Changes on
40 changes detected
--- a/admin-setup.md
+++ b/admin-setup.md
@@ -46,7 +46,7 @@
Windows: `C:\Program Files\ClaudeCode\managed-settings.json`| Medium| All
Windows user registry| `HKCU\SOFTWARE\Policies\ClaudeCode`| Lowest| Windows only
-Server-managed settings reach devices at authentication time and refresh hourly during active sessions, with no endpoint infrastructure. Delivery through the claude.ai admin console requires a Claude for Teams or Enterprise plan. Deployments on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry can get the same remote delivery by running a [Claude apps gateway](</docs/en/claude-apps-gateway>), or use one of the file-based or OS-level mechanisms instead. If your organization mixes providers, configure [server-managed settings](</docs/en/server-managed-settings>) for claude.ai users plus a [file-based or plist/registry fallback](</docs/en/managed-settings#delivery-mechanisms>) so other users still receive managed policy. The plist and HKLM registry locations work with any provider and resist tampering because they require admin privileges to write. The Windows user registry at HKCU is writable without elevation, so treat it as a convenience default rather than an enforcement channel. By default, WSL reads only the Linux file path at `/etc/claude-code`. To extend your Windows registry and `C:\Program Files\ClaudeCode` policy to WSL on the same machine, set [`wslInheritsWindowsSettings: true`](</docs/en/settings-reference#wslinheritswindowssettings>) in either of those admin-only Windows sources. Whichever mechanism you choose, managed values take precedence over user and project settings, apart from a few security-sensitive [exceptions](</docs/en/settings#exceptions-to-managed-settings-precedence>). Array settings such as `permissions.allow` and `permissions.deny` merge entries from all sources, so developers can extend managed lists but not remove from them. For `fallbackModel` and `availableModels`, the managed value replaces lower layers rather than merging.
+Server-managed settings reach devices at authentication time and refresh hourly during active sessions, with no endpoint infrastructure. Delivery through the claude.ai admin console requires a Claude for Teams or Enterprise plan. Deployments on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry can get the same remote delivery by running a [Claude apps gateway](</docs/en/claude-apps-gateway>), or use one of the file-based or OS-level mechanisms instead. If your organization mixes providers, configure [server-managed settings](</docs/en/server-managed-settings>) for claude.ai users plus a [file-based or plist/registry fallback](</docs/en/managed-settings#delivery-mechanisms>) so other users still receive managed policy. The plist and HKLM registry locations work with any provider and resist tampering because they require admin privileges to write. The Windows user registry at HKCU is writable without elevation, so treat it as a convenience default rather than an enforcement channel. By default, WSL reads only the Linux file path at `/etc/claude-code`. To extend your Windows registry and `C:\Program Files\ClaudeCode` policy to WSL on the same machine, set [`wslInheritsWindowsSettings: true`](</docs/en/settings-reference#wslinheritswindowssettings>) in either of those admin-only Windows sources. Whichever mechanism you choose, managed values take precedence over user and project settings, apart from a few security-sensitive [exceptions](</docs/en/settings#exceptions-to-managed-settings-precedence>). Array settings such as `permissions.allow` and `permissions.deny` merge entries from all sources, so developers can extend managed lists but not remove from them. For `fallbackModel`, `availableModels`, and [`modelPicker`](</docs/en/settings-reference#modelpicker>), the managed value replaces lower layers rather than merging.
###
--- a/agent-teams.md
+++ b/agent-teams.md
@@ -290,7 +290,7 @@
Token usage
-Agent teams use significantly more tokens than a single session. Each teammate has its own context window, and token usage scales with the number of active teammates. For research, review, and new feature work, the extra tokens are usually worthwhile. For routine tasks, a single session is more cost-effective. See [agent team token costs](</docs/en/costs#agent-team-token-costs>) for usage guidance.
+Agent teams use significantly more tokens than a single session. Each teammate has its own context window, and token usage scales with the number of active teammates. For research, review, and new feature work, the extra tokens are usually worthwhile. For routine tasks, a single session is more cost-effective. See [agent team token costs](</docs/en/costs#agent-team-token-costs>) for usage guidance. An in-process teammate’s requests fall outside the main conversation’s [cache TTL bucket](</docs/en/prompt-caching#which-ttl-each-request-gets>), so its cache holds for five minutes by default, including on a Claude subscription. To keep it for an hour, set [`subagentPromptCacheTtl`](</docs/en/settings-reference#subagentpromptcachettl>) to `1h`. The API bills 1-hour cache writes at a higher rate.
##
--- a/amazon-bedrock.md
+++ b/amazon-bedrock.md
@@ -221,7 +221,7 @@
# Optional: Request 1-hour prompt cache TTL instead of the 5-minute default
# export ENABLE_PROMPT_CACHING_1H=1
-The 1-hour cache TTL is billed at a higher rate than the 5-minute default. See [cache lifetime](</docs/en/prompt-caching#cache-lifetime>).
+The 1-hour cache TTL is billed at a higher rate than the 5-minute default. See [cache lifetime](</docs/en/prompt-caching#cache-lifetime>). To set different TTLs for your main conversation and for the requests Claude Code makes outside it, [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>).
Prompt caching may not be available in all Amazon Bedrock regions. If cache token counts stay at zero, check [supported models, regions, and limits](<https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html#prompt-caching-models>) in the Amazon Bedrock documentation.
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,79 @@
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.245
+
+August 25, 2026
+
+ * Fixed a crash on startup on Linux distributions that ship glibc 2.44 (for example Arch Linux, CachyOS and Fedora Rawhide)
+
+
+
+2.1.243
+
+August 25, 2026
+
+ * Added a Loops breakdown to `/usage`: per-loop run count, total tokens, tokens per run, and last run, so runaway or chatty `/loop` tasks are easy to spot
+ * Added `modelPicker` setting: curate the `/model` picker with an ordered, labeled list of models (any id spelling, including Vertex/Bedrock ids), appended to or replacing the built-in lineup
+ * Added `promptCacheTtl` and `subagentPromptCacheTtl` settings so API-key and cloud-provider users can keep a 1-hour prompt cache on the main conversation while subagents stay at 5 minutes
+ * Added `modelPricing` managed setting so an organization’s contracted per-model rates and discount multiplier are used for `/cost`, the status line, and telemetry cost figures instead of list price
+ * Added a keyless sign-in under `/login` → Anthropic Console: “Sign in with your Console account” (recommended) alongside creating an API key, so organizations that don’t allow API keys can sign in
+ * Added a `Skipped sources` line to `/status` that lists managed settings sources (for example `managed-settings.json`) present but not applied because a higher-precedence managed source is active
+ * Added a `managed` marker in `/mcp` and `/plugins` on claude.ai connectors whose authentication is managed by your organization
+ * Added a tip pointing claude.ai users who haven’t connected GitHub for Claude Code on the web to `/web-setup`
+ * Added a `/status` line showing whether GitHub is connected for Claude Code on the web (Pro/Max), pointing to `/web-setup` when it isn’t
+ * Added the model (and effort level) each subagent ran on to `/tasks` and the agent detail dialogs
+ * Fixed remote MCP servers in non-interactive (`-p`) and SDK sessions never recovering after a dropped connection; they now reconnect automatically or report as failed
+ * Fixed MCP server sign-in started from the desktop app failing with “Invalid redirect URI” on servers that support client ID metadata documents (for example Linear)
+ * Fixed auto mode staying unavailable at startup when a temporary server-side disable was cached and later flag fetches failed
+ * Fixed auto mode tool calls being denied as “temporarily unavailable” after about a minute of waiting when the API was briefly overloaded and asked the client to retry
+ * Fixed the `/model` picker silently ignoring an Ultracode selection; picking Ultracode now applies it to the current session
+ * Fixed `/resume` only listing the 50 most recent sessions; the picker now loads more as you scroll
+ * Fixed cloud sessions resuming after a mid-turn restart with a pending hook or background-task notification re-sent as the prompt instead of the normal continuation message
+ * Fixed cross-session messaging silently turning off inside user namespaces and rootless containers after the 2.1.232 socket-directory hardening
+ * Fixed text that hangs outside its container (for example the sign-in URL in `/login`) losing its leading columns when another part of the screen repaints
+ * Fixed `spellcheck` not underlining a misspelled word typed directly after an emoji
+ * Fixed background subagents not waking when their last background Bash task completes
+ * Fixed sessions going silent for 10+ minutes when the Anthropic API never starts a response: the request now times out after ~3 minutes, retries once, then shows `API Error: No response from API`
+ * Fixed auth, model-availability, and other client-generated error messages rendering like model output instead of as error lines
+ * Fixed workload identity federation in CI: processes in one job share the exchanged token instead of re-exchanging the single-use token; a rejected exchange fails fast with the server’s message
+ * Fixed server-managed `companyAnnouncements` not showing at startup in a session that began with signing in (for example the first launch after `/logout`)
+ * Fixed hook `if` conditions like `Bash(cat *)` firing on unrelated Bash commands when the command contained `$()` or backtick command substitution followed by more arguments
+ * Fixed plugin dependencies declared with a `marketplace` field never resolving when both plugins are loaded together via `--plugin-dir`
+ * Fixed `/reload-plugins` keeping the LSP tool after the last LSP plugin is disabled; it now also warns before an LSP plugin change that would re-read the conversation
+ * Fixed `--agents` silently ignoring invalid JSON or invalid agent definitions; it now exits with a clear error, like `--mcp-config`
+ * Fixed `/status` showing “Found invalid entries in: .” with no filename when `~/.claude.json` has an invalid MCP server entry
+ * Fixed `/clear` removing the `/rename` session name from the prompt bar even though the name was kept for the new session
+ * Fixed Ctrl+R history search and up-arrow history breaking when `~/.claude/history.jsonl` contains a malformed entry
+ * Fixed Ctrl+[ not leaving vim INSERT mode in terminals that encode modified keys (modifyOtherKeys / kitty protocol)
+ * Fixed the local IDE connection being routed through `HTTPS_PROXY` (and sometimes failing) when `localhost` was listed in `NO_PROXY` but not lowercase `no_proxy`; both casings are now honored
+ * Fixed sandbox network-violation details being dropped from the Bash tool result when the blocked command still exited 0 (for example `curl` printing the proxy’s 403 page)
+ * Fixed the status line `rate_limits` fields and `/usage` still showing a rate-limit window’s pre-reset usage percentage after the window reset while the session was idle
+ * Fixed `claude --teleport <session>` exiting on uncommitted changes instead of offering to stash them and continue, as the session picker already does
+ * Fixed `/web-setup` repeatedly asking you to log in when an older GitHub CLI (without `gh auth token`) was already authenticated
+ * Fixed Claude in Chrome losing its connection to Claude Code after an auto-update cleaned up the version it was set up with; the native host now launches via the stable `claude` launcher
+ * [VSCode] Fixed sessions started before feature flags were first fetched (for example right after install) opening in the default permission mode instead of auto mode or your configured default mode
+ * [VSCode] Fixed Focus view sections you expanded collapsing on their own during subagent tool activity
+ * Improved startup time: sandbox and MCP bring-up no longer block the first frame, bare launches skip subcommand registration, and workflow discovery, settings, and trust-store work is cheaper
+ * Improved native install and auto-update download size: the binary is now zstd-compressed (about 75 MB instead of 340 MB on Linux x64)
+ * Improved attribution of usage telemetry to your organization for sessions that authenticate with `ANTHROPIC_AUTH_TOKEN` directly against the Anthropic API, so its data-handling settings apply
+ * Improved native binary size: about 2 MB smaller by storing the bundled skill and prompt text more compactly
+ * Improved memory usage of native builds: code is now loaded on demand instead of keeping the whole bundle resident (roughly 40–70 MB less memory per session)
+ * Improved peak memory usage in long-running sessions (the runtime now garbage-collects sooner as the heap grows)
+ * Improved `/login` over SSH: the sign-in URL appears immediately, pressing `c` reports how the URL was copied instead of always claiming success, and a hint explains how to select text in fullscreen
+ * Improved the error when effort `xhigh`/`max` is used with thinking turned off: it now names the level, the setting that disabled thinking, and `/effort high` as the fix
+ * Improved `/loop`: consecutive wake-ups where Claude has nothing to do now fold into a single line in the terminal instead of printing each one
+ * Changed the sandboxed Bash tool prompt to no longer list allowed network hosts, so Claude attempts requests (and you can approve new hosts) instead of assuming unlisted hosts are blocked
+ * Updated the `/model` picker and the bundled `claude-api` skill to show Sonnet 5’s 2/2/2/10 per Mtok pricing as its standard list price rather than a limited-time promo
+ * Changed computer use on macOS so clicking the desktop, Dock, or a Finder window requires granting Finder via the access dialog, like any other app
+ * Changed `/model`, `/fast`, and `/effort` to also run immediately instead of queueing until the turn ends on Bedrock, Vertex, and Foundry and when telemetry is disabled
+ * Fixed `claude remote-control` exiting and stranding attached Remote Control sessions when the server drops its environment mid-session; it now recovers
+ * Fixed Remote Control sessions served by `claude remote-control` sometimes getting stuck after it was stopped and restarted, for Team and Enterprise members without an admin or owner role
+ * Changed the cross-session messaging inbox socket to close connections that send no complete line within 30 seconds; scripts posting to it should connect once their data is ready
+ * Improved the notice when resuming a conversation whose Remote Control is held by another terminal: it now says sessions on other machines can’t be seen from, or reach, this one
+ * [VSCode] Improved history trimming in long sessions: older tool-activity rows are dropped first so your messages and Claude’s replies stay visible
+ * [VSCode] Improved attribution of the extension’s own usage telemetry to your organization when you are signed in with a Claude account, so its data-handling settings apply
--- a/claude-apps-gateway-config.md
+++ b/claude-apps-gateway-config.md
@@ -560,7 +560,7 @@
What goes in `cli`
-Each `cli` value is a complete Claude Code `managed-settings.json` document, the same schema you would deploy via MDM or `/etc/claude-code/managed-settings.json`, expressed here as YAML. The CLI applies the delivered document at the managed tier, above user and project settings. The gateway validates each document against the CLI’s settings schema at boot, so an unrecognized top-level key or a recognized key with a malformed value fails boot with an error naming every offending key. Deliberately open parts of the schema still accept arbitrary values, because newer clients may recognize entries the gateway’s schema doesn’t. These open keys are `env`, `pluginConfigs`, and keys nested under `permissions`. Because validation uses the schema bundled with the gateway’s installed version, putting a top-level settings key introduced by a newer Claude Code release into managed config requires upgrading the gateway first. Smoke-test a new policy on one client before rolling it out. The full key reference is in [Claude Code settings](</docs/en/settings-reference#all-settings>). The keys most operators reach for first:
+Each `cli` value is a complete Claude Code `managed-settings.json` document, the same schema you would deploy via MDM or `/etc/claude-code/managed-settings.json`, expressed here as YAML. The CLI applies the delivered document at the managed tier, above user and project settings, in place of server-managed settings. It therefore ignores the settings [restricted to OS-level policy sources](</docs/en/server-managed-settings#current-limitations>), such as `policyHelper` and `wslInheritsWindowsSettings`. The gateway validates each document against the CLI’s settings schema at boot, so an unrecognized top-level key or a recognized key with a malformed value fails boot with an error naming every offending key. Deliberately open parts of the schema still accept arbitrary values, because newer clients may recognize entries the gateway’s schema doesn’t. These open keys are `env`, `pluginConfigs`, and keys nested under `permissions`. Because validation uses the schema bundled with the gateway’s installed version, putting a top-level settings key introduced by a newer Claude Code release into managed config requires upgrading the gateway first. Smoke-test a new policy on one client before rolling it out. The full key reference is in [Claude Code settings](</docs/en/settings-reference#all-settings>). The keys most operators reach for first:
managed:
policies:
--- a/claude-platform-on-aws.md
+++ b/claude-platform-on-aws.md
@@ -73,7 +73,7 @@
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5
-For the full list of model IDs and aliases, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For other model-related variables, see [Model configuration](</docs/en/model-config>). [Prompt caching](</docs/en/prompt-caching>) is enabled automatically. To request a 1-hour cache TTL instead of the 5-minute default, set `ENABLE_PROMPT_CACHING_1H=1`. The API bills 1-hour cache writes at a higher rate. See [prompt caching pricing](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing>) for the rates.
+For the full list of model IDs and aliases, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For other model-related variables, see [Model configuration](</docs/en/model-config>). [Prompt caching](</docs/en/prompt-caching>) is enabled automatically. To request a 1-hour cache TTL instead of the 5-minute default, set `ENABLE_PROMPT_CACHING_1H=1`. The API bills 1-hour cache writes at a higher rate. See [prompt caching pricing](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing>) for the rates. To set different TTLs for your main conversation and for the requests Claude Code makes outside it, [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>).
###
--- a/cloud-environments.md
+++ b/cloud-environments.md
@@ -341,7 +341,7 @@
**When they run**| Before Claude Code launches, skipped when a cached environment exists| After Claude Code launches, on every session including resumed
**Where they run**| Cloud sessions only| Local and cloud sessions
-If you have SessionStart hooks in your user-level `~/.claude/settings.json`, don’t expect them in the cloud: user-level settings stay on your machine. In a cloud session, Claude Code runs hooks from the repository and from your organization’s [server-managed settings](</docs/en/server-managed-settings>); sessions in a [self-hosted environment](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>) also run hooks the operator seeded from the runner host’s `~/.claude/`.
+If you have SessionStart hooks in your user-level `~/.claude/settings.json`, don’t expect them in the cloud: user-level settings stay on your machine. In a cloud session, Claude Code runs hooks from the repository and from your organization’s [server-managed settings](</docs/en/server-managed-settings>). In a [self-hosted environment](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>), Claude Code also runs the hooks the operator seeded from the runner host’s `~/.claude/`, and it runs the hooks in the runner image’s managed settings file when neither [server-managed settings nor an MDM-delivered Claude Code policy](</docs/en/settings#precedence-within-the-managed-tier>) supplies the managed tier.
###
--- a/commands.md
+++ b/commands.md
@@ -46,7 +46,7 @@
`/code-review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [pr#|branch|path]`| **[Skill](</docs/en/skills#bundled-skills>).** Review the current diff, or a PR number, branch, or path you pass, for correctness bugs and cleanup opportunities. Pass `--fix` to apply findings, `--comment` to post them as inline GitHub PR comments, or `ultra` to run a deep [cloud review](</docs/en/ultrareview>). With `ultra` on a `github.com` PR target, `--post` preselects [posting the finished findings to the PR](</docs/en/ultrareview#post-findings-to-the-pull-request>) in the launch dialog. See [Review a diff locally](</docs/en/code-review#review-a-diff-locally>) for the effort levels, targeting, and how it relates to `/simplify`. Alias: `/review`
`/color [color|default]`| Set the prompt bar color for the current session. Available colors: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan`. Use `default` to reset, or run with no argument to pick a random color. When [Remote Control](</docs/en/remote-control>) is connected, the color syncs to claude.ai/code. Also available in non-interactive mode (`-p`); requires Claude Code v2.1.205 or later
`/compact [instructions]`| Free up context by summarizing the conversation so far. Optionally pass focus instructions for the summary. See [how compaction handles rules, skills, and memory files](</docs/en/context-window#what-survives-compaction>)
-`/config [key=value ...]`| Open the [Settings](</docs/en/settings>) interface to adjust theme, model, [output style](</docs/en/output-styles>), and other preferences. From v2.1.181, pass one or more `key=value` pairs to set a setting directly without opening the interface, for example `/config thinking=false`. From v2.1.182, named shorthand keys are also accepted, such as `/config theme=dark` or `/config model=sonnet`. The `key=value` form also works in non-interactive mode (`-p`) and from the Claude mobile app via [Remote Control](</docs/en/remote-control>). Run `/config --help` to list every settable key with its options. Alias: `/settings`
+`/config [key=value ...]`| Open the [Settings](</docs/en/settings>) interface to adjust theme, model, [output style](</docs/en/output-styles>), and other preferences. From v2.1.181, pass one or more `key=value` pairs to set a setting directly without opening the interface, for example `/config thinking=false`. From v2.1.182, named shorthand keys are also accepted, such as `/config theme=dark` or `/config model=sonnet`. The `key=value` form also works in non-interactive mode (`-p`) and from the Claude mobile app via [Remote Control](</docs/en/remote-control>). The `key=value` form can’t turn on a setting that needs your confirmation in the panel, such as [`autoContinueAtUsageLimit`](</docs/en/interactive-mode#turn-automatic-continue-off>), though it can turn one off. Run `/config --help` to list the keys it accepts. Alias: `/settings`
`/context [all]`| Visualize current context usage as a colored grid. Shows optimization suggestions for context-heavy tools, memory bloat, and capacity warnings. When the conversation exceeds the context window, the output includes a [warning](</docs/en/errors#context-exceeds-the-token-limit>) showing how far over the limit you are and which command frees space. In [fullscreen mode](</docs/en/fullscreen>), `/context` collapses the per-item breakdown to keep the grid visible. Pass `all` to expand it
`/copy [N]`| Copy the last assistant response to clipboard. Pass a number `N` to copy the Nth-latest response: `/copy 2` copies the second-to-last. When code blocks are present, shows an interactive picker to select individual blocks or the full response. Press `w` in the picker to write the selection to a file instead of the clipboard, which is useful over SSH
`/cost`| Alias for `/usage`
@@ -93,6 +93,7 @@
`/pr-comments [PR]`| Removed in v2.1.91. Ask Claude directly to view pull request comments instead. On earlier versions, fetches and displays comments from a GitHub pull request; automatically detects the PR for the current branch, or pass a PR URL or number. Requires the `gh` CLI
`/privacy-settings`| View and update your privacy settings. Only available for Pro and Max plan subscribers
`/radio`| Open Claude FM lo-fi radio in your browser. Prints the stream URL when no browser is available. Not available on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS
+`/rate-limit-options`| Show ways to keep working when a claude.ai usage limit blocks a request: wait and [continue automatically when the limit resets](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>), add [usage credits](</docs/en/costs#add-usage-credits-to-your-subscription>), or upgrade your plan. Claude Code can also open this menu on its own when you hit a limit at your own terminal. See [Turn automatic continue off](</docs/en/interactive-mode#turn-automatic-continue-off>). Requires a claude.ai subscription. Doesn’t appear in the command menu; type it in full. The wait-and-continue rows require Claude Code v2.1.234 or later
`/recap`| Generate a one-line summary of the current session on demand. See [Session recap](</docs/en/interactive-mode#session-recap>) for the automatic recap that appears after you’ve been away
`/release-notes`| View the changelog in an interactive version picker. Select a specific version to see its release notes, or choose to show all versions. The notes appear in your transcript without entering the conversation Claude sees
`/reload-plugins [--force]`| Reload all active [plugins](</docs/en/plugins>) to apply pending changes without restarting. Reports counts for each reloaded component and flags any load errors. When the reload would change which MCP tools are loaded and invalidate the prompt cache, the command warns and skips unless you pass `--force`
@@ -128,7 +129,7 @@
`/ultraplan <prompt>`| Removed. Use [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) instead. Previously sent a planning task to a [Claude Code on the web](</docs/en/claude-code-on-the-web>) session for review in your browser
`/ultrareview [PR or branch]`| Run a deep, multi-agent code review in a cloud sandbox with [ultrareview](</docs/en/ultrareview>). Pass a PR reference to review that pull request, or a branch name to change the comparison base. The preferred invocation is now `/code-review ultra`, and `/ultrareview` remains as an alias. Includes 3 free runs on Pro and Max, then requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)
`/upgrade`| Open the upgrade page in your browser to switch to a higher plan tier. When the browser fails to open, the command shows a sign-in prompt without printing the URL
-`/usage`| Show session cost, plan usage limits, and activity stats. On a Pro, Max, Team, or Enterprise plan, includes a breakdown of usage by skill, subagent, plugin, and MCP server. See the [cost tracking guide](</docs/en/costs#using-the-%2Fusage-command>) for details. `/cost` and `/stats` are aliases
+`/usage`| Show session cost, plan usage limits, and activity stats. On a Pro, Max, Team, or Enterprise plan, includes a [breakdown of what counts against your plan limits](</docs/en/costs#plan-usage-breakdown>). `/cost` and `/stats` are aliases
`/usage-credits`| Configure usage credits, or request them from your admin, when you hit a limit. Opens your [usage-credits billing settings](</docs/en/costs#add-usage-credits-to-your-subscription>) in the browser, except that Team and Enterprise members without billing access instead send a usage-credits request to their admin from the CLI, after confirming in a dialog that the request notifies their admins. When no browser can open the billing page, for example over SSH, the command prints the URL to visit instead; this requires Claude Code v2.1.205 or later, and earlier versions showed nothing in that case. Previously `/extra-usage`
`/verify`| **[Skill](</docs/en/skills#bundled-skills>).** Confirm a code change does what it should by building your project’s app, running it, and observing the result, rather than relying on tests or type checks. See [Run and verify your app](</docs/en/skills#run-and-verify-your-app>)
`/vim`| Removed in v2.1.92. To toggle between Vim and Normal editing modes, use `/config` → Editor mode
--- a/context-window.md
+++ b/context-window.md
@@ -19,19 +19,22 @@
What survives compaction
-When a long session compacts, Claude Code summarizes the conversation history to fit the context window. As of v2.1.198, the summarization request inherits your session’s [extended thinking](</docs/en/model-config#extended-thinking>) configuration, so it reasons with thinking enabled when your session has it enabled and stays off otherwise. Thinking affects only how the summary is produced; your session settings are unchanged afterward. What happens to your instructions depends on how they were loaded:
+When a long session compacts, Claude Code summarizes the conversation history to fit the context window. As of v2.1.198, the summarization request inherits your session’s [extended thinking](</docs/en/model-config#extended-thinking>) configuration, so it reasons with thinking enabled when your session has it enabled and stays off otherwise. Thinking affects only how the summary is produced; your session settings are unchanged afterward. What happens to each kind of content depends on how it was loaded:
Mechanism| After compaction
---|---
System prompt and output style| Unchanged; not part of message history
Project-root CLAUDE.md and unscoped rules| Re-injected from disk
Auto memory| Re-injected from disk
-Rules with `paths:` frontmatter| Lost until a matching file is read again
-Nested CLAUDE.md in subdirectories| Lost until a file in that subdirectory is read again
+The plan Claude wrote in [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>)| Re-injected from disk
+Rules with `paths:` frontmatter| Claude Code reloads them as Claude reads files they match
+Nested CLAUDE.md in subdirectories| Claude Code reloads them as Claude reads files in that subdirectory
+Files Claude read or edited| Claude Code re-reads up to five, most recently modified first
Invoked skill bodies| Re-injected, capped at 5,000 tokens per skill and 25,000 tokens total; oldest dropped first
-Hooks| Not applicable; hooks run as code, not context
+Context that hooks added earlier| Summarized with the rest of the conversation
+[SessionStart hooks](</docs/en/hooks-guide#re-inject-context-after-compaction>) that match the `compact` source| Claude Code runs them and adds their output to the compacted context
-Path-scoped rules and nested CLAUDE.md files load into message history when their trigger file is read, so compaction summarizes them away with everything else. They reload the next time Claude reads a matching file. If a rule must persist across compaction, drop the `paths:` frontmatter or move it to the project-root CLAUDE.md. Skill bodies are re-injected after compaction, but large skills are truncated to fit the per-skill cap, and the oldest invoked skills are dropped once the total budget is exceeded. Truncation keeps the start of the file, so put the most important instructions near the top of `SKILL.md`.
+Path-scoped rules and nested CLAUDE.md files load into message history when their trigger file is read, so compaction summarizes them away with everything else. Right after compaction, Claude Code re-reads up to five of the files Claude has read or edited in the session, choosing the ones modified most recently, and reloads the rules and nested CLAUDE.md files that apply to those files. A file over 5,000 tokens comes back as a path reference without its content, shown as `Referenced file` instead of `Read`. Its rules still reload. If a rule must persist across compaction, drop the `paths:` frontmatter or move it to the project-root CLAUDE.md. Skill bodies are re-injected after compaction, but large skills are truncated to fit the per-skill cap, and the oldest invoked skills are dropped once the total budget is exceeded. Truncation keeps the start of the file, so put the most important instructions near the top of `SKILL.md`.
##
@@ -42,6 +45,7 @@
Claude Code compacts automatically as you approach the limit, so a full context window doesn’t end your session. The automatic pass works the same way as the `/compact` step in the timeline. See [When context fills up](</docs/en/how-claude-code-works#when-context-fills-up>) for what it preserves. You can also act before the automatic pass runs:
* **Compact with a focus** : run `/compact` with instructions, like `/compact focus on the auth bug fix`, before starting a long new task. The summary keeps what you choose instead of what the automatic pass guesses is important.
+ * **Compact part of the conversation** : run `/rewind`, select a message, and choose **Summarize from here** or **Summarize up to here**. See [Rewind and summarize](</docs/en/checkpointing#rewind-and-summarize>) for what each option keeps and how to guide the summary.
* **Compact earlier** : run [`/autocompact`](</docs/en/commands#all-commands>) with a token count, like `/autocompact 500k`, to set how full the context window gets before the automatic pass runs. See [Set the auto-compact window](</docs/en/model-config#set-the-auto-compact-window>) for accepted values and overrides.
* **Clear between tasks** : run `/clear` when switching to unrelated work. Old conversation crowds out the files you need next and costs tokens on every message.
* **Delegate large reads** : send research to a [subagent](</docs/en/sub-agents>) so the file contents stay in its context window, not yours.
--- a/cost-tracking.md
+++ b/cost-tracking.md
@@ -327,7 +327,7 @@
Extend the prompt cache TTL to one hour
-Cache entries written by the SDK use a 5-minute TTL by default when you authenticate with an API key or run on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). If your workload runs many short sessions against the same system prompt and context with gaps longer than 5 minutes between them, the cache expires between sessions and each new session pays full input price. To request a 1-hour TTL on cache writes, set the [`ENABLE_PROMPT_CACHING_1H`](</docs/en/env-vars>) environment variable. You can export it in your shell or container environment, or pass it through `options.env`. The following example enables 1-hour TTL for an agent running on Amazon Bedrock. Because it sets `CLAUDE_CODE_USE_BEDROCK`, it requires working AWS credentials for [Amazon Bedrock](</docs/en/amazon-bedrock>); without them the query fails.
+Your own turns fall in the [main conversation TTL bucket](</docs/en/prompt-caching#which-ttl-each-request-gets>), together with the helpers Claude Code runs inline with them. The requests Claude Code makes outside that conversation, such as [subagents](</docs/en/agent-sdk/subagents>), have a [separate TTL control](</docs/en/prompt-caching#choose-the-ttl-yourself>). Cache entries for your own turns use a 5-minute TTL by default when you authenticate with an API key or run on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). If your workload runs many short sessions against the same system prompt and context with gaps longer than 5 minutes between them, the cache expires between sessions and each new session pays full input price. To request a 1-hour TTL on cache writes, set the [`ENABLE_PROMPT_CACHING_1H`](</docs/en/env-vars>) environment variable. You can export it in your shell or container environment, or pass it through `options.env`. The following example enables 1-hour TTL for an agent running on Amazon Bedrock. Because it sets `CLAUDE_CODE_USE_BEDROCK`, it requires working AWS credentials for [Amazon Bedrock](</docs/en/amazon-bedrock>); without them the query fails.
Python
@@ -363,7 +363,12 @@
console.log(message);
}
-Cache writes with a 1-hour TTL are billed at a higher rate than 5-minute writes, so enabling this trades higher write cost for more cache reads. See [prompt caching pricing](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching>) for details. Claude subscription users within included usage receive the 1-hour TTL automatically without setting this variable. When you’re drawing on [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>), the SDK drops to the 5-minute TTL unless you set `ENABLE_PROMPT_CACHING_1H`.
+Cache writes with a 1-hour TTL are billed at a higher rate than 5-minute writes, so enabling this trades higher write cost for more cache reads. See [prompt caching pricing](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching>) for details. On a Claude subscription within your plan’s included usage, you get the 1-hour TTL on your own turns, and on some of the helper requests Claude Code makes beside them, without setting this variable, and Claude Code drops those turns to the 5-minute TTL once you’re drawing on [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>). `ENABLE_PROMPT_CACHING_1H` asks for the 1-hour TTL on every request in both buckets. To choose a TTL for each bucket separately, use these controls instead. Each takes `5m` or `1h` and takes precedence over `ENABLE_PROMPT_CACHING_1H`:
+
+ * Main conversation: the `CLAUDE_CODE_PROMPT_CACHE_TTL` [environment variable](</docs/en/env-vars>), or the [`promptCacheTtl`](</docs/en/settings-reference#promptcachettl>) setting
+ * Everything else: the `CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL` environment variable, or the [`subagentPromptCacheTtl`](</docs/en/settings-reference#subagentpromptcachettl>) setting
+
+Setting `promptCacheTtl` to `1h` keeps the 1-hour cache on the main conversation while you’re drawing on usage credits. For the full precedence order, see [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>).
##
--- a/costs.md
+++ b/costs.md
@@ -35,8 +35,9 @@
* **Attribution** : recent usage attributed to skills, subagents, plugins, and individual MCP servers, each shown as a percentage of the total. An MCP server’s share counts only the requests that consumed one of its tool results. Before v2.1.222, after one call to an MCP server, Claude Code attributed every subsequent request to that server, overstating its share.
* **Behavior flags** : behaviors such as long context or cache misses, flagged when one accounts for 10% or more of recent usage.
-
-Press `d` or `w` to switch between the last 24 hours and the last 7 days. The figures are approximate and computed from local session history on this machine, so usage from other devices or claude.ai is not included. In the [VS Code extension](</docs/en/vs-code#check-account-and-usage>), the same breakdown appears in the Account & usage dialog with a Day and Week toggle. Requires Claude Code v2.1.174 or later.
+ * **Loops** : a row for each of the heaviest [`/loop` or other scheduled tasks](</docs/en/scheduled-tasks>) that ran recently, ordered by total tokens, with a count of the rest. Claude Code reports how often each task fires, how many times it ran, its total and per-run tokens, and when it last ran. Claude Code keys a row by the task’s prompt, so a loop you stop and re-create stays one row. Requires Claude Code v2.1.242 or later.
+
+Press `d` or `w` to switch between the last 24 hours and the last 7 days. The figures are approximate and computed from local session history on this machine, so usage from other devices or claude.ai is not included. In the [VS Code extension](</docs/en/vs-code#check-account-and-usage>), the attribution shares and behavior flags appear in the Account & usage dialog with a Day and Week toggle, without the Loops rows. Requires Claude Code v2.1.174 or later.
####
@@ -154,7 +155,9 @@
Developers usually bring limit questions to their admin, so it helps to know which ceiling they hit. The four situations mean different things:
- * **“You’ve hit your session limit” or “You’ve hit your weekly limit”** : a seat-based usage window on a subscription plan. These windows are shared across all models, so switching models with `/model` doesn’t restore access, though it does keep the developer working after the model-specific “You’ve hit your Opus limit” message. The message shows when the window resets, and the developer can run `/usage-credits` to request usage beyond the allowance if you have [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) turned on. See [usage limit errors](</docs/en/errors#youve-hit-your-session-limit>).
+ * **“You’ve hit your session limit” or “You’ve hit your weekly limit”** : a seat-based usage window on a subscription plan, shared across all models, so the developer can’t restore access by switching models with `/model`. The message shows when the window resets. After the model-specific “You’ve hit your Opus limit” or “You’ve hit your Sonnet limit” message, switching to a model outside that family with `/model` does keep the developer working. See [usage limit errors](</docs/en/errors#youve-hit-your-session-limit>). What the developer can do in the meantime:
+ * Run `/usage-credits` to request usage beyond the allowance, if you have [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) turned on.
+ * On Claude Code v2.1.234 or later, [wait and continue the interrupted task automatically after the reset](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>); that section lists when Claude Code starts the wait on its own and when the developer picks it from `/rate-limit-options`. To control for your fleet whether Claude Code starts that wait on its own, set [`autoContinueAtUsageLimit`](</docs/en/settings-reference#autocontinueatusagelimit>) in [managed settings](</docs/en/settings#settings-precedence>).
* **A spend limit message from a[Claude apps gateway](</docs/en/claude-apps-gateway>)**: the developer passed a spend cap you set on your self-hosted gateway, and the gateway blocks their requests until the period resets or you raise the cap. See [gateway spend limits](</docs/en/claude-apps-gateway-spend-limits>) for caps, reset schedules, and the message the developer sees.
* **A context or auto-compact warning** : not a usage limit. The conversation has grown close to the session’s [auto-compact window](</docs/en/model-config#set-the-auto-compact-window>), the threshold where Claude Code summarizes older history to free space. Point the developer at reduce token usage.
* **Unexpectedly high spend on an API or cloud-provider plan** : usually traces back to long sessions that were never cleared or to Opus left as the default model. The highest-impact habits to share are clearing between unrelated tasks and matching the model to the job, both covered in reduce token usage.
@@ -346,7 +349,7 @@
A session that has been open for hours can use far more of your plan limits than your activity suggests, usually for one of these reasons:
* **Long context** : Claude Code sends your full conversation with every request, and each time Claude uses tools it sends another request carrying that batch of tool results. With [prompt caching](</docs/en/prompt-caching>), Claude Code re-reads that history at the [cached token rate](<https://platform.claude.com/docs/en/about-claude/pricing>), so a one-line question in a session that has been open all day still draws usage for the whole conversation. See Manage context proactively for ways to keep your context small
- * **Cache misses** : your first message after a break longer than the [cache lifetime](</docs/en/prompt-caching#cache-lifetime>) misses the cache and reprocesses your full context. The lifetime is an hour on a subscription and drops to five minutes once you’re drawing on [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>); on an API key or cloud provider, it’s five minutes by default. You can keep the one-hour lifetime while drawing on usage credits by setting [`ENABLE_PROMPT_CACHING_1H=1`](</docs/en/env-vars>). On Pro and Max plans, when you resume a large session after a long break, Claude Code [offers to resume from a summary](</docs/en/sessions#resume-from-a-summary>) so later requests don’t carry the full history
+ * **Cache misses** : your first message after a break longer than the [cache lifetime](</docs/en/prompt-caching#cache-lifetime>) misses the cache and reprocesses your full context. The lifetime is an hour on a subscription and drops to five minutes once you’re drawing on [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>); on an API key or cloud provider, it’s five minutes by default. To keep the one-hour lifetime while drawing on usage credits, [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>). On Pro and Max plans, when you resume a large session after a long break, Claude Code [offers to resume from a summary](</docs/en/sessions#resume-from-a-summary>) so later requests don’t carry the full history
* **Scheduled tasks** : a [scheduled task](</docs/en/scheduled-tasks>) fires on its interval even while the session is idle, sending your full context each time
* **Cross-session messages** : Claude Code delivers a [message from another of your sessions](</docs/en/cross-session-messaging>) as a new turn when this session sits idle, sending your full context each time. To hold inbound messages instead of delivering them, set [`crossSessionInbound`](</docs/en/settings-reference#crosssessioninbound>) to `hold`
* **Goal check-ins** : while background work keeps an active [goal](</docs/en/goal>) waiting, Claude Code [asks Claude to check on that work](</docs/en/goal#background-work-defers-evaluation>) even when the session sits idle, starting a new turn that sends your full context. To turn check-ins off, set [`CLAUDE_CODE_GOAL_CHECKIN_MINUTES`](</docs/en/env-vars>) to `0`. Idle check-ins require Claude Code v2.1.236 or later
--- a/discover-plugins.md
+++ b/discover-plugins.md
@@ -417,7 +417,7 @@
Configure auto-updates
-Claude Code can automatically update marketplaces and their installed plugins in the background after startup. When auto-update is enabled for a marketplace, Claude Code refreshes the marketplace data and updates installed plugins to their latest versions on disk. Claude Code checks for marketplace and plugin updates after your session starts, with a random delay of up to ten minutes, so the running session keeps using the versions it loaded at launch. If any plugins were updated, you’ll see a notification prompting you to run `/reload-plugins`, or the new versions load on your next launch. Claude Code updates plugins that have a [`command` source](</docs/en/plugin-marketplaces#command-sources>) on a separate cadence from the marketplace auto-update setting and from `DISABLE_AUTOUPDATER`. Instead, it [re-runs the command once per session](</docs/en/plugin-marketplaces#when-claude-code-re-runs-the-command>) and installs the output as a new plugin version when its [hash](</docs/en/plugins-reference#version-management>) has changed. Toggle auto-update for individual marketplaces through the UI:
+Claude Code can automatically update marketplaces and their installed plugins in the background after startup. When auto-update is enabled for a marketplace, Claude Code refreshes the marketplace data and updates installed plugins to their latest versions on disk. Claude Code checks for marketplace and plugin updates after your session starts, with a random delay of up to ten minutes, so the running session keeps using the versions it loaded at launch. If any plugins were updated, you’ll see a notification prompting you to run `/reload-plugins`, or the new versions load on your next launch. Auto-update also leaves out a plugin whose marketplace entry declares a `headersHelper`: Claude Code [neither runs the command nor downloads the archive](</docs/en/plugin-marketplaces#installs-and-updates-that-refuse-the-command-instead-of-asking>) on that path; that section says when Claude Code lists the plugin in the `/plugin` Errors tab so you can update it from its own view. Claude Code updates plugins that have a [`command` source](</docs/en/plugin-marketplaces#command-sources>) on a separate cadence from the marketplace auto-update setting and from `DISABLE_AUTOUPDATER`. Instead, it [re-runs the command once per session](</docs/en/plugin-marketplaces#when-claude-code-re-runs-the-command>) and installs the output as a new plugin version when its [hash](</docs/en/plugins-reference#version-management>) has changed. Toggle auto-update for individual marketplaces through the UI:
1. Run `/plugin` to open the plugin manager
2. Select **Marketplaces**
--- a/env-vars.md
+++ b/env-vars.md
@@ -307,6 +307,7 @@
`CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS`| Maximum time in milliseconds that [non-interactive mode](</docs/en/headless#background-tasks-at-exit>) with the `-p` flag waits after the final turn for background subagents and workflows whose result is part of the output. Default: `600000`, or 10 minutes. When the cap is exceeded, remaining background tasks are terminated and the process exits. Set to `0` to wait indefinitely. This cap is separate from the five-second grace period that applies to plain background shells
`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
`CLAUDE_CODE_PROPAGATE_TRACEPARENT`| Set to `1` to propagate W3C trace context when `ANTHROPIC_BASE_URL` points at a custom proxy. Propagation covers the `traceparent` header on model and HTTP MCP requests and the `TRACEPARENT` environment variable for Bash, PowerShell, and hook subprocesses. By default, propagation is enabled only when connected directly to the Anthropic API. Added in v2.1.152. See [Traces (beta)](</docs/en/monitoring-usage#traces-beta>)
`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`| Set by host platforms that embed Claude Code and manage model provider routing on its behalf. When set, Claude Code ignores provider-selection, endpoint, and authentication variables such as `CLAUDE_CODE_USE_BEDROCK`, `ANTHROPIC_BASE_URL`, and `ANTHROPIC_API_KEY` in settings files, so user settings can’t override the host’s routing. Claude Code also ignores model-selection keys such as `model`, `fallbackModel`, and `modelOverrides` in [managed settings](</docs/en/managed-settings>), whichever managed source delivers them, so the host’s model configuration takes precedence over an out-of-date managed model pin. Claude Code also ignores model-selection variables such as `ANTHROPIC_MODEL` and the `ANTHROPIC_DEFAULT_*_MODEL` family in a managed `env` block; an [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist in managed settings still applies unless the host supplies its own. Claude Code also skips the automatic telemetry opt-out it otherwise applies on third-party providers such as Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, so telemetry follows the standard `DISABLE_TELEMETRY` opt-out. See [Default behaviors by API provider](</docs/en/data-usage#default-behaviors-by-api-provider>)
`CLAUDE_CODE_PROXY_RESOLVES_HOSTS`| Set to `1` to allow the proxy to perform DNS resolution instead of the caller. Opt-in for environments where the proxy should handle hostname resolution
@@ -336,6 +337,7 @@
`CLAUDE_CODE_SKIP_VERTEX_AUTH`| Skip Google authentication for Google Cloud’s Agent Platform (for example, when using an LLM gateway)
`CLAUDE_CODE_STOP_HOOK_BLOCK_CAP`| Maximum number of consecutive times a [Stop](</docs/en/hooks#stop>) or [SubagentStop](</docs/en/hooks#subagentstop>) hook may block the turn from ending before Claude Code overrides it and ends the turn anyway (default: 8). Set to `0` to disable the cap. Raise this if your hook legitimately needs more iterations to resolve
`CLAUDE_CODE_SUBAGENT_MODEL`| The model Claude Code uses for all [subagents](</docs/en/sub-agents#choose-a-model>), [agent teams](</docs/en/agent-teams>), and agents in a [workflow](</docs/en/workflows>). Accepts an alias such as `haiku` or a full model name, and takes precedence over the per-invocation `model` parameter and the subagent definition’s `model` frontmatter. See [Model configuration](</docs/en/model-config#environment-variables>). Setting it to `inherit` is the same as leaving it unset; before v2.1.196, `inherit` was an override that forced every subagent onto the main conversation’s model
+`CLAUDE_CODE_SUBAGENT_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 requests outside the main conversation, such as [subagents](</docs/en/sub-agents>), workflows, and background work. Takes precedence over the `subagentPromptCacheTtl` 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
`CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`| Set to `1` to strip Anthropic and cloud provider credentials from subprocess environments (Bash tool, hooks, MCP stdio servers). The parent Claude process keeps these credentials for API calls, but child processes cannot read them, reducing exposure to prompt injection attacks that attempt to exfiltrate secrets via shell expansion. On Linux, this also runs Bash subprocesses in an isolated PID namespace so they cannot read host process environments via `/proc`; as a side effect, `ps`, `pgrep`, and `kill` cannot see or signal host processes. `claude-code-action` sets this automatically when `allowed_non_write_users` is configured
`CLAUDE_CODE_SYNC_PLUGIN_INSTALL`| Set to `1` in non-interactive mode (the `-p` flag) to wait for plugin installation to complete before the first query. Without this, plugins install in the background and may not be available on the first turn. Combine with `CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS` to bound the wait
`CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS`| Timeout in milliseconds for synchronous plugin installation. When exceeded, Claude Code proceeds without plugins and logs an error. No default: without this variable, synchronous installation waits until complete
@@ -394,13 +396,13 @@
`DISABLE_UPGRADE_COMMAND`| Set to `1` to hide the `/upgrade` command
`DO_NOT_TRACK`| Set to `1` to opt out of telemetry, with the same effect as `DISABLE_TELEMETRY`, including making [Remote Control](</docs/en/remote-control#requirements>) and the other features that need feature-flag fetching unavailable. Claude Code reads this variable as a standard boolean, so `0` leaves telemetry on, and honors it as the cross-tool convention recognized by many developer CLIs
`ENABLE_CLAUDEAI_MCP_SERVERS`| Set to `false` to disable [claude.ai MCP servers](</docs/en/mcp#use-mcp-servers-from-claude-ai>) in Claude Code. Enabled by default for logged-in users. To disable per-project or per-org, set [`disableClaudeAiConnectors`](</docs/en/settings-reference#disableclaudeaiconnectors>) in settings instead
-`ENABLE_PROMPT_CACHING_1H`| Set to `1` to request a 1-hour [prompt cache TTL](</docs/en/prompt-caching#cache-lifetime>) instead of the default 5 minutes. Intended for API key, [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) users. Subscription users within included usage receive 1-hour TTL automatically. Subscription users drawing on [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) can set it to keep the 1-hour TTL. 1-hour cache writes are billed at a higher rate
+`ENABLE_PROMPT_CACHING_1H`| Set to `1` to request a 1-hour [prompt cache TTL](</docs/en/prompt-caching#cache-lifetime>) instead of the default 5 minutes. Intended for API key, [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) users. Subscription users within included usage receive the 1-hour TTL automatically on the [main conversation](</docs/en/prompt-caching#which-ttl-each-request-gets>). Subscription users drawing on [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) can set it to keep the 1-hour TTL. 1-hour cache writes are billed at a higher rate. To choose the TTL per request bucket instead, use `CLAUDE_CODE_PROMPT_CACHE_TTL` and `CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL`, which take precedence over this variable
`ENABLE_PROMPT_CACHING_1H_BEDROCK`| Deprecated. Use `ENABLE_PROMPT_CACHING_1H` instead
`ENABLE_TOOL_SEARCH`| Controls [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>). Unset, Claude Code defers all MCP tools by default. It still loads them upfront on Google Cloud’s Agent Platform models earlier than the Claude 4.5 generation, on a Microsoft Foundry deployment hosted on Azure, and when `ANTHROPIC_BASE_URL` points to a non-first-party host. `true` always defers and sends the beta header, except on those same Agent Platform models and Microsoft Foundry deployments; requests fail on proxies that don’t support `tool_reference`. `auto` loads upfront when tool definitions fit within 10% of context. `auto:N` sets a custom threshold, such as `auto:5` for 5%. `false` loads all tools upfront. A value you set yourself is ignored when `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` is set. Before v2.1.221, Claude Code disabled tool search for all models on Google Cloud’s Agent Platform unless you set this variable to `true`
`FALLBACK_FOR_ALL_PRIMARY_MODELS`| Set to any non-empty value, such as `1`, to make every model stop retrying with a repeated-overload error when no fallback model is configured. **Setting it to`0` or `false` still enables this**, unlike most on/off variables; unset the variable to restore the default retry behavior. Without it, models Claude Code recognizes as Opus, Fable 5, or Mythos models stop retrying this way when you authenticate with an API key or a [third-party provider](</docs/en/third-party-integrations>) rather than a Claude subscription. As of v2.1.160, a configured [fallback model chain](</docs/en/model-config#fallback-model-chains>) triggers on repeated overload errors for any primary model, so this variable does not affect switching to a fallback model
`FORCE_AUTOUPDATE_PLUGINS`| Set to `1` to force plugin auto-updates even when the main auto-updater is disabled via `DISABLE_AUTOUPDATER`
`FORCE_HYPERLINK`| Set to `1` to enable clickable OSC 8 hyperlinks when your terminal supports them but isn’t auto-detected, or `0` to disable them. When unset, Claude Code enables hyperlinks only when it detects terminal support. Claude Code parses this value as a number, not a Boolean, so a value such as `false`, `no`, or `off` enables hyperlinks rather than disabling them. Claude Code renders the footer [PR or merge request badge](</docs/en/interactive-mode#pr-review-status>) as a hyperlink even when it can’t detect terminal support, such as over SSH. Set `0` to render the badge as plain text
-`FORCE_PROMPT_CACHING_5M`| Set to `1` to force the 5-minute prompt cache TTL even when 1-hour TTL would otherwise apply. Overrides `ENABLE_PROMPT_CACHING_1H`
+`FORCE_PROMPT_CACHING_5M`| Set to `1` to force the 5-minute prompt cache TTL even when 1-hour TTL would otherwise apply. Overrides `CLAUDE_CODE_PROMPT_CACHE_TTL`, `CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL`, `ENABLE_PROMPT_CACHING_1H`, and the `promptCacheTtl` and `subagentPromptCacheTtl` settings
`HTTP_PROXY`| Specify HTTP proxy server for network connections
`HTTPS_PROXY`| Specify HTTPS proxy server for network connections
`IS_DEMO`| Set to any non-empty value, such as `1`, to enable demo mode: hides your email and organization name from the header and `/status` output, and skips onboarding. **Setting it to`0` or `false` still enables demo mode**, unlike most on/off variables; unset the variable to turn it off. Useful when streaming or recording a session
@@ -476,6 +478,7 @@
* Read or reply to [comments on an artifact](</docs/en/artifacts#collect-comments-on-an-artifact>), unless you set `CLAUDE_CODE_ARTIFACT_COMMENTS=1`; for Claude to reply to sent comments on its own, also set `CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT=1`. Neither override helps under `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, which [turns artifacts off entirely](</docs/en/artifacts#availability>)
* Have Claude Code refresh the [PR review status badge](</docs/en/interactive-mode#pr-review-status>) less often while you’re idle; Claude Code refreshes it every 60 seconds instead
* 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`
+ * Get the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) by default for claude.ai and Console accounts on Windows with Git Bash installed; Claude Code routes shell commands through Git Bash unless you set `CLAUDE_CODE_USE_POWERSHELL_TOOL=1`. On Windows without Git Bash, the tool stays on
With fetching off, you can still type `/code-review` yourself, but [Claude can’t start the review on its own, and a scheduled `/code-review` reaches Claude as plain text](</docs/en/code-review#let-claude-start-the-review>) instead of running the review.
--- a/errors.md
+++ b/errors.md
@@ -26,7 +26,7 @@
`Auto mode classifier transcript exceeded context window`| Server errors
`Agent aborted: auto mode classifier request refused by the safety safeguard`| Server errors
`Agent terminated early due to an API error`| Server errors
-`You've hit your session limit` / `You've hit your weekly limit`| Usage limits
+`You've hit your session limit` / `You've hit your weekly limit` / `You've hit your Opus limit` / `You've hit your Sonnet limit`| Usage limits
`Usage credits required for 1M context`| Usage limits
`the prompt to confirm went unanswered — nothing was sent`| Usage limits
`Server is temporarily limiting requests`| Usage limits
@@ -201,6 +201,7 @@
* A failure that arrives after Claude has finished the response: nothing needs retrying, so Claude Code keeps the complete response and ends the turn normally.
* An Amazon Bedrock streaming response with an unexpected content-type, because the gateway or proxy rewriting the response would rewrite the retry the same way. Requires Claude Code v2.1.208 or later.
* A non-streaming retry of a failed streaming request that gets a success status but no Claude API message in the body. Claude Code ends the turn with that error.
+ * A request that your organization’s policy check denied, which surfaces as an `API Error:` line carrying the denial message. Your organization’s administrators set up the check with [Inference hooks](<https://platform.claude.com/docs/en/manage-claude/inference-hooks>), a Claude Enterprise feature, and the message ends with the instructions they configured, or by default tells you to contact them. Claude Code doesn’t re-send the denied request to the same model or to a [fallback model](</docs/en/model-config#fallback-model-chains>), because the denial is about the request’s content rather than the model. Before v2.1.239, Claude Code could re-send a denied request, without streaming or on a configured fallback model, before showing you the denial.
###
@@ -404,12 +405,13 @@
You've hit your session limit · resets 3:45pm
You've hit your weekly limit · resets Mon 12:00am
You've hit your Opus limit · resets 3:45pm
-
-Claude Code blocks further requests until the reset time shown in the message. The session and weekly limits are shared across all models, so switching models doesn’t restore access. The Opus limit applies only to Opus requests, so switching to another model with `/model` keeps you working. Usage counts against the session and weekly allowances at the same time. A single burst of heavy activity, such as a large workflow fanout, can exhaust the weekly allowance before the session window resets. **What to do:**
+ You've hit your Sonnet limit · resets 3:45pm
+
+Claude Code blocks further requests until the reset time shown in the message. The session and weekly limits are shared across all models, so switching models doesn’t restore access. The Opus and Sonnet limits each apply only to requests to that model family, so switching to a model outside the family with `/model` keeps you working. In an interactive session signed in with a claude.ai subscription, Claude Code can also wait in the open session and continue the interrupted task shortly after the reset. While it waits, a line at the bottom of the session reads `Usage limit reached · continuing automatically at 3:45pm · esc to cancel`. Press `Esc` at an empty prompt to cancel the wait. See [Wait for a usage limit to reset](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>) for what you see, how to start or cancel a wait, and how to turn automatic continue off. Before v2.1.234, Claude Code didn’t offer this wait. Usage counts against the session and weekly allowances at the same time. A single burst of heavy activity, such as a large workflow fanout, can exhaust the weekly allowance before the session window resets. **What to do:**
* Wait for the reset time shown in the error
- * In the Code tab of the [Desktop app](</docs/en/desktop>), the session-limit card shows an **Auto-continue when limits reset** checkbox. The weekly-limit card doesn’t offer it. When it’s checked, the Desktop app retries the interrupted turn after the reset and shows the retry time on the card. Uncheck it to turn this off for your account.
- * For the Opus limit, run `/model` and switch to another model to keep working
+ * In the Code tab of the [Desktop app](</docs/en/desktop>), the session-limit card offers an **Auto-continue when limits reset** checkbox. The weekly-limit card doesn’t. When it’s checked, the Desktop app retries the interrupted turn after the reset and shows the retry time on the card. The Desktop checkbox and the CLI’s **Continue automatically at usage limit** setting in `/config` are separate, so turn each off on its own.
+ * For the Opus or Sonnet limit, run `/model` and switch to a model outside that family to keep working. Each model has its own prompt cache, so the next request re-reads the whole conversation with no cache hits; see [Switching models](</docs/en/prompt-caching#switching-models>)
* Run `/usage` to see your plan limits and when they reset
* Run `/usage-credits` to buy additional usage on Pro and Max, or to request it from your admin on Team and Enterprise. See [usage credits for paid plans](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) for how this is billed.
* To upgrade your plan for higher base limits, see [claude.com/pricing](<https://claude.com/pricing>)
@@ -1095,7 +1097,7 @@
A proxy or security appliance on your network is intercepting TLS traffic with its own certificate, and Claude Code does not trust it.
Unable to connect to API: SSL certificate verification failed. Check your proxy or corporate SSL certificates
- Unable to connect to API: Self-signed certificate detected
+ Unable to connect to API: Self-signed certificate detected. Check your proxy or corporate SSL certificates
As of v2.1.199, a certificate validation failure isn’t retried, so this error appears on the first attempt instead of after the full retry budget. Earlier versions spent a few minutes retrying before showing it. Transient TLS conditions, such as a handshake timeout, still retry. During `/login` and the startup connectivity check, the same failure is reported with the OpenSSL code and the fix inline:
--- a/github-enterprise-server.md
+++ b/github-enterprise-server.md
@@ -95,7 +95,7 @@
Network requirements
-For Anthropic-hosted sessions, your GHES instance must be reachable from Anthropic infrastructure so Claude can clone repositories and post review comments. If your GHES instance is behind a firewall, allowlist the [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>). Sessions in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#configure-git>) clone from inside your network instead, unless the runner opts into the [Anthropic git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), which fetches from Anthropic’s side and needs the same reachability; the [SCM connector](</docs/en/self-hosted-environments-reference#scm-connector-flags>) covers the hosted pre-session flows, such as the repository picker, for a GHES host that’s only routable internally.
+For Anthropic-hosted sessions, your GHES instance must be reachable from Anthropic infrastructure so Claude can clone repositories and post review comments. If your GHES instance is behind a firewall, allowlist Anthropic’s [outbound IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses#outbound-ip-addresses>). Sessions in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#configure-git>) clone from inside your network instead, unless the runner opts into the [Anthropic git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), which fetches from Anthropic’s side and needs the same reachability; the [SCM connector](</docs/en/self-hosted-environments-reference#scm-connector-flags>) covers the hosted pre-session flows, such as the repository picker, for a GHES host that’s only routable internally.
##
@@ -248,7 +248,7 @@
GHES instance not reachable
-If reviews or Anthropic-hosted web sessions time out, your GHES instance may not be reachable from Anthropic infrastructure. Confirm your firewall allows inbound connections from the [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>). Sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) reach GHES from inside your network, so for them check the runner’s own network path and the [SCM connector](</docs/en/self-hosted-environments-reference#scm-connector-flags>) instead.
+If reviews or Anthropic-hosted web sessions time out, your GHES instance may not be reachable from Anthropic infrastructure. Confirm your firewall allows inbound connections from Anthropic’s [outbound IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses#outbound-ip-addresses>). Sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) reach GHES from inside your network, so for them check the runner’s own network path and the [SCM connector](</docs/en/self-hosted-environments-reference#scm-connector-flags>) instead.
###
--- a/google-vertex-ai.md
+++ b/google-vertex-ai.md
@@ -139,7 +139,7 @@
* `VERTEX_REGION_CLAUDE_*`: Claude Code falls back to `CLOUD_ML_REGION`.
* `CLOUD_ML_REGION`: Claude Code falls back to `us-east5`.
-[Prompt caching](</docs/en/prompt-caching>) is enabled automatically. To disable it, set `DISABLE_PROMPT_CACHING=1`. To request a 1-hour cache TTL instead of the 5-minute default, set `ENABLE_PROMPT_CACHING_1H=1`; cache writes with a 1-hour TTL are billed at a higher rate. For heightened rate limits, contact Google Cloud support. When using Google Cloud’s Agent Platform, the `/logout` command is unavailable since authentication is handled through Google Cloud credentials. Claude Code decides between [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>) and upfront loading by model generation:
+[Prompt caching](</docs/en/prompt-caching>) is enabled automatically. To disable it, set `DISABLE_PROMPT_CACHING=1`. To request a 1-hour cache TTL instead of the 5-minute default, set `ENABLE_PROMPT_CACHING_1H=1`; cache writes with a 1-hour TTL are billed at a higher rate. To set different TTLs for your main conversation and for the requests Claude Code makes outside it, [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>). To raise your rate limits, contact Google Cloud support. When using Google Cloud’s Agent Platform, the `/logout` command is unavailable since authentication is handled through Google Cloud credentials. Claude Code decides between [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>) and upfront loading by model generation:
* **Claude Opus 4.5, Sonnet 4.5, Haiku 4.5, and later** : Claude Code enables tool search by default.
* **Earlier models, including all Claude 3.x models** : Claude Code loads MCP tool definitions upfront, because their Agent Platform serving stacks reject the required beta header. Setting `ENABLE_TOOL_SEARCH=true` doesn’t override this.
--- a/hooks-guide.md
+++ b/hooks-guide.md
@@ -170,8 +170,11 @@
`elicitation_response`| An MCP elicitation response is sent back to the server
`agent_needs_input`| A background session starts waiting on your input. Fires only while [agent view](</docs/en/agent-view>) is open
`agent_completed`| A background session finishes or fails. Fires only while [agent view](</docs/en/agent-view>) is open
-
-Claude Code times `permission_prompt` differently in a terminal and in Claude Desktop, the VS Code extension, and other hosts that answer permission requests through the Agent SDK. See [when each notification type fires](</docs/en/hooks#notification>) for both timings. The `agent_needs_input` and `agent_completed` matchers require Claude Code v2.1.198 or later. Type `/hooks` and select `Notification` to confirm the hook is registered. For the full event schema, see the [Notification reference](</docs/en/hooks#notification>).
+`quota_auto_resume_fired`| Claude Code continues your task after a claude.ai usage limit paused it: at the reset, or sooner when something you do in Claude Code during the wait, such as adding usage credits, upgrading your plan, or switching models, makes usage available again, with the [model-setting exception](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>)
+`quota_auto_resume_stale`| A claude.ai usage limit reset while your computer slept for more than about 30 minutes. Claude Code waits for you to press `Enter` instead of continuing. After a shorter sleep it continues and fires `quota_auto_resume_fired` instead
+`quota_auto_resume_disabled`| Claude Code ends its wait for a claude.ai usage limit without continuing your task: [`autoContinueAtUsageLimit`](</docs/en/settings-reference#autocontinueatusagelimit>) turned off or the reset moved more than 24 hours away during a wait Claude Code started on its own, the continued task kept hitting the limit, or the continuation was blocked before it reached the model. Doesn’t fire when you press `Esc` or `Ctrl+C`, or pick **Don’t continue automatically**
+
+Claude Code times `permission_prompt` differently in a terminal and in Claude Desktop, the VS Code extension, and other hosts that answer permission requests through the Agent SDK. See [when each notification type fires](</docs/en/hooks#notification>) for both timings. The `agent_needs_input` and `agent_completed` matchers require Claude Code v2.1.198 or later. The `quota_auto_resume_fired`, `quota_auto_resume_stale`, and `quota_auto_resume_disabled` matchers require Claude Code v2.1.234 or later. Type `/hooks` and select `Notification` to confirm the hook is registered. For the full event schema, see the [Notification reference](</docs/en/hooks#notification>).
###
@@ -631,7 +634,7 @@
`SessionStart`| how the session started| `startup`, `resume`, `clear`, `compact`, `fork`
`Setup`| which CLI flag triggered setup| `init`, `maintenance`
`SessionEnd`| why the session ended| `clear`, `resume`, `logout`, `prompt_input_exit`, `other`
-`Notification`| notification type| `permission_prompt`, `idle_prompt`, `auth_success`, `elicitation_dialog`, `elicitation_url_dialog`, `elicitation_complete`, `elicitation_response`, `agent_needs_input`, `agent_completed`
+`Notification`| notification type| `permission_prompt`, `idle_prompt`, `auth_success`, `elicitation_dialog`, `elicitation_url_dialog`, `elicitation_complete`, `elicitation_response`, `agent_needs_input`, `agent_completed`, `quota_auto_resume_fired`, `quota_auto_resume_stale`, `quota_auto_resume_disabled`
`SubagentStart`| agent type| `general-purpose`, `Explore`, `Plan`, or custom agent names
`PreCompact`, `PostCompact`| what triggered compaction| `manual`, `auto`
`SubagentStop`| agent type| same values as `SubagentStart`
@@ -762,7 +765,7 @@
[Skill](</docs/en/skills>) frontmatter| The rest of the session once the skill is invoked. See [Hooks in skills and agents](</docs/en/hooks#hooks-in-skills-and-agents>)| Yes, defined in the skill file
[Subagent](</docs/en/sub-agents>) frontmatter| While that subagent is running| Yes, defined in the subagent file
-Run [`/hooks`](</docs/en/hooks#the-%2Fhooks-menu>) in Claude Code to browse all configured hooks grouped by event. To disable hooks, set `"disableAllHooks": true` in your settings file. Claude Code reads the value left after [settings precedence](</docs/en/hooks#disable-or-remove-hooks>) applies, so a project’s settings file can override yours. Hooks configured in managed settings still run unless `disableAllHooks` is also set there. If you edit settings files directly while Claude Code is running, the file watcher normally picks up hook changes automatically.
+Run [`/hooks`](</docs/en/hooks#the-%2Fhooks-menu>) in Claude Code to browse all configured hooks grouped by event. To disable hooks, set `"disableAllHooks": true` in your settings file. Claude Code reads the value left after [settings precedence](</docs/en/hooks#disable-or-remove-hooks>) applies, so a project’s settings file can override yours. Hooks configured in managed settings still run unless `disableAllHooks` is also set there. For the full reach of each level, see [`disableAllHooks`](</docs/en/settings-reference#disableallhooks>). If you edit settings files directly while Claude Code is running, the file watcher normally picks up hook changes automatically.
##
--- a/interactive-mode.md
+++ b/interactive-mode.md
@@ -630,6 +630,64 @@
+Wait for a usage limit to reset
+
+When a claude.ai [usage limit](</docs/en/errors#youve-hit-your-session-limit>) stops Claude mid-task, Claude Code waits in the open session and continues the task on its own after the limit resets. Automatic continue is on by default in interactive sessions signed in with a claude.ai subscription. Requires Claude Code v2.1.234 or later. While Claude Code waits, a line at the bottom of the session shows when it will continue:
+
+ Usage limit reached · continuing automatically at 3:45pm · esc to cancel
+
+Keep the session open. What happens next depends on how the wait ends:
+
+ * **At the reset** : the line reads `continuing shortly`, then `Usage limit reset · continuing automatically`, and Claude Code sends Claude a fixed prompt to pick the task up where it stopped. It doesn’t resend your last message.
+ * **After your computer slept** : if it slept for more than about 30 minutes and the limit reset while it slept, the line reads `Your usage limit has reset · press enter to continue`. Press `Enter` to continue. After a shorter sleep, Claude Code continues on its own.
+ * **Early** : when you finish adding [usage credits](</docs/en/costs#add-usage-credits-to-your-subscription>) with `/usage-credits`, sign back in after `/upgrade`, or switch models with `/model` during the wait, Claude Code checks whether usage is available again and continues right away if it is. It doesn’t check after an upgrade or purchase you make in a browser on your own. Under [`opusplan`](</docs/en/model-config#opusplan-model-setting>) and other model settings that run plan mode on a different model, Claude Code waits for the reset instead.
+
+The continued task runs like any other turn. Claude Code still asks for [permissions](</docs/en/permissions>) as usual, so the task can stop on a prompt while you’re away. If it hits the limit again, Claude Code re-arms the wait on its own at most twice in a row, then stops and shows `Automatic continue stopped after repeated usage-limit hits · /rate-limit-options to try again`.
+
+###
+
+
+
+Cancel the wait
+
+Press `Esc` at an empty prompt, or `Ctrl+C`, while the line shows, or run [`/rate-limit-options`](</docs/en/commands#all-commands>) and pick **Don’t continue automatically**. Claude Code confirms with a line that starts `Automatic continue cancelled`. After a cancel, nothing continues until you send a prompt or pick the row that starts **Wait here, then continue automatically** from `/rate-limit-options` again. Claude Code doesn’t start a wait on its own again for that reset window; the next reset window starts fresh. The wait also ends without continuing the task in these cases:
+
+ * **You send a prompt** : Claude Code runs your prompt instead of waiting.
+ * **You exit Claude Code** : the wait doesn’t restart when you resume the session.
+ * **The conversation changes hands** : you switch accounts with `/login`, clear or rewind the conversation, `/resume` another session, pull one with `/teleport`, relaunch with `/tui`, or hand the session to Claude Desktop, a background session, or the cloud.
+ * **The setting turns off, or the reset moves past 24 hours** : this ends only a wait Claude Code started on its own. A wait you picked from `/rate-limit-options` keeps counting down.
+ * **The continuation is blocked** : a [`UserPromptSubmit` hook](</docs/en/hooks#userpromptsubmit>) that blocks the continuation prompt, or a failure before it reaches the model, ends the wait. Claude Code tells you the continuation didn’t run. Send a prompt to continue.
+
+###
+
+
+
+Start a wait yourself
+
+Claude Code doesn’t start the wait on its own in these cases:
+
+ * **Remote Control and agent team teammate sessions** : a person at that terminal can still start one.
+ * **A reset more than 24 hours away** : a weekly limit can reset days out.
+ * **An Opus or Sonnet limit while you run a model outside that family** : your next turn may not hit that limit. [`opusplan`](</docs/en/model-config#opusplan-model-setting>) and other model settings that run plan mode on the limited family don’t get this exception.
+
+In those cases, and whenever automatic continue is off, Claude Code opens the usage-limit options menu once per reset window when you hit a limit at your own terminal. Pick the row that starts **Wait here, then continue automatically** to start the wait. In a [Remote Control](</docs/en/remote-control>) or [agent team](</docs/en/agent-teams>) teammate session, run `/rate-limit-options` yourself to open the menu. Claude Code doesn’t offer the wait at all in these cases:
+
+ * **Background sessions and`-p` runs**: the menu row isn’t available.
+ * **API keys, cloud providers, and usage-based billing** : usage there is metered per request, so there is no reset to wait for.
+ * **An[LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) without a saved claude.ai login**: Claude Code offers the wait only while a saved claude.ai login is the active credential.
+
+###
+
+
+
+Turn automatic continue off
+
+In `/config`, turn off **Continue automatically at usage limit** , or set [`autoContinueAtUsageLimit`](</docs/en/settings-reference#autocontinueatusagelimit>) to `false` in your user settings. `/config autoContinueAtUsageLimit=false` also works, including with `-p`, but the `key=value` form can’t turn it back on, because the setting grants unattended execution. Which settings files Claude Code reads for this key is in the [settings reference](</docs/en/settings-reference#autocontinueatusagelimit>).
+
+##
+
+
+
PR review status
When working on a branch with an open pull request, Claude Code displays a clickable PR link in the footer, such as “PR #446”. The link has a colored underline indicating the review state:
--- a/llm-gateway-connect.md
+++ b/llm-gateway-connect.md
@@ -317,7 +317,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. 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`: a success logs how many models were cached, 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 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`: a success logs how many models were cached, 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>).
###
@@ -500,7 +500,7 @@
`400` errors naming `context_management`, `Extra inputs are not permitted`, or other unrecognized fields| The gateway forwards requests to an upstream that rejects fields Claude Code sends to Anthropic-format endpoints| Set `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1`, which suppresses most pre-release fields; see [feature pass-through](</docs/en/llm-gateway-protocol#feature-pass-through>). Some betas aren’t gated by this flag; for those, set the matching `CLAUDE_CODE_USE_*` provider variable so Claude Code sends only what that provider accepts
`400` errors naming `thinking` or `adaptive`, such as `Input tag 'adaptive' found`| The upstream model build doesn’t accept adaptive reasoning, which Claude Code requests for Claude 4.6 and later models| Upgrade the gateway’s upstream. On Opus 4.6 and Sonnet 4.6, `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` works instead. The [model configuration](</docs/en/model-config>) capability variables apply only to the provider configurations, such as `CLAUDE_CODE_USE_BEDROCK` and `CLAUDE_CODE_USE_VERTEX`, not behind an `ANTHROPIC_BASE_URL` gateway
`400` errors stating a context or token limit in the gateway’s own words, such as `ContextWindowExceededError` or `prompt token count of N exceeds the limit of M`| The gateway enforces a smaller context than the model’s native window and rewrites the upstream error, so Claude Code doesn’t recognize it as a [too-long error](</docs/en/errors#prompt-is-too-long>) and doesn’t compact and retry automatically| Run `/compact` to recover the session. To prevent it, set `CLAUDE_CODE_AUTO_COMPACT_WINDOW` to the gateway’s limit; Claude Code clamps the value to at least 100,000 tokens and at most the model’s context window, so you can’t match a gateway limit below 100,000, and `/compact` remains the recovery there. Also set `CLAUDE_CODE_MAX_OUTPUT_TOKENS` below the gateway model’s output limit
-Models missing from the `/model` picker| Gateway model names aren’t in Claude Code’s built-in list| Enable gateway model discovery or add names with the [model configuration](</docs/en/model-config>) variables
+Models missing from the `/model` picker| Gateway model names aren’t in Claude Code’s built-in list, or Claude Code is showing a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup that replaces the built-in options| Enable gateway model discovery or add names with the [model configuration](</docs/en/model-config>) variables. If Claude Code shows a replacing `modelPicker` lineup, add the gateway models to it, or ask your administrator to add them when managed settings supply it
`/fast` reports `Fast mode unavailable due to network connectivity issues` while inference requests work| The [fast mode](</docs/en/fast-mode>) availability check goes directly to `api.anthropic.com` and doesn’t follow `ANTHROPIC_BASE_URL`, so blocked direct egress fails the check. The same message appears on an open network when the check presents a gateway-issued key from `ANTHROPIC_API_KEY` or an `apiKeyHelper` and Anthropic rejects it| Allowlist `api.anthropic.com` if egress is blocked, or set a skip variable; for a rejected gateway key only the skip variables help. See [use fast mode behind proxies and LLM gateways](</docs/en/fast-mode#use-fast-mode-behind-proxies-and-llm-gateways>)
`/fast` reports `Fast mode has been disabled by your organization` in a session authenticated with `ANTHROPIC_AUTH_TOKEN`, even though the organization has fast mode enabled| The availability check requires a claude.ai login or an Anthropic API key; with only a bearer token, Claude Code treats fast mode as disabled without sending the check| Set `CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK=1`; see [use fast mode behind proxies and LLM gateways](</docs/en/fast-mode#use-fast-mode-behind-proxies-and-llm-gateways>)
Claude Code asks you to log in even though the curl test succeeds| The CLI has no credential of its own: a reachable base URL isn’t one, and in an interactive session an `env` block in a project’s `.claude/settings.json` or `.claude/settings.local.json` applies only after the first-run wizard and [trust prompt](</docs/en/permissions#what-runs-before-you-trust-a-folder>)| Set `ANTHROPIC_AUTH_TOKEN` somewhere Claude Code reads before first-run setup: a shell export, the `env` block in `~/.claude/settings.json`, or managed settings
--- a/llm-gateway-protocol.md
+++ b/llm-gateway-protocol.md
@@ -164,7 +164,7 @@
Model discovery
-When `ANTHROPIC_BASE_URL` points at a gateway that exposes the Anthropic Messages format, Claude Code can query the gateway’s `/v1/models` endpoint at startup and add the returned models to the `/model` picker. Developers enable it by setting [`CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1`](</docs/en/env-vars>), in their own environment or through managed settings. Discovery is off by default so that gateways backed by a shared API key don’t surface every model the key can access to every user.
+When `ANTHROPIC_BASE_URL` points at a gateway that exposes the Anthropic Messages format, Claude Code can query the gateway’s `/v1/models` endpoint at startup and add the returned models to the `/model` picker. If you or your administrator set `replaceBuiltInOptions` in a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup, Claude Code hides the discovered models from the picker. Developers enable it by setting [`CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1`](</docs/en/env-vars>), in their own environment or through managed settings. Discovery is off by default so that gateways backed by a shared API key don’t surface every model the key can access to every user.
###
--- a/managed-mcp.md
+++ b/managed-mcp.md
@@ -126,7 +126,7 @@
Policy-based control with allowlists and denylists
-Allowlists and denylists filter which configured servers are allowed to load. They aren’t a registry: a server still has to be added by a user, a plugin, or `managed-mcp.json` before the allowlist or denylist applies to it. To deploy servers to users, use `managed-mcp.json`. Both lists also filter servers passed with the [`--mcp-config` CLI flag](</docs/en/cli-reference#cli-flags>); `--strict-mcp-config` limits which configuration files load and doesn’t bypass either list. To make the allowlist authoritative, set `allowedMcpServers` and `allowManagedMcpServersOnly: true` together in a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>), such as server-managed settings or a deployed `managed-settings.json` file. Restrict the allowlist to managed settings only shows the configuration. Without `allowManagedMcpServersOnly`, allowlists from every settings source merge, including a user’s own `~/.claude/settings.json`, so a user can broaden what your allowlist permits. Denylists merge from every source regardless.
+Allowlists and denylists filter which configured servers are allowed to load. They aren’t a registry: a server still has to be added by a user, a plugin, or `managed-mcp.json` before the allowlist or denylist applies to it. To deploy servers to users, use `managed-mcp.json`. Both lists also filter servers passed with the [`--mcp-config` CLI flag](</docs/en/cli-reference#cli-flags>); `--strict-mcp-config` limits which configuration files load and doesn’t bypass either list. To make the allowlist authoritative, set `allowedMcpServers` and `allowManagedMcpServersOnly: true` together in a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>), such as server-managed settings or a deployed `managed-settings.json` file. Restrict the allowlist to managed settings only shows the configuration. Without `allowManagedMcpServersOnly`, allowlists from every settings scope merge, including a user’s own `~/.claude/settings.json`, so a user can broaden what your allowlist permits. Denylists merge from every scope regardless.
`allowManagedMcpServersOnly` is separate from `allowManagedPermissionRulesOnly`, which locks down [permission rules](</docs/en/permissions#managed-settings>) only. Setting that flag does not enforce the MCP allowlist.
@@ -170,7 +170,7 @@
Before loading a server, including one from `managed-mcp.json`, Claude Code runs three checks in order:
- 1. **Merge the lists.** Allowlist and denylist entries from every settings source combine into one allowlist and one denylist. When `allowManagedMcpServersOnly` is `true`, only the managed allowlist is kept; the denylist always merges from every source.
+ 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 read from the one [managed source Claude Code selects](</docs/en/managed-settings#precedence-within-the-managed-tier>). 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.
3. **Check the allowlist.** If `allowedMcpServers` isn’t set anywhere, every server that passed the denylist loads. If it is set, what the server must match depends on its type, shown in the table below.
@@ -334,7 +334,7 @@
]
}
-When `allowManagedMcpServersOnly` is `true`, allowlists from user, project, and local settings are ignored. The denylist still merges from all sources, so users can always block servers for themselves.
+When `allowManagedMcpServersOnly` is `true`, allowlists from user, project, and local settings are ignored. The denylist still merges from every settings scope, so users can always block servers for themselves.
##
@@ -372,8 +372,8 @@
Surface| What it controls| Where it lives| How to deliver
---|---|---|---
`managed-mcp.json`| Fixed server set, exclusive control| System path: `/Library/Application Support/ClaudeCode/`, `/etc/claude-code/`, or `C:\Program Files\ClaudeCode\`| MDM, GPO, fleet management, or any process with administrator privileges. Cannot be set through server-managed settings
-`allowedMcpServers`| Allowlist of permitted servers| Any [settings file](</docs/en/settings#where-settings-live>); entries from every source merge unless `allowManagedMcpServersOnly` is set| For enforcement, a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>): server-managed settings, `managed-settings.json`, MDM profile, or registry
-`deniedMcpServers`| Denylist of blocked servers| Any settings file; entries from every source merge| Same as `allowedMcpServers`
+`allowedMcpServers`| Allowlist of permitted servers| Any [settings scope](</docs/en/settings#where-settings-live>); Claude Code merges the lists from every scope unless `allowManagedMcpServersOnly` is set, and takes the managed scope’s list from the one [managed source it selects](</docs/en/managed-settings#precedence-within-the-managed-tier>)| For enforcement, a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>): server-managed settings, `managed-settings.json`, MDM profile, or registry
+`deniedMcpServers`| Denylist of blocked servers| Any settings scope; Claude Code merges the lists from every scope and takes the managed scope’s list from the one managed source it selects| Same as `allowedMcpServers`
`allowManagedMcpServersOnly`| Locks the allowlist to managed sources only| Managed settings sources only; the setting has no effect elsewhere| Same as `allowedMcpServers`
`allowAllClaudeAiMcps`| Loads the claude.ai connectors Claude Code fetches itself alongside `managed-mcp.json`. Connectors delivered to cloud sessions stay suppressed| Managed settings sources only; the setting has no effect elsewhere| Same as `allowedMcpServers`
--- a/managed-settings.md
+++ b/managed-settings.md
@@ -108,6 +108,7 @@
* **Nested blocks** , such as `env` or `sandbox`: the two blocks merge key by key, and each key inside follows these same rules
* **`fallbackModel`** : the later chain replaces the earlier one whole
* **[`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>)** : a later entry with the same name replaces the earlier one whole
+ * **[`modelPicker`](</docs/en/settings-reference#modelpicker>)** : the later lineup replaces the earlier one whole
##
@@ -263,7 +264,7 @@
[`allowManagedPermissionRulesOnly`](</docs/en/settings-reference#allowmanagedpermissionrulesonly>)| Only managed permission rules apply; the entry lists every source it ignores
[`blockedMarketplaces`](</docs/en/settings-reference#blockedmarketplaces>)| Blocklist of marketplace sources. Blocked sources are checked before downloading, so they never touch the filesystem. See [managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>)
[`channelsEnabled`](</docs/en/settings-reference#channelsenabled>)| Allow [channels](</docs/en/channels>) for the organization. See [enterprise controls](</docs/en/channels#enterprise-controls>) for the default on each plan
-[`disableCommandPluginSources`](</docs/en/settings-reference#disablecommandpluginsources>)| When `true`, blocks [`command` plugin sources](</docs/en/plugin-marketplaces#command-sources>) entirely, so the marketplace-declared command never runs. When unset, follows `allowManagedHooksOnly`. Requires Claude Code v2.1.229 or later
+[`disableCommandPluginSources`](</docs/en/settings-reference#disablecommandpluginsources>)| When `true`, blocks [`command` plugin sources](</docs/en/plugin-marketplaces#command-sources>) entirely, so the marketplace-declared command never runs. Also blocks marketplace [`headersHelper` commands](</docs/en/plugin-marketplaces#authenticate-archive-downloads>), except for a marketplace that managed settings themselves declare. When unset, follows `allowManagedHooksOnly`. Requires Claude Code v2.1.229 or later, and the `headersHelper` block requires v2.1.238 or later
[`disableSideloadFlags`](</docs/en/settings-reference#disablesideloadflags>)| Reject the `--plugin-dir`, `--plugin-url`, `--agents`, and `--mcp-config` flags at startup. In cloud sessions, Claude Code drops the MCP servers the server delivered through `--mcp-config`, other than in-process `type: "sdk"` entries, and starts the session. Requires Claude Code v2.1.193 or later
[`forceRemoteSettingsRefresh`](</docs/en/settings-reference#forceremotesettingsrefresh>)| When `true`, blocks CLI startup until remote managed settings are freshly fetched and exits if the fetch fails. See [fail-closed enforcement](</docs/en/server-managed-settings#enforce-fail-closed-startup>)
[`parentSettingsBehavior`](</docs/en/settings-reference#parentsettingsbehavior>)| Whether host-supplied parent settings merge under the managed policy
--- a/microsoft-foundry.md
+++ b/microsoft-foundry.md
@@ -95,6 +95,8 @@
export ENABLE_PROMPT_CACHING_1H=1
+To set different TTLs for your main conversation and for the requests Claude Code makes outside it, [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>).
+
###
--- a/model-config.md
+++ b/model-config.md
@@ -177,7 +177,7 @@
* **`advisorModel` setting**: the advisor is disabled for the session
* **`--advisor` flag**: Claude Code exits with an error at launch. In a [background session](</docs/en/agent-view>), it starts the session without the advisor instead of exiting
-Claude Code hides excluded models from the `/model` picker. A full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. Model changes that Claude Code makes on your behalf are checked the same way:
+Claude Code hides excluded models from the `/model` picker. A full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row, unless Claude Code replaces the built-in options with a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. Model changes that Claude Code makes on your behalf are checked the same way:
* **Fallback model chains** : entries outside the allowlist are dropped
* **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model
@@ -357,7 +357,7 @@
Fallback model chains
-When the primary model is overloaded, unavailable, or returns another non-retryable server error, Claude Code can switch to a fallback model instead of failing the request. Authentication, billing, rate-limit, request-size, and transport errors never trigger a switch; those follow their normal retry and error handling. Configure one or more fallback models and Claude Code tries them in order, showing a notice when it switches. The switch lasts for the current turn only, so your next message tries the primary model first again. Claude Code caps chains at three models after duplicate removal and ignores extra entries. Set a chain for one session with the `--fallback-model` flag, which accepts a comma-separated list:
+When the primary model is overloaded, unavailable, or returns another non-retryable server error, Claude Code can switch to a fallback model instead of failing the request. Authentication, billing, rate-limit, request-size, and transport errors, and a [denial by your organization’s policy check](</docs/en/errors#automatic-retries>), never trigger a switch; those follow their normal retry and error handling. Configure one or more fallback models and Claude Code tries them in order, showing a notice when it switches. The switch lasts for the current turn only, so your next message tries the primary model first again. Claude Code caps chains at three models after duplicate removal and ignores extra entries. Set a chain for one session with the `--fallback-model` flag, which accepts a comma-separated list:
claude --fallback-model sonnet,haiku
@@ -635,13 +635,13 @@
Add a custom model option
-Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [gateway model discovery](</docs/en/llm-gateway-protocol#model-discovery>). This example sets all three variables to make a gateway-routed Opus deployment selectable. Claude Code reads environment variables at startup, so run the exports before launching `claude`, or restart an existing session to pick them up:
+Use `ANTHROPIC_CUSTOM_MODEL_OPTION` to add a single custom entry to the `/model` picker without replacing the built-in aliases. This is useful for testing model IDs that Claude Code does not list by default. For LLM gateway deployments, Claude Code can populate the picker from the gateway’s `/v1/models` endpoint when `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` is set, so this variable is needed only when discovery is disabled or does not return the model you want. See [gateway model discovery](</docs/en/llm-gateway-protocol#model-discovery>). To list several models instead, in your own order and under labels you choose, set [`modelPicker`](</docs/en/settings-reference#modelpicker>). Its entry says which rows the picker keeps when that lineup replaces the built-in one. This example sets all three variables to make a gateway-routed Opus deployment selectable. Claude Code reads environment variables at startup, so run the exports before launching `claude`, or restart an existing session to pick them up:
export ANTHROPIC_CUSTOM_MODEL_OPTION="my-gateway/claude-opus-5"
export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Opus via Gateway"
export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Custom deployment routed through the internal LLM gateway"
-The custom entry appears at the bottom of the `/model` picker. `ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If you omit the name, Claude Code uses the model ID; if you omit the description, Claude Code uses `Custom model (<model-id>)`. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well. Otherwise Claude Code filters the custom entry from the picker and rejects a `--model` selection of it like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-5`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior.
+`ANTHROPIC_CUSTOM_MODEL_OPTION_NAME` and `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION` are optional. If you omit the name, Claude Code uses the model ID; if you omit the description, Claude Code uses `Custom model (<model-id>)`. Claude Code lists the custom entry after the built-in entries, and any [`modelPicker`](</docs/en/settings-reference#modelpicker>) rows you append come after it. Claude Code skips validation for the model ID set in `ANTHROPIC_CUSTOM_MODEL_OPTION`, so you can use any string your API endpoint accepts. When `availableModels` is set, include the custom model ID in the allowlist as well. Otherwise Claude Code filters the custom entry from the picker and rejects a `--model` selection of it like any other excluded model. A custom ID that embeds a family name, such as `my-gateway/claude-opus-5`, counts as a specific entry for that family and disables its wildcard, so also list the versions you intend to keep selectable. See Merge behavior.
##
@@ -757,4 +757,4 @@
`DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for Opus models only
`DISABLE_PROMPT_CACHING_FABLE`| Set to `1` to disable prompt caching for Fable models only
-To change the cache TTL or learn what triggers a cache miss, see [How Claude Code uses prompt caching](</docs/en/prompt-caching>).
+To choose the cache TTL for the main conversation and for subagents separately, see [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>). For what triggers a cache miss, see [How Claude Code uses prompt caching](</docs/en/prompt-caching>).
--- a/network-config.md
+++ b/network-config.md
@@ -207,7 +207,15 @@
`formulae.brew.sh`| Update version checks on Homebrew installs. Other install methods don’t contact this host
`code.claude.com`| Claude Code documentation lookups by the built-in claude-code-guide agent and pre-approved WebFetch requests. Blocking this host only affects documentation lookups
-If you install Claude Code through npm or manage your own binary distribution, end users don’t need the native installer and auto-updater uses of `downloads.claude.ai`, but npm and bun installs need their package registry, `registry.npmjs.org`, unless your organization mirrors it. The other uses in the table apply regardless of install method. The two Datadog intake hosts carry only optional operational telemetry, and setting [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>) disables both. Sessions on third-party providers never send to these hosts, even when a platform sets [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>) and telemetry metrics default on. See [Telemetry services](</docs/en/data-usage#telemetry-services>) for everything Claude Code sends and how to disable it before finalizing your allowlist. When using [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or a signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) session, model traffic and authentication go to your provider or gateway instead of `api.anthropic.com`, `claude.ai`, or `platform.claude.com`. The WebFetch tool still calls `api.anthropic.com` for its [domain safety check](</docs/en/data-usage#webfetch-domain-safety-check>) unless you set `skipWebFetchPreflight: true` in [settings](</docs/en/settings>). When routing through an [LLM gateway](</docs/en/llm-gateway>) with [`ANTHROPIC_BASE_URL`](</docs/en/llm-gateway-connect#set-the-base-url-and-credential>), the [fast mode](</docs/en/fast-mode>) availability check still calls `api.anthropic.com` rather than the gateway base URL. The check does honor a configured HTTP proxy, so where a network block is the cause, an allowlist entry for `api.anthropic.com` in the proxy is the fix. A network block fails the check only where the host is unreachable even through the proxy, and fast mode then reports a connectivity error. The same connectivity error appears when the check presents a gateway-issued credential that Anthropic rejects; allowlisting doesn’t help there, since nothing is blocked. See [use fast mode behind proxies and LLM gateways](</docs/en/fast-mode#use-fast-mode-behind-proxies-and-llm-gateways>) for the variables that restore it. [Claude Code on the web](</docs/en/claude-code-on-the-web>) in Anthropic-hosted environments and [Code Review](</docs/en/code-review>) connect to your repositories from Anthropic-managed infrastructure; sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) connect from inside your network, unless the runner opts into the [Anthropic git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), which fetches from Anthropic’s side. If your GitHub Enterprise Cloud organization restricts access by IP address, enable [IP allow list inheritance for installed GitHub Apps](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#allowing-access-by-github-apps>). The Claude GitHub App registers its IP ranges, so enabling this setting allows access without manual configuration. To [add the ranges to your allow list manually](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#adding-an-allowed-ip-address>) instead, or to configure other firewalls, see the [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>). For self-hosted [GitHub Enterprise Server](</docs/en/github-enterprise-server>) instances behind a firewall, allowlist the same [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>) so Anthropic infrastructure can reach your GHES host to clone repositories and post review comments. Sessions in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#configure-git>) reach your GHES host from inside your network instead, so that exposure applies only to Anthropic-hosted sessions, to hosted pre-session flows such as the repository picker, and to self-hosted runners that opt into the [Anthropic git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), which fetches from Anthropic’s side. For a GHES host that’s only routable inside your network, the [SCM connector](</docs/en/self-hosted-environments-reference#scm-connector-flags>) carries the hosted pre-session flows over an outbound connection instead, so the allowlist isn’t needed for them.
+If you install Claude Code through npm or manage your own binary distribution, end users don’t need the native installer and auto-updater uses of `downloads.claude.ai`, but npm and bun installs need their package registry, `registry.npmjs.org`, unless your organization mirrors it. The other uses in the table apply regardless of install method. The two Datadog intake hosts carry only optional operational telemetry, and setting [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>) disables both. Sessions on third-party providers never send to these hosts, even when a platform sets [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>) and telemetry metrics default on. See [Telemetry services](</docs/en/data-usage#telemetry-services>) for everything Claude Code sends and how to disable it before finalizing your allowlist. When using [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or a signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) session, model traffic and authentication go to your provider or gateway instead of `api.anthropic.com`, `claude.ai`, or `platform.claude.com`. The WebFetch tool still calls `api.anthropic.com` for its [domain safety check](</docs/en/data-usage#webfetch-domain-safety-check>) unless you set `skipWebFetchPreflight: true` in [settings](</docs/en/settings>). When routing through an [LLM gateway](</docs/en/llm-gateway>) with [`ANTHROPIC_BASE_URL`](</docs/en/llm-gateway-connect#set-the-base-url-and-credential>), the [fast mode](</docs/en/fast-mode>) availability check still calls `api.anthropic.com` rather than the gateway base URL. The check does honor a configured HTTP proxy, so where a network block is the cause, an allowlist entry for `api.anthropic.com` in the proxy is the fix. A network block fails the check only where the host is unreachable even through the proxy, and fast mode then reports a connectivity error. The same connectivity error appears when the check presents a gateway-issued credential that Anthropic rejects; allowlisting doesn’t help there, since nothing is blocked. See [use fast mode behind proxies and LLM gateways](</docs/en/fast-mode#use-fast-mode-behind-proxies-and-llm-gateways>) for the variables that restore it.
+
+###
+
+
+
+GitHub allow lists and firewalls
+
+[Claude Code on the web](</docs/en/claude-code-on-the-web>) in Anthropic-hosted environments and [Code Review](</docs/en/code-review>) connect to your repositories from Anthropic-managed infrastructure; sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) connect from inside your network, unless the runner opts into the [Anthropic git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), which fetches from Anthropic’s side. If your GitHub Enterprise Cloud organization restricts access by IP address, enable [IP allow list inheritance for installed GitHub Apps](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#allowing-access-by-github-apps>) and also [add an allow list entry](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#adding-an-allowed-ip-address>) for Anthropic’s [outbound IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses#outbound-ip-addresses>). Inheritance covers only the requests the Claude GitHub App makes as an installation, not the requests it makes on your users’ behalf. For other firewalls, see the [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>). For self-hosted [GitHub Enterprise Server](</docs/en/github-enterprise-server>) instances behind a firewall, allowlist Anthropic’s [outbound IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses#outbound-ip-addresses>) so Anthropic infrastructure can reach your GHES host to clone repositories and post review comments. Sessions in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#configure-git>) reach your GHES host from inside your network instead, so that exposure applies only to Anthropic-hosted sessions, to hosted pre-session flows such as the repository picker, and to self-hosted runners that opt into the [Anthropic git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), which fetches from Anthropic’s side. For a GHES host that’s only routable inside your network, the [SCM connector](</docs/en/self-hosted-environments-reference#scm-connector-flags>) carries the hosted pre-session flows over an outbound connection instead, so the allowlist isn’t needed for them.
###
--- a/permission-modes.md
+++ b/permission-modes.md
@@ -163,13 +163,7 @@
* **Auto** : appears when your account meets the auto mode requirements
* **Bypass permissions** : requires the **Allow bypass permissions mode** toggle in Desktop settings on Pro and Max plans; on Team and Enterprise plans, organization policy controls it instead
-The Cowork tab doesn’t use these modes. Cowork has its own permission modes, enabled separately, and the Cowork tab shows no mode selector at all until a mode beyond its default is enabled for your account. See the [Cowork docs](<https://claude.com/docs/cowork/overview>).For desktop-specific details, see [Choose a permission mode](</docs/en/desktop#choose-a-permission-mode>) in the Desktop guide.**As a default** : set `defaultMode` in [settings](</docs/en/settings#where-settings-live>). The desktop app reads the same settings files as the CLI and applies the permission mode to new local sessions.A mode you pick in the mode selector is remembered per folder and takes precedence over `defaultMode` for that folder. Plan is the exception: picking it applies to the current session only.This example sets Plan mode as the default for new local sessions:
-
- {
- "permissions": {
- "defaultMode": "plan"
- }
- }
+The Cowork tab doesn’t use these modes. Cowork has its own permission modes, enabled separately, and the Cowork tab shows no mode selector at all until a mode beyond its default is enabled for your account. See the [Cowork docs](<https://claude.com/docs/cowork/overview>).For desktop-specific details, see [Choose a permission mode](</docs/en/desktop#choose-a-permission-mode>) in the Desktop guide.**As a default** : set `defaultMode` in [settings](</docs/en/settings#where-settings-live>). The desktop app reads the same settings files as the CLI and applies the permission mode to new local sessions.A mode you pick in the mode selector is remembered per folder and takes precedence over `defaultMode` for that folder. Plan is the exception: picking it applies to the current session only.For where `defaultMode` goes in a settings file, see the example under Start in a different permission mode.
Use the mode dropdown next to the prompt box on [claude.ai/code](<https://claude.ai/code>) or in the mobile app. Permission prompts appear in claude.ai for approval. Which modes appear depends on where the session runs:
@@ -225,13 +219,7 @@
Set plan mode as the default
-To make plan mode the default for a project’s terminal sessions, set `defaultMode` in `.claude/settings.json`. Conversations the [VS Code extension](</docs/en/vs-code>) starts don’t read project settings for the starting permission mode. There, set `claudeCode.initialPermissionMode` to `plan` in your VS Code user settings instead. This example sets the project default:
-
- {
- "permissions": {
- "defaultMode": "plan"
- }
- }
+To make plan mode the default for a project’s terminal sessions, set `defaultMode` to `plan` in `.claude/settings.json`, placed as the example under Start in a different permission mode shows. Conversations the [VS Code extension](</docs/en/vs-code>) starts don’t read project settings for the starting permission mode. There, set `claudeCode.initialPermissionMode` to `plan` in your VS Code user settings instead.
##
@@ -250,7 +238,7 @@
* **Model** : on the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Claude Opus 4.6 or later, Sonnet 4.6 or later, or [Fable 5](</docs/en/model-config#work-with-fable-5>). On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, only Claude Sonnet 5, Opus 4.7 or later, and Fable 5. Older models, including Sonnet 4.5, Opus 4.5, Haiku, and claude-3 models, are not supported on any provider.
* **Provider** : available by default on the Anthropic API, Claude Platform on AWS, Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in Claude apps gateway sessions.
-If Claude Code reports auto mode as unavailable, one of these requirements is unmet; this is not a transient outage. A separate message that names a model and says auto mode “cannot determine the safety” of an action means a classifier request failed; that failure is usually transient, but on Amazon Bedrock it can repeat until your account can invoke the named model. See the [error reference](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) for the causes and what to do. If you set `defaultMode: "auto"` in [settings](</docs/en/settings-reference#all-settings>) and a terminal session starts in Manual mode with no error, the setting is likely in `.claude/settings.json` or `.claude/settings.local.json`. In Claude Code v2.1.142 and later, `auto` doesn’t take effect from those files. Move it to `~/.claude/settings.json`. For a conversation the VS Code extension started, check the extension’s own list in Switch permission modes instead.
+If Claude Code reports auto mode as unavailable, one of these requirements is unmet; this is not a transient outage. A separate message that names a model and says auto mode “cannot determine the safety” of an action means a classifier request failed; that failure is usually transient, but on Amazon Bedrock it can repeat until your account can invoke the named model. See the [error reference](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) for the causes and what to do. If you set `defaultMode: "auto"` in [settings](</docs/en/settings-reference#all-settings>) and a terminal session starts in Manual mode with no error, the setting is likely in `.claude/settings.json` or `.claude/settings.local.json`. `auto` doesn’t take effect from those files. Move it to `~/.claude/settings.json`. For a conversation the VS Code extension started, check the extension’s own list in Switch permission modes instead.
###
--- a/plugin-dependencies.md
+++ b/plugin-dependencies.md
@@ -1,4 +1,4 @@
-A plugin can depend on other plugins by listing them in `plugin.json` or in its marketplace entry. By default, a dependency tracks the latest available version, so an upstream release can change the dependency under your plugin without warning. Version constraints let you hold a dependency at a tested version range until you choose to move. When you install a plugin that declares dependencies, Claude Code resolves and installs them automatically. If a dependency later goes missing, `/reload-plugins` and the background plugin auto-update reinstall it, provided its marketplace is already in your configured marketplaces. Re-running `claude plugin install` on the dependent plugin, or adding a marketplace with `claude plugin marketplace add`, also resolves any outstanding missing dependencies. Dependencies from a marketplace you have not added are left unresolved. This guide is for plugin authors who declare dependencies in `plugin.json` and for marketplace maintainers who tag releases. Dependencies here are other plugins; for the npm and Bun packages a plugin itself uses, see [Node.js package dependencies](</docs/en/plugins-reference#node-js-package-dependencies>). To install plugins that have dependencies, see [Discover and install plugins](</docs/en/discover-plugins>). For the full manifest schema, see the [Plugins reference](</docs/en/plugins-reference>).
+A plugin can depend on other plugins by listing them in `plugin.json` or in its marketplace entry. By default, a dependency tracks the latest available version, so an upstream release can change the dependency under your plugin without warning. Version constraints let you hold a dependency at a tested version range until you choose to move. When you install a plugin that declares dependencies, Claude Code resolves and installs them automatically, apart from a dependency whose marketplace entry has a [`command` source](</docs/en/plugin-marketplaces#how-users-accept-the-command>) or a [`headersHelper`](</docs/en/plugin-marketplaces#how-users-accept-a-headershelper-command>), which you install yourself first. If a dependency later goes missing, `/reload-plugins` and the background plugin auto-update reinstall it, provided its marketplace is already in your configured marketplaces. Re-running `claude plugin install` on the dependent plugin, or adding a marketplace with `claude plugin marketplace add`, also resolves any outstanding missing dependencies. Dependencies from a marketplace you have not added are left unresolved. This guide is for plugin authors who declare dependencies in `plugin.json` and for marketplace maintainers who tag releases. Dependencies here are other plugins; for the npm and Bun packages a plugin itself uses, see [Node.js package dependencies](</docs/en/plugins-reference#node-js-package-dependencies>). To install plugins that have dependencies, see [Discover and install plugins](</docs/en/discover-plugins>). For the full manifest schema, see the [Plugins reference](</docs/en/plugins-reference>).
##
@@ -117,7 +117,7 @@
The resolved tag’s semver is recorded separately from `plugin.json`’s `version`, so constraint checks use the tag that was actually fetched even if `plugin.json` at that commit has a stale value. The cache directory name for a tag-resolved install includes a 12-character commit-SHA suffix, so if a maintainer force-moves a tag to a different commit, the next install gets a fresh cache directory instead of reusing stale content.
-For dependencies with an `npm`, `archive`, or `command` [plugin source](</docs/en/plugin-marketplaces#plugin-sources>), the constraint does not control which version is fetched, since tag-based resolution applies only to git-backed sources. The constraint is still checked at load time, and the dependent plugin is disabled with `dependency-version-unsatisfied` if the installed version does not satisfy it. For a `command` source, Claude Code checks the version in the dependency’s `plugin.json` and ignores the content-hash suffix; a dependency whose `plugin.json` sets no version satisfies no constraint, so set one before you constrain it. Claude Code never installs a dependency with a `command` source itself, so users [install it first](</docs/en/plugin-marketplaces#how-users-accept-the-command>).
+For dependencies with an `npm`, `archive`, or `command` [plugin source](</docs/en/plugin-marketplaces#plugin-sources>), the constraint does not control which version is fetched, since tag-based resolution applies only to git-backed sources. The constraint is still checked at load time, and the dependent plugin is disabled with `dependency-version-unsatisfied` if the installed version does not satisfy it. For a `command` source, Claude Code checks the version in the dependency’s `plugin.json` and ignores the content-hash suffix; a dependency whose `plugin.json` sets no version satisfies no constraint, so set one before you constrain it.Claude Code never installs a dependency with a `command` source itself, so users [install it first](</docs/en/plugin-marketplaces#how-users-accept-the-command>). Claude Code never runs the `headersHelper` on a dependency’s marketplace entry either, so users [install that plugin first](</docs/en/plugin-marketplaces#how-users-accept-a-headershelper-command>).
##
Show diff (236 lines)
--- a/plugin-marketplaces.md
+++ b/plugin-marketplaces.md
@@ -203,7 +203,7 @@
Plugin entries
-Each plugin entry in the `plugins` array describes a plugin and where to find it. You can include any field from the [plugin manifest schema](</docs/en/plugins-reference#plugin-manifest-schema>), such as `description`, `version`, `author`, `commands`, and `hooks`, plus these marketplace-specific fields: `source`, `category`, `tags`, `strict`, and `relevance`.
+Each plugin entry in the `plugins` array describes a plugin and where to find it. You can include any field from the [plugin manifest schema](</docs/en/plugins-reference#plugin-manifest-schema>), such as `description`, `version`, `author`, `commands`, and `hooks`, plus these marketplace-specific fields: `source`, `category`, `tags`, `strict`, `relevance`, `headers`, and `headersHelper`.
###
@@ -252,6 +252,13 @@
`mcpServers`| string|object| MCP server configurations or path to MCP config
`lspServers`| string|object| LSP server configurations or path to LSP config
+**Archive authentication fields:** Set these when the entry has an `archive` source on a server that requires credentials.
+
+Field| Type| Description
+---|---|---
+`headers`| object| HTTP headers Claude Code sends when it downloads this entry’s archive. Overrides the marketplace’s headers of the same name. Requires Claude Code v2.1.238 or later.
+`headersHelper`| string| Command that prints the HTTP headers for this entry’s archive download as one JSON object, for a credential that expires. See Authenticate archive downloads. The entry must also set `"strict": false`. Requires Claude Code v2.1.238 or later.
+
##
@@ -277,15 +284,7 @@
For example, a marketplace hosted at `acme-corp/plugin-catalog` (marketplace source) can list a plugin fetched from `acme-corp/code-formatter` (plugin source). The marketplace source and plugin source point to different repositories and are pinned independently.
-The git-based source types below are `github`, `url`, and `git-subdir`. When both `ref` and `sha` are set on any of them, the `sha` is the effective pin. Claude Code fetches and checks out the pinned commit directly. On most git hosts, including GitHub, GitLab, and Bitbucket, this means installation succeeds even if the branch or tag named by `ref` has since been deleted upstream, as long as the commit is still reachable from the repository. Some servers, such as AWS CodeCommit, don’t support fetching commits by SHA. On those servers the `ref` must still exist and the pinned commit must be reachable from it.
-
-If you distribute this marketplace through [Organization settings > Plugins](<https://claude.ai/admin-settings/plugins>) on a Team or Enterprise plan, different source rules apply:
-
- * The marketplace repository must be private or internal. Organization sync reads it through the Claude GitHub App or your organization’s GitHub Enterprise App.
- * Each plugin source must be of type `github`, `url`, or `git-subdir`, or a relative path within the marketplace repository.
- * A plugin source can be private in two cases: a github.com source that shares the marketplace repository’s owner, or a source on your organization’s GitHub Enterprise host with the GHE App installed on the repository. Organization sync fetches every other source without credentials, so github.com repositories under a different owner and repositories on other hosts, such as GitLab or Bitbucket, must be public.
-
-To include private plugins, place the plugin folders inside the marketplace repository and reference them with a relative path. Organization sync packages each plugin during distribution, so users never need access to a separate source repository. See [Manage plugins for your organization](<https://support.claude.com/en/articles/13837433>) for the admin workflow.
+The git-based source types below are `github`, `url`, and `git-subdir`. When both `ref` and `sha` are set on any of them, the `sha` is the effective pin. Claude Code fetches and checks out the pinned commit directly. On most git hosts, including GitHub, GitLab, and Bitbucket, this means installation succeeds even if the branch or tag named by `ref` has since been deleted upstream, as long as the commit is still reachable from the repository. Some servers, such as AWS CodeCommit, don’t support fetching commits by SHA. On those servers the `ref` must still exist and the pinned commit must be reachable from it. If you distribute plugins through **Organization settings > Plugins**, only some source types are allowed. See Distribute through organization settings.
###
@@ -494,7 +493,100 @@
`url`| string| Required. HTTPS URL of the zip archive. Claude Code rejects `http://` URLs, along with loopback, link-local, and cloud-metadata hosts. Every redirect hop must satisfy the same rules, or Claude Code refuses the download
`sha256`| string| Optional. SHA-256 digest of the archive as 64 hex characters, uppercase or lowercase. Claude Code verifies every download against it and refuses the install on a mismatch
-The `sha256` digest also serves as the plugin’s version when neither `plugin.json` nor the marketplace entry declares one. See [Version management](</docs/en/plugins-reference#version-management>). If you declare a `version`, that version string is the update signal, so after changing the zip and its digest, bump the version too, or users keep the cached copy. If you register the marketplace from a URL source with `headers`, such as an [`extraKnownMarketplaces` entry](</docs/en/settings-reference#extraknownmarketplaces>), Claude Code sends those headers with archive downloads whose URL shares the marketplace URL’s origin: the same scheme, host, and port. Claude Code downloads an archive on a different origin without the headers, and drops them when a redirect leaves the origin, so it never sends a marketplace credential to a third-party host.
+The `sha256` digest also serves as the plugin’s version when neither `plugin.json` nor the marketplace entry declares one. See [Version management](</docs/en/plugins-reference#version-management>). If you declare a `version`, that version string is the update signal, so after changing the zip and its digest, bump the version too, or users keep the cached copy.
+
+####
+
+
+
+Authenticate archive downloads
+
+To authenticate an archive download, such as a download from a private registry, set the HTTP headers Claude Code sends with it. Set `headers` on the `url` source you registered the marketplace from, such as an [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) entry. On Claude Code v2.1.238 or later, you can set it on the plugin’s entry instead, beside `source`. If the value you would put in `headers` is short-lived, such as a token your registry mints on request, set a `headersHelper` command in the same place instead. Claude Code runs the command and sends the JSON object it prints as that place’s headers. Requires Claude Code v2.1.238 or later. The place you choose decides which downloads get the headers and when Claude Code runs the command:
+
+Place| Downloads that get the headers| When Claude Code runs a `headersHelper` set there
+---|---|---
+Marketplace `url` source| Archive downloads on the marketplace URL’s origin, meaning the same scheme, host, and port| Before each fetch of the marketplace’s `marketplace.json` and before each archive download on that origin. Claude Code reuses one run’s output for up to 60 seconds
+Plugin entry| That entry’s download only| Only when a user installs or updates that one plugin by itself and accepts the command
+
+Where both places set a header of the same name, Claude Code sends the entry’s value. Within one place, a header the command prints overrides a header of the same name listed in `headers`.
+
+##### Add a headersHelper to a plugin entry
+
+This entry sets `headersHelper` beside `source`. It also sets `"strict": false`, which Claude Code requires of a `marketplace.json` entry that sets `headersHelper`. With `"strict": false`, the marketplace entry is the plugin’s entire definition, so a user can review what the plugin contains before accepting the command:
+
+ {
+ "name": "my-plugin",
+ "description": "Formatting commands for internal services",
+ "strict": false,
+ "commands": "./commands",
+ "source": {
+ "source": "archive",
+ "url": "https://registry.example.com/plugins/my-plugin-2.1.0.zip"
+ },
+ "headersHelper": "/opt/bin/mint-registry-token.sh"
+ }
+
+To check the entry, run `claude plugin install my-plugin@your-marketplace`. Claude Code shows you the command and the archive URL, and downloads the zip after you accept. Before v2.1.238, Claude Code downloaded an entry’s archive without its `headers` or `headersHelper`, so an install that relied on them failed with `HTTP 401 while downloading plugin archive from`, followed by the URL, with the registry’s status code in place of 401.
+
+####
+
+
+
+Write the headersHelper command
+
+Whether you set `headersHelper` on a marketplace’s `url` source or on a plugin entry, write the command to meet these requirements:
+
+ * **Command text** : at most 500 characters of printable ASCII, with no run of four or more spaces.
+ * **Output** : print one JSON object of header names and string values on stdout, then exit 0 within 10 seconds.
+ * **Shell and working directory** : Claude Code runs the command through `sh`, or `cmd.exe` on Windows, from the configuration directory, `~/.claude` or [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars#variables>). Give an absolute path or a command on `PATH`, because a relative path resolves against that directory, not the user’s project.
+ * **Variables Claude Code removes** : from the environment of a command set in a `marketplace.json` entry or in a project’s `.claude/settings.json` or `.claude/settings.local.json`, Claude Code removes every variable whose name contains a word such as `TOKEN`, `SECRET`, `KEY`, or `AUTH`, including `ANTHROPIC_API_KEY`. Claude Code doesn’t apply this removal to a command set in user settings, a `--settings` file, or managed settings.
+ * **Variables Claude Code sets** : `CLAUDE_CODE_MARKETPLACE_URL` and `CLAUDE_CODE_MARKETPLACE_NAME` for a `url` source’s command, and `CLAUDE_CODE_PLUGIN_NAME` and `CLAUDE_CODE_PLUGIN_ARCHIVE_URL` for an entry’s command. `CLAUDE_CODE_MARKETPLACE_NAME` is unset on the first fetch after a user adds a marketplace by URL, because that fetch is what supplies the name.
+
+A command that mints a bearer token prints an object like this one:
+
+ {"Authorization": "Bearer eyJhbGciOiJSUzI1NiJ9"}
+
+####
+
+
+
+When Claude Code skips a headersHelper command or drops its output
+
+Claude Code doesn’t run a `headersHelper` command, or drops headers that came from `headers` or from the command’s output, in these situations:
+
+ * **Command fails** : if the command exits non-zero, runs past 10 seconds, or prints anything other than a JSON object of string values, Claude Code doesn’t make the fetch or download it ran the command for.
+ * **Marketplace URL doesn’t start with`https://`**: Claude Code doesn’t run that `url` source’s command and sends only the headers listed in its `headers` field.
+ * **Redirect leaves the origin** : when a download is redirected off the archive URL’s origin, Claude Code drops the `headers` values and command output of both the marketplace `url` source and the plugin entry.
+ * **Entry sets a routing or identity header** : Claude Code drops request-routing and client-identity names such as `Host`, `Cookie`, and `X-Forwarded-*` from an entry’s `headers` and command output, and keeps authentication names such as `Authorization`. Claude Code filters every `marketplace.json` entry this way, and an [inline settings entry](</docs/en/settings-reference#extraknownmarketplaces>) depending on which file declares it.
+ * **Command set in an`--add-dir` directory’s settings**: Claude Code ignores it, on a `url` source and on an [inline plugin entry](</docs/en/settings-reference#extraknownmarketplaces>) alike, and sends only that file’s `headers`.
+ * **Managed settings block the command** : setting [`disableCommandPluginSources`](</docs/en/settings-reference#disablecommandpluginsources>) to `true` blocks `headersHelper` commands, and [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>) blocks them too unless `disableCommandPluginSources` is explicitly `false`. Under either block, Claude Code still runs the command for a marketplace that managed settings themselves declare.
+
+####
+
+
+
+How users accept a headersHelper command
+
+A user accepts a plugin entry’s command each time they install or update that one plugin by itself, from the plugin’s own view in `/plugin` or with `claude plugin install` or `claude plugin update`. Claude Code shows the command and the archive URL, and runs the command only after the user accepts. In a non-interactive shell, pass [`--yes`](</docs/en/plugins-reference#plugin-install>) to accept it. Claude Code runs only the command it showed, for the archive URL it showed. If the entry’s command or archive URL changed in between, Claude Code refuses the install or update. A change in the query string alone doesn’t count.
+
+##### Installs and updates that refuse the command instead of asking
+
+On any operation other than a single-plugin install or update, Claude Code neither runs an entry’s command nor downloads its archive, so the plugin stays at its installed version or stays uninstalled. What the user sees depends on the operation:
+
+ * **Installing several plugins at once, from a plugin suggestion, or as another plugin’s dependency** : Claude Code refuses the plugin that has the command and points the user at that plugin’s own view in `/plugin`. The other plugins in a bulk install still install. A plugin that depends on the refused plugin fails to install until the user installs the refused plugin by itself.
+ * **Background auto-update, or session start for a plugin whose archive was never downloaded** : Claude Code lists the plugin in the `/plugin` Errors tab so the user knows to install or update it by hand. An auto-update that finds the entry still advertises the installed version lists nothing.
+
+##### When a marketplace `url` source’s command runs
+
+A marketplace `url` source’s `headersHelper` is declared in a settings file, such as an [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) entry, rather than in the catalog the marketplace publishes, so Claude Code doesn’t ask the user to accept it on each install or update. The settings file that declares it decides when Claude Code runs it:
+
+Settings file| When Claude Code runs the command
+---|---
+User settings, a `--settings` file, or a managed settings file on the machine| Without asking, including during a background marketplace refresh
+A project’s `.claude/settings.json` or `.claude/settings.local.json`| Only after the user accepts the [workspace trust dialog](</docs/en/permissions#what-runs-before-you-trust-a-folder>) for that folder itself. A `-p` or SDK session doesn’t count as accepting it, and neither does trust granted to a parent folder
+Server-managed settings| Only after the user approves the delivered settings in the [security approval dialog](</docs/en/server-managed-settings#security-approval-dialogs>)
+
+In a `-p` or SDK session, Claude Code can’t show the security approval dialog. It applies the other delivered settings, but the marketplace fetch, and any archive download that needs the command, fails until a user has approved in an interactive session. For an [inline plugin entry](</docs/en/settings-reference#extraknownmarketplaces>) in one of these files, Claude Code requires the same folder trust or settings approval as for a marketplace-level command in that file, and the user also accepts the entry’s command on each install or update.
###
@@ -542,7 +634,7 @@
Claude Code runs your command on the user’s machine, so it binds every run to the user’s explicit acceptance:
- * When users install the plugin from its details screen in `/plugin`, or install or update it with `claude plugin install` or `claude plugin update` in an interactive terminal, Claude Code shows them the exact command string first and records the accepted command for that installation. In a non-interactive shell, such as a provisioning script, pass `--yes` to `claude plugin install` or `claude plugin update` to accept the command it prints.
+ * When users install the plugin from its details screen in `/plugin`, or install or update it with `claude plugin install` or `claude plugin update` in an interactive terminal, Claude Code shows them the exact command string first and records the accepted command for that installation. A `claude plugin update` that can proceed on the recorded acceptance of the same command shows nothing. In a non-interactive shell, such as a provisioning script, pass `--yes` to `claude plugin install` or `claude plugin update` to accept the command it prints.
* Every other path runs only the command the user already accepted. This includes updates started from `/plugin` and the background runs described in When Claude Code re-runs the command. When none was accepted, Claude Code refuses to run the command and tells the user how to review it. Claude Code never installs a command-sourced plugin as a dependency of another plugin, so users install it themselves first.
* If you change the entry’s `command`, or switch its `mode`, users keep the version they already have and Claude Code stops re-running the command. In interactive sessions, the `/plugin` Errors tab shows the new command until the user reviews and accepts it by running `claude plugin update <plugin>@<marketplace>`.
@@ -688,7 +780,7 @@
Private repositories
-Claude Code supports installing plugins from private repositories. If you distribute your marketplace through [Organization settings > Plugins](<https://claude.ai/admin-settings/plugins>) instead, your git credentials aren’t involved: organization sync reads the marketplace repository through the Claude GitHub App or your organization’s GitHub Enterprise App, and a plugin source it can’t authenticate to must be public. The note under Plugin sources has the full rules.
+Claude Code supports installing plugins from private repositories. If you distribute your marketplace through [**Organization settings > Plugins**](<https://claude.ai/admin-settings/plugins>) instead, your git credentials aren’t involved: organization sync reads the marketplace repository through the Claude GitHub App or your organization’s GitHub Enterprise App, and a plugin source it can’t authenticate to must be public. See Distribute through organization settings for the full rules.
####
@@ -724,6 +816,41 @@
The rewrite stores the token in plaintext in your gitconfig, so use a token with read-only access to the marketplace repository.
In CI/CD environments, configure a git credential helper before installing plugins from private repositories. On GitHub Actions, export a token with read access to the marketplace repository as `GH_TOKEN`, then run `gh auth setup-git`. The default workflow token can only access the workflow’s own repository, so a private marketplace in another repository needs a personal access token or app token. A global URL rewrite configured in the pipeline also authenticates the background pull directly.
+
+###
+
+
+
+Distribute through organization settings
+
+If you distribute plugins through [**Organization settings > Plugins**](<https://claude.ai/admin-settings/plugins>) on a Team or Enterprise plan, these source rules apply:
+
+ * The marketplace repository must be private or internal. Organization sync reads it through the Claude GitHub App or your organization’s GitHub Enterprise App.
+ * Each plugin source must be of type `github`, `url`, or `git-subdir`, or a relative path that starts with `./`. If you list a plugin by bare name under `metadata.pluginRoot`, organization sync rejects it as an unsupported source, so write the path out, such as `./plugins/deploy-tools`.
+ * A plugin source can be private in two cases:
+ * A github.com source that shares the marketplace repository’s owner
+ * A source on your organization’s GitHub Enterprise host with the GHE App installed on the repository
+ * Organization sync fetches every other source without credentials, so github.com repositories under a different owner and repositories on other hosts, such as GitLab or Bitbucket, must be public.
+
+See [Manage plugins for your organization](<https://support.claude.com/en/articles/13837433>) for the admin workflow. To include private plugins, place the plugin folders inside the marketplace repository and reference them with a relative path. Organization sync packages each plugin during distribution, so users never need access to a separate source repository. For example, this `marketplace.json` plugin entry references a plugin you committed at `plugins/deploy-tools` in the marketplace repository:
+
+ {
+ "name": "deploy-tools",
+ "source": "./plugins/deploy-tools"
+ }
+
+####
+
+
+
+Keep executables out of the top-level bin directory
+
+Don’t include a top-level `bin/` directory in any plugin you distribute through organization settings. claude.ai rejects a plugin that has one, whether the plugin arrives by marketplace sync or by direct upload:
+
+ * **Marketplace sync** : organization sync rejects that plugin and syncs the rest of the marketplace. The error code is `marketplace_sync_bin_directory_not_allowed` and the message starts with `Plugin contains a top-level bin/ directory`.
+ * **Direct upload** : if you upload the plugin in [**Organization settings > Plugins**](<https://claude.ai/admin-settings/plugins>) instead, claude.ai rejects the upload with the same message.
+
+Keep executables in another directory, such as `scripts/`, and reference them as `${CLAUDE_PLUGIN_ROOT}/scripts/<name>` from your [skills, hooks, or MCP server configs](</docs/en/plugins-reference#environment-variables>).
###
@@ -913,7 +1040,12 @@
Set up release channels
-To support “stable” and “latest” release channels for your plugins, you can set up two marketplaces that point to different refs or SHAs of the same repo. You can then assign the two marketplaces to different user groups through [managed settings](</docs/en/managed-settings>).
+To support “stable” and “latest” release channels for your plugins, you can set up two marketplaces that point to different refs or SHAs of the same repo. You can then give each user group its own marketplace through managed settings in one of two ways:
+
+ * Deploy separate [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>), such as a managed settings file or an MDM profile, to each group’s devices. On each device, Claude Code applies only the [highest-ranked managed source](</docs/en/managed-settings#precedence-within-the-managed-tier>) that delivers any keys, so this route works only when the per-group file or profile is that source on the group’s devices.
+ * Define one [Claude apps gateway policy](</docs/en/claude-apps-gateway-config#managed>) per group. The gateway applies the first policy whose match rule fits a user, so order the policies so that each user reaches their group’s policy. A group policy’s `extraKnownMarketplaces` replaces the catch-all policy’s map rather than merging with it, so list every marketplace the group needs in the group’s policy, not only its channel marketplace.
+
+Server-managed settings from the admin console [apply to every user in your organization](</docs/en/server-managed-settings#current-limitations>), so they can’t carry a per-group assignment.
Each channel must resolve to a different version. If you use explicit versions, `plugin.json` must declare a different `version` at each pinned ref. If you omit `version`, the distinct commit SHAs already distinguish the channels. If two refs resolve to the same version string, Claude Code treats them as identical and skips the update.
@@ -949,7 +1081,7 @@
##### Assign channels to user groups
-Assign each marketplace to the appropriate user group through managed settings. For example, the stable group receives:
+Assign each marketplace to its user group through the per-group endpoint-managed settings or gateway policy described under Set up release channels. For example, the stable group receives:
{
"extraKnownMarketplaces": {
@@ -1314,7 +1446,7 @@
Plugins with relative paths fail in URL-based marketplaces
-**Symptoms** : Added a marketplace via URL (such as `https://example.com/marketplace.json`), but plugins with relative path sources like `"./plugins/my-plugin"` fail to install with “path not found” errors. **Cause** : URL-based marketplaces only download the `marketplace.json` file itself. They don’t download plugin files from the server. Relative paths in the marketplace entry reference files on the remote server that were not downloaded. **Solutions** :
+**Symptoms** : Added a marketplace via URL (such as `https://example.com/marketplace.json`), but plugins with relative path sources like `"./plugins/my-plugin"` fail to install with “path not found” errors. **Cause** : adding a URL-based marketplace downloads only the `marketplace.json` file itself, and Claude Code doesn’t fetch plugin files by relative path from that server. Relative paths in the marketplace entry reference files on the remote server that were not downloaded. **Solutions** :
* **Use external sources** : change plugin entries to any plugin source other than a relative path:
--- a/plugins-reference.md
+++ b/plugins-reference.md
@@ -839,7 +839,7 @@
**MCP servers**| `.mcp.json`| MCP server definitions
**LSP servers**| `.lsp.json`| Language server configurations
**Monitors**| `monitors/monitors.json`| Background monitor configurations
-**Executables**| `bin/`| Executables added to the Bash tool’s `PATH`. Files here are invokable as bare commands in any Bash tool call while the plugin is enabled
+**Executables**| `bin/`| Executables added to the Bash tool’s `PATH` and invokable as bare commands while the plugin is enabled. You can’t include this directory in a plugin you [distribute through claude.ai organization settings](</docs/en/plugin-marketplaces#keep-executables-out-of-the-top-level-bin-directory>)
**Settings**| `settings.json`| Default configuration applied when the plugin is enabled. Only the [`agent`](</docs/en/sub-agents>) and [`subagentStatusLine`](</docs/en/statusline#subagent-status-lines>) keys are supported
* * *
@@ -920,7 +920,7 @@
---|---|---
`-s, --scope <scope>`| Installation scope: `user`, `project`, or `local`| `user`
`--config <key=value>`| Set a `userConfig` option declared in the plugin’s manifest. Repeat the flag to set multiple options|
-`-y, --yes`| Accept the command that a plugin with a [`command` source](</docs/en/plugin-marketplaces#command-sources>) runs, without the confirmation prompt. Claude Code still prints the command first. Required when stdin or stdout isn’t a TTY. Has no effect inside a Claude Code session, so run the command from your own terminal|
+`-y, --yes`| Accept a command the plugin’s marketplace declares, without the confirmation prompt: the command that produces a plugin with a [`command` source](</docs/en/plugin-marketplaces#command-sources>), or the [`headersHelper`](</docs/en/plugin-marketplaces#authenticate-archive-downloads>) that authenticates an archive download. Accepting a `headersHelper` requires Claude Code v2.1.238 or later. Claude Code still prints the command first. Required when stdin or stdout isn’t a TTY. Has no effect inside a Claude Code session, so run the command from your own terminal|
`-h, --help`| Display help for command|
Scope determines which settings file the installed plugin is added to. For example, `--scope project` writes to `enabledPlugins` in .claude/settings.json, making the plugin available to everyone who clones the project repository. **Examples:**
@@ -1045,7 +1045,7 @@
Option| Description| Default
---|---|---
`-s, --scope <scope>`| Scope to update: `user`, `project`, `local`, or `managed`| `user`
-`-y, --yes`| Accept the command that a plugin with a [`command` source](</docs/en/plugin-marketplaces#command-sources>) runs, without the confirmation prompt. Claude Code still prints the command first. Required when stdin or stdout isn’t a TTY. Has no effect inside a Claude Code session, so run the command from your own terminal|
+`-y, --yes`| Accept a command the plugin’s marketplace declares, without the confirmation prompt: the command that produces a plugin with a [`command` source](</docs/en/plugin-marketplaces#command-sources>), or the [`headersHelper`](</docs/en/plugin-marketplaces#authenticate-archive-downloads>) that authenticates an archive download. Accepting a `headersHelper` requires Claude Code v2.1.238 or later. Claude Code still prints the command first. Required when stdin or stdout isn’t a TTY. Has no effect inside a Claude Code session, so run the command from your own terminal|
`-h, --help`| Display help for command|
* * *
--- a/prompt-caching.md
+++ b/prompt-caching.md
@@ -261,31 +261,48 @@
Cache lifetime
-Cached prefixes expire after a period of inactivity. Each request that hits the cache resets the timer, so the cache stays warm as long as you keep working. After a long enough gap, the next request recomputes the full input and re-establishes the cache, which is why the first turn back after stepping away can be noticeably slower. On a Pro or Max plan, when you resume a large session after a long break, Claude Code [offers to resume from a summary](</docs/en/sessions#resume-from-a-summary>) so later requests don’t carry the full history. The time to live (TTL) controls how long a gap the cache survives. The API offers two: a five-minute TTL, and a [one-hour TTL](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#1-hour-cache-duration>) that keeps the cache warm through longer breaks but [bills cache writes at a higher rate](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing>). Claude Code picks the TTL for you based on how you authenticate, and you can override it with environment variables.
-
-###
-
-
-
-On a Claude subscription
-
-On a Claude subscription, Claude Code requests the one-hour TTL automatically, so the cache survives breaks of up to an hour. If you’ve gone over your plan’s usage limit and Claude Code is drawing on [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>), you are billed for that usage. Cache writes cost more at the one-hour TTL than at the five-minute TTL, so Claude Code automatically drops to the shorter one. To keep the one-hour TTL while drawing on usage credits, set `ENABLE_PROMPT_CACHING_1H=1`.
-
-###
-
-
-
-On an API key or third-party provider
-
-On an API key, Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS, you pay the per-token rates, so the TTL stays at the cheaper five minutes by default. To opt into the [one-hour TTL](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#1-hour-cache-duration>), set `ENABLE_PROMPT_CACHING_1H=1`. On Amazon Bedrock, prompt caching support, minimum cacheable prefix length, and one-hour TTL availability all vary by model. If cache token counts stay at zero, check [supported models, regions, and limits](<https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html#prompt-caching-models>) in the Amazon Bedrock documentation.
-
-###
-
-
-
-Override the TTL
-
-Set `FORCE_PROMPT_CACHING_5M=1` to force the five-minute TTL regardless of authentication. This is useful when you’re debugging cache behavior, comparing the two TTLs, or overriding an `ENABLE_PROMPT_CACHING_1H` set in [managed settings](</docs/en/managed-settings>).
+Cached prefixes expire after a period of inactivity. Each request that hits the cache resets the timer, so the cache stays warm as long as you keep working. After a long enough gap, the next request recomputes the full input and re-establishes the cache, which is why the first turn back after stepping away can be noticeably slower. On a Pro or Max plan, when you resume a large session after a long break, Claude Code [offers to resume from a summary](</docs/en/sessions#resume-from-a-summary>) so later requests don’t carry the full history. The time to live (TTL) controls how long a gap the cache survives. The API offers two: a five-minute TTL, and a [one-hour TTL](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#1-hour-cache-duration>) that keeps the cache warm through longer breaks but [bills cache writes at a higher rate](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing>). The longer TTL helps when you leave a session idle and come back to it, because you skip the reprocessing an expired prefix costs. It costs more on short bursts of work that never idle past five minutes, where the higher write rate applies and the longer cache lifetime goes unused.
+
+###
+
+
+
+Which TTL each request gets
+
+Claude Code decides the TTL per request, and every request falls in one of two fixed buckets:
+
+ * **Main conversation** : your interactive turns, non-interactive `-p` runs, and Agent SDK turns, plus the helpers Claude Code runs inline with them
+ * **Everything else** : the requests Claude Code makes outside that conversation, such as [subagents](</docs/en/sub-agents>), [workflows](</docs/en/workflows>), in-process [teammates](</docs/en/agent-teams>), forks, compaction, and session titles
+
+Unless you choose a TTL yourself, Claude Code requests the one-hour TTL only on a Claude subscription within your plan’s included usage. There it requests the hour for the main conversation, plus a small set of helper requests that Anthropic controls server-side. This table gives each bucket’s default TTL under both kinds of billing.
+
+Request bucket| Claude subscription, within plan usage| Usage credits, API key, or cloud provider
+---|---|---
+Main conversation| One hour| Five minutes
+Everything else| Five minutes, except the server-controlled helper requests, which get one hour| Five minutes
+
+Once you go over your plan’s usage limit and Claude Code draws on [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>), you are billed for that usage, so Claude Code drops the main conversation to the cheaper five-minute TTL. To keep the one-hour TTL there, choose the TTL yourself.
+
+###
+
+
+
+Choose the TTL yourself
+
+You can set a TTL for either bucket. Each control takes `5m` or `1h`, and Claude Code ignores any other value.
+
+ * **Main conversation** : the [`promptCacheTtl`](</docs/en/settings-reference#promptcachettl>) setting, or the `CLAUDE_CODE_PROMPT_CACHE_TTL` [environment variable](</docs/en/env-vars>)
+ * **Everything else** : the [`subagentPromptCacheTtl`](</docs/en/settings-reference#subagentpromptcachettl>) setting, or the `CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL` environment variable
+
+Both settings and both environment variables require Claude Code v2.1.242 or later. If you sign in with an API key or use a cloud provider, set `promptCacheTtl` to `1h` to give the main conversation a one-hour cache. Requests outside it keep the five-minute default until you choose a TTL for that bucket too. When more than one control applies, Claude Code takes the first match in this order:
+
+ 1. `FORCE_PROMPT_CACHING_5M=1`, which forces five minutes for both buckets
+ 2. The bucket’s environment variable
+ 3. The bucket’s setting
+ 4. `ENABLE_PROMPT_CACHING_1H=1`, which requests one hour for both buckets
+ 5. The default for the request’s bucket
+
+Set `FORCE_PROMPT_CACHING_5M=1` when you’re debugging cache behavior, comparing the two TTLs, or overriding a longer TTL set in [managed settings](</docs/en/managed-settings>). The one-hour TTL isn’t available through the [Claude apps gateway](</docs/en/claude-apps-gateway#availability-and-limitations>). On Amazon Bedrock, prompt caching support, minimum cacheable prefix length, and one-hour TTL availability all vary by model. If cache token counts stay at zero, check [supported models, regions, and limits](<https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html#prompt-caching-models>) in the Amazon Bedrock documentation.
##
@@ -316,7 +333,7 @@
Subagents and the cache
-A [subagent](</docs/en/sub-agents>) starts its own conversation with its own system prompt and tool set, separate from the parent’s. Its first request doesn’t read the parent’s cache, because the two prefixes differ, and it warms a cache of its own across its turns. Subagents use the five-minute TTL even on a subscription, since the automatic one-hour TTL applies to the main conversation. The parent’s cache is unaffected. From the parent’s side, the subagent’s call and result append to the conversation, leaving the parent’s prefix intact. A [fork](</docs/en/sub-agents#fork-the-current-conversation>), by contrast, inherits the parent’s system prompt, tools, and conversation history exactly, so its first request reads the parent’s cache. The compaction summarization call described in Compacting the conversation uses the same prefix-sharing approach. In a [workflow fan-out](</docs/en/workflows#prompt-caching-in-a-fan-out>) of same-prefix agents, Claude Code briefly holds all but the first so their first requests can read the prefix the first agent cached.
+A [subagent](</docs/en/sub-agents>) starts its own conversation with its own system prompt and tool set, separate from the parent’s. Its first request doesn’t read the parent’s cache, because the two prefixes differ, and it warms a cache of its own across its turns. Subagents fall outside the main-conversation TTL bucket, so they get five minutes even on a subscription until you choose a longer one. The parent’s cache is unaffected. From the parent’s side, the subagent’s call and result append to the conversation, leaving the parent’s prefix intact. A [fork](</docs/en/sub-agents#fork-the-current-conversation>), by contrast, inherits the parent’s system prompt, tools, and conversation history exactly, so its first request reads the parent’s cache. The compaction summarization call described in Compacting the conversation uses the same prefix-sharing approach. In a [workflow fan-out](</docs/en/workflows#prompt-caching-in-a-fan-out>) of same-prefix agents, Claude Code briefly holds all but the first so their first requests can read the prefix the first agent cached.
##
--- a/python.md
+++ b/python.md
@@ -358,7 +358,7 @@
`session_id`| `str`| Session identifier
`message`| `Any`| Raw message content
`parent_tool_use_id`| `str | None`| For subagent messages, the id of the spawning `Agent` tool-use block. `None` for main-session messages and older sessions
-`parent_agent_id`| `str | None`| For messages from a [nested subagent](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>), the agent id of the parent subagent. `None` for main-session messages, top-level subagent messages, and older sessions
+`parent_agent_id`| `str | None`| For messages from a [nested subagent](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>), the agent id of the parent subagent. `None` for main-session messages, top-level subagent messages, and older sessions. Requires Python Agent SDK 0.2.140 or later
####
@@ -923,15 +923,15 @@
`user`| `str | None`| `None`| User identifier
`include_partial_messages`| `bool`| `False`| Include partial message streaming events. When enabled, `StreamEvent` messages are yielded
`include_hook_events`| `bool`| `False`| Include hook lifecycle events in the message stream as `HookEventMessage` objects
-`forward_subagent_text`| `bool`| `False`| Forward subagent text and thinking blocks in the message stream. By default only subagent `tool_use` and `tool_result` blocks are emitted
+`forward_subagent_text`| `bool`| `False`| Forward subagent text and thinking blocks in the message stream. By default only subagent `tool_use` and `tool_result` blocks are emitted. Requires Python Agent SDK 0.2.140 or later
`fork_session`| `bool`| `False`| When resuming with `resume`, fork to a new session ID instead of continuing the original session
-`resume_session_at`| `str | None`| `None`| When resuming, load the conversation only up to and including the message with this UUID. Use with `resume`, and usually `fork_session`, to branch from an earlier point
-`resume_drops_turn`| `str | None`| `None`| UUID of the user prompt whose turn a `resume_session_at` truncation discards. When set, the CLI refuses the resume if the discarded range holds entries not attributable to that turn. Requires Claude Code v2.1.223 or later; the bundled CLI satisfies this
+`resume_session_at`| `str | None`| `None`| When resuming, load the conversation only up to and including the message with this UUID. Use with `resume`, and usually `fork_session`, to branch from an earlier point. Requires Python Agent SDK 0.2.137 or later
+`resume_drops_turn`| `str | None`| `None`| UUID of the user prompt whose turn a `resume_session_at` truncation discards. When set, the CLI refuses the resume if the discarded range holds entries not attributable to that turn. Requires Python Agent SDK 0.2.137 or later and Claude Code v2.1.223 or later; the CLI bundled with those SDK versions satisfies the Claude Code requirement
`agents`| `dict[str, AgentDefinition] | None`| `None`| Programmatically defined subagents
`plugins`| `list[SdkPluginConfig]`| `[]`| Load custom plugins from local paths. See [Plugins](</docs/en/agent-sdk/plugins>) for details
`sandbox`| `SandboxSettings` ` | None`| `None`| Configure sandbox behavior programmatically. See Sandbox settings for details
`setting_sources`| `list[SettingSource] | None`| `None` (CLI defaults: all sources)| Control which filesystem settings to load. Pass `[]` to disable user, project, and local settings. Endpoint-managed policy loads regardless; server-managed settings are fetched when the session authenticates with an organization credential on an [eligible configuration](</docs/en/server-managed-settings#platform-availability>). See [Use Claude Code features](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>)
-`skills`| `list[str] | Literal["all"] | None`| `None`| Skills available to the session. Pass `"all"` to enable every discovered skill, or a list of skill names. Pass exact names only. The SDK rejects malformed and wildcard-form names with a `ValueError` before starting the Claude Code process. When set, the SDK adds the Skill tool to `allowed_tools` automatically. If you also pass `tools`, include `"Skill"` in that list. See [Skills](</docs/en/agent-sdk/skills>)
+`skills`| `list[str] | Literal["all"] | None`| `None`| Skills available to the session. Pass `"all"` to enable every discovered skill, or a list of skill names. Pass exact names only. The SDK rejects malformed and wildcard-form names with a `ValueError` before starting the Claude Code process; this check requires Python Agent SDK 0.2.129 or later. When set, the SDK adds the Skill tool to `allowed_tools` automatically. If you also pass `tools`, include `"Skill"` in that list. See [Skills](</docs/en/agent-sdk/skills>)
`max_thinking_tokens`| `int | None`| `None`| _Deprecated_ \- Maximum tokens for thinking blocks. Use `thinking` instead
`thinking`| `ThinkingConfig` ` | None`| `None`| Controls extended thinking behavior. Takes precedence over `max_thinking_tokens`
`effort`| `EffortLevel` ` | None`| `None`| Effort level for thinking depth. See [adjust the effort level](</docs/en/model-config#adjust-effort-level>)
@@ -1624,7 +1624,7 @@
`uuid`| `str | None`| Unique message identifier
`parent_tool_use_id`| `str | None`| Tool use ID if this message is a tool result response
`tool_use_result`| `dict[str, Any] | None`| Tool result data if applicable
-`origin`| `MessageOrigin | None`| Provenance of this message, populated on injected turns such as task notifications and peer messages. `None` when the CLI didn’t attribute it
+`origin`| `MessageOrigin | None`| Provenance of this message, populated on injected turns such as task notifications and peer messages. `None` when the CLI didn’t attribute it. Requires Python Agent SDK 0.2.137 or later
###
@@ -1727,7 +1727,7 @@
* `result`: text of the final assistant message on `subtype="success"`, or `None` on the `error_*` subtypes. When `subtype="success"` and `is_error=True`, this holds the API error string if one is available but can be empty, so check `api_error_status` and the preceding `AssistantMessage` content for detail.
* `errors`: loop-level error strings such as the max-turns message. Populated only on the `error_*` subtypes.
* `terminal_reason`: why the query loop ended, such as `"completed"`, `"max_turns"`, `"api_error"`, `"aborted_streaming"`, or `"aborted_tools"`. A value of `"aborted_streaming"` or `"aborted_tools"` means the turn was aborted before completing. Common causes are `interrupt()` and a permission callback returning `PermissionResultDeny` with `interrupt=True`. `None` on CLI versions that predate the field, on results that bypassed the query loop such as local slash commands, or on synthesized error results emitted when the session fails fatally. Mirrors the TypeScript SDK’s [`SDKResultMessage.terminal_reason`](</docs/en/agent-sdk/typescript#sdkresultmessage>), which lists the full set of values.
- * `origin`: origin of the user message that triggered this turn. In [streaming input mode](</docs/en/agent-sdk/streaming-vs-single-mode>), check this to tell the result of your own prompt, where `origin` is `None` or `{"kind": "human"}`, from the result of an injected turn such as a background-task notification.
+ * `origin`: origin of the user message that triggered this turn. In [streaming input mode](</docs/en/agent-sdk/streaming-vs-single-mode>), check this to tell the result of your own prompt, where `origin` is `None` or `{"kind": "human"}`, from the result of an injected turn such as a background-task notification. Requires Python Agent SDK 0.2.137 or later.
The `usage` dict covers the main agent loop only and excludes subagent and other nested or auxiliary model calls. In [streaming input mode](</docs/en/agent-sdk/streaming-vs-single-mode>), the values are per-turn. Prefer `model_usage` for token and cost accounting. The `usage` dict contains the following keys when present:
@@ -1836,7 +1836,7 @@
`ConversationResetMessage`
-Emitted when the conversation is replaced without ending the connection, such as after `/clear`. See [Track costs in streaming input mode](</docs/en/agent-sdk/cost-tracking#track-costs-in-streaming-input-mode>) for how a reset affects the running totals on later `ResultMessage` objects.
+Emitted when the conversation is replaced without ending the connection, such as after `/clear`. See [Track costs in streaming input mode](</docs/en/agent-sdk/cost-tracking#track-costs-in-streaming-input-mode>) for how a reset affects the running totals on later `ResultMessage` objects. Requires Python Agent SDK 0.2.137 or later.
@dataclass
class ConversationResetMessage:
--- a/sandboxing.md
+++ b/sandboxing.md
@@ -447,12 +447,14 @@
Network access is controlled through a proxy server running outside the sandbox:
- * **Domain restrictions** : Claude Code pre-allows no domains by default. The first time a command needs a new domain, Claude Code prompts for approval, or in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) sends the request to the classifier. If you choose Yes when prompted, Claude Code allows the host for the rest of the current session and doesn’t prompt again for later connections to the same host. If you choose “Yes, and don’t ask again”, Claude Code saves a `WebFetch(domain:...)` allow rule to your [local settings](</docs/en/permissions#permission-system>), so the host stays allowed in future sessions. Pre-allow domains with [`allowedDomains`](</docs/en/settings-reference#sandbox-network-alloweddomains>) to avoid the prompt entirely. Claude Code also pre-allows domains from `WebFetch` allow rules, as described in Permission rules.
+ * **Domain restrictions** : Claude Code pre-allows no domains by default. The first time a command needs a new domain, Claude Code prompts for approval, or in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) sends the request to the classifier. If you choose Yes when prompted, Claude Code allows the host for the rest of the current session and doesn’t prompt again for later connections to the same host. If you choose “Yes, and don’t ask again”, Claude Code saves a `WebFetch(domain:...)` allow rule to your [local settings](</docs/en/permissions#permission-system>), so the host stays allowed in future sessions. Pre-allow domains with [`allowedDomains`](</docs/en/settings-reference#sandbox-network-alloweddomains>) to avoid the prompt entirely. Claude Code also pre-allows domains from `WebFetch(domain:...)` allow rules, as described in Permission rules.
* **Strict allowlist** : if you set [`strictAllowlist`](</docs/en/settings-reference#sandbox-network-strictallowlist>) to `true` in user, managed, or CLI `--settings` settings, Claude Code denies sandboxed commands access to any host outside the allowlist instead of prompting. The allowlist is the same one the sandbox otherwise prompts against: `allowedDomains` plus domains from `WebFetch(domain:...)` allow rules, or only the managed settings entries when `allowManagedDomainsOnly` is set. Claude Code enforces this for sandboxed commands only; in-process tools such as `WebFetch` still follow their permission rules. Setting it in a repository’s `.claude/settings.json` or `.claude/settings.local.json` has no effect. Requires Claude Code v2.1.219 or later.
* **Managed lockdown** : if [`allowManagedDomainsOnly`](</docs/en/settings-reference#sandbox-network-allowmanageddomainsonly>) is set in managed settings, non-allowed domains are blocked automatically instead of prompting, and only `allowedDomains` and `WebFetch(domain:...)` allow rules from managed settings are honored.
* **Corporate proxy** : when your network requires outbound traffic to go through a corporate proxy, set `HTTPS_PROXY`, `HTTP_PROXY`, and `NO_PROXY` as [proxy configuration](</docs/en/network-config#proxy-configuration>) describes, in the `env` block of your settings so that [background agents](</docs/en/network-config#set-network-variables-in-settings-not-the-shell>) get them too, or in the environment you launch Claude Code from. Claude Code enforces the domain allowlist and then tunnels allowed connections through that upstream proxy.
* **Custom proxy support** : advanced users can implement custom rules on outgoing traffic
* **Comprehensive coverage** : restrictions apply to all scripts, programs, and subprocesses spawned by commands
+
+In a `WebFetch(domain:...)` rule, the sandbox honors two wildcard forms: a leading `*.`, such as `*.example.com`, and a bare `*`. The bare `*` form requires Claude Code v2.1.186 or later. A wildcard in any other position, such as `WebFetch(domain:example.*)`, still matches fetches but has no effect on sandboxed commands.
The built-in proxy enforces the allowlist based on the requested hostname and, by default, does not terminate or inspect TLS traffic. The experimental [`network.tlsTerminate`](</docs/en/settings-reference#sandbox-network-tlsterminate>) setting, available in Claude Code v2.1.199 and later, makes the built-in proxy terminate TLS itself, which `mask` credential entries require. See Security limitations for the implications of the default, and Custom proxy configuration if your threat model requires TLS inspection.
@@ -512,11 +514,11 @@
`sandbox.filesystem.disabled`| Turns the filesystem layer off entirely while keeping network isolation
`Edit` allow rules| Grant write access to specific paths, the same way `sandbox.filesystem.allowWrite` does
`Read` and `Edit` deny rules| Block access to specific files or directories
-`WebFetch` allow and deny rules| Control domain access
+`WebFetch(domain:...)` allow and deny rules| Control domain access
Sandbox `allowedDomains`| Controls which domains Bash commands can reach
Sandbox `deniedDomains`| Blocks specific domains even when a broader `allowedDomains` wildcard would otherwise permit them
-Paths from both `sandbox.filesystem` settings and permission rules are merged together into the final sandbox configuration. The [claude-code repository’s examples directory](<https://github.com/anthropics/claude-code/tree/main/examples/settings>) includes starter settings configurations for common deployment scenarios, including sandbox-specific examples. Use these as starting points and adjust them to fit your needs.
+Paths and domains from both sandbox settings and permission rules are merged into the final sandbox configuration. The [claude-code repository’s examples directory](<https://github.com/anthropics/claude-code/tree/main/examples/settings>) includes starter settings configurations for common deployment scenarios, including sandbox-specific examples. Use these as starting points and adjust them to fit your needs.
###
--- a/settings.md
+++ b/settings.md
@@ -218,9 +218,10 @@
Lists merge instead of overriding
-When you set the same list key, such as `permissions.allow`, in more than one file, Claude Code combines the lists instead of picking one, so each file can add entries without removing another file’s. Two list keys follow their own rules:
+When you set the same list key, such as `permissions.allow`, in more than one file, Claude Code combines the lists instead of picking one, so each file can add entries without removing another file’s. Three keys that hold model lists follow their own rules:
* [`fallbackModel`](</docs/en/settings-reference#fallbackmodel>) is an ordered chain where position carries meaning, so Claude Code takes the whole value from the highest-precedence file that defines it.
+ * [`modelPicker`](</docs/en/settings-reference#modelpicker>) holds one ordered list of rows plus a replace flag, so Claude Code never merges rows from two sources. It takes the whole value from the highest of managed settings, `--settings`, and user settings that defines it, and ignores the key in project and local settings. Requires Claude Code v2.1.242 or later.
* [`availableModels`](</docs/en/settings-reference#availablemodels>): when the [highest-precedence managed source](</docs/en/managed-settings#precedence-within-the-managed-tier>) defines it, Claude Code applies that list as-is and ignores entries you add in user, project, or local settings, unless an app that embeds Claude Code supplies its own model list; see Exceptions to managed settings precedence. Across non-managed scopes Claude Code merges the arrays as usual.
###
@@ -299,7 +300,7 @@
Two things keep a key in `.claude/settings.json` from applying for everyone who clones it:
- * **Claude Code ignores the key in a repository file.** Look for `User, local, or managed`, `User or managed`, `Managed`, or `Global config` in the Scope column of the [All settings](</docs/en/settings-reference#all-settings>) index; those keys never apply from the shared file, and `Global config` keys apply only from `~/.claude.json`.
+ * **Claude Code ignores the key in a repository file.** Look for `User, local, or managed`, `User or managed`, `Managed`, or `Global config` in the Scope column of the [All settings](</docs/en/settings-reference#all-settings>) index; those keys never apply from the shared file, apart from [`autoContinueAtUsageLimit`](</docs/en/settings-reference#autocontinueatusagelimit>), which a repository file can still switch off: while the file sets the key and no user, `--settings`, or managed value does, Claude Code reads the setting as off. `Global config` keys apply only from `~/.claude.json`.
* **The key waits for trust.** `permissions.allow` rules, `permissions.additionalDirectories`, `extraKnownMarketplaces`, and most [`env`](</docs/en/settings-reference#env>) values apply only after each teammate [trusts the folder](</docs/en/permissions#project-allow-rules-and-workspace-trust>). Until then they still see prompts and don’t get plugins from a marketplace the file declares. `deny` and `ask` rules apply right away.
####
Show diff (295 lines)
--- a/settings-reference.md
+++ b/settings-reference.md
@@ -30,6 +30,7 @@
`autoCompactEnabled`| Turn [automatic compaction](</docs/en/context-window>) off or on| Memory and context| Any file
`autoCompactWindow`| Set how full the context gets before Claude Code [compacts](</docs/en/context-window>)| Memory and context| Any file
`autoConnectIde`| Connect to a running [VS Code](</docs/en/vs-code>) or [JetBrains](</docs/en/jetbrains#from-external-terminals>) IDE automatically from an external terminal| Global config settings| Global config
+`autoContinueAtUsageLimit`| Wait in the open session and [continue the task automatically](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>) after a claude.ai usage limit resets| Interface and terminal| User or managed
`autoInstallIdeExtension`| Turn off automatic install of the [IDE extension](</docs/en/vs-code#install-the-extension>) from a VS Code terminal| Global config settings| Global config
`autoMemoryDirectory`| Store [auto memory](</docs/en/memory#auto-memory>) in a directory you choose| Memory and context| Any file
`autoMemoryEnabled`| Turn [auto memory](</docs/en/memory#auto-memory>) off or on| Memory and context| Any file
@@ -104,6 +105,7 @@
`minimumVersion`| Keep [auto-updates](</docs/en/setup#pin-a-minimum-version>) from installing anything below a version| Updates and versioning| Any file
`model`| Change the [model](</docs/en/model-config#set-a-default-model-for-new-sessions>) Claude Code starts with| Model and responses| Any file
`modelOverrides`| [Map model IDs](</docs/en/model-config#override-model-ids-per-version>) to your provider’s IDs, such as Bedrock ARNs| Model and responses| Any file
+`modelPicker`| Choose which models the [`/model` picker](</docs/en/model-config#available-models>) lists, in your own order and with your own labels| Model and responses| User or managed
`otelHeadersHelper`| Generate rotating [OpenTelemetry](</docs/en/monitoring-usage#dynamic-headers>) headers with your own command| Authentication and providers| Any file
`outputStyle`| Change Claude’s role, tone, and output format with an [output style](</docs/en/output-styles>)| Model and responses| Any file
`parentSettingsBehavior`| Apply or drop restrictions an [SDK or IDE host](</docs/en/managed-settings#let-an-embedding-host-add-policy>) passes when you deploy [managed settings](</docs/en/managed-settings>)| Enterprise and managed settings| Managed
@@ -126,6 +128,7 @@
`preferredNotifChannel`| Choose a [terminal bell or desktop notification](</docs/en/terminal-config#get-a-terminal-bell-or-notification>) for task completion| Remote, desktop, and notifications| Any file
`prefersReducedMotion`| [Reduce or turn off](</docs/en/accessibility#accessibility-settings>) spinner, shimmer, and flash animations| Interface and terminal| Any file
`processWrapper`| Run Claude Code’s background processes through a [corporate launcher](</docs/en/corporate-launcher>) on macOS and Linux| Agents, sessions, and worktrees| User or managed
+`promptCacheTtl`| Choose the [prompt cache lifetime](</docs/en/prompt-caching#cache-lifetime>) for the main conversation| Model and responses| Any file
`promptSuggestionEnabled`| Hide the grayed-out [prompt suggestions](</docs/en/interactive-mode#prompt-suggestions>) in the input box| Interface and terminal| Any file
`prUrlTemplate`| Point PR links at an internal code-review tool instead of github.com| Git and attribution| Any file
`remote.defaultEnvironmentId`| Pick the default [cloud environment](</docs/en/cloud-environments>) for `claude --cloud`; a self-hosted `ccpool_` ID is read only from user and managed settings and `--settings`| Remote, desktop, and notifications| Any file
@@ -194,6 +197,7 @@
`strictPluginOnlyCustomization.hooks`| Lock [hooks](</docs/en/hooks>) to plugin and managed sources| Plugins and skills| Managed
`strictPluginOnlyCustomization.mcp`| Lock [MCP servers](</docs/en/mcp>) to plugin and managed sources| Plugins and skills| Managed
`strictPluginOnlyCustomization.skills`| Lock [skills](</docs/en/skills>) to plugin and managed sources| Plugins and skills| Managed
+`subagentPromptCacheTtl`| Choose the [prompt cache lifetime](</docs/en/prompt-caching#cache-lifetime>) for subagents and other requests outside the main conversation| Model and responses| Any file
`subagentStatusLine`| Rewrite rows in the [subagent](</docs/en/sub-agents>) task display with your own command| Interface and terminal| Any file
`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
@@ -476,6 +480,56 @@
+`modelPicker`
+
+List the models the `/model` picker offers, in the order you write them and under labels you choose, so the picker lists the models your organization runs, after the built-in lineup or instead of it. Each row’s `model` is taken verbatim, so it accepts anything `--model` accepts: an alias such as `opus`, an Anthropic model ID, or a provider-format ID for Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or an LLM gateway. Requires Claude Code v2.1.242 or later.
+
+ * **Scope** : `User or managed`. Claude Code reads the key from managed settings, `--settings`, and user settings, and ignores it in project and local settings so a repository you clone can’t relabel the picker. The highest of those three that sets the key supplies the whole lineup, and Claude Code never combines lineups from two sources.
+ * **Type** : object with an `options` array of rows and an optional `replaceBuiltInOptions` Boolean
+ * **Default** : unset, so the picker shows the built-in lineup
+
+This example adds two Bedrock deployments after the built-in lineup, under names your team recognizes:
+
+managed-settings.json
+
+ {
+ "modelPicker": {
+ "options": [
+ { "model": "us.anthropic.claude-opus-4-8", "label": "Opus (production)" },
+ {
+ "model": "us.anthropic.claude-sonnet-4-6",
+ "label": "Sonnet (production)",
+ "description": "Day-to-day work"
+ }
+ ]
+ }
+ }
+
+####
+
+
+
+Fields for `modelPicker`
+
+The key takes two fields, one for the rows themselves and one for whether they replace the built-in lineup or add to it.
+
+Field| Type| What it does
+---|---|---
+`options`| array of rows, each with a required `model` and an optional `label` and `description`| The rows the picker shows, in this order, except that a grayed-out row moves to the bottom. Without a `label`, Claude Code titles the row with the built-in name for a model it knows, or the model ID otherwise, and without a `description` it writes a generic second line
+`replaceBuiltInOptions`| Boolean, default `false`| Set it to `true` to show only these rows, **Default** , and a row for the model the session is already using. Leave it unset to add these rows after the built-in lineup
+
+With `replaceBuiltInOptions` on, Claude Code hides every other row: the built-in lineup, the rows it adds for `availableModels` entries, the models [gateway discovery](</docs/en/llm-gateway-protocol#model-discovery>) found, and [`ANTHROPIC_CUSTOM_MODEL_OPTION`](</docs/en/model-config#add-a-custom-model-option>). With it off, Claude Code skips a listed model that the built-in lineup already covers. A label changes what the picker shows, not which model Claude Code runs. An `availableModels` allowlist still applies to these rows. Before you add a listed model to the allowlist, read [Merge behavior](</docs/en/model-config#merge-behavior>): a specific model ID narrows its family’s wildcard entry. Claude Code also checks each row against the session before it shows the picker:
+
+ * **Dropped** : a row Claude Code can’t serve, such as a retired model or a model your organization has no access to
+ * **Grayed out** : a row you can’t select yet, shown with the reason
+ * **No row survives** : Claude Code keeps the built-in lineup, filtered by the allowlist as usual
+
+Claude Code drops a row it can’t parse and keeps the rest. See [Fix a broken settings file](</docs/en/settings#fix-a-broken-settings-file>).
+
+###
+
+
+
`outputStyle`
Select an [output style](</docs/en/output-styles>) by name. An output style is a saved set of instructions that Claude Code adds to the system prompt to change Claude’s role, tone, and output format, such as the built-in Explanatory and Learning styles or one you wrote yourself. Claude Code builds the style into the system prompt once per conversation. An edit to this key takes effect after you run `/clear` or start a new session.
@@ -491,6 +545,32 @@
{
"outputStyle": "Explanatory"
}
+
+###
+
+
+
+`promptCacheTtl`
+
+Choose how long the [prompt cache](</docs/en/prompt-caching>) holds the main conversation. This key applies to your interactive, `-p`, and Agent SDK turns, together with the helpers Claude Code runs inline with them. The one-hour lifetime keeps the cache warm across longer breaks, and the API [bills each cache write at a higher rate](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing>) than at the five-minute lifetime. Requires Claude Code v2.1.242 or later.
+
+ * **Scope** : `Any file`
+ * **Type** : string, one of:
+ * `"5m"`: the cache holds for five minutes
+ * `"1h"`: the cache holds for an hour
+ * **Default** : unset, so each main-conversation request gets [its default lifetime](</docs/en/prompt-caching#which-ttl-each-request-gets>)
+ * **Per-session overrides** : [`FORCE_PROMPT_CACHING_5M`](</docs/en/env-vars>) takes precedence over everything else, then [`CLAUDE_CODE_PROMPT_CACHE_TTL`](</docs/en/env-vars>), then this key, and last [`ENABLE_PROMPT_CACHING_1H`](</docs/en/env-vars>)
+
+This example keeps the main conversation on the one-hour lifetime and leaves subagents on five minutes:
+
+settings.json
+
+ {
+ "promptCacheTtl": "1h",
+ "subagentPromptCacheTtl": "5m"
+ }
+
+For what each lifetime costs, see [Cache lifetime](</docs/en/prompt-caching#cache-lifetime>).
###
@@ -513,6 +593,31 @@
}
Redaction only changes what you see, not what the model generates: to reduce thinking spend, [lower the budget or disable thinking](</docs/en/model-config#extended-thinking>) instead. This setting has no effect in non-interactive mode (`-p`), the Agent SDK, or IDE extensions such as VS Code.
+
+###
+
+
+
+`subagentPromptCacheTtl`
+
+Choose how long the [prompt cache](</docs/en/prompt-caching>) holds the requests Claude Code makes outside the main conversation. This key applies to [subagents](</docs/en/sub-agents>), [workflows](</docs/en/workflows>), and Claude Code’s own background and helper requests, such as compaction and session titles. The one-hour lifetime keeps the cache warm across longer breaks, and the API [bills each cache write at a higher rate](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing>) than at the five-minute lifetime. Requires Claude Code v2.1.242 or later.
+
+ * **Scope** : `Any file`
+ * **Type** : string, one of:
+ * `"5m"`: the cache holds for five minutes
+ * `"1h"`: the cache holds for an hour
+ * **Default** : unset, so each of these requests gets [its default lifetime](</docs/en/prompt-caching#which-ttl-each-request-gets>)
+ * **Per-session overrides** : [`FORCE_PROMPT_CACHING_5M`](</docs/en/env-vars>) takes precedence over everything else, then [`CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL`](</docs/en/env-vars>), then this key, and last [`ENABLE_PROMPT_CACHING_1H`](</docs/en/env-vars>), which asks for the one-hour lifetime on every request
+
+This example gives subagents and the other requests outside the main conversation the one-hour lifetime:
+
+settings.json
+
+ {
+ "subagentPromptCacheTtl": "1h"
+ }
+
+This key covers the requests `promptCacheTtl` doesn’t, so set both to choose a lifetime for every request Claude Code makes. For how a subagent’s cache differs from the main conversation’s, see [Subagents and the cache](</docs/en/prompt-caching#subagents-and-the-cache>).
###
@@ -846,7 +951,7 @@
}
}
-Permission rules layer on top of every mode: `deny` rules block in every mode, including `bypassPermissions`. See [Permission modes](</docs/en/permission-modes>). `manual` names the permission mode labeled Manual in the CLI and the VS Code extension; the alias requires Claude Code v2.1.200 or later. Before v2.1.142, project settings could set `auto`. In Claude Code on the web, Claude Code honors only `acceptEdits`, `plan`, `default`, and `auto` from this key. For conversations the VS Code extension starts, see [which setting the extension reads for the starting permission mode](</docs/en/permission-modes#switch-permission-modes>).
+Permission rules layer on top of every mode: `deny` rules block in every mode, including `bypassPermissions`. See [Permission modes](</docs/en/permission-modes>). `manual` names the permission mode labeled Manual in the CLI and the VS Code extension; the alias requires Claude Code v2.1.200 or later. In Claude Code on the web, Claude Code honors only `acceptEdits`, `plan`, `default`, and `auto` from this key. For conversations the VS Code extension starts, see [which setting the extension reads for the starting permission mode](</docs/en/permission-modes#switch-permission-modes>).
###
@@ -1104,7 +1209,7 @@
}
}
-Claude Code enforces these lists at the OS sandbox boundary, so they apply to every subprocess a sandboxed command starts, such as `kubectl`, `terraform`, or `npm`, not only to Claude’s file tools. Your [permission rules](</docs/en/sandboxing#permission-rules>) feed the same lists: `Edit` allow and deny rules join `allowWrite` and `denyWrite`, `Read` deny rules join `denyRead`, and `WebFetch` allow and deny rules join the `network` domain lists. Every list merges across settings files. When you edit a list during a session, Claude Code [applies the change to the running session](</docs/en/settings#when-edits-take-effect>).
+Claude Code enforces these lists at the OS sandbox boundary, so they apply to every subprocess a sandboxed command starts, such as `kubectl`, `terraform`, or `npm`, not only to Claude’s file tools. Your [permission rules](</docs/en/sandboxing#permission-rules>) feed the same lists: `Edit` allow and deny rules join `allowWrite` and `denyWrite`, `Read` deny rules join `denyRead`, and `WebFetch(domain:...)` allow and deny rules join the `network` domain lists. Every list merges across settings files. When you edit a list during a session, Claude Code [applies the change to the running session](</docs/en/settings#when-edits-take-effect>).
####
@@ -2328,6 +2433,28 @@
+`autoContinueAtUsageLimit`
+
+After a claude.ai usage limit stops your session, wait in the open session and continue the task automatically after the reset. See [Turn automatic continue off](</docs/en/interactive-mode#turn-automatic-continue-off>). Requires Claude Code v2.1.234 or later.
+
+ * **Scope** : `User or managed`. Read from user settings, `--settings`, and managed settings only. When none of those sets the key, a project or local settings file that sets it turns the feature off rather than being ignored.
+ * **Type** : Boolean
+ * `true`: after a claude.ai usage limit stops your session, Claude Code waits in the open session and continues the task automatically after the reset
+ * `false`: Claude Code doesn’t start the wait on its own. You can still [start a wait yourself](</docs/en/interactive-mode#start-a-wait-yourself>) from the usage-limit options menu
+ * **Default** : `true`
+
+settings.json
+
+ {
+ "autoContinueAtUsageLimit": false
+ }
+
+Appears in `/config` as **Continue automatically at usage limit** , which writes this key to user settings; Claude Code hides the row while managed settings or the `--settings` flag set the key.
+
+###
+
+
+
`autoScrollEnabled`
Follow new output to the bottom of the conversation in [fullscreen rendering](</docs/en/fullscreen>). Turn it off to stay where you scrolled while Claude keeps working; permission prompts still scroll into view.
@@ -3329,6 +3456,7 @@
* **Force-enabled plugin hooks run** : hooks from plugins your managed settings force-enable through `enabledPlugins`. Claude Code matches on the full `plugin@marketplace` ID, so a plugin with the same name from a different marketplace stays blocked. This lets you distribute vetted hooks through an organization marketplace while blocking everything else
* **Everything else is blocked** : user, project, and local hooks, hooks from other plugins, and hooks declared in agent frontmatter
* **Command-sourced plugins are disabled** : Claude Code also disables plugins with a [`command` source](</docs/en/plugin-marketplaces#command-sources>), including plugins force-enabled in managed `enabledPlugins`, unless you set `disableCommandPluginSources` to `false` explicitly
+ * **Marketplace`headersHelper` commands are blocked**: Claude Code also blocks marketplace [`headersHelper` commands](</docs/en/plugin-marketplaces#authenticate-archive-downloads>) unless `disableCommandPluginSources` is explicitly set to `false`, except for a marketplace that managed settings themselves declare. Requires Claude Code v2.1.238 or later
* **Status line and file suggestion narrow to managed settings** : Claude Code reads [`statusLine`](</docs/en/statusline>), `fileSuggestion`, and [`subagentStatusLine`](</docs/en/statusline#subagent-status-lines>) from managed settings only, following the status line and file suggestion gates
The [`/goal`](</docs/en/goal>) command can’t run while this key is set, because it depends on hooks.
@@ -3355,10 +3483,10 @@
The reach depends on which file carries the key:
- * **In managed settings** : Claude Code disables every hook, including managed ones
- * **In any other settings file** : Claude Code disables user, project, local, and plugin hooks; managed hooks and hooks from plugins force-enabled in managed `enabledPlugins` keep running
-
-The [`/goal`](</docs/en/goal>) command can’t run while hooks are disabled, and the `/hooks` menu shows a notice instead of your hooks.
+ * **In managed settings** : Claude Code disables every configured hook, including managed ones, and keeps running the hooks the [Agent SDK](</docs/en/agent-sdk/overview>) registers in process
+ * **In any other settings file** : Claude Code disables user, project, local, and plugin hooks; managed hooks, Agent SDK hooks, and hooks from plugins force-enabled in managed `enabledPlugins` keep running
+
+Keeping Agent SDK hooks running when managed settings set this key requires Claude Code v2.1.242 or later. The [`/goal`](</docs/en/goal>) command can’t run while hooks are disabled, and the `/hooks` menu shows a notice instead of your hooks.
####
@@ -3697,7 +3825,7 @@
`disableCommandPluginSources`
-Block the [`command` plugin source](</docs/en/plugin-marketplaces#command-sources>), which installs a plugin by running a marketplace-declared command on the user’s machine. When you set it to `true`, Claude Code never runs the command, doesn’t install or update command-sourced plugins, and stops loading the ones already installed. Set it to `false` to allow them explicitly. Requires Claude Code v2.1.229 or later.
+Block the [`command` plugin source](</docs/en/plugin-marketplaces#command-sources>), which installs a plugin by running a marketplace-declared command on the user’s machine. When you set it to `true`, Claude Code never runs the command, doesn’t install or update command-sourced plugins, and stops loading the ones already installed. Set it to `false` to allow them explicitly. Whenever it blocks command sources, whether you set it to `true` or leave it unset under `allowManagedHooksOnly`, it also blocks marketplace [`headersHelper` commands](</docs/en/plugin-marketplaces#authenticate-archive-downloads>), except for a marketplace that managed settings themselves declare. Requires Claude Code v2.1.229 or later, and the `headersHelper` block requires v2.1.238 or later.
* **Scope** : `Managed`
* **Type** : Boolean
@@ -3799,7 +3927,7 @@
Three source types carry rules beyond the table:
- * **`url`** : a URL marketplace downloads only the `marketplace.json` file, not plugin files, so its plugins must use a [plugin source](</docs/en/plugin-marketplaces#plugin-sources>) other than a relative path. For plugins with relative paths, use a Git-based marketplace instead. See [Plugins with relative paths fail in URL-based marketplaces](</docs/en/plugin-marketplaces#plugins-with-relative-paths-fail-in-url-based-marketplaces>).
+ * **`url`** : a URL marketplace downloads only the `marketplace.json` file, and Claude Code doesn’t fetch plugin files by relative path from that server, so its plugins must use a [plugin source](</docs/en/plugin-marketplaces#plugin-sources>) other than a relative path, such as an archive URL, which can be on the same host. For plugins with relative paths, use a Git-based marketplace instead. See [Plugins with relative paths fail in URL-based marketplaces](</docs/en/plugin-marketplaces#plugins-with-relative-paths-fail-in-url-based-marketplaces>).
* **`hostPattern`** : use it to allow every marketplace on an internal GitHub Enterprise or GitLab server without listing each repository. Claude Code matches `github` sources against `github.com`, takes the hostname from `url` sources, and takes it from `git` sources depending on the [git URL](<https://git-scm.com/docs/git-clone#_git_urls>)’s form:
* A URL with a scheme, such as `https://` or `ssh://`: the hostname in the URL.
* An SSH address without a scheme, in git’s `user@host:path` form, such as `git@git.example.com:tools/plugins.git`: the host between `@` and `:`, which is the host git connects to.
@@ -4080,12 +4208,17 @@
* **`github`** : a GitHub repository, with `repo`
* **`git`** : any git URL, with `url`
- * **`url`** : a direct URL to a `marketplace.json` file, with `url` and optional `headers` for authenticated access
+ * **`url`** : a direct URL to a `marketplace.json` file, with `url` and optional `headers` and `headersHelper` for authenticated access. `headersHelper` names a command that prints headers whose values are too short-lived to list in `headers`, and requires Claude Code v2.1.238 or later
* **`file`** : a local path to a `marketplace.json` file, with `path`
* **`directory`** : a local filesystem path, with `path`, for development only
* **`settings`** : an inline marketplace declared directly in the settings file without a hosted repository, with `name` and `plugins`
-The `git` source type works with any git hosting service, including self-hosted GitLab and Bitbucket. Claude Code clones the repository with the same authentication that `git clone` would use on that machine: configured credential helpers or SSH keys. A provider token such as `GITHUB_TOKEN` takes effect only through a credential helper that reads it. See [Private repositories](</docs/en/plugin-marketplaces#private-repositories>) for setup details. For `github` and `git` sources, set `"skipLfs": true` inside the `source` object, alongside `repo` or `url`, to skip Git LFS downloads when Claude Code clones or updates the marketplace repository. LFS pointer files remain as pointers instead of downloading their content. Use this when the repository contains large LFS objects unrelated to plugin content. Requires Claude Code v2.1.153 or later. Plugins listed in a `settings` source must reference external sources such as GitHub or npm, and the `name` must match the marketplace key. You still enable each plugin separately in `enabledPlugins`. This example declares one plugin inline:
+The `git` source type works with any git hosting service, including self-hosted GitLab and Bitbucket. Claude Code clones the repository with the same authentication that `git clone` would use on that machine: configured credential helpers or SSH keys. A provider token such as `GITHUB_TOKEN` takes effect only through a credential helper that reads it. See [Private repositories](</docs/en/plugin-marketplaces#private-repositories>) for setup details. For `github` and `git` sources, set `"skipLfs": true` inside the `source` object, alongside `repo` or `url`, to skip Git LFS downloads when Claude Code clones or updates the marketplace repository. LFS pointer files remain as pointers instead of downloading their content. Use this when the repository contains large LFS objects unrelated to plugin content. Requires Claude Code v2.1.153 or later. For a `url` source, set `headersHelper` inside the `source` object when the credential in `headers` expires and a command has to produce a fresh one. Requires Claude Code v2.1.238 or later. For what the command must print and where Claude Code runs it, see [Write the headersHelper command](</docs/en/plugin-marketplaces#write-the-headershelper-command>), and for the cases where Claude Code doesn’t run it, see [When Claude Code skips a headersHelper command](</docs/en/plugin-marketplaces#when-claude-code-skips-a-headershelper-command-or-drops-its-output>). Once you set `headersHelper` on an `https://` marketplace URL, Claude Code runs the command at two points, reusing one run’s output for up to 60 seconds:
+
+ * Before each fetch of that marketplace’s `marketplace.json`, including a later refresh. Claude Code sends the printed headers with that fetch.
+ * Before each plugin archive download on the marketplace URL’s origin, meaning the same scheme, host, and port. Claude Code sends the output with that download, and no other download gets the headers.
+
+Claude Code ignores any `headersHelper` set in the `.claude/settings.json` or `.claude/settings.local.json` of a directory you add with [`--add-dir`](</docs/en/permissions#what-runs-before-you-trust-a-folder>), on a `url` source and on an inline plugin entry alike, and sends only the fixed `headers` set in that file. [How users accept a headersHelper command](</docs/en/plugin-marketplaces#how-users-accept-a-headershelper-command>) covers the other settings files. Plugins listed in a `settings` source must reference external sources such as GitHub or npm, and the `name` must match the marketplace key. You still enable each plugin separately in `enabledPlugins`. This example declares one plugin inline:
settings.json
@@ -4109,6 +4242,12 @@
}
}
+A plugin entry under `source: 'settings'` whose own `source` is an [`archive`](</docs/en/plugin-marketplaces#zip-archives>) can set `headers` for the archive download. If the value you would put in `headers` is short-lived, such as a token your registry mints on request, set a `headersHelper` command instead. An entry may set both. Both fields require Claude Code v2.1.238 or later. Claude Code sends the entry’s `headers`, and whatever the command prints, with that plugin’s archive download and with no other download. Claude Code runs the command only when a user [installs or updates that one plugin by itself](</docs/en/plugin-marketplaces#how-users-accept-a-headershelper-command>). Three further rules depend on which file holds the entry:
+
+ * **`strict`** : unlike an entry in a marketplace’s `marketplace.json`, an entry in settings doesn’t need `"strict": false`, because a settings file carries no manifest fields to inline. See [Strict mode](</docs/en/plugin-marketplaces#strict-mode>).
+ * **Folder trust** : for an entry in a project’s `.claude/settings.json` or `.claude/settings.local.json`, Claude Code runs the command only after the user has also [trusted that folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>).
+ * **Header filter** : Claude Code drops [request-routing and client-identity header names](</docs/en/plugin-marketplaces#when-claude-code-skips-a-headershelper-command-or-drops-its-output>) from an entry in a project’s `.claude/settings.json` or `.claude/settings.local.json`, because a repository can supply those files. Claude Code applies the same filter to a catalog entry and to an entry in an `--add-dir` directory’s settings, and no filter to an entry in your user settings, a `--settings` file, or managed settings.
+
####
@@ -4178,7 +4317,7 @@
"allowAllClaudeAiMcps": true
}
-`allowedMcpServers` and `deniedMcpServers` still apply to the connectors this key loads. Connectors delivered to [cloud sessions](</docs/en/claude-code-on-the-web>) stay suppressed. See [Allow claude.ai connectors alongside the managed set](</docs/en/managed-mcp#allow-claude-ai-connectors-alongside-the-managed-set>). Requires Claude Code v2.1.149 or later.
+`allowedMcpServers` and `deniedMcpServers` still apply to the connectors this key loads. Connectors delivered to [cloud sessions](</docs/en/claude-code-on-the-web>) stay suppressed. See [Allow claude.ai connectors alongside the managed set](</docs/en/managed-mcp#allow-claude-ai-connectors-alongside-the-managed-set>).
###
@@ -4582,7 +4721,7 @@
`worktree.bgIsolation`
-Choose how [background sessions](</docs/en/agent-view#how-file-edits-are-isolated>) isolate their file edits. With `"worktree"`, Claude Code blocks `Edit` and `Write` in the main checkout until the session calls `EnterWorktree`; with `"none"`, background jobs edit the working copy directly. Set `"none"` for a repository where git worktrees are impractical. Requires Claude Code v2.1.143 or later.
+Choose how [background sessions](</docs/en/agent-view#how-file-edits-are-isolated>) isolate their file edits. With `"worktree"`, Claude Code blocks `Edit` and `Write` in the main checkout until the session calls `EnterWorktree`; with `"none"`, background jobs edit the working copy directly. Set `"none"` for a repository where git worktrees are impractical.
* **Scope** : `Any file`
* **Type** : string, one of:
--- a/skills.md
+++ b/skills.md
@@ -339,7 +339,7 @@
Pre-approve tools for skills
-For project and personal skills, the `allowed-tools` frontmatter field applies only when you use the Claude Code CLI directly. In SDK sessions, manage tool approval for these skills through the `allowedTools` option (`allowed_tools` in Python) in your query configuration. Skills [synced from claude.ai](</docs/en/skills#how-claude-code-handles-the-frontmatter-of-a-synced-skill>) follow their own frontmatter rules.
+For project and personal skills, Claude Code applies the [`allowed-tools`](</docs/en/skills#pre-approve-tools-for-a-skill>) frontmatter field in SDK sessions. You can also pre-approve tools for these skills through the `allowedTools` option (`allowed_tools` in Python) in your query configuration. Skills [synced from claude.ai](</docs/en/skills#how-claude-code-handles-the-frontmatter-of-a-synced-skill>) follow their own frontmatter rules.
Skills run with the session’s tools. The example below pre-approves `Read`, `Grep`, and `Glob` with `allowedTools` (`allowed_tools` in Python), so Claude can inspect files while running the security-check skill without stopping for approval:
@@ -476,13 +476,13 @@
Invalid skill name "docs:*": wildcard-suffix names are not allowed; list each skill by its exact name.
-An empty name reports `Skill names must be non-empty strings.`
+An empty name reports `Skill names must be non-empty strings.`Before TypeScript Agent SDK 0.3.221, the SDK didn’t run this check.
The Python SDK raises `ValueError` stating the rule the entry broke. For example, `skills=["docs:*"]` raises:
ValueError: Invalid skill name 'docs:*': wildcard-suffix names are not allowed; list each skill by its exact name.
-An empty name reports `Skill names must be non-empty strings`.
+An empty name reports `Skill names must be non-empty strings`.Before Python Agent SDK 0.2.129, the SDK didn’t run this check.
###
@@ -498,7 +498,7 @@
Next steps
-The [Claude Code skills guide](</docs/en/skills>) covers authoring in depth. Its guidance applies to SDK sessions, with one exception: for project and personal skills, Pre-approve tools for skills replaces the `allowed-tools` frontmatter field with the `allowedTools` option. Start with these sections:
+The [Claude Code skills guide](</docs/en/skills>) covers authoring in depth. Its guidance applies to SDK sessions. Start with these sections:
* [Frontmatter reference](</docs/en/skills#frontmatter-reference>): every supported field
* [Pass arguments to skills](</docs/en/skills#pass-arguments-to-skills>): `$ARGUMENTS`, `$0`, `$1`, and skill stacking. The [full substitution table](</docs/en/skills#available-string-substitutions>) adds named arguments and the `${CLAUDE_*}` variables
--- a/tool-search.md
+++ b/tool-search.md
@@ -9,7 +9,7 @@
How tool search works
-Tool search is on by default, with the exceptions listed in Configure tool search. When it is active, tool definitions are withheld from the context window. The agent receives a summary of available tools and searches for relevant ones when the task requires a capability not already loaded. Up to five of the most relevant tools are loaded into context by default, where they stay available for subsequent turns. If the conversation is long enough that the SDK compacts earlier messages to free space, previously discovered tools may be removed, and the agent searches again as needed. Tool search adds one extra round-trip the first time Claude discovers a tool (the search step), but for large tool sets this is offset by smaller context on every turn. With fewer than ~10 tools whose definitions fit comfortably in the context window, loading everything upfront is typically faster. For details on the underlying API mechanism, see [Tool search in the API](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool>).
+Tool search is on by default, with the exceptions listed in Configure tool search. When it is active, tool definitions are withheld from the context window. The agent receives a summary of available tools and searches for relevant ones when the task requires a capability not already loaded. Up to five of the most relevant tools are loaded into context by default, where they stay available for subsequent turns. When the SDK compacts earlier messages to free space, it keeps the discovered tools loaded. Tool search adds one extra round-trip the first time Claude discovers a tool (the search step), but for large tool sets this is offset by smaller context on every turn. With fewer than ~10 tools whose definitions fit comfortably in the context window, loading everything upfront is typically faster. For details on the underlying API mechanism, see [Tool search in the API](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool>).
Tool search isn’t supported on Microsoft Foundry [deployments hosted on Azure](<https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry#hosting-options>), which reject it server-side: the SDK detects the rejection and loads tool definitions upfront for that deployment instead. `ENABLE_TOOL_SEARCH` can’t override this, since the rejection comes from the deployment itself.
--- a/tools-reference.md
+++ b/tools-reference.md
@@ -446,7 +446,13 @@
* When a URL redirects to a different host, WebFetch returns a text result that names the original URL and the redirect target instead of following it. Claude then fetches the new URL with a second WebFetch call.
* When the extraction step hits an overloaded API, Claude Code retries it with backoff; a fetch that still fails returns an error result. Before v2.1.212, the API error text could reach Claude as if it were the extracted page content.
-In the `default` and `acceptEdits` permission modes, WebFetch prompts the first time it reaches a new domain, except for a built-in set of preapproved documentation domains that fetch without a prompt. To allow another domain in advance without a prompt, add a permission rule like `WebFetch(domain:example.com)`. The `auto` and `bypassPermissions` [permission modes](</docs/en/permissions#permission-modes>) skip the prompt entirely. An explicit `WebFetch(domain:...)` rule in `deny`, `ask`, or `allow` takes precedence over the preapproved set, so you can block a preapproved domain or require a prompt for it. WebFetch sets a `User-Agent` header beginning with `Claude-User`, and an `Accept` header that prefers Markdown over HTML so servers that support content negotiation can return Markdown directly. You configure [sandbox](</docs/en/sandboxing>) network rules separately, so a domain you want a sandboxed process to reach still needs an explicit sandbox permission rule.
+In Manual and `acceptEdits` [permission modes](</docs/en/permission-modes>), WebFetch prompts before fetching, except for domains your [permission rules](</docs/en/permissions#manage-permissions>) already allow or deny and a built-in set of preapproved documentation domains that fetch without a prompt. Whatever your rules allow, a fetch also passes the [WebFetch domain safety check](</docs/en/data-usage#webfetch-domain-safety-check>) first; that section covers what the check sends and the setting that skips it. The prompt offers three options:
+
+ * **Yes** : approves this fetch only. The next WebFetch call prompts again, even for the same domain.
+ * **Yes, and don’t ask again for`<domain>`**: approves the fetch and saves a `WebFetch(domain:...)` allow rule for that domain to `.claude/settings.local.json` for that repository. See [how saved approvals persist](</docs/en/permissions#permission-system>). When your organization sets [`allowManagedPermissionRulesOnly`](</docs/en/permissions#managed-only-settings>), Claude Code hides this option.
+ * **No, and tell Claude what to do differently** : rejects the fetch.
+
+To allow a domain in advance without a prompt, add an allow rule like `WebFetch(domain:example.com)`; `WebFetch(domain:*)` allows every domain. The `auto` and `bypassPermissions` [permission modes](</docs/en/permissions#permission-modes>) skip the prompt, except for a domain an explicit `ask` rule matches. An explicit `WebFetch(domain:...)` rule in `deny`, `ask`, or `allow` takes precedence over the preapproved set, so you can block a preapproved domain or require a prompt for it. WebFetch sets a `User-Agent` header beginning with `Claude-User`, and an `Accept` header that prefers Markdown over HTML so servers that support content negotiation can return Markdown directly. Sandboxed commands don’t inherit WebFetch’s built-in set of preapproved documentation domains. To let a sandboxed command reach a domain without a prompt, add the domain to [`allowedDomains`](</docs/en/settings-reference#sandbox-network-alloweddomains>) or allow it with a `WebFetch(domain:...)` rule, which the [sandbox also honors](</docs/en/sandboxing#network-isolation>). WebFetch never reads the sandbox allowlist in return, so adding a domain to a sandbox or organization network allowlist doesn’t stop WebFetch from prompting for it.
##
--- a/vs-code.md
+++ b/vs-code.md
@@ -44,7 +44,7 @@
* **Activity Bar** : click the Spark icon in the left sidebar to open the sessions list. Click any session to open it as a full editor tab, or start a new one. This icon is always visible in the Activity Bar.
* **Command Palette** : `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux), type “Claude Code”, and select an option like “Open in New Tab”
- * **Status Bar** : click **✱ Claude Code** in the bottom-right corner of the window. This works even when no file is open.
+ * **Status Bar** : if you’ve set `preferredLocation` to `sidebar`, or opened Claude with **Claude Code: Open in Side Bar** , click **✱ Claude Code** in the bottom-right corner of the window. This works even when no file is open.
You can drag the Claude panel to reposition it anywhere in VS Code. See Customize your workflow for details.
@@ -92,7 +92,7 @@
* **Edit automatically** : Claude makes edits without asking.
* **Command menu** : click `/` or type `/` to open the command menu. Options include attaching files, switching models, toggling extended thinking, viewing plan usage (`/usage`), and starting a [Remote Control](</docs/en/remote-control>) session (`/remote-control`). The Customize section provides access to MCP servers, hooks, memory, permissions, and plugins. Items with a terminal icon open in the integrated terminal.
* The Settings section includes **Enable Remote Control for all sessions** , which sets [`remoteControlAtStartup`](</docs/en/settings-reference#remotecontrolatstartup>) to control whether [new interactive sessions connect to Remote Control automatically](</docs/en/remote-control#enable-remote-control-for-all-sessions>). Requires Claude Code v2.1.203 or later.
- * The Settings section also includes **Focus view** , which hides tool calls, tool results, and thinking behind expandable rows, leaving your prompts and Claude’s responses. Claude’s latest to-do list stays visible, and so does the text a pending question from Claude is asking about. Toggle it there, with `Ctrl+Option+F` (Mac) / `Ctrl+Alt+F` (Windows/Linux), or from the Command Palette with **Claude Code: Toggle Focus view**. The change applies to every open session and persists across sessions. Requires Claude Code v2.1.221 or later.
+ * The Settings section also includes **Focus view** , which hides tool calls, tool results, and thinking behind expandable rows, leaving your prompts and Claude’s responses. Claude’s latest to-do list stays visible, and so does the text a pending question from Claude is asking about; this requires Claude Code v2.1.225 or later. Toggle it there, with `Ctrl+Option+F` (Mac) / `Ctrl+Alt+F` (Windows/Linux), or from the Command Palette with **Claude Code: Toggle Focus view**. The change applies to every open session and persists across sessions. Requires Claude Code v2.1.221 or later.
* To report a bug, click **Report a problem** at the bottom of the menu, or type `/bug` or `/feedback` with an optional description that prefills the report. When you submit the report and you’re signed in to Anthropic on a first-party connection, Claude Code sends it to Anthropic. On a third-party provider, or without Anthropic credentials, the dialog still opens, but submitting shows an error and sends nothing: unlike the CLI’s `/bug`, the extension doesn’t write a local archive. Requires Claude Code v2.1.229 or later.
* **Side questions** : type `/btw` followed by a question, or pick it from the command menu, to ask about your session [without adding to the conversation](</docs/en/interactive-mode#side-questions-with-%2Fbtw>). The answer opens in a panel beside the chat, where you can ask follow-up questions. The thread survives window reloads. Claude Code keeps the newest 20 exchanges and expires stored threads on the [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) schedule, as long as Claude Code can [safely determine the retention period](</docs/en/claude-directory#cleaned-up-automatically>). To clear a thread, click the trash icon in the panel. Requires Claude Code v2.1.227 or later.
* **Context indicator** : the prompt box shows how much of Claude’s context window you’re using. Claude automatically compacts when needed, or you can run `/compact` manually.
@@ -278,14 +278,14 @@
Command| Shortcut| Description
---|---|---
Focus Input| `Cmd+Esc` (Mac) / `Ctrl+Esc` (Windows/Linux)| Toggle focus between editor and Claude
-Open in Side Bar| -| Open Claude in the left sidebar
+Open in Side Bar| -| Open Claude in the sidebar
Open in Terminal| -| Open Claude in terminal mode
Open in New Tab| `Cmd+Shift+Esc` (Mac) / `Ctrl+Shift+Esc` (Windows/Linux)| Open a new conversation as an editor tab
Open in New Window| -| Open a new conversation in a separate window
New Conversation| `Cmd+N` (Mac) / `Ctrl+N` (Windows/Linux)| Start a new conversation. Requires Claude to be focused and `enableNewConversationShortcut` set to `true`
Reopen Closed Session| `Cmd+Shift+T` (Mac) / `Ctrl+Shift+T` (Windows/Linux)| Reopen the most recently closed Claude session tab. Falls through to VS Code’s normal reopen-closed-editor when the last closed tab wasn’t a Claude session. Disable with `enableReopenClosedSessionShortcut`
Insert @-Mention Reference| `Option+K` (Mac) / `Alt+K` (Windows/Linux)| Insert a reference to the current file and selection (requires editor to be focused)
-Toggle Focus view| `Ctrl+Option+F` (Mac) / `Ctrl+Alt+F` (Windows/Linux)| Hide or show tool activity in the conversation. Works while a Claude panel or sidebar is visible
+Toggle Focus view| `Ctrl+Option+F` (Mac) / `Ctrl+Alt+F` (Windows/Linux)| Hide or show tool activity in the conversation. Works while a Claude panel or sidebar is visible. Requires Claude Code v2.1.221 or later
Show Logs| -| View extension debug logs
Logout| -| Sign out of your Anthropic account
@@ -361,7 +361,7 @@
`enableNewConversationShortcut`| `false`| Enable Cmd/Ctrl+N to start a new conversation
`enableReopenClosedSessionShortcut`| `true`| Use Cmd/Ctrl+Shift+T to reopen the most recently closed Claude session tab. When the last closed tab wasn’t a Claude session, the shortcut runs VS Code’s normal reopen-closed-editor command instead.
`hideOnboarding`| `false`| Hide the onboarding checklist (graduation cap icon)
-`focusView`| `false`| Hide tool calls, tool results, and thinking behind expandable rows, leaving your prompts and Claude’s responses. Claude’s latest to-do list stays visible. You can also toggle Focus view from the command menu. Requires Claude Code v2.1.221 or later
+`focusView`| `false`| Hide tool calls, tool results, and thinking behind expandable rows, leaving your prompts and Claude’s responses. Claude’s latest to-do list stays visible; this requires Claude Code v2.1.225 or later. You can also toggle Focus view from the command menu. Requires Claude Code v2.1.221 or later
`respectGitIgnore`| `true`| Exclude .gitignore patterns from file searches
`usePythonEnvironment`| `true`| Activate the workspace’s Python environment when running Claude. Requires the Python extension.
`environmentVariables`| `[]`| Set environment variables for the Claude process. Use Claude Code settings instead for shared config.
@@ -444,7 +444,7 @@
Monitor background processes
-When Claude runs long-running commands, the extension shows progress in the status bar. However, visibility for background tasks is limited compared to the CLI. For better visibility, have Claude output the command so you can run it in VS Code’s integrated terminal.
+Visibility for background tasks in the extension is limited compared to the CLI. For better visibility, have Claude output the command so you can run it in VS Code’s integrated terminal.
###
@@ -566,7 +566,7 @@
4. **Disable conflicting extensions** : Temporarily disable other AI extensions (Cline, Continue, etc.)
5. **Check workspace trust** : The extension doesn’t work in Restricted Mode
-Alternatively, click ”✱ Claude Code” in the **Status Bar** (bottom-right corner). This works even without a file open. You can also use the **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) and type “Claude Code”.
+Alternatively, if you’ve set `preferredLocation` to `sidebar`, or opened Claude with **Claude Code: Open in Side Bar** , click ”✱ Claude Code” in the **Status Bar** (bottom-right corner). This works even without a file open. You can also use the **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) and type “Claude Code”.
###
--- a/workflows.md
+++ b/workflows.md
@@ -323,7 +323,7 @@
Prompt caching in a fan-out
-Agents in the same run can read each other’s [prompt cache](</docs/en/prompt-caching#subagents-and-the-cache>). Two agents that run with the same model, effort level, agent type, tools, output schema, and working directory build the same tools-and-system-prompt prefix, so an agent that starts after a matching sibling’s response has begun reads that sibling’s cache on its first request. When a fan-out starts several matching agents at once, Claude Code holds all but the first until the first agent’s response begins, then releases the held agents together so their first requests read the shared prefix instead of each processing it uncached. Claude Code caps the hold at [`CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS`](</docs/en/env-vars>) milliseconds, `5000` by default. Set it to `0` to disable the hold.
+Agents in the same run can read each other’s [prompt cache](</docs/en/prompt-caching#subagents-and-the-cache>). Two agents that run with the same model, effort level, agent type, tools, output schema, and working directory build the same tools-and-system-prompt prefix, so an agent that starts after a matching sibling’s response has begun reads that sibling’s cache on its first request. A workflow agent’s requests fall outside the main conversation’s [cache TTL bucket](</docs/en/prompt-caching#which-ttl-each-request-gets>), so its cache holds for five minutes by default, including on a Claude subscription. To keep it for an hour, set [`subagentPromptCacheTtl`](</docs/en/settings-reference#subagentpromptcachettl>) to `1h`. The API bills 1-hour cache writes at a higher rate. When a fan-out starts several matching agents at once, Claude Code holds all but the first until the first agent’s response begins, then releases the held agents together so their first requests read the shared prefix instead of each processing it uncached. Claude Code caps the hold at [`CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS`](</docs/en/env-vars>) milliseconds, `5000` by default. Set it to `0` to disable the hold.
###
--- a/worktrees.md
+++ b/worktrees.md
@@ -161,7 +161,7 @@
Copy gitignored files into worktrees
-A worktree is a fresh checkout, so untracked files like `.env` or `.env.local` from your main repository are not present. To copy them automatically when Claude creates a worktree, add a `.worktreeinclude` file to your project root. The file uses `.gitignore` syntax. Only files that match a pattern and are also gitignored are copied, so tracked files are never duplicated. This `.worktreeinclude` copies two env files and a secrets config into each new worktree:
+A worktree is a fresh checkout, so untracked files like `.env` or `.env.local` from your main repository are not present. To copy them automatically when Claude creates a worktree, add a `.worktreeinclude` file to your project root. The file uses `.gitignore` syntax. Only files that match a pattern and are also gitignored are copied, so tracked files are never duplicated. If you write a pattern that starts with `**/` and the files you want are inside a directory that is gitignored as a whole, Claude Code copies them only when that directory itself matches the pattern, or when the first name after the `**/` is one of the names in the directory’s path. For example, if you write `**/.claude/skills/*.md`, that first name is `.claude`, so Claude Code copies the matching files out of an ignored `.claude/` directory. To copy files out of an ignored directory that a `**/` pattern doesn’t reach, name the directory in the pattern instead: write `vendor/**/config.json` rather than `**/config.json`. Before v2.1.239, Claude Code copied files out of a wholly ignored directory for a `**/` pattern only when the directory itself matched the pattern. This `.worktreeinclude` copies two env files and a secrets config into each new worktree:
.worktreeinclude