Changes on
49 changes detected
--- a/2026-w34.md
+++ b/2026-w34.md
@@ -2,7 +2,7 @@
/designresearch preview
-The `/design` skill brings Claude Design’s artboard workflow into the CLI and Claude Code Desktop, built on artifacts. Run it with a brief and Claude publishes a canvas of editable artboards for your UI. Pick one, tweak it, then have Claude implement it. Available on Pro, Max, Team, and Enterprise. Requires v2.1.233 or later.
+The `/design` skill brings Claude Design’s artboard workflow into the CLI and Claude Code Desktop, built on artifacts. Run it with a brief and Claude publishes a canvas of editable artboards for your UI. Pick one, tweak it, then have Claude implement it. Available on Pro, Max, Team, and Enterprise. Requires v2.1.234 or later.
Describe what you want designed and let Claude draft the options:
--- a/agent-teams.md
+++ b/agent-teams.md
@@ -126,17 +126,19 @@
Claude Code picks each teammate’s model from the first of these that applies:
- 1. [`CLAUDE_CODE_SUBAGENT_MODEL`](</docs/en/model-config#environment-variables>), when it’s set to anything other than `inherit`.
- 2. The model your spawn prompt names for that teammate.
- 3. For an in-process teammate spawned from a subagent definition, the definition’s `model`.
+ 1. The model your spawn prompt names for that teammate.
+ 2. For a teammate spawned from a subagent definition, the definition’s `model`, where `inherit` selects the lead’s model.
+ 3. [`CLAUDE_CODE_SUBAGENT_MODEL`](</docs/en/model-config#environment-variables>), when it’s set to anything other than `inherit`.
4. The lead’s current model.
-`teammateDefaultModel` was removed in v2.1.234; Claude Code ignores a leftover value. Name the model in your prompt or set `CLAUDE_CODE_SUBAGENT_MODEL` instead.
-
-Claude Code checks the model your prompt requests for a teammate, or the one `CLAUDE_CODE_SUBAGENT_MODEL` supplies, against your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist. When the allowlist blocks a value, Claude Code substitutes another model:
+Before v2.1.251, `CLAUDE_CODE_SUBAGENT_MODEL` came first in this order.
+
+`teammateDefaultModel` was removed in v2.1.234; Claude Code ignores a leftover value. Name the model in your prompt instead.
+
+Claude Code checks the model it selects for a teammate against your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist. When the allowlist blocks a value, Claude Code substitutes another model:
* **Family alias such as`opus`**: On the Anthropic API and Claude Platform on AWS, Claude Code runs the teammate on the newest version of that family the allowlist permits. On providers with provider-specific model IDs, where the [substitution doesn’t operate](</docs/en/model-config#restrict-model-selection>), a blocked alias falls back like any other blocked value per the next bullet
- * **Any other blocked value, including a family alias on providers where the substitution doesn’t operate or whose family has no permitted version** : Claude Code runs the teammate on the lead’s model
+ * **Any other blocked value, including a family alias on providers where the substitution doesn’t operate, or one whose family has no permitted version** : Claude Code runs the teammate on the lead’s model instead. If you set `CLAUDE_CODE_SUBAGENT_MODEL`, Claude Code tries that model first, under these same rules
Teammates inherit the lead’s [effort level](</docs/en/model-config#adjust-effort-level>). In split-pane mode this applies from v2.1.186; earlier versions did not pass the lead’s session effort to split-pane teammates.
@@ -253,7 +255,7 @@
Claude Code reads the subagent definition you named and applies these parts of it to the teammate. Where a part depends on the teammate’s display mode, the entry says so:
* **`tools`** : Claude Code limits the teammate to the tools in the definition’s `tools` list. For an in-process teammate, Claude Code adds `SendMessage` to that list, and in a [session that has the Task tools](</docs/en/tools-reference#task-tool-availability>) it adds `TaskCreate`, `TaskGet`, `TaskList`, and `TaskUpdate` too.
- * **`model`** : for an in-process teammate, Claude Code uses the definition’s `model` when neither `CLAUDE_CODE_SUBAGENT_MODEL` nor your spawn prompt names a model. A split-pane teammate doesn’t use the definition’s `model`. See how Claude Code picks a teammate’s model.
+ * **`model`** : Claude Code uses the definition’s `model` in either display mode when your spawn prompt doesn’t name one. See how Claude Code picks a teammate’s model.
* **Body** : for an in-process teammate, Claude Code appends the definition’s body to its default system prompt as additional instructions. For a split-pane teammate, Claude Code uses the body in place of its default system prompt.
* **`skills`** : Claude Code doesn’t apply the definition’s `skills` to a teammate in either display mode. The teammate loads skills from your project and user settings.
* **`mcpServers`** : for a split-pane teammate, Claude Code applies the definition’s `mcpServers` under the [rules for that field](</docs/en/sub-agents#scope-mcp-servers-to-a-subagent>), which cover a session started with `--agent` as well. An in-process teammate ignores the field and loads MCP servers from your project and user settings.
--- a/agent-view.md
+++ b/agent-view.md
@@ -256,7 +256,7 @@
From agent view
-Type a prompt in the input at the bottom of agent view and press `Enter` to start a new background session. The session is named automatically from the prompt; rename it later with `Ctrl+R`. The automatic name is a short label written by a [Haiku-class model](</docs/en/model-config>). A name the session gets later also appears on its row, including the [generated title](</docs/en/sessions#name-your-sessions>) the session gets when you [accept a plan](</docs/en/permission-modes#review-and-approve-a-plan>) in that session. Paste an image into the prompt to include a screenshot or diagram with the task. Pasted text longer than 800 characters or more than two lines collapses to a `[Pasted text #N]` placeholder so the input stays on one line; the full text is sent when you dispatch. To review or edit the collapsed text before dispatching, paste the same text again and the placeholder expands back into the input. Prefix or mention parts of the prompt to control how the session starts:
+Type a prompt in the input at the bottom of agent view and press `Enter` to start a new background session. The session is named automatically from the prompt; rename it later with `Ctrl+R`. The automatic name is a short label written by a [Haiku-class model](</docs/en/model-config>). A name the session gets later also appears on its row, including the [generated title](</docs/en/sessions#name-your-sessions>) the session gets when you [accept a plan](</docs/en/permission-modes#review-and-approve-a-plan>) in that session. Paste an image into the prompt to include a screenshot or diagram with the task. Pasted text longer than 800 characters or more than three lines collapses to a `[Pasted text #N]` placeholder so the input stays on one line; the full text is sent when you dispatch. To review or edit the collapsed text before dispatching, paste the same text again and the placeholder expands back into the input. Prefix or mention parts of the prompt to control how the session starts:
Input| Effect
---|---
@@ -496,7 +496,7 @@
What persists across restarts
-The permission mode, model, and effort you chose for a background session, along with the configuration flags it carries, all persist when the supervisor later stops and restarts its process. A session you launched with `claude --bg --dangerously-skip-permissions` or `claude --bg --permission-mode bypassPermissions` stays in `bypassPermissions` after that restart. A model or effort you changed mid-session with `/model` or `/effort` is kept too. If the session took its effort from the [`effortLevel` setting](</docs/en/settings-reference#effortlevel>) rather than from `--effort` or `/effort`, Claude Code reads the setting again each time it starts a process for the session. So when you edit `effortLevel` in `settings.json`, the change reaches sessions you background with `←` or `/bg`, and their later restarts. Claude Code also keeps a name you set with [`/rename`](</docs/en/commands>) or `Ctrl+R` across that restart, so you can still run [`claude --resume <name>`](</docs/en/sessions#name-your-sessions>) to reach the session.
+The permission mode, model, and effort you chose for a background session, along with the configuration flags it carries, all persist when the supervisor later stops and restarts its process. A session you launched with `claude --bg --dangerously-skip-permissions` or `claude --bg --permission-mode bypassPermissions` stays in `bypassPermissions` after that restart. A model or effort you changed mid-session with `/model` or `/effort` is kept too. If the session took its effort from your settings rather than from `--effort` or `/effort`, Claude Code reads your settings again each time it starts a process for the session. So when you edit the saved effort in `settings.json`, the change reaches sessions you background with `←` or `/bg`, and their later restarts. The saved effort is the [`effortLevel`](</docs/en/settings-reference#effortlevel>) key or a [`modelSettings`](</docs/en/settings-reference#modelsettings>) entry. Claude Code also keeps a name you set with [`/rename`](</docs/en/commands>) or `Ctrl+R` across that restart, so you can still run [`claude --resume <name>`](</docs/en/sessions#name-your-sessions>) to reach the session.
###
--- a/amazon-bedrock.md
+++ b/amazon-bedrock.md
@@ -485,7 +485,7 @@
Streaming errors behind a gateway or proxy
-If streaming requests fail with an error that begins `Bedrock streaming response has content-type`, a gateway or proxy between Claude Code and Amazon Bedrock is transforming the streaming response. Amazon Bedrock streams responses in a binary event-stream format with the content-type `application/vnd.amazon.eventstream`, and Claude Code rejects a successful streaming response that reports a different content-type instead of decoding a body it can’t read. The error names the content-type it received, commonly `text/event-stream` from an Amazon API Gateway and Lambda integration that re-emits the stream as server-sent events. Before v2.1.208, the same misconfiguration surfaced as `API Error: Truncated event message received` after the whole response had been buffered. To fix it, configure the gateway to pass the `InvokeModelWithResponseStream` response body and its `Content-Type` header through unmodified. If the gateway rewrites only the header and passes the binary body through intact, set [`CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD=1`](</docs/en/env-vars>) to skip the check until the gateway is fixed. With the check off, a response body that was transformed fails with `Truncated event message received` again. When a successful streaming response arrives with a missing or empty `Content-Type` header, Claude Code decodes the body as the binary event-stream format. Amazon Bedrock always sends the header, so a missing header means an intermediary stripped it. If your proxy strips the header and also re-emits the body as server-sent events, set [`CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT=1`](</docs/en/env-vars>) so Claude Code reads the body as server-sent events instead.
+Amazon Bedrock streams `InvokeModelWithResponseStream` responses in a binary event-stream format with the header `Content-Type: application/vnd.amazon.eventstream`. A gateway or proxy between Claude Code and Amazon Bedrock must forward the response body and its headers, including `Content-Type`, as Amazon Bedrock sent them. If the gateway rewrites `Content-Type` to another value, Claude Code rejects the response with an error that begins `Bedrock streaming response has content-type`, naming the value it received. The common rewrite is `text/event-stream`, from an integration that re-emits the stream as server-sent events. If the gateway drops or blanks the header instead, Claude Code assumes the body is Amazon Bedrock’s event stream and decodes it, so a body the gateway passed through unmodified keeps streaming. If a gateway that drops the header also re-emits the stream as server-sent events, Claude Code can’t decode the body and falls back to a slower non-streaming path on every turn: each response appears only once it is complete instead of streaming in. In that case, set [`CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT=1`](</docs/en/env-vars>) so Claude Code reads the body as server-sent events instead. To fix the error or the fallback, configure the gateway to forward the `InvokeModelWithResponseStream` response body and its `Content-Type` header unmodified. A gateway that converts the stream to server-sent events is no longer serving the Amazon Bedrock API. If it also accepts Anthropic Messages API requests, connect to it as an [LLM gateway](</docs/en/llm-gateway-connect>) with `ANTHROPIC_BASE_URL` instead of `CLAUDE_CODE_USE_BEDROCK`.
###
--- a/artifacts.md
+++ b/artifacts.md
@@ -101,10 +101,10 @@
When you share an artifact within your organization, the people you share it with can leave comments on the page, and you can have Claude read those comments and reply to them. You need Claude Code v2.1.221 or later and a Team or Enterprise plan, because only an artifact you share within your organization takes comments. Claude reads the comments in two cases:
- * **You ask Claude to read them** : give Claude the artifact’s URL and ask for the comments. Claude lists each thread and marks the comments a commenter sent to it.
- * **A commenter sends a comment to Claude** : in a thread on the page, the commenter mentions `@claude` or uses the thread’s Claude control, where the page offers one. Either gesture activates the thread, and Claude can reply only in a thread someone activated. Viewers see each reply attributed to Claude, via you.
-
-If you share an artifact publicly, viewers can’t comment on it: the page says `Comments aren't available while this Artifact is shared publicly.` To switch an artifact that already has comment threads to a public link, delete the threads first. To ask for the comments yourself, give Claude the URL:
+ * **You ask Claude to read them** : give Claude the artifact’s URL and ask for the comments. Claude lists each thread and marks the comments someone who can edit the artifact sent to it.
+ * **Someone who can edit the artifact sends a comment to Claude** : in a thread on the page, they send a comment with **Send to Claude** , or mention `@claude` in one. Either way, they activate the thread.
+
+Claude can reply to or resolve only an activated thread. Other threads stay open until a person resolves them on the page. Viewers see each reply attributed to Claude, via you. If you share an artifact publicly, viewers can’t comment on it: the page says `Comments aren't available while this Artifact is shared publicly.` To switch an artifact that already has comment threads to a public link, delete the threads first. To ask for the comments yourself, give Claude the URL:
Read the comments on https://claude.ai/code/artifact/5fbea6f3-... and make the changes the commenters ask for.
@@ -120,17 +120,19 @@
Let Claude reply to comments on its own
-After your session publishes an artifact, Claude Code watches that artifact for comments for as long as the session runs. When a commenter sends a comment to Claude, it reaches your session right away, and Claude can read the thread and reply without you asking. You need Claude Code v2.1.228 or later. If you turned [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) off, Claude Code doesn’t watch for comments. Your [permission mode](</docs/en/permission-modes>) decides what Claude does when a sent comment arrives:
+After your session publishes an artifact, Claude Code watches that artifact for comments for as long as the session runs. When someone who can edit the artifact sends a comment to Claude, it reaches your session right away, and Claude can read the thread and reply without you asking. You need Claude Code v2.1.228 or later. If you turned [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) off, Claude Code doesn’t watch for comments. Your [permission mode](</docs/en/permission-modes>) decides what Claude does when a sent comment arrives:
* **Claude replies on its own** : when your permission mode lets Claude post the reply without asking you, Claude reads the thread and replies, and edits the artifact when the comment asks for a change. You see `Auto-replied to comment thread on Artifact: <name>` or `Auto-edited Artifact: <name> in response to a comment thread`.
* **Claude waits for you** : outside plan mode, when posting the reply would need your approval, you see `Comments are waiting on Artifact: <name>`. Claude then asks you for approval to read the thread, and again to post the reply.
* **Claude pauses in plan mode** : you see `Comments are waiting on Artifact: <name>`, and Claude doesn’t reply until you leave plan mode and ask it to read and reply.
-Claude also stops replying on its own to an artifact after it handles 60 sent comments or thread activations on that artifact within an hour. You see `Comments are waiting on Artifact: <name>` once, and Claude picks up again as that hour’s comments age out. Run `/tasks` to see each artifact your session is watching, listed as a live-updates task. You can stop Claude from replying on its own in three ways, and each one lasts a different length of time:
-
- * **Press Ctrl+C once** : Claude stops replying on every artifact your session is watching, and starts again on an artifact when you have your session publish it again.
- * **Stop the task in`/tasks`**: Claude stops replying on that artifact for the rest of the session. Publishing it again doesn’t start replies again, and if you resume the session later, Claude still doesn’t reply there.
- * **Press`Ctrl+X Ctrl+K` twice within 3 seconds**: the chord that [stops every running background subagent](</docs/en/interactive-mode#general-controls>) also stops Claude from replying on every artifact for the rest of the session.
+Claude also stops replying on its own to an artifact after it handles 60 sent comments or thread activations on that artifact within an hour. You see `Comments are waiting on Artifact: <name>` once, and Claude picks up again as that hour’s comments age out. Run `/tasks` to see each artifact your session is watching, listed as a live-updates task. You can stop Claude from replying on its own in any of these ways:
+
+ * **Press Ctrl+C once at an idle prompt** : Claude pauses replying on every artifact your session is watching. Replies start again after you send your next message.
+ * **Stop the task in`/tasks`**: Claude stops replying on that artifact until you ask it to resume replies there. Publishing the artifact again doesn’t start replies again, and the stop still applies when you resume the session later.
+ * **Press`Ctrl+X Ctrl+K` twice within 3 seconds**: the chord that [stops every running background subagent](</docs/en/interactive-mode#general-controls>) also stops Claude from replying on every artifact for the rest of the session. Asking Claude to resume replies doesn’t undo this stop.
+
+If the service that delivers comments becomes unavailable or stops answering, Claude Code keeps trying to reconnect for a while, then stops watching each artifact your session was watching.
##
@@ -243,6 +245,18 @@
- Spacing: 8px scale, 6px border radius
Claude treats your design system as higher precedence than its own choices, and your prompt as higher precedence than both. The heading and format above are an example; any clear list of colors, fonts, and spacing works. For typography, Claude can load a typeface from Google Fonts, the one external font source an artifact page can load from. Claude inlines any other typeface as a `@font-face` data URI and gives every typeface a fallback stack, so the page still renders if a font doesn’t load. To use a specific typeface, name it in your prompt or your design system.
+
+##
+
+
+
+Draft a design canvas
+
+To mock up a UI, a screen flow, a landing page, or a poster rather than build a page, run `/design` with a brief. Claude drafts the design as artboards on one canvas and publishes the canvas as an artifact that runs a research preview of Claude Design’s editor. The brief names what you want drawn:
+
+ /design a settings screen for a mobile banking app
+
+Open the published artifact to review the artboards. Where saving is enabled for your account, select an element on an artboard, change it, and save to publish a new version; otherwise you view the draft and export it as PNG or PDF. `/design` requires a session where artifacts are available and Claude Code v2.1.234 or later.
##
--- a/authentication.md
+++ b/authentication.md
@@ -10,7 +10,7 @@
* **Claude Pro or Max subscription** : log in with your Claude.ai account. Subscribe at [claude.com/pricing](<https://claude.com/pricing?utm_source=claude_code&utm_medium=docs&utm_content=authentication_pro_max>).
* **Claude for Teams or Enterprise** : log in with the Claude.ai account your team admin invited you to.
- * **Claude Console** : log in with your Console credentials. Your admin must have invited you first.
+ * **Claude Console** : log in with your Console credentials. Your admin must have invited you first. You can sign in with or without creating an API key.
* **Cloud providers** : if your organization uses [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>), set the required environment variables before running `claude`, or select **3rd-party platform** at the login prompt, which launches an interactive setup wizard for Bedrock and Vertex AI. No browser login is needed.
* **Cloud gateway** : if your organization runs a self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>), sign in with corporate SSO through `/login`. The gateway-issued token is the session’s only credential.
@@ -103,6 +103,31 @@
* [Install Claude Code](</docs/en/setup#install-claude-code>)
* Log in with Console account credentials
+####
+
+
+
+Sign in without an API key
+
+You can sign in to your Console account without creating an API key, even when your organization doesn’t let developers create them. Choose the Anthropic Console account at the `/login` prompt and Claude Code asks how you want to sign in. Requires Claude Code v2.1.242 or later. Both routes sign you in to Console in the browser and differ in what Claude Code stores afterwards:
+
+ * **Sign in with your Console account** , labeled `(recommended)`: Claude Code keeps the OAuth token from that sign-in and stores it as an Anthropic profile. It creates no API key
+ * **Create an API key** , labeled `(legacy)`: Claude Code creates a Console API key for you and stores it with your other credentials
+
+In practice, the profile stores an OAuth login while an API key is a static credential: Claude Code refreshes the profile’s login automatically, and when refresh fails, requests fail with [Anthropic profile login expired](</docs/en/errors#anthropic-profile-login-expired>) until you sign in again. You don’t get the choice on every machine. Claude Code creates an API key without asking in these cases:
+
+ * You run against a cloud provider, such as [Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry](</docs/en/third-party-integrations>) or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>)
+ * Any settings file sets `forceLoginOrgUUID`, or sets `forceLoginMethod` to `"claudeai"` or `"console"`
+ * A managed settings source on your machine, such as the managed settings file, an MDM profile, or the cached server-managed settings, exists but Claude Code [can’t read it](</docs/en/managed-settings#invalid-entries-in-managed-settings>) and no other managed source supplies a policy
+
+Unset `ANTHROPIC_API_KEY` before you sign in without a key. A profile written by Claude Code’s own Console sign-in, or by the Claude Platform CLI’s `ant auth login`, is the same kind of credential, so signing in again replaces it. After you sign in without a key, you have a profile instead of a stored API key:
+
+ * **Which profile it writes** : Claude Code writes the profile named by `ANTHROPIC_PROFILE`, or your active profile, or `default`. If that profile is a federation profile, Claude Code refuses the sign-in instead of overwriting it
+ * **What it signs you out of** : Claude Code signs you out of any claude.ai login stored on the machine
+ * **How to undo it** : run `/logout`, which removes and revokes the credential this sign-in wrote
+
+Everything else about profiles applies to this sign-in, including where it ranks against your other credentials, the `Profile` row you get in `/status`, and the features that need a claude.ai login. See Anthropic profiles and federation credentials.
+
###
@@ -135,7 +160,7 @@
Restrict login to your organization
-To require that developers’ claude.ai logins belong to a specific Anthropic organization, set [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>) and [`forceLoginOrgUUID`](</docs/en/settings-reference#forceloginorguuid>) in [managed settings](</docs/en/managed-settings>). Set `forceLoginOrgUUID` to your organization ID, shown in [claude.ai admin settings](<https://claude.ai/admin-settings/organization>) for Claude for Teams or Enterprise organizations. Claude Code reports an error for a claude.ai login to any other organization and exits at startup if the claude.ai credential in use belongs to an organization that isn’t listed. For Claude Console logins, Claude Code uses `forceLoginOrgUUID` only to pre-select the organization on the Console sign-in page when you set it to a single Console organization ID, shown at [platform.claude.com/settings/organization](<https://platform.claude.com/settings/organization>). It doesn’t check which organization the resulting Console credential belongs to, at login or at startup, and a developer who logged in with a Console account before you deployed the keys stays logged in. To direct developers to claude.ai sign-in instead, set `forceLoginMethod` to `"claudeai"`. Developers can log in from several paths: the terminal `/login` flow, the [VS Code extension](</docs/en/vs-code>), the Agent SDK, `claude setup-token`, `/install-github-app`, and [gateway](</docs/en/claude-apps-gateway>) sign-in for organizations that route through a cloud gateway. On Claude Code v2.1.212 or later, every path applies `forceLoginMethod`; before v2.1.212, only terminal logins applied either key. On the terminal’s interactive login screen, reached by `/login` or first-run onboarding, Claude Code pre-selects a `claudeai` or `console` method without enforcing it, so even with `forceLoginMethod` set to `"claudeai"`, a developer can still complete a Console login there. The paths differ on `forceLoginOrgUUID`:
+To require that developers’ claude.ai logins belong to a specific Anthropic organization, set [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>) and [`forceLoginOrgUUID`](</docs/en/settings-reference#forceloginorguuid>) in [managed settings](</docs/en/managed-settings>). Set `forceLoginOrgUUID` to your organization ID, shown in [claude.ai admin settings](<https://claude.ai/admin-settings/organization>) for Claude for Teams or Enterprise organizations. Claude Code reports an error for a claude.ai login to any other organization and exits at startup if the claude.ai credential in use belongs to an organization that isn’t listed. For Claude Console logins, Claude Code uses `forceLoginOrgUUID` to pre-select the organization on the Console sign-in page when you set it to a single Console organization ID, shown at [platform.claude.com/settings/organization](<https://platform.claude.com/settings/organization>). It doesn’t check which organization the resulting Console credential belongs to, at login or at startup, and a developer who logged in with a Console account before you deployed the keys stays logged in. If you set `forceLoginOrgUUID` in any settings file, Claude Code stops offering the keyless Console sign-in in the sessions that file applies to and creates an API key instead. To direct developers to claude.ai sign-in instead, set `forceLoginMethod` to `"claudeai"`. Developers can log in from several paths: the terminal `/login` flow, the [VS Code extension](</docs/en/vs-code>), the Agent SDK, `claude setup-token`, `/install-github-app`, and [gateway](</docs/en/claude-apps-gateway>) sign-in for organizations that route through a cloud gateway. On Claude Code v2.1.212 or later, every path applies `forceLoginMethod`; before v2.1.212, only terminal logins applied either key. On the terminal’s interactive login screen, reached by `/login` or first-run onboarding, Claude Code pre-selects a `claudeai` or `console` method without enforcing it, so even with `forceLoginMethod` set to `"claudeai"`, a developer can still complete a Console login there. The paths differ on `forceLoginOrgUUID`:
* **Terminal, VS Code extension, and Agent SDK logins** : verify `forceLoginOrgUUID` for claude.ai account logins
* **`claude setup-token` and `/install-github-app`**: enforce only `forceLoginMethod`, so they can mint a token in a different organization
@@ -161,14 +186,14 @@
Claude Code securely manages your authentication credentials:
* **Storage location** :
- * On macOS, credentials are stored in the encrypted macOS Keychain.
+ * On macOS, credentials are stored in the encrypted macOS Keychain. When the Keychain rejects the write, such as when it’s locked in an SSH session, Claude Code stores your login in `~/.claude/.credentials.json` with file mode `0600` instead, the same storage it uses on Linux. A Console login that creates an API key fails until the Keychain is writable. To move your login back into the Keychain, follow [the recovery steps](</docs/en/troubleshoot-install#not-logged-in-or-token-expired>).
* On Linux, credentials are stored in `~/.claude/.credentials.json` with file mode `0600`.
* On Windows, credentials are stored in `%USERPROFILE%\.claude\.credentials.json` and inherit the access controls of your user profile directory, which restricts the file to your user account by default.
- * If you’ve set the `CLAUDE_CONFIG_DIR` environment variable on Linux or Windows, the `.credentials.json` file lives under that directory instead.
+ * If you’ve set the `CLAUDE_CONFIG_DIR` environment variable, Claude Code keeps the `.credentials.json` file under that directory instead, including the file the macOS fallback writes, and keys the macOS Keychain entry to that directory too, so a session with a different `CLAUDE_CONFIG_DIR` reads a different entry.
* Claude Code manages `.credentials.json` through `/login` and `/logout`. To route requests through a custom API endpoint, set the [`ANTHROPIC_BASE_URL`](</docs/en/env-vars>) environment variable instead.
* **Supported authentication types** : Claude.ai credentials, Claude API credentials, Microsoft Foundry Auth, Bedrock Auth, Vertex Auth, Anthropic profile and [Workload Identity Federation](<https://platform.claude.com/docs/en/manage-claude/workload-identity-federation>) credentials, and [Claude apps gateway](</docs/en/claude-apps-gateway>) session tokens.
* **Custom credential scripts** : configure the [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) setting to run a shell script that returns an API key.
- * **Refresh intervals** : by default, `apiKeyHelper` is called after 5 minutes or on HTTP 401 response. Set `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` environment variable for custom refresh intervals.
+ * **Refresh intervals** : Claude Code re-runs `apiKeyHelper` after five minutes by default. Set the `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` environment variable for custom refresh intervals. See [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) for the other cases in which Claude Code re-runs the helper.
* **Slow helper notice** : if `apiKeyHelper` takes longer than 10 seconds to return a key, Claude Code displays a warning notice in the prompt bar showing the elapsed time. If you see this notice regularly, check whether your credential script can be optimized.
* **Helper failures** : when the script exits with an error, times out, or prints nothing, requests fail with [`Your apiKeyHelper script is failing`](</docs/en/errors#your-apikeyhelper-script-is-failing>) within three attempts. Before v2.1.208, helper failures surfaced as a generic 401 after about ten silent retries.
@@ -206,7 +231,7 @@
Anthropic profiles and federation credentials
-A profile is a named credential configuration file in your [Anthropic configuration directory](<https://platform.claude.com/docs/en/manage-claude/wif-reference#configuration-directory>), by default `~/.config/anthropic` on macOS and Linux or `%APPDATA%\Anthropic` on Windows. A profile’s auth mode is `oidc_federation` when you set it up for [Workload Identity Federation (WIF)](<https://platform.claude.com/docs/en/manage-claude/workload-identity-federation>) or `user_oauth` when [`ant auth login`](<https://platform.claude.com/docs/en/cli-sdks-libraries/cli/authentication>) wrote it. Claude Code doesn’t read profiles or federation variables in [bare mode](</docs/en/headless#start-faster-with-bare-mode>), in Claude Desktop, or in cloud sessions. Claude Code checks three sources in this order and stops at the first one that is set. The table shows what sets each source and where it ranks against your `/login` credential.
+A profile is a named credential configuration file in your [Anthropic configuration directory](<https://platform.claude.com/docs/en/manage-claude/wif-reference#configuration-directory>), by default `~/.config/anthropic` on macOS and Linux or `%APPDATA%\Anthropic` on Windows. A profile’s auth mode is `oidc_federation` when you set it up for [Workload Identity Federation (WIF)](<https://platform.claude.com/docs/en/manage-claude/workload-identity-federation>) or `user_oauth` when [`ant auth login`](<https://platform.claude.com/docs/en/cli-sdks-libraries/cli/authentication>) wrote it or you signed in to a Console account without an API key. Claude Code doesn’t read profiles or federation variables in [bare mode](</docs/en/headless#start-faster-with-bare-mode>), in Claude Desktop, or in cloud sessions. In those sessions, `/status` shows no `Profile` row. Claude Code checks three sources in this order and stops at the first one that is set. The table shows what sets each source and where it ranks against your `/login` credential.
Source| Set by| Rank against `/login`
---|---|---
@@ -217,7 +242,7 @@
The `user_oauth` rule keeps a leftover `ant auth login` profile from moving your requests off the account you signed in to with `/login`. For the federation variables, Claude Code also reads the other variables in the [WIF reference](<https://platform.claude.com/docs/en/manage-claude/wif-reference#environment-variables>), such as `ANTHROPIC_IDENTITY_TOKEN_FILE`, when it exchanges your identity token. For the profile file format, see the [WIF reference](<https://platform.claude.com/docs/en/manage-claude/wif-reference#profile-configuration-file>). To confirm which source Claude Code chose, run `/status`: a `Profile` row names the source in place of the `Login method` row. If you start Claude Code with `--debug`, it also writes a `Using Anthropic profile auth` line with the source name to the debug log at `~/.claude/debug/<session-id>.txt`. When Claude Code passes over a `user_oauth` active profile because you have a working `/login` credential, it writes a warning to the debug log saying it’s using the claude.ai login instead. When a `user_oauth` profile’s login has expired and Claude Code can’t renew it, requests fail with [Anthropic profile login expired](</docs/en/errors#anthropic-profile-login-expired>). Features that need your claude.ai login, such as [claude.ai connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>) and [`/schedule`](</docs/en/routines>), aren’t available while one of these sources is selected. To stop Claude Code from selecting a source:
* **Named profile or federation variables** : unset `ANTHROPIC_PROFILE`, or unset either federation variable
- * **Active profile** : run `ant auth logout` for a `user_oauth` profile, or delete the profile’s file from `configs/` in your configuration directory for either auth mode
+ * **Active profile** : run `/logout` for a `user_oauth` profile whose current credential you wrote by signing in to a Console account without an API key, run `ant auth logout` for one whose current credential `ant auth login` wrote, or delete the profile’s file from `configs/` in your configuration directory for either auth mode
###
modified
Claude apps gateway for Amazon Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry
View current →
--- a/claude-apps-gateway.md
+++ b/claude-apps-gateway.md
@@ -253,7 +253,7 @@
Deliver policy to Claude Desktop sessions
-Claude Desktop runs its Cowork and Code tabs, plus the Chat tab when you enable it, on embedded Claude Code sessions and sends their model requests through the gateway. It passes policy to each of those sessions, built from the configuration the gateway serves it at `/user/bootstrap`: the model allowlist, disabled tools, and egress allowlist derived from the matched policy’s `cli` block, plus the [`desktop` overlay](</docs/en/claude-apps-gateway-config#claude-desktop-overlay>). Other `cli` keys, such as hooks, `env`, and scoped permission rules like `Bash(npm *)`, reach only clients that sign in through `/login`. Claude Desktop reads the gateway URL from its own managed configuration and signs in with its own flow, separate from the `forceLoginMethod` and `forceLoginGatewayUrl` keys in Set the gateway URL. Settings passed by a launching process are parent settings. Claude Code ignores parent settings on any machine that has an admin-deployed managed source, unless the highest-priority source sets `parentSettingsBehavior: "merge"`.
+Claude Desktop runs its Cowork and Code tabs, plus the Chat tab when you enable it, on embedded Claude Code sessions and sends their model requests through the gateway. It passes policy to each of those sessions, built from the configuration the gateway serves it at `/user/bootstrap`: the model allowlist, disabled tools, and egress allowlist derived from the matched policy’s `cli` block, plus the [`desktop` overlay](</docs/en/claude-apps-gateway-config#claude-desktop-overlay>). Other `cli` keys, such as hooks, `env`, and scoped permission rules like `Bash(npm *)`, reach only clients that sign in through `/login`. Claude Desktop reads the gateway URL from its own managed configuration and signs in with its own flow, separate from the `forceLoginMethod` and `forceLoginGatewayUrl` keys in Set the gateway URL. Settings passed by a launching process are parent settings. Claude Code ignores parent settings on any machine that has an admin-deployed managed source, unless the [source that delivers the policy](</docs/en/managed-settings#which-managed-source-claude-code-uses>) sets `parentSettingsBehavior: "merge"`.
####
@@ -261,7 +261,7 @@
Which machines need the opt-in
-Machines that only run Claude Desktop need it. Claude Desktop applies the model list and the disabled-tools list to embedded sessions itself, but the egress allowlist reaches them only as parent settings, in the form of `WebFetch` domain rules and sandbox network rules. Without the opt-in, those sessions run without the egress restriction, and nothing warns you. The gateway still rejects inference requests for models the policy doesn’t grant. Machines where developers sign in through `/login` don’t need it; every Claude Code invocation fetches its policy from the gateway directly. Fleets whose [`policyHelper`](</docs/en/settings-reference#policyhelper>) supplies managed settings can’t use it: parent settings are never merged then, because the helper’s output replaces the other managed sources.
+Machines that only run Claude Desktop need it. Claude Desktop applies the model list and the disabled-tools list to embedded sessions itself, but the egress allowlist reaches them only as parent settings, in the form of `WebFetch` domain rules and sandbox network rules. Without the opt-in, those sessions run without the egress restriction, and nothing warns you. The gateway still rejects inference requests for models the policy doesn’t grant. Machines where developers sign in through `/login` don’t need it; each Claude Code session fetches its policy from the gateway. Fleets whose [`policyHelper`](</docs/en/settings-reference#policyhelper>) supplies managed settings can’t use it: Claude Code never merges parent settings on those fleets, because it reads managed settings from the helper’s output alone.
####
@@ -269,7 +269,7 @@
Set the opt-in
-Deploy the key, mirror it to the source that wins on each machine, then verify.
+Deploy the managed settings snippet from Set the gateway URL, mirror it to any client-side source that outranks the file, then verify.
1
@@ -279,15 +279,15 @@
2
-Set the same key in any source that outranks the file
-
-Only the highest-priority admin source’s value counts. A managed-preferences plist on macOS or an HKLM policy on Windows outranks the `managed-settings.json` file, and the gateway’s own remote managed settings outrank both, so on machines that sign in to the gateway, also set the key in the gateway policy’s [`cli` block](</docs/en/claude-apps-gateway-config#managed>).
+Mirror the snippet to any source that outranks the file
+
+Claude Code reads `parentSettingsBehavior` only from the [selected source](</docs/en/managed-settings#which-managed-source-claude-code-uses>). Adding any policy key to a source can make that source the selected one, so in a client-side source, mirror the whole snippet rather than `parentSettingsBehavior` alone. [Client-side managed settings](</docs/en/claude-apps-gateway-config#client-side-managed-settings>) covers fleets that deliver policy through Group Policy or configuration profiles. A managed-preferences plist on macOS or an HKLM policy on Windows outranks the `managed-settings.json` file, and the gateway’s own remote managed settings outrank both, so on machines that sign in to the gateway, also set `parentSettingsBehavior` in the gateway policy’s [`cli` block](</docs/en/claude-apps-gateway-config#managed>).
3
-Check which source won
-
-Call the Agent SDK’s [`resolveSettings()`](</docs/en/agent-sdk/typescript#resolvesettings>). Its result includes a `sources` list; the managed policy entry there carries a `policyOrigin` field naming the active source. `resolveSettings()` doesn’t execute a configured `policyHelper`, so its result doesn’t reflect the live session on machines where a helper supplies the managed settings.
+Check which source is selected
+
+On a machine that only runs Claude Desktop, call the Agent SDK’s [`resolveSettings()`](</docs/en/agent-sdk/typescript#resolvesettings>) and read `policyOrigin` on the `managed` entry in its `sources` list. The value names the selected client-side source, `plist`, `hklm`, or `file`, which is the source that must carry the snippet. Claude Desktop’s embedded sessions don’t fetch the gateway policy, so the gateway’s `cli` block never counts as the selected source for them.
###
@@ -368,7 +368,7 @@
CI pipelines and remote machines
-There is no service-token flow for unattended pipelines. Gateway sign-in always runs the browser device flow, so a CI job with no developer to approve the sign-in can’t authenticate; configure those against your provider directly. Once a developer has signed in, every Claude Code invocation on that machine uses the gateway session, including non-interactive `claude -p` runs and sessions started by the Agent SDK, and the [gateway policy applies to all of them](</docs/en/claude-apps-gateway-config#managed>). The device flow separates the polling CLI from the approving browser, so a remote development box with no display still works: the developer runs `/login` over SSH on the remote machine and opens the verification link in the browser on their laptop.
+There is no service-token flow for unattended pipelines. Gateway sign-in always runs the browser device flow, so a CI job with no developer to approve the sign-in can’t authenticate; configure those against your provider directly. Once a developer has signed in, each Claude Code session on that machine uses the gateway session, including non-interactive `claude -p` runs and sessions started by the Agent SDK. Claude Code applies the [gateway policy](</docs/en/claude-apps-gateway-config#managed>) to each of them. The device flow separates the polling CLI from the approving browser, so a remote development box with no display still works: the developer runs `/login` over SSH on the remote machine and opens the verification link in the browser on their laptop.
###
--- a/claude-apps-gateway-deploy.md
+++ b/claude-apps-gateway-deploy.md
@@ -246,10 +246,10 @@
* **Data residency** : the gateway’s own data plane sends nothing to Anthropic unless the Anthropic API is a configured upstream; when it is, your existing data-handling agreement applies to the inference path. Telemetry, audit, identity, and settings go only to the destinations you configure.
* **Host-process traffic** : the host process is the Claude Code CLI. `claude gateway` runs under the same third-party rules as Amazon Bedrock and Google Cloud’s Agent Platform deployments and sends nothing to Anthropic. Before v2.1.227, the host process sent startup telemetry such as product version and platform, which setting `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1` in the container environment turned off. Those releases also sent one `HEAD` request at boot, with no body or credentials, to `/api/hello` on `https://api.anthropic.com`, or on `ANTHROPIC_BASE_URL` when the environment set it, unless the environment also set a proxy variable such as `HTTPS_PROXY` or an mTLS client certificate. They ignored the response, so blocking that request at the egress firewall didn’t affect the gateway.
- * **Client analytics** : the CLI disables its own usage analytics and error reporting while signed in to a gateway. Before the sign-in, including on a first run where a [managed settings file, an MDM profile, or a policy helper](</docs/en/claude-apps-gateway-config#client-side-managed-settings>) sets `forceLoginMethod: "gateway"`, the CLI sends its startup events and a feature-flag request to Anthropic.
+ * **Client analytics** : the CLI disables its own usage analytics and error reporting while signed in to a gateway. Before the first sign-in, the CLI still sends startup events to Anthropic, including on machines whose managed settings force gateway sign-in. To keep those off too, deliver [`DISABLE_TELEMETRY`](</docs/en/managed-settings#turn-telemetry-off-for-your-organization>) in the same [client-side managed settings](</docs/en/claude-apps-gateway-config#client-side-managed-settings>) that force gateway sign-in.
* **Error reporting** : the CLI turns error reporting off whenever its model requests go to any endpoint other than Anthropic’s first-party API, such as Amazon Bedrock or a custom `ANTHROPIC_BASE_URL`.
* **Client machines** : developers’ CLIs still send WebFetch hostname checks and version checks to Anthropic unless `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1` and `skipWebFetchPreflight: true` are set. See [data usage](</docs/en/data-usage>).
- * **Survey ratings** : gateway sign-in disables the Anthropic-bound rating sink from the same point as the analytics streams, so ratings aren’t sent to Anthropic.
+ * **Survey ratings** : while signed in to a gateway, the CLI disables the Anthropic-bound rating upload together with the analytics streams, so it doesn’t send ratings to Anthropic.
* **Transcript sharing** : choosing Yes on a survey’s transcript-share prompt writes a local file under `~/.claude/feedback-bundles/` instead of uploading to Anthropic.
* **Client updates** : update checks are separate from gateway traffic. Pin versions through your own distribution and set `DISABLE_UPDATES` if laptops must not fetch releases. `DISABLE_AUTOUPDATER` stops only background updates while `claude update` still works.
* **TLS** : serve `public_url` over HTTPS in production, either from the gateway’s own listener via `listen.tls` or from a TLS-terminating ingress in front of plain-HTTP replicas, with `listen.public_url` set in both cases. The gateway doesn’t refuse plain HTTP. The IdP must serve HTTPS in production, and Postgres supports `?sslmode=require`. Set `Strict-Transport-Security` at your ingress.
--- a/claude-security.md
+++ b/claude-security.md
@@ -9,7 +9,7 @@
To run the plugin, you need:
* A paid plan, for the [dynamic workflows](</docs/en/workflows>) the scan uses to orchestrate its agents. On Pro, turn them on from the Dynamic workflows row in `/config`.
- * Python 3.9.6 or later available on your `PATH` as `python3`. Check with `python3 --version`. The plugin’s tooling uses only the Python standard library, so nothing is installed.
+ * Python 3.9 or later available on your `PATH` as `python3`. Check with `python3 --version`. The plugin’s tooling uses only the Python standard library, so nothing is installed.
* Linux, macOS, or Windows.
* Git, for change scans and for turning findings into patches; those jobs don’t support other version control systems. A full scan works in any directory, with or without version control.
@@ -23,7 +23,7 @@
/plugin install claude-security@claude-plugins-official
-If the install fails, the fix depends on which message Claude Code reports:
+The command opens the plugin’s details, where you choose an [installation scope](</docs/en/discover-plugins#install-plugins>) to start the install. If the install fails, the fix depends on which message Claude Code reports:
* If it reports `Marketplace "claude-plugins-official" not found`, add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.
* If it reports that it [can’t find the plugin in the marketplace](</docs/en/discover-plugins#install-plugins>), check the plugin name for a typo.
@@ -164,7 +164,7 @@
Troubleshooting
-**The`/claude-security` menu opens with a Python warning.** The plugin needs `python3` 3.9.6 or later on your `PATH`. When it can’t find `python3` at all, the menu warns that Claude Security won’t work until one is installed; when the first `python3` on your `PATH` is older, the warning names the version it found. Install Python 3, or put a newer `python3` first on your `PATH`, then start a new session. **You may see “Fable 5’s safeguards flagged this message” when using Fable 5.** Due to Fable 5’s cybersecurity safety classifiers, certain model activities will be blocked and automatically downgraded to Opus. This is expected, and the scan should still complete successfully.
+**The`/claude-security` menu opens with a Python warning.** The plugin needs `python3` 3.9 or later on your `PATH`. When it can’t find `python3` at all, the menu warns that Claude Security won’t work until one is installed; when the first `python3` on your `PATH` is older, the warning names the version it found. Install Python 3, or put a newer `python3` first on your `PATH`, then start a new session. **You may see “Fable 5’s safeguards flagged this message” when using Fable 5.** Due to Fable 5’s cybersecurity safety classifiers, certain model activities will be blocked and automatically downgraded to Opus. This is expected, and the scan should still complete successfully.
##
--- a/cli-reference.md
+++ b/cli-reference.md
@@ -79,7 +79,7 @@
`--debug-file <path>`| Write debug logs to a specific file path. Implicitly enables debug mode. Takes precedence over `CLAUDE_CODE_DEBUG_LOGS_DIR`| `claude --debug-file /tmp/claude-debug.log`
`--disable-slash-commands`| Disable all skills and commands for this session| `claude --disable-slash-commands`
`--disallowedTools`, `--disallowed-tools`| Deny rules. A bare tool name removes the matching tools from Claude’s context: `"Edit"` removes Edit, `"*"` removes every tool, and `"mcp__*"` removes every MCP tool. A scoped rule such as `Bash(rm *)` leaves the tool available and denies only matching calls. A rule naming [`EndConversation`](</docs/en/tools-reference#endconversation-tool-behavior>) can’t remove it while any other tool remains| `"Bash(git log *)" "Bash(git diff *)" "Edit"`
-`--effort`| Set the [effort level](</docs/en/model-config#adjust-effort-level>) for the current session. Options: `low`, `medium`, `high`, `xhigh`, `max`, or `ultracode`. Available levels depend on the model. `ultracode` starts the session at `xhigh` effort with [ultracode](</docs/en/workflows#let-claude-decide-with-ultracode>) turned on, and requires Claude Code v2.1.203 or later. Overrides the [`effortLevel`](</docs/en/settings-reference#effortlevel>) setting for this session and does not persist| `claude --effort high`
+`--effort`| Set the [effort level](</docs/en/model-config#adjust-effort-level>) for the current session. Options: `low`, `medium`, `high`, `xhigh`, `max`, or `ultracode`. Available levels depend on the model. `ultracode` starts the session at `xhigh` effort with [ultracode](</docs/en/workflows#let-claude-decide-with-ultracode>) turned on, and requires Claude Code v2.1.203 or later. Overrides the [`modelSettings`](</docs/en/settings-reference#modelsettings>) and [`effortLevel`](</docs/en/settings-reference#effortlevel>) settings for this session and does not persist| `claude --effort high`
`--enable-auto-mode`| Removed in v2.1.111. Auto mode is now in the `Shift+Tab` cycle by default; use `--permission-mode auto` to start in it| `claude --permission-mode auto`
`--environment <environment-id>`| Create a new cloud session that runs on the [self-hosted environment](</docs/en/self-hosted-environments>) with the given ID. Environment IDs start with `ccpool_`. See [`--environment` dispatch behavior](</docs/en/self-hosted-environments-testing#environment-dispatch-behavior>) for dispatch behavior and the flag combinations it rejects. Requires Claude Code v2.1.224 or later| `claude -p "Fix the login bug" --environment ccpool_abc123`
`--exclude-dynamic-system-prompt-sections`| Move per-machine sections from the system prompt (working directory, environment info, memory paths, git-repo flag) into the first user message. Improves prompt-cache reuse across different users and machines running the same task. Only applies with the default system prompt; ignored when `--system-prompt` or `--system-prompt-file` is set. Use with `-p` for scripted, multi-user workloads| `claude -p --exclude-dynamic-system-prompt-sections "query"`
--- a/cloud-environments.md
+++ b/cloud-environments.md
@@ -78,7 +78,8 @@
Two of these decide whether you can add a credential, and two decide whether the agent proxy can use it once added:
- * **Role** : an organization admin role in your claude.ai organization, which Admins and Owners hold
+ * **Role** : an organization admin role in your claude.ai organization
+ * On Team and Enterprise, Owners hold it and Admins don’t
* On Pro and Max, you hold it in your own organization
* Without it, you see a note instead of the credential list, on your own environments too. Ask an Owner to add the credential to a shared environment and run your sessions there
* **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have API credentials
@@ -166,7 +167,7 @@
Organization-shared environments
-On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). Shared environments appear in each member’s environment selector alongside their personal ones, so a team can standardize on one configuration instead of each member recreating it. Create, edit, and archive shared environments from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>). A shared environment also opens from the environment selector at [claude.ai/code](<https://claude.ai/code>): an Admin or Owner can edit it there, and that dialog is where API credentials are added. Other members see it read-only. Each shared environment has a name, a network access level, environment variables in `.env` format, and a setup script. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Every member’s sessions in a shared environment read its variables, so don’t include secrets in them. To give those sessions a key they can’t read, add an API credential from that dialog.
+On Team and Enterprise plans, an Owner can create cloud environments that are shared with every member of the organization. The same role manages everything else on the **Cloud environments** admin page, including [self-hosted environments](</docs/en/self-hosted-environments>); the Admin role can’t open the page. The full list of roles that can open it is the one for [managing server-managed settings](</docs/en/server-managed-settings#access-control>). Shared environments appear in each member’s environment selector alongside their personal ones, so a team can standardize on one configuration instead of each member recreating it. Create, edit, and archive shared environments from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>). A shared environment also opens from the environment selector at [claude.ai/code](<https://claude.ai/code>): an Owner can edit it there, and that dialog is where API credentials are added. Other members see it read-only. Each shared environment has a name, a network access level, environment variables in `.env` format, and a setup script. Owners choose the organization’s default environment separately, at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Every member’s sessions in a shared environment read its variables, so don’t include secrets in them. To give those sessions a key they can’t read, add an API credential from that dialog.
###
--- a/commands.md
+++ b/commands.md
@@ -53,6 +53,7 @@
`/dataviz [request]`| **[Skill](</docs/en/skills#bundled-skills>).** Design guidance for charts, graphs, and dashboards. Claude picks the chart form for the data, assigns color by role, validates the palette for colorblind safety and contrast with a bundled script, and applies mark, interaction, and accessibility rules. Uses a brand-neutral placeholder palette that you replace with your own. Requires Claude Code v2.1.198 or later
`/debug [description]`| **[Skill](</docs/en/skills#bundled-skills>).** Enable debug logging for the current session and troubleshoot issues by reading the session debug log. Debug logging is off by default unless you started with `claude --debug`, so running `/debug` mid-session starts capturing logs from that point forward. Optionally describe the issue to focus the analysis
`/deep-research <question>`| **[Workflow](</docs/en/workflows#bundled-workflows>).** Fan out web searches on a question, fetch and cross-check sources, and synthesize a cited report
+`/design [brief]`| **[Skill](</docs/en/skills#bundled-skills>).** Draft UI mockups, screen flows, landing pages, or posters as artboards on one canvas, published as an [artifact](</docs/en/artifacts#draft-a-design-canvas>) that runs a research preview of Claude Design’s editor, for example `/design a settings screen for a mobile banking app`. Where saving is enabled for your account, you edit the artboards on the canvas and save to publish a new version; otherwise you view the draft and export it as PNG or PDF. Requires a session where [artifacts are available](</docs/en/artifacts#availability>) and Claude Code v2.1.234 or later. Available on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS, artifacts aren’t available, so the command is unavailable there
`/design-login`| Authorize design-system access for `/design-sync` with your claude.ai account
`/design-sync [hint]`| **[Skill](</docs/en/skills#bundled-skills>).** Convert your repo’s React design system and upload it to [Claude Design](<https://claude.ai/design>), so designs it produces use your real components. Optionally name the design system, for example `/design-sync Acme DS`. A first-time sync verifies every component and can take a few hours on a large repo. Available on the Anthropic API; on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS the underlying tool can’t reach claude.ai, so the command is unavailable
`/desktop`| Continue the current session in the Claude Code Desktop app. Requires macOS or x64 Windows and a Claude subscription. Alias: `/app`
@@ -148,7 +149,7 @@
* **Highlighting** : Claude Code highlights the top suggestion only when the letters after the `/` match a command’s name or alias, from the start of the name or from a word within it, ignoring the `:`, `_`, and `-` separators. Typing `/adddir` highlights `/add-dir`, and typing `/new` highlights `/clear` through its alias. Press `Enter` to run the highlighted suggestion. These highlighting rules require Claude Code v2.1.236 or later.
* **After a typo** : Claude Code highlights nothing. The close matches stay listed, and you can pick one with `Tab` or the arrow keys, but `Enter` submits your text as typed and reports [Unknown command](</docs/en/errors#unknown-command>).
- * **Commands that aren’t available to you** : Claude Code leaves them out of the menu. When nothing matches, Claude Code shows `No commands match "/name"`. Most unavailable commands return [Unknown command](</docs/en/errors#unknown-command>) when you submit them; a few, such as [`/schedule` on a Console API key](</docs/en/routines#schedule-returns-unknown-command>), answer with their own availability message instead.
+ * **Commands that aren’t available to you** : Claude Code leaves them out of the menu. When nothing matches, Claude Code shows `No commands match "/name"`. Most unavailable commands return [Unknown command](</docs/en/errors#unknown-command>) when you submit them; a few, such as [`/schedule` on a Console API key](</docs/en/routines#schedule-returns-unknown-command>), answer with their own availability message instead. Some commands also answer with a message of their own when your organization’s policy disables them.
* **Hidden commands** : Claude Code keeps a few available commands, such as `/heapdump`, out of the menu by design. A partial name never brings a hidden command into the menu: if the partial matches nothing visible, Claude Code shows the same no-match message. Claude Code lists the command only once you’ve typed its full name, and submitting the full name runs it.
##
--- a/computer-use.md
+++ b/computer-use.md
@@ -90,7 +90,7 @@
Can read or write any file| Finder
Can change system settings| System Settings
-These apps aren’t blocked. The warning lets you decide whether the task warrants that level of access. Claude’s level of control also varies by app category: browsers and trading platforms are view-only, terminals and IDEs are click-only, and everything else gets full control. See [app permissions in Desktop](</docs/en/desktop#app-permissions>) for the complete tier breakdown.
+These apps aren’t blocked. The warning lets you decide whether the task warrants that level of access. Approve Finder to let Claude click the desktop, the Dock, or a Finder window. Claude’s level of control also varies by app category: browsers and trading platforms are view-only, terminals and IDEs are click-only, and everything else gets full control. See [app permissions in Desktop](</docs/en/desktop#app-permissions>) for the complete tier breakdown.
##
--- a/debug-your-config.md
+++ b/debug-your-config.md
@@ -72,8 +72,7 @@
The clean session has no user or project settings, hooks, MCP servers, plugins, or memory. On the first launch, expect the first-run setup screens, starting with theme selection. If you see them, the clean configuration directory is in effect. Later launches with the same directory skip these screens because Claude Code saves onboarding state there.
* Managed settings still apply if your organization deploys them. Claude Code reads MDM profiles, registry policy, and `managed-settings.json` from locations outside the configuration directory, and [fetches server-managed settings](</docs/en/server-managed-settings#fetch-and-caching-behavior>) again for the clean session once it has credentials
- * On Linux and Windows, you’ll be prompted to log in again because credentials are stored under the configuration directory
- * On macOS, credentials are in the Keychain and carry over to the clean session
+ * You’ll be prompted to log in again
If the problem disappears here, the cause is somewhere in your real `~/.claude` or project `.claude` files. Reintroduce them one at a time, by copying files into the temporary directory or by launching from your project, to find which one. If it persists in the clean session, the cause is outside your user and project configuration. Run `/status` to check whether managed settings are in effect, look for [environment variables](</docs/en/env-vars>) that affect Claude Code, then see [Troubleshooting](</docs/en/troubleshooting>).
--- a/desktop.md
+++ b/desktop.md
@@ -81,7 +81,7 @@
**Manual**| `default`| Claude asks before editing files or running commands. You see a diff and can accept or reject each change.
**Accept edits**| `acceptEdits`| Claude auto-accepts file edits and common filesystem commands like `mkdir`, `touch`, and `mv`, but still asks before running other terminal commands. Use this when you trust file changes and want faster iteration.
**Plan**| `plan`| Claude reads files and runs commands to explore, then proposes a plan without editing your source code. Good for complex tasks where you want to review the approach first.
-**Auto**| `auto`| Claude executes all actions with background safety checks that verify alignment with your request. Reduces permission prompts while maintaining oversight. Appears when your account meets the availability requirements below; there is no separate Settings toggle for it.
+**Auto**| `auto`| Claude executes all actions with background safety checks that verify alignment with your request. Reduces permission prompts while maintaining oversight. Appears when auto mode is available; there is no separate Settings toggle for it.
**Bypass permissions**| `bypassPermissions`| Claude runs without permission prompts, except for the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>), safety classifiers when Claude acts on external sites, or desktop actions where Claude always asks first, such as archiving a session. Equivalent to `--dangerously-skip-permissions` in the CLI. On Pro and Max plans, enable it in your Settings → Claude Code under “Allow bypass permissions mode”; on Team and Enterprise plans there is no Settings toggle, and organization policy controls it instead. Only use this in sandboxed containers or VMs.
Earlier versions of the Code tab labeled these modes Ask permissions, Auto accept edits, and Plan mode. The `dontAsk` permission mode is available only in the [CLI](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>). Auto mode is available to all users on the Anthropic API and requires Claude Opus 4.6 or later, Sonnet 4.6 or later, or Fable 5. Organization administrators can turn auto mode off with the `disableAutoMode` key in managed settings. In Enterprise deployments that route Desktop to Google Cloud’s Agent Platform, auto mode is also available by default; see [Auto mode on Bedrock, Agent Platform, or Foundry](</docs/en/permission-modes#enable-auto-mode-on-bedrock-agent-platform-or-foundry>) for the supported models.
Show diff (126 lines)
--- a/env-vars.md
+++ b/env-vars.md
@@ -90,7 +90,7 @@
Precedence
-Some behaviors have both an environment variable and a dedicated settings key, and which one Claude Code reads first differs per key. For `ANTHROPIC_MODEL` and `CLAUDE_CODE_AUTO_CONNECT_IDE`, Claude Code reads the variable first and uses the `model` or `autoConnectIde` setting only when the variable is unset. For the pair you’re setting, check the variable’s row below and the key’s entry on the [settings reference](</docs/en/settings-reference>). When the same variable is set in both your shell and a settings file `env` block, the settings file value applies. Claude Code writes each `env` entry into the process environment, replacing the value inherited from the shell. The [`env` setting](</docs/en/settings-reference#when-claude-code-applies-env-values>) says when it applies them. A few variables are special-cased; the [`env` setting](</docs/en/settings-reference#env>) lists the exceptions. In a settings file you can set a variable but you can’t remove one. To override a variable you can’t unset, such as a stale `CLAUDE_CODE_USE_VERTEX` exported by a shell profile you don’t control, set it to an empty string in the `env` block: `"CLAUDE_CODE_USE_VERTEX": ""`. Claude Code treats the empty value as unset for provider selection. Subprocesses still inherit the empty value. Between settings files, `env` values follow [settings precedence](</docs/en/settings#settings-precedence>), so a managed settings entry overrides the same variable in user or project settings. How an environment variable interacts with CLI flags and in-session commands varies per feature: `--model` and `/model` override `ANTHROPIC_MODEL`, while `CLAUDE_CODE_EFFORT_LEVEL` overrides `/effort`. When a variable interacts with another configuration source, its row in the Variables list states the precedence or links to the page that documents it. Claude Code reads shell environment variables at startup, so changes to them take effect the next time you launch `claude`. Variables set under the `env` key in settings files are reapplied to a running session when the file changes, with the startup-only exception described in In settings files.
+Some behaviors have both an environment variable and a dedicated settings key, and which one Claude Code reads first differs per key. For `ANTHROPIC_MODEL` and `CLAUDE_CODE_AUTO_CONNECT_IDE`, Claude Code reads the variable first and uses the `model` or `autoConnectIde` setting only when the variable is unset. For the pair you’re setting, check the variable’s row below and the key’s entry on the [settings reference](</docs/en/settings-reference>). When the same variable is set in both your shell and a settings file `env` block, the settings file value applies. Claude Code writes each `env` entry into the process environment, replacing the value inherited from the shell. The [`env` setting](</docs/en/settings-reference#when-claude-code-applies-env-values>) says when it applies them. A few variables are special-cased; the [`env` setting](</docs/en/settings-reference#env>) lists the exceptions. In a settings file you can set a variable but you can’t remove one. To override a variable you can’t unset, such as a stale `CLAUDE_CODE_USE_VERTEX` exported by a shell profile you don’t control, set it to an empty string in the `env` block: `"CLAUDE_CODE_USE_VERTEX": ""`. Claude Code treats the empty value as unset for provider selection. Subprocesses still inherit the empty value. Between settings files, `env` values follow [settings precedence](</docs/en/settings#settings-precedence>), so a managed settings entry overrides the same variable in user or project settings. How an environment variable interacts with CLI flags and in-session commands varies per feature: `--model` and `/model` override `ANTHROPIC_MODEL`, while `CLAUDE_CODE_EFFORT_LEVEL` overrides `--effort` and `/effort`. When a variable interacts with another configuration source, its row in the Variables list states the precedence or links to the page that documents it. Claude Code reads shell environment variables at startup, so changes to them take effect the next time you launch `claude`. Variables set under the `env` key in settings files are reapplied to a running session when the file changes, with the startup-only exception described in In settings files.
##
@@ -153,7 +153,7 @@
`ANTHROPIC_FOUNDRY_RESOURCE`| Microsoft Foundry resource name (for example, `my-resource`). Required if `ANTHROPIC_FOUNDRY_BASE_URL` is not set (see [Microsoft Foundry](</docs/en/microsoft-foundry>))
`ANTHROPIC_MODEL`| Name of the model setting to use (see [Model Configuration](</docs/en/model-config#environment-variables>))
`ANTHROPIC_ORGANIZATION_ID`| Organization ID for [Workload Identity Federation](<https://platform.claude.com/docs/en/manage-claude/workload-identity-federation>). Set it together with `ANTHROPIC_FEDERATION_RULE_ID`. See [authentication precedence](</docs/en/authentication#authentication-precedence>)
-`ANTHROPIC_PROFILE`| Name of the Anthropic profile to authenticate with, such as one created by [`ant auth login`](<https://platform.claude.com/docs/en/cli-sdks-libraries/cli/authentication>). The named profile ranks above your `/login` credential. See [authentication precedence](</docs/en/authentication#authentication-precedence>)
+`ANTHROPIC_PROFILE`| Name of the Anthropic profile to authenticate with, such as one created by [`ant auth login`](<https://platform.claude.com/docs/en/cli-sdks-libraries/cli/authentication>) or by [signing in to a Console account without an API key](</docs/en/authentication#sign-in-without-an-api-key>). See [authentication precedence](</docs/en/authentication#authentication-precedence>)
`ANTHROPIC_SMALL_FAST_MODEL`| [DEPRECATED] Name of [Haiku-class model for background tasks](</docs/en/costs>)
`ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION`| Override AWS region for the Haiku-class model when using Amazon Bedrock or Amazon Bedrock Mantle. On Amazon Bedrock, this only takes effect when `ANTHROPIC_DEFAULT_HAIKU_MODEL` or the deprecated `ANTHROPIC_SMALL_FAST_MODEL` is also set, since Amazon Bedrock otherwise runs background tasks on the [default Sonnet model or the primary model](</docs/en/amazon-bedrock#4-pin-model-versions>) in the session region
`ANTHROPIC_VERTEX_BASE_URL`| Override Google Cloud’s Agent Platform endpoint URL. Use for custom Google Cloud’s Agent Platform endpoints or when routing through an [LLM gateway](</docs/en/llm-gateway>). See [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>)
@@ -165,6 +165,7 @@
`BASH_DEFAULT_TIMEOUT_MS`| Default timeout for long-running bash commands (default: 120000, or 2 minutes)
`BASH_MAX_OUTPUT_LENGTH`| Maximum number of characters of bash output that Claude Code reads back into a command’s result (default: 30000; maximum: 150000). See [Output limits](</docs/en/tools-reference#output-limits>)
`BASH_MAX_TIMEOUT_MS`| Maximum timeout the model can set for long-running bash commands (default: 600000, or 10 minutes). The effective ceiling is the larger of this and `BASH_DEFAULT_TIMEOUT_MS`
+`BETA_TRACING_ENDPOINT`| OTLP endpoint for [detailed beta tracing](</docs/en/monitoring-usage#traces-beta>): with `ENABLE_BETA_TRACING_DETAILED=1`, logs and traces go there instead of to the configured exporters. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>)
`CCR_FORCE_BUNDLE`| Set to `1` to force [`claude --cloud`](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) to bundle and upload your local repository even when GitHub access is available
`CLAUDECODE`| Set to `1` in subprocesses Claude Code spawns (Bash and PowerShell tools, tmux sessions, [hook](</docs/en/hooks>) commands, [status line](</docs/en/statusline>) commands, stdio [MCP server](</docs/en/mcp>) subprocesses). IDE extensions also set this in their integrated terminals. Use to detect when a script is running inside a subprocess spawned by Claude Code. To check whether the current process was spawned directly by a tool call or hook, rather than inside a stdio MCP server that Claude Code started, use `CLAUDE_CODE_CHILD_SESSION` instead
`CLAUDE_AFK_COUNTDOWN_MS`| How many milliseconds before auto-continue the on-screen countdown appears on an unanswered [`AskUserQuestion`](</docs/en/tools-reference>) dialog. Default `20000` (20 seconds), capped at the auto-continue timeout. Has no effect unless auto-continue is on; see the [`askUserQuestionTimeout`](</docs/en/settings-reference#askuserquestiontimeout>) setting and `CLAUDE_AFK_TIMEOUT_MS`. Requires Claude Code v2.1.198 or later
@@ -189,6 +190,7 @@
`CLAUDE_CODE_ARTIFACT_COMMENTS`| Set to `0` to stop Claude reading and replying to [comments on an artifact](</docs/en/artifacts#collect-comments-on-an-artifact>). Has no effect when `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` has [turned artifacts off](</docs/en/artifacts#availability>). Requires Claude Code v2.1.221 or later
`CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT`| Set to `0` to stop Claude [replying on its own to comments sent to it](</docs/en/artifacts#let-claude-reply-to-comments-on-its-own>). Requires Claude Code v2.1.228 or later
`CLAUDE_CODE_ATTRIBUTION_HEADER`| Set to `0` to omit the [attribution block](</docs/en/llm-gateway-protocol#system-prompt-attribution-block>), which carries the client version and a prompt fingerprint, from the start of the system prompt. Caching on a direct connection to the Anthropic API is unaffected either way. In some direct-connection setups, Claude Code keeps the block on [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) classifier requests even when you set `0`. In [System prompt attribution block](</docs/en/llm-gateway-protocol#system-prompt-attribution-block>), check which connections and credentials this covers. Before v2.1.181 the block included a per-request token on custom base URLs and Microsoft Foundry connections, so on those versions set it to `0` when your LLM gateway caches on the request body or forwards requests to a third-party provider, or when you connect to Microsoft Foundry directly
+`CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS`| When `CLAUDE_AUTO_BACKGROUND_TASKS` is enabled, seconds between reminders to Claude to check on [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) that are still running. Accepts a plain integer from `1` to `86400` only; any other value or spelling reads as unset. When unset, there are no check-in reminders. Requires Claude Code v2.1.248 or later
`CLAUDE_CODE_AUTO_COMPACT_WINDOW`| Set the [auto-compact window](</docs/en/model-config#set-the-auto-compact-window>) in tokens, from `100000` to `1000000`. Accepts a plain integer such as `500000` only: a value like `500k` reads as `500` and clamps to the 100K minimum. Takes precedence over the `/autocompact` command, the `--autocompact` flag, and the `autoCompactWindow` setting. The status line’s `used_percentage` always measures against the model’s full context window, so once this variable is set, that percentage no longer indicates when compaction will run
`CLAUDE_CODE_AUTO_CONNECT_IDE`| Override automatic [IDE connection](</docs/en/vs-code>). By default, Claude Code connects automatically when launched inside a supported IDE’s integrated terminal. Set to `false` to prevent this. Set to `true` to force a connection attempt when auto-detection fails, such as when tmux obscures the parent terminal. Takes precedence over the [`autoConnectIde`](</docs/en/settings-reference#autoconnectide>) global config setting
`CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS`| Time in milliseconds Claude Code waits for the AWS default credential provider chain to produce credentials before the request fails with [`AWS default-chain credential resolve timed out`](</docs/en/errors#aws-default-chain-credential-resolve-timed-out>) (default: `60000`). Raise it when a step in your chain legitimately needs longer, such as a browser-based SSO sign-in with MFA through a wrapper like `aws-vault`. Applies wherever Claude Code signs with the default chain: [Amazon Bedrock](</docs/en/amazon-bedrock#credential-caching-and-resolution-timeout>), [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and the [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>). Requires Claude Code v2.1.207 or later
@@ -212,8 +214,8 @@
`CLAUDE_CODE_DISABLE_ATTACHMENTS`| Set to `1` to disable attachment processing. File mentions with `@` syntax are sent as plain text instead of being expanded into file content
`CLAUDE_CODE_DISABLE_AUTO_MEMORY`| Set to `1` to disable [auto memory](</docs/en/memory#auto-memory>). Set to `0` to force auto memory on even when `--bare` mode or [`autoMemoryEnabled: false`](</docs/en/settings-reference#automemoryenabled>) would otherwise disable it. When disabled, Claude does not create or load auto memory files
`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`| Set to `1` to disable all background task functionality, including the `run_in_background` parameter on Bash and subagent tools, auto-backgrounding, and the Ctrl+B shortcut
-`CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT`| Set to `1` to stop Claude Code from treating an [Amazon Bedrock](</docs/en/amazon-bedrock>) streaming response with a missing or empty `Content-Type` header as the binary `application/vnd.amazon.eventstream` format. Amazon Bedrock always sends that header, so when it’s absent, a [proxy stripped it](</docs/en/amazon-bedrock#streaming-errors-behind-a-gateway-or-proxy>) and by default Claude Code decodes the body as the binary format anyway. Set this variable only when the proxy strips the header and also re-emits the body as server-sent events; Claude Code then reads the body as server-sent events instead. Requires Claude Code v2.1.239 or later
-`CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD`| Set to `1` to skip the check that an [Amazon Bedrock](</docs/en/amazon-bedrock>) streaming response carries the `application/vnd.amazon.eventstream` content-type. Without this variable, a response with a different content-type fails with an error naming that content-type, which means a [gateway or proxy is transforming the response](</docs/en/amazon-bedrock#streaming-errors-behind-a-gateway-or-proxy>). Set it only when the gateway rewrites the `Content-Type` header but passes the binary event-stream body through unmodified; if the body itself was transformed, requests fail with `Truncated event message received` instead. Requires Claude Code v2.1.208 or later
+`CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT`| Set to `1` to stop Claude Code from treating an [Amazon Bedrock](</docs/en/amazon-bedrock>) streaming response with a missing or empty `Content-Type` header as Amazon Bedrock’s binary event stream. By default, Claude Code assumes a gateway dropped the header from an otherwise unmodified response, so it decodes the body and streaming keeps working. Set this only for a gateway that also re-emits the stream as server-sent events; Claude Code then reads the header-less body as server-sent events instead. Requires Claude Code v2.1.239 or later
+`CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD`| Set to `1` to skip the check that an [Amazon Bedrock](</docs/en/amazon-bedrock>) streaming response carries the `application/vnd.amazon.eventstream` content-type. Without this variable, when a response carries a different content-type, Claude Code fails the request with an error naming that type, which means a [gateway or proxy is transforming the response](</docs/en/amazon-bedrock#streaming-errors-behind-a-gateway-or-proxy>). Configure the gateway to forward the `Content-Type` header and body unmodified rather than setting this variable. Requires Claude Code v2.1.208 or later
`CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF`| Set to `1` to stop a [background session’s](</docs/en/agent-view>) running background shell commands, dynamic workflows, and, as of v2.1.198, background subagents when the [supervisor](</docs/en/agent-view#the-supervisor-process>) stops, restarts, or updates that session’s process, instead of handing them to the session’s next process. Affects only that handoff: backgrounding a session with `←` or [`/background`](</docs/en/agent-view#from-inside-a-session>) still carries in-flight work over, and `CLAUDE_DISABLE_ADOPT` turns off both. Requires Claude Code v2.1.196 or later
`CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP`| Set to `1` to stop Claude Code from terminating [background shell commands](</docs/en/interactive-mode#background-bash-commands>) when the operating system reports memory pressure. By default, on macOS and Linux, Claude Code terminates a background shell started in the main session on a memory-pressure signal once the session has been idle for 30 minutes and no turn or subagent is running. Windows has no memory-pressure signal, so this variable has no effect there. Requires Claude Code v2.1.193 or later
`CLAUDE_CODE_DISABLE_BUNDLED_SKILLS`| Set to `1` to disable the [skills](</docs/en/skills>) and workflows included with Claude Code: bundled skills and workflows are removed entirely, while built-in commands like `/init` stay typable but are hidden from the model. `/doctor` stays typable like the built-in commands; hide it with `DISABLE_DOCTOR_COMMAND` instead. Skills from plugins, `.claude/skills/`, and `.claude/commands/` are unaffected. Equivalent to the [`disableBundledSkills`](</docs/en/settings-reference#disablebundledskills>) setting
@@ -240,7 +242,7 @@
`CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT`| Set to `1` to skip proactive [auto-compaction](</docs/en/costs#reduce-token-usage>) when Claude Code doesn’t recognize the model ID, such as an [LLM gateway](</docs/en/llm-gateway>) alias. Without this variable, Claude Code compacts at the context window it assumes for the ID. `CLAUDE_CODE_MAX_CONTEXT_TOKENS` can correct the assumed window instead; see [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>) for when each variable applies. Requires Claude Code v2.1.223 or later
`CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL`| Set to `1` to disable virtual scrolling in [fullscreen rendering](</docs/en/fullscreen>) and render every message in the transcript. Use this if scrolling in fullscreen mode shows blank regions where messages should appear
`CLAUDE_CODE_DISABLE_WORKFLOWS`| Set to `1` to disable [workflows](</docs/en/workflows#turn-workflows-off>). Equivalent to the [`disableWorkflows`](</docs/en/settings-reference#disableworkflows>) setting
-`CLAUDE_CODE_EFFORT_LEVEL`| Set the effort level for supported models. Values: `low`, `medium`, `high`, `xhigh`, `max`, or `auto` to use the model default. Available levels depend on the model. Takes precedence over `/effort` and the `effortLevel` setting. See [Adjust effort level](</docs/en/model-config#adjust-effort-level>)
+`CLAUDE_CODE_EFFORT_LEVEL`| Set the effort level for supported models. Values: `low`, `medium`, `high`, `xhigh`, `max`, or `auto` to use the model default. Available levels depend on the model. Takes precedence over `--effort`, `/effort`, and the `modelSettings` and `effortLevel` settings. See [Adjust effort level](</docs/en/model-config#adjust-effort-level>)
`CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT`| Set to `1` to enable appending extra text to the end of the system prompt of every [subagent](</docs/en/sub-agents>) other than a [forked subagent](</docs/en/sub-agents#fork-the-current-conversation>). The [`--append-subagent-system-prompt`](</docs/en/cli-reference#cli-flags>) flag supplies the appended text and sets this variable automatically, so you don’t need to set it yourself. Requires Claude Code v2.1.205 or later
`CLAUDE_CODE_ENABLE_AUTO_MODE`| Accepted for compatibility with older releases and has no effect. Auto mode is available by default on every provider, including Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. In v2.1.158 through v2.1.206, setting this to `1` was required to make [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) available on those providers
`CLAUDE_CODE_ENABLE_AWAY_SUMMARY`| Override [session recap](</docs/en/interactive-mode#session-recap>) availability. Set to `0` to force recaps off regardless of the `/config` toggle. Set to `1` to force recaps on when [`awaySummaryEnabled`](</docs/en/settings-reference#awaysummaryenabled>) is `false`. Takes precedence over the setting and `/config` toggle
@@ -305,7 +307,7 @@
`CLAUDE_CODE_PLUGIN_PREFER_HTTPS`| Set to `1` to clone GitHub `owner/repo` shorthand sources over HTTPS instead of SSH. Applies to plugin install and update, and to `/plugin marketplace add` and `update`. Useful in CI runners, containers, or any environment without a configured SSH key for `github.com`
`CLAUDE_CODE_PLUGIN_SEED_DIR`| Path to one or more read-only plugin seed directories, separated by `:` on Unix or `;` on Windows. Use this to bundle a pre-populated plugins directory into a container image. Claude Code registers marketplaces from these directories at startup and uses pre-cached plugins without re-cloning. See [Pre-populate plugins for containers](</docs/en/plugin-marketplaces#pre-populate-plugins-for-containers>)
`CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY`| Set to `1` to stop Claude Code from passing `-ExecutionPolicy Bypass` when spawning PowerShell for tool calls, hooks, and status line commands, and respect the machine’s effective execution policy instead. By default Claude Code bypasses execution policy at process scope so `.ps1` scripts and module imports work on default-Restricted Windows installs. Process-scope bypass never overrides Group Policy `MachinePolicy` or `UserPolicy` regardless of this setting
-`CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS`| 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_PRINT_BG_WAIT_CEILING_MS`| Ceiling in milliseconds on continuous idle waiting after the final turn in [non-interactive mode](</docs/en/headless#background-tasks-at-exit>) with the `-p` flag, while background subagents and workflows whose result is part of the output finish. Each turn that handles queued background results starts the count again. Default: `600000`, or 10 minutes. When idle waiting reaches the ceiling, Claude Code stops waiting for the remaining background tasks and exits. Set to `0` to wait indefinitely. This cap is separate from the five-second grace period that applies to plain background shells. Requires Claude Code v2.1.182 or later
`CLAUDE_CODE_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
@@ -339,7 +341,7 @@
`CLAUDE_CODE_SKIP_PROMPT_HISTORY`| Set to `1` to skip writing prompt history and session transcripts to disk. Sessions started with this variable set do not appear in `--resume`, `--continue`, or up-arrow history. Useful for ephemeral scripted sessions
`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_MODEL`| The default model for [subagents](</docs/en/sub-agents#choose-a-model>), [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammates, and [workflow](</docs/en/workflows>) agents that aren’t assigned a model another way. Accepts an alias such as `haiku` or a full model name. Two sources take precedence over it: a model Claude passes when it spawns the agent, and a `model` field in the agent’s definition, including `inherit`. See [Choose a model](</docs/en/sub-agents#choose-a-model>) for the full order. Setting it to `inherit` is the same as leaving it unset. Before v2.1.251, this variable overrode both the per-invocation model and the definition’s `model` field
`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
@@ -350,7 +352,7 @@
`CLAUDE_CODE_SYNTAX_HIGHLIGHT`| Set to `false` to disable syntax highlighting in diff output. Useful when colors interfere with your terminal setup. To also disable highlighting in code blocks and file previews, use the [`syntaxHighlightingDisabled`](</docs/en/settings-reference#syntaxhighlightingdisabled>) setting
`CLAUDE_CODE_TASK_LIST_ID`| Share a task list across sessions. Set the same ID in multiple Claude Code instances to coordinate on a shared task list, in [sessions that have the Task tools](</docs/en/tools-reference#task-tool-availability>). See [Task list](</docs/en/interactive-mode#task-list>)
`CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS`| Override, in milliseconds, how long a non-interactive session waits at exit for its [agent team](</docs/en/agent-teams>) to finish tearing down. Accepts 1000 to 60000; an out-of-range value is ignored and the default of 10000 applies. Requires Claude Code v2.1.206 or later
-`CLAUDE_CODE_TMPDIR`| Override the temp directory used for internal temp files. Claude Code appends `/claude-{uid}/` on Unix or `/claude/` on Windows to this path. Default: `/tmp` on macOS, `os.tmpdir()` on Linux and Windows. As of v2.1.161, on macOS and Linux, [sandboxed](</docs/en/sandboxing>) Bash subprocesses receive a short fallback `$TMPDIR` under the system default when your override is a long path, since some tools fail when temp paths get too long. Unsandboxed Bash commands inherit your shell’s `$TMPDIR` unchanged. Claude Code’s own temp files always use your override
+`CLAUDE_CODE_TMPDIR`| Override the temp directory used for internal temp files. Claude Code appends `/claude-{uid}/` on Unix or `/claude/` on Windows to this path. Default: `/tmp` on macOS, `os.tmpdir()` on Linux and Windows. As of v2.1.161, on macOS and Linux, [sandboxed](</docs/en/sandboxing>) Bash subprocesses receive a short fallback `$TMPDIR` under the system default when your override is a long path, since some tools fail when temp paths get too long. Unsandboxed Bash commands inherit your shell’s `$TMPDIR` unchanged. Claude Code’s own temp files always use your override. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>)
`CLAUDE_CODE_TMUX_TRUECOLOR`| Set to any non-empty value, such as `1`, to allow 24-bit truecolor output inside tmux. **Setting it to`0` or `false` still allows truecolor**, unlike most on/off variables; unset the variable to restore the 256-color clamp. By default, Claude Code clamps to 256 colors when `$TMUX` is set because tmux does not pass through truecolor escape sequences unless configured to. Set this after adding `set -ga terminal-overrides ',*:Tc'` to your `~/.tmux.conf`. See [Terminal configuration](</docs/en/terminal-config>) for other tmux settings
`CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE`| On Linux and WSL, set to a comma-separated list of the kinds of processes Claude Code [excludes from the tool memory cap](</docs/en/tools-reference#memory-limit-on-linux-and-wsl>), such as `mcp` or `lsp`. Set `none` to cap every kind, or `all-new` to cap only Bash, PowerShell, and Monitor tool commands. Claude Code keeps Bash, PowerShell, and Monitor tool commands under the cap whatever you list. Requires Claude Code v2.1.246 or later
`CLAUDE_CODE_TOOL_MEMORY_LIMIT`| On Linux and WSL, set to a size such as `4G` to [cap the memory that Bash and PowerShell tool commands can use](</docs/en/tools-reference#memory-limit-on-linux-and-wsl>), and Monitor tool commands on v2.1.246 or later. Write the size in plain digits, alone for a number of bytes or with a `K`, `M`, `G`, or `T` suffix. Set `0` or `off` to turn the cap off. Once the first process Claude Code starts has turned the cap on or off, a changed value takes effect the next time you launch `claude`. Requires Claude Code v2.1.233 or later
@@ -364,7 +366,7 @@
`CLAUDE_CODE_USE_VERTEX`| Use [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>)
`CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS`| Set to the number of milliseconds [WebFetch](</docs/en/tools-reference#webfetch-tool-behavior>) keeps each fetched URL’s response cached. The default is `900000`, which is 15 minutes. Takes plain digits only; `0`, a decimal, or any other spelling keeps the default. Claude Code reads the value once per launch, so a change in a settings `env` block applies when you next launch `claude`. Requires Claude Code v2.1.233 or later
`CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS`| Upper bound in milliseconds on how long a [workflow](</docs/en/workflows>) agent waits for a same-prefix sibling’s first response to begin before sending its own first request. When a fan-out starts several agents that share a [prompt-cache prefix](</docs/en/workflows#prompt-caching-in-a-fan-out>), Claude Code holds all but the first agent for up to this long so the rest read the cached prefix instead of each processing it uncached. Default `5000`. Set to `0` to disable the wait. When `DISABLE_PROMPT_CACHING` is set, agents never wait. Requires Claude Code v2.1.229 or later
-`CLAUDE_CONFIG_DIR`| Override the configuration directory (default: `~/.claude`). All settings, session history, and plugins are stored under this path, as are credentials on Linux and Windows; on macOS, credentials are in the system Keychain. Useful for running multiple accounts side by side: for example, `alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'`
+`CLAUDE_CONFIG_DIR`| Override the configuration directory (default: `~/.claude`). All settings, session history, and plugins are stored under this path. For credentials, see [where Claude Code stores credentials](</docs/en/authentication#credential-management>). Useful for running multiple accounts side by side: for example, `alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'`. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>)
`CLAUDE_DISABLE_ADOPT`| Set to `1` to stop in-flight background work instead of carrying it over when you background a session by pressing `←` or with [`/background`](</docs/en/agent-view#from-inside-a-session>). Claude Code asks you to confirm before backgrounding, then stops the tasks that would otherwise carry over. Requires Claude Code v2.1.195 or later
`CLAUDE_EFFORT`| Set automatically in Bash tool subprocesses and hook commands to the [effort level](</docs/en/model-config#adjust-effort-level>) in effect when the subprocess starts: `low`, `medium`, `high`, `xhigh`, or `max`. Ultracode is not a distinct level and reports as `xhigh`. Matches the `effort.level` field passed to [hooks](</docs/en/hooks>). Only set when the current model supports the effort parameter
`CLAUDE_ENABLE_BYTE_WATCHDOG`| Set to `1` to force-enable the byte-level streaming idle watchdog, or set to `0` to force-disable it. `0` also turns off the [first-byte deadline](</docs/en/network-config#streaming-idle-watchdogs>) on the connections where that deadline runs. When unset, the watchdog is enabled by default for direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) connections, and for streaming responses on [gateway](</docs/en/gateways>) connections reached through `ANTHROPIC_BASE_URL` or `ANTHROPIC_AWS_BASE_URL`; before v2.1.222 it didn’t run on those gateway connections, so the event-level watchdog could report a stall there even while keep-alive pings were arriving. For timeouts and how the timers interact, see [Streaming idle watchdogs](</docs/en/network-config#streaming-idle-watchdogs>)
@@ -400,6 +402,7 @@
`DISABLE_UPDATES`| Set to `1` to block all updates including manual `claude update` and `claude install`. Stricter than `DISABLE_AUTOUPDATER`. Use when distributing Claude Code through your own channels and users should not self-update
`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_BETA_TRACING_DETAILED`| Set to `1`, together with `BETA_TRACING_ENDPOINT`, to turn on [detailed beta tracing](</docs/en/monitoring-usage#traces-beta>), which adds content-bearing span attributes and the `claude_code.hook` span. Interactive CLI sessions also require your organization to be allowlisted for the beta. Both variables are ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>)
`ENABLE_CLAUDEAI_MCP_SERVERS`| Set to `false` to stop Claude Code from fetching [claude.ai MCP servers](</docs/en/mcp#use-mcp-servers-from-claude-ai>). 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 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
@@ -431,7 +434,7 @@
`NO_PROXY`| List of domains and IPs to which requests will be directly issued, bypassing proxy
`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`| Standard OpenTelemetry SDK limit on attribute value length. Claude Code caps content-bearing telemetry attributes at the smaller of this and `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH`, so the truncation marker stays within the SDK limit. Claude Code reads the `OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT` and `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` variants the same way, and the smallest set value applies to all signals. Requires Claude Code v2.1.214 or later. See [Monitoring](</docs/en/monitoring-usage#common-configuration-variables>)
`OTEL_LOG_ASSISTANT_RESPONSES`| Set to `1` to include the model’s response text on `assistant_response` OpenTelemetry log events. When unset, the value of `OTEL_LOG_USER_PROMPTS` is used instead. Set to `0` to keep responses redacted even when `OTEL_LOG_USER_PROMPTS` is set. Requires Claude Code v2.1.193 or later. See [Monitoring](</docs/en/monitoring-usage#assistant-response-event>)
-`OTEL_LOG_RAW_API_BODIES`| Emit Anthropic Messages API request and response JSON as `api_request_body` / `api_response_body` log events. Set to `1` for inline bodies truncated at the content limit, or `file:<dir>` to write untruncated bodies to disk and emit a `body_ref` path instead. `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` configures the content limit, 60 KB by default. Disabled by default; bodies include the entire conversation history. See [Monitoring](</docs/en/monitoring-usage#api-request-body-event>)
+`OTEL_LOG_RAW_API_BODIES`| Emit Anthropic Messages API request and response JSON as `api_request_body` / `api_response_body` log events. Set to `1` for inline bodies truncated at the content limit, or `file:<dir>` to write untruncated bodies to disk and emit a `body_ref` path instead. `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` configures the content limit, 60 KB by default. Disabled by default; bodies include the entire conversation history. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). See [Monitoring](</docs/en/monitoring-usage#api-request-body-event>)
`OTEL_LOG_TOOL_CONTENT`| Set to `1` to include tool input and output content in OpenTelemetry span events. Disabled by default to protect sensitive data. See [Monitoring](</docs/en/monitoring-usage>)
`OTEL_LOG_TOOL_DETAILS`| Set to `1` to include tool input arguments, MCP server names, user-authored workflow names, raw error strings on tool failures, the refusal `category` on `api_refusal` events, and other tool details in OpenTelemetry traces and logs. Disabled by default to protect PII. See [Monitoring](</docs/en/monitoring-usage>)
`OTEL_LOG_USER_PROMPTS`| Set to `1` to include user prompt text in OpenTelemetry traces and logs. Disabled by default (prompts are redacted). See [Monitoring](</docs/en/monitoring-usage>)
@@ -488,6 +491,7 @@
* 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
* Get [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>), which Claude Code turns on through a fetched flag
+ * Have Claude Code [exclude MCP tools whose input schema the API would reject](</docs/en/mcp#tools-with-invalid-input-schemas>); it sends the schema anyway, and a request that includes it fails with [a 400 error naming the tool by its position](</docs/en/errors#tool-input-schema-is-invalid>)
###
@@ -495,7 +499,7 @@
First session after an install or upgrade
-In your first session after you install Claude Code, or upgrade to a version that adds a feature, a flag-gated feature can be missing, and a session can start in Manual mode on a plan that otherwise starts in auto mode. Claude Code fetches the flags during that session, so both are there in your next session. After a fresh install, a non-interactive session, such as `claude -p`, the Agent SDK, or the VS Code extension, can pick the flags up before it [chooses its starting permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>); an interactive terminal session doesn’t.
+In your first session after you install Claude Code, or upgrade to a version that adds a feature, a flag-gated feature can be missing, and the session can start in Manual mode on a plan that otherwise starts in auto mode. Claude Code fetches the flags during that session, so both are there in your next session. After a fresh install, in a non-interactive session such as `claude -p`, the Agent SDK, or the VS Code extension, Claude Code can still pick the flags up before it [chooses the starting permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>).
##
Show diff (109 lines)
--- a/errors.md
+++ b/errors.md
@@ -235,6 +235,7 @@
* When no reduction can fit, for example when the conversation itself nearly fills the context window.
* When a retry can’t shrink `max_tokens` any further. Before v2.1.218, Claude Code could re-send a reduced request that still didn’t fit, such as when the extended thinking budget exceeded the remaining context, until the retry budget ran out.
* An expired or missing Google Cloud credential on [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), which surfaces as an error such as `Could not load the default credentials`. Claude Code discards its cached credentials and retries up to two times, running your [`gcpAuthRefresh`](</docs/en/google-vertex-ai#advanced-credential-configuration>) command if you configured one, then reports the error so you can re-authenticate right away. [Google Cloud’s Agent Platform troubleshooting](</docs/en/google-vertex-ai#troubleshooting>) covers re-authenticating. Before v2.1.228, Claude Code retried a failing credential through the full retry budget before showing the error.
+ * A `401` or `403` from the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>), while an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script supplies the credential. Claude Code re-runs the script and retries with its fresh output, within the full retry budget. When the script itself fails on the re-run, Claude Code shows Your apiKeyHelper script is failing instead.
Before v2.1.227, `Connection lost before a response was produced` read `Connection closed while thinking, before producing a response` and `The response stalled before a response was produced` read `Response stalled while thinking, before producing a response`. Claude Code doesn’t retry these failures:
@@ -634,7 +635,7 @@
* For CI or automation where interactive login is not possible, configure an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script that fetches a key at startup
* See [Authentication precedence](</docs/en/authentication#authentication-precedence>) to understand which credential Claude Code uses when several are present
-If you are prompted to log in repeatedly, see [Not logged in or token expired](</docs/en/troubleshoot-install#not-logged-in-or-token-expired>) for system clock and macOS Keychain fixes.
+If you are prompted to log in repeatedly, see [Not logged in or token expired](</docs/en/troubleshoot-install#not-logged-in-or-token-expired>) for system clock checks and macOS credential-storage recovery steps.
###
@@ -896,7 +897,7 @@
* Run `/login` to sign in again
* If the error returns within the same session after re-authenticating, run `/logout` first to fully clear the stored token, then `/login`
* If you authenticate with the `CLAUDE_CODE_OAUTH_TOKEN` environment variable, Claude Code keeps sending the value you set after a request fails with a 401, rather than switching to a stored login’s token. [`/status`](</docs/en/commands>) shows this credential as an `Auth token` row reading `CLAUDE_CODE_OAUTH_TOKEN`. Generate a fresh token with [`claude setup-token`](</docs/en/authentication#generate-a-long-lived-token>) and restart with it, or unset the variable and run `/login`. Before v2.1.225, Claude Code could replace the variable’s value mid-session with the short-lived access token from a stored login, and the session failed with 401 errors again once that token expired.
- * For repeated prompts to log in across launches, see the system clock and macOS Keychain checks in [Troubleshooting](</docs/en/troubleshoot-install#not-logged-in-or-token-expired>)
+ * For repeated prompts to log in across launches, see the system clock checks and macOS credential-storage recovery steps in [Troubleshooting](</docs/en/troubleshoot-install#not-logged-in-or-token-expired>)
* For other failures including `403 Forbidden` and OAuth browser issues, see [Login and authentication](</docs/en/troubleshoot-install#login-and-authentication>)
###
@@ -947,14 +948,14 @@
Anthropic profile login expired · Re-authenticate your Anthropic profile
Anthropic profile login expired · Run /login to use your claude.ai account instead, or re-authenticate the profile
-This appears only when the active credential comes from an Anthropic credential profile, one you select with the `ANTHROPIC_PROFILE` environment variable or that Claude Code discovers as the active profile in your Anthropic configuration directory. Sessions that authenticate with `/login`, an API key, a bearer token such as `ANTHROPIC_AUTH_TOKEN`, or a third-party provider never see this message. Running `/login` doesn’t renew the profile credential. Which form you see depends on whether you selected the profile or Claude Code discovered it, and tells you whether a working login can take over instead:
-
- * When you set `ANTHROPIC_PROFILE` explicitly, the message ends with `Re-authenticate your Anthropic profile`. Claude Code gives the profile precedence over a saved login, so signing in doesn’t stop the error.
+This appears only when the active credential comes from an Anthropic credential profile, one you select with the `ANTHROPIC_PROFILE` environment variable, that Claude Code discovers as the active profile in your Anthropic configuration directory, or that Claude Code wrote when you [signed in without an API key](</docs/en/authentication#sign-in-without-an-api-key>). Sessions that authenticate with `/login`’s claude.ai option, an API key, a bearer token such as `ANTHROPIC_AUTH_TOKEN`, or a third-party provider never see this message. On a machine that [offers the keyless sign-in](</docs/en/authentication#sign-in-without-an-api-key>), run `/login`, choose the Anthropic Console account, and sign in again to renew a profile that the keyless Console sign-in or the Claude Platform CLI’s `ant auth login` wrote. Claude Code replaces the expired credential in that profile. For a federation profile or one another tool created, `/login` doesn’t renew the credential. Which form you see depends on whether you selected the profile or Claude Code discovered it:
+
+ * When you set `ANTHROPIC_PROFILE` explicitly, the message ends with `Re-authenticate your Anthropic profile`.
* When Claude Code discovered the profile from your configuration directory, the message offers `/login`, because Claude Code gives a working `/login` precedence over the discovered profile and then authenticates with your claude.ai or Console account instead. Before v2.1.234, Claude Code showed the `Re-authenticate your Anthropic profile` form in this case too.
**What to do:**
- * Sign in to the profile again with the tool that created it, then retry
+ * Sign in to the profile again, then retry: on a machine that [offers the keyless sign-in](</docs/en/authentication#sign-in-without-an-api-key>), run `/login` and choose the Anthropic Console account for a profile the keyless Console sign-in or the Claude Platform CLI’s `ant auth login` wrote; for other profiles, use the tool that created them
* If an administrator provisioned the profile’s credential, ask them to issue a new one
* Run `/status` to confirm the active credential source and profile name
* To stop using the profile, unset `ANTHROPIC_PROFILE` if you set it, then authenticate another way, such as `/login` or `ANTHROPIC_API_KEY`
@@ -1169,14 +1170,14 @@
Bedrock streaming response has an unexpected content-type
-A gateway or proxy between Claude Code and [Amazon Bedrock](</docs/en/amazon-bedrock>) is transforming the streaming response body or its `Content-Type` header. Amazon Bedrock streams responses as `application/vnd.amazon.eventstream`, and Claude Code rejects a successful streaming response that reports a different content-type instead of decoding a body it can’t read. The request isn’t retried.
+A gateway or proxy between Claude Code and [Amazon Bedrock](</docs/en/amazon-bedrock>) is transforming the streaming response body or its `Content-Type` header. Amazon Bedrock streams responses as `application/vnd.amazon.eventstream`. Rather than decode a body it can’t read, Claude Code rejects a successful streaming response that reports a different content-type. Claude Code doesn’t retry the request.
Bedrock streaming response has content-type "text/event-stream"; expected "application/vnd.amazon.eventstream". A gateway or proxy between Claude Code and Bedrock is likely transforming the response body — Bedrock's binary event-stream format must be passed through unmodified. Set CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD=1 to suppress this check while the gateway is being fixed.
Before v2.1.208, the same misconfiguration surfaced as `API Error: Truncated event message received` after the whole response had been buffered. **What to do:**
* Configure the gateway to pass the `InvokeModelWithResponseStream` response body and its `Content-Type` header through unmodified. An intermediary that re-emits the stream as server-sent events is a common cause.
- * If the gateway rewrites only the header and passes the binary body through intact, set [`CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD=1`](</docs/en/env-vars>) to skip the check until the gateway is fixed. See [Streaming errors behind a gateway or proxy](</docs/en/amazon-bedrock#streaming-errors-behind-a-gateway-or-proxy>).
+ * Setting [`CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD=1`](</docs/en/env-vars>) hides this error, but Claude Code doesn’t decode a binary body under a rewritten header, so those requests fall back to a slower non-streaming path. See [Streaming errors behind a gateway or proxy](</docs/en/amazon-bedrock#streaming-errors-behind-a-gateway-or-proxy>).
###
@@ -1499,7 +1500,7 @@
API Error: 400 ... tools.N.custom.input_schema: JSON schema is invalid
-Claude Code [excludes MCP tools whose input schema would fail this validation](</docs/en/mcp#tools-with-invalid-input-schemas>) when it loads a server’s tools, so requests normally never include one. On a deployment that doesn’t receive the remote configuration that enables the exclusion, Claude Code records in the server’s log which tool would be rejected but sends it anyway, so this error can still occur. The error can also occur for a tool whose schema declares a JSON Schema dialect other than draft 2020-12 in `$schema`: Claude Code doesn’t check those schemas against the JSON Schema meta-schema, though it still excludes one with an invalid top-level property name. Before v2.1.216, no deployment ran the exclusion checks. **What to do:**
+Claude Code [excludes MCP tools whose input schema would fail this validation](</docs/en/mcp#tools-with-invalid-input-schemas>) when it loads a server’s tools, so requests normally never include one. On a [deployment where flag fetching is off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), or on a machine whose flags have never arrived, Claude Code records in the server’s log which tool would be rejected but sends it anyway, so this error can still occur. The error can also occur for a tool whose schema declares a JSON Schema dialect other than draft 2020-12 in `$schema`. Claude Code doesn’t check those schemas against the JSON Schema meta-schema, though the top-level property-name check still applies. Before v2.1.216, no deployment ran the exclusion checks. **What to do:**
* If your Claude Code version is earlier than v2.1.216, run `claude update`.
* Remove or [disable](</docs/en/mcp#disable-a-server-without-removing-it>) the MCP server that declares the invalid schema. The error names the tool only by position. On v2.1.216 or later, check each server’s log for a line naming a tool whose input schema would be rejected. If no log names one, disable servers one at a time.
@@ -1667,7 +1668,7 @@
Send feedback with /feedback or learn more: https://www.anthropic.com/legal/aup
-The message names the model that declined, or `Claude` when no model is recorded. In [non-interactive mode](</docs/en/headless>) (`-p`), the final line reads `Learn more:` followed by the link, without the `/feedback` mention. The check evaluates the full conversation, not only your latest prompt, so sending a new message in the same session usually re-triggers the same refusal. The same applies after exiting and reopening the session with `--continue` or `--resume`, since the transcript on disk still contains the triggering content. On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), this message also covers requests the model’s safety measures flagged as a cybersecurity topic. See Safety measures flagged a cybersecurity topic. Before v2.1.219, the message read `Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session for Claude Code to assist with a different task.` **What to do:**
+The message names the model that declined, or `Claude` when no model is recorded. The check evaluates the full conversation, not only your latest prompt, so sending a new message in the same session usually re-triggers the same refusal. The same applies after exiting and reopening the session with `--continue` or `--resume`, since the transcript on disk still contains the triggering content. On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), this message also covers requests the model’s safety measures flagged as a cybersecurity topic. See Safety measures flagged a cybersecurity topic. Before v2.1.219, the message read `Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session for Claude Code to assist with a different task.` **What to do:**
* Press Esc twice or run `/rewind` to step back to a checkpoint before the turn that triggered the refusal, then rephrase or take a different approach. See [Checkpointing](</docs/en/checkpointing>).
* If you can’t identify which turn caused it, run `/clear` to start a fresh conversation in the same project. Your previous conversation is preserved on disk and remains available in `/resume`.
@@ -1683,12 +1684,7 @@
API Error: Opus 4.8's safeguards flagged this message. Our intentionally broad safeguards allow us to deliver more capabilities faster, but can sometimes flag legitimate cybersecurity work. Apply to the Cyber Verification Program to reduce these interruptions. Send feedback with /feedback or learn more: https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude
-The message links to the [Cyber Verification Program](<https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude>), which grants access for legitimate cybersecurity work. What you see depends on your provider and mode:
-
- * On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), a cybersecurity flag produces the Usage Policy refusal message instead.
- * In [non-interactive mode](</docs/en/headless>), the final sentence reads `Learn more:` followed by the link, without the `/feedback` mention.
-
-The safeguard itself is server-side and predates v2.1.203; client releases since then have changed only the message’s wording. From v2.1.203 through v2.1.218, the message read `<model> has safety measures that flagged this message for a cybersecurity topic. To learn about the Cyber Verification Program and apply for access, visit our help center:` followed by the same help-center link, and interactive sessions appended `If you were not engaging in a cybersecurity topic, please send feedback via /feedback.` Before v2.1.203, it read `<model>'s safeguards flagged this message for a cybersecurity topic. If your work requires this access, you can apply for an exemption:` followed by an exemption form link. **What to do:**
+The message links to the [Cyber Verification Program](<https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude>), which grants access for legitimate cybersecurity work. On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), a cybersecurity flag produces the Usage Policy refusal message instead. The safeguard itself is server-side and predates v2.1.203; client releases since then have changed only the message’s wording. From v2.1.203 through v2.1.218, the message read `<model> has safety measures that flagged this message for a cybersecurity topic. To learn about the Cyber Verification Program and apply for access, visit our help center:` followed by the same help-center link, and interactive sessions appended `If you were not engaging in a cybersecurity topic, please send feedback via /feedback.` Before v2.1.203, it read `<model>'s safeguards flagged this message for a cybersecurity topic. If your work requires this access, you can apply for an exemption:` followed by an exemption form link. **What to do:**
* If your work requires this content, apply for access through the [Cyber Verification Program](<https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude>)
* If your request wasn’t about a cybersecurity topic, run `/feedback` to report the false positive
@@ -2043,10 +2039,10 @@
Claude Code suggests the closest command name or alias that the menu lists in this session. When nothing is close, the message ends after the name. The cause is usually one of the following:
* A typo, such as `/hepl` for `/help`. [How the command menu matches what you type](</docs/en/commands#how-the-command-menu-matches-what-you-type>) covers picking a close match before you submit
- * A command that exists but isn’t available in this session because a requirement isn’t met, such as your platform, plan, or authentication method. The troubleshooting entries for [`/web-setup`](</docs/en/web-quickstart#web-setup-shows-no-commands-match-or-unknown-command>) and [`/schedule`](</docs/en/routines#schedule-returns-unknown-command>) walk through two common cases
+ * A command that exists but isn’t available in this session because a requirement isn’t met, such as your platform, plan, or authentication method. The troubleshooting entries for [`/web-setup`](</docs/en/web-quickstart#web-setup-shows-no-commands-match-or-unknown-command>) and [`/schedule`](</docs/en/routines#schedule-returns-unknown-command>) walk through two common cases. Some commands answer with their own message when your organization’s policy disables them
* A command from a [plugin](</docs/en/plugins>) or [MCP server](</docs/en/mcp#use-mcp-prompts-as-commands>) that isn’t installed or connected in this session
-Before v2.1.236, if you pressed `Enter` while the command menu listed a near match for the name you typed, Claude Code ran that match, so a typo such as `/hepl` ran `/help` instead of producing this message. **What to do:**
+Claude Code doesn’t treat every prompt that starts with `/` as a command. It sends the prompt to Claude as a normal message when the first word after the `/` starts with punctuation, such as the `/--` that opens a Lean doc comment, or is a path such as `/var/log/syslog`. Before v2.1.236, if you pressed `Enter` while the command menu listed a near match for the name you typed, Claude Code ran that match, so a typo such as `/hepl` ran `/help` instead of producing this message. **What to do:**
* Run the suggested name, or type `/` followed by part of the name to see what’s available in this session
* If Claude Code reports a documented command as unknown, check its row in the [commands reference](</docs/en/commands>) for the requirement it names
--- a/fast-mode.md
+++ b/fast-mode.md
@@ -109,7 +109,9 @@
Fast mode requires all of the following:
* **Anthropic API or subscription only** : fast mode is available through the Anthropic Console API and for Claude subscription plans using usage credits. It is not available on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS. Console organizations must also have fast mode access provisioned.
- * **Usage credits turned on for subscription plans** : on a Pro, Max, Team, or Enterprise plan, your account must have [usage credits](</docs/en/costs#add-usage-credits-to-your-subscription>) turned on, which allows billing beyond your plan’s included usage. Until they’re on, `/fast` shows “Fast mode requires usage credits · /usage-credits to turn them on”. On Pro and Max, turn them on in the **Usage credits** section of [**Settings > Usage**](<https://claude.ai/settings/usage>) on claude.ai, or run `/usage-credits` to open that page. On Team and Enterprise, a member with billing access turns them on for the organization at [**Admin settings > Usage**](<https://claude.ai/admin-settings/usage>), and a member without it runs `/usage-credits` to send the organization’s admins a request.
+ * **Usage credits turned on for subscription plans** : on a Pro, Max, Team, or Enterprise plan, your account must have [usage credits](</docs/en/costs#add-usage-credits-to-your-subscription>) turned on, which allows billing beyond your plan’s included usage. Until they’re on, `/fast` shows “Fast mode requires usage credits · /usage-credits to turn them on”. How you turn them on depends on your plan:
+ * On Pro and Max, turn them on in the **Usage credits** section of [**Settings > Usage**](<https://claude.ai/settings/usage>) on claude.ai, or run `/usage-credits` to open that page.
+ * On Team and Enterprise, a member with billing access turns them on for the organization at [**Admin settings > Usage**](<https://claude.ai/admin-settings/usage>), and a member without it runs `/usage-credits` to send the organization’s admins a request.
Fast mode usage draws directly from usage credits, even if you have remaining usage on your plan.
--- a/feature-availability.md
+++ b/feature-availability.md
@@ -9,7 +9,7 @@
How you authenticate determines which features Claude Code can reach. For a single list of what is missing on your provider, see the summary by provider tabs. To find your column in the tables:
* **Claude subscription** : you sign in with a claude.ai account on the Pro, Max, Team, or Enterprise plan
- * **Anthropic Console** : you authenticate with an Anthropic API key
+ * **Anthropic Console** : you authenticate with an Anthropic API key or by [signing in to a Console account without one](</docs/en/authentication#sign-in-without-an-api-key>)
* **Amazon Bedrock** : you use Claude models from the Amazon Bedrock model catalog and set `CLAUDE_CODE_USE_BEDROCK`. The [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) (`CLAUDE_CODE_USE_MANTLE`) is covered by this column
* **Claude Platform on AWS** : you bought Claude through AWS Marketplace but call the Anthropic API, and set `CLAUDE_CODE_USE_ANTHROPIC_AWS`
* **Google Cloud’s Agent Platform** : Google-operated; you set `CLAUDE_CODE_USE_VERTEX`
--- a/features-overview.md
+++ b/features-overview.md
@@ -244,7 +244,7 @@
**When:** On demand, when you or Claude spawns one for a task.**What loads:** Fresh, isolated context containing:
- * The agent’s own system prompt, not the full Claude Code system prompt
+ * The agent’s own system prompt, not the Claude Code system prompt
* Full content of skills listed in the agent’s `skills:` field
* CLAUDE.md and git status, except the built-in Explore and Plan agents [omit both](</docs/en/sub-agents#what-loads-at-startup>)
* Whatever context the lead agent passes in the prompt
--- a/gateways.md
+++ b/gateways.md
@@ -60,7 +60,9 @@
* **Which model answers** : pick the model with the `/model` command or [model environment variables](</docs/en/model-config#setting-your-model>). The gateway decides where requests go, not which model the developer selects. Claude apps gateway can bound the choice with a per-group `availableModels` allowlist, but the developer still picks within it.
* **Other network traffic** : Claude Code itself sends version checks and downloads directly to Anthropic, separate from the gateway path. Your network still needs egress to the [required domains](</docs/en/network-config>), or set [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>) to turn off the optional streams.
- * **Client telemetry** : on a Claude apps gateway session, Claude Code sends no client analytics to Anthropic. It disables the Anthropic-bound analytics when the session signs in. For other gateways, whether the optional client telemetry stream is on depends on your provider, and the [telemetry defaults table](</docs/en/data-usage#telemetry-services>) covers each case. Where a gateway session’s telemetry goes depends on how the session signed in, and [What’s enforced on developers](</docs/en/claude-apps-gateway#whats-enforced-on-developers>) says where each kind of session’s exports go.
+ * **Client telemetry** : Claude Code disables its Anthropic-bound client analytics when a session signs in to a Claude apps gateway. To keep pre-sign-in startup analytics off as well, deliver [`DISABLE_TELEMETRY`](</docs/en/managed-settings#turn-telemetry-off-for-your-organization>) in the [client-side managed settings](</docs/en/claude-apps-gateway-config#client-side-managed-settings>) on each device.
+ * **Client telemetry on other gateways** : whether Claude Code sends the optional client telemetry stream depends on your provider, and the [telemetry defaults table](</docs/en/data-usage#default-behaviors-by-api-provider>) covers each case.
+ * **Telemetry destinations** : where Claude Code sends a gateway session’s telemetry depends on how the session signed in, and [What’s enforced on developers](</docs/en/claude-apps-gateway#whats-enforced-on-developers>) says where each kind of session’s exports go.
* **Corporate HTTP proxies** : an `HTTPS_PROXY` sits between Claude Code and every server it talks to, including the gateway. If your network requires one, [configure the proxy](</docs/en/network-config>) in addition to the gateway. For a Claude apps gateway you host, [sign-in checks that the proxy host is also on a private network](</docs/en/claude-apps-gateway#prerequisites>); if it isn’t, add the gateway host to `NO_PROXY` so the CLI connects to it directly.
##
--- a/headless.md
+++ b/headless.md
@@ -50,7 +50,7 @@
Background tasks at exit
-If Claude starts a [background Bash task](</docs/en/tools-reference#bash-tool-behavior>) during a `claude -p` run, for example a dev server or a watch build, that shell is terminated about five seconds after Claude has returned its final result and stdin has closed. The grace period lets a task that finishes right after the result still deliver its output. Before v2.1.163, a never-exiting background process would hold the `claude -p` invocation open indefinitely. Background [subagents](</docs/en/sub-agents>) and workflows are exempt from the five-second grace because their result is part of the final output, so `claude -p` waits for them to complete. From v2.1.182, that wait is capped at ten minutes by default so a stuck background agent cannot hold the process open indefinitely. Adjust the cap with [`CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS`](</docs/en/env-vars>), or set it to `0` to wait without a limit.
+If Claude starts a [background Bash task](</docs/en/tools-reference#bash-tool-behavior>) during a `claude -p` run, for example a dev server or a watch build, that shell is terminated about five seconds after Claude has returned its final result and stdin has closed. The grace period lets a task that finishes right after the result still deliver its output. Before v2.1.163, a never-exiting background process would hold the `claude -p` invocation open indefinitely. Background [subagents](</docs/en/sub-agents>) and workflows are exempt from the five-second grace because their result is part of the final output, so `claude -p` waits for them to complete. From v2.1.182, that wait is capped at ten minutes of continuous idle waiting by default, so a stuck background agent can’t hold the process open indefinitely. Adjust the cap with [`CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS`](</docs/en/env-vars>), or set it to `0` to wait without a limit.
###
@@ -171,7 +171,7 @@
Handle API retries
-When an API request fails with a retryable error, Claude Code emits a `system/api_retry` event before retrying. You can use this to surface retry progress or implement custom backoff logic.
+When an API request fails with a retryable error, Claude Code emits a `system/api_retry` event before retrying. On v2.1.246 or later, when a `401` or `403` rejects an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) credential, Claude Code makes the first two retries quietly with no event, then emits the event as usual from the third consecutive retry onward. The quiet retries still count toward `attempt`. You can use the event to show retry progress in your own interface.
Field| Type| Description
---|---|---
--- a/hooks-guide.md
+++ b/hooks-guide.md
@@ -168,13 +168,13 @@
`elicitation_url_dialog`| An MCP server asks you to open a browser URL and you haven’t typed for about six seconds
`elicitation_complete`| An MCP server reports that a [URL-mode elicitation](</docs/en/hooks#elicitation-input>) is complete
`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_needs_input`| A background session starts waiting on your input while [agent view](</docs/en/agent-view>) is open, or the current session asks you an [agent team teammate’s terminal setup question](</docs/en/agent-teams#choose-a-display-mode>) and you haven’t typed for about six seconds
`agent_completed`| A background session finishes or fails. Fires only while [agent view](</docs/en/agent-view>) is open
`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. In terminal sessions, `permission_prompt` for a sandboxed command’s network request requires Claude Code v2.1.246 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>).
+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. In terminal sessions, `permission_prompt` for a sandboxed command’s network request requires Claude Code v2.1.246 or later. `agent_needs_input` for a teammate’s terminal setup question requires Claude Code v2.1.248 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>).
###
--- a/hosting.md
+++ b/hosting.md
@@ -6,15 +6,35 @@
The subprocess model
-Every hosting decision on this page follows from how the SDK runs the agent. When your code calls `query()`, the SDK spawns a separate `claude` CLI process and talks to it over stdio. That subprocess owns the shell, the working directory, and the JSONL session transcripts on local disk. One agent session maps to one subprocess. Running N concurrent sessions means N subprocesses, each with its own process tree and transcript file. By default they all inherit your application’s working directory, so pass `cwd` on each `query()` call when sessions need separate filesystems:
+Every hosting decision on this page follows from how the SDK runs the agent. When your code calls `query()`, the SDK spawns a separate `claude` CLI process and talks to it over stdio. That subprocess owns the shell, the working directory, and the JSONL session transcripts on local disk. One agent session maps to one subprocess. Running N concurrent sessions means N subprocesses, each with its own process tree and transcript file. By default they all inherit your application’s working directory. When sessions need separate filesystems, pass a distinct `cwd` in the options of each session’s `query()` call:
TypeScript
Python
- query({ prompt, options: { cwd: "/work/session-a" } })
-
- query(prompt=prompt, options=ClaudeAgentOptions(cwd="/work/session-a"))
+ import { query } from "@anthropic-ai/claude-agent-sdk";
+
+ for await (const message of query({
+ prompt: "Summarize the files in this directory",
+ options: { cwd: "/work/session-a" },
+ })) {
+ console.log(message);
+ }
+
+ import asyncio
+
+ from claude_agent_sdk import ClaudeAgentOptions, query
+
+ async def main():
+ async for message in query(
+ prompt="Summarize the files in this directory",
+ options=ClaudeAgentOptions(cwd="/work/session-a"),
+ ):
+ print(message)
+
+ asyncio.run(main())
+
+The TypeScript examples on this page use top-level `await`, so save them as `.mts` files or set `"type": "module"` in `package.json`.
###
@@ -46,7 +66,7 @@
Ephemeral sessions
-Create a container for each user task and destroy it when the task completes. Best for one-off tasks. The user may still interact with the AI while the task is completing, but once completed the container is destroyed. Example workloads include bug investigation and fix, invoice and receipt extraction, document translation, and media transformation. The container runs a one-shot entrypoint that calls the SDK and exits. In TypeScript, save the file as `entrypoint.mts` or set `"type": "module"` in `package.json` so top-level `await` is available.
+Create a container for each user task and destroy it when the task completes. Best for one-off tasks. The user may still interact with the AI while the task is completing, but once completed the container is destroyed. Example workloads include bug investigation and fix, invoice and receipt extraction, document translation, and media transformation. The container runs a one-shot entrypoint that reads the task from the `TASK_PROMPT` environment variable, calls the SDK, and exits.
TypeScript
@@ -72,6 +92,8 @@
print(message)
asyncio.run(main())
+
+The script prints each message as it arrives, including a result message whose `subtype` is `success` when the task completes within the turn limit. If the task hits the 20-turn limit instead, the result message’s `subtype` is `error_max_turns` and the `query()` call raises an error after yielding it, so wrap the loop in a try block if the container needs to exit cleanly. See [Handle the result](</docs/en/agent-sdk/agent-loop#handle-the-result>) for the error subtypes.
###
@@ -330,7 +352,7 @@
Limitation| What to do
---|---
-No top-level session timeout| A session does not time out on its own. Set `maxTurns` in `Options` to bound how many tool-use round trips the agent takes before stopping.
+No top-level session timeout| A session does not time out on its own. Set `maxTurns` in TypeScript or `max_turns` in Python to bound how many tool-use round trips the agent takes before stopping.
Memory growth over long sessions| Cap session length or recycle subprocesses periodically. See Scaling and concurrency.
Large parallel-subagent fanouts can hit rate limits| Break work into smaller batches rather than issuing one wide dispatch.
No per-subagent wall-clock deadline| Cap each [subagent](</docs/en/agent-sdk/subagents>) with `maxTurns` in its `AgentDefinition`. For background subagents only, `CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS` sets a stall watchdog that fires when a `run_in_background` subagent stops producing output; it is not a total-runtime deadline.
--- a/llm-gateway-connect.md
+++ b/llm-gateway-connect.md
@@ -352,7 +352,7 @@
"apiKeyHelper": "powershell -NoProfile -File C:\\scripts\\get-gateway-key.ps1"
}
-Claude Code caches the helper’s output for five minutes by default and re-runs it when a request returns HTTP 401. To change the cache lifetime, set `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` in milliseconds, for example `CLAUDE_CODE_API_KEY_HELPER_TTL_MS=900000` for 15 minutes. The helper’s value is sent in both the `Authorization` and `x-api-key` headers, so it works whichever header your gateway reads.
+Claude Code caches the helper’s output for five minutes by default and re-runs the helper after the cache lifetime elapses. To change the lifetime, set `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` in milliseconds, for example `CLAUDE_CODE_API_KEY_HELPER_TTL_MS=900000` for 15 minutes. See [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) for the other cases in which Claude Code re-runs the helper. The helper’s value is sent in both the `Authorization` and `x-api-key` headers, so it works whichever header your gateway reads.
###
--- a/llm-gateway-protocol.md
+++ b/llm-gateway-protocol.md
@@ -54,7 +54,7 @@
Streaming
-Inference responses must stream. Claude Code consumes server-sent events as they arrive, so a gateway that buffers complete responses before relaying them stalls the client. Forward keep-alive pings as well. On connections through `ANTHROPIC_BASE_URL` or `ANTHROPIC_AWS_BASE_URL`, Claude Code counts every byte your gateway relays, including SSE `ping` events and comment lines, and aborts a stream that goes silent for 300 seconds by default. The upstream’s pings are the only traffic during long thinking pauses, so if your gateway strips or buffers them, Claude Code aborts the stream during those pauses; [Automatic retries](</docs/en/errors#automatic-retries>) covers what an aborted stream reports based on how far the response had progressed. An upstream that sends no pings at all, such as Amazon Bedrock’s binary event-stream, leaves those pauses with nothing to forward. When translating from such an upstream, emit your own `ping` events during silent gaps. Gateways reached through `ANTHROPIC_BEDROCK_BASE_URL`, `ANTHROPIC_VERTEX_BASE_URL`, or `ANTHROPIC_FOUNDRY_BASE_URL` aren’t wrapped by this byte-level watchdog, even when they relay the Anthropic Messages format; there, a [5-minute idle timeout](</docs/en/env-vars>) aborts a silent stream instead, and on `ANTHROPIC_BEDROCK_BASE_URL` connections you can add the byte watchdog with [`CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK`](</docs/en/env-vars>).
+Stream inference responses. Claude Code reads the stream as it arrives, so if your gateway buffers complete responses before relaying them, Claude Code stalls. When the client speaks the Amazon Bedrock format, relay the `InvokeModelWithResponseStream` response body and its `Content-Type: application/vnd.amazon.eventstream` header unmodified, and don’t convert the stream to server-sent events. See [Streaming errors behind a gateway or proxy](</docs/en/amazon-bedrock#streaming-errors-behind-a-gateway-or-proxy>). Forward keep-alive pings as well. On connections through `ANTHROPIC_BASE_URL` or `ANTHROPIC_AWS_BASE_URL`, Claude Code counts every byte your gateway relays, including SSE `ping` events and comment lines, and aborts a stream that goes silent for 300 seconds by default. The upstream’s pings are the only traffic during long thinking pauses, so if your gateway strips or buffers them, Claude Code aborts the stream during those pauses; [Automatic retries](</docs/en/errors#automatic-retries>) covers what an aborted stream reports based on how far the response had progressed. An upstream that sends no pings at all, such as Amazon Bedrock’s binary event-stream, leaves those pauses with nothing to forward. When translating from such an upstream, emit your own `ping` events during silent gaps. Gateways reached through `ANTHROPIC_BEDROCK_BASE_URL`, `ANTHROPIC_VERTEX_BASE_URL`, or `ANTHROPIC_FOUNDRY_BASE_URL` aren’t wrapped by this byte-level watchdog, even when they relay the Anthropic Messages format; there, a [5-minute idle timeout](</docs/en/env-vars>) aborts a silent stream instead, and on `ANTHROPIC_BEDROCK_BASE_URL` connections you can add the byte watchdog with [`CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK`](</docs/en/env-vars>).
###
--- a/managed-settings.md
+++ b/managed-settings.md
@@ -186,7 +186,7 @@
A [`policyHelper`](</docs/en/settings-reference#policyhelper>) is an executable your MDM policy or managed settings file names, and Claude Code runs it to compute managed settings at startup. When the selected source configures one and the helper emits a `managedSettings` object, that output changes what Claude Code reads:
- * **The emitted`managedSettings` object is the only managed settings for the session**, including for the keys it otherwise reads from every admin source, apart from `forceRemoteSettingsRefresh`, which Claude Code checks in every admin source at startup before the helper runs. A helper that exits 0 without emitting one contributes nothing, and the sources apply as usual; a helper that fails stops Claude Code from starting, as the [`policyHelper`](</docs/en/settings-reference#policyhelper>) entry describes
+ * **The emitted`managedSettings` object is the only managed settings for the session**, including for the keys it otherwise reads from every admin source, apart from `forceRemoteSettingsRefresh`, which Claude Code checks in every admin source at startup before the helper runs. For which helper runs fail, and what Claude Code does when one does, see [Helper failures](</docs/en/settings-reference#helper-failures>)
Claude Code selects the source at startup, and that selection decides whether a helper runs. The [`policyHelper`](</docs/en/settings-reference#policyhelper>) entry says which sources can configure a helper.
@@ -271,7 +271,7 @@
Find entries Claude Code dropped
-When a managed settings file, MDM profile, registry value, or server-managed payload fails schema validation, Claude Code first skips the individual entries it can repair, such as one invalid permission rule, with a warning for each, then drops any top-level key whose value still fails and keeps enforcing every remaining valid key. Claude Code is stricter with the `managedSettings` a [`policyHelper`](</docs/en/settings-reference#policyhelper>) emits: it makes the same entry repairs, but any schema violation that survives fails the whole helper run, and at startup Claude Code refuses to start, the same as for a helper that exits non-zero. A managed settings file or drop-in file that isn’t valid JSON contributes no settings at all; Claude Code reports it with the other validation errors and reads the remaining sources as usual. To find a dropped entry, look in one of three places:
+When a managed settings file, MDM profile, registry value, or server-managed payload fails schema validation, Claude Code first skips the individual entries it can repair, such as one invalid permission rule, with a warning for each, then drops any top-level key whose value still fails and keeps enforcing every remaining valid key. Claude Code is stricter with the `managedSettings` a [`policyHelper`](</docs/en/settings-reference#policyhelper>) emits: it makes the same entry repairs, but any schema violation that survives fails the whole helper run, and at startup Claude Code refuses to start, the same as for a helper that exits non-zero. A managed settings file or drop-in file that isn’t valid JSON contributes no settings at all; Claude Code reports it with the other validation errors and reads the remaining sources as usual. If a managed settings file or drop-in file can’t be read or parsed and no other admin source supplies a policy, sessions signed in with claude.ai or Claude Console credentials exit at startup with a message to contact an administrator. To find a dropped entry, look in one of three places:
* Interactive sessions show a dialog at startup listing the invalid entries.
* Non-interactive runs with `-p` print a summary to stderr.
@@ -298,7 +298,7 @@
`deniedMcpServers`| An individual invalid entry is stripped and the valid subset is enforced. A wholly invalid value is dropped with a warning, since denying every server would block servers the policy never named.
`sandbox.credentials`| A recoverable invalid entry is degraded to `mode: "deny"` with a warning; an unrecoverable one is stripped; valid entries stay enforced. See [invalid credential entries](</docs/en/settings-reference#invalid-credential-entries-in-managed-settings>)
-`requiredMinimumVersion` and `requiredMaximumVersion` fail open by design: an invalid value is dropped rather than enforced, so a bad policy push can’t prevent Claude Code from starting. This tolerance applies only to managed settings. User, project, and local settings files remain strict: a file whose JSON or top-level shape fails validation is rejected as a whole and reported, and an individual entry that fails, such as a malformed permission rule, is skipped with a warning while the rest of the file applies.
+`requiredMinimumVersion` and `requiredMaximumVersion` fail open by design: an invalid value is dropped rather than enforced. This tolerance applies only to managed settings. User, project, and local settings files remain strict: a file whose JSON or top-level shape fails validation is rejected as a whole and reported, and an individual entry that fails, such as a malformed permission rule, is skipped with a warning while the rest of the file applies.
##
--- a/mcp.md
+++ b/mcp.md
@@ -72,7 +72,7 @@
In code
-Pass MCP servers directly in the `mcpServers` option:
+Pass MCP servers directly in the `mcpServers` option. This example starts a local filesystem MCP server for `/Users/me/projects`. Replace that path with a directory on your machine:
TypeScript
@@ -127,7 +127,7 @@
From a config file
-Create a `.mcp.json` file at your project root. The file is picked up when the `project` setting source is enabled, which it is for default `query()` options. If you set `settingSources` explicitly, include `"project"` for this file to load:
+Create a `.mcp.json` file at your project root. The file is picked up when the `project` setting source is enabled, which it is for default `query()` options. If you set `settingSources` explicitly, include `"project"` for this file to load. Replace `/Users/me/projects` with a directory on your machine:
{
"mcpServers": {
@@ -278,7 +278,7 @@
stdio servers
-Local processes that communicate via stdin/stdout. Use this for MCP servers you run on the same machine. For the `.mcp.json` form, use the same fields shown at From a config file. In code, pass the command and its arguments:
+Local processes that communicate via stdin/stdout. Use this for MCP servers you run on the same machine. For the `.mcp.json` form, use the same fields shown at From a config file. In code, pass the command and its arguments. Replace `/Users/me/projects` with a directory on your machine:
TypeScript
@@ -348,7 +348,7 @@
allowed_tools=["mcp__remote-api__*"],
)
-For the streamable HTTP transport, use `"type": "http"` instead. In `.mcp.json` and other JSON config files, `"streamable-http"` is accepted as an alias for `"http"`. The programmatic `mcpServers` option accepts only `"http"`.
+For the streamable HTTP transport, use `"type": "http"` instead. In `.mcp.json` and other JSON config files, `"streamable-http"` is accepted as an alias for `"http"`. The SDKs’ `McpHttpServerConfig` type declares only `"http"`, so use `"http"` for servers you pass in code.
###
@@ -630,6 +630,8 @@
print(message.result)
asyncio.run(main())
+
+In the `MCP servers:` line, a `status` of `connected` for `github` confirms the token works. If Claude Code has a cached tool list for the server, the status can read `pending` instead and the server connects on its first tool call. If the status is `failed` or `needs-auth`, see Error handling before trusting the result, since Claude can fall back to built-in tools when the server is unavailable.
###
--- a/memory.md
+++ b/memory.md
@@ -313,7 +313,7 @@
]
}
-Patterns are matched against absolute file paths using glob syntax. You can configure `claudeMdExcludes` at any [settings layer](</docs/en/settings#where-settings-live>): user, project, local, or managed policy. Arrays merge across layers. Managed policy CLAUDE.md files cannot be excluded. This ensures organization-wide instructions always apply regardless of individual settings.
+Patterns are matched against absolute file paths using glob syntax. You can configure `claudeMdExcludes` at any [settings layer](</docs/en/settings#where-settings-live>): user, project, local, or managed policy. Arrays merge across layers. To exclude a rules file you reach through a symlink, whether the file or its directory is the link, write the pattern against either path: the file’s path under `.claude/rules/` or its link target. A pattern that matches either path excludes the file. Before v2.1.239, only a pattern that matched the link target excluded the file. Managed policy CLAUDE.md files cannot be excluded. This ensures organization-wide instructions always apply regardless of individual settings.
##
--- a/model-config.md
+++ b/model-config.md
@@ -172,7 +172,7 @@
* **`/model`** : Claude Code rejects the switch with an error
* **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: Claude Code replaces the value at startup with a warning naming both the requested and substituted models, and the session starts on the default model
* **`ANTHROPIC_DEFAULT_MODEL`** : Claude Code ignores the variable
- * **Subagent or teammate override** : Claude Code falls back to the [subagent’s inherited model](</docs/en/sub-agents#choose-a-model>) or the [lead’s model for a teammate](</docs/en/agent-teams#specify-teammates-and-models>) rather than failing the request. In interactive sessions, Claude Code warns you when it substitutes a subagent’s model, by this fallback or by the newest-permitted-version substitution above, naming the requested and substituted models; it doesn’t report a teammate’s fallback. Where the newest-permitted-version substitution above operates, a blocked family alias follows it instead; before v2.1.222, an alias fell back like any other blocked value on every provider
+ * **Subagent or teammate override** : Claude Code runs the subagent or teammate on a fallback model rather than failing the request. See [Choose a model](</docs/en/sub-agents#choose-a-model>) for the subagent fallback and [Specify teammates and models](</docs/en/agent-teams#specify-teammates-and-models>) for the teammate fallback. In interactive sessions, Claude Code warns you when it substitutes a subagent’s model, by this fallback or by the newest-permitted-version substitution above, naming the requested and substituted models; it doesn’t report a teammate’s fallback. Where the newest-permitted-version substitution above operates, a blocked family alias follows it instead. Before v2.1.222, an alias fell back like any other blocked value on every provider
* **Skill or command override** : Claude Code ignores the override, including a blocked family alias, and the skill or command runs on the session model. A skill or command that [runs in a subagent](</docs/en/skills#run-skills-in-a-subagent>) follows the subagent behavior above instead
* **`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
@@ -331,12 +331,12 @@
The behavior of `default` depends on your account type:
- * **Max, Team Premium, Enterprise pay-as-you-go, and Anthropic API** : defaults to Opus 5
+ * **Max, Team Premium, Enterprise, and Anthropic API** : defaults to Opus 5
* **Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 5
- * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 5
+ * **Pro and Team Standard** : defaults to Sonnet 5
* **Microsoft Foundry** : defaults to Sonnet 4.5
-Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, for example with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models.
+Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, for example with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models.
###
@@ -444,15 +444,23 @@
Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max`
Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max`
-If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. The default effort is `high` on every model that supports effort, except Opus 4.7, which defaults to `xhigh`. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model, and holds it across sessions until you make an explicit effort choice, such as running `/effort` in an interactive session or launching with `--effort`. Opus 5 has no such hold: a level you previously set carries over. `low`, `medium`, `high`, and `xhigh` persist across sessions when you set them in an interactive session. `max` provides the deepest reasoning. Unless you set it through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable, `max` applies to the current session only.
+If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. Your organization can also cap which levels are available for a model; see Organization effort limits. With the [`ultracode`](</docs/en/settings-reference#ultracode>) setting off, Claude Code resolves the session’s effort level in this order, taking the first that applies:
+
+ 1. An explicit choice: the [`CLAUDE_CODE_EFFORT_LEVEL`](</docs/en/env-vars#variables>) environment variable, launching with `--effort`, or `/effort` in the session (a non-interactive `/effort` has narrower effect)
+ 2. The model’s default effort, on Fable 5, Opus 4.8, or Opus 4.7: from the first time you run one of these models, Claude Code holds that model’s default effort across sessions, even when your settings resolve a different level, until you change effort once, for example with an interactive `/effort`, the `/model` picker’s effort slider, or `--effort` at launch. Opus 5 has no such hold
+ 3. Your settings: the level you saved for the model or an [`effortLevel`](</docs/en/settings-reference#effortlevel>) key, with the precedence between them and across settings files stated at [`modelSettings`](</docs/en/settings-reference#modelsettings>)
+ 4. The model’s default effort: `high` on every model that supports effort, except that Opus 4.7 defaults to `xhigh` and, when your organization sets a default effort level for its organization default model, that level is the default when you run that model
+
+When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, Claude Code saves the level and applies it in later sessions. It saves the level per model, under the [`modelSettings`](</docs/en/settings-reference#modelsettings>) key in your user settings, so each model keeps its own saved level. `max` is the deepest reasoning level. Unless you set it through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable, Claude Code applies `max` to the current session only.
A level you pick from the effort control on a phone or browser connected through [Remote Control](</docs/en/remote-control#what-connected-devices-see>) applies to that session only.
-A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. It also can’t release the model-default hold: while the hold is in force, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. You can turn on ultracode through any of the following:
+A level set with `/effort` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, applies to the current session only and isn’t saved as your default. It also doesn’t count as the one change that ends the model-default step above on Fable 5, Opus 4.8, or Opus 4.7: while that step is in effect, a non-interactive `/effort` reports `Not applied`, so pass `--effort` at launch instead. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. For where it can be set persistently, see the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. You can turn on ultracode through any of the following:
* **`/effort`** : run `/effort ultracode`, or select it from the menu
* **`--effort` flag**: launch with `claude --effort ultracode`, which starts the session at `xhigh` effort with ultracode on
* **`ultracode` setting**: set [`"ultracode": true`](</docs/en/settings-reference#ultracode>) in a settings file, with `--settings`, or in an Agent SDK control request. An [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>) request also accepts `effortLevel: "ultracode"`
+ * **`/model` picker**: move the effort slider to `ultracode` with the arrow keys while you choose a model. Claude Code turns it on for the current session, even when you save that model as your default
Passing `ultracode` to the `--effort` flag or the Agent SDK `effortLevel` value requires Claude Code v2.1.203 or later. Before v2.1.203, `--effort ultracode` printed `Unknown --effort value 'ultracode'` and the session started at the default effort. The persisted `effortLevel` setting and the `CLAUDE_CODE_EFFORT_LEVEL` environment variable don’t accept `ultracode`. When `CLAUDE_CODE_EFFORT_LEVEL` is set to a level other than `xhigh`, requests run at that level and ultracode’s workflow orchestration stays inactive. Selecting ultracode then shows a warning that the environment variable overrides effort for the session. When ultracode isn’t available, for example when [workflows are turned off](</docs/en/workflows#turn-workflows-off>), `--effort ultracode` sets `xhigh` effort only.
@@ -491,15 +499,15 @@
You can change effort through any of the following:
- * **`/effort`** : run `/effort` with no arguments to open an interactive slider, `/effort` followed by a level name to set it directly, or `/effort auto` to reset to the model default. You can run it while Claude is working, and once you confirm the [cache warning](</docs/en/prompt-caching#changing-effort-level>), if Claude Code shows one, Claude Code applies the new level to the next request in the turn
+ * **`/effort`** : run `/effort` with no arguments to open an interactive slider, `/effort` followed by a level name to set it directly, or `/effort auto` to clear your saved level for the active model. You can run it while Claude is working, and once you confirm the [cache warning](</docs/en/prompt-caching#changing-effort-level>), if Claude Code shows one, Claude Code applies the new level to the next request in the turn
* **In`/model`**: use left/right arrow keys to adjust the effort slider when selecting a model
* **`--effort` flag**: pass a level name to set it for a single session when launching Claude Code
* **Environment variable** : set `CLAUDE_CODE_EFFORT_LEVEL` to a level name or `auto`
- * **Settings** : set `effortLevel` to `low`, `medium`, `high`, or `xhigh` in your settings file. `max` isn’t accepted here, and `ultracode` has its own [`ultracode`](</docs/en/settings-reference#ultracode>) key
+ * **Settings** : set a per-model level in [`modelSettings`](</docs/en/settings-reference#modelsettings>), or set [`effortLevel`](</docs/en/settings-reference#effortlevel>) to `low`, `medium`, `high`, or `xhigh` as the default for models without one. `max` isn’t accepted in either key, and `ultracode` has its own [`ultracode`](</docs/en/settings-reference#ultracode>) key
* **From a connected device** : in a [Remote Control](</docs/en/remote-control#what-connected-devices-see>) session, pick a level from the effort control on your phone or in your browser. The level applies to the current session only. Requires Claude Code v2.1.234 or later
* **Skill and subagent frontmatter** : set `effort` in a [skill](</docs/en/skills#frontmatter-reference>) or [subagent](</docs/en/sub-agents#supported-frontmatter-fields>) markdown file to override the effort level when that skill or subagent runs
-The environment variable takes precedence over all other methods, then your configured level, then the model default. Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The `effortLevel` key in [managed settings](</docs/en/managed-settings>) is a starting default, not enforcement: users can change it for a session with `/effort` or `--effort`, and the managed value re-asserts as the default in new sessions. The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes.
+Frontmatter effort applies when that skill or subagent is active, overriding the session level but not the environment variable. The `effortLevel` key in [managed settings](</docs/en/managed-settings>) is a starting default, not enforcement: users can change it for a session with `/effort` or `--effort`, and the managed value re-asserts as the default in new sessions. The effort slider appears in `/model` when a supported model is selected. The current effort level is also shown in the session header next to the model name, for example “with low effort”, so you can confirm which setting is active without opening `/model`. The footer also briefly shows the effort level at startup and when it changes.
####
@@ -659,7 +667,7 @@
`ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active.
`ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active.
`ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>)
-`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 overrides the per-invocation `model` parameter and the subagent definition’s `model` frontmatter. Set to `inherit` to use normal model resolution instead
+`CLAUDE_CODE_SUBAGENT_MODEL`| The default model for [subagents](</docs/en/sub-agents#choose-a-model>), [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammates, and [workflow](</docs/en/workflows>) agents that aren’t assigned a model another way. Accepts an alias such as `haiku` or a full model name. A per-invocation model or a definition’s `model` field, including `inherit`, takes precedence
Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`.
--- a/modifying-system-prompts.md
+++ b/modifying-system-prompts.md
@@ -219,7 +219,7 @@
By default, two sessions that use the same `claude_code` preset and `append` text still cannot share a prompt cache entry if they run from different working directories. This is because the preset embeds per-session context in the system prompt ahead of your `append` text: the working directory, whether it’s a git repository, the platform, the active shell, the OS version, and auto memory paths. Any difference in that context produces a different system prompt and a cache miss. CLAUDE.md content doesn’t affect the system prompt cache because the SDK injects it into the conversation, not the system prompt. To make the system prompt identical across sessions, set `excludeDynamicSections: true` in TypeScript or `"exclude_dynamic_sections": True` in Python. The per-session context moves into the first user message, leaving only the static preset and your `append` text in the system prompt so identical configurations share a cache entry across users and machines.
-`excludeDynamicSections` requires `@anthropic-ai/claude-agent-sdk` v0.2.98 or later, or `claude-agent-sdk` v0.1.58 or later for Python. It applies only to the preset object form and has no effect when `systemPrompt` is a string.
+`excludeDynamicSections` requires `@anthropic-ai/claude-agent-sdk` v0.2.98 or later, or `claude-agent-sdk` v0.1.58 or later for Python. Set it on the preset object form only. The SDK ignores it when you pass a custom prompt instead of the preset; to keep a custom prompt’s instructions cached in the TypeScript SDK, see Cache the static part of a custom prompt.
The following example pairs a shared `append` block with `excludeDynamicSections` so a fleet of agents running from different directories can reuse the same cached system prompt:
@@ -327,6 +327,43 @@
asyncio.run(main())
In Python, load a large custom prompt from a file with `system_prompt={"type": "file", "path": "..."}` instead of passing it as a string. The Python SDK passes a string prompt as one command-line argument to the CLI subprocess, so a prompt that exceeds the OS argument-length limit fails at process spawn before any API request is sent. On Linux the error is `Argument list too long`. See [`SystemPromptFile`](</docs/en/agent-sdk/python#systempromptfile>) for the platform thresholds and the Windows behavior.
+
+####
+
+
+
+Cache the static part of a custom prompt
+
+In the TypeScript SDK, you can pass a custom prompt as an array of strings instead of one string, with the `SYSTEM_PROMPT_DYNAMIC_BOUNDARY` marker between the static part and the rest. Use this when your prompt combines instructions that are the same on every request with context that changes per request, such as the customer or ticket the agent is handling. When you pass both parts as one string, a change to the per-request part changes the whole system prompt, so the static instructions miss the cache too. This form isn’t available in the Python SDK, whose `system_prompt` option accepts a string, a preset, or a [file](</docs/en/agent-sdk/python#systempromptfile>).
+
+The SDK splits the prompt only when it calls the Claude API directly or runs on [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). In every other configuration, such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or an [LLM gateway](</docs/en/llm-gateway-connect>), and whenever you set [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1`](</docs/en/llm-gateway-protocol#disable-pre-release-capabilities>), the SDK sends the whole prompt as one block, the same as passing one string.
+
+To split the prompt, import `SYSTEM_PROMPT_DYNAMIC_BOUNDARY` from `@anthropic-ai/claude-agent-sdk` and pass it as its own array element between the two parts. The SDK sends the strings before the marker as one text block and the strings after it as a second block, each with its own cache breakpoint. In the example below, a support agent loads its triage instructions from a file and receives details about one ticket on each request, so the instructions stay cached while the ticket details change:
+
+TypeScript
+
+ import { readFile } from "node:fs/promises";
+ import { query, SYSTEM_PROMPT_DYNAMIC_BOUNDARY } from "@anthropic-ai/claude-agent-sdk";
+
+ // Identical on every request
+ const instructions = await readFile("triage-instructions.md", "utf8");
+ // Different on every request
+ const ticketContext = "Customer plan: Enterprise. Other open tickets from this customer: 3.";
+
+ for await (const message of query({
+ prompt: "Triage ticket 4821",
+ options: {
+ systemPrompt: [instructions, SYSTEM_PROMPT_DYNAMIC_BOUNDARY, ticketContext]
+ }
+ })) {
+ // ...
+ }
+
+[Track cache tokens](</docs/en/agent-sdk/cost-tracking#track-cache-tokens>) describes the `cache_creation_input_tokens` and `cache_read_input_tokens` fields on each result message. The SDK assembles the blocks from the array as follows:
+
+ * The SDK joins the strings on each side of the marker with a blank line between them and removes the marker itself, so the marker text doesn’t reach Claude.
+ * If you include the marker more than once, the first one is the split and the SDK removes the others.
+ * If you leave the marker out, the SDK joins all the strings into one block, the same as passing one string.
##
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -64,8 +64,14 @@
* **Protocols** : when you set `OTEL_EXPORTER_OTLP_PROTOCOL`, Claude Code removes every developer-set per-signal protocol.
* **Credentials** : when you set `OTEL_EXPORTER_OTLP_HEADERS`, `OTEL_EXPORTER_OTLP_CLIENT_KEY`, or `OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE`, Claude Code removes the developer-set per-signal versions of that variable, plus every developer-set endpoint variable, generic or per-signal, since those credentials would otherwise reach a collector the managed settings didn’t choose.
* **Exporter selectors** : `OTEL_METRICS_EXPORTER`, `OTEL_LOGS_EXPORTER`, and the beta `OTEL_TRACES_EXPORTER` follow normal per-key precedence. A developer’s setting can still disable a signal or switch it to the console exporter, so set the selectors in managed settings too if you need them locked. Across [admin sources](</docs/en/managed-settings#precedence-within-the-managed-tier>), `OTEL_LOGS_EXPORTER` follows the [telemetry unit](</docs/en/server-managed-settings#per-key-exceptions-across-managed-sources>) while the other two selectors merge per key. Requires Claude Code v2.1.223 or later.
-
-Claude Code doesn’t remove per-signal variables that you set in managed settings itself, so you can route one signal to a different collector by setting its variable there, as the SIEM example does. If you set a per-signal credential there, Claude Code removes the developer-set endpoint for that signal. This removal behavior changes where telemetry is delivered, not what Claude Code collects. Before v2.1.217, every variable followed per-key settings precedence independently, so a signal-specific endpoint set in user settings or the shell redirected that signal away from the managed collector.
+ * **Beta tracing endpoints** : with detailed beta tracing active, Claude Code exports logs and traces to `BETA_TRACING_ENDPOINT` instead of through the logs and traces exporters. Claude Code therefore removes a developer-set `BETA_TRACING_ENDPOINT` whenever any of these managed settings decides either signal’s destination:
+ * A generic or logs/traces endpoint or credential
+ * An [`otelHeadersHelper`](</docs/en/settings-reference#otelheadershelper>)
+ * A logs or traces exporter selector set to `none`, `console`, or empty, values that keep the signal off a collector
+ * `CLAUDE_CODE_ENABLE_TELEMETRY` turned off
+A metrics-only endpoint or credential doesn’t remove it. Before v2.1.251, a developer-set `BETA_TRACING_ENDPOINT` redirected the logs and traces that detailed beta tracing exports even when managed settings pinned the collector.
+
+Claude Code doesn’t remove per-signal variables that you set in managed settings itself, so you can route one signal to a different collector by setting its variable there, as the SIEM example does. If you set a per-signal credential there, Claude Code removes the developer-set endpoint for that signal. This removal behavior changes where telemetry is delivered, not what Claude Code collects. Before v2.1.217, every variable followed per-key settings precedence independently, so a signal-specific endpoint set in user settings or the shell redirected that signal away from the managed collector. When the desktop app or a [self-hosted environment](</docs/en/self-hosted-environments>) runner launches Claude Code and names an OTLP endpoint in the environment it provides, Claude Code pins the destination the same way: the launcher’s telemetry variables remove developer-set variables exactly as managed settings do. Claude Code doesn’t remove variables that the launcher itself set. Requires Claude Code v2.1.251 or later.
##
@@ -260,7 +266,7 @@
`success`| `true` or `false`|
`error`| Error category string when execution failed, such as `Error:ENOENT` or `ShellError`. Contains the full error message instead when the gate is set| `OTEL_LOG_TOOL_DETAILS`
-**`claude_code.hook`** This span is emitted only when detailed beta tracing is active, which requires `ENABLE_BETA_TRACING_DETAILED=1` and `BETA_TRACING_ENDPOINT` in addition to the trace exporter configuration above. In interactive CLI sessions, this also requires your organization to be allowlisted for the feature. Agent SDK and non-interactive `-p` sessions are not gated. It is not emitted when only `CLAUDE_CODE_ENHANCED_TELEMETRY_BETA` is set.
+**`claude_code.hook`** This span appears only when detailed beta tracing is active, which requires `ENABLE_BETA_TRACING_DETAILED=1` and `BETA_TRACING_ENDPOINT`, a pair that also [changes where your logs and traces go](</docs/en/env-vars#variables>). Set the pair in your shell, user settings, or managed settings; both variables are ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). `CLAUDE_CODE_ENHANCED_TELEMETRY_BETA` alone doesn’t produce it. In interactive CLI sessions, detailed beta tracing also requires your organization to be allowlisted for the feature. Agent SDK and non-interactive `-p` sessions don’t require allowlisting.
Attribute| Description| Gated by
---|---|---
@@ -1401,7 +1407,9 @@
* `user_prompt` events include the verbatim `command_name` for custom, plugin, and MCP commands
* Trace spans include the same `tool_input` attribute and input-derived attributes such as `file_path`, with the same truncation as `tool_input`
* Tool input and output content is not logged in trace spans by default. To include it, set `OTEL_LOG_TOOL_CONTENT=1`. When enabled, span events include full tool input and output content truncated at the content limit (60 KB by default) per attribute. This can include raw file contents from Read tool results and Bash command output. Configure your telemetry backend to filter or redact these attributes as needed
- * Raw Anthropic Messages API request and response bodies are not logged by default. To include them, set `OTEL_LOG_RAW_API_BODIES`. With `=1`, each API call emits `api_request_body` and `api_response_body` log events whose `body` attribute is the JSON-serialized payload, truncated at the content limit (60 KB by default). With `=file:<dir>`, untruncated bodies are written to `.request.json` and `.response.json` files under that directory and the events carry a `body_ref` path instead of the inline body. Ship the directory with a log collector or sidecar rather than through the telemetry stream. In both modes, bodies contain the full conversation history, including the system prompt, every prior user and assistant turn, and tool results, so enabling this implies consent to everything the other `OTEL_LOG_*` content flags would reveal. Claude’s extended-thinking content is always redacted from these bodies regardless of other settings
+ * Raw Anthropic Messages API request and response bodies are not logged by default. To include them, set `OTEL_LOG_RAW_API_BODIES` in your shell, user settings, or managed settings. It’s ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). The bodies contain the full conversation history, including the system prompt, every prior user and assistant turn, and tool results, so enabling this implies consent to everything the other `OTEL_LOG_*` content flags would reveal. Claude Code always redacts Claude’s extended-thinking content from these bodies, regardless of other settings. The value you set determines how Claude Code delivers the bodies:
+ * With `=1`, Claude Code emits `api_request_body` and `api_response_body` log events for each API call. The events’ `body` attribute carries the JSON-serialized payload, truncated at the content limit (60 KB by default)
+ * With `=file:<dir>`, Claude Code writes untruncated bodies to `.request.json` and `.response.json` files under that directory, and the events carry a `body_ref` path instead of the inline body. Ship the directory with a log collector or sidecar rather than through the telemetry stream
##
--- a/observability.md
+++ b/observability.md
@@ -132,7 +132,7 @@
* **`claude_code.interaction`:** wraps a single turn of the agent loop, from receiving a prompt to producing a response.
* **`claude_code.llm_request`:** wraps each call to the Claude API, with model name, latency, and token counts as attributes.
* **`claude_code.tool`:** wraps each tool invocation, with child spans for the permission wait (`claude_code.tool.blocked_on_user`) and the execution itself (`claude_code.tool.execution`).
- * **`claude_code.hook`:** wraps each [hook](</docs/en/agent-sdk/hooks>) execution. Requires detailed beta tracing (`ENABLE_BETA_TRACING_DETAILED=1` and `BETA_TRACING_ENDPOINT`) in addition to the variables above.
+ * **`claude_code.hook`:** wraps each [hook](</docs/en/agent-sdk/hooks>) execution. Requires detailed beta tracing (`ENABLE_BETA_TRACING_DETAILED=1` and `BETA_TRACING_ENDPOINT`), a pair that also [changes where your logs and traces go](</docs/en/env-vars#variables>).
The `llm_request`, `tool`, and `hook` spans are children of the enclosing `claude_code.interaction` span. When the agent spawns a subagent through the Agent tool, the subagent’s `llm_request` and `tool` spans nest under the parent agent’s `claude_code.tool` span, so the full delegation chain appears as one trace. Spans carry a `session.id` attribute by default. When you make several `query()` calls against the same [session](</docs/en/agent-sdk/sessions>), filter on `session.id` in your backend to see them as one timeline. Claude Code omits the attribute if you set `OTEL_METRICS_INCLUDE_SESSION_ID` to a falsy value.
--- a/permission-modes.md
+++ b/permission-modes.md
@@ -70,13 +70,13 @@
---|---
Any settings file sets `disableAutoMode` to `"disable"`| `default`
[Feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) is off| `default`
-Your [first session after you install Claude Code or upgrade](</docs/en/env-vars#first-session-after-an-install-or-upgrade>) to a version that adds this default, unless a non-interactive session picks the flags up in time| `default`
+Your [first session after you install Claude Code or upgrade](</docs/en/env-vars#first-session-after-an-install-or-upgrade>) to a version that adds this default, unless, after a fresh install, Claude Code fetches the flags in time| `default`
`claude -p` or the [Agent SDK](</docs/en/agent-sdk/permissions>)| `default`
Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), or a signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) session| `default`
A Pro, Max, or Team plan, in a terminal or through the [VS Code extension](</docs/en/vs-code>)| `auto`
An Enterprise plan or a Claude Console API key| `default`
-When feature-flag fetching is off, or in a [first session after an install or upgrade](</docs/en/env-vars#first-session-after-an-install-or-upgrade>) where the flags haven’t arrived yet, the VS Code extension ignores every settings file when choosing the starting permission mode. When the flag, a settings file, or the built-in default selects `auto` but auto mode isn’t available to the session, Claude Code starts the session in Manual instead. Auto mode is unavailable when a settings file turns it off or the model doesn’t support it. The first time the built-in default starts one of your sessions in auto mode, Claude Code shows a notice that links to this page:
+When feature-flag fetching is off, or in a [first session after an install or upgrade](</docs/en/env-vars#first-session-after-an-install-or-upgrade>) where the flags haven’t arrived yet, the VS Code extension ignores every settings file when choosing the starting permission mode. When the flag, a settings file, or the built-in default selects `auto` but auto mode isn’t available to the session, Claude Code starts the session in Manual instead. Auto mode is unavailable when the session doesn’t meet the availability requirements, such as a settings file turning it off or a model that doesn’t support it, or when Anthropic has temporarily turned it off server-side. The first time the built-in default starts one of your sessions in auto mode, Claude Code shows a notice that links to this page:
* In a terminal, once, at the top of the session
* In the VS Code extension, as a card on the new-conversation screen that stays until you dismiss it
@@ -128,7 +128,7 @@
**During a session** : press `Shift+Tab` to cycle permission modes. From `auto`, the first press switches to `default`, and the cycle then runs `default` → `acceptEdits` → `plan` → back to `default`. Optional modes, described below, slot in after `plan`. The status bar shows the active mode as a gray `⏸ manual mode on` for `default`, or as `⏵⏵ accept edits on`, `⏸ plan mode on`, `⏵⏵ auto mode on`, `⏵⏵ don't ask on`, or `⏵⏵ bypass permissions on`.Not every mode is in the default cycle:
- * `auto`: appears when your account meets the auto mode requirements; cycling to it switches permission modes without a confirmation prompt
+ * `auto`: appears when auto mode is available; cycling to it switches permission modes without a confirmation prompt
* `bypassPermissions`: appears after you start with `--permission-mode bypassPermissions`, `--dangerously-skip-permissions`, `--allow-dangerously-skip-permissions`, or `permissions.defaultMode: "bypassPermissions"` in [settings](</docs/en/settings-reference#permission-settings>); the `--allow-` variant adds the permission mode to the cycle without activating it
* `dontAsk`: never appears in the cycle; set it with `--permission-mode dontAsk`
@@ -155,13 +155,13 @@
3. `permissions.defaultMode` from [managed settings](</docs/en/managed-settings>) or `~/.claude/settings.json`, on Pro, Max, and Team plans with feature-flag fetching available
4. The built-in default for your plan, provider, and organization settings
-The extension never reads a project’s `.claude/settings.json` or `.claude/settings.local.json` for the starting permission mode, and in conversations that don’t meet item 3’s conditions it reads no settings file at all. When `claudeCode.claudeProcessWrapper` is set, items 3 and 4 don’t apply either: those conversations start in Manual unless item 1 or item 2 sets a permission mode.Auto mode appears in the mode indicator when your account meets every requirement listed in the auto mode section.Bypass permissions requires the **Allow dangerously skip permissions** toggle in the extension settings. Without it, the permission mode doesn’t appear in the indicator, and a `bypassPermissions` value from item 1 or item 3 starts the conversation in Manual instead. Auto from any item likewise starts the conversation in Manual when auto mode isn’t available.See the [VS Code guide](</docs/en/vs-code>) for extension-specific details.
+The extension never reads a project’s `.claude/settings.json` or `.claude/settings.local.json` for the starting permission mode, and in conversations that don’t meet item 3’s conditions it reads no settings file at all. When `claudeCode.claudeProcessWrapper` is set, items 3 and 4 don’t apply either: those conversations start in Manual unless item 1 or item 2 sets a permission mode.Auto appears in the mode indicator when auto mode is available.Bypass permissions requires the **Allow dangerously skip permissions** toggle in the extension settings. Without it, the permission mode doesn’t appear in the indicator, and a `bypassPermissions` value from item 1 or item 3 starts the conversation in Manual instead. Auto from any item likewise starts the conversation in Manual when auto mode isn’t available.See the [VS Code guide](</docs/en/vs-code>) for extension-specific details.
The JetBrains plugin runs Claude Code in the IDE terminal, so switching permission modes works the same as in the CLI: press `Shift+Tab` to cycle, or pass `--permission-mode` when launching.
**During a session** : in the Code tab, use the mode selector next to the send button. Not every mode appears in the selector:
- * **Auto** : appears when your account meets the auto mode requirements
+ * **Auto** : appears when auto mode is available
* **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.For where `defaultMode` goes in a settings file, see the example under Start in a different permission mode.
@@ -239,7 +239,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`. `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, first check these requirements and whether any settings file sets [`disableAutoMode`](</docs/en/settings-reference#disableautomode>). Anthropic may also have turned auto mode off server-side, or the server may have rejected auto mode for your account. A session that received either answer keeps auto mode off until the session ends, so start a new session later. 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/plugins-reference.md
+++ b/plugins-reference.md
@@ -556,7 +556,7 @@
Monitor commands| Read the value from a config file in the script
MCP [`headersHelper`](</docs/en/mcp#use-dynamic-headers-for-custom-authentication>)| Read the value from a config file in the script
-Before v2.1.207, these fields substituted `${user_config.KEY}` values; update plugins that relied on this. Non-sensitive values are stored under the [`pluginConfigs`](</docs/en/settings-reference#pluginconfigs>) key in your user `settings.json` as `pluginConfigs[<plugin-id>].options`. Sensitive values go to the macOS Keychain, or to `~/.claude/.credentials.json` on platforms where no supported keychain is available. Keychain storage is shared with OAuth tokens and has an approximately 2 KB total limit, so keep sensitive values small. Claude Code reads all `pluginConfigs` values from only three settings sources:
+Before v2.1.207, these fields substituted `${user_config.KEY}` values; update plugins that relied on this. Non-sensitive values are stored under the [`pluginConfigs`](</docs/en/settings-reference#pluginconfigs>) key in your user `settings.json` as `pluginConfigs[<plugin-id>].options`. On macOS, Claude Code stores sensitive values in the macOS Keychain, falling back to `~/.claude/.credentials.json` when the Keychain rejects the write. On platforms without a supported keychain, it stores them in `~/.claude/.credentials.json`. Keychain storage is shared with OAuth tokens and has an approximately 2 KB total limit, so keep sensitive values small. Claude Code reads all `pluginConfigs` values from only three settings sources:
* **User settings** : `~/.claude/settings.json`, the file the enable-time prompt writes to
* **`--settings`** : the CLI flag or SDK inline settings
--- a/python.md
+++ b/python.md
@@ -1158,7 +1158,7 @@
`prompt`| Yes| The agent’s system prompt
`tools`| No| Array of allowed tool names. If omitted, inherits every [tool available to subagents](</docs/en/sub-agents#available-tools>)
`disallowedTools`| No| Array of tool names to remove from the agent’s tool set. MCP server-level patterns are also accepted: `mcp__server` or `mcp__server__*` removes every tool from that server, and `mcp__*` removes every MCP tool from any server
-`model`| No| Model override for this agent. Accepts an alias such as `"sonnet"`, `"opus"`, `"haiku"`, or `"inherit"`, or a full model ID. If omitted, uses the main model
+`model`| No| Model override for this agent. Accepts an alias such as `"sonnet"`, `"opus"`, `"haiku"`, or `"inherit"`, or a full model ID. When you omit it, Claude Code picks the model in the [subagent model order](</docs/en/sub-agents#choose-a-model>)
`skills`| No| List of skill names to preload into the agent’s context at startup. Unlisted skills remain invocable through the Skill tool
`memory`| No| Memory source for this agent: `"user"`, `"project"`, or `"local"`
`mcpServers`| No| MCP servers available to this agent. Each entry is a server name or an inline `{name: config}` dict
--- a/sandboxing.md
+++ b/sandboxing.md
@@ -36,7 +36,7 @@
Run a Bash command
-Ask Claude to run a command, such as a build or a test suite. By default, commands inside the sandbox can write only to the working directory, any [directories you’ve added](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) with `--add-dir` or `/add-dir`, and the session temp directory. The first time a command needs a new network 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.Commands that can’t run sandboxed fall back to the regular permission flow. Claude Code titles their permission prompt “Bash command (unsandboxed)” instead of “Bash command”, so you can tell which commands ran outside the sandbox. To widen or narrow what the sandbox allows, see Configure sandboxing.If sandboxed commands fail with `Operation not permitted` inside a container, see the Bubblewrap entry under Troubleshooting.
+Ask Claude to run a command, such as a build or a test suite. By default, commands inside the sandbox can write to the working directory, the session temp directory, and any [directories you’ve added](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) with `--add-dir`, `/add-dir`, or `permissions.additionalDirectories`. The first time a command needs a new network 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.Commands that can’t run sandboxed fall back to the regular permission flow. Claude Code titles their permission prompt “Bash command (unsandboxed)” instead of “Bash command”, so you can tell which commands ran outside the sandbox. To widen or narrow what the sandbox allows, see Configure sandboxing.If sandboxed commands fail with `Operation not permitted` inside a container, see the Bubblewrap entry under Troubleshooting.
When you select a mode in the panel, Claude Code saves it to your project’s local settings at `.claude/settings.local.json`, which apply to the current project. Claude Code adds that file to your global gitignore when it saves a setting there. To enable the sandbox across all of your projects, set [`sandbox.enabled`](</docs/en/settings-reference#sandbox-enabled>) to `true` in your user settings at `~/.claude/settings.json`. To enforce sandboxing for every developer in an organization, use managed settings.
@@ -140,7 +140,7 @@
Configure sandboxing
-Customize sandbox behavior through your `settings.json` file. See [Settings](</docs/en/settings-reference#sandbox-settings>) for the complete configuration reference. By default, sandboxed commands can write only to the current working directory, any [directories you’ve added](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) with `--add-dir` or `/add-dir`, and the session temp directory. If subprocess commands like `kubectl`, `terraform`, or `npm` need to write outside those directories, use `sandbox.filesystem.allowWrite` to grant access to specific paths:
+Customize sandbox behavior through your `settings.json` file. See [Settings](</docs/en/settings-reference#sandbox-settings>) for the complete configuration reference. By default, sandboxed commands can write to the current working directory, the session temp directory, and any [directories you’ve added](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) with `--add-dir`, `/add-dir`, or `permissions.additionalDirectories`. If subprocess commands like `kubectl`, `terraform`, or `npm` need to write outside those directories, use `sandbox.filesystem.allowWrite` to grant access to specific paths:
{
"sandbox": {
@@ -421,7 +421,7 @@
The sandboxed Bash tool restricts file system access to specific directories:
- * **Default write behavior** : read and write access to the current working directory and its subdirectories, any directories you’ve added with `--add-dir` or `/add-dir`, plus the session temp directory that `$TMPDIR` points to
+ * **Default write behavior** : read and write access to the current working directory and its subdirectories, any directories you’ve added with `--add-dir`, `/add-dir`, or [`permissions.additionalDirectories`](</docs/en/settings-reference#permissions-additionaldirectories>), plus the session temp directory that `$TMPDIR` points to
* **Default read behavior** : read access to the entire computer, except certain denied directories. Note that this default still allows reading credential files such as `~/.aws/credentials` and `~/.ssh/`. Use `sandbox.credentials` to block reads of these files and unset secret environment variables, or add the paths to `denyRead`.
* **Blocked access** : cannot modify files outside the working directory, added directories, and session temp directory without explicit permission, including shell configuration files such as `~/.bashrc` and system binaries in `/bin/`
* **Git worktrees** : when the working directory is a [linked git worktree](</docs/en/worktrees>), the sandbox also allows writes to the main repository’s shared `.git` directory so commands such as `git commit` can update refs and the index. Writes to `hooks/` and `config` inside that directory remain denied.
--- a/self-hosted-environments-testing.md
+++ b/self-hosted-environments-testing.md
@@ -202,7 +202,7 @@
Long-lived CI host
-Run `claude auth login` once interactively on the machine that executes the script, using a dedicated user account for automation. The token lives in the OS keychain on macOS, or in `~/.claude/.credentials.json` on Linux and Windows. The CLI refreshes the short-lived access token automatically on each invocation, but the underlying refresh-token grant is capped at 30 days from the initial login, so re-run `claude auth login` interactively on that host every 30 days.
+Run `claude auth login` once interactively on the machine that executes the script, using a dedicated user account for automation. Claude Code stores the token in the OS keychain on macOS, or in `~/.claude/.credentials.json` on Linux and Windows. On a macOS host whose Keychain can’t be written, as is typical in an SSH session where the login Keychain stays locked, Claude Code stores the token in `~/.claude/.credentials.json` there too. See [Credential management](</docs/en/authentication#credential-management>). The CLI refreshes the short-lived access token automatically on each invocation, but the underlying refresh-token grant is capped at 30 days from the initial login, so re-run `claude auth login` interactively on that host every 30 days.
###
@@ -228,7 +228,7 @@
`$ADMIN_TOKEN` is a claude.ai OAuth access token for an account that holds an Owner role, minted the same way as Authenticate from CI:
- * **Mint it** : run `claude auth login` with an account that holds an Owner role, then read the current access token from the OS keychain on macOS or `~/.claude/.credentials.json` on Linux and Windows.
+ * **Mint it** : run `claude auth login` with an account that holds an Owner role, then read the current access token from wherever Long-lived CI host says Claude Code stored it.
* **Read it fresh each run** : the CLI rotates the access token, and the same 30-day refresh-grant cap applies, so don’t store a copy.
* **Pass it via stdin** : as the example does, so the token never lands in curl’s argument list or your build log.
--- a/settings.md
+++ b/settings.md
@@ -154,10 +154,10 @@
To try a value without saving it, set it when you start Claude Code. The value applies to that session and your settings files stay as they were. You have three ways to do it:
* **`--settings`** : pass a key as JSON, inline or as a path to a file. Claude Code applies it above your user, project, and local files and below managed settings. It can set any key your user settings file can set; it can’t set `Managed` or `Global config` keys.
- * **A flag for that key** : some keys have their own flag, such as `--model` for `model` and `--effort` for `effortLevel`.
+ * **A flag for that key** : some keys have their own flag, such as `--model` for `model` and `--effort` for `effortLevel` and `modelSettings`.
* **An environment variable** : export the key’s paired variable before you run `claude`, such as `ANTHROPIC_MODEL` for `model`.
-Each key’s entry on the [settings reference](</docs/en/settings-reference>) lists its per-session overrides and which one takes precedence, so check the entry for the key you want to change. Commands you run inside a session mostly save your choice: `/config` writes to your settings files, and `/model` and `/effort` save the value as your default for new sessions. Pressing `s` in the `/model` picker switches the model without saving it, and some `/effort` levels, such as `max` and `ultracode`, apply to the current session only; see [Adjust effort level](</docs/en/model-config#adjust-effort-level>). For example, to start one session on Opus without changing your default:
+Each key’s entry on the [settings reference](</docs/en/settings-reference>) lists its per-session overrides and which one takes precedence, so check the entry for the key you want to change. Commands you run inside a session mostly save your choice: `/config` writes to your settings files, `/model` saves the value as your default for new sessions, and `/effort` on your machine saves the level as your default for the model you’re using. If you press `s` in the `/model` picker, Claude Code switches the model without saving it as your user default. Claude Code applies some `/effort` levels, such as `max` and `ultracode`, to the current session only; see [Adjust effort level](</docs/en/model-config#adjust-effort-level>). For example, to start one session on Opus without changing your default:
claude --settings '{"model": "claude-opus-4-8"}'
@@ -170,7 +170,7 @@
Claude Code watches your settings files and reloads them when they change, so it applies most edits to the running session without a restart, including edits to `permissions`, `hooks`, and credential helpers such as `apiKeyHelper`. The reload covers user, project, local, and managed settings, and Claude Code runs the [`ConfigChange` hook](</docs/en/hooks#configchange>) for each settings-file change it detects, not for managed settings that arrive from MDM or the claude.ai console. Managed settings that arrive through MDM or from the claude.ai console reach a running session on a schedule rather than on save; the [delivery table](</docs/en/managed-settings#choose-a-delivery-mechanism>) gives it per source. Claude Code reads some keys only once, at session start, so an edit to one of them doesn’t reach the running session. Admin-side keys that also wait for a restart, such as `requiredMinimumVersion`, are listed under [where and when a policy applies](</docs/en/managed-settings#where-and-when-a-policy-applies>). The ones you’re most likely to edit mid-session:
* [`model`](</docs/en/settings-reference#model>): use [`/model`](</docs/en/model-config#setting-your-model>) to switch mid-session. Each model has its own prompt cache, so the first request after a switch re-reads the whole conversation uncached; see [Switching models](</docs/en/prompt-caching#switching-models>)
- * [`effortLevel`](</docs/en/settings-reference#effortlevel>): use [`/effort`](</docs/en/model-config#adjust-effort-level>) to change it mid-session
+ * [`effortLevel`](</docs/en/settings-reference#effortlevel>) and [`modelSettings`](</docs/en/settings-reference#modelsettings>): use [`/effort`](</docs/en/model-config#adjust-effort-level>) to change effort mid-session
* [`outputStyle`](</docs/en/settings-reference#outputstyle>): part of the system prompt, so Claude Code applies the edit after `/clear` or a restart
###
@@ -218,11 +218,12 @@
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. Three keys that hold model lists 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. Four keys that hold model lists or per-model entries 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 managed settings Claude Code applies define 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 managed sources the list never merges either; [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s list applies. Across non-managed scopes Claude Code merges the arrays as usual.
+ * [`modelSettings`](</docs/en/settings-reference#modelsettings>): Claude Code resolves it one model at a time, together with [`effortLevel`](</docs/en/settings-reference#effortlevel>). The `modelSettings` entry states which file’s value applies to a model.
###
--- a/settings-example.md
+++ b/settings-example.md
@@ -51,7 +51,7 @@
{
// Start every session on Sonnet 5
"model": "claude-sonnet-5",
- // Reason more deeply than the default high level; /effort saves a new level, and --effort overrides it for one session
+ // Reason more deeply than the default high level on models without a saved level; /effort saves a level per model, and --effort sets one for a single session
"effortLevel": "xhigh",
// Vim keybindings in the prompt
"editorMode": "vim",
Show diff (310 lines)
--- a/settings-reference.md
+++ b/settings-reference.md
@@ -73,7 +73,7 @@
`disableSkillShellExecution`| Stop [skills](</docs/en/skills>) and custom commands from running inline shell| Plugins and skills| Any file
`disableWorkflows`| Turn [dynamic workflows](</docs/en/workflows>) off for everyone; use `enableWorkflows` for yourself| Hooks and automation| Any file
`editorMode`| Use [vim key bindings](</docs/en/interactive-mode#vim-editor-mode>) in the input prompt| Interface and terminal| Any file
-`effortLevel`| Save the [`/effort` level](</docs/en/model-config#adjust-effort-level>) so future sessions reason more or less deeply| Model and responses| Any file
+`effortLevel`| Set a default [effort level](</docs/en/model-config#adjust-effort-level>) for models without a saved level of their own| Model and responses| Any file
`emojiCompletionEnabled`| Turn off [`:shortcode:` emoji suggestions and replacement](</docs/en/interactive-mode#emoji-shortcodes>) in the prompt input| Interface and terminal| Any file
`enableAllProjectMcpServers`| Approve every server in project [`.mcp.json`](</docs/en/mcp#project-server-approvals-and-workspace-trust>) files without a prompt| MCP| Any file
`enableArtifact`| Turn the [Artifact tool](</docs/en/artifacts>) off with a `false` in any file; no file can turn it back on| Remote, desktop, and notifications| Any file
@@ -111,6 +111,7 @@
`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
`modelPricing`| Report spend at your organization’s contracted rates instead of list price| Model and responses| Managed
+`modelSettings`| Keep a saved [effort level](</docs/en/model-config#adjust-effort-level>) per model, which Claude Code writes when you run `/effort`| Model and responses| Any file
`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
@@ -207,7 +208,7 @@
`switchModelsOnFlag`| Switch models automatically or pause when a [safety classifier](</docs/en/model-config#ask-before-switching>) flags a request| Model and responses| Any file
`syncClaudeAiSkills`| Stop downloading the [skills enabled on your claude.ai account](</docs/en/skills#how-synced-skills-behave>) and hide the ones already synced| Plugins and skills| User, local, or managed
`syntaxHighlightingDisabled`| Turn off syntax highlighting in diffs and code blocks| Interface and terminal| Any file
-`teammateDefaultModel`| Removed in v2.1.234; [teammates](</docs/en/agent-teams#specify-teammates-and-models>) follow the lead’s model| Global config settings| Global config
+`teammateDefaultModel`| Removed in v2.1.234; see [Specify teammates and models](</docs/en/agent-teams#specify-teammates-and-models>) for how Claude Code picks a teammate’s model| Global config settings| Global config
`teammateMode`| Choose how [agent team teammates display](</docs/en/agent-teams#choose-a-display-mode>)| Agents, sessions, and worktrees| Any file
`terminalProgressBarEnabled`| Hide the terminal progress bar in terminals that support it| Interface and terminal| Any file
`terminalTitleFromRename`| Stop [`/rename`](</docs/en/sessions#name-your-sessions>) and `--name` from changing the terminal tab title| Interface and terminal| Any file
@@ -308,7 +309,7 @@
`effortLevel`
-Keep an [effort level](</docs/en/model-config#adjust-effort-level>) across sessions. Lower levels are faster and cheaper on straightforward tasks, and higher levels reason more deeply on complex problems. Claude Code writes this key to your user settings when you run `/effort low`, `medium`, `high`, or `xhigh` in an interactive session on your machine. In a `-p` run, the Agent SDK, or a session attached to a remote worker, `/effort` applies to that session only. The message `/effort` prints says which happened.
+Set a default [effort level](</docs/en/model-config#adjust-effort-level>) for models you haven’t saved a level for. Lower levels are faster and cheaper on straightforward tasks, and higher levels reason more deeply on complex problems. When you run `/effort low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, Claude Code saves the level for the active model under `modelSettings` rather than writing this key. Within the same settings file, Claude Code uses a model’s saved level rather than this key; `modelSettings` states the cross-file precedence. In a `-p` run, the Agent SDK, or a session attached to a remote worker, `/effort` applies to that session only. The message that `/effort` prints says which happened. Before v2.1.251, `/effort` wrote this key.
* **Scope** : `Any file`
* **Type** : string, one of:
@@ -325,7 +326,7 @@
"effortLevel": "xhigh"
}
-On Opus 4.7, Opus 4.8, and Fable 5, Claude Code holds that model’s default effort until you change effort once with `/effort`, `--effort`, or the `/model` picker. After that, it reads this key. See [Adjust effort level](</docs/en/model-config#adjust-effort-level>).
+On Opus 4.7, Opus 4.8, and Fable 5, Claude Code holds that model’s default effort, organization-set or built-in, until you change effort once, for example with an interactive `/effort`, the `/model` picker’s effort slider, or `--effort` at launch. After that, Claude Code resolves effort by the precedence stated at `modelSettings`. See [Adjust effort level](</docs/en/model-config#adjust-effort-level>).
###
@@ -592,6 +593,32 @@
+`modelSettings`
+
+Requires Claude Code v2.1.251 or later. Save an [effort level](</docs/en/model-config#adjust-effort-level>) for each model you use. In an interactive session on your machine, when you run `/effort low`, `medium`, `high`, or `xhigh` or move the `/model` picker’s effort slider, Claude Code saves that level here under the model you’re using, so you rarely edit this key yourself. The `effortLevel` entry lists the sessions in which `/effort` applies to that session only. Edit the key by hand to change or remove a level you saved. A model’s entry here takes precedence over `effortLevel` in the same settings file. Across files, Claude Code resolves each model separately: the highest-precedence [settings file](</docs/en/settings#settings-precedence>) that sets either that model’s entry or `effortLevel` decides, so an `effortLevel` in managed settings outranks a level you saved in user settings. [Adjust effort level](</docs/en/model-config#adjust-effort-level>) lists what else can override a saved level, such as `--effort` at launch.
+
+ * **Scope** : `Any file`
+ * **Type** : object mapping a model name to an object with an `effortLevel` field, one of `"low"`, `"medium"`, `"high"`, or `"xhigh"`
+ * **Default** : unset
+
+Claude Code writes each entry under the model’s canonical name, such as `claude-opus-5`, and matches that model’s alias, date-suffixed, `[1m]`, and recognized provider-specific IDs to the same entry. This example keeps Opus 5 at `medium` while other models use their own saved or default levels:
+
+settings.json
+
+ {
+ "modelSettings": {
+ "claude-opus-5": {
+ "effortLevel": "medium"
+ }
+ }
+ }
+
+Run `/effort auto` to clear your saved level for the model you’re using. Claude Code leaves the other entries and any top-level `effortLevel` in place.
+
+###
+
+
+
`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.
@@ -724,7 +751,7 @@
"ultracode": true
}
-Ultracode runs the session at `xhigh` effort and takes precedence over `effortLevel`. An Agent SDK `apply_flag_settings` control request also accepts the key.
+Ultracode runs the session at `xhigh` effort and takes precedence over `effortLevel` and `modelSettings` entries. An Agent SDK `apply_flag_settings` control request also accepts the key.
##
@@ -1117,7 +1144,7 @@
}
}
-Claude Code takes a Boolean key’s value from the highest-precedence settings file that sets it, so a managed `enabled` or `failIfUnavailable` overrides anything a developer sets. It merges array keys across every settings file the session loads, so a developer can append entries; see [Keep developers from widening the policy](</docs/en/sandboxing#keep-developers-from-widening-the-policy>) for the managed-only locks. To require the sandbox for an organization, see [Enforce sandboxing with managed settings](</docs/en/sandboxing#enforce-sandboxing-with-managed-settings>).
+Claude Code takes a Boolean key’s value from the highest-precedence settings scope that sets it, so a managed `enabled` or `failIfUnavailable` overrides anything a developer sets. It merges array keys across every settings scope the session loads, so a developer can append entries; see [Keep developers from widening the policy](</docs/en/sandboxing#keep-developers-from-widening-the-policy>) for the managed-only locks. To require the sandbox for an organization, see [Enforce sandboxing with managed settings](</docs/en/sandboxing#enforce-sandboxing-with-managed-settings>).
###
@@ -1217,7 +1244,7 @@
}
}
-Excluded commands still go through the regular permission flow. Exclusion is a convenience, not a security boundary: prefer `filesystem.allowWrite` when a tool only needs to write somewhere specific. Claude Code merges entries across every settings file the session loads, and there is no managed-only lock for this list, so keep a managed list narrow.
+Excluded commands still go through the regular permission flow. Exclusion is a convenience, not a security boundary: prefer `filesystem.allowWrite` when a tool only needs to write somewhere specific. Claude Code merges entries across every settings scope the session loads, and there is no managed-only lock for this list, so keep a managed list narrow.
###
@@ -1252,7 +1279,7 @@
`sandbox.filesystem`
-Control which paths sandboxed commands can read and write. By default they can write to the working directory, any directories you add with `--add-dir`, and the session temp directory, and can read the rest of the filesystem, including credential files. Widen or narrow that with the four path lists, or switch the filesystem layer off with `disabled`. See [Filesystem isolation](</docs/en/sandboxing#filesystem-isolation>) for the default boundaries.
+Control which paths sandboxed commands can read and write. By default they can write to the working directory, the session temp directory, and directories you add with `--add-dir`, `/add-dir`, or `permissions.additionalDirectories`, and can read the rest of the filesystem, including credential files. Widen or narrow that with the four path lists, or switch the filesystem layer off with `disabled`. See [Filesystem isolation](</docs/en/sandboxing#filesystem-isolation>) for the default boundaries.
* **Scope** : `Any file`
* **Type** : object with `allowWrite`, `denyWrite`, `denyRead`, and `allowRead` arrays, plus the `allowManagedReadPathsOnly` and `disabled` Booleans
@@ -1298,11 +1325,11 @@
`sandbox.filesystem.allowWrite`
-Add paths where sandboxed commands can write, beyond the working directory, the directories you’ve added with `--add-dir` or `/add-dir`, and the session temp directory. Use it when a subprocess such as `kubectl` or a build tool needs to write outside the project.
+Add paths where sandboxed commands can write, beyond the working directory, the session temp directory, and the directories you’ve added with `--add-dir`, `/add-dir`, or `permissions.additionalDirectories`. Use it when a subprocess such as `kubectl` or a build tool needs to write outside the project.
* **Scope** : `Any file`
* **Type** : array of path strings, using the sandbox path prefixes
- * **Default** : unset, so sandboxed commands can write only to the working directory, any directories you’ve added with `--add-dir` or `/add-dir`, and the session temp directory
+ * **Default** : unset, so sandboxed commands can write to the working directory, the session temp directory, directories you’ve added with `--add-dir` or `/add-dir`, and directories in `permissions.additionalDirectories`
This lets a build write under `/tmp/build` and lets `kubectl` update your kubeconfig:
@@ -1316,7 +1343,7 @@
}
}
-Claude Code merges entries across every settings file the session loads: user, project, local, and managed paths combine rather than replace each other, and Claude Code adds the paths from your `Edit(...)` allow permission rules. An `allowWrite` entry can’t lift a [protected path](</docs/en/sandboxing#protected-paths>).
+Claude Code merges entries across every settings scope the session loads: user, project, local, and managed paths combine rather than replace each other, and Claude Code adds the paths from your `Edit(...)` allow permission rules. An `allowWrite` entry can’t lift a [protected path](</docs/en/sandboxing#protected-paths>).
###
@@ -1342,7 +1369,7 @@
}
}
-Claude Code merges entries across every settings file the session loads, and adds the paths from your `Edit(...)` deny permission rules.
+Claude Code merges entries across every settings scope the session loads, and adds the paths from your `Edit(...)` deny permission rules.
###
@@ -1366,7 +1393,7 @@
}
}
-Claude Code merges entries across every settings file the session loads, and adds the paths from your `Read(...)` deny permission rules. When `filesystem.disabled` is `true`, Claude Code doesn’t enforce these entries.
+Claude Code merges entries across every settings scope the session loads, and adds the paths from your `Read(...)` deny permission rules. When `filesystem.disabled` is `true`, Claude Code doesn’t enforce these entries.
###
@@ -1401,12 +1428,12 @@
`sandbox.filesystem.allowManagedReadPathsOnly`
-Honor only the `allowRead` entries that come from managed settings, so developers can’t re-open read access to paths your organization blocked. Claude Code still merges `denyRead` entries from every settings file the session loads.
+Honor only the `allowRead` entries that come from managed settings, so developers can’t re-open read access to paths your organization blocked. Claude Code still merges `denyRead` entries from every settings scope the session loads.
* **Scope** : `Managed`
* **Type** : Boolean
* `true`: Claude Code honors only the `allowRead` entries from managed settings
- * `false`: `allowRead` entries merge from every settings file the session loads
+ * `false`: `allowRead` entries merge from every settings scope the session loads
* **Default** : `false`
This blocks reads of the home directory, re-opens `~/work`, and stops developers from re-opening anything else:
@@ -2368,7 +2395,7 @@
* From user settings, `--settings`, and managed settings: at startup, and again in the running session when a saved change alters the merged `env`.
* From project and local settings: after you trust the workspace, or at startup in `-p` mode, which never shows the trust dialog, and again when a saved change alters the merged `env`.
- * Variables Claude Code classifies as safe, such as model selection, timeouts and limits, feature toggles, and telemetry settings: at startup from every settings file.
+ * Variables Claude Code classifies as safe, such as model selection, timeouts and limits, feature toggles, and telemetry settings: at startup from every settings file, apart from the variables project and local settings can’t set.
* After you [move the session with `/cd`](</docs/en/permissions#move-the-session-to-another-directory>) on v2.1.246 or later: the new directory’s project and local `env` values, on top of the previous directory’s.
####
@@ -2377,7 +2404,11 @@
Variables Claude Code ignores in `env`
- * Project and local settings can’t set a few variables, such as `CLAUDE_CODE_PROCESS_WRAPPER`, `CLAUDE_CODE_SYNC_SKILLS`, `CLAUDE_CODE_SYNC_PLUGINS`, `CLAUDE_CODE_PLUGIN_CACHE_DIR`, and `CLAUDE_CODE_PLUGIN_SEED_DIR`; set those in user or managed settings.
+ * Project and local settings can’t set variables that a checked-out repository shouldn’t control; set those in your shell, user settings, or managed settings instead. Claude Code drops each one and logs a warning you can see with `claude --debug`. They include:
+ * Variables that choose where Claude Code stores or writes its own files: `CLAUDE_CONFIG_DIR`, `CLAUDE_CODE_TMPDIR`, and the operating-system directory variables such as `HOME`, `TMPDIR`, `TMP`, `TEMP`, and the `XDG_*` family.
+ * Variables that export session content: [`OTEL_LOG_RAW_API_BODIES`](</docs/en/env-vars#variables>) and the detailed beta tracing pair `ENABLE_BETA_TRACING_DETAILED` and `BETA_TRACING_ENDPOINT`.
+ * Variables that change how Claude Code starts or syncs, such as `CLAUDE_CODE_PROCESS_WRAPPER`, `CLAUDE_CODE_SYNC_SKILLS`, `CLAUDE_CODE_SYNC_PLUGINS`, `CLAUDE_CODE_PLUGIN_CACHE_DIR`, and `CLAUDE_CODE_PLUGIN_SEED_DIR`.
+Before v2.1.251, project and local settings could set every variable this list names except `HOME`, `XDG_CONFIG_HOME`, and the variables that change how Claude Code starts or syncs.
* Identity variables that Claude Code’s hosting environments own, such as `CLAUDE_CODE_REMOTE` and `CLAUDE_CODE_ACCOUNT_UUID`, are ignored from every file.
* [`CLAUDE_CODE_MESSAGING_SOCKET` and `CLAUDE_CODE_MESSAGING_TOKEN`](</docs/en/env-vars#variables>), which Claude Code exports itself, are ignored from every file. Ignoring the socket variable requires Claude Code v2.1.224 or later, and ignoring the token requires v2.1.228 or later.
* [`CLAUDE_CODE_PROJECT_DIR_NAME`](</docs/en/sessions#name-the-project-directory-yourself>), which Claude Code reads from the launch environment only, is ignored from every file; requires v2.1.234 or later.
@@ -3534,8 +3565,8 @@
* **Scope** : `Managed`
* **Type** : Boolean
* `true`: only managed hooks run, plus Agent SDK hooks and hooks from plugins your managed settings force-enable. See What runs under `allowManagedHooksOnly`
- * `false`: hooks from every settings file and plugin run
- * **Default** : unset, so hooks from every settings file and plugin run
+ * `false`: hooks from every settings scope and plugin run
+ * **Default** : unset, so hooks from every settings scope and plugin run
managed-settings.json
@@ -4366,7 +4397,7 @@
`pluginConfigs`
-Store the non-sensitive answers you give a plugin’s [`userConfig`](</docs/en/plugins-reference#user-configuration>) configuration dialog, keyed by plugin ID. Claude Code writes this key to your user settings when you fill in the dialog, so you don’t need to edit it by hand. Sensitive options go to the macOS Keychain instead, or to `~/.claude/.credentials.json` on platforms without a supported keychain.
+Store the non-sensitive answers you give a plugin’s [`userConfig`](</docs/en/plugins-reference#user-configuration>) configuration dialog, keyed by plugin ID. Claude Code writes this key to your user settings when you fill in the dialog, so you don’t need to edit it by hand. Claude Code stores sensitive options in the macOS Keychain instead, falling back to `~/.claude/.credentials.json` when the Keychain rejects the write; on platforms without a supported keychain, it stores them in `~/.claude/.credentials.json`.
* **Scope** : `User or managed`
* **Type** : object mapping a plugin ID to an object with an `options` field, mapping each option name to a string, number, Boolean, or array of strings, and an optional `mcpServers` field holding per-server user configuration values in the same shape
@@ -4448,13 +4479,13 @@
`allowManagedMcpServersOnly`
-Make the managed allowlist the only one that applies. Claude Code then reads `allowedMcpServers` from managed settings alone and ignores allowlists in user, project, and local settings; `deniedMcpServers` still merges from every file, so users can still block servers for themselves. Administrators set it so a user’s own settings can’t broaden what the managed allowlist permits.
+Make the managed allowlist the only one that applies. Claude Code then reads `allowedMcpServers` from managed settings alone and ignores allowlists in user, project, and local settings; `deniedMcpServers` still merges from every settings scope, so users can still block servers for themselves. Administrators set it so a user’s own settings can’t broaden what the managed allowlist permits.
* **Scope** : `Managed`
* **Type** : Boolean
* `true`: Claude Code reads `allowedMcpServers` from managed settings alone and ignores allowlists in user, project, and local settings
- * `false`: allowlists from every settings file merge
- * **Default** : `false`, so allowlists from every settings file merge
+ * `false`: allowlists from every settings scope merge
+ * **Default** : `false`, so allowlists from every settings scope merge
This example locks the allowlist to managed settings and allows only the server named `github`:
@@ -5165,7 +5196,13 @@
"apiKeyHelper": "/bin/generate_temp_api_key.sh"
}
-Claude Code caches the value and reruns the command after the interval you set with [`CLAUDE_CODE_API_KEY_HELPER_TTL_MS`](</docs/en/env-vars>). In interactive sessions, when the command comes from project or local settings, Claude Code doesn’t run it until you accept the workspace trust prompt. See [Credential management](</docs/en/authentication#credential-management>).
+Claude Code caches the value and reruns the command in these cases:
+
+ * After the cache lifetime, five minutes by default or the interval you set with [`CLAUDE_CODE_API_KEY_HELPER_TTL_MS`](</docs/en/env-vars>).
+ * When a request to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>), fails with `401` or `403`.
+ * Before sending a request to the Anthropic API, directly or through an LLM gateway, when the cached output is a JWT that expired after the helper produced it. Requires Claude Code v2.1.246 or later.
+
+The last two cases apply only when the helper’s output is the credential Claude Code sends and `ANTHROPIC_AUTH_TOKEN` isn’t set. In interactive sessions, when the command comes from project or local settings, Claude Code doesn’t run it until you accept the workspace trust prompt. See [Credential management](</docs/en/authentication#credential-management>).
###
@@ -5213,7 +5250,7 @@
`forceLoginMethod`
-Restrict which kind of account people can log in with. Set `"claudeai"` to allow only claude.ai accounts, `"console"` to allow only Claude Console accounts, or `"gateway"` to send people to a [cloud gateway](</docs/en/claude-apps-gateway>) instead of a first-party login. Administrators set it in managed settings and pair it with `forceLoginOrgUUID` to keep developers’ claude.ai logins inside one organization.
+Restrict which kind of account people can log in with. Set `"claudeai"` to allow only claude.ai accounts, `"console"` to allow only Claude Console accounts, or `"gateway"` to send people to a [cloud gateway](</docs/en/claude-apps-gateway>) instead of a first-party login. Administrators set it in managed settings and pair it with `forceLoginOrgUUID` to keep developers’ claude.ai logins inside one organization. If you set it to `"claudeai"` or `"console"` in any settings file, Claude Code also stops offering the [keyless Console sign-in](</docs/en/authentication#sign-in-without-an-api-key>) in the sessions that file applies to.
* **Scope** : `Any file`. Claude Code honors `"gateway"` only from a managed source on the machine: `managed-settings.json`, the macOS plist or Windows HKLM registry, or a policy helper. It treats `"gateway"` as unset in user, project, local, HKCU, and server-managed settings, the same rule as `forceLoginGatewayUrl`.
* **Type** : string, one of:
@@ -5256,7 +5293,7 @@
`forceLoginOrgUUID`
-From a managed source, require claude.ai account logins to belong to one Anthropic organization, a single UUID, or to any of several, an array. From any settings file, a single UUID also pre-selects that organization during a claude.ai or Claude Console login; an array pre-selects nothing.
+From a managed source, require claude.ai account logins to belong to one Anthropic organization, given as a single UUID, or to any of several organizations, given as an array. From any settings file, Claude Code also uses a single UUID to pre-select that organization during a claude.ai or Claude Console login, and pre-selects nothing for an array. If you set the key in any settings file, Claude Code also stops offering the [keyless Console sign-in](</docs/en/authentication#sign-in-without-an-api-key>) in the sessions that file applies to and creates an API key instead.
* **Scope** : `Any file`. Only a managed source enforces the restriction; a single UUID in any other settings file pre-selects the organization during login without restricting it.
* **Type** : string, one UUID, or array of strings, several UUIDs
@@ -5732,7 +5769,7 @@
Write the helper output
-Claude Code runs the helper with no arguments, sets `CLAUDE_CODE_VERSION` in its environment, and reads a JSON envelope from stdout, capped at 1 MB. Put the settings under a `managedSettings` key. A bare settings object with no `managedSettings` key parses with `managedSettings` undefined and applies nothing, and Claude Code reports no error:
+Claude Code runs the helper with no arguments, sets `CLAUDE_CODE_VERSION` in its environment, and reads a JSON envelope from stdout, capped at 1 MiB. Put the settings under a `managedSettings` key. A bare settings object with no `managedSettings` key parses with `managedSettings` undefined and applies nothing, and Claude Code reports no error:
{
"managedSettings": {
@@ -5740,7 +5777,23 @@
}
}
-When the helper emits `managedSettings`, that object becomes the only managed settings source for the run: Claude Code ignores the MDM, file, and HKCU sources, reads the [cross-source keys](</docs/en/managed-settings#keys-read-from-every-admin-source>) from the helper’s output alone, and never merges [parent settings](</docs/en/managed-settings#parent-settings-from-embedding-hosts>). The startup `forceRemoteSettingsRefresh` check runs before the helper and reads any admin source. A helper that exits 0 without emitting `managedSettings` contributes no managed settings, and the other sources apply as usual. When the helper exits non-zero at startup, Claude Code prints the error and refuses to start, so a helper that needs outage resilience should serve from its own cache and exit `0`.
+When the helper emits `managedSettings`, that object becomes the only managed settings source for the run: Claude Code ignores the MDM, file, and HKCU sources, reads the [cross-source keys](</docs/en/managed-settings#keys-read-from-every-admin-source>) from the helper’s output alone, and never merges [parent settings](</docs/en/managed-settings#parent-settings-from-embedding-hosts>). The startup `forceRemoteSettingsRefresh` check runs before the helper and reads any admin source. A helper that exits 0 with an envelope that omits `managedSettings` contributes no managed settings, and the other sources apply as usual.
+
+####
+
+
+
+Helper failures
+
+A helper run fails when:
+
+ * `path` breaks the rules in `policyHelper.path`.
+ * No regular file is at `path`. Claude Code checks for the file before starting the helper, within the same `timeoutMs` budget, so an unresponsive network mount can cause the run to fail.
+ * The helper exits non-zero, is still running when `timeoutMs` elapses, or doesn’t start at all, for example because it isn’t executable.
+ * The helper writes more than 1 MiB to stdout or to stderr.
+ * stdout isn’t a single JSON object, or its `managedSettings` has a [schema violation Claude Code can’t repair](</docs/en/managed-settings#find-entries-claude-code-dropped>).
+
+When the startup run fails, Claude Code prints the reason and refuses to start. After a non-zero exit or a timeout, the message includes the helper’s stderr. The refusal covers interactive sessions, `claude -p`, Agent SDK sessions, [background sessions](</docs/en/agent-view>), and most subcommands. The refusal is deliberate, so a helper that needs outage resilience should serve from its own cache and exit `0`. When a background refresh fails, Claude Code keeps the last successful policy in effect. Claude Code runs each refresh under the same `timeoutMs` and failure rules as the startup run. With `--debug`, Claude Code writes the helper’s stderr from every run to the [debug log](</docs/en/debug-your-config>). Claude Code reports an invalid `policyHelper` value as a [dropped entry](</docs/en/managed-settings#find-entries-claude-code-dropped>) and starts the session on the remaining managed settings without running a helper. Invalid values include a bare path string and a `timeoutMs` below its minimum. To turn a helper off, remove the key from the source that sets it.
###
@@ -5748,10 +5801,10 @@
`policyHelper.path`
-Name the helper executable Claude Code runs. Claude Code refuses to start when the path isn’t absolute, or on Windows when it doesn’t end in `.exe`.
+Name the helper executable Claude Code runs. For what happens when the path breaks the rules below, see Helper failures.
* **Scope** : `Managed`. Read from the macOS plist, the Windows HKLM registry, or the managed settings file, wherever `policyHelper` is read.
- * **Type** : string, an absolute path in normalized form, without `.` or `..` segments
+ * **Type** : string, an absolute path in normalized form, without `.` or `..` segments; on Windows, a drive-letter or UNC path that ends in `.exe`
* **Default** : none; required when `policyHelper` is set
managed-settings.json
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -46,7 +46,7 @@
A capable agent for complex, multi-step tasks that require both exploration and action.
- * **Model** : inherits from the main conversation
+ * **Model** : the `CLAUDE_CODE_SUBAGENT_MODEL` model if you set one and nothing assigns a model another way, otherwise the main conversation’s model; Choose a model states the full order
* **Tools** : every tool available to subagents
* **Purpose** : complex research, multi-step operations, code modifications
@@ -56,7 +56,7 @@
Agent| Model| When Claude uses it
---|---|---
-claude| Inherits| When a task doesn’t fit a more specialized agent. A catch-all with every tool available to subagents. Also the default agent for a dispatched [background session](</docs/en/agent-view>); [which permission mode it starts in](</docs/en/agent-view#permission-mode-model-and-effort>) depends on how the session was started
+claude| None of its own; follows the model order when Claude spawns it as a subagent| When a task doesn’t fit a more specialized agent. A catch-all with every tool available to subagents. Also the default agent for a dispatched [background session](</docs/en/agent-view>); [which permission mode it starts in](</docs/en/agent-view#permission-mode-model-and-effort>) depends on how the session was started
statusline-setup| Sonnet| When you run `/statusline` to configure your status line
claude-code-guide| Haiku| When you ask questions about Claude Code features
@@ -233,7 +233,7 @@
`description`| Yes| When Claude should delegate to this subagent
`tools`| No| Tools the subagent can use. Inherits every tool available to subagents if omitted. If no entry in the list resolves to a tool, the subagent usually [fails to launch](</docs/en/errors#agent-would-be-spawned-with-zero-tools>) with an error naming the entries. To preload Skills into context, use the `skills` field rather than listing `Skill` here
`disallowedTools`| No| Tools to deny, removed from inherited or specified list
-`model`| No| Model to use: `sonnet`, `opus`, `haiku`, `fable`, a full model ID (for example, `claude-opus-5`), or `inherit`. Defaults to `inherit`
+`model`| No| Model to use: `sonnet`, `opus`, `haiku`, `fable`, a full model ID such as `claude-opus-5`, or `inherit`. When you omit it, Claude Code picks the model in the subagent model order
`permissionMode`| No| Permission mode: `default`, `acceptEdits`, `auto`, `dontAsk`, `bypassPermissions`, `plan`, or `manual` as an alias for `default`. The `manual` alias requires Claude Code v2.1.200 or later. Ignored for plugin subagents
`maxTurns`| No| Maximum number of agentic turns before the subagent stops. When the subagent reaches the limit, Claude Code returns its output marked as partial, and Claude can resume it to continue. The partial marking requires Claude Code v2.1.246 or later
`skills`| No| [Skills](</docs/en/skills>) to preload into the subagent’s context at startup. The full skill content is injected, not only the description. Subagents can still invoke unlisted project, user, and plugin skills through the Skill tool
@@ -282,24 +282,23 @@
Choose a model
-The `model` field controls which [AI model](</docs/en/model-config>) the subagent uses:
+The `model` field controls which model the subagent uses:
* **Model alias** : use one of the available aliases: `sonnet`, `opus`, `haiku`, or `fable`
* **Full model ID** : use a full model ID such as `claude-opus-5` or `claude-sonnet-5`. Accepts the same values as the `--model` flag
* **inherit** : use the same model as the main conversation
- * **Omitted** : defaults to `inherit` and uses the same model as the main conversation
When Claude invokes a subagent, it can also pass a `model` parameter for that specific invocation. Claude Code resolves the subagent’s model in this order:
- 1. The [`CLAUDE_CODE_SUBAGENT_MODEL`](</docs/en/model-config#environment-variables>) environment variable, when set to a model alias or model ID
- 2. The per-invocation `model` parameter
- 3. The subagent definition’s `model` frontmatter
+ 1. The per-invocation `model` parameter
+ 2. The subagent definition’s `model` frontmatter, where `inherit` selects the main conversation’s model
+ 3. The [`CLAUDE_CODE_SUBAGENT_MODEL`](</docs/en/model-config#environment-variables>) environment variable, when you set it to a model alias or model ID
4. The main conversation’s model
-As of v2.1.196, setting `CLAUDE_CODE_SUBAGENT_MODEL` to `inherit` is the same as leaving it unset: resolution continues with the per-invocation `model` parameter, then the frontmatter. In earlier versions, `inherit` forced subagents onto the main conversation’s model and ignored both of those sources. Claude Code checks the environment variable, per-invocation parameter, and frontmatter values against your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist. For a blocked value, it substitutes another model:
+Setting `CLAUDE_CODE_SUBAGENT_MODEL` by itself doesn’t change the model the built-in Explore and Plan subagents run on. Before v2.1.251, `CLAUDE_CODE_SUBAGENT_MODEL` came first in this order and overrode both the per-invocation parameter and the frontmatter, including `model: inherit`. Setting the variable to `inherit` is the same as leaving it unset. Before v2.1.196, that value forced subagents onto the main conversation’s model and ignored the other sources. Claude Code checks the per-invocation parameter, frontmatter, and environment variable values against your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist. For a blocked value, it substitutes another model:
* When the blocked value is a family alias such as `opus`, Claude Code runs the subagent on the newest version of that family the allowlist permits, following the same [substitution rules and provider scope](</docs/en/model-config#restrict-model-selection>) as `/model`. Before v2.1.222, Claude Code ran the subagent on the inherited model for a blocked family alias as well.
- * For any other blocked value, on providers where that substitution doesn’t operate, or when the allowlist permits no version of the family, Claude Code runs the subagent on the inherited model instead.
+ * For any other blocked value, on providers where that substitution doesn’t operate, or when the allowlist permits no version of the family, Claude Code runs the subagent on the inherited model instead. If you set `CLAUDE_CODE_SUBAGENT_MODEL`, Claude Code tries that model first, under these same rules.
In interactive sessions, Claude Code shows a warning naming the requested model and the model the subagent runs on, for either substitution. A per-invocation `model` parameter also applies when the subagent is resumed or sent a follow-up message, so the subagent stays on that model. Before v2.1.211, resuming dropped the per-invocation value and the subagent reverted to its definition’s `model` field or, without one, the main conversation’s model. As of v2.1.198, subagents also inherit the main conversation’s [extended thinking](</docs/en/model-config#extended-thinking>) configuration: if thinking is on in your session, it’s on for the subagent, and if it’s off, it stays off. There is no per-subagent thinking setting. Before v2.1.198, subagents ran with extended thinking disabled regardless of the main conversation’s setting.
--- a/subagents.md
+++ b/subagents.md
@@ -151,7 +151,7 @@
`prompt`| `string`| Yes| The agent’s system prompt defining its role and behavior
`tools`| `string[]`| No| Array of allowed tool names. If omitted, inherits every [tool available to subagents](</docs/en/sub-agents#available-tools>)
`disallowedTools`| `string[]`| No| Array of tool names to remove from the agent’s tool set. MCP server-level patterns are also accepted: `mcp__server` or `mcp__server__*` removes every tool from that server, and `mcp__*` removes every MCP tool from any server
-`model`| `string`| No| Model override for this agent. Accepts an alias such as `'fable'`, `'opus'`, `'sonnet'`, `'haiku'`, `'inherit'`, or a full model ID. Defaults to main model if omitted
+`model`| `string`| No| Model override for this agent. Accepts an alias such as `'fable'`, `'opus'`, `'sonnet'`, `'haiku'`, `'inherit'`, or a full model ID. `'inherit'` uses the main model. When you omit it, Claude Code picks the model in the [subagent model order](</docs/en/sub-agents#choose-a-model>)
`skills`| `string[]`| No| List of skill names to preload into the agent’s context at startup. Unlisted skills remain invocable through the Skill tool
`memory`| `'user' | 'project' | 'local'`| No| Memory source for this agent
`mcpServers`| `(string | object)[]`| No| MCP servers available to this agent, by name or inline config
--- a/terminal-config.md
+++ b/terminal-config.md
@@ -330,7 +330,7 @@
Paste large content
-When you paste more than 800 characters or more than two lines into the prompt, Claude Code collapses the input to a placeholder such as `[Pasted text #1 +120 lines]` so the input box stays usable. The full content is still sent to Claude when you submit. When you delete with a word or line shortcut such as `Ctrl+W` or `Ctrl+K`, or with a vim delete through an `f`/`t` motion such as `df]`, and the deleted range reaches inside a placeholder, Claude Code removes the placeholder whole. You can paste the deletion back to restore it, with [`Ctrl+Y`](</docs/en/interactive-mode#text-editing>) after `Ctrl+W`, `Ctrl+U`, or `Ctrl+K`, or with [`p` in NORMAL mode](</docs/en/interactive-mode#editing-normal-mode>) after a vim delete. Claude Code keeps the collapsed content under `~/.claude/paste-cache/`, so when you recall a prompt from [command history](</docs/en/interactive-mode#command-history>) and resubmit it, Claude Code sends the full pasted content again, including in a later session, until the retention sweep removes the cache file. Claude Code deletes cache files older than [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>), following the [retention sweep rules](</docs/en/claude-directory#cleaned-up-automatically>), so a recalled prompt can reference pasted text that no longer exists. When you submit such a prompt, Claude Code never sends the literal `[Pasted text #N]` string, and shows a notification naming the missing paste:
+When you paste more than 800 characters or more than three lines into the prompt, Claude Code collapses the input to a placeholder such as `[Pasted text #1 +120 lines]` so the input box stays usable. In a terminal window shorter than 12 rows the line limit drops, so Claude Code collapses a three-line paste at 11 rows and any multi-line paste at 10 rows or fewer. Claude Code still sends the full content when you submit. When you delete with a word or line shortcut such as `Ctrl+W` or `Ctrl+K`, or with a vim delete through an `f`/`t` motion such as `df]`, and the deleted range reaches inside a placeholder, Claude Code removes the placeholder whole. You can paste the deletion back to restore it, with [`Ctrl+Y`](</docs/en/interactive-mode#text-editing>) after `Ctrl+W`, `Ctrl+U`, or `Ctrl+K`, or with [`p` in NORMAL mode](</docs/en/interactive-mode#editing-normal-mode>) after a vim delete. Claude Code keeps the collapsed content under `~/.claude/paste-cache/`, so when you recall a prompt from [command history](</docs/en/interactive-mode#command-history>) and resubmit it, Claude Code sends the full pasted content again, including in a later session, until the retention sweep removes the cache file. Claude Code deletes cache files older than [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>), following the [retention sweep rules](</docs/en/claude-directory#cleaned-up-automatically>), so a recalled prompt can reference pasted text that no longer exists. When you submit such a prompt, Claude Code never sends the literal `[Pasted text #N]` string, and shows a notification naming the missing paste:
* In a plain prompt with text remaining, Claude Code removes the placeholder and sends the remaining text.
* In a [shell mode](</docs/en/interactive-mode#shell-mode-with-prefix>) command or a `/` command, where the removal would change what runs, and in any prompt the removal leaves empty, Claude Code cancels the submission and keeps the original text in the input, with the placeholder still in it. Delete the placeholder or edit the command, then resubmit.
--- a/third-party-integrations.md
+++ b/third-party-integrations.md
@@ -13,7 +13,7 @@
**Enterprise:** [Contact Sales](<https://claude.com/contact-sales?utm_source=claude_code&utm_medium=docs&utm_content=third_party_enterprise>)| PAYG| PAYG through AWS| PAYG through AWS Marketplace| PAYG through GCP| PAYG through Azure
Regions| Supported [countries](<https://www.anthropic.com/supported-countries>)| Supported [countries](<https://www.anthropic.com/supported-countries>)| Multiple AWS [regions](<https://docs.aws.amazon.com/bedrock/latest/userguide/models-regions.html>)| Multiple AWS regions| Multiple GCP [regions](<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations>)| Multiple Azure [regions](<https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-region/>)
Prompt caching| Enabled by default| Enabled by default| Enabled by default| Enabled by default| Enabled by default| Enabled by default
-Authentication| Claude.ai SSO or email| API key| API key or AWS credentials| API key or AWS credentials| GCP credentials| API key or Microsoft Entra ID
+Authentication| Claude.ai SSO or email| API key or a [Console sign-in without one](</docs/en/authentication#sign-in-without-an-api-key>)| API key or AWS credentials| API key or AWS credentials| GCP credentials| API key or Microsoft Entra ID
Cost tracking| Usage dashboard| Usage dashboard| AWS Cost Explorer| AWS Cost Explorer| GCP Billing| Azure Cost Management
Includes Claude on web| Yes| No| No| No| No| No
Enterprise features| Team management, SSO, usage monitoring| None| IAM policies, CloudTrail| IAM policies, CloudTrail| IAM roles, Cloud Audit Logs| RBAC policies, Azure Monitor
--- a/tools-reference.md
+++ b/tools-reference.md
@@ -174,7 +174,7 @@
* A command that starts with `sleep`.
* A command that runs `git` anywhere in it.
- * A compound command Claude Code can’t fully parse into simple commands.
+ * A compound command Claude Code can’t fully parse into simple commands. Claude Code treats a parameter expansion such as `${VAR}` as unparseable, so it stops a command that ends in `; exit "${PIPESTATUS[0]}"` at the timeout even when the rest of that command parses.
The result of a command moved to the background states what happened:
--- a/troubleshoot-install.md
+++ b/troubleshoot-install.md
@@ -841,7 +841,33 @@
Not logged in or token expired
-If Claude Code prompts you to log in again after a session, your OAuth token may have expired. Run `/login` to re-authenticate. If this happens frequently, check that your system clock is accurate, as token validation depends on correct timestamps. Parallel sessions on one machine share a saved login and coordinate its renewal so that only one process refreshes the token at a time. Before v2.1.211, waking the machine from sleep could cause two sessions to renew with the same token, which revoked the saved login and prompted every open session to log in again at once. On macOS, login can also fail when the Keychain is locked or its password is out of sync with your account password, which prevents Claude Code from saving credentials. Run `claude doctor` to check Keychain access. To unlock the Keychain manually, run `security unlock-keychain ~/Library/Keychains/login.keychain-db`. If unlocking doesn’t help, open Keychain Access, select the `login` keychain, and choose Edit > Change Password for Keychain “login” to resync it with your account password.
+If Claude Code prompts you to log in again after a session, your OAuth token may have expired. Run `/login` to re-authenticate. If this happens frequently, check that your system clock is accurate, as token validation depends on correct timestamps. Parallel sessions on one machine share a saved login and coordinate its renewal so that only one process refreshes the token at a time. Before v2.1.211, waking the machine from sleep could cause two sessions to renew with the same token, which revoked the saved login and prompted every open session to log in again at once. On macOS, Claude Code saves credentials to the login Keychain. When the Keychain rejects the write, such as when it’s locked in an SSH session or its password is out of sync with your account password, Claude Code saves your login to the plaintext `~/.claude/.credentials.json` file instead. A Console login that creates an API key fails until the Keychain is writable again. To make the Keychain writable again and move your login back into the encrypted Keychain:
+
+1
+
+Check Keychain access
+
+Run `claude doctor` to check Keychain access. When the Keychain rejects writes, the report lists a warning that starts with `macOS Keychain is not writable`, followed by a suggested fix. When the report lists no Keychain warning, the Keychain is writable and you can skip to the last step.
+
+2
+
+Unlock the Keychain
+
+ security unlock-keychain ~/Library/Keychains/login.keychain-db
+
+Enter your Keychain password when the command asks for it, then run `claude doctor` again. When the unlock worked, the report no longer lists the Keychain warning.
+
+3
+
+Resync the Keychain password if unlocking doesn't help
+
+Open Keychain Access, select the `login` keychain, and choose **Edit > Change Password for Keychain “login”** to resync it with your account password. Then run `claude doctor` again. Go on to the next step once the report no longer lists the Keychain warning.
+
+4
+
+Log out and back in
+
+Once the Keychain is writable again, Claude Code moves the credentials back the next time it writes a credential. To force it now, run `/logout` and then `/login`. Logging out removes all stored credentials, including the plaintext file’s contents, saved MCP server logins, and plugin sensitive values, so expect to re-authorize MCP servers and re-enter plugin secrets afterwards. Logging in again stores your login in the Keychain.
###
--- a/typescript.md
+++ b/typescript.md
@@ -421,7 +421,13 @@
Resolves the effective Claude Code settings for a given directory using the same merge engine as the CLI, without spawning the Claude CLI. Use it to inspect what configuration a `query()` call would see before invoking one.
-This function is alpha and its API may change before stabilization. It reads MDM sources, including macOS plist and Windows HKLM/HKCU, for parity with CLI startup, but does not execute the admin-configured `policyHelper` subprocess. The `permissions.defaultMode` field is returned as-is from all tiers including project settings. In a live session, the CLI [ignores `defaultMode: 'auto'` from project and local settings](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>); `resolveSettings()` skips that check, so an `auto` from those tiers appears here even though a session would ignore it.
+This function is alpha and its API may change before stabilization.
+
+The snapshot differs from what a live `query()` session applies:
+
+ * **`policyHelper`** : `resolveSettings()` reads MDM sources, including macOS plist and Windows HKLM/HKCU, but doesn’t execute the admin-configured `policyHelper` subprocess.
+ * **Server-managed settings** : `resolveSettings()` doesn’t fetch [server-managed settings](</docs/en/server-managed-settings#fetch-and-caching-behavior>). Pass them as `options.serverManagedSettings` to include them.
+ * **`defaultMode`** : the snapshot returns `permissions.defaultMode` as-is from every tier. A live session [ignores `defaultMode: 'auto'` from project and local settings](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), so an `auto` from those tiers appears in the snapshot even though a session would ignore it.
function resolveSettings(
options?: ResolveSettingsOptions
@@ -438,7 +444,7 @@
Parameter| Type| Default| Description
---|---|---|---
`options.cwd`| `string`| `process.cwd()`| Directory to resolve project and local settings relative to
-`options.settingSources`| `SettingSource``[]`| All sources| Which filesystem sources to load. Pass `[]` to skip user, project, and local settings. [Endpoint-managed policy](</docs/en/managed-settings#delivery-mechanisms>) loads in all cases. Server-managed settings are taken from `serverManagedSettings` when the host passes it, or read from the CLI’s on-disk cache otherwise; the snapshot does not fetch them from the network
+`options.settingSources`| `SettingSource``[]`| All sources| Which filesystem sources to load. Pass `[]` to skip user, project, and local settings. [Endpoint-managed policy](</docs/en/managed-settings#delivery-mechanisms>) loads in all cases. `resolveSettings()` includes server-managed settings only when you pass `options.serverManagedSettings`
`options.managedSettings`| `Settings`| `undefined`| Policy-tier settings supplied by the embedding host. Follows the same rules as `managedSettings` in `Options`, except that `resolveSettings()` doesn’t execute a configured [`policyHelper`](</docs/en/settings-reference#policyhelper>), so the snapshot can include settings that a live session drops
`options.serverManagedSettings`| `Settings`| `undefined`| Server-managed settings payload from `/api/claude_code/settings`. Non-restrictive keys pass through unfiltered
@@ -546,7 +552,7 @@
`spawnClaudeCodeProcess`| `(options: SpawnOptions) => SpawnedProcess`| `undefined`| Custom function to spawn the Claude Code process. Use to run Claude Code in VMs, containers, or remote environments
`stderr`| `(data: string) => void`| `undefined`| Callback for stderr output
`strictMcpConfig`| `boolean`| `false`| Use only the servers passed in `mcpServers` and ignore project `.mcp.json`, user settings, plugin-provided MCP servers, and [claude.ai connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>)
-`systemPrompt`| `string | { type: 'preset'; preset: 'claude_code'; append?: string; excludeDynamicSections?: boolean }`| `undefined` (minimal prompt)| System prompt configuration. Pass a string for custom prompt, or `{ type: 'preset', preset: 'claude_code' }` to use Claude Code’s system prompt. When using the preset object form, add `append` to extend it with additional instructions, and set `excludeDynamicSections: true` to move per-session context into the first user message for [better prompt-cache reuse across machines](</docs/en/agent-sdk/modifying-system-prompts#improve-prompt-caching-across-users-and-machines>)
+`systemPrompt`| `string | string[] | { type: 'preset'; preset: 'claude_code'; append?: string; excludeDynamicSections?: boolean }`| `undefined` (minimal prompt)| System prompt configuration. Pass a string for a custom prompt, or `{ type: 'preset', preset: 'claude_code' }` to use Claude Code’s system prompt. Pass an array of strings with the exported `SYSTEM_PROMPT_DYNAMIC_BOUNDARY` constant between the static and per-request parts to [cache the static part of a custom prompt](</docs/en/agent-sdk/modifying-system-prompts#cache-the-static-part-of-a-custom-prompt>). When using the preset object form, add `append` to extend it with additional instructions, and set `excludeDynamicSections: true` to move per-session context into the first user message for [better prompt-cache reuse across machines](</docs/en/agent-sdk/modifying-system-prompts#improve-prompt-caching-across-users-and-machines>)
`taskBudget`| `{ total: number }`| `undefined`| _Alpha._ API-side task budget in tokens. When set, the model is told its remaining token budget so it can pace tool use and wrap up before the limit
`thinking`| `ThinkingConfig`| `{ type: 'adaptive' }` for supported models| Controls Claude’s thinking/reasoning behavior. See `ThinkingConfig` for options
`title`| `string`| `undefined`| Display title for the session. When resuming via `resume` or `continue`, the resumed session’s persisted title takes precedence; use `renameSession()` to retitle an existing session
@@ -926,7 +932,7 @@
`tools`| No| Array of allowed tool names. If omitted, inherits every [tool available to subagents](</docs/en/sub-agents#available-tools>). To preload Skills into the agent’s context, use the `skills` field rather than listing `'Skill'` here
`disallowedTools`| No| Array of tool names to explicitly disallow for this agent. MCP server-level patterns are also accepted: `mcp__server` or `mcp__server__*` removes every tool from that server, and `mcp__*` removes every MCP tool from any server
`prompt`| Yes| The agent’s system prompt
-`model`| No| Model override for this agent. Accepts an alias such as `'fable'`, `'opus'`, `'sonnet'`, `'haiku'`, `'inherit'`, or a full model ID. If omitted or `'inherit'`, uses the main model
+`model`| No| Model override for this agent. Accepts an alias such as `'fable'`, `'opus'`, `'sonnet'`, `'haiku'`, `'inherit'`, or a full model ID. `'inherit'` uses the main model. When you omit it, Claude Code picks the model in the [subagent model order](</docs/en/sub-agents#choose-a-model>)
`mcpServers`| No| MCP server specifications for this agent
`skills`| No| Array of skill names to preload into the agent context
`initialPrompt`| No| Auto-submitted as the first user turn when this agent runs as the main thread agent
@@ -4704,7 +4710,7 @@
---|---|---
`name`| `string`| Agent type identifier (e.g., `"Explore"`, `"general-purpose"`)
`description`| `string`| Description of when to use this agent
-`model`| `string | undefined`| Model alias this agent uses. If omitted, inherits the parent’s model
+`model`| `string | undefined`| Model this agent uses: an alias or model ID, or `'inherit'` for the parent’s model. When it’s `undefined`, Claude Code picks the model in the [subagent model order](</docs/en/sub-agents#choose-a-model>)
###
--- a/workflows.md
+++ b/workflows.md
@@ -153,7 +153,7 @@
/effort ultracode
-To start a session with ultracode already on, launch with `claude --effort ultracode`. Requires Claude Code v2.1.203 or later. With ultracode on, Claude decides when a task warrants a workflow. A single request can turn into several workflows in a row: one to understand the code, one to make the change, and one to verify it. This applies to every task in the session, so each request uses more tokens and takes longer than at lower effort levels. `/effort ultracode` lasts for the current session; to have every session start with it, set the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. Drop back with `/effort high` when you return to routine work. It’s available on models that support `xhigh` [effort](</docs/en/model-config#adjust-effort-level>); on other models the `/effort` menu doesn’t offer it.
+To start a session with ultracode already on, launch with `claude --effort ultracode`. Requires Claude Code v2.1.203 or later. To turn it on while you choose a model, move the `/model` picker’s effort slider to `ultracode` with the arrow keys. [Adjust effort level](</docs/en/model-config#adjust-effort-level>) lists the routes that turn ultracode on. With ultracode on, Claude decides when a task warrants a workflow. A single request can turn into several workflows in a row: one to understand the code, one to make the change, and one to verify it. This applies to every task in the session, so each request uses more tokens and takes longer than at lower effort levels. `/effort ultracode` lasts for the current session; to have every session start with it, set the [`ultracode`](</docs/en/settings-reference#ultracode>) setting. Drop back with `/effort high` when you return to routine work. It’s available on models that support `xhigh` [effort](</docs/en/model-config#adjust-effort-level>); on other models the `/effort` menu doesn’t offer it.
###
@@ -403,7 +403,7 @@
* If you choose a size guideline yourself, its agent count replaces the 25-agent threshold. The built-in default guideline leaves the threshold at 25.
* Sessions with ultracode on don’t show the warning, because turning ultracode on already opts you in to large runs.
-Every agent in a workflow uses your session’s model unless the script routes a stage to a different one or the [`CLAUDE_CODE_SUBAGENT_MODEL`](</docs/en/model-config#environment-variables>) environment variable is set, which overrides both. To control the model cost:
+Claude Code picks each workflow agent’s model in the same [order it uses for subagents](</docs/en/sub-agents#choose-a-model>). A model the script names for a stage counts as the per-invocation model in that order. When nothing else assigns one, the agent runs on your session’s model. To control the model cost:
* Check `/model` before a large run if you usually switch to a smaller model for routine work
* Ask Claude to use a smaller model for stages that don’t need the strongest one when you describe the task