Changes on
45 changes detected
--- a/accessibility.md
+++ b/accessibility.md
@@ -76,7 +76,7 @@
Claude Code keeps the terminal cursor on the input caret, so your screen reader’s read-current-line command reads the prompt you’re editing. As you type at the end of the input line, or press `Backspace` there, Claude Code writes only the characters that change. Your screen reader echoes only those characters. When you delete a word or a line with one of the [text editing shortcuts](</docs/en/interactive-mode#text-editing>), Claude Code announces the deleted text:
- * Deleting a word with `Ctrl+W`, `Option+Delete` on macOS, or `Ctrl+Backspace` on Windows
+ * Deleting words with `Ctrl+W` or `Alt+D`, or with `Option+Delete` on macOS or `Ctrl+Backspace` on Windows
* Deleting to the start of the line with `Ctrl+U` or `Cmd+Backspace`
* Deleting to the end of the line with `Ctrl+K`
--- a/auto-mode-config.md
+++ b/auto-mode-config.md
@@ -77,7 +77,7 @@
For most organizations, `autoMode.environment` is the only field you need to set. It tells the classifier which repos, buckets, and domains are trusted: the classifier uses it to decide what “external” means, so any destination not listed is a potential exfiltration target. As of Claude Code v2.1.198, `claude auto-mode defaults` prints three kinds of environment entry. Versions before v2.1.195 print only the first five trust slots.
- * **Context slots** : describe your organization, stack, and security posture so the classifier reads the other rules in your context. Unlike the other two kinds, context slots have no rules of their own that target them. Each defaults to `None configured` or to the conservative assumption named next to it:
+ * **Context slots** : describe your organization, stack, and security posture so the classifier reads the other rules in your context. Each defaults to `None configured` or to the conservative assumption named next to it:
* **Organization**
* **Primary use of Claude Code** : defaults to software development
* **Cloud provider(s)**
@@ -87,6 +87,7 @@
* **Secrets management**
* **CI/CD deploy targets**
* **Network posture**
+ * **Host containment** : defaults to an ordinary developer machine or CI runner with open internet. If Claude Code runs in a container, VM, or pod with an egress allow-list or neighbors it must not touch, name the allowed hosts, whether the cloud metadata endpoint should be reachable, and which cloud project, cluster, or registry the task uses and under what identity. Until this entry names that identity, the classifier [blocks](</docs/en/permission-modes#what-the-classifier-blocks-by-default>) requests for the host’s own credentials. Requires Claude Code v2.1.257 or later
* **Protected deployment namespaces / environments** : falls back to the Sensitive remote targets heuristic until you name them
* **Data retention / declassification**
* **Trust slots** : name what the classifier treats as inside your boundary. The slots are Trusted repo, Source control, Trusted internal domains, Trusted cloud buckets, Key internal services, and Internal package registry. The repo and source-control entries default to the working repository and its configured remotes. Every other trust slot defaults to `None configured`, so nothing else is trusted until you add it. A repository’s visibility scopes only confidential material: a private repository is an acceptable destination for confidential material, but making a repository private never clears secrets or personal or entrusted data into it, and the classifier treats content ported, repointed, or first read from outside the working repository as not that repository’s own work. This scoping requires Claude Code v2.1.203 or later.
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,78 @@
This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Run `claude --version` to check your installed version.
+
+
+
+2.1.261
+
+September 4, 2026
+
+ * Added an “Organization policy” line to `/status` and `claude doctor` that says why your organization’s policy could not be loaded, such as a proxy not passing the endpoint through
+ * Added `bashOutputMaxChars` and `taskOutputMaxChars` settings to raise how much command and background-task output Claude receives inline before it is saved to a file, up to 128K characters
+ * Added `--append-subagent-system-prompt-file` to read the subagent system prompt from a file, for prompts too large to pass on the command line
+ * Added `/skill-doctor` to show which loaded skills go unused and what they cost in context, so you can prune them
+ * Fixed typed or pasted characters occasionally landing out of order or being dropped during fast input or key repeat
+ * Fixed `/add-dir <subdirectory>` printing a false “couldn’t be resolved” error when the working directory is on a `/net` automount
+ * Fixed the Bedrock setup wizard hanging when AWS or an AWS credential helper never responds (it now times out with a clear error), and its model checks failing behind a TLS-inspecting proxy
+ * Fixed cloud sessions discarding a plugin synced from claude.ai when managed settings force-enable it in `enabledPlugins`, then falling back to a marketplace clone that could fail
+ * Fixed being unable to delete the character immediately before an inline `[Image #N]` chip in the prompt input
+ * Fixed resuming a session losing hook output and other context around parallel tool calls, which changed the resumed request
+ * Fixed Remote Control showing a stale permission mode when a phone, browser, or claude.ai app attaches to a terminal session or after the mode changes in the terminal
+ * Fixed Remote Control sessions showing as still working (stuck spinner and Stop button) after stopping a turn from a connected phone or browser, or after a local slash command like `/clear`
+ * Fixed SDK and cloud sessions ignoring a Stop or interrupt sent just after the first prompt, before the turn had started; the turn now stops instead of running to completion
+ * Fixed Remote Control uploading a session pulled with `/teleport` into the connected session, which appeared appended to the original on phone and web
+ * Fixed Remote Control’s inbound event stream failing behind TLS-inspecting corporate proxies on native Windows
+ * Fixed Remote Control sessions showing the default effort level on claude.ai when the effort comes from settings
+ * Fixed `gcpAuthRefresh` opening a browser at startup when the Google credential check was slow, even though the credential was still valid
+ * Fixed claude.ai connectors staying absent for the whole session when the startup connector fetch timed out — the CLI now retries in the background
+ * Fixed sustained high CPU usage when a background agent could not be resumed and its wake-up was retried in a tight loop
+ * Fixed feature flags gated to a newer version occasionally applying to an older Claude Code version running on the same machine
+ * Fixed `/usage` and the VS Code usage panel dropping a model-specific weekly limit row when the usage endpoint is rate limited or when opened right after startup
+ * Fixed `claude -p --resume <file>` adopting a malformed session ID recorded in the transcript; it now resumes under a fresh session ID instead
+ * Fixed the terminal progress indicator (iTerm2, Ghostty, ConEmu) showing the session as finished while a background workflow or agent was still running
+ * Fixed a rare layout glitch where a box could render with the wrong height after its container switched between row and column direction
+ * Fixed Claude apps gateway client IP when a trusted proxy appends a port to `X-Forwarded-For`; with an access list set, an unreadable entry now gets 403
+ * Fixed Claude apps gateway telling Claude Desktop to export OpenTelemetry as JSON even when the terminal CLI uses protobuf, so protobuf-only collectors rejected Desktop’s data
+ * Fixed Desktop and web showing a session as busy while it only watches an artifact for updates
+ * Fixed Claude in Chrome `file_upload` failing with “paths: expected array, received undefined” in local Cowork sessions run from the Claude Desktop app
+ * Fixed `SendMessage` to an offline Remote Control session on another machine reading as delivered; the result now says delivery is queued until that machine reconnects
+ * Fixed plugin install hints from CLIs run in background Bash commands: they are now detected, and the raw `<claude-code-hint>` tag no longer leaks into the conversation
+ * Fixed in-process agent-team teammates re-sending their first-turn tool and skill announcements on the second turn, which changed the request prefix and missed the prompt cache
+ * Improved the `/model` picker and the VS Code model pill to show a model’s name instead of its raw Bedrock, Vertex AI, or LLM gateway ID when Claude Code recognizes it
+ * Improved startup on Google Vertex AI when `GOOGLE_APPLICATION_CREDENTIALS` is set: API client creation no longer re-runs Google Cloud project discovery or spawns extra `gcloud` processes
+ * Improved streaming performance: already-rendered blocks are no longer re-checked by layout on each update
+ * Improved the dangerous-`rm` safety prompt to also catch `rm -rf` on positional parameters and inside double-quoted `sh -c` scripts
+ * Improved handling when the API sends no response headers: the retry now waits up to `API_TIMEOUT_MS` (10 minutes by default) instead of another 3 minutes, and the messages say what to change
+ * Changed a Claude apps gateway 403 on the managed settings load (at startup or after `/login`) to say Claude Code may not be enabled for the organization, instead of advising a new sign-in
+ * Changed machines whose managed settings pin `forceLoginMethod: "gateway"` to ignore a leftover API key or claude.ai login and ask for `/login`; Bedrock, Vertex AI, and Foundry sessions are unaffected
+ * Changed auto mode to treat a link that packs content into a public diagram renderer’s URL as an upload to that site: no longer auto-approved unless you asked for it
+ * Changed the prompt’s word-editing keys to match Bash: Ctrl+W deletes back to whitespace, Alt+F and Alt+D stop at word end, punctuation separates words; `keybindingFlavor` no longer has any effect
+ * Changed `/context` token counting to use a local estimate when the token-counting API is unavailable, instead of extra small-model requests
+ * [VSCode] Added a “Build a custom style” walkthrough to the Output styles menu that writes a custom output style file and lists it right away
+ * [VSCode] Added an Add server form and a Remove action to the MCP servers dialog, so MCP servers can be added and removed without leaving the IDE
+ * [VSCode] Added a hollow ring in the session list for sessions open in a terminal, another VS Code window, or Claude Desktop, so they no longer look closed
+ * [VSCode] Added a fold button to permission and question prompts so the conversation behind them can be read without dismissing them; the space beside the prompt now scrolls the conversation
+ * [VSCode] Added “Archive session” to the session list’s right-click menu and gave Unarchive its own icon
+ * [VSCode] Fixed a session teleported from Claude Code on the web treating a question that was cut off when the cloud session shut down as declined
+ * [VSCode] Fixed the session tab’s Rename box opening empty for a tab restored with the window; it now starts with the current name
+ * [VSCode] Fixed collapsed sections in the session list panel briefly showing expanded each time the panel loaded
+ * [VSCode] Fixed Focus view showing a tool call as still running after Claude had moved on, such as while a question waited for your answer
+ * [VSCode] Fixed the session list’s active-row highlight going stale when an unfocused Claude tab’s session ID is corrected
+ * [VSCode] Fixed Cmd/Ctrl+Shift+T reopen and deep-link opens placing the Claude tab outside the Claude editor group when a Claude tab has focus
+ * [VSCode] Fixed the session tab’s “Add to group” putting a session opened from Claude Code on the Web in two groups; it now moves the entry the session list shows
+ * [VSCode] Fixed the model picker showing models an organization has since disabled until the window was reloaded twice
+ * [VSCode] Fixed a tab opened from the session list jumping back to that session, and a tab opened from a Web session restarting its teleport or staying empty, after VS Code reloads the tab’s view
+ * [VSCode] Fixed `/btw` side-question history from earlier sessions being overwritten when a question is asked right after a window reload or while a settings file has errors
+ * [VSCode] Fixed the pending question card not reappearing after the Claude panel reloads when signed in with a Claude.ai or Console account
+ * [VSCode] Fixed claude.ai-only features staying visible in a window’s other Claude panels after one panel picked up a third-party provider from a settings file
+ * [VSCode] Fixed the sign-in screen appearing despite the Disable Login Prompt setting when Claude Code reports no login or a request fails for lack of one
+ * [VSCode] Fixed the next queued permission prompt keeping text typed on the previous prompt and accepting an immediate second click
+ * [VSCode] Fixed install-plugin links opening the Claude sidebar without the install dialog in a window where only the session list had been shown
+ * [VSCode] Fixed the sidebar usage meter staying empty on a new window until the Account & usage dialog was opened, and a 0% usage limit being left out of the meter
+ * [VSCode] Fixed “Start new session in this group” losing the group after New conversation, and a missing unread dot for a session that finished before the sidebar’s unread list loaded
+ * [VSCode] Fixed the editor tab badge showing unread during a running turn or missing on a tab opened from the session list, and “Add Session Tab to Group” doing nothing for an archived session
+ * [VSCode] Fixed “Enable Remote Control for all sessions” so flipping it also applies right away to sessions open in other VS Code windows
+ * [VSCode] Fixed the session list’s Open filter for sessions continued from claude.ai whose tab was still recorded under the web session, and labeled the filter menu’s sections for screen readers
+ * [VSCode] Changed the model picker to one flat list of every model, with rows kept for older model spellings listed last
--- a/checkpointing.md
+++ b/checkpointing.md
@@ -19,7 +19,7 @@
* Every user prompt creates a new checkpoint
* Claude Code keeps file snapshots for the 100 most recent checkpoints in a session. Discarding an older checkpoint deletes the snapshot files that no remaining checkpoint references, except each file’s first snapshot, which the VS Code extension uses as the baseline for its session diffs.
* Claude Code saves checkpoints with the conversation, so you can still run `/rewind` after you resume a session
- * Claude Code deletes checkpoints along with sessions after 30 days, following the [retention sweep rules](</docs/en/claude-directory#cleaned-up-automatically>); change the period with [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>)
+ * Claude Code deletes a session’s file snapshots in the [retention sweep](</docs/en/claude-directory#cleaned-up-automatically>), by default about 30 days after the session last saved one. Rewinding to a checkpoint whose snapshots are gone can fail with [`No files were restored`](</docs/en/errors#no-files-were-restored>). To keep snapshots longer, set [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>).
###
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -114,12 +114,12 @@
`projects/<project>/<session>/tool-results/`| Large tool outputs spilled to separate files
`file-history/<session>/`| Pre-edit snapshots of files Claude changed, used for [checkpoint restore](</docs/en/checkpointing>). Holds snapshots for the 100 most recent checkpoints; snapshot files that no retained checkpoint references are deleted, except each file’s first snapshot
`plans/`| Plan files written during [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>)
-`debug/`| Per-session debug logs, written only when you start with `--debug` or run `/debug`
+`debug/`| Per-session debug logs, written while debug logging is on, such as when you start with [`--debug`](</docs/en/cli-reference#cli-flags>) or run `/debug`
`paste-cache/`| Contents of large pastes
`image-cache/<session>/`| Attached images. On each sweep, Claude Code removes the directories of all other sessions, whatever their age.
`uploads/<session>/`| Files you attach from the web or mobile app, and photos you attach from the mobile app, when messaging a [Remote Control](</docs/en/remote-control>) session. An attachment to a [cloud session](</docs/en/claude-code-on-the-web>) is saved in that session’s own cloud environment instead, not on your machine.
`session-env/`| Per-session environment metadata
-`tasks/`| Per-session task lists written by the task tools
+`tasks/`| Task lists written by the task tools, one directory per list
`shell-snapshots/`| Aliases, functions, and shell options captured at startup and applied by the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) to each command. Removed on clean exit. The sweep clears any left after a crash.
`backups/`| Earlier versions of `~/.claude.json`, copied when Claude Code rewrites the file. Claude Code keeps the five newest, plus a copy of any version it couldn’t parse.
`feedback-bundles/`| Redacted transcript archives written by `/feedback` on third-party providers or when no Anthropic credentials are configured, for sending to your Anthropic account team
@@ -130,7 +130,7 @@
Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule:
* **`sessions/`** : holds one small file per running session, used to detect concurrent sessions and crashes. It isn’t part of the age-based sweep: Claude Code removes each file when its session exits and clears crash leftovers on the next launch.
- * **Auto memory** : Claude Code excludes a project’s [auto memory](</docs/en/memory#auto-memory>) directory, `projects/<project>/memory/`, from this sweep, and removes the directory itself only after it has been empty for the whole retention period. Before v2.1.228, the sweep treated folders inside the memory directory as session data and could delete old files beneath it.
+ * **Auto memory** : the sweep doesn’t delete the memory files in a project’s [auto memory](</docs/en/memory#auto-memory>) directory, `projects/<project>/memory/`. Claude Code removes that directory only if it has been empty for the whole retention period. Before v2.1.228, the sweep treated folders inside the memory directory as session data and could delete old files beneath it.
* **Claude Desktop and Cowork transcripts** : Claude Code keeps the transcript of a session you started or most recently continued in Claude Desktop or Cowork at any age. To give these transcripts an age limit, set [`desktopSessionCleanupPeriodDays`](</docs/en/settings-reference#desktopsessioncleanupperioddays>). When [managed settings](</docs/en/managed-settings>) set `cleanupPeriodDays`, Claude Code deletes these transcripts after that period instead. Requires Claude Code v2.1.248 or later; earlier versions delete them after `cleanupPeriodDays`.
Claude Code skips the sweep entirely in these cases:
@@ -144,17 +144,21 @@
Kept until you delete them
-The retention cleanup sweep doesn’t cover the following paths. Claude Code keeps them until you delete them, apart from the two caches whose rows say that logging out deletes them.
+The retention cleanup sweep doesn’t remove the paths below. Claude Code keeps them until you delete them, apart from the two caches it deletes when you log out.
Path under `~/.claude/`| Contents
---|---
-`history.jsonl`| Every prompt you’ve typed, with timestamp and project path. Used for up-arrow recall.
+`history.jsonl`| Every prompt you’ve typed, with timestamp and project path. Used for up-arrow recall, `Ctrl+R` history search, and `!` shell-command completion.
`stats-cache.json`| Aggregated token and cost counts shown by `/usage`
`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization, or `{}` when your organization has configured none. Only present when the session [fetches them](</docs/en/server-managed-settings#platform-availability>). Claude Code checks for updates at startup and hourly during a session. Claude Code deletes it when you log out.
`cache/changelog.md`| Cached copy of the Claude Code changelog, shown by `/release-notes`. Refreshed in the background.
`policy-limits.json`| Cached feature policy settings for your organization. Only present for some account types. Refreshed automatically. Claude Code deletes it when you log out.
-Other small cache and lock files appear depending on which features you use and are safe to delete.
+Other files appear depending on which features you use. Caches and lock files are safe to delete. Keep these state files:
+
+ * `.credentials.json`: your [login credentials](</docs/en/authentication#credential-management>)
+ * `agent-memory/`: [subagent memory](</docs/en/sub-agents#enable-persistent-memory>)
+ * `jobs/` and `daemon/`: [background session](</docs/en/agent-view#where-state-is-stored>) state
###
@@ -209,12 +213,12 @@
claude project purge ~/work/my-repo --yes
-Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. You can also delete any of the application-data paths above by hand. New sessions are unaffected. The table below shows what you lose for past sessions.
+Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. You can also delete any of the application-data paths above by hand, apart from the state files to keep. New sessions are unaffected. The table below shows what you lose for past sessions.
Delete| You lose
---|---
`~/.claude/projects/`| Resume, continue, and rewind for past sessions, and auto memory for every project
-`~/.claude/history.jsonl`| Up-arrow prompt recall
+`~/.claude/history.jsonl`| Up-arrow prompt recall, `Ctrl+R` history search, and `!` shell-command completion
`~/.claude/paste-cache/`| Pasted text in recalled prompts; see [paste large content](</docs/en/terminal-config#paste-large-content>)
`~/.claude/uploads/`| Attachments that past [Remote Control](</docs/en/remote-control>) sessions refer to by path
`~/.claude/file-history/`| Checkpoint restore for past sessions
@@ -225,7 +229,8 @@
`~/.claude/remote-settings.json`| Nothing. Re-fetched on next launch.
`~/.claude/cache/changelog.md`| Nothing. Refreshed in the background.
`~/.claude/policy-limits.json`| Nothing. Refreshed automatically.
-`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
+`~/.claude/tasks/`| Task lists that a resumed session would pick up
+`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
`~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`| Nothing. Legacy directories not written by current versions.
Don’t delete `~/.claude.json`, `~/.claude/settings.json`, or `~/.claude/plugins/`: those hold your auth, preferences, and installed plugins.
--- a/cli-reference.md
+++ b/cli-reference.md
@@ -55,7 +55,7 @@
Flag| Description| Example
---|---|---
-`--add-dir`| Add additional working directories for Claude to read and edit files. Grants file access; most `.claude/` configuration is [not discovered](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) from these directories. Validates each path exists as a directory. To persist these directories across sessions, set [`permissions.additionalDirectories`](</docs/en/settings-reference#permissions-additionaldirectories>) in settings| `claude --add-dir ../apps ../lib`
+`--add-dir`| Add additional working directories for Claude to read and edit files. Grants file access; Claude Code [doesn’t discover](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) most `.claude/` configuration from these directories. Validates that each path exists as a directory. You can’t add most [network paths](</docs/en/errors#working-directory-is-a-network-path>), such as `\\server\share`. To persist these directories across sessions, set [`permissions.additionalDirectories`](</docs/en/settings-reference#permissions-additionaldirectories>) in settings| `claude --add-dir ../apps ../lib`
`--advisor <model>`| Enable the server-side [advisor tool](</docs/en/advisor>) for this session with a model alias, `fable`, `opus`, or `sonnet`, or a full model ID. Takes precedence over the `advisorModel` setting for the session. `fable` requires [Fable access](</docs/en/advisor#choose-an-advisor-model>)| `claude --advisor opus`
`--agent`| Specify an agent for the current session (overrides the `agent` setting)| `claude --agent my-custom-agent`
`--agents`| Define custom subagents dynamically via JSON. Accepts the [fields listed for CLI-defined subagents](</docs/en/sub-agents#choose-the-subagent-scope>). Claude Code validates the JSON at startup and exits on an invalid value; see [`Invalid --agents configuration`](</docs/en/errors#invalid-agents-configuration>) for the message and for the flags and environment variable that skip the validation. Validation requires Claude Code v2.1.242 or later| `claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'`
--- a/cloud-environments.md
+++ b/cloud-environments.md
@@ -224,7 +224,12 @@
*.internal.example.com
registry.example.com
-Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s API credentials, other than the hosts the agent proxy skips, don’t go through this allowlist. A leading `*.` matches every subdomain. To keep the Trusted domains too, check **Also include default list of common package managers** ; leave it unchecked to allow only what you list. If sessions in the environment work with [artifacts](</docs/en/artifacts>), include `*.frame.claudeusercontent.com` in your list. Claude Code fetches artifact content from that host. If you leave it out, Claude can’t read artifacts in sessions that run in the environment. Each environment has its own allowed-domains list; there’s no organization-level allowlist that admins can push to every member’s environments. [Server-managed settings](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist.
+Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s API credentials, other than the hosts the agent proxy skips, don’t go through this allowlist. A leading `*.` matches every subdomain. To keep the Trusted domains too, check **Also include default list of common package managers** ; leave it unchecked to allow only what you list. If your organization uses [artifacts](</docs/en/artifacts#availability>), you don’t need `*.frame.claudeusercontent.com` in the list for sessions to read them. When the list leaves that host out, Claude Code reads artifact content through the session’s connection to Anthropic instead. Keep the host in an allowlist in two situations:
+
+ * **Sessions in this environment open another organization’s public artifacts** : Claude Code fetches those from the host directly, so add it to this list.
+ * **You’re configuring the local CLI or a self-hosted runner** : keep the host in that allowlist. See [network access requirements](</docs/en/network-config#network-access-requirements>) and the self-hosted [network requirements](</docs/en/self-hosted-environments-deploy#network-requirements>).
+
+Each environment has its own allowed-domains list; there’s no organization-level allowlist that admins can push to every member’s environments. [Server-managed settings](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist.
###
--- a/commands.md
+++ b/commands.md
@@ -27,7 +27,7 @@
Command| Purpose
---|---
-`/add-dir <path>`| Add a working directory for file access during the current session. Type a partial path to see matching directory suggestions; press `Tab` to accept one. Most `.claude/` configuration is [not discovered](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) from the added directory. A successful add runs your [`DirectoryAdded` hooks](</docs/en/hooks#directoryadded>). When you run it while Claude is responding, Claude Code asks you to confirm the directory right away, and once you confirm, Claude’s next tool call in the same turn can access it. Before v2.1.234, Claude Code queued the command until the turn finished
+`/add-dir <path>`| Add a working directory for file access during the current session. Type a partial path to see matching directory suggestions; press `Tab` to accept one. Most `.claude/` configuration [isn’t discovered](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) from the added directory. You can’t add most [network paths](</docs/en/errors#working-directory-is-a-network-path>), such as `\\server\share`. After a successful add, your [`DirectoryAdded` hooks](</docs/en/hooks#directoryadded>) run. When you run it while Claude is responding, Claude Code asks you to confirm the directory right away, and once you confirm, Claude’s next tool call in the same turn can access it. Before v2.1.234, Claude Code queued the command until the turn finished
`/advisor [model|off]`| Enable or disable the [advisor tool](</docs/en/advisor>), which consults a second model for guidance at key moments during a task. Accepts `fable`, `opus`, `sonnet`, or a full model ID. `fable` requires [Fable access](</docs/en/advisor#choose-an-advisor-model>). Without an argument, opens a picker
`/agents`| As of v2.1.198, running `/agents` prints a reminder to ask Claude to create or manage [subagents](</docs/en/sub-agents>), or to edit `.claude/agents/` or `~/.claude/agents/` directly. On v2.1.197 and earlier, opens an interactive interface for creating and managing subagent configurations
`/artifacts`| List the [artifacts](</docs/en/artifacts#find-an-artifact-again>) you own or that are shared with you, then attach one to the session, open it in your browser, or copy its link. Available where [artifacts](</docs/en/artifacts#availability>) are. Requires Claude Code v2.1.208 or later; attaching with `Enter` requires v2.1.216
@@ -57,7 +57,7 @@
`/design-login`| Authorize design-system access for `/design-sync` with your claude.ai account
`/design-sync [hint]`| **[Skill](</docs/en/skills#bundled-skills>).** Convert your repo’s React design system and upload it to [Claude Design](<https://claude.ai/design>), so designs it produces use your real components. Optionally name the design system, for example `/design-sync Acme DS`. A first-time sync verifies every component and can take a few hours on a large repo. Available on the Anthropic API; on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS the underlying tool can’t reach claude.ai, so the command is unavailable
`/desktop`| Continue the current session in the Claude Code Desktop app. Requires macOS or x64 Windows and a Claude subscription. Alias: `/app`
-`/diff`| Open an interactive diff viewer showing uncommitted changes and per-turn diffs. Use left/right arrows to switch between the current git diff and individual Claude turns, and up/down to browse files. Press Enter to open the selected file’s diff, scroll it with up/down or PageUp/PageDown, and press Esc to return to the file list. Claude Code computes these diffs from raw git blob content, so diff drivers and `textconv` filters configured in `.gitattributes` or git config don’t apply. Before v2.1.222, workspace-configured drivers and filters could rewrite the viewer’s output. The open viewer also refreshes automatically when the repository’s git state changes outside the session, such as a branch switch or commit in another terminal; the auto-refresh requires Claude Code v2.1.198 or later
+`/diff`| Review the changes in your working tree, including the edits Claude has made so far. See [Review changes with /diff](</docs/en/interactive-mode#review-changes-with-%2Fdiff>)
`/doctor`| **[Skill](</docs/en/skills#bundled-skills>).** Run a setup checkup that diagnoses issues and can fix them. Checks installation health, including duplicate or leftover installs, `PATH` problems, and unparseable settings files. Finds unused skills, MCP servers, and plugins versus their context cost, flags slow [hooks](</docs/en/hooks>), and checks for a newer version on your [release channel](</docs/en/setup#configure-release-channel>). Deduplicates local `CLAUDE.md` files against checked-in ones, trims checked-in [`CLAUDE.md`](</docs/en/memory#my-claude-md-is-too-large>) files by cutting content Claude could derive from the codebase, and migrates the always-loaded guidance that remains into [skills](</docs/en/skills>) and nested `CLAUDE.md` files that load on demand. Also offers to make [auto mode](</docs/en/permissions#permission-modes>) your default and to [pre-approve](</docs/en/permissions>) frequently denied read-only commands. Reports findings first and asks for confirmation before changing anything. From the terminal, `claude doctor` prints read-only installation diagnostics without starting a session. Alias: `/checkup`. The `CLAUDE.md` trim check requires Claude Code v2.1.206 or later. Before v2.1.205, `/doctor` opened a read-only diagnostics screen and pressing `f` sent the report to Claude
`/effort [level|auto|status]`| Set the [effort level](</docs/en/model-config#adjust-effort-level>): `low` to `xhigh`, `max`, [`ultracode`](</docs/en/workflows#let-claude-decide-with-ultracode>), or `auto`; `status` prints it. `max` and `ultracode` are session-only; the [`ultracode`](</docs/en/settings-reference#ultracode>) key persists. Run it while Claude is responding and, once you confirm the [cache warning](</docs/en/prompt-caching#changing-effort-level>), if Claude Code shows one, Claude Code applies the new level to the next request in that turn. Before v2.1.242, Claude Code decided from a feature flag it fetched from Anthropic whether to run the command mid-turn or queue it until the turn finished, and always queued it in a session that doesn’t [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), such as on a [third-party provider](</docs/en/third-party-integrations>). Works in `-p` outside the [effort hold](</docs/en/model-config#adjust-effort-level>)
`/exit`| Exit the CLI. In an attached [background session](</docs/en/agent-view#attach-to-a-session>), this detaches and the session keeps running. Alias: `/quit`
@@ -114,6 +114,7 @@
`/setup-bedrock`| Configure [Amazon Bedrock](</docs/en/amazon-bedrock>) authentication, region, and model pins through an interactive wizard. Hidden from the command menu until `CLAUDE_CODE_USE_BEDROCK=1` is set; type it in full. First-time Amazon Bedrock users can also access this wizard from the login screen
`/setup-vertex`| Configure [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) authentication, project, region, and model pins through an interactive wizard. Hidden from the command menu until `CLAUDE_CODE_USE_VERTEX=1` is set; type it in full. First-time Google Cloud’s Agent Platform users can also access this wizard from the login screen
`/simplify [target]`| **[Skill](</docs/en/skills#bundled-skills>).** Review the changed code for cleanup opportunities and apply the fixes. Four review [agents](</docs/en/sub-agents>) run in parallel, covering reuse of existing helpers, simplification, efficiency, and whether the change is at the right level of abstraction. The review doesn’t look for correctness bugs. Use `/code-review` to find bugs. Pass a path or PR reference to review a specific target
+`/skill-doctor`| Show what each of your [skills](</docs/en/skills>) costs in context and how often it gets used, so you can [find skills to turn off](</docs/en/skills#find-unused-skills>). Requires Claude Code v2.1.252 or later and [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>)
`/skills`| List available [skills](</docs/en/skills>). Type to filter the list by name, description, or source. Press `t` to sort by token count, `Space` or `Enter` to [cycle a skill’s visibility to Claude and the `/` menu](</docs/en/skills#override-skill-visibility-from-settings>), and `Esc` to save and close. You can’t cycle plugin skills, skills whose frontmatter sets `disable-model-invocation: true`, or skills with a `skillOverrides` entry in managed settings or the `--settings` flag
`/stats`| Alias for `/usage`. Opens on the Stats tab
`/status`| Open the Settings interface on the Status tab, showing version, model, account, and connectivity. A `Session kind` row reads `background job · attached` or `background job · unattended` in a [background session](</docs/en/agent-view>), depending on whether a terminal is attached, and `interactive` in any other session. Before v2.1.221, `/status` didn’t show this row. Works while Claude is responding
--- a/costs.md
+++ b/costs.md
@@ -37,7 +37,7 @@
The misses, expected rebuilds, and warm or cold parts of the line mean the following:
- * **Misses** : requests that re-processed content the cache already held, with the time of the last miss and how many tokens those requests wrote back to the cache. Claude Code counts a request as a miss when the request re-processed more than 5% and at least 2,000 tokens of what it could have read from cache. [Actions that invalidate the cache](</docs/en/prompt-caching#actions-that-invalidate-the-cache>) lists the usual causes.
+ * **Misses** : requests that re-processed content the cache already held, with the time of the last miss and how many tokens those requests wrote back to the cache. Claude Code counts a request as a miss when the request re-processed more than 5% and at least 2,000 tokens of what it could have read from cache. [Actions that invalidate the cache](</docs/en/prompt-caching#actions-that-invalidate-the-cache>) lists the usual causes. When Claude Code can identify a likely cause for the last miss, the line names it too, for example `likely cause: tool definitions changed`. The likely-cause text requires Claude Code v2.1.260 or later.
* **Expected rebuilds** : when Claude Code has itself just rewritten the conversation, by [compaction](</docs/en/prompt-caching#compacting-the-conversation>) or by clearing old tool results from context, it counts the same kind of miss as an expected rebuild instead. This part appears only after at least one expected rebuild has happened.
* **Warm or cold** : whether the cached prefix is still within its [cache lifetime](</docs/en/prompt-caching#cache-lifetime>), with the TTL in effect. When the cache is cold, the line shows how long the session has been idle. When no response has reported cache tokens, the line ends with `no prompt caching reported by the API` instead.
--- a/deep-links.md
+++ b/deep-links.md
@@ -45,7 +45,7 @@
Parameter| Description
---|---
`q`| Text to pre-fill in the prompt box. [URL-encode](<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent>) the value. Use `%0A` for line breaks in multi-line prompts. Maximum 5,000 characters.
-`cwd`| Absolute path to use as the working directory. Network and UNC paths are rejected, and so are paths that contain invisible or bidirectional control characters.
+`cwd`| Absolute path to use as the working directory. Network and UNC paths are rejected, and so are paths that contain `..` segments or invisible or bidirectional control characters.
`repo`| A GitHub `owner/name` slug. Claude Code resolves it to a local clone it has seen before and starts there. If you have no matching clone, the session opens in your home directory instead.
`cwd` and `repo` are two ways to set the working directory. If you pass both, `cwd` takes precedence and `repo` is ignored, even if the `cwd` path does not exist. The following link points at a repository called `acme/payments` with a two-line diagnostic prompt. Replace `acme/payments` with your repository’s `owner/name` slug when you build your own:
--- a/discover-plugins.md
+++ b/discover-plugins.md
@@ -163,12 +163,13 @@
Browse available plugins
-Run `/plugin` to open the plugin manager. This opens a tabbed interface with four tabs you can cycle through using **Tab** , or **Shift+Tab** to go backward:
+Run `/plugin` to open the plugin manager. This opens a tabbed interface you can cycle through using **Tab** , or **Shift+Tab** to go backward:
* **Discover** : browse available plugins from all your marketplaces
* **Installed** : view and manage your installed plugins
* **Marketplaces** : add, remove, or update your added marketplaces
* **Errors** : view any plugin loading errors
+ * **Stats** : see [what each of your skills costs in context and how often it gets used](</docs/en/skills#find-unused-skills>), in sessions where `/skill-doctor` is available
Go to the **Discover** tab to see plugins from the marketplace you just added. When your administrator has allowlisted the marketplace via the [`pluginSuggestionMarketplaces`](</docs/en/settings-reference#pluginsuggestionmarketplaces>) managed setting, plugins marked as relevant to your current working directory are pinned at the top with a **suggested for this directory** label.
--- a/env-vars.md
+++ b/env-vars.md
@@ -163,7 +163,7 @@
`API_TIMEOUT_MS`| Timeout for API requests in milliseconds (default: 600000, or 10 minutes; maximum: 2147483647). Increase this when requests time out on slow networks or when routing through a proxy. Values above the maximum overflow the underlying timer and cause requests to fail immediately
`AWS_BEARER_TOKEN_BEDROCK`| Amazon Bedrock API key for authentication (see [Amazon Bedrock API keys](<https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/>))
`BASH_DEFAULT_TIMEOUT_MS`| Default timeout for long-running bash commands (default: 120000, or 2 minutes)
-`BASH_MAX_OUTPUT_LENGTH`| Maximum number of characters of bash output that Claude Code reads back into a command’s result (default: 30000; maximum: 150000). See [Output limits](</docs/en/tools-reference#output-limits>)
+`BASH_MAX_OUTPUT_LENGTH`| Maximum number of characters of bash output that Claude Code reads back into a command’s result (default: 30000; maximum: 150000). If you set the [`bashOutputMaxChars`](</docs/en/settings-reference#bashoutputmaxchars>) setting, Claude Code ignores this variable. See [Output limits](</docs/en/tools-reference#output-limits>)
`BASH_MAX_TIMEOUT_MS`| Maximum timeout the model can set for long-running bash commands (default: 600000, or 10 minutes). The effective ceiling is the larger of this and `BASH_DEFAULT_TIMEOUT_MS`
`BETA_TRACING_ENDPOINT`| OTLP endpoint for [detailed beta tracing](</docs/en/monitoring-usage#traces-beta>): with `ENABLE_BETA_TRACING_DETAILED=1`, logs and traces go there instead of to the configured 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>)
`CCR_FORCE_BUNDLE`| Set to `1` to force [`claude --cloud`](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) to bundle and upload your local repository even when GitHub access is available
@@ -232,7 +232,7 @@
`CLAUDE_CODE_DISABLE_MOUSE`| Set to `1` to disable mouse tracking in [fullscreen rendering](</docs/en/fullscreen>). Keyboard scrolling with `PgUp` and `PgDn` still works. Use this to keep your terminal’s native copy-on-select behavior
`CLAUDE_CODE_DISABLE_MOUSE_CLICKS`| Set to `1` to disable click, drag, and hover handling in [fullscreen rendering](</docs/en/fullscreen>) while keeping mouse-wheel scrolling. Use this when you want wheel scroll to work inside Claude Code but don’t want clicks to position the cursor, expand tool output, or open links. `CLAUDE_CODE_DISABLE_MOUSE` takes precedence when both are set. Requires Claude Code v2.1.195 or later
`CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION`| Set to `1` to stop Claude Code from re-reading the [mTLS client certificate and key](</docs/en/network-config#mtls-authentication>) when an API request fails with a connection-level error, such as a connection reset or a TLS handshake error. With the reload disabled, Claude Code loads rotated files only when it next applies settings or at the next startup. Requires Claude Code v2.1.232 or later
-`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`| Set to any non-empty value, such as `1`, to disable nonessential network traffic: auto-updates, telemetry, error reporting, the `/feedback` command, [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>), release notes, the [PR and MR status badge](</docs/en/interactive-mode#pr-review-status>) checks, [gateway model discovery](</docs/en/llm-gateway-connect#add-gateway-models-to-the-model-picker>) refreshes, and availability checks such as the [fast mode](</docs/en/fast-mode#use-fast-mode-behind-proxies-and-llm-gateways>) check. It also stops the [background runs of plugin `command` sources](</docs/en/plugin-marketplaces#when-claude-code-re-runs-the-command>), which are local commands rather than network traffic, because they can trigger dependency installs. **Setting it to`0` or `false` still disables this traffic**, unlike most on/off variables; unset the variable to allow it again. Also disables feature-flag fetching, which makes [Remote Control](</docs/en/remote-control#requirements>) and the other features that need feature-flag fetching unavailable. Official plugin marketplace auto-install isn’t covered; disable it with `CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL`
+`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`| Set to any non-empty value, such as `1`, to disable nonessential network traffic: auto-updates, telemetry, error reporting, the `/feedback` command, [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>), release notes, the [PR and MR status badge](</docs/en/interactive-mode#pr-review-status>) checks, and availability checks such as the [fast mode](</docs/en/fast-mode#use-fast-mode-behind-proxies-and-llm-gateways>) check. It also stops the [background runs of plugin `command` sources](</docs/en/plugin-marketplaces#when-claude-code-re-runs-the-command>), which are local commands rather than network traffic, because they can trigger dependency installs. **Setting it to`0` or `false` still disables this traffic**, unlike most on/off variables; unset the variable to allow it again. Also disables feature-flag fetching, which makes [Remote Control](</docs/en/remote-control#requirements>) and the other features that need feature-flag fetching unavailable. Official plugin marketplace auto-install isn’t covered; disable it with `CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL`. Doesn’t affect [gateway model discovery](</docs/en/llm-gateway-connect#add-gateway-models-to-the-model-picker>), which has its own opt-in
`CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK`| Set to `1` to disable the non-streaming fallback when a streaming request fails mid-stream. Streaming errors propagate to the retry layer instead. Useful when a proxy or gateway causes the fallback to produce duplicate tool execution
`CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK`| Set to `1` to send the `PushNotification` tool’s desktop notification even while you are typing in or focused on the terminal. By default the tool skips both the desktop notification and the [mobile push](</docs/en/remote-control#mobile-push-notifications>) when it detects recent keyboard activity or terminal focus. This variable disables only that local check, so the server can still suppress the mobile push when it detects that you are active. Requires Claude Code v2.1.193 or later
`CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL`| Set to `1` to disable automatic registration of the official plugin marketplace. Claude Code reads the variable when it is about to register the marketplace, usually during a machine’s first interactive launch. If the variable is set at that point, Claude Code skips the registration permanently. Unsetting the variable later doesn’t undo the skip. Run `claude plugin marketplace add anthropics/claude-plugins-official` to register the marketplace at any time
@@ -308,7 +308,7 @@
`CLAUDE_CODE_PLUGIN_PREFER_HTTPS`| Set to `1` to clone GitHub `owner/repo` shorthand sources over HTTPS instead of SSH. Applies to plugin install and update, and to `/plugin marketplace add` and `update`. Useful in CI runners, containers, or any environment without a configured SSH key for `github.com`
`CLAUDE_CODE_PLUGIN_SEED_DIR`| Path to one or more read-only plugin seed directories, separated by `:` on Unix or `;` on Windows. Use this to bundle a pre-populated plugins directory into a container image. Claude Code registers marketplaces from these directories at startup and uses pre-cached plugins without re-cloning. See [Pre-populate plugins for containers](</docs/en/plugin-marketplaces#pre-populate-plugins-for-containers>)
`CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY`| Set to `1` to stop Claude Code from passing `-ExecutionPolicy Bypass` when spawning PowerShell for tool calls, hooks, and status line commands, and respect the machine’s effective execution policy instead. By default Claude Code bypasses execution policy at process scope so `.ps1` scripts and module imports work on default-Restricted Windows installs. Process-scope bypass never overrides Group Policy `MachinePolicy` or `UserPolicy` regardless of this setting
-`CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS`| Ceiling in milliseconds on continuous idle waiting after the final turn in [non-interactive mode](</docs/en/headless#background-tasks-at-exit>) with the `-p` flag, while background subagents and workflows whose result is part of the output finish. Each turn that handles queued background results starts the count again. Default: `600000`, or 10 minutes. When idle waiting reaches the ceiling, Claude Code stops waiting for the remaining background tasks and exits. Set to `0` to wait indefinitely. This cap is separate from the five-second grace period that applies to plain background shells. Requires Claude Code v2.1.182 or later
+`CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS`| Ceiling in milliseconds on idle waiting for background subagents and workflows after the final turn in [non-interactive mode](</docs/en/headless#background-tasks-at-exit>) with the `-p` flag. Idle waiting starts over each time Claude takes a turn to handle a background result. Default: `600000`, or 10 minutes. When idle waiting reaches the ceiling, Claude Code stops waiting for the remaining background tasks and exits. Set to `0` to wait indefinitely. This cap is separate from the five-second grace period that applies to plain background shells. Requires Claude Code v2.1.182 or later
`CLAUDE_CODE_PROCESS_WRAPPER`| Launch the processes Claude Code starts from its own binary, such as the background service that hosts [agent view](</docs/en/agent-view>) sessions, through a corporate launcher given as an argv prefix like `/opt/corp/launcher`. Set it in the `env` block of user or [managed settings](</docs/en/managed-settings>), not as a shell export, so the detached background service inherits it; project and local settings can’t set it. Equivalent to the [`processWrapper` setting](</docs/en/settings-reference#processwrapper>), which requires Claude Code v2.1.210 or later; this variable takes precedence when both are set. The VS Code extension configures its own launcher separately through its `claudeProcessWrapper` setting. Ignored on Windows. See [Run Claude Code behind a corporate launcher](</docs/en/corporate-launcher>) for the value format, what the launcher covers, and the contract the launcher must satisfy. Requires Claude Code v2.1.208 or later
`CLAUDE_CODE_PROJECT_DIR_NAME`| Set together with `CLAUDE_CONFIG_DIR` to choose the `projects/` directory name Claude Code stores that session’s transcripts and auto memory under, in place of one derived from the working directory path. For example, starting Claude Code with `CLAUDE_CONFIG_DIR=/srv/tenant-a CLAUDE_CODE_PROJECT_DIR_NAME=work claude` stores them under `/srv/tenant-a/projects/work/`. Claude Code ignores this variable when `CLAUDE_CONFIG_DIR` is unset, and reads it only from the environment you start `claude` from, never from a settings file `env` block. See [Name the project directory yourself](</docs/en/sessions#name-the-project-directory-yourself>). Requires Claude Code v2.1.234 or later
`CLAUDE_CODE_PROMPT_CACHE_TTL`| Set `5m` or `1h`, the only values Claude Code accepts, to choose the [prompt cache TTL](</docs/en/prompt-caching#cache-lifetime>) for the main conversation: your interactive, `-p`, and SDK turns, plus the helpers that run inline with them. Takes precedence over the `promptCacheTtl` setting and over `ENABLE_PROMPT_CACHING_1H`, and `FORCE_PROMPT_CACHING_5M` overrides it. The API bills 1-hour cache writes at a higher rate. Requires Claude Code v2.1.242 or later
@@ -446,7 +446,7 @@
`OTEL_METRICS_INCLUDE_SESSION_ID`| Set to `false` to exclude session ID from metrics attributes (default: included). See [Monitoring](</docs/en/monitoring-usage>)
`OTEL_METRICS_INCLUDE_VERSION`| Set to `true` to include Claude Code version in metrics attributes (default: excluded). See [Monitoring](</docs/en/monitoring-usage>)
`SLASH_COMMAND_TOOL_CHAR_BUDGET`| Override the character budget for skill metadata shown to the [Skill tool](</docs/en/skills#control-who-invokes-a-skill>). The budget scales dynamically at 1% of the context window, with a fallback of 8,000 characters. Legacy name kept for backwards compatibility
-`TASK_MAX_OUTPUT_LENGTH`| Maximum number of characters in [subagent](</docs/en/sub-agents>) output before truncation (default: 32000, maximum: 160000). When truncated, the full output is saved to disk and the path is included in the truncated response
+`TASK_MAX_OUTPUT_LENGTH`| Maximum number of characters of a [background task’s](</docs/en/tools-reference#background-commands>) output that the `TaskOutput` tool keeps (default: 32000; maximum: 160000). If you set the [`taskOutputMaxChars`](</docs/en/settings-reference#taskoutputmaxchars>) setting, Claude Code ignores this variable
`USE_BUILTIN_RIPGREP`| Set to `0` to use system-installed `rg` instead of `rg` included with Claude Code
`VERTEX_REGION_CLAUDE_3_5_HAIKU`| Override region for Claude 3.5 Haiku when using Google Cloud’s Agent Platform
`VERTEX_REGION_CLAUDE_3_5_SONNET`| Override region for Claude 3.5 Sonnet when using Google Cloud’s Agent Platform
@@ -488,6 +488,7 @@
* Use [Remote Control](</docs/en/remote-control#requirements>)
* [Message sessions beyond this machine](</docs/en/cross-session-messaging#message-sessions-on-other-machines>); messaging between sessions on this machine works with fetching off
* Run [`claude import` or the `/import` command](</docs/en/cli-reference#cli-commands>)
+ * Run [`/skill-doctor`](</docs/en/skills#find-unused-skills>) or open its report in the `/plugin` **Stats** tab
* Use [the advisor tool](</docs/en/advisor#requirements>)
* Read or reply to [comments on an artifact](</docs/en/artifacts#collect-comments-on-an-artifact>)
* Get the [v2 MCP client runtime](</docs/en/mcp#mcp-client-runtimes>) and its protocol probe without setting `MCP_SDK_GENERATION` and `MCP_PROTOCOL_NEGOTIATION`; Claude Code uses the v1 runtime unless you set `MCP_SDK_GENERATION=v2`, and skips the probe unless you set `MCP_PROTOCOL_NEGOTIATION=auto`
Show diff (284 lines)
--- a/errors.md
+++ b/errors.md
@@ -158,6 +158,7 @@
`Cannot switch renderers while work is running in the background`| Command-line errors
`Couldn't read your Zed keymap` / `Couldn't back up your Zed keymap` / `Couldn't update your Zed keymap`| Command-line errors
`Your Zed keymap isn't a readable list of keybindings`| Command-line errors
+`Skill usage reports are not available on this connection.`| Command-line errors
`Marketplace "<name>" is registered from an untrusted source`| Plugin errors
`references ${user_config.*} in a shell-form command`| Plugin errors
`Monitor "<name>" from plugin <plugin> references ${user_config.*} in its command`| Plugin errors
@@ -183,6 +184,7 @@
`Refusing to write <path>: its parent-directory symlink resolution changed after permission was checked` / `Refusing to write <path>: it is a symbolic link. Write to the link's target path instead`| Tool errors
`Refusing to search <path>: a path one of its Read deny rules is written through changed while the search was being prepared` / `Refusing to search <path>: it could not be opened`| Tool errors
`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
`Can't open MCP settings while no terminal is attached to this background session`| Background session errors
`Can't open MCP settings in a background session`| Background session errors
`blocked because the path is spelled in a form that cannot be safely resolved`| Background session errors
@@ -202,7 +204,8 @@
`exited before it became reachable`| Background session errors
`Claude Code process exited with code N`| Wrapper and IDE errors
`Could not locate the Claude CLI on PATH`| Wrapper and IDE errors
-`Restored the code, but skipped N files`| Rewind warnings
+`Restored the code, but skipped N files`| Rewind warnings and errors
+`No files were restored: N files failed (backup missing, or the file could not be updated)`| Rewind warnings and errors
`Transcript writes are failing (...)`| Session saving warnings
`Transcript saving is off — CLAUDE_CODE_SKIP_PROMPT_HISTORY is set`| Session saving warnings
`Transcript saving is off — inherited CLAUDE_CODE_CHILD_SESSION marker`| Session saving warnings
@@ -210,11 +213,14 @@
`Claude Code exited after an unrecoverable interface error (...)`| Configuration warnings
`Agent descriptions are over the 15.0k-token limit`| Configuration warnings
`Ignoring N permissions.allow entries from ... this workspace has not been trusted`| Configuration warnings
+`is a network path, which cannot be added as a working directory`| Configuration warnings
`Remote managed settings failed to load (<cause>)`| Configuration warnings
+`MCP server <name> is blocked by enterprise managed policy`| Configuration warnings
`Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.`| Configuration warnings
`Managed settings drop-in directory could not be read`| Configuration warnings
`"crossSessionInbound" must be one of "accept", "hold", "refuse"`| Configuration warnings
`headersHelper not run — this workspace has no persisted trust`| Configuration warnings
+`Invalid permission rule "..." was skipped: Malformed Tool(content) rule`| Configuration warnings
`... is not matched by file permission checks`| Configuration warnings
`... has a wildcard before the rest of the command`| Configuration warnings
`CLAUDE_CODE_DISABLE_1M_CONTEXT is set, but the 200K limit isn't enforced`| Configuration warnings
@@ -277,7 +283,7 @@
---|---|---
[`CLAUDE_CODE_MAX_RETRIES`](</docs/en/env-vars>)| 10| Number of retry attempts. Capped at 15 as of v2.1.186; as of v2.1.199 `CLAUDE_CODE_RETRY_WATCHDOG` raises the default and removes the cap. Lower it to surface failures faster in scripts.
[`CLAUDE_CODE_RETRY_WATCHDOG`](</docs/en/env-vars>)| unset| Set to `1` in unattended sessions such as CI jobs to retry `429` and `529` capacity errors indefinitely instead of failing after `CLAUDE_CODE_MAX_RETRIES` attempts. Claude Code fails at once on a `429` that reports a spend limit or exhausted usage credits, even one from a gateway spend cap that resets on a schedule. Before v2.1.239, the watchdog retried these indefinitely. On v2.1.199 or later it also raises the default retry count for other transient errors, such as server errors, timeouts, and dropped connections, to 300, roughly three hours of backoff, and removes the cap of 15 on `CLAUDE_CODE_MAX_RETRIES` if you set that variable explicitly.
-[`API_TIMEOUT_MS`](</docs/en/env-vars>)| 600000| Per-request timeout in milliseconds. Raise it for slow networks or proxies. It also bounds the first-byte deadline.
+[`API_TIMEOUT_MS`](</docs/en/env-vars>)| 600000| Per-request timeout in milliseconds. Raise it for slow networks or proxies. It also caps how long Claude Code waits for response headers, described in No response from API.
[`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`](</docs/en/env-vars>)| unset| Deadline in milliseconds for the first response byte of a streaming request. Requires Claude Code v2.1.242 or later. For how Claude Code picks the deadline when this is unset, see No response from API.
##
@@ -343,23 +349,23 @@
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 per model request, within the retry budget, and ends the turn with this message when that attempt goes unanswered too. 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.
-
- API Error: No response from API
-
-Claude Code picks the deadline from the first of these that applies:
-
- * [`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`](</docs/en/env-vars>), when you set it to 1 or more: Claude Code uses that value, clamped to between 10 seconds and 30 minutes, and adds one second for every 32KB of request body. Claude Code ignores 0 and lower.
- * [`API_TIMEOUT_MS`](</docs/en/env-vars>), when you set it above the byte-level watchdog timeout, 180 seconds on the Anthropic API and 300 seconds elsewhere: Claude Code uses one second less than the value you set.
- * Otherwise, Claude Code uses the byte-level watchdog timeout, and adds one second for every 32KB of request body.
-
-Whichever case applies, the deadline never exceeds one second less than a positive `API_TIMEOUT_MS`, and a positive `API_TIMEOUT_MS` under 11 seconds turns the deadline off. See [Streaming idle watchdogs](</docs/en/network-config#streaming-idle-watchdogs>) for the variables that change the watchdog timeout and the connections the deadline runs on. 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:**
+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.
+
+ 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.
+
+Claude Code sets the first attempt’s wait for response headers and the retry’s wait separately:
+
+ * **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.
+
+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:**
* 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. A proxy that accepts the connection and never forwards the request produces this error on every attempt.
- * On a slow network, set `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` to the deadline you want, or set `API_TIMEOUT_MS` above the watchdog timeout.
-
-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.
+ * 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.
###
@@ -2275,6 +2281,20 @@
Before v2.1.247, `/terminal-setup` couldn’t parse a Zed keymap that used `//` comments or trailing commas, and it replaced the entire file with only its own binding while reporting the binding as installed. To restore a keymap an earlier version replaced, use the `.bak` backup file described under [Enter multiline prompts](</docs/en/terminal-config#enter-multiline-prompts>).
+###
+
+
+
+Skill usage reports are not available on this connection
+
+You ran [`/skill-doctor`](</docs/en/skills#find-unused-skills>) over [Remote Control](</docs/en/remote-control>), from your phone or browser. Claude Code doesn’t send the skill usage report over Remote Control and replies with this message instead:
+
+ Skill usage reports are not available on this connection.
+
+**What to do:**
+
+ * Run `/skill-doctor` in the terminal on the machine where the session is running, or run `claude -p "/skill-doctor"` there
+
##
@@ -2353,9 +2373,14 @@
commands path escapes plugin directory: ./../shared.md
-In `claude plugin` command output, the same error reads `Path escapes plugin directory: ./../shared.md (commands)`. Before v2.1.251, Claude Code loaded a `commands` path declared in a marketplace entry even when it pointed outside the plugin directory. Claude Code already rejected paths declared in `plugin.json` and the other component paths in a marketplace entry. **What to do:**
+In `claude plugin` command output, the same error reads `Path escapes plugin directory: ./../shared.md (commands)`. Claude Code rejects both a path that points outside the plugin as written, such as `../shared-utils`, and a symlink that leads outside the plugin and isn’t one the [marketplace symlink rules](</docs/en/plugins-reference#share-files-within-a-marketplace-with-symlinks>) allow. For a symlink, the message also says where the path resolves:
+
+ commands path escapes plugin directory: ./commands/deploy.md — it resolves to /home/user/shared/deploy.md, outside the plugin directory
+
+Before v2.1.251, Claude Code loaded a `commands` path declared in a marketplace entry even when it pointed outside the plugin directory. Claude Code already rejected paths declared in `plugin.json` and the other component paths in a marketplace entry. Before v2.1.257, the check looked only at the path’s spelling, not at where a symlink leads. **What to do:**
* Move the referenced file inside the plugin directory and point the path at it with a `./` relative path
+ * If the path is a symlink to a file outside the plugin, replace the symlink with a copy of the file
* To share files with other plugins in the same marketplace, link them with a symlink inside the plugin directory, following the [symlink rules](</docs/en/plugins-reference#share-files-within-a-marketplace-with-symlinks>)
###
@@ -2384,7 +2409,7 @@
Tool errors
-These errors come from Claude’s built-in tools. Claude corrects most tool errors on its own; the first two below need a change from you, because they come from a subagent definition or a permission rule you control.
+These errors come from Claude’s built-in tools. Claude corrects most tool errors on its own. When one needs a change from you, that error’s **What to do** list says what to change.
###
@@ -2588,6 +2613,22 @@
Before v2.1.251, Claude Code re-checked a path’s resolution only for file writes, so a link replaced after the permission check could redirect a read or search to a different location without a message. Of these refusals, only the parent-directory write refusal appears on earlier versions.
+###
+
+
+
+Task output swap refused
+
+Claude Code saves each Bash command’s output to a file under its temp directory. This message means a directory on that file’s path is a symbolic link or has been moved, so Claude Code refused to run the command rather than write its output through that path. The message appears in the Bash tool result:
+
+ task output swap refused (tasks dir moved or linked): /private/tmp/claude-501/-Users-you-my-project/1f0e62dc-4b0a-4f5e-9c2d-8a7b6c5d4e3f/tasks/b7k2f9m3q.output. To recover: restart Claude Code with CLAUDE_CODE_TMPDIR set to a fresh directory; or, if /private/tmp/claude-501/-Users-you-my-project is a stray directory or a symbolic link that should not be there, remove that entry itself (not what it points to) and restart.
+
+**What to do:**
+
+ * Upgrade to v2.1.260 or later. Earlier versions sometimes showed this message when no link or moved directory was present
+ * Restart Claude Code with [`CLAUDE_CODE_TMPDIR`](</docs/en/env-vars>) set to a fresh directory
+ * Or check your project’s directory under the Claude Code temp directory, `/private/tmp/claude-501/-Users-you-my-project` in the example message. If that path is a symbolic link, or a directory that shouldn’t be there, remove the link or directory itself rather than the link’s target, and restart Claude Code
+
##
@@ -2894,9 +2935,9 @@
-Rewind warnings
-
-This warning comes from a [`/rewind`](</docs/en/checkpointing>) code restore. It reports paths the restore refused to touch; the restore completed for every other tracked file.
+Rewind warnings and errors
+
+These messages come from a [`/rewind`](</docs/en/checkpointing>) code restore. `Restored the code, but skipped N files` is a warning that Claude Code skipped some paths. `No files were restored` is an error that means it restored nothing.
###
@@ -2920,6 +2961,25 @@
* If a skipped file is a link you created on purpose, such as a config file managed by a dotfile manager or a file hard-linked by tools like pnpm, the rewind left its contents alone. To undo the session’s changes to it, ask Claude to reverse the edit or edit the file yourself
* If you didn’t create the link, inspect the path before trusting its contents: something replaced the file after the checkpoint
+###
+
+
+
+No files were restored
+
+Claude Code shows this message when you restore code with [`/rewind`](</docs/en/checkpointing>) and it can’t restore any of the files in that checkpoint. For each file, either the backup Claude Code saved before editing it is missing, or Claude Code couldn’t write to or delete the file.
+
+ Failed to restore the code:
+ No files were restored: 1 file failed (backup missing, or the file could not be updated)
+
+Claude Code deletes a session’s backups in the [retention sweep](</docs/en/claude-directory#cleaned-up-automatically>), by default about 30 days after the session last saved one. If you resume a session after that, `/rewind` still lists its checkpoints, but rewinding to one of them can fail with this error. If the message also says `N paths were skipped for link safety`, see Restored the code, but skipped files for those paths. **What to do:**
+
+ * Undo the changes another way: ask Claude to reverse its edits, or restore the files from version control. When the backups are gone, running `/rewind` again fails the same way.
+ * If Claude Code couldn’t write or delete a file, fix what blocks the write, such as file permissions, then run `/rewind` again.
+ * To keep backups longer in future sessions, raise [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>).
+
+Before v2.1.260, Claude Code silently skipped files whose backups were missing, and the rewind appeared to succeed.
+
##
@@ -3059,6 +3119,30 @@
+Working directory is a network path
+
+Claude Code doesn’t add network paths as working directories. Looking up a network path can contact the host it names, and on Windows that contact can send the host your credentials, so Claude Code refuses the path without looking it up. You see this message when you run `/add-dir` with such a path, or as a warning at startup. When it appears at startup, Claude Code starts without that directory.
+
+ \\server\share is a network path, which cannot be added as a working directory. On Windows, map the share to a drive letter and pass it at launch with --add-dir (a drive letter added mid-session does not yet carry remote-read trust).
+
+Paths that Claude Code refuses this way include:
+
+ * UNC shares such as `\\server\share`
+ * Automount paths such as `/net/<host>`, unless you launched Claude Code from a directory under that host’s automount
+ * Local paths that reach a network location through a symbolic link or junction
+
+Mapped drive letters and `\\wsl$` paths don’t count as network paths. **What to do:**
+
+ * On Windows, map the share to a drive letter, for example with `net use Z: \\server\share`, and pass the drive at launch with `claude --add-dir Z:\`.
+ * On macOS or Linux, mount the share at a local path and add that path instead.
+ * If the path is in `permissions.additionalDirectories`, remove it from the settings file that lists it.
+
+Before v2.1.257, Claude Code accepted a reachable network path as a working directory.
+
+###
+
+
+
Remote managed settings failed to load
Your session is eligible for [server-managed settings](</docs/en/server-managed-settings>), but Claude Code couldn’t fetch them, so it shows this warning in interactive sessions. The parenthesized cause names what failed, such as `network error`, `request timed out`, or `authentication rejected (401)`, and the rest of the line says which policy the session runs on:
@@ -3072,6 +3156,30 @@
* Run `/status` or `claude doctor` for the full diagnostic
Before v2.1.248, Claude Code reported a failed settings fetch only in the debug log.
+
+###
+
+
+
+MCP server is blocked by enterprise managed policy
+
+You selected **Reconnect** on a server in `/mcp`, or turned a disabled server back on there, and a setting that [restricts MCP servers](</docs/en/managed-mcp>) blocks that server. Claude Code refuses to connect it and shows:
+
+ MCP server <name> is blocked by enterprise managed policy
+
+Any of these settings can produce the message:
+
+ * A [`deniedMcpServers`](</docs/en/managed-mcp#policy-based-control-with-allowlists-and-denylists>) entry that matches the server, including one in your own `~/.claude/settings.json` or the project’s `.claude/settings.json`
+ * An [`allowedMcpServers`](</docs/en/managed-mcp#policy-based-control-with-allowlists-and-denylists>) list that the server doesn’t match
+ * [`strictPluginOnlyCustomization`](</docs/en/settings-reference#strictpluginonlycustomization>) with `mcp` locked, which blocks servers configured in `~/.claude.json` and `.mcp.json`
+ * [`disableClaudeAiConnectors`](</docs/en/mcp#disable-claude-ai-connectors>), when the server is a claude.ai connector
+
+**What to do:**
+
+ * Check your own user and project settings files for one of these settings and change or remove it
+ * If none of your own settings explains the block, ask your administrator which managed setting blocks the server
+
+Before v2.1.257, **Reconnect** and re-enable in `/mcp` could connect a server that a mid-session policy update blocked.
###
@@ -3109,6 +3217,23 @@
* Run `claude` in the folder the message names, accept the trust dialog, then run your `-p` or SDK command again
* Set the `hasTrustDialogAccepted` entry in `~/.claude.json` yourself, using the exact `projects` key the message prints
* If you started the session in your home directory, work from a project directory you have trusted. When you accept the trust dialog in your home directory, Claude Code holds that trust for the current session only.
+
+###
+
+
+
+Malformed Tool(content) rule
+
+A [permission rule](</docs/en/permissions#permission-rule-syntax>) in one of your settings files doesn’t have the shape `Tool` or `Tool(content)`, for example because text follows the closing parenthesis or one of the parentheses is missing. Claude Code skips the rule and lists it in the invalid-settings dialog when an interactive session starts, and in [`claude doctor`](</docs/en/debug-your-config#check-resolved-settings>) output:
+
+ Invalid permission rule "Bash(ls) x" was skipped: Malformed Tool(content) rule. Rules take the form Tool or Tool(content) and must end at the closing ")"; parentheses inside the content are literal
+
+**What to do:**
+
+ * In the settings file listed with the message, rewrite the rule so it ends at its closing parenthesis, for example `Bash(ls *)` in place of `Bash(ls) x`
+ * Leave parentheses inside the content as they are. They’re literal, so a rule such as `Edit(./Finance (2024)/**)` is valid without escaping
+
+Before v2.1.260, Claude Code reported a rule with unmatched parentheses as `Mismatched parentheses`.
###
--- a/fullscreen.md
+++ b/fullscreen.md
@@ -180,9 +180,17 @@
+Watch your changes in the diff panel
+
+In fullscreen rendering, [`/diff`](</docs/en/interactive-mode#review-changes-with-%2Fdiff>) opens a panel beside the conversation rather than a viewer you have to close, so you can watch the changes accumulate while Claude works. In a wide terminal the panel can also open on its own once Claude starts editing files. [Diff panel](</docs/en/interactive-mode#diff-panel>) covers what it shows, how to keep it closed, and how to change what it compares against.
+
+##
+
+
+
Clear the conversation
-Run `/clear` to start a new conversation. Pressing `Ctrl+L` or `Cmd+K` doesn’t clear the conversation; Claude Code redraws the screen and keeps it. Before v2.1.238, Claude Code ran `/clear` when you pressed `Ctrl+L` or `Cmd+K` twice within two seconds. On iTerm2 and Terminal.app, your terminal handles `Cmd+K` itself and clears its own screen without telling Claude Code. Claude Code detects the cleared screen and repaints the conversation.
+Run `/clear` to start a new conversation. To clear the screen and keep the conversation, press `Ctrl+L`. The earlier messages scroll up out of view, and you can scroll back with `PgUp` or the mouse wheel to read them again. Before v2.1.260, `Ctrl+L` redrew the screen without clearing it. Before v2.1.238, pressing it twice within two seconds ran `/clear`. `Cmd+K` does the same as `Ctrl+L` when your terminal passes it through to Claude Code. iTerm2 and Terminal.app handle `Cmd+K` themselves, and Claude Code redraws the conversation instead of clearing it, so press `Ctrl+L` on those terminals.
##
--- a/headless.md
+++ b/headless.md
@@ -50,7 +50,7 @@
Background tasks at exit
-If Claude starts a [background Bash task](</docs/en/tools-reference#bash-tool-behavior>) during a `claude -p` run, for example a dev server or a watch build, that shell is terminated about five seconds after Claude has returned its final result and stdin has closed. The grace period lets a task that finishes right after the result still deliver its output. Before v2.1.163, a never-exiting background process would hold the `claude -p` invocation open indefinitely. Background [subagents](</docs/en/sub-agents>) and workflows are exempt from the five-second grace because their result is part of the final output, so `claude -p` waits for them to complete. From v2.1.182, that wait is capped at ten minutes of continuous idle waiting by default, so a stuck background agent can’t hold the process open indefinitely. Adjust the cap with [`CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS`](</docs/en/env-vars>), or set it to `0` to wait without a limit.
+If Claude starts a [background Bash task](</docs/en/tools-reference#bash-tool-behavior>) during a `claude -p` run, for example a dev server or a watch build, that shell is terminated about five seconds after Claude has returned its final result and stdin has closed. The grace period lets a task that finishes right after the result still deliver its output. If Claude starts a background [subagent](</docs/en/sub-agents>) or workflow, `claude -p` instead stays open until that work completes, because its result is part of the final output. By default the wait ends after 10 minutes of continuous idle waiting, so a stuck subagent or workflow can’t hold the process open indefinitely. At that point Claude Code stops whatever is still running and drops its partial result. To change the limit, set [`CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS`](</docs/en/env-vars>), or set it to `0` to wait without one. If Claude starts a [Monitor](</docs/en/tools-reference#monitor-tool>) watch during a `claude -p` run, Claude Code waits for the watch until it times out or the ten-minute cap ends the wait, whichever comes first. While it waits, Claude keeps responding to what the watch reports. By default, a watch times out five minutes after Claude starts it.
###
@@ -181,6 +181,7 @@
`max_retries`| integer| total retries permitted
`retry_delay_ms`| integer| milliseconds until the next attempt
`error_status`| integer or null| HTTP status code, or `null` for connection errors with no HTTP response
+`no_response`| object, optional| present only when the failed attempt got [no response headers in time](</docs/en/errors#no-response-from-api>). `waited_ms` is how long that attempt waited and `retry_wait_ms` is how long the retry will wait. In these events, `max_retries` reflects the one retry this cause normally gets, not the session-wide budget. Requires Claude Code v2.1.261 or later
`error`| string| error category: `authentication_failed`, `oauth_org_not_allowed`, `billing_error`, `rate_limit`, `overloaded`, `invalid_request`, `model_not_found`, `server_error`, `max_output_tokens`, or `unknown`
`uuid`| string| unique event identifier
`session_id`| string| session the event belongs to
Show diff (122 lines)
--- a/interactive-mode.md
+++ b/interactive-mode.md
@@ -18,7 +18,7 @@
`Ctrl+X Ctrl+K`| Stop all running [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) in this session, and turn off [artifact auto-replies](</docs/en/artifacts#let-claude-reply-to-comments-on-its-own>) for the rest of it. Press twice within 3 seconds to confirm| Subagent control
`Ctrl+D`| Exit Claude Code session| The first press shows a confirmation hint and a second press within 800ms exits. When the prompt has text, `Ctrl+D` deletes the character after the cursor instead
`Ctrl+G` or `Ctrl+X Ctrl+E`| Open in default text editor| Edit your prompt or custom response in your default text editor. `Ctrl+X Ctrl+E` is the readline-native binding. Turn on **Show last response in external editor** in `/config` to prepend Claude’s previous reply as `#`-commented context above your prompt; Claude Code strips the comment block when you save
-`Ctrl+L`| Redraw screen| Forces a full terminal redraw, keeping input and conversation history. Use this to recover if the display becomes garbled or partially blank
+`Ctrl+L`| Redraw or clear the screen| Forces a full terminal redraw, keeping input and conversation history. Use this to recover if the display becomes garbled or partially blank. In [fullscreen rendering](</docs/en/fullscreen#clear-the-conversation>), it also clears the screen, and you can scroll up to see the earlier messages
`Ctrl+O`| Toggle transcript viewer| Shows detailed tool usage and execution, with a timestamp and the model used on each assistant message. Also expands lines that collapse by default, such as MCP calls, shown as a single `Called slack 3 times` line, and [messages from your other sessions](</docs/en/cross-session-messaging#what-a-message-looks-like>), shown as a one-line `Message from @<sender>` preview
`Ctrl+R`| Reverse search command history| Search through previous commands interactively
`Ctrl+V` or `Cmd+V` (iTerm2) or `Alt+V` (Windows and WSL)| Paste image from clipboard| Inserts an `[Image #N]` chip at the cursor so you can reference it positionally in your prompt. On WSL, both `Ctrl+V` and `Alt+V` are bound; use `Alt+V` if your terminal intercepts `Ctrl+V`
@@ -48,32 +48,21 @@
`Ctrl+E`| Move cursor to end of current line| In multiline input, moves to the end of the current logical line
`Ctrl+K`| Delete to end of line| Stores deleted text for pasting
`Ctrl+U`| Delete from cursor to line start| Stores deleted text for pasting. Repeat to clear across lines in multiline input. On macOS, terminal emulators including iTerm2 and Terminal.app map `Cmd+Backspace` to this shortcut
-`Ctrl+W`| Delete previous word| Stores deleted text for pasting. On macOS, `Option+Delete` deletes the previous word, and on Windows, `Ctrl+Backspace` does. To make `Ctrl+W` delete back to the previous whitespace instead, set `keybindingFlavor` to `"readline"`
-`Ctrl+Y`| Paste deleted text| Paste text deleted with `Ctrl+K`, `Ctrl+U`, `Ctrl+W`, or, under `keybindingFlavor: "readline"`, `Alt+D`
+`Ctrl+W`| Delete back to previous whitespace| Stores deleted text for pasting. One press removes a whole path or `--flag=value`. To delete only the previous word, press `Option+Delete` on macOS or `Ctrl+Backspace` on Windows
+`Ctrl+Y`| Paste deleted text| Pastes the text you last deleted with one of the word or line deletion shortcuts, such as `Ctrl+K`, `Ctrl+U`, or `Ctrl+W`
`Alt+Y` (after `Ctrl+Y`)| Cycle paste history| After pasting, cycle through previously deleted text. Requires Option as Meta on macOS
`Alt+B`| Move cursor back one word| Word navigation. Requires Option as Meta on macOS
-`Alt+F`| Move cursor forward one word| Moves to the start of the next word, or to the end of the current word when `keybindingFlavor` is `"readline"`. Requires Option as Meta on macOS
-`Alt+D`| Delete next word| Deletes through the space after the word, or to the end of the word when `keybindingFlavor` is `"readline"`. Requires Option as Meta on macOS
+`Alt+F`| Move cursor forward one word| Moves to the end of the current word, or to the end of the next word when the cursor is between words. Requires Option as Meta on macOS
+`Alt+D`| Delete to end of word| Deletes to the end of the current word, or to the end of the next word when the cursor is between words. Stores deleted text for pasting. Requires Option as Meta on macOS
`Ctrl+_` or `Ctrl+Shift+-`| Undo last input edit| Restores the previous input text and cursor position
###
-Make editing keys follow readline conventions
-
-Set [`keybindingFlavor`](</docs/en/settings-reference#keybindingflavor>) to `"readline"` to make the prompt’s editing keys follow GNU readline conventions, as in Bash. The default value is `"classic"`. Requires Claude Code v2.1.238 or later. Under `"readline"`:
-
- * `Ctrl+W` deletes back to the previous whitespace.
- * A word is a run of letters and digits, so punctuation such as `_`, `.`, and `/` separates words. `Alt+F` and `Alt+D` stop at the end of the current word, and `Ctrl+Y` can paste back text that `Alt+D` deleted. Before v2.1.239, Claude Code applied `"readline"` only to `Ctrl+W`.
-
-Add the setting to `~/.claude/settings.json`:
-
- {
- "keybindingFlavor": "readline"
- }
-
-To confirm, type `fix the bug in src/utils/foo.ts` in the prompt and press `Ctrl+W`. Claude Code removes `src/utils/foo.ts`. Under `"classic"` it removes only `foo.ts`. This setting is separate from the [keybindings configuration file](</docs/en/keybindings>): the word-editing commands aren’t actions there, so you can’t remap them in `keybindings.json`.
+Word boundaries in editing shortcuts
+
+The word shortcuts `Alt+B`, `Alt+F`, `Alt+D`, `Option+Delete`, and `Ctrl+Backspace` treat a word as a run of letters and digits, so punctuation such as `_`, `.`, and `/` separates words. With `src/utils/foo.ts` in the prompt, repeated presses of `Alt+B` stop at the start of `ts`, `foo`, `utils`, and `src`. `Ctrl+W` is different: it ignores punctuation and deletes back to the previous whitespace, so one press removes all of `src/utils/foo.ts`. In text written without spaces, such as Chinese or Japanese, the word shortcuts still move or delete one word at a time. These readline conventions apply in Claude Code v2.1.261 and later. The [`keybindingFlavor`](</docs/en/settings-reference#keybindingflavor>) setting that turned them on in earlier versions is deprecated and has no effect. You can’t remap these shortcuts in the [keybindings configuration file](</docs/en/keybindings>), which has no actions for them.
###
@@ -345,7 +334,8 @@
* Output is written to a file and Claude can retrieve it using the Read tool
* Background tasks have unique IDs for tracking and output retrieval
- * Background tasks are automatically cleaned up when Claude Code exits. If you background the session instead of exiting it, Claude Code hands them to the background session, where they keep running. See [background a running session](</docs/en/agent-view#from-inside-a-session>)
+ * Background tasks are automatically cleaned up when Claude Code exits. On macOS and Linux, when you stop a background task from [`/tasks`](</docs/en/commands>) or Claude Code stops it at exit, processes that detached from the task’s shell, such as ones started under `setsid` or `timeout`, stop too
+ * If you background the session instead of exiting it, your background tasks keep running in the background session. See [background a running session](</docs/en/agent-view#from-inside-a-session>)
* Background tasks are automatically terminated if output exceeds 5GB, with a note in stderr explaining why
* On macOS and Linux, Claude Code terminates running background tasks when the operating system signals memory pressure, provided the session has been idle for at least 30 minutes and no turn or subagent is running. Set [`CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP`](</docs/en/env-vars>) to `1` to turn this off. Requires Claude Code v2.1.193 or later. Background commands owned by a [subagent](</docs/en/sub-agents>) are instead terminated after 60 minutes, configurable in milliseconds with [`CLAUDE_SUBAGENT_BG_SHELL_MAX_MS`](</docs/en/env-vars>). A command owned by a subagent running in the foreground also ends when that subagent gives its final response; see [Background commands](</docs/en/tools-reference#background-commands>) in the tools reference. Before v2.1.218, neither the memory-pressure reap nor the 60-minute limit covered commands moved to the background with `Ctrl+B`
@@ -380,7 +370,7 @@
* Exit with `Escape`, `Backspace`, or `Ctrl+U` on an empty prompt
* Pasting text that starts with `!` into an empty prompt enters shell mode automatically, matching typed `!` behavior
-Claude responds to the command output automatically once it lands in the transcript, so you can run `! npm test` and get an explanation of the failures without a second prompt. The response costs the same as sending a normal prompt. To restore the earlier behavior where the output is added to context without a response, set [`respondToBashCommands`](</docs/en/settings-reference#respondtobashcommands>) to `false` in `settings.json`. Before v2.1.186, shell mode always added output to context without a response.
+In a regular interactive session, commands you type in shell mode run outside the [sandbox](</docs/en/sandboxing>) even when you’ve enabled sandboxing, because the sandbox applies to the commands Claude runs. See [strict sandbox mode](</docs/en/sandboxing#the-unsandboxed-retry-escape-hatch>) for the sessions where shell-mode commands run sandboxed too, such as background sessions with strict sandbox mode on. Claude responds to the command output automatically once it lands in the transcript, so you can run `! npm test` and get an explanation of the failures without a second prompt. The response costs the same as sending a normal prompt. To restore the earlier behavior where the output is added to context without a response, set [`respondToBashCommands`](</docs/en/settings-reference#respondtobashcommands>) to `false` in `settings.json`. Before v2.1.186, shell mode always added output to context without a response.
##
@@ -577,6 +567,51 @@
+Review changes with /diff
+
+Run `/diff` to look over the changes in your working tree without leaving Claude Code. You see the edits Claude has made so far alongside anything else you haven’t committed. In [fullscreen rendering](</docs/en/fullscreen>), `/diff` opens the diff panel beside the conversation, which stays open and updates while you keep working. In the classic renderer, `/diff` opens the diff viewer in place of the prompt, and you close it when you’re done reading.
+
+###
+
+
+
+Diff panel
+
+The diff panel lists the changed files with their added and removed line counts, and shows each file’s diff under the list. Claude Code refreshes it each time Claude edits a file or runs a shell command. To close it, run `/diff` again or click the `✕` in its header. To use the panel you need:
+
+ * [Fullscreen rendering](</docs/en/fullscreen>)
+ * A git repository
+ * A terminal at least 110 columns wide
+ * Claude Code v2.1.260 or later
+
+When the panel can’t open, `/diff` opens the diff viewer instead or tells you why. The panel also opens on its own once Claude starts editing files, if your terminal is at least 144 columns wide. After you’ve opened it yourself with `/diff`, later sessions open it as soon as Claude edits a file in any terminal wide enough to fit it. Close the panel and it stays closed, in this session and later ones, until you run `/diff` again. While the panel is open, you can:
+
+ * **Jump to a file** : click its row in the list. Scroll the panel with the mouse wheel. When the file list itself is too long to fit, scroll it with `Alt+Up` and `Alt+Down`, or `Ctrl+Up` and `Ctrl+Down`.
+ * **Ask Claude about specific lines** : select them in the panel with the mouse. Claude Code attaches the selection to your next prompt and shows a line count next to the input until you send it.
+ * **Show the files the panel leaves out** : the list skips test files and generated files, and collapses changes from before this session into one line at the bottom. Click either count line to expand it.
+ * **Change what the panel compares against** : press `Ctrl+X B` to cycle from this session’s changes, to your uncommitted changes as one list, to everything since your branch split from the default branch. Claude Code remembers the choice for each project.
+
+To bind keys to these actions, see [Diff panel actions](</docs/en/keybindings#diff-panel-actions>).
+
+###
+
+
+
+Diff viewer
+
+The diff viewer takes the place of the prompt until you close it. Its **Current** view shows your uncommitted changes from git, or, when there are none, what your branch adds on top of the default branch. The viewer also has a turn view for each prompt after which Claude edited files, showing just those edits. Claude Code builds the turn views from Claude’s file edits rather than from git, so a change Claude makes through a shell command appears only under Current. Use these keys in the viewer:
+
+ * **Left and Right** : move between Current and the turn views.
+ * **Up and Down** : select a file.
+ * **Enter** : open the selected file’s diff. Scroll it with Up and Down, or PageUp and PageDown.
+ * **Esc** : return from a file’s diff to the list, or close the viewer from the list.
+
+To rebind these keys, see [Diff actions](</docs/en/keybindings#diff-actions>).
+
+##
+
+
+
Side questions with /btw
Use `/btw` to ask a question about your current work without adding to the conversation history.
--- a/keybindings.md
+++ b/keybindings.md
@@ -57,6 +57,7 @@
`Footer`| Footer indicator navigation (tasks, teams, diff, artifacts)
`MessageSelector`| Rewind and summarize dialog message selection
`DiffDialog`| Diff viewer navigation
+`DiffPanel`| The [diff panel](</docs/en/interactive-mode#diff-panel>) is open
`ModelPicker`| Model picker effort level
`Select`| Generic select/list components
`Plugin`| Plugin dialog (browse, discover, manage)
@@ -113,8 +114,8 @@
Action| Default| Description
---|---|---
`chat:cancel`| Escape| Cancel current input
-`chat:clearInput`| Ctrl+L| Force a full screen redraw, preserving input and conversation
-`chat:clearScreen`| Cmd+K| Force a full screen redraw, preserving input and conversation. See [Clear the conversation](</docs/en/fullscreen#clear-the-conversation>) for how Cmd+K behaves on iTerm2 and Terminal.app
+`chat:clearInput`| Ctrl+L| Force a full screen redraw, preserving input and conversation. In [fullscreen rendering](</docs/en/fullscreen#clear-the-conversation>), also clear the screen
+`chat:clearScreen`| Cmd+K| Same as `chat:clearInput`. See [Clear the conversation](</docs/en/fullscreen#clear-the-conversation>) for how Cmd+K behaves on iTerm2 and Terminal.app
`chat:killAgents`| Ctrl+X Ctrl+K| Stop all running [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) in this session and turn off [artifact auto-replies](</docs/en/artifacts#let-claude-reply-to-comments-on-its-own>) for the rest of it
`chat:cycleMode`| Shift+Tab*| Cycle permission modes
`chat:modelPicker`| Meta+P| Open model picker
@@ -337,6 +338,23 @@
`scroll:fullPageDown`| Space| Scroll down a full viewport
`scroll:top`| G, Home| Jump to the top
`scroll:bottom`| Shift+G, End| Jump to the bottom
+
+###
+
+
+
+Diff panel actions
+
+Actions for the [diff panel](</docs/en/interactive-mode#diff-panel>) that `/diff` opens in fullscreen rendering. `app:cycleDiffBase` is in the `DiffPanel` context, which is active while the panel is open; the others are `Global`. The panel requires Claude Code v2.1.260 or later.
+
+Action| Default| Description
+---|---|---
+`app:toggleReplTab`| (unbound)| Open or close the diff panel, the same as running `/diff`
+`app:cycleDiffBase`| Ctrl+X B| Cycle the panel’s comparison base: this session, uncommitted, then branch
+`app:diffFileListUp`| Ctrl+Up, Meta+Up| Scroll the panel’s file list up when it overflows
+`app:diffFileListDown`| Ctrl+Down, Meta+Down| Scroll the panel’s file list down when it overflows
+`app:toggleDiffNoiseFilter`| (unbound)| Show or hide test and generated files in the panel
+`app:toggleDiffPreSession`| (unbound)| Expand or collapse the changes from before this session
###
@@ -535,7 +553,7 @@
]
}
-This also works for chord bindings. Unbinding every chord that shares a prefix frees that prefix for use as a single-key binding. A chord in any active context keeps its prefix reserved, so you must unbind each chord in the context that defines it. Claude Code binds these default chords on the `ctrl+x` prefix: `ctrl+x ctrl+k`, `ctrl+x ctrl+e`, and `ctrl+x enter` in `Chat`, and `ctrl+x ctrl+b` in `Task`. The `ctrl+x enter` chord requires v2.1.247 or later. To reclaim `ctrl+x` itself as a single-key binding, unbind all of them:
+This also works for chord bindings. Unbinding every chord that shares a prefix frees that prefix for use as a single-key binding. A chord in any active context keeps its prefix reserved, so you must unbind each chord in the context that defines it. Claude Code binds these default chords on the `ctrl+x` prefix: `ctrl+x ctrl+k`, `ctrl+x ctrl+e`, and `ctrl+x enter` in `Chat`, `ctrl+x ctrl+b` in `Task`, and `ctrl+x b` in `DiffPanel`. The `ctrl+x enter` chord requires v2.1.247 or later, and `ctrl+x b` requires v2.1.260 or later. To reclaim `ctrl+x` itself as a single-key binding, unbind all of them:
{
"bindings": [
@@ -543,6 +561,12 @@
"context": "Task",
"bindings": {
"ctrl+x ctrl+b": null
+ }
+ },
+ {
+ "context": "DiffPanel",
+ "bindings": {
+ "ctrl+x b": null
}
},
{
--- a/large-codebases.md
+++ b/large-codebases.md
@@ -176,7 +176,7 @@
}
}
-Deny rules cover Claude’s built-in file tools and recognized Bash file commands, including `cat`, `head`, `grep`, and `find`, when a denied path is passed as an argument. Claude Code also makes a best-effort attempt to leave denied paths out of the results of the built-in Grep and Glob tools. Claude still sees denied paths in the output of a Bash search such as `grep -r` or `find`. Deny rules don’t cover subprocesses that open files themselves. For the full pattern syntax, see [Read and Edit permission rules](</docs/en/permissions#read-and-edit>).
+Deny rules cover Claude’s built-in file tools. In Bash, they cover the file commands Claude Code recognizes, such as `cat`, `head`, `grep`, and `find`, when a denied path appears as an argument, and the target of a [redirection](</docs/en/permissions#redirections>) such as `< file`. Claude Code also makes a best-effort attempt to leave denied paths out of the results of the built-in Grep and Glob tools. A Bash search such as `grep -r` or `find` over a directory that contains denied files still includes them in its output. Deny rules don’t cover subprocesses that open files themselves. For the full pattern syntax, see [Read and Edit permission rules](</docs/en/permissions#read-and-edit>).
###
--- a/llm-gateway-connect.md
+++ b/llm-gateway-connect.md
@@ -319,7 +319,7 @@
Add gateway models to the model picker
-With model discovery enabled, Claude Code queries the gateway for its model list at startup and adds those names to the `/model` picker alongside the built-in entries. If you or your administrator set `replaceBuiltInOptions` in a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup, Claude Code hides the discovered names too. It keeps a row for the model the session is already using. Enable it if your gateway serves model names that aren’t in Claude Code’s built-in list and you want to select them from the picker. If the built-in models are what you use, you don’t need discovery; your administrator may also have already enabled it through managed settings. To enable it, set `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` in your shell or in the `env` block of `~/.claude/settings.json`. Discovered models appear as additional `/model` entries labeled `From gateway`. To confirm discovery ran, start `claude --debug` and look for the `[gatewayDiscovery]` lines in the debug log at `~/.claude/debug/<session-id>.txt`: Claude Code logs how many models it cached the first time discovery succeeds and again only when the gateway’s list changes, and a `404`, timeout, or redirect is recorded there too. For when discovery runs, what it filters, and the response format gateways serve, see the [model discovery reference](</docs/en/llm-gateway-protocol#model-discovery>).
+With model discovery enabled, Claude Code queries the gateway for its model list at startup and adds those names to the `/model` picker alongside the built-in entries. If you or your administrator set `replaceBuiltInOptions` in a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup, Claude Code hides the discovered names too. It keeps a row for the model the session is already using. Enable it if your gateway serves model names that aren’t in Claude Code’s built-in list and you want to select them from the picker. If the built-in models are what you use, you don’t need discovery; your administrator may also have already enabled it through managed settings. To enable it, set `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` in your shell or in the `env` block of `~/.claude/settings.json`. Discovered models appear as additional `/model` entries. Each entry shows the description your gateway supplies for the model, or `From gateway` when it doesn’t supply one. To confirm discovery ran, start `claude --debug` and look for the `[gatewayDiscovery]` lines in the debug log at `~/.claude/debug/<session-id>.txt`. The first time discovery succeeds, Claude Code logs how many models it cached, and it logs again only when the gateway’s list changes. A `404`, timeout, or redirect appears there too. For when discovery runs, what it filters, and the response format gateways serve, see the [model discovery reference](</docs/en/llm-gateway-protocol#model-discovery>).
###
@@ -376,7 +376,7 @@
* It disables auto-updates, so plan for another update path, such as your package manager or managed distribution.
* It suppresses the [fast mode](</docs/en/fast-mode>) availability check. Unless a previous check already enabled fast mode on the machine, `/fast` reports that fast mode is unavailable.
- * It turns off gateway model discovery, even though discovery queries the gateway itself. Previously discovered models stay available from the local cache, but the list isn’t refreshed.
+ * It doesn’t affect gateway model discovery, which queries only your gateway. Before v2.1.257, the variable also stopped discovery from refreshing, so the picker kept the previously cached list.
* The WebFetch tool’s [domain safety check](</docs/en/data-usage#webfetch-domain-safety-check>) isn’t affected and still calls `api.anthropic.com`. Turn it off separately with `skipWebFetchPreflight: true` in [settings](</docs/en/settings>) if your network blocks that host.
* For each telemetry stream and the variable that controls it, see [telemetry services](</docs/en/data-usage#telemetry-services>).
--- a/llm-gateway-protocol.md
+++ b/llm-gateway-protocol.md
@@ -177,7 +177,8 @@
* Any `CLAUDE_CODE_USE_*` provider variable is set, even if `ANTHROPIC_BASE_URL` is also set
* `ANTHROPIC_BASE_URL` is unset or points at `api.anthropic.com`
- * Nonessential traffic is disabled, through [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>) or organization policy
+
+Discovery still runs when [nonessential traffic is turned off](</docs/en/llm-gateway-connect#turn-off-traffic-outside-the-gateway-path>), because the request goes only to your gateway. Before v2.1.257, discovery didn’t run while nonessential traffic was turned off.
###
@@ -190,11 +191,15 @@
* `Authorization`: `ANTHROPIC_AUTH_TOKEN` as a bearer token, otherwise the [`apiKeyHelper`](</docs/en/llm-gateway-connect#rotate-credentials-with-apikeyhelper>) value as a bearer token. In that case Claude Code waits for the helper to return before sending the request.
* `x-api-key`: the API key Claude Code resolved, such as `ANTHROPIC_API_KEY`. When a helper value is the only credential, this header carries it too, so the value arrives in both headers.
-Claude Code also sends any headers from `ANTHROPIC_CUSTOM_HEADERS`. When neither credential header’s value resolves, Claude Code skips discovery and writes a `[gatewayDiscovery] skipped` line to the debug log of a `claude --debug` session. Claude Code reads `id` and the optional `display_name` from each entry in the response’s `data` array:
+Claude Code also sends any headers from `ANTHROPIC_CUSTOM_HEADERS`. When a custom header has a non-empty value, Claude Code sends it in place of a built-in header of the same name, matching names case-insensitively. When neither credential header’s value resolves, Claude Code skips discovery and writes a `[gatewayDiscovery] skipped` line to the debug log of a `claude --debug` session. If you supply a credential only through `ANTHROPIC_CUSTOM_HEADERS`, Claude Code still skips discovery. Claude Code reads `id`, the optional `display_name`, and the optional `description` from each entry in the response’s `data` array:
{
"data": [
- { "id": "claude-sonnet-4-6", "display_name": "Claude Sonnet 4.6" },
+ {
+ "id": "claude-sonnet-4-6",
+ "display_name": "Claude Sonnet 4.6",
+ "description": "Default model for everyday coding tasks"
+ },
{ "id": "claude-opus-4-8" }
]
}
@@ -207,7 +212,12 @@
Picker entries and caching
-The picker is the interactive model list that opens when a developer runs `/model` in Claude Code. Each discovered entry is labeled “From gateway” and uses `display_name` when provided. The [`availableModels` managed setting](</docs/en/settings-reference#availablemodels>) bounds what discovery can add. A discovered ID is skipped when it exactly matches a row already in the picker, or when the discovered and existing IDs are spellings of the same [Fable](</docs/en/model-config#work-with-fable>) version. A discovered explicit ID is also folded into a built-in entry when both resolve to the same model. Built-in rows are keyed on aliases such as `sonnet`, so a discovered explicit ID of the model the alias currently resolves to, such as `claude-sonnet-5`, collapses into the `sonnet` row, while an ID the alias doesn’t resolve to, such as `claude-sonnet-4-6`, still adds its own “From gateway” row alongside the built-in entry. Before v2.1.197, Claude Code didn’t fold explicit IDs into built-in entries, so a discovered ID such as `claude-sonnet-5` added its own “From gateway” row alongside the `sonnet` row. Results are cached to `~/.claude/cache/gateway-models.json`, or `%USERPROFILE%\.claude\cache\gateway-models.json` on Windows, and refreshed on each startup. If you set [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>), the cache lives under that directory instead. If the request fails or the gateway doesn’t implement `/v1/models`, the picker falls back to the cached list from the previous startup or to the built-in model list. If your gateway serves Claude models under aliases that don’t match the discovery filter, developers can add those aliases manually with the [model configuration](</docs/en/model-config>) variables.
+The picker is the interactive model list that opens when a developer runs `/model` in Claude Code. Each discovered entry uses `display_name` as its name when the gateway sends one, and the model’s `id` otherwise. Discovery adds only models that the [`availableModels` managed setting](</docs/en/settings-reference#availablemodels>) allows. Each entry also shows the model’s `description`, collapsed to one line. An entry without a `description` reads “From gateway” instead. Before v2.1.257, every discovered entry read “From gateway”. A discovered ID doesn’t get its own row when it matches a row already in the picker:
+
+ * Same ID: the discovered ID exactly matches an existing row’s ID, or the two IDs are spellings of the same [Fable](</docs/en/model-config#work-with-fable>) version.
+ * Same model as a built-in alias: when a discovered explicit ID names the model that a built-in alias currently resolves to, the picker shows only the alias row. For example, while `sonnet` resolves to `claude-sonnet-5`, a discovered `claude-sonnet-5` collapses into the `sonnet` row, and a discovered `claude-sonnet-4-6` still gets its own row. Before v2.1.197, Claude Code didn’t fold these IDs into built-in rows, so `claude-sonnet-5` also got its own “From gateway” row.
+
+Results are cached to `~/.claude/cache/gateway-models.json`, or `%USERPROFILE%\.claude\cache\gateway-models.json` on Windows, and refreshed on each startup. If you set [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>), the cache lives under that directory instead. If the request fails or the gateway doesn’t implement `/v1/models`, the picker falls back to the cached list from the previous startup or to the built-in model list. If your gateway serves Claude models under aliases that don’t match the discovery filter, developers can add those aliases manually with the [model configuration](</docs/en/model-config>) variables.
##
--- a/managed-mcp.md
+++ b/managed-mcp.md
@@ -168,7 +168,7 @@
How a server is evaluated
-Before loading a server, including one from `managed-mcp.json`, Claude Code runs the three checks below in order. In-process `type: "sdk"` servers, which the [app that started the session registers](</docs/en/mcp#how-connectors-reach-claude-code>), skip all three.
+Before loading a server, including one from `managed-mcp.json`, Claude Code runs the three checks below in order. It runs them again when a user reconnects a server or turns a disabled one back on in `/mcp`. In-process `type: "sdk"` servers, which the [app that started the session registers](</docs/en/mcp#how-connectors-reach-claude-code>), skip all three.
1. **Merge the lists.** Allowlist and denylist entries from every settings scope combine into one allowlist and one denylist, with the managed scope’s lists coming from the [managed source or sources Claude Code applies](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). When `allowManagedMcpServersOnly` is `true`, only the managed allowlist is kept; the denylist always merges from every scope.
2. **Check the denylist.** A server that matches any denylist entry, by URL, command, or name, is blocked. Nothing overrides a denylist match.
@@ -350,8 +350,9 @@
The server is on a denylist and the user runs `claude mcp add`| `Cannot add MCP server "<name>": server is explicitly blocked by enterprise policy`
The server isn’t on the allowlist and the user runs `claude mcp add`| `Cannot add MCP server "<name>": not allowed by enterprise policy`
A previously configured server is now blocked by policy| The server silently disappears from `/mcp` and `claude mcp list` with no warning
-
-In the last case, the user gets no signal that policy is the reason their server disappeared, so tell affected users which servers are blocked when you roll out a new restriction.
+A server becomes blocked while a session is running, and the user selects **Reconnect** or turns it back on in `/mcp`| [`MCP server <name> is blocked by enterprise managed policy`](</docs/en/errors#mcp-server-is-blocked-by-enterprise-managed-policy>)
+
+When a server silently disappears, the user gets no signal that policy is the reason, so tell affected users which servers are blocked when you roll out a new restriction.
##
--- a/managed-settings.md
+++ b/managed-settings.md
@@ -343,7 +343,7 @@
[`strictPluginOnlyCustomization`](</docs/en/settings-reference#strictpluginonlycustomization>)| Block skills, agents, hooks, and MCP servers from user and project sources; `true` locks all four, an array names which
[`wslInheritsWindowsSettings`](</docs/en/settings-reference#wslinheritswindowssettings>)| When set in the HKLM registry or a file under `C:\Program Files\ClaudeCode`, have WSL read the Windows policy chain, and read `/etc/claude-code` only when no managed settings file or drop-in under that directory delivers a policy key; the entry gives the order
-On Team and Enterprise plans, an Owner enables or disables [Remote Control](</docs/en/remote-control>) and [web sessions](</docs/en/claude-code-on-the-web>) organization-wide in [Claude Code admin settings](<https://claude.ai/admin-settings/claude-code>). Remote Control can additionally be disabled per device with the [`disableRemoteControl`](</docs/en/settings-reference#disableremotecontrol>) setting. Web sessions have no per-device managed settings key.
+On Team and Enterprise plans, an Owner enables or disables [Remote Control](</docs/en/remote-control>) and [web sessions](</docs/en/claude-code-on-the-web>) organization-wide in [Claude Code admin settings](<https://claude.ai/admin-settings/claude-code>). Remote Control can additionally be disabled per device with the [`disableRemoteControl`](</docs/en/settings-reference#disableremotecontrol>) setting. Web sessions have no per-device managed settings key.To check whether these organization settings reached a given machine, run `claude doctor` there and read the `Organization policy` line, which says where Claude Code loaded the policy from or why it didn’t load. Requires Claude Code v2.1.261 or later. In a running session, `/status` shows the same line when the policy didn’t load.
##
--- a/memory.md
+++ b/memory.md
@@ -364,7 +364,7 @@
├── feedback_testing.md # One memory
└── ... # Any other topic files Claude creates
-`MEMORY.md` acts as an index of the memory directory. Claude reads and writes files in this directory throughout your session, using `MEMORY.md` to keep track of what’s stored where. Auto memory is machine-local. All worktrees and subdirectories within the same git repository share one auto memory directory. Files are not shared across machines or cloud environments. Claude Code deletes old session transcripts after the [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) retention period, but excludes the files in the memory directory from that [retention sweep](</docs/en/claude-directory#cleaned-up-automatically>). `MEMORY.md` and topic files stay until you or Claude edits or deletes them.
+`MEMORY.md` acts as an index of the memory directory. Claude reads and writes files in this directory throughout your session, using `MEMORY.md` to keep track of what’s stored where. Auto memory is machine-local. All worktrees and subdirectories within the same git repository share one auto memory directory. Files are not shared across machines or cloud environments. Claude Code deletes old session transcripts after the [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) retention period, but excludes the memory files in the memory directory from that [retention sweep](</docs/en/claude-directory#cleaned-up-automatically>). `MEMORY.md` and topic files stay until you or Claude edits or deletes them.
###
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -4,7 +4,7 @@
Overview
-The Claude Code SDK has been renamed to the **Claude Agent SDK** and its documentation has been reorganized. This change reflects the SDK’s broader capabilities for building AI agents beyond just coding tasks.
+The Claude Code SDK has been renamed to the **Claude Agent SDK** and its documentation has been reorganized. This change reflects the SDK’s broader capabilities for building AI agents beyond just coding tasks. Migrating from the OpenAI Agents SDK instead? The [OpenAI Agents SDK migration recipe](<https://platform.claude.com/cookbook/claude-agent-sdk-04-migrating-from-openai-agents-sdk>) maps each primitive onto the Claude Agent SDK through a single worked example.
##
--- a/model-config.md
+++ b/model-config.md
@@ -70,7 +70,7 @@
Fable 5.1 requires Claude Code v2.1.255 or later. If a request for it from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Fable 5 requires v2.1.170 or later. Run `claude update` to upgrade. For availability under zero data retention, see [Model availability under ZDR](</docs/en/zero-data-retention#model-availability-under-zdr>).
-On the Anthropic API, the `/model` picker lists a Fable model only after the server reports it available for your organization. When you type `/model fable` or a Fable model ID, Claude Code checks availability with the server directly, so the selection can succeed before the picker lists the entry.
+On the Anthropic API, the `/model` picker lists a Fable model only after the server reports it available for your organization. When you type `/model fable` or a Fable model ID, Claude Code checks availability with the server directly, so a typed selection can succeed even when the picker doesn’t list the entry.
####
@@ -155,6 +155,19 @@
* The model isn’t available to your account
When a new session would start on the variable’s model, a session you resume with `claude --resume`, `--continue`, or the `/resume` picker starts on it too. Claude Code doesn’t restore the model saved in that session’s transcript. Otherwise Claude Code doesn’t use the variable when you resume a session.
+
+####
+
+
+
+A new session starts on a different model than you picked
+
+When you pick a model with `/model` and your next session starts on something else, these are the usual causes:
+
+ * **You chose it for one session.** Pressing `s` in the picker, launching with `--model`, and running `/model` in non-interactive mode all apply to the current session and leave your saved default alone.
+ * **Something with higher priority sets the model.** A `model` value in project or managed settings, `ANTHROPIC_MODEL` in your shell, or an organization default your admin set to override user choices applies again at every launch. Your `/model` choice is still saved; it’s outranked. When project or managed settings set the model, the startup header names the file.
+ * **Claude Code couldn’t save your choice.** `/model` writes `model` to `~/.claude/settings.json`. If you can’t write to that file, for example because another tool generates it or links it to a read-only copy, the model you chose lasts for the session and the next launch reads the old value. Set `model` in the tool that generates the file, or make the file writable. See [A change you made in Claude Code is lost in new sessions](</docs/en/settings#a-change-you-made-in-claude-code-is-lost-in-new-sessions>).
+ * **You resumed a session.** A session you resume with `claude --resume` or `--continue` usually keeps the model it was using rather than your current default.
##
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -1160,7 +1160,7 @@
* `used_default`: `"true"` when no readable settings source sets `cleanupPeriodDays`, `"false"` otherwise. On complete events, `"true"` means the 30-day default applied
* `skip_reason`: Why Claude Code paused the sweep. Present only when `result` is `"skipped"`:
* `"user_source_disabled"`: User settings are excluded, for example by the [`--setting-sources`](</docs/en/cli-reference#cli-flags>) flag or the SDK’s [`settingSources`](</docs/en/agent-sdk/typescript#options>) option, and no enabled source provides `cleanupPeriodDays`
- * `"settings_unknowable"`: A settings file couldn’t be read or parsed, so `cleanupPeriodDays` may be set to a value Claude Code can’t see
+ * `"settings_unknowable"`: A settings file couldn’t be read or parsed, so `cleanupPeriodDays` or `desktopSessionCleanupPeriodDays` may be set to a value Claude Code can’t see
* `"settings_invalid_key_set"`: Settings have validation errors and `cleanupPeriodDays` or `desktopSessionCleanupPeriodDays` is explicitly set, so falling back to the default could delete or keep files against that setting
* `transcripts_deleted`: Number of session transcripts, the top-level `~/.claude/projects/*/*.jsonl` files, that the sweep deleted
* `transcripts_exempted_desktop`: Number of transcripts past the retention period that the sweep kept under the [Claude Desktop and Cowork rule](</docs/en/claude-directory#cleaned-up-automatically>). These don’t count toward `files_past_cutoff`. Requires Claude Code v2.1.248 or later
--- a/network-config.md
+++ b/network-config.md
@@ -177,7 +177,7 @@
* `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 derives the deadline from the byte-level watchdog’s timeout or from an `API_TIMEOUT_MS` you set above that timeout, so `CLAUDE_STREAM_IDLE_TIMEOUT_MS` and `CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS` change the deadline too. For the clamps, the upload allowance, and the `API_TIMEOUT_MS` cap, see [No response from API](</docs/en/errors#no-response-from-api>).
+ * `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_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/overview.md
+++ b/overview.md
@@ -104,6 +104,7 @@
These resources cover deeper technical detail and example projects for building with the Agent SDK.
* [Quickstart](</docs/en/agent-sdk/quickstart>): build your first agent that finds and fixes bugs
+ * [Migration guide](</docs/en/agent-sdk/migration-guide>): migrate from the Claude Code SDK packages to the Agent SDK
* [Agent loop](</docs/en/agent-sdk/agent-loop>): how Claude plans, calls tools, and decides when a task is done
* [Example agents](<https://github.com/anthropics/claude-agent-sdk-demos>): demo apps for local development
* [TypeScript SDK](</docs/en/agent-sdk/typescript>): full TypeScript API reference and examples
--- a/permission-modes.md
+++ b/permission-modes.md
@@ -314,7 +314,14 @@
* Writing to Claude Code session transcripts, the `.jsonl` history files under `~/.claude/projects/` or your configured config directory, whether directly or through a shell command. The rule also covers the metadata lines Claude Code appends to each transcript entry for its own checks. Reading a transcript isn’t blocked
* A recursive forced delete such as `rm -rf "$VAR"` or `Remove-Item -Recurse -Force $dir` whose target is a shell variable, or a glob rooted at one, that isn’t assigned anywhere in the conversation the classifier sees. The value came only from earlier command output, which the classifier never receives, so the classifier can’t verify the deletion target against the other deletion rules. The block clears when you name the exact path being deleted, or when Claude re-runs the delete with the resolved literal path written into the command. Deletes whose target the classifier can resolve aren’t affected. `Remove-Item` targets that are a bare `*` or end in `/*` or `\*` never reach the classifier: Claude Code denies them outright
-**Allowed by default** :
+Claude Code v2.1.257 and later also block these by default:
+
+ * Requesting credentials from the cloud instance-metadata endpoint, such as `169.254.169.254`, or explicitly authenticating a cloud, cluster, or registry call with the machine’s own service-account or node identity
+ * Reaching a public host by a route other than a direct request, such as a tunnel, a reverse shell, or a resolver or proxy configuration rewritten to point outside
+ * Reading credentials that belong to the host rather than to your task, such as node certificates or the node’s container-registry auth
+ * Connecting to or scanning sibling containers, pods, or VMs that Claude didn’t start, or the node beneath the container
+
+If Claude Code runs somewhere that is meant to allow one of these, describe that setup in a [Host containment entry](</docs/en/auto-mode-config#define-trusted-infrastructure>) in `autoMode.environment`. **Allowed by default** :
* Local file operations in your working directory
* Installing dependencies declared in your lock files or manifests
--- a/permissions.md
+++ b/permissions.md
@@ -42,7 +42,7 @@
canUseTool callback
-If not resolved by any of the above, call your [`canUseTool` callback](</docs/en/agent-sdk/user-input>) for a decision. In `dontAsk` mode, this step is skipped and the tool is denied.
+If not resolved by any of the above, call your [`canUseTool` callback](</docs/en/agent-sdk/user-input>) for a decision. In `dontAsk` mode, this step is skipped and the tool is denied.In the TypeScript SDK, if you set [`permissionPrompts: 'none'`](</docs/en/agent-sdk/typescript#options>), your callback isn’t called at this step. A [`PermissionRequest` hook](</docs/en/hooks#permissionrequest>) still gets a chance to decide, and if it doesn’t, Claude Code denies the call. The option requires Claude Code v2.1.259 or later.
If you pass a `canUseTool` callback in a configuration where the TypeScript SDK expects the evaluation order to auto-approve calls before the callback is consulted, the SDK emits a Node.js process warning once when the query is constructed. The warning’s code is `CLAUDE_SDK_CAN_USE_TOOL_SHADOWED`. Two configurations trigger it:
--- a/plugins-reference.md
+++ b/plugins-reference.md
@@ -755,7 +755,7 @@
Path traversal limitations
-Claude Code doesn’t let a plugin reference files outside its own directory. It rejects a component path that resolves outside the plugin root, such as `../shared-utils`, whether the path is declared in `plugin.json` or in a [marketplace entry](</docs/en/plugin-marketplaces#plugin-entries>). Claude Code reports a [`path escapes plugin directory`](</docs/en/errors#path-escapes-plugin-directory>) error and loads the plugin without that component. Claude Code also doesn’t copy files outside the plugin directory into the cache when it installs the plugin, so when a script inside a copied plugin reads a path above the plugin root, it doesn’t find those files either.
+Claude Code doesn’t let a plugin reference files outside its own directory. It rejects a component path that resolves outside the plugin root, whether the path is declared in `plugin.json` or in a [marketplace entry](</docs/en/plugin-marketplaces#plugin-entries>). That covers a path that points outside the plugin as written, such as `../shared-utils`, and a symlink that leads outside the plugin, other than links within one marketplace. When Claude Code rejects a path, it reports a [`path escapes plugin directory`](</docs/en/errors#path-escapes-plugin-directory>) error and loads the plugin without that component. Claude Code also doesn’t copy files outside the plugin directory into the cache when it installs the plugin, so when a script inside a copied plugin reads a path above the plugin root, it doesn’t find those files either.
###
--- a/prompt-caching.md
+++ b/prompt-caching.md
@@ -334,7 +334,7 @@
`cache_creation_input_tokens`| Tokens written to the cache on this turn, billed at the cache write rate
`cache_read_input_tokens`| Tokens served from cache on this turn, billed at roughly 10% of the standard input rate
-A high read-to-creation ratio means caching is working well. If creation stays high turn after turn, something is changing in your prefix. The actions that invalidate the cache section lists the usual causes. For a per-session summary, run `/usage`. After the main conversation’s first response, Claude Code adds a [`Prompt cache (main)` line](</docs/en/costs#prompt-cache-statistics>) to the Session block, showing the session’s hit ratio, miss count, and whether the cache is warm right now. A status line script can read the same numbers from the [`prompt_cache` object](</docs/en/statusline#prompt-cache-fields>). Both require Claude Code v2.1.251 or later. For visibility across an organization, the OpenTelemetry exporter reports cache read and creation tokens per user and session. See [Monitor usage](</docs/en/monitoring-usage>) for the metric and event attribute reference.
+A high read-to-creation ratio means caching is working well. If creation stays high turn after turn, something is changing in your prefix. The actions that invalidate the cache section lists the usual causes. For a per-session summary, run `/usage`. After the main conversation’s first response, Claude Code adds a [`Prompt cache (main)` line](</docs/en/costs#prompt-cache-statistics>) to the Session block, showing the session’s hit ratio, miss count, and whether the cache is warm right now. A status line script can read the same numbers from the [`prompt_cache` object](</docs/en/statusline#prompt-cache-fields>). Both require Claude Code v2.1.251 or later. The `Prompt cache (main)` line also names the likely cause of the last miss when Claude Code can identify one, for example `likely cause: tool definitions changed`. The likely-cause text requires Claude Code v2.1.260 or later. For visibility across an organization, the OpenTelemetry exporter reports cache read and creation tokens per user and session. See [Monitor usage](</docs/en/monitoring-usage>) for the metric and event attribute reference.
##
--- a/remote-control.md
+++ b/remote-control.md
@@ -400,10 +400,12 @@
”Remote Control is disabled by your organization’s policy”
-A policy blocks Remote Control. The message’s own text tells you which:
+A policy blocks Remote Control, or Claude Code couldn’t load your organization’s policy on this machine and keeps Remote Control off in the meantime. Check these causes in order:
* **The error mentions`disableRemoteControl`**: your IT administrator has disabled Remote Control on this device through [managed settings](</docs/en/managed-settings>), independent of the organization-wide toggle and of how you’re signed in.
- * **Otherwise, an Owner hasn’t enabled it for your organization** : this form appears when you’re signed in with an eligible claude.ai account but Remote Control is off, the default on Team and Enterprise plans. An Owner can enable it at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>) by turning on the **Remote Control** toggle. This toggle is a server-side organization setting.
+ * **Your claude.ai plan is Pro or Max** : Claude Code is still signed in under a Team or Enterprise organization from an earlier login, so it checks that organization’s Remote Control policy. Run `/status` to see which plan and organization your sign-in uses. Run `claude auth logout` then `claude auth login` to sign in again under your current plan.
+ * **The organization policy didn’t load on this machine** : run `claude doctor` and read the `Organization policy` line. If the line shows the policy isn’t loaded, that is what’s keeping Remote Control off. Before v2.1.261, `claude doctor` didn’t print this line.
+ * **Otherwise, an Owner hasn’t enabled it for your organization** : Remote Control is off by default on Team and Enterprise plans. An Owner can enable it at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>) by turning on the **Remote Control** toggle. This toggle is a server-side organization setting.
###
--- a/sandboxing.md
+++ b/sandboxing.md
@@ -124,7 +124,12 @@
The unsandboxed retry escape hatch
-Some commands can’t run inside the sandbox at all, such as tools that are incompatible with it or that need a host you haven’t allowed. Claude Code reports sandbox violations in the blocked command’s result, naming the path or host the sandbox denied, so Claude sees what the sandbox blocked. Rather than failing the task or requiring you to turn sandboxing off, Claude Code includes an escape hatch: Claude analyzes the violation and may retry the command with the `dangerouslyDisableSandbox` parameter. The retried command runs outside the sandbox, so it goes through the regular permission flow. In Manual mode you get a confirmation prompt. In [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), the classifier evaluates the underlying command. While [`permissions.blockReadsOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockreadsoutsideworkingdirectories>) is on, a retry that needs approval to run outside the sandbox prompts you instead. To be prompted on every unsandboxed retry even in auto mode, add an [ask rule](</docs/en/permissions#match-by-input-parameter>) for `Bash(dangerouslyDisableSandbox:true)`. You can disable this escape hatch by setting `"allowUnsandboxedCommands": false` in your [sandbox settings](</docs/en/settings-reference#sandbox-settings>). When disabled, which the `/sandbox` Overrides tab shows as **Strict sandbox mode** , the `dangerouslyDisableSandbox` parameter is completely ignored and all commands must run sandboxed or be explicitly listed in `excludedCommands`.
+Some commands can’t run inside the sandbox at all, such as tools that are incompatible with it or that need a host you haven’t allowed. Claude Code reports sandbox violations in the blocked command’s result, naming the path or host the sandbox denied, so Claude sees what the sandbox blocked. Rather than failing the task or requiring you to turn sandboxing off, Claude Code includes an escape hatch: Claude analyzes the violation and may retry the command with the `dangerouslyDisableSandbox` parameter. The retried command runs outside the sandbox, so it goes through the regular permission flow. In Manual mode you get a confirmation prompt. In [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), the classifier evaluates the underlying command. While [`permissions.blockReadsOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockreadsoutsideworkingdirectories>) is on, a retry that needs approval to run outside the sandbox prompts you instead. To be prompted on every unsandboxed retry even in auto mode, add an [ask rule](</docs/en/permissions#match-by-input-parameter>) for `Bash(dangerouslyDisableSandbox:true)`. You can disable this escape hatch by setting `"allowUnsandboxedCommands": false` in your [sandbox settings](</docs/en/settings-reference#sandbox-settings>). With the escape hatch disabled, Claude Code ignores the `dangerouslyDisableSandbox` parameter, and every command Claude runs must run sandboxed unless you’ve listed it in `excludedCommands`. The `/sandbox` **Overrides** tab shows this setting as **Strict sandbox mode**. Strict sandbox mode applies to the commands Claude runs. Commands you type yourself at the [`!` shell-mode prompt](</docs/en/interactive-mode#shell-mode-with-prefix>) run outside the sandbox unless the session is one of these:
+
+ * **A[background session](</docs/en/agent-view>)**: strict sandbox mode covers shell-mode commands too
+ * **A Linux session with[`CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`](</docs/en/env-vars#variables>) set**: every command runs sandboxed, shell-mode commands included
+
+Before v2.1.260, strict sandbox mode sandboxed shell-mode commands in every session.
####
@@ -568,9 +573,9 @@
The two keys beyond `enabled` control what happens when the sandbox cannot run a command:
* **`failIfUnavailable`** : a missing dependency such as bubblewrap on Linux blocks Claude Code from starting rather than showing a warning and falling back to unsandboxed execution
- * **`allowUnsandboxedCommands: false`** : the `dangerouslyDisableSandbox` escape hatch is ignored, so commands that fail under the sandbox cannot be retried outside it
-
-Two additions are worth considering alongside them. Add `excludedCommands` for any organization-approved tools that must run without isolation. Add `sandbox.credentials` entries for credential directories such as `~/.aws` and `~/.ssh` and for secret environment variables, since the default read policy still allows them. The sandbox does not run on native Windows, so if your fleet includes Windows hosts, scope this configuration to macOS and Linux or have those users run Claude Code inside WSL2 or a container.
+ * **`allowUnsandboxedCommands: false`** : Claude Code ignores the `dangerouslyDisableSandbox` escape hatch, so when a command fails under the sandbox, Claude can’t retry it unsandboxed
+
+Two additions are worth considering alongside them. Add `excludedCommands` for any organization-approved tools that must run without isolation. Add `sandbox.credentials` entries for credential directories such as `~/.aws` and `~/.ssh` and for secret environment variables, since the default read policy still allows them. This configuration sandboxes the commands Claude runs. A developer can still type a command at the [`!` shell-mode prompt](</docs/en/interactive-mode#shell-mode-with-prefix>) and run it outside the sandbox, with the same access they already have in any terminal outside Claude Code. See The unsandboxed retry escape hatch for the sessions where typed commands run sandboxed. The sandbox does not run on native Windows, so if your fleet includes Windows hosts, scope this configuration to macOS and Linux or have those users run Claude Code inside WSL2 or a container.
###
@@ -617,7 +622,8 @@
* **Go-based CLIs fail TLS verification on macOS** : tools such as `gh`, `gcloud`, and `terraform` may fail TLS verification under Seatbelt. List these tools in `excludedCommands` to run them outside the sandbox. If you are using `httpProxyPort` with a MITM proxy and custom CA, set [`enableWeakerNetworkIsolation`](</docs/en/settings-reference#sandbox-enableweakernetworkisolation>) to `true` instead.
* **`open`, `osascript`, or browser-based auth flows fail with error `-600` on macOS**: the sandbox blocks Apple Events by default. Set [`allowAppleEvents`](</docs/en/settings-reference#sandbox-allowappleevents>) to `true` in your user, managed, or CLI settings to allow them. Project settings are ignored for this key. Enabling it removes code-execution isolation, since sandboxed commands can then launch other applications unsandboxed with no user prompt and send AppleScript commands to running applications, subject to the macOS automation-consent prompt (TCC). Alternatively, add the command to `excludedCommands` to run it outside the sandbox.
* **`docker` commands fail**: `docker` is incompatible with the sandbox. Add `docker *` to `excludedCommands` to run it outside the sandbox.
- * **A git command fails with`unable to unlink old`**: `git merge`, `git checkout`, and similar commands fail this way when they need to replace a file the sandbox denies writes to, whether that file is under a protected path such as `.claude/skills`, under one of your `denyWrite` entries, or outside the directories the sandbox lets commands write to at all. On Linux and WSL2 the error ends with `Read-only file system`. After the failure, Claude may offer to rerun the command outside the sandbox; approve that retry, or run the git command yourself in another terminal. If you’ve set `allowUnsandboxedCommands` to `false`, Claude can’t offer the retry, so run the command yourself or, if the same git command fails often, add that command to [`excludedCommands`](</docs/en/settings-reference#sandbox-excludedcommands>).
+ * **`pbcopy`, `xclip`, or `wl-copy` doesn’t update the clipboard**: these clipboard utilities can fail to reach the system clipboard from inside the sandbox, in which case the text piped to them doesn’t arrive. To put Claude’s output on your clipboard, ask Claude to print it in its response, then run [`/copy`](</docs/en/commands>), which writes to the clipboard from the Claude Code process rather than from a sandboxed command. Alternatively, add `pbcopy *`, `wl-copy *`, or `xclip *` to `excludedCommands` to run the command outside the sandbox.
+ * **A git command fails with`unable to unlink old`**: `git merge`, `git checkout`, and similar commands fail this way when they need to replace a file the sandbox denies writes to, whether that file is under a protected path such as `.claude/skills`, under one of your `denyWrite` entries, or outside the directories the sandbox lets commands write to at all. On Linux and WSL2 the error ends with `Read-only file system`. After the failure, Claude may offer to rerun the command outside the sandbox; approve that retry, or run the git command yourself in another terminal. If you’ve set `allowUnsandboxedCommands` to `false`, Claude can’t offer the retry, so run the command yourself. If the same git command fails often, add it to [`excludedCommands`](</docs/en/settings-reference#sandbox-excludedcommands>).
* **Bubblewrap fails to start inside a container** : in an unprivileged container, bubblewrap can’t mount a fresh `/proc` filesystem, so sandboxed commands fail with a `bwrap` error such as `Can't mount proc on /newroot/proc: Operation not permitted`. Set [`enableWeakerNestedSandbox`](</docs/en/settings-reference#sandbox-enableweakernestedsandbox>) to `true` so the inner sandbox bind-mounts the container’s existing `/proc` instead. Only use this setting when the outer container already provides the isolation boundary you need, since it exposes process information to sandboxed commands that a fresh `/proc` mount would hide.
* **`--dangerously-skip-permissions` fails as root**: this flag is blocked when running as root or via sudo on Linux and macOS, because root access combined with no permission prompts can modify any file or service on the system. The check is skipped automatically inside a recognized sandbox. To run autonomously in a container, use the [dev container](</docs/en/devcontainer>) configuration, which runs Claude Code as a non-root user.
--- a/settings.md
+++ b/settings.md
@@ -290,6 +290,14 @@
+A change you made in Claude Code is lost in new sessions
+
+When you save a choice for new sessions from inside Claude Code, such as a default model with `/model`, Claude Code writes it to your user settings file, `~/.claude/settings.json`. If you can’t write to that file, for example because another tool generates it or links it to a read-only copy, the change applies to the current session and is gone in the next one. Set the key in the tool that generates the file, or replace the file with one you can write to. If you can write to the file and the change still doesn’t last, check whether the change was for one session only or a higher level sets the same key. For the `model` key, [A new session starts on a different model than you picked](</docs/en/model-config#a-new-session-starts-on-a-different-model-than-you-picked>) lists more causes.
+
+####
+
+
+
A managed change hasn’t reached you
Managed sources reach a running session on the schedule in the [delivery table](</docs/en/managed-settings#choose-a-delivery-mechanism>), so restart the session first. If `/status` then names a different source than the one your administrator changed, a higher-priority source applies; [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) gives the order.
--- a/settings-example.md
+++ b/settings-example.md
@@ -359,9 +359,9 @@
"repo": "acme-corp/approved-plugins"
}
],
- // Sandbox every command, refuse to start if the sandbox can't be set up, and
- // never let a blocked command retry outside the sandbox; network limited to
- // npm and GitHub, and users can't add domains
+ // Sandbox every command Claude runs, refuse to start if the sandbox can't be
+ // set up, and never let a blocked command retry outside the sandbox; network
+ // limited to npm and GitHub, and users can't add domains
"sandbox": {
"enabled": true,
"failIfUnavailable": true,
Show diff (152 lines)
--- a/settings-reference.md
+++ b/settings-reference.md
@@ -43,6 +43,7 @@
`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
+`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/plugin-marketplaces>) sources for your organization| Plugins and skills| Managed
`browserExternalPageTools`| Keep Claude’s tools off external pages in the [desktop](</docs/en/desktop>) Browser pane| Tools| Managed
`channelsEnabled`| Allow [channels](</docs/en/channels#enable-channels-for-your-organization>) for your organization| Plugins and skills| Managed
@@ -103,7 +104,7 @@
`includeGitInstructions`| Remove the built-in commit and PR instructions from the [system prompt](</docs/en/sub-agents#what-loads-at-startup>)| Git and attribution| Any file
`inputNeededNotifEnabled`| Get a [push notification](</docs/en/remote-control#mobile-push-notifications>) when Claude is waiting on you| Remote, desktop, and notifications| Any file
`isolatePeerMachines`| Ask you before Claude [messages one of your sessions on another machine](</docs/en/cross-session-messaging#require-approval-for-cross-machine-messages>)| Agents, sessions, and worktrees| Any file
-`keybindingFlavor`| Make `Ctrl+W` [delete back to the previous whitespace](</docs/en/interactive-mode#make-ctrl-w-delete-back-to-whitespace>), as Bash does| Interface and terminal| Any file
+`keybindingFlavor`| Deprecated and has no effect; the word-editing shortcuts always [follow readline conventions](</docs/en/interactive-mode#make-ctrl-w-delete-back-to-whitespace>)| Interface and terminal| Any file
`language`| Have Claude respond in a language other than English| Model and responses| Any file
`managedSourcesBehavior`| Compose every [managed source](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) you deploy instead of using the highest-priority one alone| Enterprise and managed settings| Managed
`minimumVersion`| Keep [auto-updates](</docs/en/setup#pin-a-minimum-version>) from installing anything below a version| Updates and versioning| Any file
@@ -209,6 +210,7 @@
`switchModelsOnFlag`| Switch models automatically or pause when a [safety classifier](</docs/en/model-config#ask-before-switching>) flags a request| Model and responses| Any file
`syncClaudeAiSkills`| Stop downloading the [skills enabled on your claude.ai account](</docs/en/skills#how-synced-skills-behave>) and hide the ones already synced| Plugins and skills| User, local, or managed
`syntaxHighlightingDisabled`| Turn off syntax highlighting in diffs and code blocks| Interface and terminal| Any file
+`taskOutputMaxChars`| Set how much of a [background task’s](</docs/en/tools-reference#background-commands>) output Claude receives inline| Memory and context| Any file
`teammateDefaultModel`| Removed in v2.1.234; see [Specify teammates and models](</docs/en/agent-teams#specify-teammates-and-models>) for how Claude Code picks a teammate’s model| Global config settings| Global config
`teammateMode`| Choose how [agent team teammates display](</docs/en/agent-teams#choose-a-display-mode>)| Agents, sessions, and worktrees| Any file
`terminalProgressBarEnabled`| Hide the terminal progress bar in terminals that support it| Interface and terminal| Any file
@@ -967,7 +969,7 @@
`permissions.deny`
-List the tool uses Claude Code blocks. Use it for files that hold API keys, secrets, or environment values: Claude Code excludes matching files from file discovery and search results, denies reads of them, and blocks the [Edit and Write tools](</docs/en/permissions#read-and-edit>) on the matching paths. Read and Edit deny rules apply to Claude’s built-in file tools and to file commands Claude Code recognizes in Bash, such as `cat`, `head`, `tail`, and `sed`; they don’t apply to arbitrary subprocesses, so for OS-level enforcement [enable the sandbox](</docs/en/sandboxing>).
+List the tool uses Claude Code blocks. Use it for files that hold API keys, secrets, or environment values: Claude Code excludes matching files from file discovery and search results, denies reads of them, and blocks the [Edit and Write tools](</docs/en/permissions#read-and-edit>) on the matching paths. Read and Edit deny rules apply to Claude’s built-in file tools, to file commands Claude Code recognizes in Bash, such as `cat`, `head`, `tail`, and `sed`, and to the targets of Bash [redirections](</docs/en/permissions#redirections>) such as `> file` and `< file`; they don’t apply to arbitrary subprocesses, so for OS-level enforcement [enable the sandbox](</docs/en/sandboxing>).
* **Scope** : `Any file`
* **Type** : array of permission rule strings
@@ -1261,7 +1263,7 @@
* **Scope** : `Any file`
* **Type** : array of command patterns
- * **Default** : unset, so every command Claude Code can sandbox runs sandboxed
+ * **Default** : unset, so no command is excluded
settings.json
@@ -1279,12 +1281,12 @@
`sandbox.allowUnsandboxedCommands`
-Let Claude retry a command outside the sandbox with the `dangerouslyDisableSandbox` parameter after the sandbox blocks it. Set it to `false` so Claude Code ignores that parameter completely and every command must run sandboxed or appear in `excludedCommands`, which the `/sandbox` **Overrides** tab shows as **Strict sandbox mode**. Use `false` in managed settings for policies that require strict sandboxing.
+Let Claude retry a command outside the sandbox with the `dangerouslyDisableSandbox` parameter after the sandbox blocks it. Set it to `false` so Claude Code ignores that parameter completely and every command Claude runs must be sandboxed or appear in `excludedCommands`. The `/sandbox` **Overrides** tab shows that state as **Strict sandbox mode**. Use `false` in managed settings for policies that require strict sandboxing.
* **Scope** : `Any file`
* **Type** : Boolean
* `true`: Claude can retry a command outside the sandbox with the `dangerouslyDisableSandbox` parameter after the sandbox blocks it
- * `false`: Claude Code ignores that parameter, so every command runs sandboxed or appears in `excludedCommands`
+ * `false`: Claude Code ignores that parameter, so every command Claude runs is sandboxed or appears in `excludedCommands`
* **Default** : `true`
This enforces strict sandbox mode for everyone the managed settings cover:
@@ -1298,7 +1300,7 @@
}
}
-An unsandboxed retry goes through the regular permission flow, with a prompt in Manual mode. See [The unsandboxed retry escape hatch](</docs/en/sandboxing#the-unsandboxed-retry-escape-hatch>).
+An unsandboxed retry goes through the regular permission flow, with a prompt in Manual mode. See [The unsandboxed retry escape hatch](</docs/en/sandboxing#the-unsandboxed-retry-escape-hatch>). To see when commands you type yourself at the [`!` shell-mode prompt](</docs/en/interactive-mode#shell-mode-with-prefix>) run sandboxed, see [strict sandbox mode](</docs/en/sandboxing#the-unsandboxed-retry-escape-hatch>).
###
@@ -2342,6 +2344,26 @@
+`bashOutputMaxChars`
+
+Set how many characters of a successful Bash or PowerShell command’s [output Claude receives inline](</docs/en/tools-reference#output-limits>). When output passes the limit, Claude Code saves it to a file and Claude receives a short preview plus the file’s path. Raise the limit when command output, such as a verbose build or a full test-suite log, routinely overflows the default and you want Claude to read it without opening the file. Requires Claude Code v2.1.261 or later.
+
+ * **Scope** : `Any file`
+ * **Type** : number of characters, a positive integer. Claude Code clamps the value into the range `4000` to `128000`
+ * **Default** : unset, so Claude receives up to 30,000 characters inline
+
+settings.json
+
+ {
+ "bashOutputMaxChars": 100000
+ }
+
+When you set this key, Claude Code ignores the [`BASH_MAX_OUTPUT_LENGTH`](</docs/en/env-vars>) environment variable.
+
+###
+
+
+
`claudeMd`
Inject CLAUDE.md-style instructions as organization-managed memory without deploying a separate file. Claude Code loads the text as a managed memory entry ahead of user and project CLAUDE.md files.
@@ -2522,6 +2544,26 @@
Raise it to keep long descriptions intact at the cost of more context per turn; lower it to fit more skills under `skillListingBudgetFraction`.
+###
+
+
+
+`taskOutputMaxChars`
+
+Set how many characters of a [background task’s](</docs/en/tools-reference#background-commands>) output Claude receives inline when Claude reads the task with the `TaskOutput` tool. When a finished task’s output is longer, Claude receives the most recent characters. Raise the limit when your background tasks routinely produce more output than the default. Requires Claude Code v2.1.261 or later.
+
+ * **Scope** : `Any file`
+ * **Type** : number of characters, a positive integer. Claude Code clamps the value into the range `4000` to `128000`
+ * **Default** : unset, so Claude receives up to 32,000 characters inline
+
+settings.json
+
+ {
+ "taskOutputMaxChars": 100000
+ }
+
+When you set this key, Claude Code ignores the [`TASK_MAX_OUTPUT_LENGTH`](</docs/en/env-vars>) environment variable.
+
##
@@ -2824,21 +2866,13 @@
`keybindingFlavor`
-Choose which convention `Ctrl+W` follows in the prompt input. Set it to `"readline"` to make `Ctrl+W` delete back to the previous whitespace, as Bash does, so a path or a `--flag=value` goes in one press. Requires Claude Code v2.1.238 or later.
-
- * **Scope** : `Any file`
- * **Type** : string, one of:
- * `"classic"`: `Ctrl+W` deletes the previous word
- * `"readline"`: `Ctrl+W` deletes back to the previous whitespace
- * **Default** : `"classic"`
-
-settings.json
-
- {
- "keybindingFlavor": "readline"
- }
-
-See [Make editing keys follow readline conventions](</docs/en/interactive-mode#make-ctrl-w-delete-back-to-whitespace>) for the per-key behavior.
+Deprecated since v2.1.261 and has no effect. The prompt’s word-editing keys always [follow readline conventions](</docs/en/interactive-mode#make-ctrl-w-delete-back-to-whitespace>), as in Bash. Claude Code still accepts `keybindingFlavor`, so a settings file that sets it stays valid.
+
+In v2.1.238 through v2.1.260, setting it to `"readline"` made `Ctrl+W` delete back to the previous whitespace instead of only the previous word.
+
+ * **Scope** : `Any file`
+ * **Type** : string, `"classic"` or `"readline"`
+ * **Default** : unset
###
--- a/statusline.md
+++ b/statusline.md
@@ -257,6 +257,14 @@
"cache_write_tokens": 352000,
"miss_recache_tokens": 310200,
"last_miss_at": 1738425230,
+ "last_miss_cause": {
+ "causes": ["tools_changed"],
+ "tools_added": 2,
+ "tools_removed": 0
+ },
+ "miss_causes": {
+ "tools_changed": 2
+ },
"recache_tokens_if_cold": 45000
},
"fast_mode": false,
@@ -362,9 +370,22 @@
`cache_write_tokens`| All tokens written to the cache this session, the first request’s initial write included
`miss_recache_tokens`| Tokens written to the cache by the requests counted as misses
`last_miss_at`| When the last miss happened, in epoch seconds. `null` while the session has no misses
+`last_miss_cause`| What Claude Code identified as the likely cause of the last miss, described under Last miss cause. Requires Claude Code v2.1.260 or later
+`miss_causes`| How many of this session’s diagnosed misses had each cause, keyed by the same cause names as `last_miss_cause`. Requires Claude Code v2.1.260 or later
`recache_tokens_if_cold`| Tokens the next request re-caches if the cache has gone cold by then. `null` right after a compaction or a clearing of old tool results, until the next request records the rewritten conversation’s size
Claude Code shows the same statistics in the terminal, on the [`/usage` command’s `Prompt cache (main)` line](</docs/en/costs#prompt-cache-statistics>).
+
+####
+
+
+
+Last miss cause
+
+The `last_miss_cause` object reports what Claude Code identified as the likely cause of the most recent miss. Its `causes` array holds one or more cause names, such as `tools_changed`, `system_prompt_changed`, `ttl_expired_5m`, or `likely_server_side`. The object is `null` until the session’s first miss, and again whenever Claude Code couldn’t identify a cause for the most recent miss. Requires Claude Code v2.1.260 or later. Two causes add counts to the object:
+
+ * `tools_added` and `tools_removed`: with `tools_changed`, how many tools were added to or removed from the request
+ * `system_char_delta`: with `system_prompt_changed`, the change in the system prompt’s length, in characters
##
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -215,7 +215,7 @@
The frontmatter defines the subagent’s metadata and configuration. The body becomes the system prompt that guides the subagent’s behavior. Subagents receive only this system prompt plus basic environment details like the working directory, not the Claude Code system prompt. In [non-interactive mode](</docs/en/headless>), pass [`--append-subagent-system-prompt`](</docs/en/cli-reference#cli-flags>) to append your text to the end of every subagent’s system prompt, nested subagents included, apart from a forked subagent, which reuses the conversation’s own prompt. Requires Claude Code v2.1.205 or later. A subagent starts in the main conversation’s current working directory. Within a subagent, `cd` commands don’t persist between Bash or PowerShell tool calls and don’t affect the main conversation’s working directory. To give the subagent an isolated copy of the repository instead, set `isolation: worktree`. A subagent with `isolation: worktree` runs its Bash and PowerShell commands inside its worktree. A command whose working directory resolves to your main checkout instead, for example because the worktree directory was removed while the subagent was running, fails with an error. Before v2.1.203, such a command could run in the main checkout. This working-directory check covers the whole repository containing the directory you launched Claude Code from. When your session runs in a linked [worktree](</docs/en/worktrees>) of its own, the check also covers the main checkout that worktree is linked from. Before v2.1.210, the check covered only the launch directory itself. A command whose working directory resolved elsewhere in the same repository, such as the repository root when you launched Claude Code from a monorepo subdirectory, ran there instead of failing. For Bash commands, Claude Code also checks the command itself in two ways:
* It blocks a command that redirects git into the main checkout.
- * It refuses a command whose shape it can’t verify stays inside the worktree. This refusal applies even to a command that runs no git.
+ * It refuses a command when it can’t verify from the command text that any git the command runs stays inside the worktree, for example when the command name is computed at runtime.
The redirect vectors and the shape rules are listed under [How Claude Code enforces isolation](</docs/en/worktrees#how-claude-code-enforces-isolation>). PowerShell commands get only the working-directory check. [Monitor](</docs/en/tools-reference#monitor-tool>) commands go through the same working-directory and command-content checks as Bash commands. When the main conversation itself runs isolated in a worktree, Claude Code applies the same checks to the session and to every subagent it spawns, including subagents without `isolation: worktree`; see [How Claude Code enforces isolation](</docs/en/worktrees#how-claude-code-enforces-isolation>).
--- a/terminal-config.md
+++ b/terminal-config.md
@@ -330,7 +330,7 @@
Paste large content
-When you paste more than 800 characters or more than three lines into the prompt, Claude Code collapses the input to a placeholder such as `[Pasted text #1 +120 lines]` so the input box stays usable. In a terminal window shorter than 12 rows the line limit drops, so Claude Code collapses a three-line paste at 11 rows and any multi-line paste at 10 rows or fewer. Claude Code still sends the full content when you submit. When you delete with a word or line shortcut such as `Ctrl+W` or `Ctrl+K`, or with a vim delete through an `f`/`t` motion such as `df]`, and the deleted range reaches inside a placeholder, Claude Code removes the placeholder whole. You can paste the deletion back to restore it, with [`Ctrl+Y`](</docs/en/interactive-mode#text-editing>) after `Ctrl+W`, `Ctrl+U`, or `Ctrl+K`, or with [`p` in NORMAL mode](</docs/en/interactive-mode#editing-normal-mode>) after a vim delete. Claude Code keeps the collapsed content under `~/.claude/paste-cache/`, so when you recall a prompt from [command history](</docs/en/interactive-mode#command-history>) and resubmit it, Claude Code sends the full pasted content again, including in a later session, until the retention sweep removes the cache file. Claude Code deletes cache files older than [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>), following the [retention sweep rules](</docs/en/claude-directory#cleaned-up-automatically>), so a recalled prompt can reference pasted text that no longer exists. When you submit such a prompt, Claude Code never sends the literal `[Pasted text #N]` string, and shows a notification naming the missing paste:
+When you paste more than 800 characters or more than three lines into the prompt, Claude Code collapses the input to a placeholder such as `[Pasted text #1 +120 lines]` so the input box stays usable. In a terminal window shorter than 12 rows the line limit drops, so Claude Code collapses a three-line paste at 11 rows and any multi-line paste at 10 rows or fewer. Claude Code still sends the full content when you submit. When you delete with a word or line shortcut such as `Ctrl+W` or `Ctrl+K`, or with a vim delete through an `f`/`t` motion such as `df]`, and the deleted range reaches inside a placeholder, Claude Code removes the placeholder whole. You can paste the deletion back to restore it, with [`Ctrl+Y`](</docs/en/interactive-mode#text-editing>) after a word or line shortcut, or with [`p` in NORMAL mode](</docs/en/interactive-mode#editing-normal-mode>) after a vim delete. Claude Code keeps the collapsed content under `~/.claude/paste-cache/`, so when you recall a prompt from [command history](</docs/en/interactive-mode#command-history>) and resubmit it, Claude Code sends the full pasted content again, including in a later session, until the retention sweep removes the cache file. Claude Code deletes cache files older than [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>), following the [retention sweep rules](</docs/en/claude-directory#cleaned-up-automatically>), so a recalled prompt can reference pasted text that no longer exists. When you submit such a prompt, Claude Code never sends the literal `[Pasted text #N]` string, and shows a notification naming the missing paste:
* In a plain prompt with text remaining, Claude Code removes the placeholder and sends the remaining text.
* In a [shell mode](</docs/en/interactive-mode#shell-mode-with-prefix>) command or a `/` command, where the removal would change what runs, and in any prompt the removal leaves empty, Claude Code cancels the submission and keeps the original text in the input, with the placeholder still in it. Delete the placeholder or edit the command, then resubmit.
--- a/todo-tracking.md
+++ b/todo-tracking.md
@@ -6,7 +6,7 @@
Model availability
-On TypeScript Agent SDK 0.3.233 and later, or Python Agent SDK 0.2.139 and later, the following tools aren’t available on Opus 4.8, Sonnet 5, Fable 5, Mythos 5, or later versions of those families unless you opt in:
+On TypeScript Agent SDK 0.3.233 and later, or Python Agent SDK 0.2.139 and later, the following restriction applies.The following tools aren’t available on Opus 4.8, Sonnet 5, Fable 5, Mythos 5, or later versions of those families unless you opt in:
* `TodoWrite`
* `TaskCreate`
--- a/tools-reference.md
+++ b/tools-reference.md
@@ -159,10 +159,10 @@
Result| What Claude gets
---|---
-Valid| Inline up to roughly 30,000 characters; past that, the path of a file saved to the session directory, truncated past 64 MiB, plus a short preview from the start, and Claude reads or searches the file when it needs the rest
+Valid| Inline up to roughly 30,000 characters by default; past that, the path of a file saved to the session directory and truncated past 64 MiB, plus a short preview from the start, and Claude reads or searches the file when it needs the rest
Failure| Inline up to roughly 10,000 characters; past that, a head-and-tail excerpt of that size cut from the read-back window, with no file path
-A command that exits 1 counts as a valid result for the Bash tool only when Claude Code recognizes exit code 1 as a benign outcome for that command: `grep`, `rg`, `egrep`, `fgrep`, `find`, `diff`, `test`, and `[`, plus `git diff` and `git grep`. Every other command that exits 1 counts as a failure, even when exit 1 is a benign informational outcome: no matches for `pgrep` and `jq -e`, files that differ for `cmp`. [`BASH_MAX_OUTPUT_LENGTH`](</docs/en/env-vars>) sets how many characters of output Claude Code reads back from the working file into a command’s result: 30,000 by default, up to a hard ceiling of 150,000. Raise it when your commands routinely overflow that window, such as a verbose build or a full test-suite log. Raising it enlarges the read-back window, and the window a failing command’s excerpt is cut from. It does not raise the inline ceilings above: a valid result over roughly 30,000 characters arrives as a file path plus preview regardless of this variable.
+A command that exits 1 counts as a valid result for the Bash tool only when Claude Code recognizes exit code 1 as a benign outcome for that command: `grep`, `rg`, `egrep`, `fgrep`, `find`, `diff`, `test`, and `[`, plus `git diff` and `git grep`. Every other command that exits 1 counts as a failure, even when exit 1 is a benign informational outcome: no matches for `pgrep` and `jq -e`, files that differ for `cmp`. [`BASH_MAX_OUTPUT_LENGTH`](</docs/en/env-vars>) sets how many characters of output Claude Code reads back from the working file into a command’s result: 30,000 by default, up to a hard ceiling of 150,000. Raise it when your commands routinely overflow that window, such as a verbose build or a full test-suite log. Raising it enlarges the read-back window, which is also the window a failing command’s excerpt is cut from. It doesn’t raise the inline ceilings: a valid result over the inline ceiling arrives as a file path plus preview regardless of this variable. To change how much of a valid result Claude receives inline, set the [`bashOutputMaxChars`](</docs/en/settings-reference#bashoutputmaxchars>) setting instead, up to 128,000 characters. It sizes the inline ceiling and the read-back window together, and Claude Code then ignores `BASH_MAX_OUTPUT_LENGTH`. Requires Claude Code v2.1.261 or later.
###
@@ -170,7 +170,7 @@
Background commands
-For long-running processes such as dev servers or watch builds, Claude can set `run_in_background: true` to start the command as a background task and continue working while it runs. List and stop background tasks with `/tasks`. When a [subagent running in the foreground](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) started the command, Claude Code ends it when that subagent gives its final response. Commands started by the main conversation or by a background subagent keep running. In non-interactive mode with the `-p` flag, [background tasks end shortly after the run’s final result](</docs/en/headless#background-tasks-at-exit>). When a command reaches its timeout without finishing, Claude Code moves it to the background instead of stopping it. Claude keeps working while the command continues. Claude Code applies the same lifetime rules to a moved command as to any other background command, so it still ends a foreground subagent’s command at that subagent’s final response. Setting [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1`](</docs/en/env-vars#variables>) disables auto-backgrounding along with the rest of the background task functionality. Claude Code never auto-backgrounds three kinds of command. It stops them at the timeout instead:
+For long-running processes such as dev servers or watch builds, Claude can set `run_in_background: true` to start the command as a background task and continue working while it runs. List and stop background tasks with `/tasks`. After you stop one there, or from a connected client such as the desktop app, Claude moves on instead of waiting for it. If a subagent started the command, it’s that subagent that moves on. A command that a [foreground subagent](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) started stops when that subagent gives its final response. A command that the main conversation or a background subagent started keeps running after a final response. In non-interactive mode with the `-p` flag, [background commands end shortly after the run’s final result](</docs/en/headless#background-tasks-at-exit>). When a command reaches its timeout without finishing, Claude Code moves it to the background instead of stopping it. Claude keeps working while the command continues. Claude Code applies the same lifetime rules to a moved command as to any other background command, so it still ends a foreground subagent’s command at that subagent’s final response. Setting [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1`](</docs/en/env-vars#variables>) disables auto-backgrounding along with the rest of the background task functionality. Claude Code never auto-backgrounds three kinds of command. It stops them at the timeout instead:
* A command that starts with `sleep`.
* A command that runs `git` anywhere in it.
@@ -223,7 +223,7 @@
* **Match** : `old_string` must appear in the file exactly as written. A single character of whitespace or indentation difference is enough to miss.
* **Uniqueness** : `old_string` must appear exactly once. When it appears more than once, Claude either supplies a longer string with enough surrounding context to pin down one occurrence, or sets `replace_all: true` to replace them all.
-A file that changed on disk after Claude last read it can still be edited when `old_string` matches the current content exactly and unambiguously and Claude Code can read the file without prompting. Matching against the file’s current content keeps this safe, and the result notes that the file carries other changes so Claude re-reads it before edits that depend on surrounding content. In any other case, such as a stale `old_string` or one that matches more than once without `replace_all`, Claude reads the file again before editing. The relaxed handling of unread and changed files requires Claude Code v2.1.208 or later; before that, Claude Code refused any edit to a file it hadn’t read in the conversation or that changed on disk after the read. Viewing a file with Bash also satisfies the read-before-edit requirement when the command is `cat`, `nl`, `bat`, `batcat`, `head`, `tail`, `sed -n 'X,Yp'`, `grep`, `egrep`, `fgrep`, or `rg` on a single file with no pipes or redirects. Piped output and other Bash commands don’t count toward the read-before-edit check. This affects edit eligibility only, not permissions. [Read and Edit deny rules](</docs/en/permissions#tool-specific-permission-rules>) also apply to file commands Claude Code recognizes in Bash, such as `cat`, `head`, `tail`, `sed`, and `grep`, but not to arbitrary subprocesses that read or write files indirectly, like a Python or Node script that opens files itself. The set of commands recognized for deny rules is not the same as the read-before-edit list above: for example, `egrep` and `fgrep` count for read-before-edit but are not checked against Read deny rules. For OS-level enforcement that covers every process, [enable the sandbox](</docs/en/sandboxing>).
+A file that changed on disk after Claude last read it can still be edited when `old_string` matches the current content exactly and unambiguously and Claude Code can read the file without prompting. Matching against the file’s current content keeps this safe, and the result notes that the file carries other changes so Claude re-reads it before edits that depend on surrounding content. In any other case, such as a stale `old_string` or one that matches more than once without `replace_all`, Claude reads the file again before editing. The relaxed handling of unread and changed files requires Claude Code v2.1.208 or later; before that, Claude Code refused any edit to a file it hadn’t read in the conversation or that changed on disk after the read. Viewing a file with Bash also satisfies the read-before-edit requirement when the command is `cat`, `nl`, `bat`, `batcat`, `head`, `tail`, `sed -n 'X,Yp'`, `grep`, `egrep`, `fgrep`, or `rg` on a single file with no pipes or redirects. Piped output and other Bash commands don’t count toward the read-before-edit check. Viewing a file with Bash affects edit eligibility only, not permissions. See [Read and Edit permission rules](</docs/en/permissions#read-and-edit>) for which Bash commands your `Read` and `Edit` deny rules cover.
##
@@ -309,7 +309,7 @@
* Track output from any long-running script you point it at
* Connect to a WebSocket feed and report each message as it arrives
-For most watches, Claude writes a small script, runs it in the background, and receives each output line as it arrives. For a server that already pushes events, Claude can open a WebSocket instead of running a script. You keep working in the same session and Claude interjects when an event arrives. Stop a monitor by asking Claude to cancel it or by ending the session. When Monitor runs a command, it uses the same [permission rules as Bash](</docs/en/permissions#tool-specific-permission-rules>), so `allow` and `deny` patterns you have set for Bash apply here too. While [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) is active, Claude Code sets aside allow rules that name `Monitor` itself, along with the other [broad allow rules it drops](</docs/en/permission-modes#how-the-classifier-evaluates-actions>), so the classifier reviews Monitor commands the same way it reviews Bash commands. The WebSocket source has its own approval prompt, which the classifier also decides in auto mode. The tool is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. It is also not available when `DISABLE_TELEMETRY` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set. Plugins can declare monitors that start automatically when the plugin is active, instead of asking Claude to start them. See [plugin monitors](</docs/en/plugins-reference#monitors>).
+For most watches, Claude writes a small script, runs it in the background, and receives each output line as it arrives. For a server that already pushes events, Claude can open a WebSocket instead of running a script. You keep working in the same session and Claude interjects when an event arrives. Stop a monitor by asking Claude to cancel it or by ending the session. When you stop a [subagent](</docs/en/sub-agents>) that started monitors, for example from `/tasks`, those monitors stop with it. When Monitor runs a command, it uses the same [permission rules as Bash](</docs/en/permissions#tool-specific-permission-rules>), so `allow` and `deny` patterns you have set for Bash apply here too. While [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) is active, Claude Code sets aside allow rules that name `Monitor` itself, along with the other [broad allow rules it drops](</docs/en/permission-modes#how-the-classifier-evaluates-actions>), so the classifier reviews Monitor commands the same way it reviews Bash commands. The WebSocket source has its own approval prompt, which the classifier also decides in auto mode. The tool is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. It is also not available when `DISABLE_TELEMETRY` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set. Plugins can declare monitors that start automatically when the plugin is active, instead of asking Claude to start them. See [plugin monitors](</docs/en/plugins-reference#monitors>).
###
Show diff (179 lines)
--- a/typescript.md
+++ b/typescript.md
@@ -535,6 +535,7 @@
`pathToClaudeCodeExecutable`| `string`| Auto-resolved from bundled native binary| Path to Claude Code executable. Only needed if optional dependencies were skipped during install or your platform isn’t in the supported set
`permissionMode`| `PermissionMode`| `'default'`| Permission mode for the session
`permissionPromptToolName`| `string`| `undefined`| MCP tool name for permission prompts
+`permissionPrompts`| `'host' | 'none'`| `'host'`| Who answers permission prompts: `'host'` routes them to your `canUseTool` callback or the `permissionPromptToolName` tool, and `'none'` [denies the calls that would have prompted](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>). Requires Claude Code v2.1.259 or later
`persistSession`| `boolean`| `true`| When `false`, disables session persistence to disk. Sessions cannot be resumed later
`planModeInstructions`| `string`| `undefined`| Custom workflow instructions for plan mode. When `permissionMode` is `'plan'`, this string replaces the default plan-mode workflow body. The CLI still wraps it with the read-only enforcement preamble and the ExitPlanMode protocol footer
`plugins`| `SdkPluginConfig``[]`| `[]`| Load custom plugins from local paths. See [Plugins](</docs/en/agent-sdk/plugins>) for details
@@ -644,7 +645,7 @@
Method| Description
---|---
-`interrupt()`| Interrupts the query. Only available in streaming input mode. When the CLI advertises the `interrupt_receipt_v1` capability in `SDKSystemMessage.capabilities`, resolves with an `SDKControlInterruptResponse` listing the queued messages that survive the interrupt. Resolves `undefined` on CLIs before v2.1.205
+`interrupt()`| Interrupts the query. Only available in streaming input mode. When the CLI advertises the `interrupt_receipt_v1` capability in `SDKSystemMessage.capabilities`, resolves with an `SDKControlInterruptResponse` listing the messages that were pending when the interrupt arrived. Resolves `undefined` on CLIs before v2.1.205
`rewindFiles(userMessageId, options?)`| Restores files to their state at the specified user message. Pass `{ dryRun: true }` to preview changes. Requires `enableFileCheckpointing: true`. See [File checkpointing](</docs/en/agent-sdk/file-checkpointing>)
`setPermissionMode()`| Changes the permission mode (only available in streaming input mode)
`setModel()`| Changes the model (only available in streaming input mode). Passing `undefined` or the string `"default"` resets to the session default model
@@ -760,7 +761,7 @@
cancelled?: string[];
};
-`still_queued` lists the UUIDs of user messages that survive the interrupt: messages still in the queue, plus any messages Claude Code had already taken off the queue for the next turn before the interrupt arrived. Claude Code processes the listed messages after the interrupt unless you cancel them first, and can merge several into one turn. Use the receipt to decide whether to resend anything. Resending a message that is already listed delivers it to Claude twice. Interpret the list with these caveats:
+`still_queued` lists the UUIDs of the user messages that were pending when the interrupt arrived: messages still in the queue, plus any messages Claude Code had already taken off the queue for the next turn. Once the session’s first turn has started, Claude Code processes the listed messages after the interrupt unless you cancel them first, and can merge several into one turn. If you interrupt before the first turn starts, Claude Code aborts that turn as soon as it starts, and the listed messages in that turn get no response. Use the receipt to decide whether to resend anything. A listed message that you don’t cancel enters the conversation whether or not it gets a response, so resending it delivers it to Claude twice. Interpret the list with these caveats:
* Only messages that were enqueued with a UUID appear. An empty array doesn’t mean nothing else will run.
* Only main-thread messages are listed. Messages addressed to a subagent are out of scope.
@@ -1294,9 +1295,10 @@
timestamp?: string;
context_usage?: SDKContextUsage;
user_message_uuid?: string;
- };
-
-The `message` field is a [`BetaMessage`](<https://platform.claude.com/docs/en/api/messages/create>) from the Anthropic SDK. It includes fields like `id`, `content`, `model`, `stop_reason`, and `usage`. `SDKAssistantMessageError` is one of: `'authentication_failed'`, `'oauth_org_not_allowed'`, `'account_on_hold'`, `'billing_error'`, `'rate_limit'`, `'overloaded'`, `'invalid_request'`, `'model_not_found'`, `'server_error'`, `'max_output_tokens'`, or `'unknown'`. `'model_not_found'` means the selected model doesn’t exist or isn’t available to your account or deployment. `'overloaded'` means the API returned a 529 because the server is at capacity, as opposed to `'rate_limit'`, which is a 429 against your quota. `'account_on_hold'` means [your account is on hold](</docs/en/errors#your-account-is-on-hold>). `aborted` is `true` when an interrupt or abort truncated the assistant message before the stream completed: the message has no `stop_reason` and the content may end mid-word. The field is absent on normally completed messages. It requires Agent SDK v0.3.214 or later. Claude Code sets `user_message_uuid` on the turn’s first assistant message, under the conditions in `user_message_uuid`. `timestamp` is the ISO 8601 time when the message’s content finished generating on the process that produced it. The value comes from that machine’s clock, so use it for display only and don’t order messages by it. One API turn can produce several assistant messages that share a `message.id`, each with its own `timestamp`. When the field is absent, fall back to the time you received the message. `context_usage` is a structured copy of the `/context` report, typed as `SDKContextUsage`, and requires Agent SDK v0.3.232 or later. When you send `/context` as a prompt, Claude Code delivers the report as an assistant message whose `message.content` holds the markdown table, and attaches `context_usage` to that same message. Claude Code doesn’t set the field on any other assistant message, and earlier versions deliver the `/context` table without it, so read the breakdown from the field when it’s present and fall back to the markdown text when it isn’t.
+ user_message_uuids?: string[];
+ };
+
+The `message` field is a [`BetaMessage`](<https://platform.claude.com/docs/en/api/messages/create>) from the Anthropic SDK. It includes fields like `id`, `content`, `model`, `stop_reason`, and `usage`. `SDKAssistantMessageError` is one of: `'authentication_failed'`, `'oauth_org_not_allowed'`, `'account_on_hold'`, `'billing_error'`, `'rate_limit'`, `'overloaded'`, `'invalid_request'`, `'model_not_found'`, `'server_error'`, `'max_output_tokens'`, or `'unknown'`. `'model_not_found'` means the selected model doesn’t exist or isn’t available to your account or deployment. `'overloaded'` means the API returned a 529 because the server is at capacity, as opposed to `'rate_limit'`, which is a 429 against your quota. `'account_on_hold'` means [your account is on hold](</docs/en/errors#your-account-is-on-hold>). `aborted` is `true` when an interrupt or abort truncated the assistant message before the stream completed: the message has no `stop_reason` and the content may end mid-word. The field is absent on normally completed messages. It requires Agent SDK v0.3.214 or later. Claude Code sets `user_message_uuid` and `user_message_uuids` on the turn’s first assistant message, under the conditions in `user_message_uuid`. `timestamp` is the ISO 8601 time when the message’s content finished generating on the process that produced it. The value comes from that machine’s clock, so use it for display only and don’t order messages by it. One API turn can produce several assistant messages that share a `message.id`, each with its own `timestamp`. When the field is absent, fall back to the time you received the message. `context_usage` is a structured copy of the `/context` report, typed as `SDKContextUsage`, and requires Agent SDK v0.3.232 or later. When you send `/context` as a prompt, Claude Code delivers the report as an assistant message whose `message.content` holds the markdown table, and attaches `context_usage` to that same message. Claude Code doesn’t set the field on any other assistant message, and earlier versions deliver the `/context` table without it, so read the breakdown from the field when it’s present and fall back to the markdown text when it isn’t.
###
@@ -1366,7 +1368,12 @@
ttft_ms?: number;
ttft_stream_ms?: number;
user_message_uuid?: string;
+ user_message_uuids?: string[];
request_sent_wall_ms?: number;
+ first_content_frame_ms?: number;
+ first_stream_post_ms?: number;
+ first_stream_post_ack_ms?: number;
+ first_stream_post_wall_ms?: number;
total_cost_usd: number;
usage: NonNullableUsage;
modelUsage: { [modelName: string]: ModelUsage };
@@ -1400,6 +1407,7 @@
queued_turn_count?: number;
errors: string[];
user_message_uuid?: string;
+ user_message_uuids?: string[];
terminal_reason?: TerminalReason;
fast_mode_state?: FastModeState;
fast_mode_disabled_reason?: FastModeDisabledReason;
@@ -1412,7 +1420,10 @@
* `ttft_ms`: time to first token in milliseconds, measured when the first complete assistant message arrives. Present on the success arm only.
* `ttft_stream_ms`: time in milliseconds until the first `message_start` stream event, when the response stream opens. Lower than `ttft_ms`; the gap between the two is time spent streaming the first message. Present on the success arm only.
* `user_message_uuid`: the `uuid` of the message you sent that started this turn. See `user_message_uuid` for which results carry it.
+ * `user_message_uuids`: the `uuid`s of every message you sent that Claude Code answered in this turn. See `user_message_uuids`.
* `request_sent_wall_ms`: epoch milliseconds at which Claude Code dispatched the API request, for joins against server-side timestamps. Present on the success arm only, together with `user_message_uuid`, when `is_error` is false.
+ * `first_content_frame_ms`: time in milliseconds until the first `content_block_start` or `content_block_delta` stream event, counting thinking blocks as content. Present on the success arm only, when `is_error` is false. Requires Agent SDK v0.3.260 or later.
+ * `first_stream_post_ms`, `first_stream_post_ack_ms`, `first_stream_post_wall_ms`: timings for uploading the turn’s first stream event. Claude Code records them only in sessions it streams to claude.ai, such as [cloud sessions](</docs/en/claude-code-on-the-web>), and the results `query()` yields don’t carry them. Requires Agent SDK v0.3.260 or later.
* `usage`: main agent loop only. Excludes subagent and auxiliary model calls, and is per-turn in streaming-input sessions. Prefer `modelUsage` for token/cost accounting.
* `modelUsage`: per-model totals for every model call made through the query pipeline during this `query()` call, including the main loop, subagents, and internal calls such as compaction and Workflow agents. Helper calls outside that pipeline, such as the permission classifier and token-counting requests, are excluded. In streaming-input sessions the totals are cumulative across turns, so read the latest result rather than summing across results. See [Track costs in streaming input mode](</docs/en/agent-sdk/cost-tracking#track-costs-in-streaming-input-mode>) for resets and [Recover totals after a session crash](</docs/en/agent-sdk/cost-tracking#recover-totals-after-a-session-crash>) for zeroed results.
* `total_cost_usd`: cumulative estimated cost in USD for this `query()` call, covering the same calls as `modelUsage` and reset at the same points. It is an estimate, not a billing statement. See [Track cost and usage](</docs/en/agent-sdk/cost-tracking>) for accuracy caveats.
@@ -1444,17 +1455,26 @@
`user_message_uuid`
-The `uuid` of the `SDKUserMessage` that started the turn, echoed so you can match Claude Code’s reply to the message you sent. Claude Code echoes it only if you set `uuid` on that message. The field is optional on `SDKUserMessage`, and a string prompt passed to `query()` carries none. When you set it, Claude Code echoes it on two kinds of frame:
-
- * **The result** : on the success arm with `is_error` false, together with `request_sent_wall_ms`, which requires Agent SDK v0.3.216 or later. On an error result that answers a message you sent, Claude Code echoes the field alone, which requires Agent SDK v0.3.246 or later.
- * **The turn’s first reply** : the first assistant message, or with `includePartialMessages` the first stream event whose `event.type` isn’t `ping`, so you can bind the reply before the result arrives. When a turn streams nothing, Claude Code sets it on the first assistant message instead. One frame per turn carries it. Requires Agent SDK v0.3.246 or later.
+The `uuid` of the `SDKUserMessage` that started the turn, echoed so you can match Claude Code’s reply to the message you sent. Claude Code echoes it only if you set `uuid` on that message. The field is optional on `SDKUserMessage`, and a string prompt passed to `query()` carries none. When you send several messages close together, Claude Code can merge them into one turn. The field then carries only the last message’s `uuid`. To match the reply to any of the merged messages, use `user_message_uuids`. When you set `uuid`, Claude Code echoes it on three kinds of frame:
+
+ * **The result** : on the success arm with `is_error` false, together with `request_sent_wall_ms`, which requires Agent SDK v0.3.216 or later. Claude Code also echoes it on an error result that answers a message you sent, which requires Agent SDK v0.3.246 or later.
+ * **The turn’s first reply** : the first assistant message, or with `includePartialMessages` the first stream event whose `event.type` isn’t `ping`, so you can bind the reply before the result arrives. When a turn streams nothing, Claude Code sets it on the first assistant message instead. One reply frame per turn carries it. Requires Agent SDK v0.3.246 or later.
+ * **Every`thinking_tokens` frame of the turn**: so you can attribute thinking progress to the message you sent without waiting for the turn’s first reply. Requires Agent SDK v0.3.260 or later.
Claude Code omits the field in these cases:
* Later assistant messages and stream events of the same turn
* Subagent frames
* Synthetic turns, such as scheduled ones
- * Results with no single triggering message, such as the zeroed result after a crashed worker process
+ * Results that answer no message you sent, such as the zeroed result after a crashed worker process
+
+####
+
+
+
+`user_message_uuids`
+
+The `uuid`s of every message you sent that Claude Code answered in this turn. When you send several messages close together, Claude Code can merge them into one turn, and `user_message_uuid` then names only the last of them. To match the reply to any of the merged messages, look for that message’s `uuid` anywhere in this list. Requires Agent SDK v0.3.259 or later. Claude Code sets the list together with `user_message_uuid` on the turn’s first reply and on the result. For the full set of frames that carry `user_message_uuid`, and the version each requires, see `user_message_uuid`. The list always contains `user_message_uuid` and holds at most 64 entries. A message you send while the turn is running that Claude Code picks up between tool calls appears only in the result’s list. When a first reply or result carries `user_message_uuid` without the list, it came from an earlier Claude Code version, so fall back to the single field.
####
@@ -1511,8 +1531,8 @@
Capability| Meaning
---|---
-`interrupt_receipt_v1`| `interrupt()` resolves with an `SDKControlInterruptResponse` receipt naming the queued messages that survive the interrupt
-`interrupt_cancel_queued_v1`| The `interrupt` control request honors `cancel_queued: true`, cancelling the queued messages that would otherwise survive the interrupt and listing them on the receipt’s `cancelled` field. See `SDKControlInterruptResponse`. Requires Claude Code v2.1.219 or later
+`interrupt_receipt_v1`| `interrupt()` resolves with an `SDKControlInterruptResponse` receipt listing the messages that were pending when the interrupt arrived
+`interrupt_cancel_queued_v1`| The `interrupt` control request honors `cancel_queued: true`, cancelling the messages the receipt would otherwise list under `still_queued` and listing them under `cancelled` instead. See `SDKControlInterruptResponse`. Requires Claude Code v2.1.219 or later
###
@@ -1530,9 +1550,10 @@
session_id: string;
ttft_ms?: number; // Time to first token in ms, present only on message_start events
user_message_uuid?: string; // Present on at most one stream event per turn
- };
-
-Claude Code sets `user_message_uuid` on one stream event per turn, under the conditions in `user_message_uuid`.
+ user_message_uuids?: string[];
+ };
+
+Claude Code sets `user_message_uuid` and `user_message_uuids` on one stream event per turn, under the conditions in `user_message_uuid`.
###
@@ -1614,9 +1635,10 @@
Stream event emitted when the permission system denies a tool call without an interactive prompt. Use it to render the denial in your UI as it happens, rather than only observing the `is_error` tool result that follows. Which denials it reports depends on how the run handles permission prompts:
- * **With a`canUseTool` callback**: permission prompts go to your callback, and this event reports the denials Claude Code decides on its own without calling it.
+ * **With a`canUseTool` callback** and the default `permissionPrompts: 'host'`: permission prompts go to your callback, and this event reports the denials Claude Code decides on its own without calling it.
* **With neither** : a bare `-p` run, or `query()` that sets neither `canUseTool` nor `permissionPromptToolName`, denies any tool call that would have prompted, and this event reports those denials as well as the ones Claude Code decides on its own. Before v2.1.223, Claude Code didn’t emit this event in runs without a callback.
- * **With an MCP prompt tool** , set with `permissionPromptToolName` or the [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) flag: Claude Code doesn’t emit this event at all, not even for the rule denials it decides on its own.
+ * **With an MCP prompt tool** , set with `permissionPromptToolName` or the [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) flag, and the default `permissionPrompts: 'host'`: Claude Code doesn’t emit this event at all, not even for the rule denials it decides on its own.
+ * **With`permissionPrompts: 'none'`**: Claude Code denies the calls that would have prompted, even when `canUseTool` or an MCP prompt tool is also set, and this event reports those denials as well as the ones Claude Code decides on its own. Requires Claude Code v2.1.259 or later.
In every configuration, this event skips any denial decided on the `PreToolUse` hook path, whether the hook denied the call itself or a deny rule overrode the hook’s allow or ask decision. The event is also best-effort: occasionally Claude Code records a denial without emitting this event, so `permission_denials` on the result message is the authoritative record.
@@ -5035,7 +5057,7 @@
`SDKTaskNotificationMessage`
-Notification when a background task completes, fails, or is stopped. Background tasks include `run_in_background` Bash commands, Monitor watches, and background subagents. `ambient` is `true` for tasks Claude Code starts for its own operation; `SDKTaskStartedMessage` defines the field and its version requirement.
+Notification when a background task completes, fails, or is stopped. Background tasks include `run_in_background` Bash commands, Monitor watches, and background subagents. For the `ambient` field, see `SDKTaskStartedMessage`, which defines it and its version requirement.
type SDKTaskNotificationMessage = {
type: "system";
@@ -5210,7 +5232,7 @@
session_id: string;
};
-`ambient` is `true` for tasks Claude Code starts for its own operation and doesn’t display as your work, such as auto-started live-update watchers. Exclude ambient tasks from activity indicators. The field requires Agent SDK v0.3.247 or later. `ambient` also appears on `SDKTaskNotificationMessage` and on `SDKBackgroundTasksChangedMessage` entries. `is_backgrounded` and `spawn_depth` describe how Claude Code started the task. Both fields require Agent SDK v0.3.238 or later.
+`ambient` is `true` for tasks that aren’t part of the session’s work, such as tasks Claude Code runs for its own operation. Live-update watchers are also ambient, including watchers the user asked for. Exclude ambient tasks from activity indicators. The field requires Agent SDK v0.3.247 or later. `ambient` also appears on `SDKTaskNotificationMessage` and on `SDKBackgroundTasksChangedMessage` entries. `is_backgrounded` and `spawn_depth` describe how Claude Code started the task. Both fields require Agent SDK v0.3.238 or later.
* `is_backgrounded`: Claude Code sets it on `"local_agent"` and `"local_bash"` tasks. `true` means the task runs in the background. `false` means the task runs in the foreground, and the tool call that started it stays blocked until the task finishes or moves to the background.
* `spawn_depth`: Claude Code sets it on `"local_agent"` tasks only. A subagent that the main thread spawned has depth `1`. A subagent that a depth `1` subagent spawned has depth `2`, and so on.
@@ -5273,7 +5295,7 @@
`SDKBackgroundTasksChangedMessage`
-Emitted whenever the set of live background tasks changes: a task starts, completes, is killed, a foreground agent is backgrounded, or a task’s `ambient` flag changes. The `tasks` array is the full live set. Replace any cached set with each payload instead of pairing `task_started` and `task_notification` events, so the next membership change corrects any event you missed. Ordering relative to those per-task events is unspecified, so don’t correlate the two streams. Nothing is emitted at startup. Reset to an empty set whenever the session’s CLI process starts or restarts and let the next membership change repopulate it. When you send a repeated `initialize` control request to a running session, such as with `reinitialize()` after a transport gap, Claude Code follows the response with a snapshot of the current live set, even when it is empty. A reconnecting host therefore learns what is running without waiting for the next membership change. Before Agent SDK v0.3.239, Claude Code sent no snapshot after a repeated `initialize`. Requires Claude Code v2.1.203 or later.
+Emitted whenever the set of live background tasks changes: a task starts, completes, is killed, a foreground agent is backgrounded, or a task’s `description` or `ambient` field changes. The `tasks` array is the full live set. Replace any cached set with each payload instead of pairing `task_started` and `task_notification` events, so the next membership change corrects any event you missed. Ordering relative to those per-task events is unspecified, so don’t correlate the two streams. Nothing is emitted at startup. Reset to an empty set whenever the session’s CLI process starts or restarts and let the next membership change repopulate it. When you send a repeated `initialize` control request to a running session, such as with `reinitialize()` after a transport gap, Claude Code follows the response with a snapshot of the current live set, even when it is empty. A reconnecting host therefore learns what is running without waiting for the next membership change. Before Agent SDK v0.3.239, Claude Code sent no snapshot after a repeated `initialize`. Requires Claude Code v2.1.203 or later.
type SDKBackgroundTasksChangedMessage = {
type: "system";
@@ -5301,6 +5323,7 @@
subtype: "thinking_tokens";
estimated_tokens: number;
estimated_tokens_delta: number;
+ user_message_uuid?: string;
uuid: UUID;
session_id: string;
};
--- a/user-input.md
+++ b/user-input.md
@@ -42,7 +42,7 @@
Handle tool approval requests
-Once you’ve passed a `canUseTool` callback in your query options, it fires when Claude wants to use a tool that nothing earlier in the permission flow has approved. Your callback receives three arguments:
+Once you’ve passed a `canUseTool` callback in your query options, it fires when Claude wants to use a tool that nothing earlier in the permission flow has approved. In some configurations, such as `dontAsk` mode, Claude Code doesn’t call it; the last step of [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) lists them and says what happens to the call instead. Your callback receives three arguments:
Argument| Description
---|---
--- a/worktrees.md
+++ b/worktrees.md
@@ -79,7 +79,7 @@
* **File edits** : Claude Code blocks an `Edit`, `Write`, or `NotebookEdit` that targets a path in the main checkout.
* **Command working directory** : Claude Code blocks a Bash, PowerShell, or Monitor command whose working directory resolves to the main checkout, or whose working directory it can’t verify stays outside it.
* **Git redirects** : Claude Code blocks a Bash or Monitor command that redirects git into the main checkout. The redirect can come through `git -C`, `--git-dir`, a `GIT_DIR` or `GIT_WORK_TREE` variable, or a `cd` into the main checkout before running git.
- * **Command shape** : Claude Code blocks a Bash or Monitor command it can’t verify stays inside the worktree, even when the command runs no git at all. Claude Code refuses shell constructs it can’t trace without running them, such as brace expansion and heredocs with unquoted delimiters. Claude Code tells Claude how to rewrite the refused command, such as splitting it into plain, separate commands. You can’t turn this check off.
+ * **Command shape** : Claude Code blocks a Bash or Monitor command when it can’t verify from the command text that any git the command runs stays inside the worktree, for example when the command name is computed at runtime or the syntax can’t be parsed. Claude Code tells Claude how to rewrite the refused command, such as splitting it into plain, separate commands. You can’t turn this check off.
The checks apply to the repository you launched Claude Code from. They also cover the main checkout a linked worktree is linked from. For PowerShell commands, Claude Code applies only the working-directory check. Claude sees each refusal as a tool error that names the worktree and says how to proceed.