Changes on
55 changes detected
--- a/accessibility.md
+++ b/accessibility.md
@@ -14,13 +14,24 @@
If you combine methods, Claude Code applies the [`--ax-screen-reader`](</docs/en/cli-reference#cli-flags>) flag over the [`CLAUDE_AX_SCREEN_READER`](</docs/en/env-vars#variables>) environment variable, and the variable over the [`axScreenReader`](</docs/en/settings-reference#axscreenreader>) setting. If you use Claude Code over SSH, set the environment variable or setting on the remote machine where Claude Code runs. The first line Claude Code prints confirms the mode: `[Screen Reader Mode: on via flag]`, `[Screen Reader Mode: on via env]`, or `[Screen Reader Mode: on via settings]`.
+###
+
+
+
+Project settings can’t turn on screen reader mode
+
+The startup line `Screen reader mode is off: project settings can't turn it on` means the project asked for screen reader mode and nothing else turns it on. Claude Code ignores both the `axScreenReader` key and a `CLAUDE_AX_SCREEN_READER` value under `env` in the project’s `.claude/settings.json` and `.claude/settings.local.json`, whatever their value.
+
+ * **To turn the mode on** : start Claude Code with `--ax-screen-reader`, set `CLAUDE_AX_SCREEN_READER` to `1` in your shell, or add `"axScreenReader": true` to your user [settings file](</docs/en/settings>) and restart Claude Code. You don’t need to change the project’s files. Once you turn the mode on, the confirmation line appears at startup instead.
+ * **If you don’t use a screen reader** : you don’t need to do anything. To stop the line from appearing, add `"axScreenReader": false` to your user settings file, or remove the `axScreenReader` key and the `CLAUDE_AX_SCREEN_READER` variable from the project’s settings files.
+
##
Turn off screen reader mode
-Reverse whichever method turned the mode on: start without the flag, unset the environment variable, or set `axScreenReader` to `false`. If you set `CLAUDE_AX_SCREEN_READER` to `0`, Claude Code keeps the mode off even when the setting is `true`.
+Reverse whichever method turned the mode on: start without the flag, unset the environment variable, or set `axScreenReader` to `false` in your user settings file. If you set `CLAUDE_AX_SCREEN_READER` to `0`, Claude Code keeps the mode off even when the setting is `true`.
##
--- a/agent-teams.md
+++ b/agent-teams.md
@@ -274,7 +274,12 @@
Permissions
-Teammates start with the lead’s permission mode, except [`dontAsk` mode](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>), which they don’t inherit. If the lead runs with `--dangerously-skip-permissions`, all teammates do too. After spawning, you can change an individual teammate’s permission mode, but you can’t set per-teammate permission modes at spawn time. Teammate permission prompts appear in the lead session, so approve them there yourself. You don’t need to approve a teammate’s plan.
+Teammates start with the lead’s permission mode, except [`dontAsk` mode](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>), which they don’t inherit. If the lead runs with `--dangerously-skip-permissions`, all teammates do too. After spawning, you can change an individual teammate’s permission mode, but you can’t set per-teammate permission modes at spawn time. An in-process teammate runs under the lead’s live allow and deny rules, so [`--disallowedTools`](</docs/en/cli-reference#cli-flags>), `--tools`, and `--allowedTools` all apply to it. For a split-pane teammate, check each flag:
+
+ * **`--disallowedTools` and `--tools`**: the teammate starts with the lead’s command-line deny rules and tool list. Requires Claude Code v2.1.309 or later.
+ * **`--allowedTools`** : Claude Code doesn’t pass this flag to a split-pane teammate, so an action you allowed with it alone isn’t pre-approved there. To approve those actions ahead of time, put the rules under `permissions.allow` in [`--settings`](</docs/en/settings#change-a-setting-for-one-session>) when you start the lead. For example, run `claude --settings '{"permissions":{"allow":["Bash(npm *)"]}}'` in your shell. The rules apply to the lead and each split-pane teammate for that session.
+
+Teammate permission prompts appear in the lead session, so approve them there yourself. You don’t need to approve a teammate’s plan.
####
Show diff (104 lines)
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,101 @@
This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Longer releases are grouped by type of change, with long lists of improvements and bug fixes collapsed. Run `claude --version` to check your installed version.
+
+
+
+2.1.309
+
+October 22, 2026
+
+**Added**
+
+ * [VSCode] Added a log warning that says what to do when dictation or the extension’s own requests fail certificate verification, such as behind a TLS-inspecting proxy
+
+**Changed**
+
+ * Updated the bundled dataviz skill to accept APCA as a text-contrast measure (keeping WCAG 2 ratios where AA conformance is required), add an `apca(text, background)` function to its palette validator scripts, and say whether a label inside a colored chart fill should be white or near-black
+ * Updated the /claude-api skill: service account keys and Workload Identity Federation tokens can now manage OpenTelemetry destinations
+ * Changed `sed -i` to get the standard Bash prompt and run as written, not a simulated file-edit preview; like other Bash edits, it is no longer restored by `/rewind`
+ * Changed `claude ultrareview` to require workspace trust: it asks on a terminal, else refuses; scripts pass `--trust-workspace`, which takes no value (put a PR number or base branch before it), or set `CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK=1`
+ * Changed the dangerous `rm` and `rmdir` prompt in bypass permissions mode in the Desktop app and VS Code to deny the command at once with a rewrite hint, so unattended sessions keep going
+ * Changed commands the settings exclude from the sandbox to ask before writing to its write-list paths while the sandbox is enabled but cannot run; the unsandboxed fallback is refused there
+ * Changed worktree creation and reuse so git no longer fetches objects on demand, in ordinary clones and in partial clones with a Bash sandbox configured; such a partial clone fetches them first
+ * Changed the `/claude-api` skill to build Managed Agents subagent teams on `multiagent_20261001` with dynamic workflows on by default, instead of `coordinator`
+
+Show 8 improvements
+
+ * Improved the speed of many git commands Claude Code runs for itself on Windows; on every platform, errors from those commands now show in English even when git is set to another language
+ * Improved the error when a hooks module is nested too deep to load: it now names the file instead of showing a bare stack-overflow message
+ * Improved disk-full handling: a Bash command cut off by a full disk now says so and names the folder to free up, and starting on a full temp volume prints a clear message, not a raw ENOSPC error
+ * Improved the /claude-api skill to offer API tracing alongside SDK tracing when asked to add OpenTelemetry
+ * Improved the /claude-api skill to check the live docs before saying a feature is unsupported
+ * Self-hosted runner: Improved sessions that move to a new runner: Claude now sees the tool call that was interrupted, marked as outcome unknown
+ * [VSCode] Improved Edit and Write speed in the chat panel: the wait for new problems after each edit is now 0.75 seconds in most cases, down from 1 to 1.5 seconds
+ * [Cloud sessions] Improved a cloud session’s Changes pane, which now says when it lists only pushed commits or only Claude’s edits
+
+Show 62 bug fixes
+
+ * Fixed sandboxed Bash commands on macOS and Linux running the shell’s startup files outside the sandbox before each command
+ * Fixed macOS sandbox `denyWrite` glob patterns not applying at a path’s real location when the pattern’s folder is reached through a symlink
+ * Fixed sandboxed commands and auto-accepted edits being able to modify the MCP config file passed with `--mcp-config`
+ * Fixed a disabled MCP server being reconnected by a later permission prompt in print and SDK sessions
+ * Fixed the Bash permission check trusting a variable set by a command whose redirect can fail to open
+ * Fixed Bash permission checks not prompting for some compound commands that change directory before running git when the `cd` is wrapped or prefixed, as they do for a plain `cd`
+ * Fixed an `Edit(path)` deny rule not blocking a Bash redirect to that path in some commands that also held a subshell
+ * Fixed worktree-isolated sessions accepting some locale-prefixed commands the isolation guard should refuse
+ * Fixed worktree-isolated sessions on zsh accepting some arithmetic commands that the isolation guard should refuse
+ * Fixed worktrees and branch checkouts that Claude Code creates so they ignore git replace refs, as its other git operations already do
+ * Fixed profile store write protection not applying when the config directory is reached through a symlink
+ * Fixed sessions compacting repeatedly after reading files under a very large nested CLAUDE.md; a nested CLAUDE.md over the size limit now loads only its start
+ * Fixed ctrl+enter (send now) only queuing a message when pressed before the response had started, and restarting a prompt’s hooks while leaving the message queued when pressed while those hooks were running
+ * Fixed key-bound slash commands running in the shell from `!` mode
+ * Fixed ctrl+o not showing messages from other agents and sessions that are still waiting to be delivered; they now appear in full under the transcript, marked as waiting
+ * Fixed long tool output previews being cut through an emoji, leaving session transcripts that `jq` could not parse
+ * Fixed Read reporting “File does not exist” for PDF page ranges in Linux sandboxes that share the parent’s `/proc`
+ * Fixed messages from a Claude Desktop-hosted session sometimes being lost when its connection refreshed
+ * Fixed features missing from Claude Code sessions in the Claude desktop app when the terminal on the same computer was signed in to a different account or organization
+ * Fixed the `claude remote-control` status line showing `HEAD` as the branch for a folder that is not in a git repository
+ * Fixed split-pane agent teammates not inheriting the tool deny and `--tools` rules given on the leader’s command line
+ * Fixed sessions renamed with `/rename` appearing to other sessions under a generated name after a VS Code window reload or a non-interactive `--resume`
+ * Fixed the `/rewind` list showing “No code changes” for a turn that changed checkpointed files through `/code-review --fix`, a subagent or a shell command
+ * Fixed `/privacy-settings` showing an out-of-date “Help improve our AI models” value; it now also says when the setting can’t be fetched
+ * Fixed feedback saying “try again later” when your organization does not accept feedback; it now shows the server’s reason and where to report a bug
+ * Fixed oversized /feedback reports failing instead of being resent without the transcript
+ * Fixed a skill in an `--add-dir` folder being unreachable when another skill already held its name; it is now offered as `<folder>:<name>`
+ * Fixed `/verify` and `/code-review` not finding a nested package’s own skill when its files were changed from the shell
+ * Fixed the /claude-api skill saying that `ant beta:worker poll --on-work` passes trace context to the command
+ * Fixed the /claude-api skill’s C# tracing setup missing spans from the cloud platform clients
+ * Fixed the /claude-api skill saying that API spans for requests to Claude Platform on AWS can’t join the caller’s trace
+ * Fixed hooks that run in PowerShell not blocking when the hook’s program exits with code 2, and on Windows `PreToolUse` and `PermissionRequest` hooks with `"shell": "powershell"` failing open when Git for Windows isn’t installed
+ * Fixed a mod’s `turn.step` hook that names a model by alias, such as `haiku`, failing every request with a model error: the alias now resolves to its model
+ * Fixed plugins and skills synced from claude.ai being removed, sometimes mid-session, after a disk read error
+ * Fixed artifact publishes and updates being refused for some ordinary pages, such as pages with certain minified scripts or artifacts Claude could not read first
+ * Fixed Claude asking for permission on each artifact update for the rest of a turn after the conversation was compacted in that turn
+ * Fixed fine-grained tool streaming staying off on Amazon Bedrock when `ANTHROPIC_BEDROCK_BASE_URL` is set to the default `bedrock-runtime.<region>.amazonaws.com` endpoint
+ * Fixed the “Waiting for API response” hint flickering behind gateways that send only keepalive pings: routes off Anthropic’s backend now wait 45 seconds
+ * Fixed Claude notifying unrelated GitHub users by writing role names and placeholders as mentions in PRs, issues and comments
+ * Linux: Fixed sandbox write denies lifting when a background command outlived the session
+ * Windows: Fixed PowerShell permission checks auto-approving some `Set-Location` or `cd` commands that target the current directory and carry extra arguments; these now prompt for approval
+ * macOS: Fixed the “Install Command Line Developer Tools” dialog opening each time Claude Code starts on a Mac without Xcode or the Command Line Tools
+ * Self-hosted runner: Fixed `--startup-timeout-min` stopping a session whose first prompt, such as `/code-review`, was still working in a subagent; a frozen process is still stopped
+ * [VSCode] Fixed the Claude panel staying blank after the editor cached an incomplete copy of its files; it now recovers by itself, or says what went wrong and how to fix it
+ * [VSCode] Fixed Session history filling up with empty “Untitled” sessions each time you start a new session without sending a message
+ * [VSCode] Fixed long slash-command messages such as `/goal` filling the chat panel; they now fold behind Show more like other prompts (anthropics/claude-code#97469)
+ * [VSCode] Fixed long messages not folding behind Show more after the chat panel is made narrower
+ * [VSCode] Fixed Ctrl+J in the chat input always inserting a newline: it is now left to VS Code and the OS when “ctrl+j” is set to null in the Chat context of ~/.claude/keybindings.json
+ * [VSCode] Fixed a mod’s “From the … plugin” label above the prompt being drawn over the slash command and @-mention menus (anthropics/claude-code#102981)
+ * [VSCode] Fixed an empty list item, paragraph or code block, and list items renumbered from 1, when pasting copied LaTeX math
+ * [VSCode] Fixed the feedback error showing only an HTTP status when your organization does not accept feedback
+ * [Cloud sessions] Fixed the Add connector list in routine forms saying no connectors were available while they were still loading
+ * [Cloud sessions] Fixed the cloud environment editor shuffling environment variables and adding backslashes to values that contain both kinds of quote
+ * [Cloud sessions] Fixed the self-hosted environment details dialog in admin settings so its title, tabs and buttons stay in view while only the content scrolls
+ * [Cloud sessions] Fixed the “read documentation” tool row in cloud sessions, which showed escaped JSON instead of a readable page
+ * [Claude Tag] Fixed Claude in Slack posting a draft you approved for a channel into your DM by mistake; a post with no channel is now refused so it can go to the approved channel
+ * [Claude Tag] Fixed Allow and Deny on Claude’s approval cards in Slack doing nothing when the session had stopped; your answer now restarts the session
+ * [Claude Tag] Fixed Claude ignoring untagged messages in a Slack channel after its workspace moved to a different Claude organization, including unshared channels on Enterprise Grid
+ * [Claude Tag] Fixed Claude in a Slack channel posting a threaded reply before reading a newer message someone had just added to that thread
+ * [Claude Tag] Fixed the Slack page in Claude Tag admin settings saying no workspaces were connected when the list failed to load; it now shows an error with a Retry button
+ * [Code Review] Fixed a finished review showing no check on the pull request when earlier tries to create it failed; a final try now adds a completed check
+ * [Code Review] Fixed a push queued behind a running review still starting a review after `@claude review stop`; its check now closes and says why
--- a/checkpointing.md
+++ b/checkpointing.md
@@ -93,13 +93,7 @@
Bash command changes not tracked
-Checkpointing does not track files modified by Bash commands. For example, if Claude Code runs:
-
- rm file.txt
- mv old.txt new.txt
- cp source.txt dest.txt
-
-These file modifications cannot be undone through rewind. Only direct file edits made through Claude’s file editing tools are tracked.
+Once Claude has edited a file with its file editing tools in your conversation, `/rewind` undoes changes that Bash commands make to that file afterward. A file that only Bash commands changed isn’t tracked and stays as it is. To revert it, use version control, such as Git. Under each prompt, the rewind menu counts changes to files Claude had already edited, whatever made them. A prompt where a shell command changed such a file lists file changes too.
###
@@ -110,7 +104,7 @@
A [subagent](</docs/en/sub-agents>) makes edits with Claude’s file editing tools, but Claude Code usually doesn’t capture those edits in your session’s checkpoints. Whether rewinding restores them depends on how the subagent runs:
* **Foreground forked skill** : a [skill with `context: fork`](</docs/en/skills#run-skills-in-a-subagent>) that runs in the foreground edits your working tree during your own turn, so rewinding restores its edits as usual. Set `background: false` to run a fork in the foreground; a few situations, [listed on the skills page](</docs/en/skills#run-skills-in-a-subagent>), run it there regardless of the setting.
- * **Any other subagent** : rewinding restores only the files Claude had already edited in your conversation. The subagent’s edits to other files stay, so use git to revert them. This includes a forked skill that runs in the background, the default, and a background [`/code-review --fix`](</docs/en/code-review-local>) run.
+ * **Any other subagent** : rewinding restores only the files Claude had already edited in your conversation. The subagent’s edits to other files stay, so use version control, such as Git, to revert them. This includes a forked skill that runs in the background, the default, and a background [`/code-review --fix`](</docs/en/code-review-local>) run.
###
modified
Claude apps gateway for Amazon Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry
View current →
--- a/claude-apps-gateway.md
+++ b/claude-apps-gateway.md
@@ -414,6 +414,24 @@
Under the default first-wins setting, an admin value blocks the parent’s only when it sits in the highest-priority admin source, except for `allowedMcpServers` while the MCP server lock is on. Under the `managedSourcesBehavior` merge opt-in, [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s value applies instead.
+####
+
+
+
+How hook and skill keys in parent settings take effect
+
+If you pass `disableAllHooks: true` as a parent setting through the Agent SDK’s `managedSettings` option, not every hook stops. Your [SDK hook callbacks](</docs/en/agent-sdk/hooks>) still run, and so do the administrator’s hooks, which your application can’t switch off. On a machine where an administrator deploys managed settings, Claude Code ignores parent settings unless the administrator [lets an embedding host add policy](</docs/en/managed-settings#let-an-embedding-host-add-policy>).
+
+What you pass| What happens
+---|---
+`disableAllHooks: true`| Treated as `allowManagedHooksOnly: true`, so the hooks listed as [blocked under `allowManagedHooksOnly`](</docs/en/settings-reference#what-runs-under-allowmanagedhooksonly>) stop, and so do hooks in the SDK’s [`settings` option](</docs/en/agent-sdk/typescript#options>).
+[`disableSkillShellExecution: true`](</docs/en/settings-reference#disableskillshellexecution>)| Takes effect.
+`allowedHttpHookUrls: []`| Takes effect unless the administrator defines `hooks` or enables a plugin. No HTTP hook runs, except for URLs another settings source lists.
+`httpHookAllowedEnvVars: []`| Takes effect unless the administrator defines `hooks` or enables a plugin. HTTP hook headers can include only environment variables another settings source lists.
+`allowedHttpHookUrls` or `httpHookAllowedEnvVars` with entries| Claude Code ignores it, since merging would widen an administrator’s list. Use the SDK `settings` option instead.
+
+Passing these keys in `managedSettings` requires Claude Code v2.1.309 or later, or TypeScript Agent SDK v0.3.309 or later.
+
###
--- a/claude-apps-gateway-deploy.md
+++ b/claude-apps-gateway-deploy.md
@@ -192,12 +192,24 @@
Keep `API_TIMEOUT_MS` above the gateway’s time to first byte
-If you lower [`API_TIMEOUT_MS`](</docs/en/network-config#streaming-idle-watchdogs>) to retry an unanswered request sooner, keep it above the time the gateway takes to send the first bytes of a streaming response. A request that waits longer times out, and so does each retry that waits as long, until the turn ends with `Request timed out`.
+If you lower [`API_TIMEOUT_MS`](</docs/en/network-config#streaming-idle-watchdogs>) to retry an unanswered request sooner, keep it above the time the gateway takes to send the first bytes of a streaming response. A request that waits longer times out, and so does each retry that waits as long, until the turn ends with `Request timed out` unless the first-byte deadline ends it.
* **`provider: anthropic`** : set `API_TIMEOUT_MS` above the longest time your upstream takes to send its first event.
* **Every other upstream** : set it more than 20 seconds above the longest time your upstream takes to return response headers. The gateway sends its first keepalive `ping` about 15 seconds after those headers, unless the upstream’s first event comes sooner. A gateway older than v2.1.229 sends no pings, so use the `provider: anthropic` rule there.
On top of that time, allow for any wait for a free slot and for the wait on a down upstream before [failover](</docs/en/claude-apps-gateway-config#multiple-upstreams>). Keep the value above the longest [non-streaming request](</docs/en/network-config#streaming-idle-watchdogs>) too.
+
+###
+
+
+
+Retry an unanswered request sooner with the first-byte deadline
+
+To make Claude Code retry an unanswered streaming request sooner, give it a first-byte deadline by setting [`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`](</docs/en/env-vars>) on your developers’ machines. The deadline limits how long the first attempt waits for response headers. Without it, that attempt can wait 5 to 6 minutes. Requires Claude Code v2.1.307 or later on the developer’s machine. Set the variable to a positive whole number of milliseconds, in a gateway policy’s `env` block or a developer’s shell. Keep the value above your gateway’s longest time to first byte, or Claude Code can abort and re-send healthy requests whose headers take longer. This example sets 60 seconds in a developer’s shell:
+
+ export CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS=60000
+
+An unanswered re-send can wait 5 to 6 minutes, until the [body idle timeout](</docs/en/network-config#streaming-idle-watchdogs>) ends it and Claude Code retries it within the [retry budget](</docs/en/errors#tune-retry-behavior>). If you lowered `API_TIMEOUT_MS` only to retry sooner, remove that value, or one unanswered re-send can end the turn with [No response from API](</docs/en/errors#no-response-from-api>). To confirm the deadline fired, have a developer start Claude Code with [debug logging](</docs/en/network-config#verify-your-configuration>), then search the log for `[first-byte] no response headers`.
###
--- a/claude-code-on-the-web.md
+++ b/claude-code-on-the-web.md
@@ -258,15 +258,15 @@
* **`/model`, `/effort`, `/color`, and `/rename`**: pass the value as an argument, for example `/model sonnet`, instead of opening the terminal picker or slider. The argument forms follow each command’s [availability notes](</docs/en/commands#all-commands>).
* **`/fast`** : toggles [fast mode](</docs/en/fast-mode#use-fast-mode-in-cloud-sessions>) for the session when fast mode is [available on your account](</docs/en/fast-mode#requirements>). Requires Claude Code v2.1.271 or later in the session’s environment.
- * **`/config`** : in your browser at claude.ai/code, opens the Claude Code section of your settings instead of setting a value, and text after the command, including `key=value`, is ignored. To change a setting for a cloud session, set an [environment variable](</docs/en/cloud-environments#set-environment-variables>) on the environment. In a session with one repository outside a [project](</docs/en/claude-projects>)’s threads, commit the key to that repository’s `.claude/settings.json` instead. [Settings in cloud sessions](</docs/en/settings#settings-in-cloud-sessions>) lists what each session reads.
-
-For context management specifically:
+ * **`/config`** : in your browser at claude.ai/code, opens the Claude Code section of your settings instead of setting a value. To change a setting for a cloud session, set an [environment variable](</docs/en/cloud-environments#set-environment-variables>) on the environment. In a session with one repository outside a [project](</docs/en/claude-projects>)’s threads, commit the key to that repository’s `.claude/settings.json` instead. [Settings in cloud sessions](</docs/en/settings#settings-in-cloud-sessions>) lists what each session reads.
+
+For context management in a cloud session outside a [project’s threads](</docs/en/claude-projects#choose-models-and-let-claude-manage-context>):
Command| Works in cloud sessions| Notes
---|---|---
`/compact`| Yes| Summarizes the conversation to free up context. Accepts optional focus instructions like `/compact keep the test output`
`/context`| Yes| Shows what’s currently in the context window
-`/clear`| No| Start a new session from the sidebar instead
+`/clear`| Yes| Starts a fresh conversation with empty context in the same cloud session
Auto-compaction runs automatically when the context window approaches capacity. Cloud sessions set [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/env-vars>) themselves, so compaction triggers partway through the [auto-compact window](</docs/en/model-config#set-the-auto-compact-window>) rather than when the window fills. That value overrides one you add in your [environment variables](</docs/en/cloud-environments#set-environment-variables>), so adding the variable there doesn’t change when compaction triggers. To change the auto-compact window instead, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) in your environment variables, or run [`/autocompact`](</docs/en/commands#all-commands>) with a token count in a session where the variable isn’t set. [Subagents](</docs/en/sub-agents>) work the same way they do locally. Claude can spawn them with the Agent tool to offload research or parallel work into a separate context window, keeping the main conversation lighter. Outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>)’s threads, subagents defined in your repo’s `.claude/agents/` load automatically. [Agent teams](</docs/en/agent-teams>) are off by default but can be enabled by adding `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` to your [environment variables](</docs/en/cloud-environments#set-environment-variables>).
--- a/claude-projects.md
+++ b/claude-projects.md
@@ -1,4 +1,4 @@
-Projects are in public beta on Pro and Max plans and rolling out gradually, starting with accounts that have used [cloud sessions](</docs/en/claude-code-on-the-web>) and don’t have existing projects in claude.ai chat or Cowork. They aren’t available on Team or Enterprise plans yet. If **Projects** doesn’t appear in the sidebar at [claude.ai/code](<https://claude.ai/code>) or in the Code tab of the [desktop app](</docs/en/desktop>), the rollout hasn’t reached your account, and you can [join the waitlist](<https://claude.com/form/projects>). [Run agents in parallel](</docs/en/agents>) lists what you can use in the meantime.
+Projects are in public beta on Pro and Max plans and rolling out gradually. The rollout started with accounts that have used [cloud sessions](</docs/en/claude-code-on-the-web>) and don’t have existing projects in claude.ai chat or Cowork. Projects aren’t offered on Team or Enterprise plans yet.If you don’t see **Projects** in the sidebar at [claude.ai/code](<https://claude.ai/code>) or in the Code tab of the [desktop app](</docs/en/desktop>), check under **More** there. If it’s missing there too, the rollout hasn’t reached your account yet. You can [join the waitlist](<https://claude.com/form/projects>), and see [Run agents in parallel](</docs/en/agents>) for what you can use in the meantime.
A project is one ongoing conversation where Claude coordinates a stream of related work for you. You tell it what needs doing and it starts a thread for each task. Each thread is usually a [cloud session](</docs/en/claude-code-on-the-web>): Claude Code running in the cloud rather than on your machine. When a task needs something only your computer has, you can ask Claude to run that thread on your computer instead of in the cloud, through [Remote Control](</docs/en/remote-control>). Threads run in parallel, and you can check on them and steer them from your phone. Cloud threads keep going after you close your laptop, while a thread on your computer runs only while that computer is awake. Without a project, running several sessions means doing the coordinating yourself: you decide what each one works on, repeat the same background at the start of each, and check back to see which finished or needs an answer. With a project, you instead:
@@ -66,7 +66,7 @@
You create and use projects at [claude.ai/code](<https://claude.ai/code>), in the Code tab of the desktop app, or in the Claude mobile app for [iOS](<https://apps.apple.com/us/app/claude-by-anthropic/id6473753684>) and [Android](<https://play.google.com/store/apps/details?id=com.anthropic.claude>). In the browser and the desktop app there are two ways to start a project:
* **From scratch** , when you know the stream of work you want Claude to run: open the **New project** dialog and name it. Start a new project from scratch walks through the dialog.
- * **From a cloud session that’s already doing the work** : choose **Continue as project** from that session’s menu, and Claude proposes the project’s setup from what the session was doing. See Start from an existing cloud session.
+ * **From a cloud session that’s already doing the work** : in that session’s sidebar menu, choose **Move to project** , then **Continue as new project**. Claude proposes the project’s setup from what the session was doing. See Start from an existing cloud session.
Either way, check the prerequisites first.
@@ -78,7 +78,7 @@
Before you create a project, check your plan, your GitHub setup, and what the work needs to reach:
- * **Plan** : you’re on Pro or Max and **Projects** shows in your sidebar.
+ * **Plan** : you’re on Pro or Max, and **Projects** shows in your sidebar, directly or under **More**. Select **Projects** and check that it offers **New project** or **Get started**.
* **GitHub, if the project will work on code** : your code is on github.com rather than GitHub Enterprise Server, GitLab, or Bitbucket, your connected GitHub account has push access to it, and the Claude GitHub App is installed on it. If you connected GitHub with [`/web-setup`](</docs/en/web-quickstart#connect-from-your-terminal>), that token lets your other cloud sessions reach a repository but isn’t enough for a project’s cloud threads, which need the Claude GitHub App. Set up GitHub access has the steps.
* **Network access, secrets, and tools** : for cloud threads, these come from the project’s cloud environment. The default environment already reaches [common package registries](</docs/en/cloud-environments#default-allowed-domains>), so check this only if the work needs other domains, a secret, or a tool that isn’t preinstalled. If the work needs an MCP server, check that it shows as connected in your [claude.ai connectors](<https://claude.ai/customize/connectors>).
@@ -94,7 +94,7 @@
Open Projects
-At [claude.ai/code](<https://claude.ai/code>) or in the Code tab of the desktop app, select **Projects** in the left sidebar, then select **New project**. In a browser you can also go straight to [claude.ai/code/projects/browse](<https://claude.ai/code/projects/browse>).
+At [claude.ai/code](<https://claude.ai/code>) or in the Code tab of the desktop app, select **Projects** in the left sidebar, or under **More** there. In a browser you can also go straight to [claude.ai/code/projects/browse](<https://claude.ai/code/projects/browse>). Then select **New project**. If the button reads **Get started** instead, select it and first upgrade or archive the existing claude.ai projects it lists.
2
@@ -125,12 +125,12 @@
Start from an existing cloud session
-If you already have a cloud session doing work that belongs in a project, open the session’s menu in the sidebar and choose **Continue as project** or **Move to project** :
-
- * **Continue as project** creates a new project named after the session and opens it. Claude reads the session and posts **Setup recommendations** in the conversation for you to confirm. The original session stays in your session list, and if it was in the middle of a turn it keeps running, so stop it yourself if you don’t want both working at once. If you use the **Set up project** banner that can appear above a cloud session’s message box instead, the result is the same, except that the session’s running turn stops once the project opens.
- * **Move to project** brings the session’s work into an existing project. It posts a message in that project’s conversation asking Claude to read the session and pick up where it left off, and new work continues in the project’s own threads. The original session stays in your session list, unchanged.
-
-A local session doesn’t have these options. To continue its work in a project, describe the work in the project conversation, or push its branch, add that repository to the project, and name the branch in the task.
+If a cloud session you started yourself is doing work that belongs in a project, open its sidebar menu and choose **Move to project** , then pick from the submenu:
+
+ * Choose **Continue as new project** to create a new project from the session. The project opens, and Claude reads the session and posts **Setup recommendations** in the project conversation for you to confirm. The original session stays in your session list. If it was in the middle of a turn it keeps running, so stop it yourself if you don’t want both working at once.
+ * Choose one of your existing projects to bring the session’s work into that project. That project opens, and a message sent on your behalf asks Claude to read the session and pick up where it left off. The original session stays in your session list, unchanged.
+
+A **Set up project** banner can also appear above a cloud session’s message box. If you use it instead of **Continue as new project** , the result is the same, except that the session’s running turn stops once the project opens. A local session doesn’t have these options. To continue its work in a project, describe the work in the project conversation, or push its branch, add that repository to the project, and name the branch in the task.
###
@@ -512,7 +512,7 @@
Several Claude Code features let more than one session work at the same time, so running work in parallel is not by itself what a project is for. In a project, Claude starts and tracks the sessions instead of you, and each one starts from the same instructions. This is how each neighboring feature connects to a project:
* **Claude Tag** : [Claude Tag](<https://claude.com/docs/claude-tag/overview>) is Claude in your team’s Slack channels, on Team and Enterprise plans. Anyone in a channel can give it work, everyone in the channel sees and steers it, and it uses connections an admin set up for that channel. A project is yours alone: you’re the only one who sends it work or sees its threads, it uses your own GitHub access and connectors, and it’s on Pro and Max. [How Claude Tag differs from Cowork and Claude Code](<https://claude.com/docs/claude-tag/concepts/how-it-works#how-claude-tag-differs-from-cowork-and-claude-code>) has the side-by-side.
- * **Cloud sessions** : every thread is a [cloud session](</docs/en/claude-code-on-the-web>) unless you ask Claude to run it on your machine. Either way, Claude starts and tracks it instead of you. A cloud session you started yourself can become a project or feed one through **Continue as project** or **Move to project**.
+ * **Cloud sessions** : every thread is a [cloud session](</docs/en/claude-code-on-the-web>) unless you ask Claude to run it on your machine. Either way, Claude starts and tracks it instead of you. You can also bring the work of a cloud session you started yourself into a project: choose **Move to project** in that session’s sidebar menu.
* **Scheduled tasks** : when you ask for scheduled work in a project, Claude creates a [cloud scheduled task](</docs/en/routines>) that runs as threads in that project and appears on its **Scheduled tasks** tab. Scheduled tasks you create outside a project keep working on their own.
* **Remote Control** : [Remote Control](</docs/en/remote-control>) connects claude.ai to a Claude Code session running on your machine. When you ask Claude in a project to run a thread on your computer, the project uses Remote Control to do it.
* **Local sessions and agent view** : a session you start yourself in your terminal, IDE, or the desktop app’s local environment can’t be added to a project. [Agent view](</docs/en/agent-view>) is a screen for tracking several local sessions side by side, and you still start each one and give it its task yourself.
--- a/cloud-environments.md
+++ b/cloud-environments.md
@@ -58,7 +58,7 @@
* **Add an environment** : select **New environment** at the bottom of the menu to open the **New environment** dialog. Fill in the form and select **Add environment**. Your new session then uses the environment you added.
* **Edit an environment** : find its row under **Cloud**. If **Cloud** is a single row, select it to open the list. If your environment isn’t listed under **Cloud** , select the **More** row under that heading. Hover over the environment’s row and select the settings icon that appears on its right to open its dialog.
-The dialog includes the name, network access level, environment variables, and setup script. To store a key that sessions use without seeing it, see Add network secrets.
+When you add an environment or edit one of your own, select the dialog’s **Network access**, **Setup script**, or **Environment variables** row to open that setting. After your last change, save with **Add environment** for a new environment or **Save changes** for an existing one. To store a key that sessions use without seeing it, see Add network secrets.
###
@@ -96,7 +96,7 @@
These requirements decide whether you can add a secret and whether the agent proxy can use it once added:
* **Role** : on Pro, Max, and Team plans, you can add and delete secrets on your own environments whatever your role. On Team and Enterprise, Owners hold an organization admin role in your claude.ai organization and Admins don’t, which changes what you see in these cases:
- * **Your own environment on Enterprise** : with an organization admin role, you add and delete secrets. Without it, the **Network secrets** section lists the secrets under the note “Only an organization admin can add or delete network secrets”, with no **Add secret** or delete button. Ask an Owner to add the secret to a shared environment, then run your sessions there
+ * **Your own environment on Enterprise** : with an organization admin role, you add and delete secrets. Without it, the **Network secrets** row opens the secrets list with the note “Only an organization admin can add or delete network secrets” and no **Add secret** or delete button. Ask an Owner to add the secret to a shared environment, then run your sessions there
* **A shared environment** : Owners add and delete its secrets from admin settings. Without an organization admin role, ask an Owner to add the secret, because the environment’s dialog has no **Network secrets** section
* **Your own environment on Team** : without an organization admin role, **Add secret** opens a shorter form that takes one host
* **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have network secrets
@@ -109,13 +109,13 @@
Add a secret
-You add secrets one at a time, and you can’t edit a secret after you add it. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), then continue step 1 from the **Network secrets** section. If you’re on a Team plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form.
+You add secrets one at a time, and you can’t edit a secret after you add it. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), then continue from step 2 in its **Network secrets** section. If you’re on a Team plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form.
1
Open the environment's network secrets
-Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit cloud environment** dialog, find the **Network secrets** section. You see the secrets already on the environment, each with the hosts it applies to.
+Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit cloud environment** dialog, select the **Network secrets** row. You see the secrets already on the environment, each with the hosts it applies to.
2
@@ -143,7 +143,7 @@
Add a secret on a Team plan without an organization admin role
-If you’re on a Team plan and don’t hold an organization admin role, the **Add secret** form takes one secret for one host. Select **Add secret** in your environment’s **Network secrets** section, fill in these fields, then select the form’s **Add secret** button:
+If you’re on a Team plan and don’t hold an organization admin role, the **Add secret** form takes one secret for one host. Select your environment’s **Network secrets** row and then **Add secret**. Fill in these fields and select the form’s **Add secret** button:
* **Host** : the one host that gets the secret, such as `api.example.com`. The form doesn’t accept a `*.` wildcard
* **Name** : an optional label for the secret
@@ -472,7 +472,15 @@
Setup scripts
-A setup script is a Bash script that runs when a new cloud session starts, before Claude Code launches. Use setup scripts to install dependencies, configure tools, or fetch anything the session needs that isn’t pre-installed. Scripts run as root on Ubuntu 24.04, so `apt install` and most language package managers work. To add a setup script, open the environment settings dialog and enter your script in the **Setup script** field. This example installs [ShellCheck](<https://www.shellcheck.net/>), which isn’t pre-installed.
+A setup script is a Bash script that runs when a new cloud session starts, before Claude Code launches. Use setup scripts to install dependencies, configure tools, or fetch anything the session needs that isn’t pre-installed. Scripts run as root on Ubuntu 24.04, so `apt install` and most language package managers work.
+
+###
+
+
+
+Add a setup script
+
+To add a setup script to your own environment, you can type or paste it, or load a text file such as `setup.sh`. Add or edit the environment and select the **Setup script** row. Enter the script in the box that opens, or select **Choose file** to replace the box’s contents with the text of a file up to 64 KB. Then select **Add environment** or **Save changes**. This example installs [ShellCheck](<https://www.shellcheck.net/>), which isn’t pre-installed.
#!/bin/bash
apt update && apt install -y shellcheck
--- a/code-review.md
+++ b/code-review.md
@@ -99,7 +99,7 @@
Who controls a review
- * **Who can start one** : where reviews run automatically, opening or pushing to a pull request starts a review, [except on drafts and forks](</docs/en/code-review-pull-requests#review-drafts-and-pull-requests-from-forks>). A [comment command](</docs/en/code-review-pull-requests#comment-commands>) starts one only when it comes from a person with write access to the repository.
+ * **Who can start one** : where reviews run automatically, opening or pushing to a pull request starts a review, [except on drafts and forks](</docs/en/code-review-pull-requests#review-drafts-and-pull-requests-from-forks>). After some pushes, Code Review [keeps the earlier result](</docs/en/code-review-pull-requests#when-a-push-keeps-the-earlier-result>) instead. A [comment command](</docs/en/code-review-pull-requests#comment-commands>) starts one only when it comes from a person with write access to the repository.
* **Which instructions it follows** : `REVIEW.md` from the base or default branch and [never from the pull request’s own changes](</docs/en/code-review-customize#which-branch-review-md-is-read-from>).
##
--- a/code-review-pull-requests.md
+++ b/code-review-pull-requests.md
@@ -45,7 +45,25 @@
🔴 Important| `src/auth/session.ts:142`| Token refresh races with logout, leaving stale sessions active
🟡 Nit| `src/auth/session.ts:88`| `parseExpiry` silently returns 0 on malformed input
-A finding that has a line but wasn’t posted as an inline comment appears as an annotation in the **Files changed** tab, on the lines concerned. Important findings show in red, nits in yellow, and pre-existing bugs in gray. The check run concludes as neutral, or as skipped when an automatic review didn’t run because a push changed no files. It never concludes as a failure, so a finished review doesn’t fail a required check. If you don’t see findings, or a review didn’t run, see [Troubleshoot Code Review](</docs/en/code-review-troubleshooting>).
+A finding that has a line but wasn’t posted as an inline comment appears as an annotation in the **Files changed** tab, on the lines concerned. Important findings show in red, nits in yellow, and pre-existing bugs in gray. The check run concludes as neutral, or as skipped after some pushes that change no files and keep the earlier result. It never concludes as a failure, so a finished review doesn’t fail a required check. If you don’t see findings, or a review didn’t run, see [Troubleshoot Code Review](</docs/en/code-review-troubleshooting>).
+
+###
+
+
+
+When a push keeps the earlier result
+
+If the check run has one of these titles after you push, Code Review kept the result of an earlier review instead of starting a new one:
+
+ * **Code review skipped — no new changes** : no Important finding from the earlier review is still open, so you don’t need a new review
+ * **Code review not repeated — earlier findings still open** : to start a new review, push a fix for an open Important finding, or resolve its thread and push again
+
+On github.com, Code Review can keep a result when both of these hold:
+
+ * The pull request still adds and removes the same lines, as after an empty commit, a clean merge of the base branch, or a clean rebase
+ * Nobody has resolved an Important finding’s thread since that review
+
+To get a review without a code change, comment `@claude review` or click **Re-run** on the check run.
###
@@ -67,6 +85,8 @@
gh api repos/OWNER/REPO/commits/<commit-sha>/check-runs --jq '.check_runs[] | {id, name}'
+If the commit has had more than one `Claude Code Review` run, such as after a **Re-run** , GitHub lists only the newest.
+
2
Read the severity counts
@@ -78,14 +98,16 @@
| scan("^<!-- bughunter-severity: (.*) -->$")[0] | fromjson)?
// error("no severity line")'
-This prints a JSON object with a count per severity and its keys in alphabetical order, for example `{"nit": 1, "normal": 2, "pre_existing": 0}`. The counts include findings from earlier reviews of the pull request whose threads are still open.
+This prints a JSON object with a count per severity and its keys in alphabetical order, for example `{"nit": 1, "normal": 2, "pre_existing": 0}`. Except on a check run that kept an earlier result, the counts include findings from earlier reviews of the pull request whose threads are still open.Under the title `Code review skipped — no new changes`, the counts leave out nits and pre-existing findings from earlier reviews that are still open. No Important finding from the earlier review is still open then.
3
Act on the result
-Have your script handle these cases:
+Have your script handle these cases in order:
+ * **The title starts with`Code review not repeated`**: Code Review kept an earlier result whose Important findings are still open, and the check run has no severity line. Read the title before the counts, with `gh api repos/OWNER/REPO/check-runs/CHECK_RUN_ID --jq .output.title`. Fail the job if you want to gate the merge.
+ * **The title ends with`no new changes`**: let the job pass without reading the counts
* **`normal` is above zero**: fail the job if you want to gate the merge. The `normal` key holds the count of Important findings, so Claude found at least one bug worth fixing before merge. To print only that count, add `| .normal` before the closing single quote.
* **The line is missing** : the command prints an error that contains `no severity line` instead of counts, and exits with a non-zero status. Treat that as no verdict rather than as zero findings. A check run for a review that failed, timed out, was canceled, or was superseded by a newer one has no such line, and some completed reviews have none either.
@@ -99,8 +121,8 @@
* **Open it or mark it ready** : in a repository set to **Once after PR creation** or **After every push** , a review starts when you open or reopen the pull request, or mark a draft ready for review.
* **Comment a command** : post `@claude review` on the pull request.
- * **Push a commit** : a push starts a review in a repository set to **After every push** , or on a pull request you subscribed with `@claude review always`.
- * **Click Re-run** : after a review fails or times out on a pull request that isn’t from a fork, [run it again](</docs/en/code-review-troubleshooting#retrigger-a-failed-or-timed-out-review>) from the check run.
+ * **Push a commit** : a push starts a review in a repository set to **After every push** , or on a pull request you subscribed with `@claude review always`. If your pull request still adds and removes the same lines after the push, Code Review can keep the earlier result instead.
+ * **Click Re-run** : after a review fails or times out on a pull request that isn’t from a fork, [run it again](</docs/en/code-review-troubleshooting#retrigger-a-failed-or-timed-out-review>) from the check run. On a pull request that isn’t from a fork, you can also click **Re-run** after a push that kept the earlier result.
* **Wait for the automatic retry** : a review whose session was interrupted is retried once automatically. The [check run’s summary](</docs/en/code-review-troubleshooting#retrigger-a-failed-or-timed-out-review>) says when that’s happening.
###
@@ -114,7 +136,7 @@
Command| What it does| When to use it
---|---|---
`@claude review`| Starts a single review without subscribing the PR to future pushes| You want one review now, such as on a pull request in a repository set to **Manual** , or another review right away in the other modes
-`@claude review always`| Starts a review and subscribes the PR to push-triggered reviews going forward| You want every subsequent push to start a fresh review, such as on a high-priority PR in a repository set to **Manual**
+`@claude review always`| Starts a review and subscribes the PR to push-triggered reviews going forward| You want subsequent pushes to start reviews, such as on a high-priority PR in a repository set to **Manual**
`@claude review once`| Same as `@claude review`: starts a single review without subscribing| The same cases as `@claude review`
`@claude review stop`| Ends the PR’s subscription to push-triggered reviews, without starting a review or canceling one that’s already running. Claude replies with a comment instead of a check run.| You subscribed a PR with `@claude review always` in a repository set to **Manual** or **Once after PR creation** , and no longer want each push to start a review
`@claude review off` or `@claude review pause`| Same as `@claude review stop`| The same cases as `@claude review stop`
--- a/code-review-troubleshooting.md
+++ b/code-review-troubleshooting.md
@@ -14,6 +14,7 @@
**Code review found no issues**| The review finished and found nothing to flag| Nothing
A title that says issues were found| The review finished with findings| If you don’t see them on the diff, see Find issues that aren’t showing as inline comments
**Code review skipped — no new changes**| An automatic review didn’t run on your latest push| To get a review anyway, comment `@claude review`
+**Code review not repeated — earlier findings still open**| An automatic review didn’t run on your latest push, and Important findings from the earlier review are still open| Push a fix, or to get a review anyway, comment `@claude review`. See [When a push keeps the earlier result](</docs/en/code-review-pull-requests#when-a-push-keeps-the-earlier-result>)
**Code review failed** or **Code review timed out**| The review didn’t finish| To run it again, see Retrigger a failed or timed-out review
**Code review declined**| The review didn’t run| Read the check run’s summary. If it names a budget or a spend limit, see Review didn’t run and the PR shows a budget message
No check run| No review started| Comment `@claude review`. If no check run appears after that, see A comment command didn’t start a review
--- a/costs.md
+++ b/costs.md
@@ -52,7 +52,9 @@
On a Pro, Max, Team, or Enterprise plan, `/usage` also shows a breakdown of what counts against your plan limits, with recommendations:
* **Attribution** : recent usage attributed to skills, subagents, plugins, and individual MCP servers, each shown as a percentage of the total. An MCP server’s share counts only the requests that consumed one of its tool results. Before v2.1.222, after one call to an MCP server, Claude Code attributed every subsequent request to that server, overstating its share.
- * **Recommendations** : changes that lower your usage, one per row. Each row starts with the share of recent usage it addresses, at least 10%, as in `25% Trim ~/code/api/CLAUDE.md · 49k tokens per request`. To have Claude Code apply the ones it can, see Apply recommendations with the fix shortcut.
+ * **Recommendations** : suggested changes, one per row. Each row starts with a share of your recent usage, at least 10%, as in `25% Trim ~/code/api/CLAUDE.md · 49k tokens per request`.
+ * **How to read the share** : it tells you how much of your usage the row applies to, not how much the change saves. One request can count toward several rows, so the shares can add up to more than 100%.
+ * **How to apply recommendations** : to have Claude Code apply the ones it can, see Apply recommendations with the fix shortcut
* **Loops** : a row for each of the heaviest [`/loop` or other session-scoped scheduled tasks](</docs/en/scheduled-tasks>) that ran recently, ordered by total tokens, with a count of the rest. Requires Claude Code v2.1.242 or later.
* **What each row reports** : how often the task fires, how many times it ran, its total and per-run tokens, and when it last ran
* **Stopped and re-created loops** : Claude Code keys a row by the task’s prompt, so a loop you stop and re-create stays one row
--- a/desktop.md
+++ b/desktop.md
@@ -589,7 +589,7 @@
* **Current layout** : in the row under the prompt box, once you select a cloud environment.
* **Earlier layout** : above the prompt box. To add another repository, click **+** beside the selected one.
-See [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>) for more on how cloud sessions work. When one body of work needs many cloud sessions, select **Projects** in the sidebar to create a [project](</docs/en/claude-projects>), where Claude starts and tracks the sessions for you from one conversation.
+See [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>) for more on how cloud sessions work. When one body of work needs many cloud sessions, use a [project](</docs/en/claude-projects>): Claude starts and tracks the sessions for you from one conversation. [Create a project](</docs/en/claude-projects#create-a-project>) has the steps.
A task in an SSH session can also keep going while Desktop is disconnected, but with a Claude account it can stop when its sign-in expires.
@@ -1179,7 +1179,7 @@
User alice
ProxyJump bastion.example.com
-Enter `devbox` in the **SSH host** field.
+Enter `devbox` in the **SSH host** field. If your administrator restricts SSH hosts, the jump host has to be on the list too. Run `ssh -G bastion.example.com` in a terminal on your computer, and ask them to allow the `hostname` that it prints.
##### Reach a container on a remote machine
@@ -1663,7 +1663,37 @@
If your organization delivers [server-managed settings](</docs/en/server-managed-settings>), set `sshHostAllowlist` there. By default, Desktop reads the key only from the [highest-ranked managed source that delivers a policy key](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). If that source leaves the key unset, Desktop ignores a list in a lower-ranked MDM policy or managed settings file and treats the key as [unset](</docs/en/settings-reference#sshhostallowlist>). Desktop shows no warning.Also keep the same list on each user’s machine, in the highest-ranked MDM policy or managed settings file there. Desktop fetches server-managed settings at launch and keeps no cached copy, so until a fetch succeeds the machine’s list is the one that applies.
-Patterns are case-insensitive. `*` matches any host, and `*.example.com` matches `example.com` and any subdomain. Anything else is an exact match. The check runs against the hostname after `~/.ssh/config` resolution via `ssh -G`, so `Host` aliases and `ProxyCommand`/`ProxyJump` entries are permitted as long as the resolved `HostName` matches. `sshHostAllowlist` is read from managed settings only; values in user or project settings are ignored. Only the Claude Desktop app honors this setting; the Claude Code CLI and IDE extensions do not read it, and it does not restrict `ssh` commands run through the Bash tool. It governs which hosts the Desktop app connects to, not network egress, so pair it with your organization’s network or zero-trust controls if you need a hard boundary.
+Patterns are case-insensitive. `*` matches any host, and `*.example.com` matches `example.com` and any subdomain. Anything else is an exact match. The check runs against the hostname after `~/.ssh/config` resolution via `ssh -G`, so a `Host` alias is permitted as long as its resolved `HostName` matches. A session’s jump hosts have to match too. `sshHostAllowlist` is read from managed settings only; values in user or project settings are ignored. Only the Claude Desktop app honors this setting; the Claude Code CLI and IDE extensions do not read it, and it does not restrict `ssh` commands run through the Bash tool. It governs which hosts the Desktop app connects to, not network egress, so pair it with your organization’s network or zero-trust controls if you need a hard boundary.
+
+##### Allow jump hosts
+
+Add each jump host that Desktop checks to `sshHostAllowlist`, by its own resolved `HostName`. Add the jump hosts before users update to Claude Desktop v3.1623.0 or later, or they can’t connect through them.
+
+The list has one kind of entry, so users can also start a session on any host that you list. List only jump hosts that you’d also let users run sessions on.
+
+Desktop checks jump hosts in the `ProxyJump` that the user’s `~/.ssh/config` sets for the session’s host, or in a `ProxyCommand` written as `ssh -W %h:%p <host>`. If one that it checks isn’t on the list when Desktop connects or reconnects a session, the connection fails. When a user starts a session or sends a message, the error’s details give that jump host’s `HostName`, which is the name to add:
+
+ SSH host "bastion.example.com" is not allowed by your organization's managed settings. It is a jump host on the way to "devbox".
+
+If the message says `managed settings on this computer`, add the name to the list on the user’s computer. If more than one jump host is missing, the error names one at a time. To find every name before users update, use a terminal on a user’s computer:
+
+1
+
+Find the route
+
+Run `ssh -G` with a host that users connect to, such as `ssh -G devbox`. Look for a `proxyjump` line, or a `proxycommand` line written as `ssh -W %h:%p <host>`. The command still counts with any of `-l`, `-p`, `-J`, `-q`, `-v`, `-N`, `-T`, `-x`, or `-a`, and the hosts after `-J` are jump hosts too. If a `proxycommand` line runs a program other than `ssh`, add nothing for it.
+
+2
+
+Look up each jump host
+
+Run `ssh -G` with each jump host on that line, without any `:port`, and note the `hostname` that it prints. If the output for the first jump host on that line has a line of either kind, repeat this step with it. Ignore such a line in a later jump host’s output.
+
+3
+
+Add the names
+
+Add each hostname, or a wildcard that covers it, to `sshHostAllowlist` in every managed source where you set a list. Then have users quit and reopen Desktop, because it fetches server-managed settings at launch.
####
@@ -1699,7 +1729,7 @@
When you adapt the example, check the hostnames, the Desktop version, and the file’s permissions:
- * **Hostnames** : make sure that a pattern in `sshHostAllowlist` matches the hostname of each `sshConfigs` entry, without `user@`, or developers can’t connect to it. For how Desktop matches a hostname, see Restrict which SSH hosts users can connect to.
+ * **Hostnames** : make sure that a pattern in `sshHostAllowlist` matches the hostname of each `sshConfigs` entry, without `user@`, or developers can’t connect to it. Also add a pattern that matches each jump host that Desktop checks on the way to it. For how Desktop matches a hostname, see Restrict which SSH hosts users can connect to.
* **Version** : `disableDesktopLocalSessions` requires Claude Desktop v1.37937.0 or later
* **File permissions** : make sure that each developer’s account on the computer can read the managed settings file. Desktop doesn’t apply the keys in a file that the account can’t read, and Claude Code [starts without them](</docs/en/managed-settings#find-entries-claude-code-dropped>) too.
@@ -1966,7 +1996,7 @@
* **Agent teams** : coordinated teams, where Claude as the team lead assigns tasks to teammates from a shared task list, are available in the [CLI](</docs/en/agent-teams>), not in Desktop. For multi-agent work inside one session, use [dynamic workflows](</docs/en/workflows>), which run in Desktop; Claude can also message and manage your other sessions directly.
* **Terminal-dialog commands** : built-in commands that open an interactive panel in the terminal behave differently in the Code tab. Edit [settings files](</docs/en/settings>) directly to manage permission rules and configuration, or run the commands from the standalone CLI.
* Commands with no argument form, such as `/permissions`, reply with `isn't available in this environment`.
- * `/config` opens Settings → Claude Code. Text after the command is ignored, so `/config theme=dark` doesn’t set the theme.
+ * `/config` opens **Settings > Claude Code**.
##
@@ -2083,7 +2113,7 @@
`SFTP doesn't start on <host>`| `[SFTP_NOT_STARTED]`| Connect to the same host with `sftp` in a terminal on your computer to see what stops it, then check the settings and files that Desktop’s message names
`<host> allows too few SSH sessions per connection`| `[SESSION_LIMIT]`| Raise `MaxSessions` in the server’s `sshd_config`, for example to OpenSSH’s default of 10
`<host> is out of disk space`| `[ENOSPC]` or `[EDQUOT]`| Free space or quota on the remote machine, in your home directory or `/tmp`
-`This computer is out of disk space`| `[ENOSPC]` or `[EDQUOT]`, in a message that starts with `Couldn't prepare the deploy locally`| Free space on your computer
+`Free up disk space on this computer`| `[ENOSPC]` or `[EDQUOT]`, in a message that starts with `Couldn't prepare the deploy locally`| Free space on your computer
`Claude Code won't start on <host>`| `[CLI_UNRESPONSIVE]`| Wait a minute, then try again. If it keeps failing, run the command that the message names on the remote machine to see whether Claude Code answers there.
For any other message, check the remote machine requirements.
--- a/desktop-scheduled-tasks.md
+++ b/desktop-scheduled-tasks.md
@@ -21,7 +21,7 @@
Persistent across restarts| Yes| Yes| Restored on `--resume`, with [exceptions](</docs/en/scheduled-tasks#limitations>)
Access to local files| No (fresh clone)| Yes| Yes
MCP servers| Connectors configured per task| [Config files](</docs/en/mcp>) and connectors| Inherits from session
-Permission prompts| No (runs autonomously)| Configurable per task| Inherits from session
+Permission prompts| [Auto mode](</docs/en/routines#permission-prompts-during-a-run>) by default| Configurable per task| Inherits from session
Customizable schedule| Yes| Yes| Yes
Minimum interval| 1 hour| 1 minute when Claude sets it, [1 hour in the forms](</docs/en/desktop-scheduled-tasks#schedule-options>)| 1 minute
--- a/env-vars.md
+++ b/env-vars.md
@@ -172,9 +172,9 @@
`CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS`| Stall timeout in milliseconds for subagents. Also covers [workflow agents](</docs/en/workflows#when-an-agent-stalls-and-restarts>) on Claude Code v2.1.286 or later. Default `600000` (10 minutes); if you raise `CLAUDE_STREAM_IDLE_TIMEOUT_MS` while the stream watchdog is on, the default rises with it, as [Handle slow or stalled API responses](</docs/en/agent-sdk/typescript#handle-slow-or-stalled-api-responses>) describes
`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`| Set the percentage (1-100) of the auto-compact window at which auto-compaction triggers. Use lower values like `50` to compact earlier; the variable can’t raise the threshold, so values above the default percentage are ignored. It applies only in sessions that [compact before the model’s context limit](</docs/en/model-config#context-window-and-auto-compaction>). Applies to both main conversations and subagents
`CLAUDE_AUTO_BACKGROUND_TASKS`| Set to `1` to force-enable automatic backgrounding of long-running agent tasks. When enabled, a [subagent](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) moves to the background after running for approximately two minutes. If Claude queued a tool call such as a file edit behind the subagent, the subagent finishes in the foreground before that call starts. Also enables [automatic backgrounding of long MCP tool calls](</docs/en/mcp#automatic-backgrounding-of-long-tool-calls>) in non-interactive mode on Claude Code v2.1.212 or later
-`CLAUDE_AX_PREPARK_MS`| In [screen reader mode](</docs/en/accessibility>), how many milliseconds Claude Code waits before it writes a new or changed line. Default `0`, so Claude Code doesn’t wait. Before v2.1.287, the default was `50`. Claude Code caps the wait at `5000`. Requires Claude Code v2.1.233 or later
-`CLAUDE_AX_SCREEN_READER`| Set to `1` to render screen-reader friendly output: flat text without decorative borders or animations. Set to `0` to force screen-reader mode off even when [`axScreenReader`](</docs/en/settings-reference#axscreenreader>) is `true`. The [`--ax-screen-reader`](</docs/en/cli-reference#cli-flags>) flag takes precedence. Requires Claude Code v2.1.181 or later
-`CLAUDE_AX_STARTUP_QUIET_MS`| In [screen reader mode](</docs/en/accessibility>), how many milliseconds Claude Code holds the first interface render after the startup confirmation line, so your screen reader can speak the line in full before new output interrupts it. Default `3000`. Set `0` to render immediately. Claude Code caps the hold at `600000` (10 minutes). Your first keystroke ends the hold early. Requires Claude Code v2.1.217 or later
+`CLAUDE_AX_PREPARK_MS`| In [screen reader mode](</docs/en/accessibility>), how many milliseconds Claude Code waits before it writes a new or changed line. Default `0`, so Claude Code doesn’t wait. Before v2.1.287, the default was `50`. Claude Code caps the wait at `5000`. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). Requires Claude Code v2.1.233 or later
+`CLAUDE_AX_SCREEN_READER`| Set to `1` to render screen-reader friendly output: flat text without decorative borders or animations. Set to `0` to force screen-reader mode off even when [`axScreenReader`](</docs/en/settings-reference#axscreenreader>) is `true`. The [`--ax-screen-reader`](</docs/en/cli-reference#cli-flags>) flag takes precedence. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). Requires Claude Code v2.1.181 or later
+`CLAUDE_AX_STARTUP_QUIET_MS`| In [screen reader mode](</docs/en/accessibility>), how many milliseconds Claude Code holds the first interface render after the startup confirmation line. Your screen reader can then speak the line in full before new output interrupts it. Default `3000`. Set `0` to render immediately. Claude Code caps the hold at `600000` (10 minutes). Your first keystroke ends the hold early. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). Requires Claude Code v2.1.217 or later
`CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR`| Return to the original working directory after each Bash or PowerShell command in the main session
`CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS`| Timeout in milliseconds for the byte-level streaming idle watchdog; when set, it takes precedence over `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for that watchdog and leaves the event-level watchdog unchanged. Claude Code clamps this variable to between 10 seconds and 30 minutes. Requires Claude Code v2.1.210 or later
`CLAUDE_CLIENT_PRESENCE_FILE`| Path to a file that an external tool, such as a screen-lock listener, creates when you unlock your screen and deletes when you lock it. While the file exists, Claude Code skips [Remote Control mobile push notifications](</docs/en/remote-control#mobile-push-notifications>), so you stop getting pushes while you are actively using the computer. When the file is absent or unreadable, notifications are sent as normal. Claude Code checks the file once per push-triggering event rather than polling it. Requires Claude Code v2.1.181 or later
@@ -251,6 +251,7 @@
`CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT`| Set to `1` to turn off the [critical-path](</docs/en/permission-modes#critical-paths>) check for a recursive `rm` whose target is entirely the output of a command substitution, such as `rm -rf "$(pwd)"`. The other critical-path checks keep running. Set it in the environment that launches Claude Code, since Claude Code ignores a copy delivered through a settings `env` block. Requires Claude Code v2.1.281 or later
`CLAUDE_CODE_DISABLE_TERMINAL_TITLE`| Set to `1` to disable automatic terminal title updates based on conversation context. This also skips the background small/fast-model request that [generates a session title](</docs/en/sessions#name-your-sessions>), and turns off [status reports to your terminal](</docs/en/terminal-config#see-session-status-in-your-terminal>)
`CLAUDE_CODE_DISABLE_THINKING`| Set to `1` to omit the `thinking` parameter from API requests entirely. This is a compatibility option for proxies and gateways that reject the parameter. On models that think by default, omitting the parameter means the model may still think. To explicitly disable [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>) on the Anthropic API, use `MAX_THINKING_TOKENS=0` instead. Neither variable turns thinking off on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models, which can’t have thinking turned off. On [third-party providers](</docs/en/third-party-integrations>), `MAX_THINKING_TOKENS=0` likewise omits the parameter, so the two variables behave the same there
+`CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK`| Set to `1` so that [`claude ultrareview`](</docs/en/ultrareview#trust-the-folder-before-the-review-runs>) doesn’t exit with `Error: Workspace not trusted` in a folder you haven’t trusted when it can’t ask you to trust it, such as in CI. Set it in the environment that launches Claude Code, not a settings `env` block, and only where every such run starts in a folder you trust. Runs that can ask still ask. Requires Claude Code v2.1.309 or later
`CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT`| Set to `1` to skip proactive [auto-compaction](</docs/en/costs#reduce-token-usage>) when Claude Code doesn’t recognize the model ID, such as an [LLM gateway](</docs/en/llm-gateway>) alias. Without this variable, Claude Code compacts at the context window it assumes for the ID. `CLAUDE_CODE_MAX_CONTEXT_TOKENS` can correct the assumed window instead; see [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>) for when each variable applies. Requires Claude Code v2.1.223 or later
`CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL`| Set to `1` to disable virtual scrolling in [fullscreen rendering](</docs/en/fullscreen>) and render every message in the transcript. Use this if scrolling in fullscreen mode shows blank regions where messages should appear
`CLAUDE_CODE_DISABLE_WEB_FETCH`| Set to `1` to turn off the [WebFetch](</docs/en/tools-reference#webfetch-tool-behavior>) tool. The [WebSearch](</docs/en/tools-reference#websearch-tool-behavior>) tool stays available. Requires Claude Code v2.1.285 or later
@@ -267,6 +268,7 @@
`CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY`| Set to `1` to populate the `/model` picker from your gateway’s `/v1/models` endpoint when `ANTHROPIC_BASE_URL` points at an Anthropic-compatible gateway such as LiteLLM, Kong, or an internal proxy. Off by default because gateways backed by a shared API key would otherwise show every user every model the key can access. Discovered models are still filtered by an [`availableModels`](</docs/en/settings-reference#availablemodels>) allowlist the session receives; deliver the list through [MDM or a managed settings file](</docs/en/managed-settings#delivery-mechanisms>), since [server-managed delivery is not available on gateway configurations](</docs/en/server-managed-settings#platform-availability>)
`CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE`| Removed in v2.1.142, when the [fast mode](</docs/en/fast-mode>) default moved from Opus 4.6 to Opus 4.7
`CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION`| Set to `false` to turn off prompt suggestions, the grayed-out predictions that appear in your prompt input. Takes precedence over the [`promptSuggestionEnabled`](</docs/en/settings-reference#promptsuggestionenabled>) setting, which is what the **Prompt suggestions** toggle in `/config` writes. Claude Code also [pauses suggestions while your account is close to or at its usage limit](</docs/en/interactive-mode#when-claude-code-skips-suggestions>). Set to `true` to keep that pause from applying until you reach the limit. Requires Claude Code v2.1.238 or later. See [Prompt suggestions](</docs/en/interactive-mode#prompt-suggestions>)
+`CLAUDE_CODE_ENABLE_SHARE_BUNDLE`| Set to `1` to make [`/share`](</docs/en/commands#all-commands>) save its report and the whole session transcript to a [local archive under `~/.claude/feedback-bundles/`](</docs/en/data-usage#telemetry-services>) instead of sending the report to Anthropic. If your organization’s policy turns off `/share`, you can’t turn it back on with this variable. Requires Claude Code v2.1.299 or later
`CLAUDE_CODE_ENABLE_TASKS`| Selects which task-tracking tools Claude Code provides in [sessions that have them](</docs/en/tools-reference#task-tool-availability>). By default, Claude Code provides the Task tools `TaskCreate`, `TaskUpdate`, `TaskGet`, and `TaskList`. Set to `0` to get the legacy `TodoWrite` tool instead. See [Task list](</docs/en/interactive-mode#task-list>)
`CLAUDE_CODE_ENABLE_TELEMETRY`| Set to `1` to enable OpenTelemetry data collection for metrics and logging. Required before configuring OTel exporters. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). See [Monitoring](</docs/en/monitoring-usage>)
`CLAUDE_CODE_ENABLE_TODO_TOOLS`| Set to `1` to get the task-tracking tools on every model. Without it, Claude Code provides them by default only on the models listed under [Task tool availability](</docs/en/tools-reference#task-tool-availability>). `CLAUDE_CODE_ENABLE_TASKS` still selects the Task tools or `TodoWrite`. Requires Claude Code v2.1.233 or later
@@ -395,6 +397,8 @@
`CLAUDE_CODE_USE_MANTLE`| Use the Amazon Bedrock [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>)
`CLAUDE_CODE_USE_POWERSHELL_TOOL`| Controls the PowerShell tool. On Windows without Git Bash, the tool is enabled automatically; set to `0` to disable it. On Windows with Git Bash installed, the tool is on by default for claude.ai and Console accounts; set to `1` to enable it in Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry sessions, or `0` to turn it off. On Linux, macOS, and WSL, set to `1` to enable it, which requires `pwsh` on your `PATH`. When enabled on Windows, Claude can run PowerShell commands natively instead of routing through Git Bash. See [PowerShell tool](</docs/en/tools-reference#powershell-tool>)
`CLAUDE_CODE_USE_VERTEX`| Use [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>)
+`CLAUDE_CODE_WARN_DISK_FREE_GIB`| Set to a whole number of GiB, such as `10`, to have Claude Code warn Claude when free space on the working directory’s filesystem falls below that amount. The warning is a system reminder saying how much is free. The reminder is off when the variable is unset, `0`, or not plain digits. Set it in the environment that launches Claude Code, since Claude Code ignores a copy delivered through a settings `env` block. Requires Claude Code v2.1.304 or later
+`CLAUDE_CODE_WARN_MEMORY_FREE_GIB`| On Linux and WSL, set to a whole number of GiB such as `4` to have Claude Code warn Claude when available memory falls below that amount. The warning is a system reminder saying how much is available. The reminder is off when the variable is unset, `0`, or not plain digits. Set it in the environment that launches Claude Code, since Claude Code ignores a copy delivered through a settings `env` block. Requires Claude Code v2.1.304 or later
`CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS`| Set to the number of milliseconds [WebFetch](</docs/en/tools-reference#webfetch-tool-behavior>) keeps each fetched URL’s response cached. The default is `900000`, which is 15 minutes. Takes plain digits only; `0`, a decimal, or any other spelling keeps the default. Claude Code reads the value once per launch, so a change in a settings `env` block applies when you next launch `claude`. Requires Claude Code v2.1.233 or later
`CLAUDE_CODE_WEBFETCH_DEADLINE_MS`| Upper bound in milliseconds on how long [WebFetch](</docs/en/tools-reference#webfetch-tool-behavior>) waits for a page to download, including any redirects it follows. A download that hasn’t completed by then fails with a deadline error. The default is `300000`, which is five minutes. Set to `0` to remove the limit. Takes plain digits only; a decimal or any other spelling keeps the default. Requires Claude Code v2.1.268 or later
`CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR`| Rate at which a session’s [WebSearch limit](</docs/en/tools-reference#session-search-limit>) refills, in calls per hour. The default is `100` in an interactive terminal session. In a [non-interactive](</docs/en/headless>) session the default is `0`, which turns refill off. Takes plain digits only; any other spelling reads as unset. Requires Claude Code v2.1.290 or later
@@ -423,7 +427,7 @@
`DISABLE_ERROR_REPORTING`| Set to any non-empty value, such as `1`, to opt out of error reporting. **Setting it to`0` or `false` still opts out**, unlike most on/off variables; unset the variable to turn error reporting back on
`DISABLE_EXTRA_USAGE_COMMAND`| Set to `1` to hide the `/usage-credits` command that lets users purchase additional usage beyond rate limits
`DISABLE_FEEDBACK_COMMAND`| Set to `1` to disable the `/feedback` command and [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>). Also disables `/bug` and `/share`, which report through the same path; before v2.1.212 they were aliases of `/feedback`, so the command was disabled under every name. The older name `DISABLE_BUG_COMMAND` is also accepted
-`DISABLE_GROWTHBOOK`| Set to `1` or `true` to disable GrowthBook feature-flag fetching and use code defaults for every flag. This makes [Remote Control](</docs/en/remote-control#requirements>) and the other features that need feature-flag fetching unavailable. Setting it to `0` or `false` leaves fetching on. Telemetry event logging stays on unless `DISABLE_TELEMETRY` is also set
+`DISABLE_GROWTHBOOK`| Set to `1` or `true` to disable feature-flag fetching and use code defaults for every flag. This makes [Remote Control](</docs/en/remote-control#requirements>) and the other features that need feature-flag fetching unavailable. Setting it to `0` or `false` leaves fetching on. Telemetry event logging stays on unless `DISABLE_TELEMETRY` is also set
`DISABLE_INSTALLATION_CHECKS`| Set to `1` to disable installation warnings. Use only when manually managing the installation location, as this can mask issues with standard installations
`DISABLE_INSTALL_GITHUB_APP_COMMAND`| Set to `1` to hide the `/install-github-app` command. Already hidden when using third-party providers (Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry)
`DISABLE_INTERLEAVED_THINKING`| Set to `1` to prevent sending the interleaved-thinking beta header. Useful when your LLM gateway or provider does not support [interleaved thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking#interleaved-thinking>)
@@ -460,7 +464,7 @@
`MCP_DISCOVERY_CACHE_STRIKES`| At a start where a [discovery-cache](</docs/en/mcp#server-status-detail>) entry is older than `MCP_DISCOVERY_CACHE_TTL_S`, Claude Code refreshes it in the background. This variable sets how many refreshes in a row can fail before Claude Code discards the entry and connects the server at the next start instead (default: 1). Raise it if your network connection drops occasionally, so that one failed refresh doesn’t discard the entry. Requires Claude Code v2.1.238 or later
`MCP_DISCOVERY_CACHE_TTL_S`| Seconds for which Claude Code uses a [discovery-cache](</docs/en/mcp#server-status-detail>) entry without refreshing it (default: 900). At a start where the entry is older than that, Claude Code still uses it but refreshes it in the background. Once the entry is older than `MCP_DISCOVERY_CACHE_MAX_STALE_S`, Claude Code discards it instead. Claude Code caps the value at `MCP_DISCOVERY_CACHE_MAX_STALE_S`, which is 4 hours by default. Before v2.1.238, Claude Code didn’t cap the value
`MCP_OAUTH_CALLBACK_PORT`| Fixed port for the OAuth redirect callback, as an alternative to `--callback-port` when adding an MCP server with [pre-configured credentials](</docs/en/mcp#use-pre-configured-oauth-credentials>)
-`MCP_PROTOCOL_NEGOTIATION`| On the [v2 MCP client runtime](</docs/en/mcp#mcp-client-runtimes>) only, whether Claude Code probes servers for MCP protocol revision 2026-07-28. Set `auto` to probe HTTP, claude.ai connector, and stdio servers, or `legacy` to probe none. With the variable unset, Claude Code probes the servers described under [MCP client runtimes](</docs/en/mcp#mcp-client-runtimes>). Any other value is ignored with a warning in the debug log. Requires Claude Code v2.1.221 or later
+`MCP_PROTOCOL_NEGOTIATION`| On the [v2 MCP client runtime](</docs/en/mcp#mcp-client-runtimes>) only, controls whether Claude Code probes servers for MCP protocol revision 2026-07-28. Set `legacy` to skip the probe, so that every server connects with the handshake from before that revision. Set `auto` to probe the server kinds that support the probe: HTTP and stdio servers, claude.ai connectors, and the connectors of cloud and Remote Control sessions. With the variable unset, Claude Code probes those same kinds by default; see [MCP client runtimes](</docs/en/mcp#mcp-client-runtimes>). Any other value is ignored with a warning in the debug log. Requires Claude Code v2.1.221 or later
`MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE`| Maximum number of remote MCP servers (HTTP/SSE) to connect in parallel during startup (default: 20)
`MCP_SDK_GENERATION`| Pin which [MCP client runtime](</docs/en/mcp#mcp-client-runtimes>) this process connects to MCP servers with: `v1`, built on MCP TypeScript SDK 1.x, or `v2`, built on [MCP TypeScript SDK 2.0](<https://ts.sdk.modelcontextprotocol.io/v2/>). Without the variable, Claude Code uses v2, starting with the versions listed in that section. On Claude Code v2.1.221 or later, the v2 runtime checks the issuer an MCP OAuth server returns in its authorization response and fails the sign-in with an error that begins `Issuer mismatch in authorization response` when it doesn’t match. The v1 runtime doesn’t run this check. If you set an unrecognized value, Claude Code ignores it and writes a warning to the debug log. Claude Code reads the value once per process. Requires Claude Code v2.1.218 or later
`MCP_SERVER_CONNECTION_BATCH_SIZE`| Maximum number of local MCP servers (stdio) to connect in parallel during startup (default: 3)
Show diff (408 lines)
--- a/errors.md
+++ b/errors.md
@@ -99,6 +99,8 @@
`(check the helper, then start a new task or chat)` / `(update it, then start a new task or chat)`| Authentication
`MCP server "<name>" needs additional permissions (scope: "<scope>") — run /mcp to re-authenticate`| Authentication
`MCP server "<name>" requires re-authorization (token expired)`| Authentication
+`Couldn't read the stored credentials for MCP server "<name>", so the request didn't run`| Authentication
+`A request to MCP server "<name>" was sent without your stored credentials`| Authentication
`This server's URL is missing or not a valid URL, so sign-in can't start`| Authentication
`Issuer mismatch in authorization response (RFC 9207)`| Authentication
`Refusing to send credentials to non-https token endpoint` / `<short-name> from the MCP SDK for <server-url>`| Authentication
@@ -136,6 +138,7 @@
`N sessions ended while this machine was offline — the environment was cleaned up on the server and can't be resumed.`| Network
`Couldn't share the transcript.`| Network
`Couldn't send feedback`| Network
+`MCP server "<name>" connection timed out. Your computer went to sleep or its clock changed while connecting.`| Network
`Prompt is too long` / `Input is too long for requested model`| Request errors
`Prompt is too long · automatic compaction failed:`| Request errors
`Prompt is too long · this conversation is a single exchange` / `A single-exchange conversation cannot be compacted`| Request errors
@@ -215,9 +218,12 @@
`Error: --agents file not found`| Command-line errors
`Error: Settings file exceeds the 2MiB limit`| Command-line errors
`The current directory no longer exists (it was deleted or moved)` / `Can't read the current directory`| Command-line errors
-`Temp directory <dir> ... Refusing to use it` / `ENOSPC: no space left on device, mkdir '<dir>'`| Command-line errors
+`Temp directory <dir> ... Refusing to use it` / `Claude Code's temporary directory <dir> could not be created`| Command-line errors
+`ENOSPC: no space left on device, mkdir '<dir>'`| Command-line errors
`couldn't be resolved to a real location, so its skills, commands, and agents weren't loaded`| Command-line errors
`Error: Workspace not trusted` when starting Remote Control| Command-line errors
+`Error: Workspace not trusted` when running `claude ultrareview`| Command-line errors
+`Ultrareview did not start`| Command-line errors
``<flag>` before `remote-control` is not carried over to the sessions Remote Control starts`| Command-line errors
`--sandbox is not supported by claude remote-control` / `--no-sandbox is not supported by claude remote-control`| Command-line errors
``claude import` is not yet available in this build`| Command-line errors
@@ -300,7 +306,9 @@
`"<plugin>" was not uninstalled: <file> is there and could not be read`| Plugin errors
`Plugin "<plugin>" was not uninstalled: installed_plugins.json`| [Plugin troubleshooting](</docs/en/plugins/troubleshooting#installed-plugins-json-holds-a-record-this-version-cannot-read>)
`Plugin directory does not exist: <path>`| [Plugin troubleshooting](</docs/en/plugins/troubleshooting#plugin-directory-does-not-exist>)
+`Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)`| Plugin errors
`Error: No such tool available: <tool name>`| Tool errors
+`MCP server "<name>" connection closed before the tool call was answered`| Tool errors
`would be spawned with zero tools — refusing`| Tool errors
`File is covered by a Read deny rule in your permission settings`| Tool errors
`cannot contain null bytes (\0)`| Tool errors
@@ -326,10 +334,11 @@
`its permission check expired before it ran (too many concurrent file operations)` / `ripgrep was found only by name on PATH`| Tool errors
`task output swap refused (tasks dir moved or linked)`| Tool errors
`Command killed: its output file was replaced or could no longer be verified`| Tool errors
-`Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)`| Tool errors
-`The filesystem with Claude Code's temp directory <dir>, or your disk quota on it, is full (ENOSPC)`| Tool errors
+`Disk full: this computer's volume holding <dir> (Claude Code's temporary directory) has <n> MB free` / `Nearly out of inodes: this computer's volume holding <dir>`| Tool errors
+`Disk full: a test write beside this command's output file` / `Disk quota used up: a test write beside this command's output file`| Tool errors
+`The command was not started: this computer's disk is full (ENOSPC)` / `the user's disk quota is used up (EDQUOT)`| Tool errors
+`Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)` / `The filesystem with Claude Code's temp directory <dir>, or your disk quota on it, is full (ENOSPC)`| Tool errors
`Command output was lost: the temp filesystem at <dir> is full` / `is out of inodes`| Tool errors
-`The command was not started: this computer's disk is full (ENOSPC)` / `(EDQUOT)`| Tool errors
`File is not valid UTF-8. It may use a legacy encoding such as Windows-1252, Shift-JIS or GBK, or be binary`| Tool errors
`the source file is not valid UTF-8 text` / `the source file is not valid UTF-16 text`| Tool errors
`the source file has the replacement character U+FFFD`| Tool errors
@@ -417,6 +426,7 @@
`Claude Code doesn't recognize the model "<model>", so it assumes a context window of 200k tokens`| [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>)
`[claude-code:unrecognized_model]`| Configuration warnings
`is ignored — managed settings set allowManagedReadPathsOnly` / `is ignored — managed settings set allowManagedDomainsOnly`| Configuration warnings
+`Sandbox mask files left behind at write-deny paths`| Configuration warnings
`Stale sandbox mask files left by a killed session`| Configuration warnings
Responses seem lower quality than usual| Response quality
@@ -433,7 +443,7 @@
* Dropped connections. When a connection drops partway through a request before Claude has completed any part of its response, including its thinking, Claude Code re-issues the request with the same backoff and the turn continues, even if some text had already started streaming. When it drops after Claude has finished thinking but before it has started any text or tool call, Claude Code instead re-issues the request up to two times in quick succession, and ends the turn with `Connection lost before a response was produced` if the connection keeps dropping at that point.
* A connection that Claude Code detects was broken by your computer going to sleep partway through a request. Claude Code counts it as a dropped connection under the rules above; once the retry label names the specific reason, it reads `Connection lost while your computer was asleep`, and if the turn ends after Claude has finished thinking but before any text or tool call, the message reads `Your computer went to sleep before a response was produced`.
* A stalled response stream, when the response headers have arrived but none of Claude’s response has arrived, or when Claude has finished thinking but hasn’t started any text or tool call: Claude Code aborts the stalled connection and streams the request again at most once. If the response stalls a second time after Claude has finished thinking but before any text or tool call, Claude Code ends the turn with `The response stalled before a response was produced`.
- * A streaming request the API never answers with response headers, on a connection where the [first-byte deadline runs](</docs/en/network-config#streaming-idle-watchdogs>): Claude Code aborts it at the deadline and re-sends it at most once per model request, within the retry budget, then ends the turn with No response from API if that attempt goes unanswered too. When you set `CLAUDE_CODE_RETRY_WATCHDOG`, the one-retry cap doesn’t apply.
+ * A streaming request the API never answers with response headers, on a connection where the [first-byte deadline runs](</docs/en/network-config#streaming-idle-watchdogs>). At the deadline, Claude Code aborts the request and re-sends it within the retry budget. If the deadline fires for a re-send too, the turn ends with No response from API. When you set `CLAUDE_CODE_RETRY_WATCHDOG`, Claude Code keeps re-sending within the budget instead.
* A streaming response that the API’s output content filter stops before Claude has either finished thinking or started any text or tool call. Claude Code re-sends the request once, within the retry budget, and shows Output blocked by content filtering policy if the filter stops the second response too.
* Temporary 429 throttles, but not a gateway’s spend-limit `429`, which isn’t a throttle; see Spend limit reached.
* When you’re signed in with a claude.ai subscription, this includes 429 throttles that don’t carry your plan’s quota headers. Before v2.1.199, Claude Code retried those throttles only for API key and Enterprise sign-ins.
@@ -551,7 +561,7 @@
No response from API
-Claude Code sent a streaming request and the API returned no response headers within the deadline for the first byte, so Claude Code aborted the request instead of waiting for the full `API_TIMEOUT_MS` request timeout, 10 minutes by default. Claude Code sends the request again at most once, if the retry budget allows. When the retry goes unanswered too, the turn ends with this message, which shows how long each attempt waited. When you set [`CLAUDE_CODE_RETRY_WATCHDOG`](</docs/en/env-vars>), the one-retry cap doesn’t apply and Claude Code retries under the budget described in Tune retry behavior.
+Claude Code sent a streaming request, and the API returned no response headers within the deadline for the first byte. Claude Code aborts such a request rather than wait for the full `API_TIMEOUT_MS` request timeout, and sends it again if the retry budget allows. When the deadline passes for the retry too, the turn ends with this message, which shows how long each attempt waited. If you set [`CLAUDE_CODE_RETRY_WATCHDOG`](</docs/en/env-vars>), Claude Code keeps retrying under the budget described in Tune retry behavior instead of ending the turn.
API Error: No response from API (waited 3m, then 10m on the retry). If a proxy or gateway on your network holds responses until they complete, raise API_TIMEOUT_MS or CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS to wait longer.
@@ -560,14 +570,14 @@
* **First attempt** : [`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`](</docs/en/env-vars>) when you set it to 1 or more, clamped to between 10 seconds and 30 minutes. Otherwise Claude Code uses the byte-level watchdog timeout listed in [Streaming idle watchdogs](</docs/en/network-config#streaming-idle-watchdogs>), so the variables that change that timeout change this wait too. Either way, Claude Code adds one second for every 32KB of request body.
* **Retry** : one second less than `API_TIMEOUT_MS`, just under 10 minutes by default, so that the retry can outlast a proxy or gateway that holds the response until generation completes. On Amazon Bedrock, the retry uses the same deadline as the first attempt, and the message shows one duration instead of two. Except on Amazon Bedrock, if you set `API_TIMEOUT_MS` to `0`, the retry waits 10 minutes plus one second per 32KB, or as long as the first attempt if that’s longer.
-Neither wait exceeds one second less than a positive `API_TIMEOUT_MS`, and a positive `API_TIMEOUT_MS` under 11 seconds turns the deadline off. The byte-level watchdog starts only once the response headers arrive, so a response that stops sending bytes after that follows the stalled-stream rules instead of this deadline. **What to do:**
+Neither wait exceeds one second less than a positive `API_TIMEOUT_MS`, and a positive `API_TIMEOUT_MS` under 11 seconds turns the deadline off. The byte-level watchdog starts only once the response headers arrive, so a response that stops sending bytes after that follows the stalled-stream rules instead of this deadline. In a [Claude apps gateway](</docs/en/claude-apps-gateway>) session, this deadline runs only when you [turn it on](</docs/en/claude-apps-gateway-deploy#retry-an-unanswered-request-sooner-with-the-first-byte-deadline>) by setting `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` to `1` or more. **What to do:**
* Send your message again. Your original message is still in the conversation, so for a long prompt you can type `try again` instead of pasting the whole thing.
* If it repeats, treat it as a network or proxy problem.
* If a proxy or gateway on your network holds responses until they complete, raise `API_TIMEOUT_MS` so the retry waits longer. On Amazon Bedrock, raise `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` as well.
* If the first attempt keeps timing out and the retry then succeeds, raise `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` so the first attempt waits long enough too.
-Before v2.1.242, Claude Code waited for the full `API_TIMEOUT_MS` request timeout, 10 minutes by default, before failing an unanswered streaming request. Before v2.1.261, the retry waited the same deadline as the first attempt and the message showed no durations.
+Before v2.1.242, Claude Code waited for the full `API_TIMEOUT_MS` request timeout, 10 minutes by default, before failing an unanswered streaming request. Before v2.1.261, the retry waited the same deadline as the first attempt and the message showed no durations. Before v2.1.307, Claude Code ignored `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` in a Claude apps gateway session.
###
@@ -1485,6 +1495,37 @@
+Couldn’t read the stored credentials for MCP server
+
+Claude Code keeps your sign-ins for OAuth [MCP servers](</docs/en/mcp>) in a credential store. This message means Claude Code couldn’t read that store, so a request to the server didn’t run:
+
+ Couldn't read the stored credentials for MCP server "<name>", so the request didn't run. If your Mac's keychain is locked, unlock it, then try again.
+ Couldn't read the stored credentials for MCP server "<name>", so the request didn't run. Try again.
+
+Your stored sign-ins are unchanged: try again once the store can be read, and sign in again only if the server then asks you to. In a [`claude -p`](</docs/en/headless>) or [Agent SDK](</docs/en/agent-sdk/overview>) run on macOS, the keychain can become readable after a request has already gone out without the stored sign-in. That request fails with:
+
+ A request to MCP server "<name>" was sent without your stored credentials, so the server rejected it. The credentials are available now. Try again.
+
+**What to do:**
+
+ * If the message asks you to unlock your Mac’s keychain, run [`claude doctor`](</docs/en/cli-reference#cli-commands>) in the shell session you run Claude Code from, and check its report for a keychain warning:
+ * If the report lists a warning that starts with `macOS Keychain is not writable`, or your shell has no `claude` command, run this unlock command in that shell session:
+
+ security unlock-keychain ~/Library/Keychains/login.keychain-db
+
+ * If the report lists no keychain warning, skip the unlock command
+ * Try again where you saw the message:
+ * For `claude -p`, run the command again
+ * In an interactive session, reconnect the server from `/mcp` if it shows as failed there, then ask Claude to try again
+ * In an Agent SDK application that keeps running, call [`reconnectMcpServer()`](</docs/en/agent-sdk/typescript#methods>) in TypeScript or [`ClaudeSDKClient.reconnect_mcp_server()`](</docs/en/agent-sdk/python#methods>) in Python, or start a new session
+ * If the server then reports that it needs authentication, Claude Code found no sign-in it can use for that server. Sign in interactively: run `/mcp` in a Claude Code session, or [`claude mcp login <name>`](</docs/en/mcp#authenticate-from-the-command-line>) in your shell. In an Agent SDK application, see [OAuth2 authentication in the Agent SDK](</docs/en/agent-sdk/mcp#oauth2-authentication>).
+
+Before v2.1.307, a `claude -p` or Agent SDK run on a Mac with a locked login keychain reported the server as needing authentication instead of showing either message.
+
+###
+
+
+
MCP server URL is missing or not a valid URL
Claude Code refused to start an OAuth sign-in for a remote MCP server because the server’s configured `url` doesn’t parse as a URL. Unless Claude Code has a more specific configuration problem to report for the server, running [`claude mcp login <name>`](</docs/en/mcp#authenticate-from-the-command-line>) in your shell prints the refusal as:
@@ -2000,22 +2041,40 @@
Couldn’t send feedback
-You sent a report from the [`/feedback`, `/bug`, or `/share` dialog](</docs/en/commands#all-commands>) and the upload to Anthropic failed. The dialog keeps your text so you can retry.
+A message starting `Couldn't send feedback` means the report you submitted from the [`/feedback`, `/bug`, or `/share` dialog](</docs/en/commands#all-commands>), or a queued [feedback draft](</docs/en/tools-reference#sendfeedback-tool-behavior>), wasn’t sent. When a sentence about your organization follows the colon, your organization refuses feedback and the same report gets the same answer. The first of these two examples is a network failure and the second is an organization’s refusal:
Couldn't send feedback (couldn't reach the service). If it keeps failing, you can file at https://github.com/anthropics/claude-code/issues instead.
-The text after the prefix names what failed:
-
- * **`: not signed in. Run /login, then retry.`** : the dialog uploads only when Claude Code found Anthropic credentials as it opened, and none were usable by the time you sent. For example, you signed out on this machine in the meantime, or your login could no longer be refreshed.
- * **A parenthetical** : `(server returned <status>)` is the service’s response code; `(request timed out)` and `(couldn't reach the service)` are network failures. When Claude Code can’t name a reason, the parenthetical is absent.
-
-In the [feedback drafts queue](</docs/en/tools-reference#sendfeedback-tool-behavior>), the same failure ends with `The draft is still queued. Try again later.` instead, and the draft stays in the queue for another attempt. **What to do:**
-
- * For the not-signed-in wording, run `/login` and send again
- * Otherwise, send again; if other requests are failing too, check your network connection and see Unable to connect to API
- * If it keeps failing, file the report at [github.com/anthropics/claude-code/issues](<https://github.com/anthropics/claude-code/issues>), as the message says
-
-Before v2.1.281, every send failed with this message once a Remote Control **Stop** or an urgent cross-session message had arrived while the dialog was open. On those versions, close the dialog, reopen it, and send again.
+ Couldn't send feedback: Feedback has not been enabled for your organization. To report a bug, open an issue at https://github.com/anthropics/claude-code/issues. Issues are public, so leave out anything confidential.
+
+**What to do:**
+
+ * **Not signed in** : the message continues `: not signed in. Run /login, then retry.` Run `/login`, then send again
+ * **Your organization’s refusal** : for example `: Feedback has not been enabled for your organization.` or `: Feedback collection is not available for organizations with custom data retention policies.` If the message adds `To report a bug, open an issue`, do so at [github.com/anthropics/claude-code/issues](<https://github.com/anthropics/claude-code/issues>). A queued draft stays queued, and you can [discard it](</docs/en/tools-reference#discard-or-keep-a-draft>)
+ * **Refused credentials** : the message continues `: the sign-in this session uses is not allowed to send feedback` or `: the server did not accept the credentials this session uses`. Run `/status` at the Claude Code prompt to see which login, token, or API key this session sends
+ * **`(request timed out)` or `(couldn't reach the service)` straight after `Couldn't send feedback`**: these are network failures. Send the report or the queued draft again. The dialog keeps your text, and a queued draft’s message says `The draft is still queued.` If other requests are failing too, check your network connection and see Unable to connect to API. If it keeps failing, file the report at [github.com/anthropics/claude-code/issues](<https://github.com/anthropics/claude-code/issues>)
+ * **`(server returned<status>)`, or no reason, straight after `Couldn't send feedback`**: the status is the service’s response code. The service’s own message follows it when one was sent, as in `(server returned 403: Access Forbidden)`. If it keeps failing, file the report at [github.com/anthropics/claude-code/issues](<https://github.com/anthropics/claude-code/issues>)
+
+Issues at github.com/anthropics/claude-code are public, so leave out code, transcripts, and anything else confidential when you open one. Before v2.1.281, every send failed with this message once a Remote Control **Stop** or an urgent cross-session message had arrived while the dialog was open. On those versions, close the dialog, reopen it, and send again.
+
+###
+
+
+
+MCP server connection timed out during a sleep or clock change
+
+This message means a connection to an [MCP server](</docs/en/mcp>) timed out, and Claude Code found that your system clock jumped forward during the attempt:
+
+ MCP server "<name>" connection timed out. Your computer went to sleep or its clock changed while connecting.
+
+Claude Code can’t tell whether your computer slept or its clock was set forward, so the message names both. **What to do:** Connect to the server again, and keep your computer awake until the attempt finishes. If the server connects, you have nothing to fix.
+
+ * **In an interactive session** : run `/mcp`, select the server, and select **Reconnect**
+ * **In your shell** : run the [`claude -p`](</docs/en/headless>), [`claude mcp list`](</docs/en/mcp#managing-your-servers>), or `claude mcp get` command again. If the server then fails with a message that starts `Skipping connection (recent failure cached`, wait 15 minutes and run the command again.
+ * **In an[Agent SDK](</docs/en/agent-sdk/overview>) application**: call [`reconnectMcpServer()`](</docs/en/agent-sdk/typescript#methods>) in TypeScript or [`ClaudeSDKClient.reconnect_mcp_server()`](</docs/en/agent-sdk/python#methods>) in Python
+ * **If the server fails again** : if the message differs from this one, see [what to check when an MCP server doesn’t connect](</docs/en/mcp-quickstart#troubleshooting>). If this message comes back although your computer stayed awake and nothing changed its clock, see Report an error.
+
+Before v2.1.307, Claude Code showed a timeout message such as `MCP server "<name>" connection timed out after <N>ms` instead of this one.
##
@@ -2336,7 +2395,7 @@
Couldn’t confirm model with the API
-You switched models through the [Agent SDK](</docs/en/agent-sdk/typescript>) `setModel()` method or an app that runs the Claude Code CLI for you, such as the [Desktop app](</docs/en/desktop>), and the request that confirms the model ID with your API endpoint got no answer within five seconds. The session keeps its current model.
+You switched models through the [Agent SDK](</docs/en/agent-sdk/typescript>) `setModel()` method or an app that runs the Claude Code CLI for you, such as the [Desktop app](</docs/en/desktop>), and the request that confirms the model ID with your API endpoint got no answer within 15 seconds. The session keeps its current model.
Couldn't confirm model "claude-sonnet-5" with the API. Try again, or run /model to see available models.
@@ -2939,7 +2998,7 @@
On macOS and Linux, Claude Code creates a private temp directory at startup, `claude-<uid>` under the system temp directory or the [`CLAUDE_CODE_TMPDIR`](</docs/en/env-vars>) override. When the directory can’t be created, or an entry already at that path fails the safety checks, Claude Code prints the failure to stderr and exits with code 1 rather than start the session:
- ENOSPC: no space left on device, mkdir '/tmp/claude-501'
+ Claude Code's temporary directory /tmp/claude-501 could not be created: the volume holding /tmp is full (ENOSPC). Free space on that volume, or set CLAUDE_CODE_TMPDIR to a directory on another one, then try again.
Temp directory /tmp/claude-501 is not a directory (may be an attacker-planted symlink). Refusing to use it. Set CLAUDE_CODE_TMPDIR to a directory you control, or ask an administrator to remove it.
@@ -2949,11 +3008,13 @@
**What to do:**
- * For `ENOSPC`, free disk space on the volume that holds the temp directory
+ * For `could not be created` followed by `is full (ENOSPC)`, free disk space on the volume the message names. When it says `your disk quota on the volume holding /tmp is used up (EDQUOT)` instead, delete your own files on that volume that you no longer need
* For the `Refusing to use it` forms, remove the named entry itself, not what a link points to, and start Claude Code again; for the `owned by uid` form, only an administrator or that user can remove it
* For `is not readable`, run `chmod 0700` on the named directory, or remove it and start again
* In any of these cases, set [`CLAUDE_CODE_TMPDIR`](</docs/en/env-vars>) to a directory you control and start Claude Code again, leaving the refused path alone
+Before v2.1.309, Claude Code printed only the operating system’s error text when the volume was full or your quota was used up. An example is `ENOSPC: no space left on device, mkdir '/tmp/claude-501'`, and the same steps apply.
+
###
@@ -2977,6 +3038,8 @@
Workspace not trusted when starting Remote Control
+If `claude ultrareview` printed `Error: Workspace not trusted`, see Workspace not trusted when running claude ultrareview instead.
+
You started [Remote Control](</docs/en/remote-control>) server mode with `claude remote-control` or its `claude rc` alias in a directory you haven’t trusted, and the command couldn’t ask you whether to trust it. For example, the command’s standard input or standard output isn’t a terminal because one of them is redirected or piped. The command exits with code 1:
Error: Workspace not trusted. Please run `claude` in /Users/you/project first to review and accept the workspace trust dialog.
@@ -2991,6 +3054,31 @@
* In your home directory, change to a project directory and start Remote Control there
Before v2.1.284, the command never asked, even in a terminal.
+
+###
+
+
+
+Workspace not trusted when running claude ultrareview
+
+In a folder you haven’t trusted, when [`claude ultrareview`](</docs/en/ultrareview#trust-the-folder-before-the-review-runs>) can’t ask whether you trust it, the run exits with code 1 before the review starts:
+
+ Error: Workspace not trusted. Please run `claude` in /Users/you/project first to review and accept the workspace trust dialog. Or, in a script or CI job, pass `--trust-workspace` to trust the folder for this run only.
+
+For example, the subcommand can’t ask when its standard input or standard output isn’t a terminal. Sending the output to a file, as in `claude ultrareview --json > findings.json`, means standard output isn’t a terminal. **What to do:**
+
+ * In a script or CI job, append `--trust-workspace` to trust the checkout for that run only: `claude ultrareview --trust-workspace`. Append it only for code you trust, because the checkout’s git configuration and Claude Code project settings can then run programs. To review a pull request whose code you don’t trust, see [how to review it from a checkout you do trust](</docs/en/ultrareview#trust-the-folder-before-the-review-runs>).
+ * On your own machine, run `claude` in that folder and accept the [workspace trust dialog](</docs/en/permissions#project-allow-rules-and-workspace-trust>), then run your original command again
+
+Each of these messages from `claude ultrareview` means that no review started and the exit code is 1:
+
+ * **`Error: Workspace not trusted. This terminal ...`** : the terminal reported no row and column count, or can’t fit the trust question and its warnings. Enlarge it or use a terminal that reports its size, then run `claude ultrareview` again. Outside your home directory, you can also run `claude` in that folder once and accept the trust dialog, so later runs there don’t ask.
+ * **`Error: Workspace not trusted.<folder> is your home directory`**: because trust for your home directory is never saved, running `claude` there first can’t help. Run `claude ultrareview` from a project directory instead, after running `claude` there once to accept the trust dialog, or append `--trust-workspace`.
+ * **`No answer in time.` followed by `Error: Workspace not trusted`**: the `Trust <folder>? [y/N]` question went unanswered for 5 minutes. Run `claude ultrareview` again and answer it.
+ * **`Ultrareview did not start:<folder> is not trusted`**: you declined at the `Trust <folder>? [y/N]` question, for example by answering `n` or pressing Enter. To start the review, run `claude ultrareview` again and answer `y`.
+ * **`Ultrareview did not start: `--trust-workspace` takes no value`** : something other than a flag follows `--trust-workspace`, such as a PR number or `false`. If you don’t trust the folder, leave the flag out. To trust it for this run, put the PR number or base branch before the flag: `claude ultrareview 1234 --trust-workspace`.
+
+Before v2.1.309, `claude ultrareview` didn’t accept `--trust-workspace`.
###
@@ -4070,6 +4158,25 @@
* Follow the last sentence of the message: repair or replace the settings file it names, or remove the plugin’s entry from `enabledPlugins` in that file yourself, then run the uninstall again
+###
+
+
+
+Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)
+
+This message means Claude Code didn’t start a stdio [MCP server that a plugin provides](</docs/en/mcp#plugin-provided-mcp-servers>), because a connection to that server failed less than 15 minutes earlier:
+
+ Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)
+
+The session continues without the server’s tools, and Claude Code doesn’t try the server again in that session when the 15 minutes end. When you start a new session or [`claude -p`](</docs/en/headless>) run at least 15 minutes after the most recent failed connection, Claude Code tries the server again. **What to do:** To have Claude Code try the server again without waiting:
+
+ * **In an interactive session** : run `/mcp`, select the server, and select **Reconnect**
+ * **In an[Agent SDK](</docs/en/agent-sdk/overview>) application**: call [`reconnectMcpServer()`](</docs/en/agent-sdk/typescript#methods>) in TypeScript or [`ClaudeSDKClient.reconnect_mcp_server()`](</docs/en/agent-sdk/python#methods>) in Python with the server’s name
+ * **In`claude -p`**: start an interactive session that loads the same plugin, on the same machine and with the same operating system account and [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>) value as your runs. Reconnect the server there from `/mcp`. Once it connects, Claude Code tries the connection in your next run.
+ * **If you’re developing the plugin** : change the server’s `command`, `args`, or `env` in the plugin’s `.mcp.json` or `plugin.json`. Claude Code tries the connection in the next session or `claude -p` run that loads the changed entry.
+
+The message replaces the error from the failed connection. If the new attempt fails too, Claude Code reports that attempt’s error instead of this message.
+
##
@@ -4093,6 +4200,23 @@
* If it happens once, you don’t need to do anything. Claude reads the error and the turn continues.
* If calls to an MCP server’s tools keep failing with this error, run `/mcp` in the session or `claude mcp list` in your shell to check the server’s [status](</docs/en/mcp#server-status>), and reconnect a failed server from `/mcp`. In the Agent SDK, see [Error handling](</docs/en/agent-sdk/mcp#error-handling>).
+
+###
+
+
+
+MCP server connection closed before the tool call was answered
+
+A tool call to an HTTP [MCP server](</docs/en/mcp>) or a [claude.ai connector](</docs/en/mcp#use-mcp-servers-from-claude-ai>) lost its connection before the server answered, so Claude Code can’t tell whether the tool ran:
+
+ MCP server "<name>" connection closed before the tool call was answered. The tool may have run: check whether it did before running it again.
+
+Repeating the call could repeat the tool’s action, such as creating a second issue. Claude Code therefore repeats the call on its own, once, when the server marks the tool as safe to repeat. **What to do:**
+
+ * Check in the service the tool acts on whether the action happened, for example whether the issue or record it was meant to create is there
+ * If the action happened, don’t run the tool again. Claude received this message in place of the tool’s result, so tell Claude the outcome.
+ * If the action didn’t happen, ask Claude to run the tool again. You don’t need to reconnect the server first, because Claude Code connects to it again for the next call to one of its tools. If that connection fails too, see [Mid-session drops of a remote server](</docs/en/mcp#mid-session-drops-of-a-remote-server>).
+ * If you build the server and the tool is safe to call twice, [mark it as safe to repeat](</docs/en/mcp#tool-calls-pending-when-a-connection-closes>) so that Claude Code can repeat a lost call
###
@@ -4410,28 +4534,32 @@
-Disk quota or temp filesystem is full
-
-Claude Code saves each Bash and PowerShell command’s output to a file under its temp directory. These messages in a command’s result mean that the filesystem holding that directory, or your disk quota on it, is full. If Claude Code can’t create that file because the filesystem or your quota on it is full, your command doesn’t start, and the result reads:
-
- The command was not started: this computer's disk is full (ENOSPC), so the file that captures command output could not be created. Nothing ran. If this is the user's own computer, tell them before deleting anything to make room.
-
-When a command exits with a nonzero code and no output at all, Claude Code checks the filesystem holding the output file. If that filesystem is out of space or inodes, or your disk quota on it is used up, a diagnostic replaces the empty output in the command’s result:
-
- Your disk quota is full on the filesystem with Claude Code's temp directory /private/tmp/claude-501/-Users-you-my-project/1f0e62dc-4b0a-4f5e-9c2d-8a7b6c5d4e3f/tasks (EDQUOT), so any output this command printed was lost, and it may have failed because it could not write. Delete files you no longer need there, or restart Claude Code with CLAUDE_CODE_TMPDIR set to a directory on another filesystem.
-
-The message names what ran out:
-
- * `Your disk quota is full ... (EDQUOT)`: your own quota on that filesystem is used up. A quota can be full while the filesystem still shows free space
- * `The filesystem with Claude Code's temp directory ..., or your disk quota on it, is full (ENOSPC)`: the filesystem, or your quota on it, has no space left
- * `Command output was lost: the temp filesystem at ... is full` or `... is out of inodes`: the filesystem has almost no free space left, or is running out of inodes
- * `The command was not started: this computer's disk is full (ENOSPC)` or `... (EDQUOT)`: the filesystem has no space left for the output file, or with `EDQUOT` your own quota on it is used up
-
-**What to do:**
-
- * Delete files you no longer need on the filesystem that holds Claude Code’s temp directory. If your message doesn’t name that directory, look up its default location in the [`CLAUDE_CODE_TMPDIR`](</docs/en/env-vars>) reference. For `EDQUOT`, delete files that count against your own quota. For `out of inodes`, delete many files rather than a few large ones, since each file takes one inode whatever its size
- * Or restart Claude Code with [`CLAUDE_CODE_TMPDIR`](</docs/en/env-vars>) set to a directory on a filesystem with room
+Disk full or disk quota used up
+
+Free up space, inodes, or disk quota on the volume that holds Claude Code’s temporary directory. A line in a command’s result starting `Disk full:`, `Disk quota used up:`, or `Nearly out of inodes:` names that directory. Claude Code saves each Bash and PowerShell command’s output to a file under that directory. If it can’t create that file because the volume or your quota on it is full, your command doesn’t start, and the result Claude reads is:
+
+ The command was not started: this computer's disk is full (ENOSPC) on the volume holding /tmp/claude-501 (Claude Code's temporary directory), so the file that captures command output could not be created there and nothing ran. Free space on that volume, or restart Claude Code with CLAUDE_CODE_TMPDIR set to a directory on another one, then retry. If this is the user's own computer, tell them before deleting anything to make room.
+
+The other three messages follow a command that ran and exited with a nonzero code. This example is the `Disk full:` form:
+
+ Disk full: this computer's volume holding /tmp/claude-501 (Claude Code's temporary directory) has 3 MB free, so whatever this command printed was lost and its own writes may have failed with "No space left on device". Free space on that volume, or restart Claude Code with CLAUDE_CODE_TMPDIR set to a directory on another one, then retry. If this is the user's own computer, tell them before deleting anything to make room.
+
+**What to do:**
+
+ * On macOS and Linux, run `df -h <dir>` in your shell to see which volume holds the directory and how full it is. `df -i <dir>` shows how many inodes are free. `<dir>` is the directory your message names, as in `df -i /tmp/claude-501`
+ * **`Disk full: this computer's volume` or `disk is full (ENOSPC)`**: anywhere on that volume, delete files you don’t need
+ * **`Disk quota used up:` or `Disk full: a test write`**: delete your own files on that volume, even if it still shows free space
+ * **`disk quota is used up (EDQUOT)`** : delete your own files on that volume
+ * **`Nearly out of inodes:`** : delete many files on that volume. Each takes one inode whatever its size, so their number matters, not their size
+ * Or restart Claude Code with [`CLAUDE_CODE_TMPDIR`](</docs/en/env-vars>) set to a directory on a volume with room
* Then have Claude run the command again
+
+Before v2.1.309, the messages read as follows, and the same steps apply:
+
+ * `Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)`
+ * `The filesystem with Claude Code's temp directory <dir>, or your disk quota on it, is full (ENOSPC)`
+ * `Command output was lost: the temp filesystem at <dir> is full` or `... is out of inodes`
+ * `The command was not started: this computer's disk is full (ENOSPC), so the file that captures command output could not be created. Nothing ran.`, or the same with `(EDQUOT)`. This form names no directory: look on the volume holding your system temp directory, such as `/tmp`, or the directory set in `CLAUDE_CODE_TMPDIR`
Before v2.1.305, a command that Claude Code couldn’t start because the disk was full returned only the operating system’s error text. That text read, for example, `ENOSPC: no space left on device, open <path>.output`.
@@ -5683,19 +5811,25 @@
-Stale sandbox mask files left by a killed session
-
-`claude doctor` prints this warning in its diagnostics, and `/status` lists the same line. It appears on Linux and WSL2 when [sandboxing](</docs/en/sandboxing>) is enabled with filesystem isolation on. While a sandboxed command runs, the sandbox holds a write denial on a file that doesn’t exist yet by creating a 0-byte read-only placeholder there, and removes it afterward. A session killed before that cleanup runs, for example by SIGKILL, leaves the placeholders behind. Later sessions bind them read-only again on every start, so a settings write such as saving “Yes, and don’t ask again” fails where one sits.
-
- - Stale sandbox mask files left by a killed session: /home/you/project/.claude/settings.local.json
- Fix: Remove each with `rm <path>` while no other Claude Code session is running in that project — a 0-byte read-only file where a settings file belongs makes "Yes, and don't ask again" fail to save, and the sandbox binds it read-only again on every start
-
-**What to do:**
-
- * Quit any other Claude Code session running in that project, then delete each listed file with `rm`. The warning names up to three files and counts the rest, so rerun `claude doctor` after deleting until the warning no longer appears. A placeholder that another session’s sandbox is still using is a live part of that session’s write protection
+Sandbox mask files left behind at write-deny paths
+
+This warning in `claude doctor` and `/status` lists mask files: 0-byte read-only placeholder files at paths the [sandbox](</docs/en/sandboxing>) denies writes to. It appears on Linux and WSL2 when sandboxing is enabled with filesystem isolation on. Delete them from your shell once no Claude Code session is open in the project that holds them. The sandbox creates a placeholder while a sandboxed command runs and removes it when the command ends. One stays behind in cases such as these:
+
+ * The session is killed before the command ends, for example by SIGKILL
+ * You quit the session while a sandboxed command is still running, such as one in the background
+
+In `claude doctor`, the warning reads:
+
+ - Sandbox mask files left behind at write-deny paths: /home/you/project/.claude/settings.local.json
+ Fix: A session leaves one where it was killed, or where it exited while a sandboxed command was still running. Remove each with `rm <path>` while no other Claude Code session is running in that project — a 0-byte read-only file where a settings file belongs makes "Yes, and don't ask again" fail to save, and the sandbox binds it read-only again on every start
+
+**What to do:**
+
+ * Quit every Claude Code session open in the project that holds the listed files, including any session where `/status` showed the warning, then work from your shell. A placeholder that another session’s sandbox is still using is a live part of that session’s write protection
+ * In your shell, delete each listed file with `rm`, and confirm if `rm` asks about a write-protected file. The warning names up to three files and counts the rest, so run `claude doctor` again after deleting until the warning no longer appears
* If a permission choice you saved with “Yes, and don’t ask again” didn’t stick, save it again after deleting the placeholder
-Before v2.1.257, `claude doctor` didn’t flag these files; earlier versions leave the same placeholders behind when a session is killed.
+Before v2.1.309, the warning read `Stale sandbox mask files left by a killed session`. Before v2.1.257, `claude doctor` didn’t flag these files; earlier versions leave the same placeholders behind when a session is killed.
##
--- a/features-overview.md
+++ b/features-overview.md
@@ -212,7 +212,7 @@
Feature| When it loads| What loads| Context cost
---|---|---|---
-**CLAUDE.md**| Session start| Full content| Every request
+**CLAUDE.md**| Session start| Full content of each file that loads at session start| Every request
**Output styles**| Session start, and again when you switch styles| The active style’s full instructions; nothing for the Default style| Every request
**Skills**| Session start + when used| Descriptions at start, full content when used| Low (descriptions every request)*
**MCP servers**| Session start| Tool names; full schemas on demand| Low until a tool is used
@@ -242,7 +242,7 @@
* Hooks
-**When:** Session start**What loads:** Full content of all CLAUDE.md files (managed, user, and project levels).**Inheritance:** Claude reads CLAUDE.md files from your working directory up to the root, and discovers nested ones in subdirectories as it accesses those files. See [How CLAUDE.md files load](</docs/en/memory#how-claude-md-files-load>) for details.
+**When:** Session start**What loads:** Full content of each CLAUDE.md file that loads at session start (managed, user, and project levels).**Inheritance:** Claude reads CLAUDE.md files from your working directory up to the root, and discovers nested ones in subdirectories as it accesses those files. See [How CLAUDE.md files load](</docs/en/memory#how-claude-md-files-load>) for details. If a nested CLAUDE.md is over its [per-file size limit](</docs/en/memory#claude-ignores-the-end-of-my-subdirectory-claude-md>), Claude receives only the start of the file.
Keep CLAUDE.md under 200 lines. Move reference material to skills, which load on demand. To get [trim proposals for a checked-in CLAUDE.md](</docs/en/memory#my-claude-md-is-too-large>), run `/doctor`.
--- a/file-checkpointing.md
+++ b/file-checkpointing.md
@@ -1,6 +1,6 @@
File checkpointing tracks file modifications made through the [Write](</docs/en/tools-reference#write-tool-behavior>), [Edit](</docs/en/tools-reference#edit-tool-behavior>), and [NotebookEdit](</docs/en/tools-reference#notebookedit-tool-behavior>) tools during an agent session, allowing you to rewind files to any previous state. To watch a rewind restore a file, jump to the interactive example.
-Only changes made through the Write, Edit, and NotebookEdit tools are tracked. Changes made through Bash commands (like `echo > file.txt` or `sed -i`) are not captured by the checkpoint system, and neither are edits a [subagent](</docs/en/agent-sdk/subagents>) applies, except a [skill with `context: fork`](</docs/en/skills#run-skills-in-a-subagent>) that runs in the foreground.
+`rewindFiles()` doesn’t undo what `sed -i` or another Bash command did to a file, unless a tool such as Write or Edit had modified that file in the main conversation. [Subagent](</docs/en/agent-sdk/subagents>) edits aren’t tracked, while edits from a [skill with `context: fork`](</docs/en/skills#run-skills-in-a-subagent>) running in the foreground are.
##
@@ -595,7 +595,7 @@
Limitation| Description
---|---
-Write/Edit/NotebookEdit tools only| Changes made through Bash commands are not tracked
+Bash command changes| Rewinding doesn’t undo changes a Bash command made, except in files the main conversation had already edited with a tool such as Write or Edit
Subagent edits| Edits a [subagent](</docs/en/agent-sdk/subagents>) applies aren’t tracked, except a skill with `context: fork` running in the foreground. A rewind reverts them only in files the main conversation had already edited; use git to revert the rest
Same session| Checkpoints are tied to the session that created them
File content only| Creating, moving, or deleting directories is not undone by rewinding
--- a/glossary.md
+++ b/glossary.md
@@ -112,7 +112,7 @@
Checkpoint
-A restore point created at each prompt you send that starts a turn. Claude Code snapshots files before every edit so a checkpoint can revert them. Press `Esc` twice or run `/rewind` to restore code, conversation, or both to an earlier point, or to summarize part of the conversation from a selected message. Checkpoints are saved with the conversation, so a resumed session can still `/rewind` to them. They’re separate from git and don’t track changes made through the Bash tool. Learn more: [Checkpointing](</docs/en/checkpointing>)
+A restore point created at each prompt you send that starts a turn. Claude Code snapshots files before every edit so a checkpoint can revert them. Press `Esc` twice or run `/rewind` to restore code, conversation, or both to an earlier point, or to summarize part of the conversation from a selected message. Checkpoints are saved with the conversation, so a resumed session can still `/rewind` to them. Rewinding doesn’t undo a Bash command’s changes to a file unless Claude had already used its file editing tools on that file in your conversation. Learn more: [Checkpointing](</docs/en/checkpointing>)
###
--- a/interface.md
+++ b/interface.md
@@ -466,7 +466,7 @@
Keyboard focus and hotkeys
-Your mod never reads the keyboard itself. The user presses a key, Claude Code decides which of your controls it’s for, and that control’s callback runs. Apart from a [digit hotkey on the band](</docs/en/plugins/mods/reference#elements>), that happens only while your pane or band has keyboard focus. The rest of the time, keys go to the prompt. In the VS Code extension, buttons have no hotkeys: the user clicks a button or presses Enter on it, and types into fields.
+Your mod never reads the keyboard itself. The user presses a key, Claude Code decides which of your controls it’s for, and that control’s callback runs. Apart from a [digit hotkey on the band or an `action` binding](</docs/en/plugins/mods/reference#elements>), that happens only while your pane or band has keyboard focus. The rest of the time, keys go to the prompt. In the VS Code extension, buttons have no hotkeys: the user clicks a button or presses Enter on it, and types into fields.
####
@@ -478,7 +478,7 @@
* Your mod opens it with `focus: true` from a command or a press
* The user presses Ctrl+X then Tab
- * The user clicks it
+ * The user clicks it, which in the terminal needs [fullscreen rendering](</docs/en/fullscreen>)
Claude Code grants `focus: true` only while the prompt is empty and nothing else has keyboard focus. A pane that opens while the user is typing doesn’t take their keystrokes.
@@ -499,6 +499,7 @@
Page Up, Page Down, Home, and End| Scroll your pane or band when it has more rows than it can show
Ctrl+X then an arrow key| Resizes your pane. Left or Up gives it more room, and Right or Down gives the room back. A pane beside the transcript stops widening at 45% of the terminal’s width.
Ctrl+X then X| Closes your pane, even while one of its fields has the focus
+Ctrl+X then Ctrl+A| Collapses the band to one row while a mod draws there, or expands it again. These keys also work while the prompt has the focus.
Esc| Returns keyboard focus to the prompt. With `closeOnEscape: true`, it also closes the pane.
A mod can’t bind Tab or the arrow keys to anything else, so a game steers with `w`, `a`, `s`, and `d`.
@@ -520,6 +521,23 @@
With `plain: true`| `1: One`| The label with a small key beside it| The label, and the hotkey does nothing
In the terminal, name the key in a bracketed button’s label, or use `plain: true`, so the user can see what to press. The [elements reference](</docs/en/plugins/mods/reference#elements>) has the other `Button` rules: `action`, digit hotkeys on the band, and two buttons on one hotkey.
+
+####
+
+
+
+When the user collapses the band
+
+In the terminal, while a mod draws in the band, the user can collapse the band to one row to get it out of the way:
+
+ * **Click`[-]`**: while the band is expanded, Claude Code draws this mark at the right end of its first row. In [fullscreen rendering](</docs/en/fullscreen>), the user clicks it to collapse the band.
+ * **Press Ctrl+X then Ctrl+A** : this works whether the prompt, the band, or a pane has keyboard focus. The user can [bind other keys](</docs/en/keybindings#above-prompt-actions>) to it through the `abovePrompt:toggle` action.
+
+A collapsed band hides everything the mods draw there and shows one dim row instead, which names the keys that expand it as the user has them bound:
+
+ ▸ plugin panel hidden · ctrl+x ctrl+a or click to show
+
+The same keys, or in fullscreen rendering a click on the row, expand the band again. Until then, nothing presses a button in it: no hotkey, no digit typed into an empty prompt, and no keybinding for a button’s [`action`](</docs/en/plugins/mods/reference#elements>). If the band has keyboard focus when the user collapses it, the focus returns to the prompt, and Ctrl+X then Tab skips the band while it’s collapsed. The band stays collapsed until the user expands it, even after `/clear`, and is expanded again the next time Claude Code starts. Your mod can’t expand it or tell that it’s collapsed: the `ui.render` hook keeps running, and nothing in `e.props` says so. Don’t make the band the only place your mod shows something the user has to answer.
###
--- a/keybindings.md
+++ b/keybindings.md
@@ -136,6 +136,7 @@
`chat:externalEditor`| Ctrl+G, Ctrl+X Ctrl+E| Open in external editor. The [agent view dispatch input](</docs/en/agent-view#keyboard-shortcuts>) follows this action’s single-keystroke bindings too
`chat:stash`| Ctrl+S| Stash current prompt
`chat:imagePaste`| Ctrl+V (Alt+V on Windows and WSL)| Paste image from clipboard. On WSL, both shortcuts are bound by default
+`command:<name>`| (unbound)| Run the [command](</docs/en/commands>) `/<name>`. For example, `"meta+g": "command:compact"` in a `Chat` block makes `Meta+G` run `/compact`
*On Windows without VT mode (Node <24.2.0/<22.17.0, Bun <1.2.23), defaults to Meta+M.
--- a/managed-mcp.md
+++ b/managed-mcp.md
@@ -118,7 +118,7 @@
* `deniedMcpServers` applies to managed servers too, so a managed server that matches an entry won’t load.
* A user’s own `deniedMcpServers` merges in from their settings, so users can block a managed server for themselves.
-`allowedMcpServers` doesn’t apply to the servers in `managed-mcp.json`, with one exception: Claude Code still checks a server whose definition uses [`${VAR}` expansion](</docs/en/mcp#environment-variable-expansion-in-mcp-json>) against the allowlist, because that server’s effective configuration comes from each user’s environment rather than from the file alone. Before v2.1.259, every managed server had to pass the allowlist whenever one was set. See How a server is evaluated for which fields trigger the `${VAR}` check and the full order of checks. If you used `allowedMcpServers` to keep some of your own `managed-mcp.json` servers from loading, those servers start loading on each user’s first launch of v2.1.259 or later unless they use `${VAR}` expansion, with no prompt or notice: only `deniedMcpServers` still subtracts from those servers. Add denylist entries for them, or deploy a separate `managed-mcp.json` per group, before your users upgrade.
+The servers in `managed-mcp.json` need no `allowedMcpServers` entry, with one exception: Claude Code checks a server against the allowlist when it uses [`${VAR}` expansion](</docs/en/mcp#environment-variable-expansion-in-mcp-json>) outside `env`. Before v2.1.305, it also checked a server that used `${VAR}` expansion only in `env`, and before v2.1.259, every managed server whenever an allowlist was set. See How a server is evaluated for which fields trigger the `${VAR}` check and the full order of checks. If you used `allowedMcpServers` to keep some of your `managed-mcp.json` servers from loading, add `deniedMcpServers` entries for them, or deploy a separate `managed-mcp.json` per group, before your users upgrade. Unless they use `${VAR}` expansion outside `env`, these servers start loading on each user’s first launch of a version that doesn’t check them, with no prompt or notice.
###
@@ -399,11 +399,11 @@
Three groups of servers skip the allowlist check, in addition to the in-process `type: "sdk"` servers that skip all three checks:
- * The organization’s own servers: every `managedMcpServers` entry, and any `managed-mcp.json` entry whose values use no `${VAR}` expansion.
+ * The organization’s own servers: every `managedMcpServers` entry, and any `managed-mcp.json` entry whose values use no `${VAR}` expansion outside `env`.
* Built-in servers, such as Claude in Chrome, the `ide` server Claude Code connects to in a running VS Code or JetBrains IDE, and servers the CLI itself configures.
* A [Claude Tag](</docs/en/claude-tag>) session’s Slack tools: the servers it uses to read the thread and post its replies load without an allowlist entry.
-A `managed-mcp.json` server that uses `${VAR}` expansion in its command, arguments, `env`, URL, or headers is still checked. Claude Code also checks every server a user, a plugin, or claude.ai adds, and every server a user passes with `--mcp-config`.
+A `managed-mcp.json` server that uses `${VAR}` expansion in its command, arguments, URL, or headers is still checked. Claude Code also checks every server a user, a plugin, or claude.ai adds, and every server a user passes with `--mcp-config`. For the versions that changed which `managed-mcp.json` servers are checked, and how to keep one from loading, see How allowlists and denylists apply to the managed set.
###
--- a/managed-settings.md
+++ b/managed-settings.md
@@ -100,7 +100,7 @@
* **Server-managed** : Anthropic’s servers, or your gateway, hold the policy. Claude Code keeps a local cache that it applies at startup and [replaces on each successful fetch](</docs/en/server-managed-settings#security-considerations>).
* **macOS configuration profile** : the `com.anthropic.claudecode` managed preferences domain. Use the same top-level keys as `managed-settings.json`, with nested settings as dictionaries and lists as plist arrays.
* **Windows HKLM registry** : the JSON as a `REG_SZ` or `REG_EXPAND_SZ` value named `Settings` under `HKLM\SOFTWARE\Policies\ClaudeCode`.
- * **File-based** : `managed-settings.json`, an optional `managed-settings.d/` directory, and `managed-mcp.json` in the system directory: `/Library/Application Support/ClaudeCode/` on macOS, `/etc/claude-code/` on Linux and WSL, and `C:\Program Files\ClaudeCode\` on Windows. Claude Code doesn’t read the legacy Windows path `C:\ProgramData\ClaudeCode\managed-settings.json`.
+ * **File-based** : `managed-settings.json`, an optional `managed-settings.d/` directory, and `managed-mcp.json` in the system directory: `/Library/Application Support/ClaudeCode/` on macOS, `/etc/claude-code/` on Linux and WSL, and `C:\Program Files\ClaudeCode\` on Windows. Claude Code doesn’t read the legacy Windows path `C:\ProgramData\ClaudeCode\managed-settings.json`. You can deploy any of these files as a symbolic link, and Claude Code reads the file the link leads to. The policy still applies when the link leads outside the system directory or Claude Code can’t confirm that it stays inside. A warning naming the file then appears in `/status` and `claude doctor`. To clear the warning, point the link at a target inside the system directory.
* **Windows HKCU registry** : the same `Settings` value under `HKCU\SOFTWARE\Policies\ClaudeCode`.
###
--- a/manifest-reference.md
+++ b/manifest-reference.md
@@ -199,7 +199,9 @@
Directory listing fields
-Anthropic’s directory reads the `icon`, `documentationUrl`, `supportUrl`, `privacyPolicyUrl`, and `termsOfServiceUrl` fields from `plugin.json` for your plugin’s listing when you [submit the plugin](</docs/en/plugins/publish#submit-to-anthropics-directory>). Claude Code ignores them at load time. Set them only in `plugin.json`. In a marketplace entry, `claude plugin validate` reports each one as an unknown field. Set `icon` to the path of an image file inside the plugin, such as `./logo.png`, and each of the four URL fields to an `https://` URL. `claude plugin validate` accepts these fields without a warning on Claude Code v2.1.281 or later. Earlier versions print an `Unknown field` warning for each one, so a `--strict` run fails on those versions.
+Anthropic’s directory reads the `icon`, `documentationUrl`, `supportUrl`, `privacyPolicyUrl`, and `termsOfServiceUrl` fields from `plugin.json` for your plugin’s listing when you [submit the plugin](</docs/en/plugins/publish#submit-to-anthropics-directory>). Claude Code ignores them at load time. Set them only in `plugin.json`. In a marketplace entry, `claude plugin validate` reports each one as an unknown field. Set `icon` to the path of an image file inside the plugin, such as `./logo.png`, and each of the four URL fields to an `https://` URL.
+
+`claude plugin validate` doesn’t report these fields in `plugin.json` as unknown on Claude Code v2.1.281 or later. Earlier versions print an `Unknown field` warning for each one, so a `--strict` run fails on those versions.
###
--- a/mcp.md
+++ b/mcp.md
@@ -536,7 +536,12 @@
OAuth2 authentication
-The [MCP specification supports OAuth 2.1](<https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization>) for authorization. The SDK doesn’t open a browser or run an interactive OAuth flow. When a configured server returns an authorization challenge and no stored token is available, the agent run continues without that server’s tools, and the server reports status `needs-auth`. The `mcp_servers` array of the [system init message](</docs/en/agent-sdk/typescript#sdksystemmessage>) may still show `pending` for that server when it’s emitted. To confirm whether a server needs credentials, poll `mcpServerStatus()` in the TypeScript SDK or [`get_mcp_status()`](</docs/en/agent-sdk/python#methods>) in Python. To supply credentials, complete the OAuth flow in your own application and pass the resulting access token in the server’s `headers`:
+The [MCP specification supports OAuth 2.1](<https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization>) for authorization. The SDK doesn’t open a browser or run an interactive OAuth flow. When a configured server returns an authorization challenge and Claude Code has no token to send, the SDK reports the server as `needs-auth` or `failed`:
+
+ * **`needs-auth`** : Claude Code found no sign-in it can use for the server. Pass a token in `headers`, or [sign in from an interactive Claude Code session](</docs/en/mcp#authenticate-with-remote-mcp-servers>) on the same machine before the run.
+ * **`failed`** , with an `error` in its [`McpServerStatus`](</docs/en/agent-sdk/typescript#mcpserverstatus>) entry that starts with `Couldn't read the stored credentials` or `A request to MCP server`: Claude Code couldn’t read its credential store. For what to do, see [Couldn’t read the stored credentials for MCP server](</docs/en/errors#couldnt-read-the-stored-credentials-for-mcp-server>). Before Claude Code v2.1.307, the status was `needs-auth` instead when a Mac’s login keychain was locked.
+
+In either case, the agent run continues without that server’s tools. The `mcp_servers` array of the [system init message](</docs/en/agent-sdk/typescript#sdksystemmessage>) may still show `pending` for that server when it’s emitted. To confirm whether a server needs credentials, poll `mcpServerStatus()` in the TypeScript SDK or [`get_mcp_status()`](</docs/en/agent-sdk/python#methods>) in Python. To supply credentials, complete the OAuth flow in your own application and pass the resulting access token in the server’s `headers`:
TypeScript
--- a/memory.md
+++ b/memory.md
@@ -95,7 +95,7 @@
Keep your files short, organized, and consistent:
- * **Size** : target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence. Move instructions that matter for only part of the codebase into path-scoped rules, which load only when Claude works with matching files. Imports help you organize a long file but don’t reduce its context cost, because imported files also load at launch.
+ * **Size** : target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence. Move instructions that matter for only part of the codebase into path-scoped rules, which load only when Claude works with matching files. Imports help you organize a long file but don’t reduce its context cost, because imported files load together with the CLAUDE.md that imports them.
* **Structure** : group related instructions under markdown headers and bullets. Organized sections are easier for Claude to follow than dense paragraphs.
* **Consistency** : if two instructions contradict each other, Claude may pick one arbitrarily. Review your CLAUDE.md files, nested CLAUDE.md files in subdirectories, and `.claude/rules/` periodically to remove outdated or conflicting instructions. To have Claude find them for you, run a prompt audit.
@@ -113,7 +113,7 @@
Import additional files
-CLAUDE.md files can import additional files using `@path/to/import` syntax. Imported files are expanded and loaded into context at launch alongside the CLAUDE.md that references them. Both relative and absolute paths are allowed. Relative paths resolve relative to the file containing the import, not the working directory. Imported files can recursively import other files, with a maximum depth of four hops. To import a file whose path contains spaces, put a backslash before each space. Without the backslashes, the path ends at the first space, even when the import is on a line of its own. A path wrapped in quotes isn’t imported at all, with or without the backslashes. This import loads a file from a folder named `Design Docs`:
+CLAUDE.md files can import additional files using `@path/to/import` syntax. Imported files are expanded and loaded into context alongside the CLAUDE.md that references them. Both relative and absolute paths are allowed. Relative paths resolve relative to the file containing the import, not the working directory. Imported files can recursively import other files, with a maximum depth of four hops. To import a file whose path contains spaces, put a backslash before each space. Without the backslashes, the path ends at the first space, even when the import is on a line of its own. A path wrapped in quotes isn’t imported at all, with or without the backslashes. This import loads a file from a folder named `Design Docs`:
- API conventions @Design\ Docs/api-conventions.md
@@ -542,7 +542,11 @@
How it works
-The first 200 lines of `MEMORY.md`, or the first 25KB, whichever comes first, are loaded at the start of every conversation. Content beyond that threshold is not loaded at session start. Claude keeps `MEMORY.md` concise by moving detailed notes into separate topic files. After Claude writes to `MEMORY.md`, Claude Code measures the file against the 200-line and 25KB read limits. If the file is near a limit, Claude Code reminds Claude to shorten it: keep one line per entry, move detail into topic files, and merge or drop stale entries. If the file is over a limit, the write still succeeds, but Claude Code returns an [error telling Claude to rewrite the index](</docs/en/errors#memory-index-is-over-its-read-limit>), because everything past the limit is dropped on the next load. This limit applies only to `MEMORY.md`. Claude Code loads a CLAUDE.md file of up to 4 MiB in full and skips a larger file. Shorter files produce better adherence. Claude Code doesn’t load topic files such as `user_role.md` or `feedback_testing.md` at startup. Claude reads them on demand using its standard file tools when it needs the information. The main conversation’s auto memory isn’t loaded into [subagents](</docs/en/sub-agents#what-loads-at-startup>); the exception is a [fork](</docs/en/sub-agents#fork-the-current-conversation>), which inherits the parent conversation and system prompt. A subagent’s own auto memory, enabled with the subagent `memory` field, is a separate directory. Claude reads and writes memory files during your session. When you see messages like “Saved 2 memories” or “Recalled 2 memories” in the Claude Code interface, Claude is actively updating or reading from `~/.claude/projects/<project>/memory/`. When Claude writes a memory file that begins with YAML frontmatter, Claude Code records the write time in a `modified` frontmatter field as an ISO 8601 timestamp. The timestamp shows how current the fact is, both to you and to Claude when it reads the memory back.
+The first 200 lines of `MEMORY.md`, or the first 25KB, whichever comes first, are loaded at the start of every conversation. Content beyond that threshold is not loaded at session start. Claude keeps `MEMORY.md` concise by moving detailed notes into separate topic files. After Claude writes to `MEMORY.md`, Claude Code measures the file against the 200-line and 25KB read limits. If the file is near a limit, Claude Code reminds Claude to shorten it: keep one line per entry, move detail into topic files, and merge or drop stale entries. If the file is over a limit, the write still succeeds, but Claude Code returns an [error telling Claude to rewrite the index](</docs/en/errors#memory-index-is-over-its-read-limit>), because everything past the limit is dropped on the next load.
+
+This limit applies only to `MEMORY.md`. Claude gets the whole of each CLAUDE.md file that loads at launch, as long as the file is 4 MiB or smaller. Claude Code skips a file over 4 MiB and loads none of it. Path-scoped rules and CLAUDE.md files in subdirectories have a smaller per-file limit of their own.
+
+Claude Code doesn’t load topic files such as `user_role.md` or `feedback_testing.md` at startup. Claude reads them on demand using its standard file tools when it needs the information. The main conversation’s auto memory isn’t loaded into [subagents](</docs/en/sub-agents#what-loads-at-startup>); the exception is a [fork](</docs/en/sub-agents#fork-the-current-conversation>), which inherits the parent conversation and system prompt. A subagent’s own auto memory, enabled with the subagent `memory` field, is a separate directory. Claude reads and writes memory files during your session. When you see messages like “Saved 2 memories” or “Recalled 2 memories” in the Claude Code interface, Claude is actively updating or reading from `~/.claude/projects/<project>/memory/`. When Claude writes a memory file that begins with YAML frontmatter, Claude Code records the write time in a `modified` frontmatter field as an ISO 8601 timestamp. The timestamp shows how current the fact is, both to you and to Claude when it reads the memory back.
###
@@ -616,7 +620,31 @@
My CLAUDE.md is too large
-Files over 200 lines consume more context and may reduce adherence. Claude Code skips a file over 4 MiB. Use path-scoped rules to load instructions only when Claude works with matching files, or trim content that isn’t needed in every session. Splitting into `@path` imports helps organization but doesn’t reduce context, since imported files load at launch. If one of your instruction files is over the recommended length, you see a warning at startup and when you run `/status`. You also see a warning when files that are each within that length add up past a combined limit at session start. Each CLAUDE.md, rules file, and `@path` import counts as a separate file. The [`/doctor`](</docs/en/commands#all-commands>) checkup proposes trims for a checked-in CLAUDE.md: it cuts content Claude can derive from the codebase, such as directory layouts, dependency lists, and architecture overviews, and keeps pitfalls, rationale, and conventions that differ from tool defaults.
+Files over 200 lines consume more context and may reduce adherence. Claude Code skips a file over 4 MiB. Use path-scoped rules to load instructions only when Claude works with matching files, or trim content that isn’t needed in every session. Splitting into `@path` imports helps organization but doesn’t reduce context, since imported files load with the CLAUDE.md importing them. If one of your instruction files is over the recommended length, you see a warning at startup and when you run `/status`. You also see a warning when files that are each within that length add up past a combined limit at session start. Each CLAUDE.md, rules file, and `@path` import counts as a separate file. The [`/doctor`](</docs/en/commands#all-commands>) checkup proposes trims for a checked-in CLAUDE.md: it cuts content Claude can derive from the codebase, such as directory layouts, dependency lists, and architecture overviews, and keeps pitfalls, rationale, and conventions that differ from tool defaults.
+
+Keep each path-scoped rules file within its own per-file size limit, because Claude receives only the start of a file that’s over it.
+
+###
+
+
+
+Claude ignores the end of my subdirectory CLAUDE.md
+
+When a subdirectory `CLAUDE.md` or a rules file that loads on demand is over a per-file size limit, Claude receives only the start of it. That part ends with a note telling Claude to read the rest with the Read tool, and until Claude chooses to, the later instructions aren’t in its context. Check whether your file is over the limit, and shrink it if it is:
+
+ 1. Confirm that the limit applies to your file. The limit applies to these files, which load on demand:
+ * `CLAUDE.md` and `CLAUDE.local.md` in a subdirectory of the directory where you started Claude Code, and the files they import with `@path`
+ * Rules files in a subdirectory’s `.claude/rules/`
+ * Path-scoped rules in your project’s `.claude/rules/` or in `~/.claude/rules/`
+ 2. Find the limit for your session’s [context window](</docs/en/model-config#extended-context>):
+ * **200K context window** : 40,000 characters
+ * **1M context window** : 200,000 characters on Claude Opus 4.6 and Claude Sonnet 4.6, and 150,000 characters on later models
+ 3. In Bash or Zsh, run `wc -m path/to/CLAUDE.md` to print your file’s character count.
+ 4. Compare the count with your limit:
+ * **Over the limit** : trim the file, or move part of it into one or more rules files, which each count against the limit on their own
+ * **Under the limit** : look for another cause under Claude isn’t following my CLAUDE.md
+
+Before v2.1.309, Claude Code didn’t apply this limit to files that load on demand.
###
--- a/model-config.md
+++ b/model-config.md
@@ -871,7 +871,7 @@
When you pin a model on a third-party provider, its row in the `/model` picker shows the model’s name by default if Claude Code recognizes the pinned ID, and the raw ID otherwise:
* **Recognized** : the exact ID of a model Claude Code knows, such as its Anthropic API ID or your provider’s or gateway’s form of it, with or without the `[1m]` suffix. Pin `us.anthropic.claude-sonnet-4-5-20250929-v1:0` and the row reads `Sonnet 4.5`.
- * **Not recognized** : any other ID, such as an application inference profile ARN or a model version Claude Code doesn’t know, unless a `modelOverrides` entry maps a model to that exact string. On Microsoft Foundry, deployment names are user-defined, so Claude Code never recognizes a pinned ID there, mapped or not, and the row shows the deployment name by default.
+ * **Not recognized** : any other ID, such as an application inference profile ARN or a model version Claude Code doesn’t know, unless a `modelOverrides` entry maps a model to that ID. On Microsoft Foundry, deployment names are user-defined, so Claude Code never recognizes a pinned ID there, mapped or not, and the row shows the deployment name by default.
When a row shows the model’s name, its default description includes the pinned ID so you can still see which ID is pinned. Claude Code may also not recognize which features a pinned model supports. You can set the display name and description yourself and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`.
Show diff (155 lines)
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -519,7 +519,7 @@
Attribute telemetry to cloud sessions
-By default, metrics and events from a cloud session carry the standard attributes, including `session.id`, `ccr.session.id`, and `organization.id`, so you can filter by session or organization without extra configuration. The `ccr.session.id` value is the session’s `CLAUDE_CODE_REMOTE_SESSION_ID`. To turn it into the session’s transcript URL, see [Link output back to the session](</docs/en/cloud-environments#link-output-back-to-the-session>). To attribute telemetry in more detail, use these options:
+By default, metrics and events from a cloud session carry the standard attributes, including `session.id`, `ccr.session.id`, and `organization.id`, so you can filter by session or organization without extra configuration. The `ccr.session.id` value is the session’s `CLAUDE_CODE_REMOTE_SESSION_ID`. To turn it into the session’s transcript URL, see [Link output back to the session](</docs/en/cloud-environments#link-output-back-to-the-session>). To tell cloud sessions apart, group or filter on `ccr.session.id`, not `session.id`. To attribute telemetry in more detail, use these options:
* **Identify Claude Tag sessions** : set `OTEL_METRICS_INCLUDE_ENTRYPOINT=true`, as described under Metrics cardinality control. Metrics then carry `app.entrypoint`, whose value is `claude-in-slack` for Claude Tag sessions.
* **Add custom attributes** : set `OTEL_RESOURCE_ATTRIBUTES` in the same place you set the other `OTEL_*` variables for those sessions. If you `export` it in the environment’s [setup script](</docs/en/cloud-environments#setup-scripts>) instead, the value doesn’t reach Claude Code: the setup script is a separate Bash script that runs before Claude Code launches, and variables it exports end with it.
@@ -542,7 +542,7 @@
Attribute| Description| Controlled By
---|---|---
-`session.id`| Unique session identifier| `OTEL_METRICS_INCLUDE_SESSION_ID` (default: true)
+`session.id`| Claude Code’s own session ID, which `/clear` replaces| `OTEL_METRICS_INCLUDE_SESSION_ID` (default: true)
`ccr.session.id`| Cloud session identifier, the value of `CLAUDE_CODE_REMOTE_SESSION_ID`, on sessions that run in a [cloud environment](</docs/en/cloud-environments>)| `OTEL_METRICS_INCLUDE_SESSION_ID` (default: true)
`app.version`| Current Claude Code version| `OTEL_METRICS_INCLUDE_VERSION` (default: false)
`app.entrypoint`| How the session was launched, such as `cli`, `sdk-cli`, `sdk-ts`, `sdk-py`, `claude-vscode`, or `claude-in-slack` for Claude Tag sessions| `OTEL_METRICS_INCLUDE_ENTRYPOINT` (default: false)
@@ -744,7 +744,7 @@
* `message.uuid` on `user_prompt`, `assistant_response`, and `api_response_body`
* `request_id` on the API events, persisted as `requestId` on the transcript’s assistant entries
- * `tool_use_id` on `tool_result` and `tool_decision` events
+ * `tool_use_id` on `tool_result` and `tool_decision` events, and on `safety_event` events except those for the end of a turn
####
@@ -963,7 +963,7 @@
* The auto mode classifier, whose verdict the same event records in `classifier_verdict`
* A grant for the rest of the session, given at an earlier permission prompt in the same interactive CLI session
* The tool being inherently safe
-The `source` value doesn’t indicate which of these sources matched. Claude Code also reports `"config"` when the permission prompt request itself fails. For example, that request fails when the Agent SDK’s [`canUseTool`](</docs/en/agent-sdk/typescript#canusetool>) callback or the [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) tool returns an invalid result, or when the input stream closes while the request is pending. Before v2.1.216, Claude Code reported these failures as `"user_reject"`.
+The `source` value doesn’t indicate which of these sources matched. To find which one refused a call, look for the Safety event with the same `tool_use_id` and read its `category` and `rule_source` attributes. Some refused calls have no safety event. Claude Code also reports `"config"` when the permission prompt request itself fails. For example, that request fails when the Agent SDK’s [`canUseTool`](</docs/en/agent-sdk/typescript#canusetool>) callback or the [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) tool returns an invalid result, or when the input stream closes while the request is pending. Before v2.1.216, Claude Code reported these failures as `"user_reject"`.
* `"hook"`: A `PreToolUse` or `PermissionRequest` hook returned the decision.
* `"user_permanent"`: Emitted when the user chose “Yes, and don’t ask again for …” at a permission prompt, which saves an allow rule to their personal settings. In the interactive CLI this is emitted only for that choice itself; later calls that match the saved rule emit `"config"` instead. In Agent SDK or non-interactive `-p` sessions, both the initial choice and later rule matches emit `"user_permanent"`. Treated as an accept.
* `"user_temporary"`: Emitted when the user chose “Yes” at a permission prompt for a one-time approval, or chose an option that grants access for the rest of the session on a file edit or read prompt. In the interactive CLI this is emitted only for the choice itself; later calls allowed by that session-scoped grant emit `"config"` instead. In Agent SDK or non-interactive `-p` sessions, both the choice and later matches emit `"user_temporary"`. Treated as an accept.
@@ -979,10 +979,10 @@
* Claude Code approved the call in auto mode without asking the classifier
* The user answered the prompt Claude Code showed after [repeated blocks](</docs/en/permission-modes#repeated-block-thresholds>)
* In a `-p` run without `--permission-prompt-tool`, Claude Code denied the call after repeated blocks because there was nobody to answer a prompt. That event reports `decision` as `"reject"` and `source` as `"config"`
- * `classifier_category` (when `OTEL_LOG_TOOL_DETAILS=1`): The name of the [built-in rule](</docs/en/auto-mode-config#inspect-the-defaults-and-your-effective-config>) the classifier named when it blocked the call, in lowercase with underscores, such as `"data_exfiltration"` for the Data Exfiltration rule. Requires Claude Code v2.1.301 or later. The attribute is present when all of these hold:
+ * `classifier_category` (when `OTEL_LOG_TOOL_DETAILS=1`): The name of the [built-in rule](</docs/en/auto-mode-config#inspect-the-defaults-and-your-effective-config>) the classifier named when it blocked the call, in lowercase with underscores, such as `"data_exfiltration"` for the Data Exfiltration rule. Requires Claude Code v2.1.301 or later. The attribute is present when both of these hold:
* `classifier_verdict` is `"block"`
- * Claude Code sent the classifier request itself, rather than using [server-side classifier review](</docs/en/permission-modes#server-side-classifier-review>)
* The classifier named exactly one rule, and that rule is a built-in one rather than one you wrote
+Before v2.1.302, the attribute was also absent on any block that [server-side classifier review](</docs/en/permission-modes#server-side-classifier-review>) decided.
* `permission_mode`: [Permission mode](</docs/en/permission-modes>) active when this call’s permission check began: `"default"`, `"plan"`, `"acceptEdits"`, `"bypassPermissions"`, `"dontAsk"`, or `"auto"`. Manual mode appears as `"default"`. A [subagent](</docs/en/sub-agents#permission-modes>) call reports the subagent’s permission mode rather than the session’s. Requires Claude Code v2.1.301 or later
* `tool_parameters` (when `OTEL_LOG_TOOL_DETAILS=1`): JSON string containing tool-specific parameters. Same shape as the Tool result event, minus post-execution fields such as `git_commit_id`. Values may differ from `tool_result` for an accepted call if the permission decision rewrites the tool input via `updatedInput`. Use this attribute to see which command was rejected when `decision` is `"reject"`.
* For `"sdk_host_builtin_mcp"` tools: `mcp_server_name` and `mcp_tool_name` are included even when `OTEL_LOG_TOOL_DETAILS` is off, because the host application defines these names; without them, a rejected call to one of these built-in servers would be unattributable on the default stream. For user-configured MCP servers, the event’s `tool_name` is always the literal `"mcp_tool"`, and the server and tool names appear only in `tool_parameters` with the flag on; argument content requires the flag everywhere.
@@ -992,6 +992,87 @@
* For Agent tool or legacy Task tool: includes `subagent_type`
If you lower the OpenTelemetry SDK’s `OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT` below the number of attributes on a `tool_decision` event, the SDK drops the attributes that Claude Code set last. The SDK drops `permission_mode` first, `classifier_category` second, and `classifier_verdict` third, and drops the event’s other attributes only after those three. This ordering requires Claude Code v2.1.302 or later.
+
+####
+
+
+
+Safety event
+
+Logged when a check refuses a tool call or requires a permission prompt, except for calls without a safety event. Also logged when the [sandbox’s network proxy](</docs/en/sandboxing#network-isolation>) refuses a connection or request, and when a hook blocks a result. Requires Claude Code v2.1.307 or later. The event exports with the other events and has no separate setting. The event’s own attributes hold no command text, file paths, host names, or MCP server and tool names. The record also carries the standard attributes every event has, which can include `workspace.host_paths` and the repository attributes. To see the command or MCP tool behind an event, set `OTEL_LOG_TOOL_DETAILS=1` and read `tool_parameters` on the matching `tool_decision` event. **Event Name** : `claude_code.safety_event` **Attributes** :
+
+ * All standard attributes
+ * `event.name`: `"safety_event"`
+ * `event.timestamp`: ISO 8601 timestamp
+ * `event.sequence`: per-process counter for ordering events, described under Event correlation attributes
+ * `category`: The check or outcome, a category value
+ * `decision`: `"accept"`, `"reject"`, or `"sent_back"` when a hook blocked a result or turn end
+ * `decision_source`: Who or what decided, a `tool_decision` `source` value or `"other"`
+ * `reason_code`: The check’s reason, such as `"rule:policySettings"`, `"mode:dontAsk"`, `"hook:PreToolUse"`, `"classifier:auto-mode"`, `"bashMiss:too-complex"`, or `"unknown"`
+ * `reason_type`: The check’s reason type, such as `"rule"`, `"subcommandResults"`, `"mode"`, `"hook"`, `"classifier"`, or `"asyncAgent"`
+ * `rule_source`: Settings source of the rule involved, such as `"policySettings"`, `"userSettings"`, `"projectSettings"`, `"localSettings"`, `"flagSettings"`, `"cliArg"`, or `"session"`
+ * `grant_scope`: `"once"` or `"session"` for a prompt approved without saving a rule to a settings file
+ * `circuit_breaker`: The built-in safety check, such as `"dangerousRemoval"`, `"outsideReadsBlocked"`, or `"claudeSettingsFile"`
+ * `classifier_category`: With `OTEL_LOG_TOOL_DETAILS=1`, the [built-in rule](</docs/en/auto-mode-config#inspect-the-defaults-and-your-effective-config>) behind an auto mode block, such as `"data_exfiltration"`
+ * `hook_event`: `"pre_tool_use"` for a `PreToolUse` hook, or `"post_tool_use"`, `"post_tool_use_failure"`, `"stop"`, or `"subagent_stop"` on `"hook_review"` events
+ * `tool_class`: `"bash"` for Bash and [Monitor](</docs/en/tools-reference#monitor-tool>), `"powershell"`, `"file"` for Read, Edit, Write, NotebookEdit, Glob, and Grep, `"web"` for WebFetch and WebSearch, `"mcp"`, or `"other"`
+ * `tool_name`: The tool’s name, such as `"Bash"` for a built-in tool, or `"mcp_tool"`, `"skill_tool"`, `"dynamic_tool"`, or `"other_tool"`
+ * `tool_source`: `"builtin"`, `"mcp"`, or `"sdk_host_builtin_mcp"`, as on `tool_decision`
+ * `permission_mode`: The call’s [permission mode](</docs/en/permission-modes>) when checked: `"default"`, `"plan"`, `"acceptEdits"`, `"bypassPermissions"`, `"dontAsk"`, or `"auto"`
+ * `tool_use_id`: The call’s ID, as on `tool_decision` and `tool_result`
+ * `sandbox_violation_count`: How many distinct connections or requests from the call’s command the sandbox’s network proxy refused, `"0"` to `"20"` as a string. Refusals are counted for a sandboxed command that finished in the foreground
+ * `sandbox_enabled`: `"true"` if [sandboxing](</docs/en/sandboxing>) is on for the session, else `"false"`
+
+These are the event’s own attributes when a managed-settings deny rule refuses a Bash command:
+
+ {
+ "event.name": "safety_event",
+ "category": "managed_policy",
+ "decision": "reject",
+ "decision_source": "config",
+ "reason_code": "rule:policySettings",
+ "rule_source": "policySettings",
+ "tool_class": "bash",
+ "tool_name": "Bash",
+ "tool_source": "builtin",
+ "permission_mode": "default",
+ "tool_use_id": "toolu_01ABC123...",
+ "sandbox_violation_count": "0",
+ "sandbox_enabled": "false"
+ }
+
+##### Safety event categories
+
+Value| Check or outcome| Detail attribute
+---|---|---
+`"permission_rule"`| A deny or ask [permission rule](</docs/en/permissions#manage-permissions>) outside managed settings| `rule_source`
+`"managed_policy"`| A deny or ask rule from [managed settings](</docs/en/permissions#managed-settings>)| `rule_source`
+`"permission_mode"`| [`dontAsk`](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>) or [plan](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) mode, or a prompt with no category in a session that can’t show prompts, as with [`--permission-prompts none`](</docs/en/headless#turn-off-permission-prompts-in-unattended-runs>)| `reason_code`, `reason_type`
+`"hook"`| A hook, such as [`PreToolUse`](</docs/en/hooks#pretooluse>) or [`PermissionRequest`](</docs/en/hooks#permissionrequest>)| `hook_event`, `reason_code`
+`"auto_mode_block"`| The auto mode [classifier](</docs/en/permission-modes#how-the-classifier-evaluates-actions>) blocked the call| `classifier_category`
+`"auto_mode_no_verdict"`| No usable [classifier verdict](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>), such as after a failed request| `reason_code`
+`"safety_check"`| A built-in safety check, such as for Read, Edit, or Write outside your [working directories](</docs/en/permissions#working-directories>)| `circuit_breaker`
+`"static_analysis"`| How a Bash or Monitor command is written, such as one too complex to analyze| `reason_code`
+`"sandbox_override"`| The prompt to [run a command outside the sandbox](</docs/en/sandboxing#the-unsandboxed-retry-escape-hatch>)| `reason_code`
+`"user_rejected"`| Someone declined or dismissed a prompt that had no category or that only a hook required, or a `canUseTool` callback or `--permission-prompt-tool` tool denied one| `decision_source`
+`"sandbox_network"`| The call ran and the [sandbox’s network proxy](</docs/en/sandboxing#network-isolation>) refused a connection or request| `sandbox_violation_count`
+`"sandbox_other"`| Like `"sandbox_network"`, but no refused target reads as a host name or IP address| `sandbox_violation_count`
+`"hook_review"`| A hook [blocked the call’s result](</docs/en/hooks#posttooluse-decision-control>) or [the end of a turn](</docs/en/hooks#stop-decision-control>)| `hook_event`
+`"other"`| A refusal no other value describes| `reason_code`
+
+To find proxy refusals under any `category`, filter for a `sandbox_violation_count` that is present and isn’t `"0"`.
+
+##### Calls without a safety event
+
+To find calls refused because nobody could answer a prompt with no category, look for `tool_decision` events reporting `"reject"` with `source` `"config"` and no safety event sharing their `tool_use_id`. Such refusals happen in a `-p` run with neither [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) nor `--permission-prompts none`. Check calls such as these for a `tool_decision` event, since they have no safety event except `"sandbox_network"`, `"sandbox_other"`, or `"hook_review"` events sent after they run:
+
+ * A call approved at a prompt with no category
+ * A call that a `canUseTool` callback or `--permission-prompt-tool` tool approved at a prompt only a `PreToolUse` hook required
+ * An [`AskUserQuestion`](</docs/en/tools-reference#askuserquestion-tool-behavior>) or `ExitPlanMode` call, declined or not
+
+##### Prompts with no category
+
+A prompt has no category when no `category` value names its check, such as the `default` mode prompt for an edit inside your working directory.
####
@@ -1528,11 +1609,14 @@
Signal| Event| Key attributes
---|---|---
-Tool call allowed or denied, and where the decision came from, such as a rule, a hook, or the user| `tool_decision`| `decision`, `source`, `classifier_verdict`, `permission_mode`, `tool_name`; `tool_parameters` when you set `OTEL_LOG_TOOL_DETAILS=1`
+Tool call allowed or denied, and where the decision came from, such as configuration, a hook, or the user| `tool_decision`| `decision`, `source`, `classifier_verdict`, `permission_mode`, `tool_name`; `tool_parameters` when you set `OTEL_LOG_TOOL_DETAILS=1`
+Which check refused a tool call or required a permission prompt for it| `safety_event` where `category` names the check, such as `"managed_policy"`, `"permission_rule"`, `"hook"`, or `"auto_mode_block"`. `decision` is `"reject"` for a call that didn’t run. Some calls have no safety event| `category`, `decision`, `reason_code`, `rule_source`, `tool_name`, `tool_use_id`
Auto mode classifier allowed or blocked a tool call, or Claude Code denied the call without a classifier verdict| `tool_decision` where `classifier_verdict` is present. For a denial without a verdict, `classifier_verdict` is `"no_verdict"` or `"unavailable"`| `classifier_verdict`, `permission_mode`, `tool_name`; `classifier_category` when you set `OTEL_LOG_TOOL_DETAILS=1`
Permission mode escalation| `permission_mode_changed`| `from_mode`, `to_mode`, `trigger`
Which permission mode each tool call was checked in, including calls subagents make| `tool_decision`| `permission_mode`, `session.id`
Policy hook blocked an action| `hook_execution_complete`| `hook_event`, `num_blocking`
+Which tool call a hook refused, and which result or turn end a hook blocked| `safety_event` where `category` is `"hook"` and `decision` is `"reject"` for a refused call, or `category` is `"hook_review"` for a blocked result or turn end| `category`, `decision`, `hook_event`; `tool_use_id` for a tool call
+Sandbox’s network proxy refused a connection or request from a Bash or PowerShell command| `safety_event` where `sandbox_violation_count` is present and isn’t `"0"`| `sandbox_violation_count`, `category`, `sandbox_enabled`, `tool_use_id`
Login, logout, and authentication failure| `auth`| `action`, `success`, `error_category`
MCP server connect or failure| `mcp_server_connection`| `status`, `server_name`, `is_plugin`, `error_code`
Plugin installed and its source| `plugin_installed`| `plugin.name`, `marketplace.name`, `marketplace.is_official`
--- a/network-config.md
+++ b/network-config.md
@@ -165,12 +165,12 @@
Claude Code runs four independent timers that abort a streaming model response when it goes quiet, so a dead connection fails and retries instead of hanging. A request that gets no response headers at all ends in one of two ways:
- * **Where the first-byte deadline runs** : the first attempt ends at that deadline. To change it, set `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`. For the retry’s wait, see [No response from API](</docs/en/errors#no-response-from-api>).
- * **On the other connections** : the request ends after 5 to 6 minutes, when the body idle timeout fires, unless you turned that timeout off. To end it sooner, lower `API_TIMEOUT_MS`.
+ * **Where the first-byte deadline runs** : the first attempt ends no later than that deadline. To change it, set `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`. For the retry’s wait, see [No response from API](</docs/en/errors#no-response-from-api>).
+ * **On the other connections** : the request ends after 5 to 6 minutes, when the body idle timeout fires, unless you turned that timeout off. To end the request sooner, lower `API_TIMEOUT_MS`. In a [Claude apps gateway](</docs/en/claude-apps-gateway>) session, you can instead end the first attempt sooner by [turning on the first-byte deadline](</docs/en/claude-apps-gateway-deploy#retry-an-unanswered-request-sooner-with-the-first-byte-deadline>).
Timer| Aborts when| Runs on| Default timeout
---|---|---|---
-First-byte deadline| No response headers arrive after Claude Code sends the request| Direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), including through an HTTPS proxy, but not when `ANTHROPIC_BASE_URL` or `ANTHROPIC_AWS_BASE_URL` routes them through a [gateway](</docs/en/gateways>). Opt-in on Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry, or in a [Claude apps gateway](</docs/en/claude-apps-gateway>) session| 180 seconds on the direct Anthropic API, 300 seconds elsewhere, plus one second per 32KB of request body
+First-byte deadline| No response headers arrive after Claude Code sends the request| Direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), including through an HTTPS proxy, but not when `ANTHROPIC_BASE_URL` or `ANTHROPIC_AWS_BASE_URL` routes them through a [gateway](</docs/en/gateways>). Opt-in for a [Claude apps gateway session](</docs/en/claude-apps-gateway-deploy#retry-an-unanswered-request-sooner-with-the-first-byte-deadline>), and on Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry| 180 seconds on the direct Anthropic API and 300 seconds on Claude Platform on AWS or Amazon Bedrock, plus one second per 32KB of request body
Event-level watchdog| No response events parse. Where the byte-level watchdog runs on a connection other than Amazon Bedrock, arriving bytes, including keep-alive pings, also reset this watchdog, for a limited time without a parsed event. That time is about five minutes when bytes arrive at least every 10 seconds. On a Claude apps gateway’s 15-second pings it is about 7.5 minutes, so a pings-only stream ends after about 12.5 minutes at the default timeout.| Every provider| 300 seconds
Byte-level watchdog| No bytes arrive on the wire, including SSE keep-alive pings| Direct Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and [gateway](</docs/en/gateways>) connections, including a custom `ANTHROPIC_BASE_URL`. Opt-in on Amazon Bedrock `vnd.amazon.eventstream` responses with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry| 180 seconds on the direct Anthropic API. 300 seconds on Claude Platform on AWS, on Amazon Bedrock, in a [Claude apps gateway](</docs/en/claude-apps-gateway>) session, and through a custom `ANTHROPIC_BASE_URL`
Body idle timeout| No bytes arrive for 5 minutes, counting the wait for response headers| Providers other than the direct Anthropic API, Claude Platform on AWS, and Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` set, unless [`API_FORCE_IDLE_TIMEOUT`](</docs/en/env-vars>) changes that| 5 minutes
@@ -180,8 +180,8 @@
* `CLAUDE_ENABLE_STREAM_WATCHDOG` and `CLAUDE_ENABLE_BYTE_WATCHDOG` force the corresponding watchdog on with `1` or off with `0`, within the connections the table lists; neither variable extends a watchdog to a connection type it doesn’t cover. `CLAUDE_ENABLE_BYTE_WATCHDOG` set to `0` also turns off the first-byte deadline.
* `CLAUDE_STREAM_IDLE_TIMEOUT_MS` sets both watchdogs’ timeout. Claude Code raises values below 5 minutes to 5 minutes, and caps the value at 30 minutes for the byte-level watchdog.
* `CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS` sets the byte-level watchdog’s timeout without changing the event-level watchdog’s, clamped to between 10 seconds and 30 minutes, and takes precedence over `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for that watchdog.
- * `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` sets the first-byte deadline directly. Leave it unset and Claude Code uses the byte-level watchdog’s timeout, so `CLAUDE_STREAM_IDLE_TIMEOUT_MS` and `CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS` change the deadline too. For the clamps, the upload allowance, the `API_TIMEOUT_MS` cap, and how long the retry waits after a no-response abort, see [No response from API](</docs/en/errors#no-response-from-api>).
- * `API_TIMEOUT_MS` limits the wait for response headers, not how long a response streams after them. Where the first-byte deadline doesn’t run, such as a Claude apps gateway session, set it below `300000`, which is 5 minutes, to retry an unanswered request sooner. Keep it above the longest wait for headers, and the longest [non-streaming request](</docs/en/errors#streaming-response-ended-before-any-complete-data-was-received>), that you expect: a request that needs longer times out again on each retry.
+ * `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` sets the first-byte deadline. In a Claude apps gateway session, set this variable to [turn the deadline on](</docs/en/claude-apps-gateway-deploy#retry-an-unanswered-request-sooner-with-the-first-byte-deadline>). If you leave the variable unset on another connection where the deadline runs, Claude Code uses the byte-level watchdog’s timeout, so `CLAUDE_STREAM_IDLE_TIMEOUT_MS` and `CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS` change the deadline too. For the limits on the value, see [No response from API](</docs/en/errors#no-response-from-api>).
+ * `API_TIMEOUT_MS` limits the wait for response headers, not how long a response streams after them. Where the first-byte deadline doesn’t run, set `API_TIMEOUT_MS` to a positive value under `300000` to retry an unanswered request in less than 5 minutes. Keep `API_TIMEOUT_MS` above the longest wait for headers, and the longest [non-streaming request](</docs/en/errors#streaming-response-ended-before-any-complete-data-was-received>), that you expect: a request that needs longer times out again on each retry.
* `API_FORCE_IDLE_TIMEOUT` set to `0` turns the body idle timeout off, and set to `1` turns it on for every provider. The watchdogs run independently of it, so to let a stream pause longer than their thresholds, also raise or disable them.
When a watchdog aborts a stalled stream, Claude Code treats the abort as a mid-stream failure, and what you see depends on how far the response had got. Claude Code retries the request or ends the turn with an error, keeps the completed output and shows an [incomplete-response notice](</docs/en/errors#the-response-above-may-be-incomplete>), or ends the turn normally. [Automatic retries](</docs/en/errors#automatic-retries>) says where each outcome applies. In a [non-interactive session](</docs/en/headless>), and for a subagent’s response in any session, Claude Code may first prompt Claude to continue the cut-off response; [that notice’s entry](</docs/en/errors#the-response-above-may-be-incomplete>) says when it does and when you still see the notice. When the first-byte deadline fires, no response has started, so there is no partial output to keep. For how Claude Code re-sends the request and when the turn ends instead, see [No response from API](</docs/en/errors#no-response-from-api>).
--- a/observability.md
+++ b/observability.md
@@ -209,7 +209,14 @@
},
};
-With end-user identity attached, the `tool_decision`, `tool_result`, `mcp_server_connection`, and `permission_mode_changed` events, which export as log records named with a `claude_code.` prefix, become a per-user audit trail you can forward to a Security Information and Event Management (SIEM) platform. See [Audit security events](</docs/en/monitoring-usage#audit-security-events>) in the Monitoring reference for the full list of security-relevant events and the attributes each one carries.
+After you attach end-user identity, these events become a per-user audit trail you can forward to a Security Information and Event Management (SIEM) platform:
+
+ * `tool_decision` and `tool_result`: each tool call, whether it was allowed or denied, and its result
+ * `safety_event`: which check refused a tool call or required a permission prompt for it, such as a permission rule or the auto mode classifier. Some calls [have no safety event](</docs/en/monitoring-usage#calls-without-a-safety-event>). Requires Claude Code v2.1.307 or later
+ * `mcp_server_connection`: MCP server connections and connection failures
+ * `permission_mode_changed`: permission mode changes
+
+These events export as log records named with a `claude_code.` prefix, such as `claude_code.safety_event`. See [Audit security events](</docs/en/monitoring-usage#audit-security-events>) in the Monitoring reference for the full list of security-relevant events and the attributes each one carries.
##
@@ -222,7 +229,7 @@
Variable| Adds
---|---
`OTEL_LOG_USER_PROMPTS=1`| Prompt text on `claude_code.user_prompt` events and on the `claude_code.interaction` span
-`OTEL_LOG_TOOL_DETAILS=1`| Tool input arguments such as file paths, shell commands, and search patterns on `claude_code.tool_result` events, and real agent, skill, plugin, and MCP server names on the [cost and token metrics](</docs/en/monitoring-usage#cost-counter>)
+`OTEL_LOG_TOOL_DETAILS=1`| Tool input arguments such as file paths, shell commands, and search patterns on `claude_code.tool_result` events, and real agent, skill, plugin, and MCP server names on the [cost and token metrics](</docs/en/monitoring-usage#cost-counter>). The built-in rule the auto mode classifier named when it blocked a call, as [`classifier_category`](</docs/en/monitoring-usage#tool-decision-event>) on `claude_code.tool_decision` and `claude_code.safety_event` events
`OTEL_LOG_TOOL_CONTENT=1`| A [`tool.output` span event](</docs/en/monitoring-usage#tool-output-span-event>) on `claude_code.tool` with file contents, Bash output, and what MCP tools, WebFetch, and WebSearch return, truncated at 60 KB by default, configurable via `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH`, which requires Claude Code v2.1.214 or later. Results from MCP tools, WebFetch, and WebSearch require Claude Code v2.1.283 or later. Requires tracing to be enabled. Span attributes carry tool content under [their own gates](</docs/en/monitoring-usage#new-context-gates>)
`OTEL_LOG_RAW_API_BODIES`| Full Anthropic Messages API request and response JSON as `claude_code.api_request_body` and `claude_code.api_response_body` log events. Set to `1` for inline bodies truncated at 60 KB by default, or `file:<dir>` for untruncated bodies on disk with a `body_ref` path in the event. `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` configures the inline truncation limit, and requires Claude Code v2.1.214 or later. Bodies include the entire conversation history and have extended-thinking content redacted. Enabling this implies consent to everything the three variables above would reveal
--- a/permissions.md
+++ b/permissions.md
@@ -116,7 +116,7 @@
`plan`| Planning mode| Claude explores and plans without editing your source files; file edits are never auto-approved and prompt through your `canUseTool` callback
`auto`| Model-classified approvals| A model classifier reviews actions such as shell commands and network requests, allowing or blocking each one it reviews. See [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) for availability and the decision order
-**Subagent inheritance:** A subagent runs in the parent session’s permission mode unless you set `permissionMode` on its [`AgentDefinition`](</docs/en/agent-sdk/typescript#agentdefinition>) and the parent session is in `default`, `dontAsk`, or `plan` mode. Even then, Claude Code never applies a `"bypassPermissions"` value, and applies an `"auto"` value only when [auto mode is available](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to that subagent. A subagent runs in `bypassPermissions` mode only when the parent session itself does. The `bypassPermissions` exception requires Claude Code v2.1.267 or later.Subagents may have different system prompts and less constrained behavior than your main agent, so inheriting `bypassPermissions` grants them full, autonomous system access. The [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) still apply.
+**Subagent inheritance:** If your main session is in [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>), a subagent whose [`AgentDefinition`](</docs/en/agent-sdk/typescript#agentdefinition>) sets `permissionMode: "acceptEdits"` still runs in plan mode. That subagent’s `Edit` and `Write` calls on your source files still go to your `canUseTool` callback. Plan mode holds for the subagents you define too, so that handing work to one doesn’t get around reviewing the plan first.The subagent inherits `plan`, `acceptEdits`, `auto`, or `bypassPermissions` from the main session, and under a `default`\- or `dontAsk`-mode main session it runs in the mode you set. Even then, Claude Code never applies a `"bypassPermissions"` value, and applies an `"auto"` value only when [auto mode is available](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to that subagent. The `bypassPermissions` exception requires Claude Code v2.1.267 or later.Subagents may have different system prompts and less constrained behavior than your main agent, so inheriting `bypassPermissions` grants them full, autonomous system access. The [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) still apply.
###
--- a/prompt-caching.md
+++ b/prompt-caching.md
@@ -102,7 +102,7 @@
Mid-session change| Cache| Tool definitions in the next request
---|---|---
A server connects, or a [dynamic tool update](</docs/en/mcp#dynamic-tool-updates>) adds tools| Invalidated| The new definitions are added
-A server drops out with no action on your part, such as a stdio server’s process exiting| Kept| The server’s definitions stay unchanged. A call to one of its tools returns an error instead of running
+A server drops out with no action on your part, such as a stdio server’s process exiting| Kept| The server’s definitions stay unchanged. A call to one of its tools returns an error instead of running, unless Claude Code [starts the server again](</docs/en/mcp#stdio-servers-that-exit-or-fail-to-start>) for that call
A remote server [reconnects automatically](</docs/en/mcp#automatic-reconnection>) after its connection drops| Kept, unless a request sent while the server reconnects adds the `WaitForMcpServers` tool, which invalidates the cache once| The server’s definitions stay unchanged. A request sent while the server reconnects can add `WaitForMcpServers` when the conversation hasn’t listed it yet, and the tool then stays listed for the rest of the conversation
You remove a tool on purpose, such as with a deny rule or by disabling its server in `/mcp`| Invalidated| The definition is removed
--- a/reference.md
+++ b/reference.md
@@ -321,26 +321,34 @@
Element| Main props| Terminal| Desktop| VS Code
---|---|---|---|---
-[`Box`](</docs/en/plugins/mods/interface#build-a-tree-from-elements>)| `key`, flex layout, `gap`, `padding`, `margin`, `width`, `height`, `borderStyle`, `backgroundColor`, `position`, `hover`| ✓| ✓| ✓
-[`Text`](</docs/en/plugins/mods/interface#build-a-tree-from-elements>)| `color`, `backgroundColor`, `bold`, `italic`, `underline`, `dimColor`, `inverse`, `wrap`, `size`, `weight`, `mono`, `tabular`| ✓| ✓| ✓
-[`Button`](</docs/en/plugins/mods/interface#respond-to-presses-and-typing>)| `key`, `label`, `onPress`, `hotkey`, `plain`, `dimColor`, `autoFocus`, `action`| ✓| ✓| ✓
+[`Box`](</docs/en/plugins/mods/interface#build-a-tree-from-elements>)| `key`, flex layout, `gap`, `padding`, `margin`, `width`, `height`, `minWidth`, `minHeight`, `borderStyle`, `borderColor`, `borderDimColor`, `backgroundColor`, `position`, `top`, `left`, `right`, `bottom`, `overflow`, `display`, `hover`| ✓| ✓| ✓
+[`Text`](</docs/en/plugins/mods/interface#build-a-tree-from-elements>)| `color`, `backgroundColor`, `bold`, `italic`, `underline`, `strikethrough`, `dimColor`, `inverse`, `wrap`, `size`, `weight`, `mono`, `tabular`, `hover`| ✓| ✓| ✓
+[`Button`](</docs/en/plugins/mods/interface#respond-to-presses-and-typing>)| `key`, `label`, `onPress`, `hotkey`, `plain`, `dimColor`, `autoFocus`, `action`, `hover`| ✓| ✓| ✓
[`Link`](</docs/en/plugins/mods/interface#link-in-the-desktop-app>)| `href`, `label`. See Limits.| ✓| ✓| ✓
[`Code`](</docs/en/plugins/mods/gallery#show-code-and-changes>)| `source`, `language`, `path`, `startLine`, `format`, `wrap`| ✓| ✓| ✓
`Markdown`| `text`, `key`, `dimColor`, `onLinkPress`, `pressableLinks`| ✓| ✓| ✓
[`Input`](</docs/en/plugins/mods/interface#take-typed-input-and-draw-a-row-for-each-item>)| `key`, `label`, `placeholder`, `value`, `submitLabel`, `onSubmit`, `onInput`, `autoFocus`| ✓| ✓| ✓
`Select`| `key`, `label`, `options`, `value`, `onSelect`, `autoFocus`| ✓| ✓| ✓
-`Svg`| An SVG document, up to 131,072 characters| | ✓| ✓
-[`Client`](</docs/en/plugins/mods/interface#build-a-tree-from-elements>)| `module`, `key`| ✓| ✓|
+`Svg`| a `source` of SVG markup up to 131,072 characters, `alt` text, `width`, `height`, and `isInteractive`| | ✓| ✓
+[`Client`](</docs/en/plugins/mods/interface#build-a-tree-from-elements>)| `module`, `key`, `props`, `width`, `height`, `flexGrow`| ✓| ✓|
[`Raster`](</docs/en/plugins/mods/interface#draw-a-grid-of-colored-cells>)| `key`, `columns` up to 512, `rows` up to 256, `cells`. See [Draw a grid of colored cells](</docs/en/plugins/mods/interface#draw-a-grid-of-colored-cells>).| ✓| |
-`Image`| PNG or RGBA bytes up to 2 MiB, or a file path, `columns` and `rows` up to 255, and `alt` text. See [which terminals draw it](</docs/en/plugins/mods/gallery#image-and-client>).| ✓| |
-
-More `Button` rules: `action` names one of Claude Code’s own [keybinding actions](</docs/en/keybindings>), and the user’s binding for it presses the button when that binding is a chord or a modified key. A digit `hotkey` on a button in the band also fires when the user types that digit alone into an empty prompt and pauses. When two buttons in one drawing name the same `hotkey`, the later one gets it. `autoFocus` accepts only `true` on any control, so omit the prop to leave it off. The VS Code extension ignores some element props and draws the element as if you had left them out:
-
- * **`Box`** : `position` and `hover`
- * **`Text`** : `size`, `mono`, and `tabular`
- * **`Button`** : `hotkey`, `plain`, `autoFocus`, and `action`, so the user presses a button there with a click, or with Enter once it has focus
+`Image`| `key`, a `source` such as PNG or RGBA bytes up to 2 MiB, or a file path, `columns` and `rows` up to 255, and `alt` text. See [which terminals draw it](</docs/en/plugins/mods/gallery#image-and-client>).| ✓| |
+
+More `Button` rules:
+
+ * **`action`** : names one of Claude Code’s own [keybinding actions](</docs/en/keybindings>), and the user’s binding for it presses the button when that binding is a chord or a modified key
+ * **Digit hotkeys on the band** : a digit `hotkey` on a button in the band also fires when the user types that digit alone into an empty prompt and pauses
+ * **A collapsed band** : while the band is [collapsed](</docs/en/plugins/mods/interface#when-the-user-collapses-the-band>), neither an `action` binding nor a hotkey presses a button in it
+ * **Two buttons on one hotkey** : when two buttons in one drawing name the same `hotkey`, the later one gets it
+
+`autoFocus` accepts only `true` on any control, so omit the prop to leave it off. The VS Code extension ignores some element props and draws the element as if you had left them out:
+
+ * **`Box`** : `position` with its `top`, `left`, `right`, and `bottom`, `alignSelf`, `borderDimColor`, and `hover`
+ * **`Text`** : `size`, `mono`, `tabular`, and `hover`
+ * **`Button`** : `hotkey`, `plain`, `autoFocus`, `action`, and `hover`, so the user presses a button there with a click, or with Enter once it has focus
* **`Code`** : `language`, `path`, `startLine`, `format`, and `wrap`, so code draws without colors or line numbers, and a `format: 'diff'` block shows the diff’s raw text
* **`Input` and `Select`**: `autoFocus`
+ * **`Svg`** : `isInteractive`
###
--- a/remote-control.md
+++ b/remote-control.md
@@ -361,7 +361,7 @@
* Text-output commands: `/compact`, `/clear`, `/context`, `/usage`, `/exit`, `/usage-credits`, `/recap`, and `/reload-plugins`. `/usage-credits` prints the billing URL instead of opening a browser. `/reload-plugins` works only when the session runs in an interactive terminal; a session without one declines it.
* `/model`, `/effort`, `/fast`, `/color`, and `/rename`: pass the value as an argument, for example `/model sonnet` or `/effort high`. From mobile and web, `/model` and `/effort` take the argument in place of the terminal picker or slider.
* `/mcp`: from the mobile app, returns a text summary of server status instead of opening the picker. On the web, `/mcp` on its own opens a directory of [claude.ai connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>) instead of returning the summary. The `reconnect`, `enable`, and `disable` [subcommands](</docs/en/commands#all-commands>) work from both when the session runs in an interactive terminal. `/mcp reconnect` with no server name retries every server that has failed or needs authentication. To authorize a claude.ai connector without the picker, see Authorize a connector again from your shell.
- * `/config`: from the mobile app, pass `key=value` to set a setting, or run it with no argument to list the keys you can set. On the web, `/config` opens the Claude Code section of your settings instead, and ignores text after the command.
+ * `/config`: from the mobile app, pass `key=value` to set a setting, or run it with no argument to list the keys you can set. On the web, `/config` opens the Claude Code section of your settings instead.
* On Team and Enterprise, `/usage-credits` from mobile or web doesn’t send a [usage-credits request to your admin](</docs/en/costs#add-usage-credits-to-your-subscription>). Sending requires a confirmation that appears only in the interactive CLI, so the command tells you to run it there instead.
* `/autocompact`, from v2.1.221: pass the window size as an argument, for example `/autocompact 500k`. With no argument, it prints the current window size as text instead of opening the dialog the command shows in a terminal session.
* `/advisor`, from v2.1.260: pass the model as an argument, for example `/advisor opus`, or pass `off` to turn the advisor off. Both forms apply to the current session only and leave your saved default unchanged. With no argument, it prints the current advisor as text instead of opening the picker.
--- a/routines.md
+++ b/routines.md
@@ -38,7 +38,7 @@
Create a scheduled task
-Create a scheduled task from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a scheduled task you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Scheduled** in the sidebar or in the sidebar’s **More** menu, then **New task** , and continue with Create from the web. Scheduled tasks run autonomously as full Claude Code cloud sessions. You don’t choose a permission mode. The session runs shell commands, uses [skills](</docs/en/skills>), and calls any connectors you include, all without stopping for approval apart from some artifact actions. Outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>)’s threads, those skills include the ones committed to the cloned repository. What a scheduled task can reach is determined by:
+Create a scheduled task from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a scheduled task you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Scheduled** in the sidebar or in the sidebar’s **More** menu, then **New task** , and continue with Create from the web. Scheduled tasks run autonomously as full Claude Code cloud sessions. The session runs shell commands, uses [skills](</docs/en/skills>), and calls any connectors you include. Outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>)’s threads, those skills include the ones committed to the cloned repository. You don’t choose a permission mode when you create the task: see Permission prompts during a run for when a run stops to wait for you. What a scheduled task can reach is determined by:
* The repositories you select
* The [environment’s](</docs/en/cloud-environments>) network access and variables
@@ -104,7 +104,7 @@
Review connectors
-Switch to the **Connectors** tab of **Advanced settings**. All of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any the task doesn’t need: Claude can use every tool from an included connector, including writes, without asking for permission during a run.
+Switch to the **Connectors** tab of **Advanced settings**. All of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any the task doesn’t need: Claude can use an included connector during a run, including writes. For when a run stops to ask you first, see Permission prompts during a run.
7
@@ -386,7 +386,30 @@
+Permission prompts during a run
+
+For a task that runs in your organization’s self-hosted environment, see [Permissions and tool approval](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>).
+
+When a run starts a new session on Anthropic’s cloud, that session begins in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) unless auto mode is unavailable. In auto mode, a classifier model allows or blocks actions that would otherwise wait for your approval. A run still stops and waits for an answer in cases such as these:
+
+ * **Actions that prompt even in auto mode** : for example, an action that matches an [ask rule](</docs/en/permissions#manage-permissions>). See [How auto mode evaluates actions](</docs/en/permission-modes#how-auto-mode-evaluates-actions>)
+ * **Repeated blocks** : one block doesn’t end the run. Once blocks reach auto mode’s [repeated-block thresholds](</docs/en/permission-modes#repeated-block-thresholds>), a permission prompt appears in the run’s session and waits until someone answers it
+
+If auto mode is unavailable, such as when your organization turned it off or the task’s model doesn’t support it, the run keeps the permission mode it launched in. To answer a waiting prompt, open the run from the task’s detail page. In a [project](</docs/en/claude-projects>), a run can continue a thread rather than start a new session. That run keeps whatever permission mode the thread is in at the time. When that thread was made, it started in auto mode unless auto mode was unavailable. To answer a prompt waiting in that thread, see [Unblock a thread waiting on approval](</docs/en/claude-projects#unblock-a-thread-waiting-on-approval>).
+
+###
+
+
+
When a run publishes an artifact without asking
+
+During a run in auto mode, Claude publishes an [artifact](</docs/en/artifacts>) without asking you once the classifier allows the publish. You’re still asked first when, for example, the publish matches an [ask rule](</docs/en/permissions#manage-permissions>). A new artifact is visible only to you until you [share it](</docs/en/artifacts#share-an-artifact>). The Accept edits rules that follow don’t apply in auto mode. When a scheduled task’s job is to keep a page current, give it an artifact you already published.
+
+####
+
+
+
+Artifacts in Accept edits mode
When a scheduled task’s schedule or **Run now** starts a run, Claude can publish a new [artifact](</docs/en/artifacts>) without asking. The new artifact is visible only to you until you [share it](</docs/en/artifacts#share-an-artifact>). If the publish declares runtime capabilities for the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) or [file downloads](</docs/en/artifacts#offer-a-file-download>), Claude asks first. In those runs, Claude republishes an existing artifact without asking only when all of these hold:
@@ -398,7 +421,7 @@
* The publish doesn’t declare runtime capabilities for the page
* The existing page holds no grant that reaches beyond the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>)
-In every other case, including a run that an API or GitHub trigger starts, Claude asks first. When a scheduled task’s job is to keep a page current, give it an artifact you already published.
+In every other case, including a run that an API or GitHub trigger starts, Claude asks first.
###
--- a/sandboxing.md
+++ b/sandboxing.md
@@ -899,7 +899,7 @@
0-byte read-only files appear at `.claude` settings paths, and “Yes, and don’t ask again” doesn’t save
-On Linux and WSL2, the sandbox holds a write denial on a file that doesn’t exist yet by creating a 0-byte read-only placeholder there while a sandboxed command runs. The sandbox removes the placeholder afterward. If a session is killed before that cleanup runs, for example by SIGKILL, the placeholders stay behind. Later sessions bind the placeholders read-only again on every start, so a settings write such as saving a permission choice fails at a path where a placeholder remains. Run `claude doctor` in your terminal to list the leftover placeholder files. The [`Stale sandbox mask files left by a killed session`](</docs/en/errors#stale-sandbox-mask-files-left-by-a-killed-session>) warning names some of them and counts the rest. Delete each file with `rm` while no other Claude Code session is running in that project. Before v2.1.257, Claude Code left the same placeholders behind without flagging them.
+On Linux and WSL2, the sandbox holds a write denial on a file that doesn’t exist yet by creating a 0-byte read-only placeholder there while a sandboxed command runs. The sandbox removes the placeholder afterward. If a session is killed before that cleanup runs, for example by SIGKILL, the placeholders stay behind. Later sessions bind the placeholders read-only again on every start, so a settings write such as saving a permission choice fails at a path where a placeholder remains. Run `claude doctor` in your terminal to list the leftover placeholder files. The [`Sandbox mask files left behind at write-deny paths`](</docs/en/errors#stale-sandbox-mask-files-left-by-a-killed-session>) warning names some of them and counts the rest. Delete each file with `rm` while no other Claude Code session is running in that project. Before v2.1.257, Claude Code left the same placeholders behind without flagging them.
###
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -23,7 +23,7 @@
Persistent across restarts| Yes| Yes| Restored on `--resume`, with [exceptions](</docs/en/scheduled-tasks#limitations>)
Access to local files| No (fresh clone)| Yes| Yes
MCP servers| Connectors configured per task| [Config files](</docs/en/mcp>) and connectors| Inherits from session
-Permission prompts| No (runs autonomously)| Configurable per task| Inherits from session
+Permission prompts| [Auto mode](</docs/en/routines#permission-prompts-during-a-run>) by default| Configurable per task| Inherits from session
Customizable schedule| Yes| Yes| Yes
Minimum interval| 1 hour| 1 minute when Claude sets it, [1 hour in the forms](</docs/en/desktop-scheduled-tasks#schedule-options>)| 1 minute
--- a/security-guidance.md
+++ b/security-guidance.md
@@ -191,7 +191,7 @@
Usage cost
-The per-edit pattern check makes no model call and adds no cost. The end-of-turn and commit reviews each spend additional model usage that counts toward your [usage](</docs/en/costs>) like any other Claude request. The commit review is agentic and may take several model turns per commit. Expect roughly one review call per turn that changes files and one deeper review per commit, both subject to the caps above. Both model-backed reviews use Claude Opus 4.7 by default. Set `SECURITY_REVIEW_MODEL` to choose a different model for the end-of-turn review and `SG_AGENTIC_MODEL` for the commit review. The plugin is available on all plans.
+The per-edit pattern check makes no model call and adds no cost. The end-of-turn and commit reviews each spend additional model usage that counts toward your [usage](</docs/en/costs>) like any other Claude request. The commit review is agentic and may take several model turns per commit. Expect roughly one review call per turn that changes files and one deeper review per commit, both subject to the caps above. By default, both reviews run on a Claude Opus model. Set `SECURITY_REVIEW_MODEL` to choose a different model for the end-of-turn review and `SG_AGENTIC_MODEL` for the commit review. The plugin is available on all plans.
##
Show diff (110 lines)
--- a/self-hosted-environments-configuration.md
+++ b/self-hosted-environments-configuration.md
@@ -28,7 +28,7 @@
`CLAUDE_CONFIG_DIR`| Per-session Claude config directory, written at session start from the snapshot of the runner host’s config that the runner captures at startup; see Permissions and tool approval. Writes here are isolated to this session. The directory stays under `<base-dir>/_sessions/` after the session ends unless you start the runner with [`--remove-session-state`](</docs/en/self-hosted-environments-reference#runner-cli-flags>); see [Reuse a pre-warmed checkout](</docs/en/self-hosted-environments-deploy#reuse-a-pre-warmed-checkout>).
`CLAUDE_CODE_REMOTE_MCP_CONFIG`| Path to a file in `CLAUDE_CONFIG_DIR` holding the MCP server definitions that Anthropic’s control plane delivered for this session. If your wrapper rebuilds the child’s environment, carry this variable over. Without it, when the control plane updates the delivered servers, the child shuts down any stdio, HTTP, or SSE server your wrapper adds with [`--mcp-config`](</docs/en/cli-reference#cli-flags>) that isn’t in the update. Requires Claude Code v2.1.299 or later.
`ANTHROPIC_BASE_URL`| The API base URL the child will use, delivered by the control plane per session and normally `https://api.anthropic.com`. Don’t override it: the session’s inference credential is an Anthropic-issued OAuth token that other providers don’t accept.
-`CLAUDE_CODE_OAUTH_TOKEN`| The short-lived OAuth access token the child uses for model inference, scoped to model inference and file upload only, with a lifetime of about 30 minutes. The runner re-mints it before expiry and delivers the rotation over the child’s stdin, so a wrapper that doesn’t keep stdin attached sees only the initial value. Don’t rely on your organization’s IP allowlist to bound this token’s use: treat it as a bearer credential that stays usable for roughly 30 minutes if it leaks, and don’t log it, write it to disk, or forward it outside the session container.
+`CLAUDE_CODE_OAUTH_TOKEN`| The short-lived OAuth access token the child uses for model inference, with a lifetime of about 30 minutes. The runner re-mints it before expiry and delivers the rotation over the child’s stdin, so a wrapper that doesn’t keep stdin attached sees only the initial value. Don’t rely on your organization’s IP allowlist to bound this token’s use: treat it as a bearer credential that stays usable for roughly 30 minutes if it leaks, and don’t log it, write it to disk, or forward it outside the session container.
The wrapper also inherits the rest of the child’s managed environment, including any server-provided environment variables. `exec` propagates all of it automatically; if your wrapper spawns the child another way, forward the full environment. `CLAUDE_CODE_REMOTE_SLACK_THREAD_URL` and `CLAUDE_CODE_REMOTE_SLACK_THREAD_TS` reach your wrapper or `command` hook. They also reach what the session runs, such as shell commands, git hooks, and Claude Code hooks. The `checkout`, `post-session`, and `spawn-runner` hooks don’t receive them.
@@ -154,7 +154,7 @@
The hook fails when it exits non-zero, or exits 0 without leaving a usable checkout behind:
* **A repository the session pushes results to** : the runner fails the session, and on a non-zero exit surfaces the tail of the script’s stderr to the user. Write the reason to stderr as one short line, write it last, and then exit non-zero. Don’t print secrets to stderr, and remove `set -x` before you deploy the hook. If git’s `couldn't find remote ref` appears in roughly the last 4 KB of the hook’s stderr, the runner reports a deleted branch instead. The session’s error message then says the branch no longer exists on the remote and asks the user to restore it. If that branch exists, see [A session fails with `no longer exists on the remote` or `couldn't find remote ref`](</docs/en/self-hosted-environments-deploy#no-longer-exists-on-the-remote>).
- * **A repository the session only reads from** , such as a repository added to a running session: the runner logs a `[runner:warn]` line with the failure detail, posts a `Skipped` step to the session, removes whatever the hook left at the checkout path, and continues with the remaining repositories. If skipping leaves the session with no repository at all, the runner fails the session anyway.
+ * **A repository the session only reads from** , such as a repository added to a running session: the runner skips it and continues with the remaining repositories. The runner posts a `Skipped` step to the session and removes whatever the hook left at the checkout path. When the `Skipped` step mentions the checkout hook, find the failure detail on the `[runner:warn] checkout hook failed` line in the runner’s log. When the step says a source ref `no longer exists on remote`, see [A session fails with `no longer exists on the remote` or `couldn't find remote ref`](</docs/en/self-hosted-environments-deploy#no-longer-exists-on-the-remote>). If skipping leaves the session with no repository at all, the runner fails the session anyway.
When the hook succeeds, the runner removes the checkout path after the session ends.
@@ -286,7 +286,7 @@
---|---
`CLAUDE_RUNNER_WORK_ORDER_FILE`| Path to a temp file containing the signed work-order JWT the new runner registers with. Deleted after the hook exits. Don’t log the file’s contents.
`CLAUDE_RUNNER_ORDER_ID`| Opaque idempotency key, unique per spawn request and safe for Kubernetes resource names. Use only the order ID as your provisioner’s dedup key.
-`CLAUDE_RUNNER_SESSION_ID`| The session this request is for. It repeats on every re-request for the session, so use it for logging and routing, not as a dedup key. Empty for pre-warming requests, which boot a standby runner ahead of any specific session when [`--min-idle`](</docs/en/self-hosted-environments-reference#orchestrator-cli-flags>) is set, so don’t assume the variable is set.
+`CLAUDE_RUNNER_SESSION_ID`| The session this request is for, as the `session_...` ID in the session’s URL. It repeats on every re-request for the session, so use it for logging and routing, not as a dedup key. Empty for pre-warming requests, which boot a standby runner ahead of any specific session when [`--min-idle`](</docs/en/self-hosted-environments-reference#orchestrator-cli-flags>) is set, so don’t assume the variable is set.
`CLAUDE_RUNNER_SESSION_UUID`| The same session ID in canonical UUID form. Empty for pre-warming requests.
`CLAUDE_RUNNER_ATTEMPT`| A per-session counter to use for logging. It isn’t a retry count or a request count. `0` for pre-warming requests, though a request for a session can carry `0` too.
`CLAUDE_RUNNER_ORDER_SERVER_TIME`| Server time from the poll response’s HTTP `Date` header. When the hook verifies the work-order JWT’s `exp`, compare against this value instead of the local clock to tolerate skew. Empty when the gateway omitted the header.
@@ -354,6 +354,17 @@
* **Activity tab** , in a failed session’s spawn error: `spawn-runner hook timed out after 60000ms`, or the last lines on the hook’s stderr.
* **Orchestrator log** : `timed out after 60000ms, sending SIGTERM to process tree`.
+
+####
+
+
+
+Exit the hook without waiting for the runner
+
+If every on-demand runner stops about 60 seconds after its hook starts, and your hook runs again for the same session, check whether the hook waits for the runner. The 60 seconds are the default [`--hook-timeout`](</docs/en/self-hosted-environments-reference#orchestrator-cli-flags>), so if you set your own, runners stop that long after the hook starts. A hook that starts `claude self-hosted-runner` on the orchestrator’s host and waits for it, in the foreground or with `wait`, is still running when `--hook-timeout` ends. The orchestrator then stops the hook and the processes running under it, including that runner and the session’s Claude process, so a turn that’s still running is cut off.
+
+ * **To confirm that the timeout is what stops your runners** : look in the orchestrator’s log for `timed out after 60000ms, sending SIGTERM to process tree` on every spawn request. The `60000` is your `--hook-timeout` in milliseconds.
+ * **To fix it** : have the hook submit the runner to your platform and exit 0. If you raise `--hook-timeout` instead, the runner only stops later.
####
@@ -583,6 +594,13 @@
d="$CLAUDE_PROJECT_DIR"
+ # Hardening: this script runs outside Claude Code's Bash sandbox, so its git
+ # calls skip some features that can start a program named in the checkout's
+ # git settings. They don't skip them all, so don't count on the sandbox alone.
+ GIT_OPTIONAL_LOCKS=0
+ export GIT_OPTIONAL_LOCKS
+ git() { command git -c core.fsmonitor= -c core.hooksPath=/dev/null "$@"; }
+
# Not a git repo → nothing to nudge.
git -C "$d" rev-parse --git-dir >/dev/null 2>&1 || exit 0
@@ -593,7 +611,7 @@
# entirely — operator-seeded settings and CLI-written runtime state
# (scheduler lock, worktrees, routine state) live there and neither is
# "uncommitted work" the model needs to push.
- s=$(git -C "$d" status --porcelain -- . ':(exclude).claude/' 2>/dev/null)
+ s=$(git -C "$d" status --porcelain --ignore-submodules=dirty -- . ':(exclude).claude/' 2>/dev/null)
if [ -n "$s" ]; then
printf '{"decision":"block","reason":"There are uncommitted changes in the repository. Please commit and push these changes to the remote branch."}'
exit 0
@@ -635,7 +653,38 @@
exit 0
-The hook prompts Claude to commit and push before the session ends, and stays silent when the directory isn’t a git repository or has no remote. For a session with several repositories, see what `$CLAUDE_PROJECT_DIR` names.
+The hook prompts Claude to commit and push before the session ends, and stays silent when the directory isn’t a git repository or has no remote. For a session with several repositories, see what `$CLAUDE_PROJECT_DIR` names. The Stop hook only prompts Claude. For the commit and push to work, set up:
+
+ * **A git identity** : set `user.name` and `user.email` in your runner image, or start the runner with [`--configure-git`](</docs/en/self-hosted-environments-deploy#let-the-runner-configure-git>)
+ * **Push credentials** : use [Anthropic-managed git](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), or supply credentials as [Ship git config in your image](</docs/en/self-hosted-environments-deploy#ship-git-config-in-your-image>) describes
+ * **For resumed sessions** : set [`--push-outcome-on-release`](</docs/en/self-hosted-environments-reference#runner-cli-flags>) on every runner in the environment. A resumed session then starts from the commits that Claude pushed to the session’s branch. For the flag’s limits, see [Resumed sessions lose unpushed work](</docs/en/self-hosted-environments-deploy#additional-limitations>).
+
+The Stop hook prompts at most once per turn. If the commit or push fails, the turn still ends. Look for git’s error in the session and fix what it names. On a large checkout, raise `timeout` in the Stop hook settings and restart the runners. The script’s `git status` skips `core.fsmonitor`, so it can take longer than the 10 seconds set there. A hook that times out ends the turn with no prompt.
+
+###
+
+
+
+Submodules and the Stop hook
+
+The Stop hook checks which commit each submodule is on, not the files inside it:
+
+ * **A new commit in a submodule** : Claude is prompted until the parent repository records it, even if `.gitmodules` sets `ignore = all` for that submodule
+ * **Uncommitted files in a submodule** : Claude isn’t prompted, so that work stays only on the runner’s disk
+ * **Unpushed commits in a submodule** : the Stop hook doesn’t check whether they’re pushed, so the parent can point at a commit that nobody else can fetch
+
+###
+
+
+
+Replace an earlier copy of the Stop hook script
+
+Search your copy of `stop-hook-nudge.sh` for `GIT_OPTIONAL_LOCKS`. If it’s missing, you have an earlier copy. Replace it with the current script wherever you installed it, then restart the runners. Keep your Stop hook settings, except to raise `timeout` on a large checkout.
+
+ * **When** : if your sessions run with the [Bash sandbox](</docs/en/sandboxing>) on, replace it now. Otherwise, replace it at your next image build or runner restart.
+ * **What changes** : uncommitted files in a submodule no longer prompt Claude. A new commit in a submodule that `.gitmodules` marks `ignore = all` now does.
+
+Hooks run outside the Bash sandbox, so the current script’s git calls skip some git features that can start a program named in the checkout’s git settings. They don’t skip them all. Don’t count on the sandbox alone, and isolate sessions as [Harden your deployment](</docs/en/self-hosted-environments-deploy#harden-your-deployment>) describes.
##
--- a/self-hosted-environments-deploy.md
+++ b/self-hosted-environments-deploy.md
@@ -425,6 +425,8 @@
- /etc/claude/environment-secret
- --capacity
- "4"
+ - --base-dir
+ - /workspace
volumeMounts:
- name: environment-secret
mountPath: /etc/claude
@@ -474,6 +476,8 @@
- /run/secrets/environment-secret
- --capacity
- "4"
+ - --base-dir
+ - /workspace
secrets:
- environment-secret
restart: always
@@ -495,7 +499,7 @@
2. It terminates each session’s process tree, including any command Claude was still running, but not a process still running after its shell command exited.
3. It runs the [`post-session` lifecycle hook](</docs/en/self-hosted-environments-configuration#post-session>).
-The runner keeps polling Anthropic throughout the drain. That keeps its sessions assigned to it, so another runner doesn’t pick one up while your `post-session` hook is still saving uncommitted work. Because `--drain-wait-sec` defaults to `0`, a rolling restart cuts off any turn that’s still running, and the session resumes on another runner without its unpushed work. To let turns finish first, set `--drain-wait-sec` and raise your stop timeout to match. The logged time is the sum of these values:
+The runner keeps polling Anthropic throughout the drain. That keeps its sessions assigned to it, so another runner doesn’t pick one up while your `post-session` hook is still saving uncommitted work. The logged time is the sum of these values:
* `--drain-wait-sec` for step 1, 0 seconds by default
* [`--session-stop-grace-sec`](</docs/en/self-hosted-environments-reference#runner-cli-flags>) for step 2, 5 seconds by default
@@ -512,6 +516,20 @@
+Let running turns finish before a restart
+
+To let running turns finish before a rolling restart, set `--drain-wait-sec`, and raise your stop timeout to at least that wait plus 80 seconds. With the default wait of `0`, a restart cuts off any turn that’s still running, and the session resumes on another runner without its unpushed work.
+
+ * **`--drain-wait-sec`** : about as long as the turns and background tasks you want to let finish. It’s a maximum: the wait ends early if they finish first.
+ * **Your stop timeout** : `terminationGracePeriodSeconds` in Kubernetes, `stop_grace_period` in Docker Compose. For example, with `--drain-wait-sec 120`, replace the `90` in the Kubernetes or Docker Compose recipe with `200`.
+ * **If you changed other shutdown settings** : the 80 seconds are for default settings. Start one runner with your flags, and use at least the number in its startup line `This runner needs up to`, which includes the wait. With `--defer-shutdown-max-min` set, use the larger number in the next startup line, after `Size the stop timeout to at least`. Shutdown timing lists what adds to these numbers.
+
+If the stop timeout runs out during the wait, your host kills the runner with work still running. Its sessions get no `post-session` hook. The runner also doesn’t deregister, so the control plane can take a few minutes and sometimes longer to requeue them.
+
+###
+
+
+
Post a status message before a restart
Before a restart that will interrupt sessions, have an [Owner](</docs/en/cloud-environments#organization-shared-environments>) post a status message on the environment from the [**Cloud environments** admin page](<https://claude.ai/admin-settings/cloud-environments>). At [claude.ai/code](<https://claude.ai/code>), members see the message in their sessions in that environment. Have the Owner set an expiry with the post, or remove the message once the runners are back.
@@ -567,7 +585,7 @@
Keep the base directory and capacity identical across runners
-If a runner dies mid-session, the server requeues the session and another runner in the environment picks it up. That runner derives the checkout path from its own `--base-dir` and `--capacity`: `--capacity 1` checks out directly under `--base-dir`, and a `--capacity` above `1` uses per-session worktrees instead. When runners in the same environment use different values for either flag, the resumed session’s working directory changes, and absolute paths the agent recorded earlier, in edits, tool calls, or its own notes, point at a location that no longer exists. Use the same `--base-dir` and `--capacity` on every runner in an environment, and don’t use a per-host value such as an instance ID or hostname. The base directory defaults to `/workspace`, with the exception the [`--base-dir` reference row](</docs/en/self-hosted-environments-reference#runner-cli-flags>) records. The runner needs write access to it. At startup, before registering, the runner creates the directory and confirms it can write to it, and exits with `cannot create or write to base directory` when it can’t. A runner started as root creates the default `/workspace` itself. For a non-root runner, create the directory and give the runner’s user ownership before starting the runner, or point `--base-dir` at a directory that user already owns.
+If a runner dies mid-session, the server requeues the session and another runner in the environment picks it up. That runner derives the checkout path from its own `--base-dir` and `--capacity`: `--capacity 1` checks out directly under `--base-dir`, and a `--capacity` above `1` uses per-session worktrees instead. When runners in the same environment use different values for either flag, the resumed session’s working directory changes, and absolute paths the agent recorded earlier, in edits, tool calls, or its own notes, point at a location that no longer exists. Use the same `--base-dir` and `--capacity` on every runner in an environment, and don’t use a per-host value such as an instance ID or hostname. Pass both flags explicitly, as the Kubernetes and Docker Compose recipes do, so that neither value depends on a default. The base directory defaults to `/workspace`, with the exception the [`--base-dir` reference row](</docs/en/self-hosted-environments-reference#runner-cli-flags>) records. The runner needs write access to it. At startup, before registering, the runner creates the directory and confirms it can write to it, and exits with `cannot create or write to base directory` when it can’t. A runner started as root creates the default `/workspace` itself. For a non-root runner, create the directory and give the runner’s user ownership before starting the runner, or point `--base-dir` at a directory that user already owns.
##
@@ -701,17 +719,17 @@
Your script’s own output still goes where it went before, while what the runner writes to stdout and stderr, its startup errors included, goes to that file. Use this shell redirect rather than [`--log-file`](</docs/en/self-hosted-environments-reference#runner-cli-flags>) alone, which mirrors the log to a file while the runner keeps writing to stdout and stderr. If you already pass `--log-file`, keep it as well, because the redirect doesn’t change what that file receives.
* **Orchestrator logs`poll failed:` with a TLS certificate error and keeps retrying**: the orchestrator doesn’t trust the CA behind the certificate it received, as happens behind a TLS-inspecting proxy. Set [`NODE_EXTRA_CA_CERTS`](</docs/en/network-config#custom-ca-certificates>) in the orchestrator’s environment to a PEM file with the proxy’s root CA. Set it for the runners your `spawn-runner` hook starts too. For example, a line can end `poll failed: self signed certificate in certificate chain — retrying in 1s`, with the TLS library’s words between the colon and the dash. To confirm the fix, check that `connected` is `true` in the orchestrator’s [`/healthz`](</docs/en/self-hosted-environments-reference#health-endpoint>) body.
* **Sessions stay queued** : every online runner may be locked to a different owner. Check each runner’s `claude_code_self_hosted_runner_locked_account` [metric](</docs/en/self-hosted-environments-reference#prometheus-metrics>) or the `locked_account` field of its `[runner:health]` log line to see who holds it. Both show the owner’s email only after the runner has been issued a session token carrying an `act.email` claim, which a Claude Tag agent’s sessions never do. Without the claim, the runner emits no `locked_account` series and logs `locked_account=yes`, which tells you the runner is locked but not to which owner. Add replicas, or wait for an existing runner to drain and restart. If the environment uses on-demand runners, check the orchestrator instead; see [On-demand runners](</docs/en/self-hosted-environments-configuration#on-demand-runners>).
- * **Sessions fail immediately after pickup** : open the session in claude.ai/code to see the error. The most common causes are missing git credentials in the runner image and build tools that aren’t installed. On a runner started with `--use-anthropic-git-proxy`, see When sessions fail to start on a runner with the git proxy. An unwritable base directory stops the runner at startup instead of failing sessions. See the **Runner exits at startup with`cannot create or write to base directory`** entry in this list.
+ * **Sessions fail immediately after pickup** : open the session in claude.ai/code to see the error. If the error shows that git couldn’t authenticate, check the runner’s git credentials. On a runner started with `--use-anthropic-git-proxy`, see When sessions fail to start on a runner with the git proxy. An unwritable base directory stops the runner at startup instead of failing sessions. See the **Runner exits at startup with`cannot create or write to base directory`** entry in this list.
* **Sessions fail to start on a runner that set`--use-anthropic-git-proxy`**: look in the runner’s log for `access denied by the git proxy`, or for a git error that names an `api.anthropic.com` address containing `/git_proxy/`. To tell whether Anthropic served the session and fix the cause, see When sessions fail to start on a runner with the git proxy.
* **Sessions can’t reach the network through an authenticating egress proxy** : when the source you set with `--proxy-authorization-command` or `--proxy-authorization-file` fails, times out after 30 seconds, or yields an empty value, the runner answers that connection `502 Bad Gateway` and logs why. The runner redacts the command’s stderr in that log and never logs the header value. With `--proxy-authorization-command`, run the command yourself on the host to confirm it prints the whole header value on stdout. If the runner instead exits at startup with `could not start the proxy-authorization listener`, it couldn’t open its loopback listener.
- * **Runner logs`Poll failed` lines containing `rejecting the malformed poll response`**: the runner received a work-poll response whose body isn’t the queue’s expected JSON, most often because something between the runner and `api.anthropic.com`, such as an intercepting proxy or a captive portal, answered with its own page. The runner rejects the response, counts it under the `transport` kind of the `claude_code_self_hosted_runner_poll_errors_total` [metric](</docs/en/self-hosted-environments-reference#prometheus-metrics>), and retries on the failed-poll schedule described in [Session lifecycle](</docs/en/self-hosted-environments#session-lifecycle>). The runner keeps serving its live sessions. Configure the proxy to pass responses from `api.anthropic.com` through unaltered. Before v2.1.246, the runner read such a response as an empty work queue, which could end its live sessions or make it exit.
+ * **Runner logs`Poll failed` lines containing `rejecting the malformed poll response`**: the runner received a work-poll response whose body isn’t the queue’s expected JSON. One cause is an intercepting proxy or a captive portal answering with its own page. If the runner connects through a proxy, configure the proxy to pass responses from `api.anthropic.com` through unaltered. The runner rejects the malformed response, counts it under the `transport` kind of the `claude_code_self_hosted_runner_poll_errors_total` [metric](</docs/en/self-hosted-environments-reference#prometheus-metrics>), and retries on the failed-poll schedule described in [Session lifecycle](</docs/en/self-hosted-environments#session-lifecycle>). The runner keeps serving its live sessions. Before v2.1.246, the runner read such a response as an empty work queue, which could end its live sessions or make it exit.
* **A session fails with`no longer exists on the remote` or `couldn't find remote ref`**: the runner reads git’s `couldn't find remote ref` as a deleted branch. The branch can still exist. Look for it on your git host, under exactly the name in the message, then check each cause that fits:
- * **The branch is gone** : typically because it was merged and auto-deleted. Restore it, as the message asks.
+ * **The branch is gone** : restore it, as the message asks.
* **The branch exists and you don’t administer the runner** : send the runner’s administrator the full message and tell them the branch exists.
* **The branch exists and the runner has a`checkout` hook**: a git command in your hook can print `couldn't find remote ref` to stderr before the hook exits non-zero. Find that command, and correct the ref it asks for or the remote it fetches from. The runner passes your hook the revision the session asked for as [`CLAUDE_RUNNER_REPO_REF`](</docs/en/self-hosted-environments-configuration#checkout>).
* **The branch exists and the runner has no`checkout` hook**: the runner fetches the branch itself. If a `--git-host-rewrite` applies to the repository, confirm that the host it rewrites to has the branch under the same name, and push the branch there if it doesn’t.
* **The branch exists and the runner is older than v2.1.301** : upgrade the runner as described in Pin the version, so that a different failure shows its own error. Before v2.1.301, other failures with `couldn't find remote ref` in their error output were also reported as a deleted branch.
-Once the runner is upgraded or the cause is fixed, retry the session or start a new one. If none of these checks finds the cause, report an issue. For the source the session pushes results to, a deleted branch fails the session. For a git source the session only reads from, the runner skips that source and continues on the remaining ones. The runner fails the session with the same error when skipping would leave it with no repository at all. Before v2.1.228, such a session started in an empty directory.
+Once the runner is upgraded or the cause is fixed, retry the session or start a new one. If none of these checks finds the cause, report an issue. For the source the session pushes results to, a deleted branch fails the session. For a git source the session only reads from, the runner skips that source and continues on the remaining ones. The runner fails the session when skipping would leave it with no repository at all. Before v2.1.228, such a session started in an empty directory.
* **A session starts without one of its repositories** : on a runner with no [`checkout` hook](</docs/en/self-hosted-environments-configuration#checkout>), the git host can refuse the runner’s access check for a repository the session only reads from. The runner then skips that repository, logs a `[runner:warn] could not access context source` line naming the refusal, and starts the session on the remaining ones. The runner skips only a clear refusal: the host answers that the repository wasn’t found, git finds no credentials for the host, or authentication fails. A network failure, a timeout, or an HTTP `403` still fails the session start, as does a refusal for a repository the session pushes results to. The runner still fails a session that skipping would leave with no repository at all. With `--use-anthropic-git-proxy`, the runner skips only a repository the git proxy itself denies. The access check runs again each time the session starts on a runner, so once the runner’s git identity has read access, the next start clones the repository. Before v2.1.274, each of these refusals failed the session start.
* **A session fails to start with`This runner couldn't read`**: the runner asked the git host for a repository with its git credentials and got a not-found answer. The repository doesn’t exist, or those credentials can’t reach the repository.
* **If you administer the runner** : give its git credentials read access to the repository, then start a new session.
@@ -735,7 +753,7 @@
* **A failed start** : the runner can’t start with the configuration or host it was given, so it exits seconds after it starts, and it exits the same way every time you restart it. Restarting it faster doesn’t help. Someone needs to read its output and fix the cause.
* **Lost contact** : a runner that can’t reach Anthropic for longer than its [lease](</docs/en/self-hosted-environments#session-lifecycle>), for example while its host sleeps, can be removed from the environment. When a removed runner reconnects, it exits. Its log can show a `[runner:fatal]` line that contains `runner record gone server-side` or, after a longer outage, [`poll auth failed`](</docs/en/self-hosted-environments-quickstart#set-up-an-environment-and-runner>). The runner doesn’t register again by itself, so restart it.
-Configure your supervisor to restart the runner whenever it exits, to wait longer between restarts when the runner keeps exiting right after it starts, and to tell someone when that keeps happening.
+Configure your supervisor to restart the runner whenever it exits, to wait longer between restarts when the runner keeps exiting right after it starts, and to tell someone when that keeps happening. For production, have your supervisor restart the runner on a fresh disk, in a new container or VM, as Harden your deployment recommends.
####
--- a/self-hosted-environments-identity.md
+++ b/self-hosted-environments-identity.md
@@ -205,7 +205,7 @@
`iat`| number| Issued-at as a Unix timestamp.
`jti`| string| Unique token identifier.
`ccr:role`| string| Always `session_worker` for session tokens.
-`ccr:session_id`| string| The session ID. Same value as the suffix of `sub`.
+`ccr:session_id`| string| The session ID in `cse_...` form. Same value as the suffix of `sub`, and the same string as [`CLAUDE_CODE_REMOTE_SESSION_ID`](</docs/en/self-hosted-environments-configuration#wrapper-scripts>). To match it to the `CLAUDE_RUNNER_SESSION_ID` that [lifecycle hooks](</docs/en/self-hosted-environments-configuration#lifecycle-hooks>) receive, replace the `cse_` prefix with `session_`.
`ccr:pool_id`| string| Your environment ID. Same value that appears in `aud`.
`ccr:org_id`| string| Your Anthropic organization ID.
`ccr:account_id`| string| The creating user’s Anthropic account ID: the value of `act.sub` without the `user:` prefix, a tagged `user_...` ID. The same value the [spawn-runner hook](</docs/en/self-hosted-environments-configuration#the-spawn-runner-hook>)’s `CLAUDE_RUNNER_ACCOUNT_ID` carries and [`--lock-to-account`](</docs/en/self-hosted-environments-reference#runner-cli-flags>) accepts, so the three compare as equal strings.
--- a/self-hosted-environments-quickstart.md
+++ b/self-hosted-environments-quickstart.md
@@ -39,14 +39,14 @@
Install on the host before you start:
- * **Claude Code v2.1.224 or later** , with any of the [standard install methods](</docs/en/setup>). The runner is part of the standard `claude` binary, and earlier versions don’t recognize the `self-hosted-runner` subcommand. The native installer’s default `latest` channel carries each release as soon as it’s published; the `stable` channel, the Homebrew `claude-code` cask, and the stable apt, dnf, and apk repositories trail by about a week. To pin the exact version your fleet runs, see [Install a specific version](</docs/en/setup#install-a-specific-version>). For container images, see the Dockerfile in [Deploy to production](</docs/en/self-hosted-environments-deploy#build-the-runner-image>).
+ * **Claude Code v2.1.224 or later** , with any of the [standard install methods](</docs/en/setup>). The runner is part of the standard `claude` binary, and earlier versions don’t recognize the `self-hosted-runner` subcommand. To pin the exact version your fleet runs, see [Install a specific version](</docs/en/setup#install-a-specific-version>). For container images, see the Dockerfile in [Deploy to production](</docs/en/self-hosted-environments-deploy#build-the-runner-image>).
* **Git 2.24 or newer**. Some git options on the deploy page need newer versions; [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>) states each floor.
Confirm the host is ready:
claude self-hosted-runner --help
-A ready host prints the runner’s usage text, listing flags such as `--environment-secret-file`. On versions older than 2.1.224, the command prints the general `claude --help` output instead; upgrade with `claude update` or reinstall from the `latest` channel.
+A ready host prints the runner’s usage text, listing flags such as `--environment-secret-file`. On versions older than 2.1.224, the command prints the general `claude --help` output instead. If you see that output, [update Claude Code](</docs/en/setup#update-claude-code>). If you run `claude` from a container image, [rebuild the image](</docs/en/self-hosted-environments-deploy#build-the-runner-image>) with version 2.1.224 or later.
##
--- a/self-hosted-environments-reference.md
+++ b/self-hosted-environments-reference.md
@@ -22,7 +22,7 @@
`--defer-shutdown-max-min <n>`| `SELF_HOSTED_RUNNER_DEFER_SHUTDOWN_MAX_MS`| `0`| On the first `SIGTERM` or `SIGINT`, keep serving the sessions already attached instead of draining them, then release whatever is still attached N minutes later and exit. Raise your host’s stop timeout before you set this. See [Defer the drain past the first signal](</docs/en/self-hosted-environments-deploy#defer-the-drain-past-the-first-signal>). `0` disables. Requires Claude Code v2.1.238 or later.
`--drain-grace-sec <n>`| `SELF_HOSTED_RUNNER_DRAIN_GRACE_MS`| `0`| Until the runner receives a shutdown signal or reaches its retire time, controls when the runner exits after its active sessions finish: `0` exits immediately without polling for more, and a positive value keeps the runner alive and re-polling the locked owner’s queue for that many seconds first, at the cost of the per-session container isolation described in the [hardening section](</docs/en/self-hosted-environments-deploy#harden-your-deployment>). After a first signal you deferred with [`--defer-shutdown-max-min`](</docs/en/self-hosted-environments-deploy#defer-the-drain-past-the-first-signal>), the runner exits as soon as it holds no sessions, whatever you set here.
`--drain-marker-file <path>`| `SELF_HOSTED_RUNNER_DRAIN_MARKER_FILE`| unset| Marker file that your host writes to announce a graceful drain before sending `SIGTERM`. When the file exists as the drain starts, the runner reports its exit to Anthropic as a host drain rather than a plain shutdown signal. The drain itself, including the `--drain-wait-sec` hold, runs the same as without the flag. Name a path on a local filesystem that sessions can’t write to. Requires Claude Code v2.1.271 or later.
-`--drain-wait-sec <n>`| `SELF_HOSTED_RUNNER_DRAIN_WAIT_MS`| `0`| Once the drain starts, which is on `SIGTERM` unless you set [`--defer-shutdown-max-min`](</docs/en/self-hosted-environments-deploy#defer-the-drain-past-the-first-signal>), wait up to N seconds for each session’s in-flight turn and background tasks to finish before terminating the child. During this wait, the runner counts a background task that has just finished as still running until the follow-up turn that reads its result starts, for at most the `SELF_HOSTED_RUNNER_BG_RESULT_GRACE_MS` window.
+`--drain-wait-sec <n>`| `SELF_HOSTED_RUNNER_DRAIN_WAIT_MS`| `0`| Once the drain starts, which is on `SIGTERM` unless you set [`--defer-shutdown-max-min`](</docs/en/self-hosted-environments-deploy#defer-the-drain-past-the-first-signal>), wait up to N seconds for each session’s in-flight turn and background tasks to finish before terminating the child. During this wait, the runner counts a background task that has just finished as still running until the follow-up turn that reads its result starts, for at most the `SELF_HOSTED_RUNNER_BG_RESULT_GRACE_MS` window. [Raise your stop timeout too](</docs/en/self-hosted-environments-deploy#let-running-turns-finish-before-a-restart>).
`--environment-secret-file <path>`| `SELF_HOSTED_RUNNER_ENVIRONMENT_SECRET`| required| Path to a file containing the environment secret, or, for runners spawned by the [orchestrator](</docs/en/self-hosted-environments-configuration#on-demand-runners>), the single-use work-order JWT. `SELF_HOSTED_RUNNER_ENVIRONMENT_SECRET` carries the secret value directly, not a file path. The older `--pool-secret-file` flag and `SELF_HOSTED_RUNNER_POOL_SECRET` variable still work and print a deprecation notice to stderr; preview-program runner builds older than 2.1.216 only recognize those older names.
`--exec-path <path>`| `SELF_HOSTED_RUNNER_EXEC_PATH`| own binary| Binary or wrapper script to spawn for each session. See [Wrapper scripts](</docs/en/self-hosted-environments-configuration#wrapper-scripts>).
`--exit-if-unused-min <n>`| `SELF_HOSTED_RUNNER_IDLE_SHUTDOWN_MS`| `0`| Exit after N minutes of polling with no work ever assigned, for autoscaler scale-down. `0` disables.
@@ -314,6 +314,17 @@
Each session runs in its own child process with its own OpenTelemetry metrics; at `--capacity` above one, the runner rewrites how those child metrics are exposed. Setting `OTEL_METRICS_EXPORTER=prometheus` on the runner host and `CLAUDE_CODE_ENABLE_TELEMETRY=1` in the session’s environment, for example from your [wrapper script](</docs/en/self-hosted-environments-configuration#wrapper-scripts>) or the runner’s own environment, which sessions inherit, re-exposes each child’s counter and gauge instruments on the runner’s own `/metrics` endpoint, alongside the runner’s series. The runner rewrites the child’s exporter to push over OTLP to a loopback-only receiver on the health port, tags each series with `session_id` and `client_platform` labels, and evicts a session’s series when that session ends. Histograms don’t pass through, and a child metric whose name would collide with the runner’s own prefix is dropped. At the default `--capacity 1`, the rewrite doesn’t apply: the session’s child binds its own Prometheus endpoint on port 9464 as usual.
+####
+
+
+
+Join a session’s metrics to the runner’s
+
+To put a session’s own metrics beside `claude_code_self_hosted_runner_session_idle_seconds`, join on the runner’s `session_id`:
+
+ * **At`--capacity` above one**: join directly. On the runner’s `/metrics`, the session’s series carry the same `session_id` as that metric, in `session_...` form.
+ * **At`--capacity 1`**: join on a converted `ccr_session_id`. By default, each Claude Code metric on port 9464 carries that label, which holds the session ID in `cse_...` form. In a new label, replace its `cse_` prefix with `session_` to get the runner’s `session_id`. The metric’s own `session_id` holds Claude Code’s own [`session.id`](</docs/en/monitoring-usage#standard-attributes>), which matches no runner series.
+
###
Show diff (149 lines)
--- a/settings-reference.md
+++ b/settings-reference.md
@@ -46,7 +46,7 @@
`awaySummaryEnabled`| Turn off the [session recap](</docs/en/interactive-mode#session-recap>) shown when you come back to the terminal| Remote, desktop, and notifications| Any file
`awsAuthRefresh`| Refresh expired [Bedrock credentials](</docs/en/amazon-bedrock#advanced-credential-configuration>) in `.aws` with your own command| Authentication and providers| Any file
`awsCredentialExport`| Supply [Bedrock credentials](</docs/en/amazon-bedrock#advanced-credential-configuration>) as JSON from your own command| Authentication and providers| Any file
-`axScreenReader`| Render [screen-reader friendly output](</docs/en/accessibility>)| Interface and terminal| Any file
+`axScreenReader`| Render [screen-reader friendly output](</docs/en/accessibility>)| Interface and terminal| User or managed
`bashEditDiffEnabled`| Record the [files that changed while a Bash command ran](</docs/en/hooks#bash>) in every permission mode| Interface and terminal| User or managed
`bashOutputMaxChars`| Set how much of a successful command’s [output](</docs/en/tools-reference#output-limits>) Claude receives inline| Memory and context| Any file
`blockedMarketplaces`| Block [plugin marketplace](</docs/en/plugins/overview>) sources for your organization| Plugins and skills| Managed
@@ -882,8 +882,12 @@
* Your `~/.claude/skills/` and `~/.claude/commands/` directories, including [skills synced from claude.ai](</docs/en/skills#where-synced-skills-load>)
* An `--add-dir` directory
* [Plugins declared with a `.claude-plugin` manifest](</docs/en/plugins/loading#plugins-shared-through-a-repository>) inside `~/.claude/skills/` or the project’s `.claude/skills/`
-
-Skills from managed settings and bundled skills keep their `allowed-tools`. A skill’s `disallowed-tools` still applies. For what a developer sees when Claude Code ignores the field, see [When only managed permission rules apply](</docs/en/skills#when-only-managed-permission-rules-apply>).
+ * Plugins loaded for one session only, whose ids end in [`@inline`](</docs/en/plugins/loading#find-where-a-plugin-came-from>), when all of these hold:
+ * The session is a [Code session](</docs/en/desktop#environment-configuration>) or [Cowork session](</docs/en/managed-settings#where-and-when-a-policy-applies>), other than a cloud session, for which the Claude Desktop app itself starts Claude Code
+ * Your managed settings set the key, not only an embedding host’s [parent settings](</docs/en/managed-settings#let-an-embedding-host-add-policy>)
+ * The session runs Claude Code v2.1.305 or later
+
+Skills from managed settings and bundled skills keep their `allowed-tools`. `@inline` plugins outside those Desktop sessions keep theirs too, except one named [`anthropic-skills`](</docs/en/skills#names-reserved-for-synced-skills>). A skill’s `disallowed-tools` still applies. For what a developer sees when Claude Code ignores the field, see [When only managed permission rules apply](</docs/en/skills#when-only-managed-permission-rules-apply>).
* **Scope** : `Managed`
* **Type** : Boolean
@@ -2180,7 +2184,7 @@
* **Scope** : `Any file`, with [limits on project and local settings](</docs/en/sandboxing#repository-settings-under-an-admin-required-sandbox>)
* **Type** : Boolean
- * `true`: sandboxed commands can connect to every Unix socket
+ * `true`: sandboxed commands can connect to every Unix socket. On Linux and WSL2 they can also connect to VM sockets, the `AF_VSOCK` address family
* `false`: the sandbox blocks Unix-socket connections: on macOS except the paths in `allowUnixSockets`, and on Linux and WSL2 through the seccomp filter when it’s present
* **Default** : `false`
@@ -2640,6 +2644,7 @@
* `OTEL_EXPORTER_PROMETHEUS_HOST` and `OTEL_EXPORTER_PROMETHEUS_PORT`
Only these values still apply from project and local settings, because they turn something off: `none` for the three exporter selectors, and an off value such as `0` for `OTEL_LOG_USER_PROMPTS`, `OTEL_LOG_TOOL_CONTENT`, and `OTEL_LOG_TOOL_DETAILS`. Such a value overrides the same variable in your user settings, but not one that the environment you start Claude Code from, a `--settings` file, or managed settings sets. When a project or local settings file sets a variable in this group, a local interactive session shows a notice at startup. Run `/status` or `claude doctor` to see which ones Claude Code ignored and which turned telemetry off; both list names, never values. A non-interactive run with `-p` or an Agent SDK session shows no notice, so check that your collector still receives data after you upgrade. If it doesn’t, set the variables in your user settings, managed settings, the job’s environment, or a file you pass with `--settings`. Ignoring this group in project and local settings requires Claude Code v2.1.282 or later.
* Variables that change how Claude Code starts or syncs, such as `CLAUDE_CODE_PROCESS_WRAPPER`, `CLAUDE_CODE_SYNC_SKILLS`, `CLAUDE_CODE_SYNC_PLUGINS`, `CLAUDE_CODE_PLUGIN_CACHE_DIR`, and `CLAUDE_CODE_PLUGIN_SEED_DIR`.
+ * The [screen reader mode](</docs/en/accessibility>) variable `CLAUDE_AX_SCREEN_READER` and the other variables whose names start with `CLAUDE_AX_`, such as [`CLAUDE_AX_STARTUP_QUIET_MS`](</docs/en/env-vars#variables>).
* [`CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS`](</docs/en/env-vars#variables>), which sets the timer on an unanswered dialog.
* [`CLAUDE_CODE_DISABLE_ATTACHMENTS`](</docs/en/env-vars#variables>), which turns off attachment processing.
* [`CLAUDE_CODE_DISABLE_FILE_MENTIONS`](</docs/en/env-vars#variables>), which stops Claude Code from expanding `@` mentions of files and directories.
@@ -2650,6 +2655,7 @@
* [`CLAUDE_CODE_RESTRICTED`](</docs/en/env-vars#variables>), which Claude Code reads from the launch environment only, is ignored from every file.
* [`CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY`](</docs/en/env-vars#variables>), which Claude Code reads from the launch environment only, is ignored from every file. The variable requires Claude Code v2.1.283 or later.
* [`CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT`, `CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT`, `CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT`, and `CLAUDE_CODE_DISABLE_MOUNTED_DRIVE_RM_PROMPT`](</docs/en/env-vars#variables>), which Claude Code reads from the launch environment only, are ignored from every file.
+ * [`CLAUDE_CODE_WARN_DISK_FREE_GIB` and `CLAUDE_CODE_WARN_MEMORY_FREE_GIB`](</docs/en/env-vars#variables>), which Claude Code reads from the launch environment only, are ignored from every file. The variables require Claude Code v2.1.304 or later.
###
@@ -2683,6 +2689,7 @@
Idle compaction [compacts](</docs/en/context-window#what-survives-compaction>) a long conversation that you’ve stepped away from, shortly before its prompt cache expires. Your next message then sends a summary instead of the whole conversation. When you come back, the conversation shows a line that starts with `Compacted while idle, before the prompt cache expired`. Idle compaction is on by default for conversations that meet all of these conditions:
* **Session** : you’re in an interactive terminal session
+ * **Auto-compaction** : `autoCompactEnabled` is on
* **Prompt cache** : the conversation is on the [one-hour prompt cache TTL](</docs/en/prompt-caching#which-ttl-each-request-gets>)
* **Feature flags** : Claude Code can [fetch feature flags from Anthropic](</docs/en/env-vars#features-that-need-feature-flag-fetching>)
* **Size** : the conversation’s context has reached the token threshold, which you can change from its default of 200,000
@@ -2879,7 +2886,7 @@
Render screen-reader friendly output: flat text without decorative borders or animations. Screen-reader mode uses the classic renderer, so the `tui` setting has no effect while it is active; attached [background sessions](</docs/en/agent-view>) still render fullscreen.
- * **Scope** : `Any file`
+ * **Scope** : `User or managed`. You can also set the key in a file you pass with `--settings`. Claude Code ignores the key in project and local settings, so neither a repository nor your own `.claude/settings.local.json` can turn screen-reader mode on or off.
* **Type** : Boolean
* `true`: Claude Code renders flat text without decorative borders or animations, using the classic renderer
* `false`: Claude Code renders normally
@@ -3944,7 +3951,7 @@
"allowedHttpHookUrls": ["https://hooks.example.com/*", "http://localhost:*"]
}
-Hostname matching is case-insensitive and treats `hooks.example.com.`, with the trailing dot that marks a fully qualified domain name, the same as `hooks.example.com`, which is how DNS treats them. The allowlist applies to hooks from every source, including managed settings.
+Hostname matching is case-insensitive and treats `hooks.example.com.`, with the trailing dot that marks a fully qualified domain name, the same as `hooks.example.com`, which is how DNS treats them. The allowlist applies to hooks from every source, including managed settings. In the Agent SDK’s `managedSettings` option, Claude Code ignores this key when its list has entries, so pass the list in the SDK’s `settings` option instead. See [what each value does in parent settings](</docs/en/claude-apps-gateway#how-hook-and-skill-keys-in-parent-settings-take-effect>).
###
@@ -4006,6 +4013,7 @@
The reach depends on which file carries the key:
* **In managed settings** : Claude Code disables every configured hook, including managed ones, and keeps running the hooks the [Agent SDK](</docs/en/agent-sdk/overview>) registers in process
+ * **In the Agent SDK’s`managedSettings` option**: Claude Code treats the key as `allowManagedHooksOnly: true`, so see what runs under `allowManagedHooksOnly` for which hooks stop. On a machine where an administrator deploys managed settings, Claude Code ignores this key unless the administrator [lets an embedding host add policy](</docs/en/managed-settings#let-an-embedding-host-add-policy>). Requires Claude Code v2.1.309 or later.
* **In any other settings file** : Claude Code disables user, project, local, and plugin hooks; managed hooks, Agent SDK hooks, and hooks from plugins force-enabled in managed `enabledPlugins` keep running
The key also stops [mods](</docs/en/plugins/mods/overview>), which are plugins whose code registers hooks:
@@ -4123,7 +4131,7 @@
"httpHookAllowedEnvVars": ["MY_TOKEN", "HOOK_SECRET"]
}
-The allowlist applies to hooks from every source, including managed settings.
+The allowlist applies to hooks from every source, including managed settings. In the Agent SDK’s `managedSettings` option, Claude Code ignores this key when its list has entries, so pass the list in the SDK’s `settings` option instead. See [what each value does in parent settings](</docs/en/claude-apps-gateway#how-hook-and-skill-keys-in-parent-settings-take-effect>).
###
@@ -4344,7 +4352,7 @@
]
}
-A `github` entry may use the owner-wildcard form `"owner/*"` to block every repository under that GitHub owner, which requires Claude Code v2.1.223 or later. Add `{ "source": "skills-dir" }` to stop Claude Code loading [`@skills-dir` plugins](</docs/en/plugins/loading#plugins-shared-through-a-repository>) from `~/.claude/skills/` without restricting any marketplace. See [Managed marketplace restrictions](</docs/en/plugins/org#restrict-what-users-can-install>).
+A `github` entry may use the owner-wildcard form `"owner/*"` to block every repository under that GitHub owner, which requires Claude Code v2.1.223 or later. Add `{ "source": "skills-dir" }` to stop Claude Code loading [`@skills-dir` plugins](</docs/en/plugins/loading#plugins-shared-through-a-repository>) from both `~/.claude/skills/` and a project’s `.claude/skills/`, without restricting any marketplace. See [Managed marketplace restrictions](</docs/en/plugins/org#restrict-what-users-can-install>).
###
@@ -4473,7 +4481,7 @@
`pathPattern`| `{ "source": "pathPattern", "pathPattern": "^/opt/approved/" }`| `pathPattern` required, a regex matched anywhere in the `path` of `file` and `directory` sources; start it with `^` to pin a prefix
`skills-dir`| `{ "source": "skills-dir" }`| No fields
-Three source types carry rules beyond the table:
+Some source types carry rules beyond the table:
* **`url`** : a URL marketplace downloads only the `marketplace.json` file, and Claude Code doesn’t fetch plugin files by relative path from that server, so its plugins must use a [plugin source](</docs/en/plugins/marketplace-reference#plugin-sources>) other than a relative path, such as an archive URL, which can be on the same host. For plugins with relative paths, use a Git-based marketplace instead. See [Plugins with relative paths fail in URL-based marketplaces](</docs/en/plugins/troubleshooting#plugins-with-relative-paths-fail-in-url-based-marketplaces>).
* **`hostPattern`** : use it to allow every marketplace on an internal GitHub Enterprise or GitLab server without listing each repository. Claude Code matches `github` sources against `github.com`, takes the hostname from `url` sources, and takes it from `git` sources depending on the [git URL](<https://git-scm.com/docs/git-clone#_git_urls>)’s form:
@@ -4482,8 +4490,7 @@
* Any other form without a scheme: no host, so no `strictKnownMarketplaces` `hostPattern` entry matches it. For a `blockedMarketplaces` `hostPattern`, Claude Code takes a host from a wider set of forms, so a blocklist entry can still match such a form. Before v2.1.234, a `strictKnownMarketplaces` `hostPattern` also matched some forms that git doesn’t treat as SSH addresses.
`file` and `directory` sources have no host and never match a `hostPattern` entry.
* **`pathPattern`** : use it to allow filesystem marketplaces alongside `hostPattern` entries for network sources. `".*"` allows every local path; a narrower pattern such as `"^/opt/approved/"` restricts to a directory.
-
-Any allowlist, even an empty one, also stops Claude Code loading [`@skills-dir` plugins](</docs/en/plugins/loading#plugins-shared-through-a-repository>) from `~/.claude/skills/`. To keep loading them, add the `{ "source": "skills-dir" }` entry and leave `strictPluginOnlyCustomization` unset. The entry has no meaning outside this key and `blockedMarketplaces`.
+ * **`skills-dir`** : any allowlist, even an empty one, stops Claude Code loading [`@skills-dir` plugins](</docs/en/plugins/loading#plugins-shared-through-a-repository>) from both `~/.claude/skills/` and a project’s `.claude/skills/`. To keep loading them, add the `{ "source": "skills-dir" }` entry and leave `strictPluginOnlyCustomization` unset. The entry has no meaning outside this key and `blockedMarketplaces`.
####
@@ -4656,7 +4663,7 @@
* Frontmatter hooks in skills, custom commands, and agents, from the sources that a `skills` or `agents` lock would block
* **Keeps running** : hooks in managed settings, and hooks from plugins other than [skills-directory plugins](</docs/en/plugins/loading#skills-directory-plugins-blocked-by-managed-settings>)
-Skills, custom commands, and agents whose frontmatter hooks stop running still load while their own surface isn’t locked.
+Skills, custom commands, and agents whose frontmatter hooks stop running still load while their own surface isn’t locked. A personal or project [skill](</docs/en/skills#where-skills-live>) that declares `hooks` in its frontmatter also loses its [`allowed-tools`](</docs/en/skills#pre-approve-tools-for-a-skill>) pre-approval, so your users get permission prompts for the tools that field lists. When such a skill runs in a subagent through [`context: fork`](</docs/en/skills#run-skills-in-a-subagent>), it keeps the pre-approval. A skill that declares no `hooks` keeps its pre-approval too.
* **Scope** : `Managed`
* **Type** : the string `"hooks"` in the `strictPluginOnlyCustomization` array
@@ -4951,7 +4958,7 @@
`allowedMcpServers`
-Allowlist the MCP servers people can add. Claude Code blocks any server that doesn’t match an entry wherever it’s defined, including plugin servers, servers a user passes with `--mcp-config`, and servers from claude.ai. Built-in servers such as Claude in Chrome, the `ide` server Claude Code connects to in a running [VS Code](</docs/en/vs-code#the-built-in-ide-mcp-server>) or [JetBrains](</docs/en/jetbrains#the-built-in-ide-mcp-server>) IDE, and servers the CLI itself configures are exempt from the allowlist, and the denylist still applies to them. On Claude Code v2.1.268 or later, a [Claude Tag](</docs/en/claude-tag>) session’s Slack tools are also exempt from the allowlist, and the denylist still applies to them. In-process `type: "sdk"` servers are exempt from both lists; the [app that started the session](</docs/en/mcp#how-connectors-reach-claude-code>) registers them. Servers your organization delivers are also exempt from the allowlist, and the denylist still applies to them. The exemption covers every `managedMcpServers` entry, and any [`managed-mcp.json`](</docs/en/managed-mcp#exclusive-control-with-managed-mcp-json>) entry whose values use no `${VAR}` expansion. See [How a server is evaluated](</docs/en/managed-mcp#how-a-server-is-evaluated>) for the full check order. Before v2.1.259, servers from `managed-mcp.json` had to match too.
+Allowlist the MCP servers people can add. Claude Code blocks any server that doesn’t match an entry wherever it’s defined, including plugin servers, servers a user passes with `--mcp-config`, and servers from claude.ai. Built-in servers such as Claude in Chrome, the `ide` server Claude Code connects to in a running [VS Code](</docs/en/vs-code#the-built-in-ide-mcp-server>) or [JetBrains](</docs/en/jetbrains#the-built-in-ide-mcp-server>) IDE, and servers the CLI itself configures are exempt from the allowlist, and the denylist still applies to them. On Claude Code v2.1.268 or later, a [Claude Tag](</docs/en/claude-tag>) session’s Slack tools are also exempt from the allowlist, and the denylist still applies to them. In-process `type: "sdk"` servers are exempt from both lists; the [app that started the session](</docs/en/mcp#how-connectors-reach-claude-code>) registers them. Servers your organization delivers are also exempt from the allowlist, and the denylist still applies to them. The exemption covers every `managedMcpServers` entry, and any [`managed-mcp.json`](</docs/en/managed-mcp#exclusive-control-with-managed-mcp-json>) entry whose values use [no `${VAR}` expansion outside `env`](</docs/en/managed-mcp#how-allowlists-and-denylists-apply-to-the-managed-set>). See [How a server is evaluated](</docs/en/managed-mcp#how-a-server-is-evaluated>) for the full check order. Before v2.1.259, servers from `managed-mcp.json` had to match too.
* **Scope** : `Any file`. Entries from every file merge into one allowlist unless `allowManagedMcpServersOnly` is set. Deploy it in managed settings to enforce it.
* **Type** : array of objects, each with exactly one key. Use `serverName`, a string limited to letters, numbers, hyphens, and underscores; `serverCommand`, an array of the command and its arguments matched exactly; or `serverUrl`, a URL pattern with `*` wildcards
@@ -5708,7 +5715,7 @@
`sshHostAllowlist`
-Limit the hosts a [Desktop SSH session](</docs/en/desktop#restrict-which-ssh-hosts-users-can-connect-to>) can connect to. Only the Desktop app reads this key; the CLI doesn’t. Patterns are case-insensitive: `*` matches any host, `*.example.com` matches `example.com` and every subdomain, and anything else is an exact match against the hostname after `~/.ssh/config` resolution. An empty array turns SSH sessions off.
+Limit the hosts a [Desktop SSH session](</docs/en/desktop#restrict-which-ssh-hosts-users-can-connect-to>) can connect to. Only the Desktop app reads this key; the CLI doesn’t. Patterns are case-insensitive: `*` matches any host, `*.example.com` matches `example.com` and every subdomain, and anything else is an exact match against the hostname after `~/.ssh/config` resolution. An empty array turns SSH sessions off. With Claude Desktop v3.1623.0 or later, a session’s [jump hosts](</docs/en/desktop#allow-jump-hosts>) have to match a pattern too.
* **Scope** : `Managed`. By default, Desktop reads the key from [one managed source](</docs/en/managed-settings#how-claude-code-combines-managed-sources>).
* **Type** : array of hostname patterns
--- a/skills.md
+++ b/skills.md
@@ -95,7 +95,13 @@
Allow only specific skills
-To let Claude invoke only specific skills, pass their names in the `skills` list. Names match the `name` field in `SKILL.md` or the skill’s directory name. Use `plugin:skill` for plugin-provided skills. The list takes exact skill names only. If an entry can’t work as an exact name, `query()` rejects the list before the session starts. See Invalid skill name error for the name rules and the error each SDK raises. The model doesn’t see unlisted skills and the Skill tool rejects them, while their files remain on disk and stay reachable through Read and Bash. Restricting the list doesn’t restrict dispatch by name. To let Claude invoke every discovered skill, pass `skills: "all"` rather than a wildcard.
+To let Claude invoke only specific skills, pass their names in the `skills` list:
+
+ * **Your own skills** : the skill’s directory name
+ * **Plugin skills** : `plugin:skill`
+ * **Name clashes in`additionalDirectories` or `add_dirs`**: a skill in one of those directories gets a [prefixed name](</docs/en/skills#how-a-skill-gets-its-command-name>) when its name clashes with an enterprise, personal, or project skill, or one in a directory added earlier. List it by that name. With a `verify` skill in `../api` and `../web`, added in that order, and no other `verify` skill, list them as `verify` and `web:verify`. Requires Claude Code v2.1.309 or later
+
+The list takes exact skill names only. If an entry can’t work as an exact name, `query()` rejects the list before the session starts. See Invalid skill name error for the name rules and the error each SDK raises. The model doesn’t see unlisted skills and the Skill tool rejects them, while their files remain on disk and stay reachable through Read and Bash. Restricting the list doesn’t restrict dispatch by name. To let Claude invoke every discovered skill, pass `skills: "all"` rather than a wildcard.
##
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -378,7 +378,7 @@
* `WaitForMcpServers`
* `Workflow`
-The second filter applies to subagents running in the background. Apart from `Agent` and `ExitPlanMode`, which follow the first filter’s conditions wherever the subagent runs, a background subagent keeps every MCP tool but only these built-in tools: `Read`, `Grep`, `Glob`, `LSP`, `Bash`, `PowerShell`, `Edit`, `Write`, `NotebookEdit`, `WebFetch`, `WebSearch`, `TodoWrite`, `Skill`, `ToolSearch`, `EnterWorktree`, `ExitWorktree`, `Monitor`, `TaskStop`, `SendMessage`, and `Artifact`, plus [`SubagentHandback`](</docs/en/tools-reference>) for a subagent that reports through it. Claude Code removes every other built-in tool from a background subagent, whether inherited or listed in the `tools` field, so the same definition can resolve to different tools in the foreground and the background. The removal reports no error unless it leaves the `tools` list [resolving to nothing](</docs/en/errors#agent-would-be-spawned-with-zero-tools>). Before v2.1.280, background subagents couldn’t use `LSP`. [`ListAgents`](</docs/en/cross-session-messaging>) follows these filters like any built-in tool: a foreground subagent inherits it in sessions where cross-session messaging is enabled, and a background subagent doesn’t keep it. Teammates in [agent teams](</docs/en/agent-teams>) additionally keep the task tools and cron tools: `TaskCreate`, `TaskGet`, `TaskList`, `TaskUpdate`, `CronCreate`, `CronDelete`, and `CronList`. In a [session without the Task tools](</docs/en/tools-reference#task-tool-availability>), Claude Code doesn’t provide the task tools to subagents either, even when the subagent runs a different model. An in-process teammate follows your session the same way, while a teammate in its own [split pane](</docs/en/agent-teams#choose-a-display-mode>) runs as a separate Claude Code process, so its own model decides.
+The second filter applies to subagents running in the background. Apart from `Agent` and `ExitPlanMode`, which follow the first filter’s conditions wherever the subagent runs, a background subagent keeps every MCP tool but only these built-in tools: `Read`, `Grep`, `Glob`, `LSP`, `Bash`, `PowerShell`, `Edit`, `Write`, `NotebookEdit`, `WebFetch`, `WebSearch`, `TodoWrite`, `Skill`, `ToolSearch`, `EnterWorktree`, `ExitWorktree`, `Monitor`, `TaskStop`, `SendMessage`, and `Artifact`, plus [`SubagentHandback`](</docs/en/tools-reference>) for a subagent that reports through it. Claude Code removes every other built-in tool from a background subagent, whether inherited or listed in the `tools` field, so the same definition can resolve to different tools in the foreground and the background. The removal reports no error unless it leaves the `tools` list [resolving to nothing](</docs/en/errors#agent-would-be-spawned-with-zero-tools>). Before v2.1.280, background subagents couldn’t use `LSP`. [`ListAgents`](</docs/en/cross-session-messaging>) follows these filters like any built-in tool: a foreground subagent inherits it in sessions where cross-session messaging is enabled, and a background subagent doesn’t keep it. Teammates in [agent teams](</docs/en/agent-teams>) additionally keep the task tools and cron tools: `TaskCreate`, `TaskGet`, `TaskList`, `TaskUpdate`, `CronCreate`, `CronDelete`, and `CronList`. In a [session without the Task tools](</docs/en/tools-reference#task-tool-availability>), Claude Code doesn’t provide the task tools to subagents either, even when the subagent runs a different model. An in-process teammate follows your session the same way. To find out whether a split-pane teammate has the task tools, see [Task tool availability](</docs/en/tools-reference#task-tool-availability>).
####
@@ -515,7 +515,8 @@
Set `permissionMode` to choose the permission mode a subagent runs in. Use the modes’ config values, so Manual mode is `default`. If you leave it unset, the subagent inherits the main conversation’s [permission mode](</docs/en/permission-modes>). The main conversation’s permission mode decides whether Claude Code uses the value you set:
* When the main conversation is in `bypassPermissions`, `acceptEdits`, or [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), the subagent runs in that same mode and Claude Code ignores the `permissionMode` you set. Under auto mode, the classifier evaluates the subagent’s tool calls with the main conversation’s block and allow rules. When the subagent finishes, the classifier also reviews its work and its final report before the report is delivered, as [How auto mode handles subagents](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) describes.
- * When the main conversation is in `default`, `dontAsk`, or `plan` mode, the subagent runs in the permission mode you set. It keeps the main conversation’s permission mode instead in these cases:
+ * When the main conversation is in `plan` mode, the subagent stays in plan mode whichever `permissionMode` you set, unless it runs as an agent team teammate under the [agent teams rules](</docs/en/agent-teams#have-teammates-plan-before-implementing>). If you set `dontAsk`, the subagent also doesn’t prompt you: an action that plan mode would ask you to approve is denied instead.
+ * When the main conversation is in `default` or `dontAsk` mode, the subagent runs in the permission mode you set. It keeps the main conversation’s permission mode instead in these cases:
* You set `bypassPermissions`. The `bypassPermissions` exception requires Claude Code v2.1.267 or later.
* You set `auto` and [auto mode isn’t available](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to the subagent, such as when a settings file sets [`disableAutoMode`](</docs/en/settings-reference#disableautomode>) or the subagent’s model doesn’t support auto mode.
--- a/tools-reference.md
+++ b/tools-reference.md
@@ -608,7 +608,22 @@
* List the tools in [`--tools`](</docs/en/cli-reference#cli-flags>), which restricts the session’s built-in tools to the ones it names. Include the tools you want alongside the other built-in tools you use
* In the Agent SDK, the [`allowedTools` and `tools` options](</docs/en/agent-sdk/todo-tracking#model-availability>) work the same way as the two flags
-In [background sessions](</docs/en/agent-view>) and in [cloud sessions](</docs/en/claude-code-on-the-web>), Claude Code provides the same tools on every model, listed or not. Claude Code gives a subagent the tools only when your session has them, even when the subagent runs a different model. An in-process [agent team](</docs/en/agent-teams>) teammate follows your session the same way, while a teammate in its own [split pane](</docs/en/agent-teams#choose-a-display-mode>) runs as a separate Claude Code process, so its own model decides. Without the Task tools, an agent coordinates with its team through messages instead of the [shared task list](</docs/en/agent-teams#assign-and-claim-tasks>). The default set described here applies in Claude Code v2.1.268 and later.
+In [background sessions](</docs/en/agent-view>) and in [cloud sessions](</docs/en/claude-code-on-the-web>), Claude Code provides the same tools on every model, listed or not. The default set described here applies in Claude Code v2.1.268 and later.
+
+###
+
+
+
+Task-tracking tools in subagents and agent teams
+
+A subagent has the task-tracking tools only when your session has them, whatever model the subagent runs. An in-process [agent team](</docs/en/agent-teams>) teammate has the task-tracking tools when your session does. A [split-pane](</docs/en/agent-teams#choose-a-display-mode>) teammate is a separate Claude Code process that [inherits](</docs/en/agent-teams#permissions>) your `--tools` list and deny rules, not `--allowedTools`, so check what you set:
+
+ * **No`--tools` list or deny rule, and `CLAUDE_CODE_ENABLE_TODO_TOOLS` unset for the teammate**: the teammate has the task-tracking tools its own model has by default.
+ * **`CLAUDE_CODE_ENABLE_TODO_TOOLS` exported in your shell**: Claude Code passes the teammate a fixed set of environment variables that doesn’t include the one you exported. To set it for the teammate too, start your session by running `claude --settings '{"env":{"CLAUDE_CODE_ENABLE_TODO_TOOLS":"1"}}'` in your shell. The teammate also gets your [`--settings`](</docs/en/settings#change-a-setting-for-one-session>) value.
+ * **`--tools` naming the task-tracking tools**: the teammate has them on any model.
+ * **A task-tracking tool missing from`--tools` or named in a deny rule**: the teammate lacks that tool.
+
+Without the Task tools, an agent coordinates with its team through messages instead of the [shared task list](</docs/en/agent-teams#assign-and-claim-tasks>).
##
--- a/troubleshoot.md
+++ b/troubleshoot.md
@@ -128,6 +128,14 @@
+`the engine ran out of stack linking the file and its imports`
+
+Code in the hooks module is nested too deeply, or its chain of imports is too long, for Claude Code to load it. The line starts with the mod’s name and `hooks module did not load:`, then gives a file’s name and this reason. Look through that file and the files reached through its imports for the most deeply nested part and rewrite it to nest less, or shorten the chain of imports. If you installed the mod and didn’t write it, ask its author to.
+
+###
+
+
+
`the parser stopped` or `the engine ran out of stack loading the file`
Code in one file of the hooks module is nested so deeply that Claude Code ran out of stack reading it. The line starts with the mod’s name and `hooks module did not load:`, then gives that file’s name and one of these reasons:
@@ -333,11 +341,20 @@
+The band shows `plugin panel hidden`
+
+The band is [collapsed](</docs/en/plugins/mods/interface#when-the-user-collapses-the-band>). It collapses when you press Ctrl+X then Ctrl+A, or the keys you bound in their place, and in [fullscreen rendering](</docs/en/fullscreen>) when you click the `[-]` on its first row. It stays collapsed until you expand it or start Claude Code again, and meanwhile no hotkey or `action` binding presses a button in it. To expand the band, press the keys the row names, Ctrl+X then Ctrl+A by default, or in fullscreen rendering click the row.
+
+###
+
+
+
Hotkeys do nothing
-Your pane doesn’t have keyboard focus, or the drawing is in the VS Code extension, where buttons have no hotkeys. Do the one that matches:
-
- * **No keyboard focus** : press Ctrl+X then Tab, or click the pane. To have the pane take focus when it opens, open it with `focus: true` from a command.
+Your pane or band doesn’t have keyboard focus, your button is in a collapsed band, or the drawing is in the VS Code extension, where buttons have no hotkeys. Do the one that matches:
+
+ * **No keyboard focus** : press Ctrl+X then Tab or, in [fullscreen rendering](</docs/en/fullscreen>), click the pane or band. To have the pane take focus when it opens, open it with `focus: true` from a command.
+ * **The button is in a collapsed band** : the band shows one dim row that starts with `▸ plugin panel hidden`. Press the keys the row names, Ctrl+X then Ctrl+A by default, to expand it.
* **In the VS Code extension** : click the button, or press Enter on it once it has focus
###
--- a/typescript.md
+++ b/typescript.md
@@ -6126,6 +6126,7 @@
filesystem?: SandboxFilesystemConfig;
ignoreViolations?: Record<string, string[]>;
enableWeakerNestedSandbox?: boolean;
+ allowNestedUserNamespaces?: boolean;
ripgrep?: { command: string; args?: string[] };
};
@@ -6140,6 +6141,7 @@
`filesystem`| `SandboxFilesystemConfig`| `undefined`| Filesystem-specific sandbox configuration for read/write restrictions
`ignoreViolations`| `Record<string, string[]>`| `undefined`| Map of command substrings, or `*` for every command, to substrings of the violation text to ignore, such as `{ "*": ['/etc/hosts'] }`; see [`sandbox.ignoreViolations`](</docs/en/settings-reference#sandbox-ignoreviolations>)
`enableWeakerNestedSandbox`| `boolean`| `false`| Enable a weaker nested sandbox for compatibility
+`allowNestedUserNamespaces`| `boolean`| `false`| Let sandboxed commands on Linux and WSL2 create user namespaces. Before you set it to `true`, read [`sandbox.allowNestedUserNamespaces`](</docs/en/settings-reference#sandbox-allownestedusernamespaces>), which covers the tools that need it and the security boundary you turn off. Requires Claude Code v2.1.305 or later
`ripgrep`| `{ command: string; args?: string[] }`| `undefined`| Custom ripgrep binary configuration for sandbox environments
The sandbox depends on platform support and, on Linux, tools like `bubblewrap` and `socat`. When `enabled` is `true` and the sandbox can’t start, `query()` reports a `result` message with `subtype: "error_during_execution"` and the reason in `errors`. For a single message `query()` call, the SDK throws after yielding that error result, so wrap the loop in a try block to continue past it. See [Handle the result](</docs/en/agent-sdk/agent-loop#handle-the-result>) for the error contract.To run unsandboxed instead, set `failIfUnavailable: false`.
--- a/ultrareview.md
+++ b/ultrareview.md
@@ -127,13 +127,13 @@
Run ultrareview non-interactively
-Use the `claude ultrareview` subcommand to start an ultrareview from CI or a script without an interactive session. The subcommand launches the same review as `/code-review ultra`, blocks until the remote review finishes, and prints the findings to stdout.
+Use the `claude ultrareview` subcommand to start an ultrareview from CI or a script without an interactive session. The subcommand launches the same review as `/code-review ultra`, blocks until the remote review finishes, and prints the findings to stdout. If the run exits with `Error: Workspace not trusted`, see Trust the folder before the review runs.
claude ultrareview
claude ultrareview 1234
claude ultrareview origin/main
-Without arguments, the subcommand reviews the diff between your current branch and the default branch, with the same whole-repository fallback as `/code-review ultra` when no merge base exists. Pass a PR number to review a pull request on `github.com`, or a base branch to review against it; base-branch handling matches the interactive command. You consent to the whole-repository fallback and to the billing and terms prompt when you run the subcommand, so the run starts without waiting for input. Running it yourself is what counts as consent. When Claude runs the subcommand for you instead, for example through the Bash tool, Claude Code refuses the whole-repository review. `claude -p '/code-review ultra'` doesn’t get you the findings, so use `claude ultrareview` in scripts. The `-p` run launches the cloud review and exits without waiting for it. When the review would bill usage credits, the `-p` run stops without launching it. Before v2.1.218, `/code-review ultra` in a non-interactive session ran a local review. `claude ultrareview` writes its progress messages to stderr so stdout stays parseable. Use these flags to control its output, the timeout, and whether to post the findings:
+Without arguments, the subcommand reviews the diff between your current branch and the default branch, with the same whole-repository fallback as `/code-review ultra` when no merge base exists. Pass a PR number to review a pull request on `github.com`, or a base branch to review against it; base-branch handling matches the interactive command. You consent to the whole-repository fallback and to the billing and terms prompt when you run the subcommand, so the run doesn’t stop to confirm them. Running it yourself is what counts as consent. When Claude runs the subcommand for you instead, for example through the Bash tool, Claude Code refuses the whole-repository review. `claude -p '/code-review ultra'` doesn’t get you the findings, so use `claude ultrareview` in scripts. The `-p` run launches the cloud review and exits without waiting for it. When the review would bill usage credits, the `-p` run stops without launching it. Before v2.1.218, `/code-review ultra` in a non-interactive session ran a local review.
Flag| Description
---|---
@@ -141,12 +141,13 @@
`--timeout <minutes>`| Maximum minutes to wait for the review to finish. Defaults to 45
`--post`| Post the finished findings to the pull request as one plain comment from your GitHub account. Works on `github.com` pull request targets; on other targets, Claude Code ignores the flag and says so. Requires Claude Code v2.1.227 or later
`--no-post`| Don’t post the findings. This is the default, and if you pass both flags, Claude Code doesn’t post. Requires Claude Code v2.1.227 or later
+`--trust-workspace`| Trust the current folder for this run only, without asking, so a script or CI job can review a checkout you haven’t trusted. Takes no value: put a PR number or base branch before it. Requires Claude Code v2.1.309 or later
-Running `claude ultrareview` requires the same authentication and usage-credits configuration as `/code-review ultra`. The subcommand exits with one of three codes:
+`claude ultrareview` writes its progress messages to stderr so stdout stays parseable. Running `claude ultrareview` requires the same authentication and usage-credits configuration as `/code-review ultra`. The subcommand exits with one of three codes:
* **0** : the review completed, with or without findings
- * **1** : the review failed to launch or was stopped before it finished, the cloud session errored, or the timeout elapsed
- * **130** : you interrupted the subcommand with Ctrl-C
+ * **1** : the review failed to launch or was stopped before it finished, the cloud session errored, or the timeout elapsed. The code is also 1 when the folder isn’t trusted, including when you answer `n` or press Ctrl-C at the trust question.
+ * **130** : you pressed Ctrl-C while the subcommand was launching the review, waiting for the findings, or sending the `--post` comment, rather than at the trust question
If the subcommand exits before the findings arrive, they never reach your terminal. The review may still be running in the cloud. Running the subcommand again starts a new review rather than resuming that one, and the new review uses a free run or bills as usage credits. With `--post`, the subcommand starts the post right after printing the findings, and prints the link to stderr.
@@ -154,6 +155,18 @@
* If the review completes but the comment isn’t posted, Claude Code prints the reason to stderr, and the findings stay on stdout so you can post them by hand.
For automatic reviews on GitHub pull requests, [Code Review](</docs/en/code-review>) integrates with your repository directly and posts findings as inline PR comments without a CLI step.
+
+###
+
+
+
+Trust the folder before the review runs
+
+When `claude ultrareview` asks `Trust <folder>? [y/N]`, answer `y` to [trust the folder](</docs/en/permissions#project-allow-rules-and-workspace-trust>). Trust it only if you trust its code, because git and Claude Code can then run programs named in its git configuration and project settings. When it can’t ask you, such as in a CI job or with output sent to a file, it exits with [`Error: Workspace not trusted`](</docs/en/errors#workspace-not-trusted-when-running-claude-ultrareview>). Append `--trust-workspace` to trust the folder for that run:
+
+ claude ultrareview 1234 --trust-workspace
+
+To review an untrusted pull request, run `claude ultrareview <PR number> --trust-workspace` from a branch you trust. Unlike `y`, the flag saves nothing. The PR is cloned in the cloud, so you don’t need its branch locally.
##
--- a/voice-dictation.md
+++ b/voice-dictation.md
@@ -162,8 +162,10 @@
* **Tapping`Space` types a space instead of recording in tap mode**: the first tap only starts recording when the prompt input is empty. Clear the input first, or check that you are in tap mode by running `/voice tap`.
* **`No audio detected from microphone`** : recording started but captured silence. Confirm the correct input device is set as the system default and that its input level is not muted or near zero. On Windows, open Settings → System → Sound → Input and select your microphone. On macOS, open System Settings → Sound → Input.
* **`Voice connection failed`** : your recording never reached the transcription service because the connection failed. Check your network and try again. A recording that captures no audio reports `No audio detected from microphone` instead of this message. Before v2.1.200, a silent microphone could report a connection failure, which suggested a network problem when the actual issue was the input device.
+ * **`Dictation error: WebSocket error:` followed by a certificate error such as `unable to get local issuer certificate`**: see [Dictation or the Web tab fails behind a TLS-inspecting proxy](</docs/en/vs-code#dictation-or-the-web-tab-fails-behind-a-tls-inspecting-proxy>) on the VS Code page.
* **`Voice stream error: WebSocket upgrade rejected with HTTP<status>`**: a server refused your connection with the HTTP status shown, so this isn’t a network outage. A status in the 400 range usually means a stale sign-in, or a proxy or bot-protection service answering in place of the transcription service. Run `/login` to refresh your sign-in, and check for a VPN or proxy on your network path if the status persists. If you’re still recording when the rejection arrives, Claude Code retries a status outside the 400 range once before showing this message; it doesn’t retry a status in the 400 range. In v2.1.229 through v2.1.231, native builds didn’t show this message: Claude Code kept recording, the hold-mode footer still showed `listening…`, and it reported `Voice connection failed` after you stopped recording.
* **`No speech detected`** : audio reached the transcription service but no words were recognized. Speak closer to the microphone, reduce background noise, and confirm your dictation language matches the language you are speaking.
+ * **`Dictation stopped: no speech recognized for 15 seconds` or `Dictation stopped at its 2-minute limit`**: in the VS Code extension, a recording ends after 15 seconds with no recognized words, or two minutes after it starts. If you were speaking during those 15 seconds, try the fixes for `No speech detected`. Words already recognized stay in the prompt box and aren’t sent. To add more, click the microphone button again.
* **Transcription is garbled or in the wrong language** : dictation defaults to English. If you are dictating in another language, set it in `/config` first. See Change the dictation language.
###
Show diff (162 lines)
--- a/vs-code.md
+++ b/vs-code.md
@@ -194,17 +194,13 @@
Resume past conversations
-Click the **Session history** button at the top of the Claude Code panel to access your conversation history. You can search by keyword or browse by time. Click any conversation to resume it. If the conversation is already open in another tab of the current window, clicking it switches to that tab. If the conversation opens with no messages showing, see why a resumed conversation is blank at first. For more on resuming sessions, see [Manage sessions](</docs/en/sessions>).
+Click the **Session history** button at the top of the Claude Code panel to access your conversation history. You can search by keyword or browse by time. Click any conversation to resume it. If the conversation is already open in another tab of the current window, clicking it switches to that tab. When a notice says the conversation is still open somewhere else, see how to continue it in this window. If the conversation opens with no messages showing, see why a resumed conversation is blank at first. For more on resuming sessions, see [Manage sessions](</docs/en/sessions>).
* **Session titles** : new sessions receive AI-generated titles based on your first message.
* **Rename and archive** : hover over a session to reveal these actions. Rename to give it a descriptive title, or archive to move it to the **Archived sessions** group at the bottom of the list.
* **Conversations missing with`claudeProcessWrapper` set**: update the extension to version 2.1.304 or later. The list then includes the conversations that were missing, along with sessions that `claude -p` or the [Agent SDK](</docs/en/agent-sdk/overview>) started in this workspace.
-If the conversation is open in another Claude Code process, such as `claude` in a terminal or another VS Code window, this notice appears in place of the prompt box:
-
- This conversation is still open somewhere else. Using it in two places at once can mix up its messages.
-
-To continue here, close the conversation in the other place and then click **Open here anyway**. If you click without closing it, the conversation is open in both places. With `claudeProcessWrapper` set, the extension skips this check and opens the conversation directly. By default, a session with no activity for 14 days moves to **Archived sessions** automatically, unless it is open, unread, or in a group. Automatic archiving requires Claude Code v2.1.265 or later. To change the period or turn it off, open the [Archive Inactive Sessions setting](<vscode://settings/claudeCode.archiveInactiveSessions>) and select a number of days or **Never**. To restore archived sessions:
+By default, a session with no activity for 14 days moves to **Archived sessions** automatically, unless it is open, unread, or in a group. Automatic archiving requires Claude Code v2.1.265 or later. To change the period or turn it off, open the [Archive Inactive Sessions setting](<vscode://settings/claudeCode.archiveInactiveSessions>) and select a number of days or **Never**. To restore archived sessions:
* **One session** : expand **Archived sessions** and click **Unarchive session**.
* **Every archived session at once** : hover over the **Archived sessions** header in the sessions list in the Activity Bar and click its unarchive icon. Requires Claude Code v2.1.277 or later.
@@ -215,6 +211,23 @@
* You have `claudeCode.claudeProcessWrapper` configured
* A [deny rule](</docs/en/permissions#manage-permissions>) removes the [`ExitPlanMode`](</docs/en/tools-reference>) tool
+####
+
+
+
+The conversation is still open somewhere else
+
+To continue in this window when a notice says the conversation is still open somewhere else, click **Open here anyway** after the step for your case:
+
+ * **You have nothing else open** : a Claude process from before the extension restarted may still have the conversation open. That process usually ends on its own within about 10 minutes, so wait that long and then click. If you click before it ends, the conversation is open in two places until it does.
+ * **You have the conversation open somewhere else** : close it there first, for example by exiting `claude` in a terminal or closing its tab in another VS Code window
+
+When the conversation is still open in another Claude Code process, this notice appears in place of the prompt box:
+
+ This conversation is still open somewhere else. Using it in two places at once can mix up its messages. If the extension restarted recently, a Claude process from before the restart may still be finishing. It usually ends on its own within about 10 minutes. This notice stays until you choose Open here anyway.
+
+With `claudeProcessWrapper` set, the extension skips this check and opens the conversation directly.
+
###
@@ -254,7 +267,7 @@
Run `/usage` to open the Account & usage dialog, which shows your signed-in account and your usage. The usage figures match how you signed in:
* **claude.ai plan** : usage bars for your plan’s limits, such as the current session and the week. Each bar shows how long until its limit resets. The dialog also breaks down what is contributing to your plan limits:
- * **Recommendations** : changes that lower your usage, one per row with the share of recent usage it addresses, such as `Trim ~/code/api/CLAUDE.md · 49k tokens per request`
+ * **Recommendations** : suggested changes, one per row, such as `Trim ~/code/api/CLAUDE.md · 49k tokens per request`
* **Fix button** : to have Claude Code apply the recommendations it can, click the button under them, such as **Fix both**. To learn which rows the button acts on and what then happens in your session, see [Apply recommendations with the fix shortcut](</docs/en/costs#apply-recommendations-with-the-fix-shortcut>). Requires Claude Code v2.1.305 or later. The button isn’t shown while [Remote Control](</docs/en/remote-control>) is connected. If a warning reads `The usage fix wasn’t fully sent. Open usage and try again.` after Remote Control connected, [disconnect Remote Control](</docs/en/remote-control#check-connection-status>) before you try again.
* **Attribution** : tables of how much usage came from each skill, subagent, plugin, and MCP server
Use the Day and Week toggle to switch between the last 24 hours and the last 7 days. The figures are approximate and computed from local sessions on this machine, so usage from other devices or claude.ai is not included.
@@ -311,7 +324,7 @@
* **Editor tab** : the conversation comes back with its tab.
* **Sidebar** : the conversation comes back if you sent a message or Claude responded in it within the last 10 minutes. If it doesn’t come back, resume the conversation from Session history.
-If another Claude Code process still has the conversation open, you’re asked before it opens here, with the same **Open here anyway** notice as when you resume it from session history. If the messages stay blank at first, see why they’re blank and when they appear.
+If a notice in place of the prompt box says the conversation is still open somewhere else, see how to continue the conversation here. If the messages stay blank at first, see why they’re blank and when they appear.
####
@@ -886,6 +899,7 @@
You’re asked to sign in again after you already signed in| [Not logged in or token expired](</docs/en/troubleshoot-install#not-logged-in-or-token-expired>)
Cloud provider credentials work in your terminal but not in the extension| [Bedrock, Agent Platform, or Foundry credentials not loading](</docs/en/troubleshoot-install#bedrock-agent-platform-or-foundry-credentials-not-loading>)
`SSL certificate verification failed` or `Self-signed certificate detected`| [SSL certificate errors](</docs/en/errors#ssl-certificate-errors>)
+`Dictation error: WebSocket error:` followed by a certificate error such as `unable to get local issuer certificate`, or `Remote server is not connected` on the Web tab| Dictation or the Web tab fails behind a TLS-inspecting proxy
`Claude Code process exited with code 1`, or another code| [Claude Code process exited with code N](</docs/en/errors#claude-code-process-exited-with-code-n>)
`Could not locate the Claude CLI on PATH`| [Could not locate the Claude CLI on PATH](</docs/en/errors#could-not-locate-the-claude-cli-on-path>)
`The connection to Claude Code ended before this message completed`| [The connection to Claude Code ended before this message completed](</docs/en/errors#the-connection-to-claude-code-ended-before-this-message-completed>)
@@ -930,6 +944,50 @@
3. Clear the Game Overlay checkbox
Alternatively, rebind the extension to a different key: open the VS Code [Keyboard Shortcuts editor](<https://code.visualstudio.com/docs/configure/keybindings>) (`Cmd+K Cmd+S`), search for `Claude Code: Focus input`, and assign a new binding.
+
+###
+
+
+
+Ctrl+J adds a new line in the prompt box
+
+To stop `Ctrl+J` from adding a new line in the prompt box, [unbind the key](</docs/en/keybindings#unbind-default-shortcuts>) in Claude Code’s `keybindings.json` file. The extension reads this file in version 2.1.309 or later, so update an older extension in the Extensions view first. This example is the whole file with the one entry that unbinds the key, `"ctrl+j": null` in a `Chat` block:
+
+ {
+ "bindings": [
+ {
+ "context": "Chat",
+ "bindings": {
+ "ctrl+j": null
+ }
+ }
+ ]
+ }
+
+The file goes in your Claude Code configuration directory, which is `~/.claude` unless you moved it with `CLAUDE_CONFIG_DIR`. Look in that directory and take the step that matches what you find:
+
+ * **No`keybindings.json` yet**: create it with exactly the content of the example
+ * **A`keybindings.json` with no `Chat` block**: add the example’s `Chat` block to the top-level `bindings` array, at any position
+ * **A`Chat` block with no `"ctrl+j"` line**: add `"ctrl+j": null` to that block’s `bindings`
+ * **A`Chat` block that already has a `"ctrl+j"` line**: change that line’s value to `null`
+
+After you save the file, pressing `Ctrl+J` in the prompt box adds no new line. If `Ctrl+J` still adds a line in the prompt box, run these two commands from the Command Palette in order:
+
+ 1. **Developer: Reload Window** , then press `Ctrl+J` in the prompt box again
+ 2. **Claude Code: Show Logs** , then look for a warning that includes `Ctrl+J in the chat input still inserts a newline`. Correct the problem it reports in the file it names, save the file, and press `Ctrl+J` again.
+
+If the log has no such warning, check that the file is in your Claude Code configuration directory and that its `Chat` block sets `"ctrl+j"` to `null`. [Report the issue](<https://github.com/anthropics/claude-code/issues>) if `Ctrl+J` still adds a line.
+
+###
+
+
+
+The Claude Code panel is blank or couldn’t load
+
+If the Claude Code panel opens but shows nothing at all, not even the prompt box, update the extension to v2.1.309 or later in the Extensions view. Then run **Developer: Reload Window** from the Command Palette. If you then see a `Claude Code couldn’t load` notice, work through the steps it lists in order. If the panel still doesn’t load, open the extension’s log and [report the issue](<https://github.com/anthropics/claude-code/issues>) with a copy of it:
+
+ * **Still blank on v2.1.309 or later** : open the log with **Claude Code: Show Logs** from the Command Palette
+ * **The notice’s steps didn’t help** : click **Show logs** in the notice to open the log
###
@@ -971,6 +1029,38 @@
+Dictation or the Web tab fails behind a TLS-inspecting proxy
+
+When dictation or the Web tab fails with a certificate error such as `unable to get local issuer certificate`, set [`NODE_EXTRA_CA_CERTS`](</docs/en/network-config#custom-ca-certificates>) in the `env` block of `~/.claude/settings.json`. Set it to the path of a PEM file with your proxy’s root CA certificate, which your IT team can give you. That error text is on the microphone button or in the extension’s logs:
+
+ * **Dictation** : the microphone button shows the error text after `Dictation error: WebSocket error:`.
+ * **Web tab** : the tab that lists cloud sessions shows `Remote server is not connected` without the error text. To read it in the logs:
+ 1. Run **Claude Code: Show Logs** from the Command Palette to open the `Claude VSCode` output channel.
+ 2. Click **Reconnect** on the tab and wait until it stops showing `Connecting…`.
+ 3. Search the channel for `Error fetching remote sessions:` or `Failed to fetch organization UUID:`, then read the error text after that prefix on the newest matching line.
+
+This fix requires extension version 2.1.307 or later, so update the extension first. Then set `NODE_EXTRA_CA_CERTS` to the certificate file’s full path, written without `~`. For a Windows path, write each backslash twice in `settings.json`, as in `C:\\certs\\example-ca.pem`. This example names a certificate file at the Linux or macOS path `/etc/ssl/certs/example-ca.pem`:
+
+~/.claude/settings.json
+
+ {
+ "env": {
+ "NODE_EXTRA_CA_CERTS": "/etc/ssl/certs/example-ca.pem"
+ }
+ }
+
+Save `settings.json`, then start a recording or click **Reconnect** again. If the error comes back, open the output channel with **Claude Code: Show Logs** and search it for `use the CA certificates file`. Such a warning gives the reason the extension can’t use your file and says where it read the path. Then find each place you set `NODE_EXTRA_CA_CERTS` in this table and do what its row says:
+
+Where you set it| What to do
+---|---
+The environment VS Code was started with| A value set here takes precedence over one in `~/.claude/settings.json`, even when the file it names can’t be used. Correct or remove it, then restart VS Code
+`env` in `~/.claude/settings.json`| Correct the value or the file it names, then start a recording or click **Reconnect** again
+VS Code’s `claudeCode.environmentVariables` setting, `~/.claude.json`, a project’s `.claude/settings.json` or `.claude/settings.local.json`, or managed settings| A value set here doesn’t apply to dictation or the Web tab. Set the variable in `env` in `~/.claude/settings.json` as well
+
+###
+
+
+
Claude Code never responds
If Claude Code isn’t responding to your prompts:
--- a/web-quickstart.md
+++ b/web-quickstart.md
@@ -65,7 +65,7 @@
Sign in with GitHub
-After you sign in, claude.ai/code prompts you to connect GitHub. Follow the prompt, and claude.ai/code sends you to GitHub’s authorization page. Approve the authorization request, and GitHub returns you to claude.ai/code. Cloud sessions work with existing GitHub repositories. To start a new project, [create an empty repository on GitHub](<https://github.com/new>) first.With this connection, a session can clone any public repository, but can work in a private repository only when the Claude GitHub App is installed on it. [Install the Claude GitHub App](<https://github.com/apps/claude/installations/new>) on each GitHub account or organization whose private repositories you want to use. On a GitHub organization, an organization owner may need to approve the installation. Installing it also enables [Auto-fix](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>), which lets Claude respond to CI failures and review comments on pull requests in those repositories.When you connect, Claude also links the GitHub accounts you own to your Claude organization, if they have the Claude GitHub App installed. On Team and Enterprise plans, admins see those accounts in the [connected GitHub accounts list](</docs/en/admin-setup#connected-github-accounts>).If onboarding prompts you to install the Claude GitHub App at this point and you’d rather do it later, click **Skip**.
+After you sign in, claude.ai/code prompts you to connect GitHub. Follow the prompt, and claude.ai/code sends you to GitHub’s authorization page. Approve the authorization request, and GitHub returns you to claude.ai/code. Cloud sessions work with existing GitHub repositories. To start a new project, [create a repository with a README on GitHub](<https://github.com/new>) first.With this connection, a session can clone any public repository, but can work in a private repository only when the Claude GitHub App is installed on it. [Install the Claude GitHub App](<https://github.com/apps/claude/installations/new>) on each GitHub account or organization whose private repositories you want to use. On a GitHub organization, an organization owner may need to approve the installation. Installing it also enables [Auto-fix](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>), which lets Claude respond to CI failures and review comments on pull requests in those repositories.When you connect, Claude also links the GitHub accounts you own to your Claude organization, if they have the Claude GitHub App installed. On Team and Enterprise plans, admins see those accounts in the [connected GitHub accounts list](</docs/en/admin-setup#connected-github-accounts>).If onboarding prompts you to install the Claude GitHub App at this point and you’d rather do it later, click **Skip**.
3
--- a/worktrees.md
+++ b/worktrees.md
@@ -323,6 +323,14 @@
+Worktree creation fails in a partial clone
+
+An error containing `This repository is a partial clone` means Claude Code couldn’t fetch every git object the worktree’s starting commit needs. Take the step in the message’s sentence ending in `try again`. Then retry from the shell where you took it: run `claude --worktree`, or start `claude` there and ask again.
+
+###
+
+
+
Claude Code refuses to use a worktree
An error starting `Refusing to use <path> as an isolation worktree` means Claude Code checked the directory’s git identity before adopting it as a session’s or subagent’s isolated checkout, and declined it. The check runs whether Claude Code is creating the worktree, entering an existing one, or reusing one from an earlier run. In most cases the rest of the message says the directory’s git metadata resolves into the main checkout: for example, its `.git` file points at the main repository’s own `.git` directory, or git resolves its working tree to the main checkout through a `core.worktree` redirect. From such a directory, an ordinary git command such as `git reset --hard` would act on the main checkout instead of the worktree. Claude Code also refuses when the directory has a `.git` entry it can’t read, rather than assuming the worktree is safe. A directory with no git metadata at all, such as one your `WorktreeCreate` hook creates, passes the check only when no git repository contains it. If the hook creates the directory inside a repository, git resolves it to that repository’s checkout and Claude Code refuses it with the `git resolves its working tree to` message, so have the hook create its directories outside any repository. Claude Code leaves the refused directory in place, since it may hold work. Match the message to its recovery, whether it follows `Refusing to use <path>` or appears in a resume message; some endings occur only in resume messages: