modified Manage mods for your organization View current →
--- a/admin.md +++ b/admin.md @@ -15,7 +15,7 @@ Stop user-installed mods from loading -To keep every mod your users bring from loading, set the `allowManagedModsOnly` option on the built-in guard, a policy mod that Claude Code loads ahead of every mod a user installs. The option goes in managed settings under `pluginConfigs`, keyed by `cc-plugin-sec-default@builtin`: +To keep every mod your users bring from running its hooks, set the `allowManagedModsOnly` option on the built-in guard, a policy mod that Claude Code loads ahead of every mod a user installs. The option goes in managed settings under `pluginConfigs`, keyed by `cc-plugin-sec-default@builtin`: managed-settings.json @@ -31,14 +31,14 @@ With the option set in managed settings: - * **No mod a user brings loads** : that covers a mod in a plugin the user installed, a mod loaded with `--plugin-dir`, and a mod [Claude wrote during a session](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) - * **Your organization’s mods still load** : a mod that counts as your organization’s isn’t checked. Every other mod counts as a user’s and doesn’t load. That includes a mod in a plugin you enable from a GitHub or other remote marketplace, and one your organization turns on for its members on claude.ai. If none counts as yours, no installed mod loads. + * **No mod a user brings runs its hooks** : that covers a mod in a plugin the user installed, a mod loaded with `--plugin-dir`, and a mod [Claude wrote during a session](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) + * **Your organization’s mods still run** : a mod that counts as your organization’s isn’t checked. Every other mod counts as a user’s and is refused. That includes a mod in a plugin you enable from a GitHub or other remote marketplace, and one your organization turns on for its members on claude.ai. If none counts as yours, no installed mod runs its hooks. * **Users can’t undo it** : the guard reads the option from managed settings only, so the same entry in a user, project, or local settings file, or in a file passed with `--settings`, changes nothing * **A file or MDM policy covers every provider** : when you deliver the option as a file or through MDM, it works the same way on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. For delivery from the claude.ai admin console, see [Platform availability](</docs/en/server-managed-settings#platform-availability>) - * **Users’ other customizations keep working** : their [hooks in settings files](</docs/en/hooks>), status lines, and `/goal` aren’t affected + * **Users’ other customizations keep working** : their [hooks in settings files](</docs/en/hooks>) and in plugins’ `hooks/hooks.json`, status lines, and `/goal` aren’t affected * **Built-in mods keep running** : mods built into Claude Code, such as `AGENTS.md` support, each have [their own switch](</docs/en/plugins/mods/overview#mods-built-into-claude-code>) -To confirm the option on a user’s machine, start Claude Code there with `--plugin-dir` and the path of a directory that holds a mod, such as `claude --plugin-dir ./first-mod`. The mod’s hooks don’t run, and the transcript and the debug log have the [guard’s message](</docs/en/plugins/mods/troubleshoot#messages-from-the-built-in-guard>), which names the mod and `allowManagedModsOnly`. If the mod loads, see [Check that a policy is in force](</docs/en/managed-settings#check-that-a-policy-is-in-force>) and the rules that decide whether an option takes effect. If you set `CLAUDE_CODE_ENABLE_FUNCTION_HOOKS` to `0` during early access, replace it with this option. Claude Code v2.1.287 and later ignores the variable at any value, so a `0` there leaves mods on. +To confirm the option on a user’s machine, start Claude Code there with `--plugin-dir` and the path of a directory that holds a mod, such as `claude --plugin-dir ./first-mod`. The mod’s hooks don’t run, and the transcript and the debug log have the [guard’s message](</docs/en/plugins/mods/troubleshoot#messages-from-the-built-in-guard>), which names the mod and `allowManagedModsOnly`. If the message isn’t there, see [Check that a policy is in force](</docs/en/managed-settings#check-that-a-policy-is-in-force>) and the rules that decide whether an option takes effect. If you set `CLAUDE_CODE_ENABLE_FUNCTION_HOOKS` to `0` during early access, replace it with this option. Claude Code v2.1.287 and later ignores the variable at any value, so a `0` there leaves mods on. ## @@ -105,7 +105,7 @@ claude plugin validate ./some-mod -Two lines in the output describe the mod’s code: +The `hooks:` and `calls:` lines in the output describe the mod’s code: ❯ ./register.js hooks: session.start, tool.call, ui.render{component=Pane} ❯ ./register.js calls: $.fs.read, $.http.fetch, $.store.set, $.ui.open @@ -136,7 +136,7 @@ What you want| Settings ---|--- -No installed mods, with hooks untouched| Set `allowManagedModsOnly` and deploy no mods of your own +No installed mod runs, with settings hooks untouched| Set `allowManagedModsOnly` and deploy no mods of your own No installed mods and no hooks at all, your managed hooks included| Set `disableAllHooks` to `true` Only your organization’s mods| Set the guard’s `allowManagedModsOnly` option, and install your mods so that they count as yours Any mod from marketplaces you approve| Keep your [marketplace restrictions](</docs/en/plugins/org#restrict-what-users-can-install>), and set `disableSideloadFlags` to `true` @@ -144,12 +144,12 @@ What each setting does: - * **`allowManagedModsOnly`** : an option on the built-in guard. Users’ own mods don’t load, and their settings hooks, status lines, and `/goal` keep working. Stop user-installed mods from loading lists what it covers. + * **`allowManagedModsOnly`** : an option on the built-in guard. Claude Code refuses users’ own mods, so none of their hooks run. Users’ settings hooks, status lines, and `/goal` keep working. Stop user-installed mods from loading lists what it covers. * **`allowManagedHooksOnly`** : a wider setting. Only your organization’s mods and the mods built into Claude Code load. A mod a user installed themselves doesn’t. The setting also blocks hooks in users’ own settings files. Read [What runs under `allowManagedHooksOnly`](</docs/en/settings-reference#what-runs-under-allowmanagedhooksonly>) before you set it. * **`disableAllHooks`** : the widest setting. In managed settings, it stops the mods in every installed plugin, yours included, and turns off every hook in settings files, so a `PreToolUse` hook in your managed settings no longer blocks anything. Custom status lines and `/goal` stop working too. Read [`disableAllHooks`](</docs/en/settings-reference#disableallhooks>) before you set it. * **`disableSideloadFlags`** : rejects `--plugin-dir` and `--plugin-url` at startup, and keeps mods Claude writes during a session from loading. The setting also rejects `--agents` and `--mcp-config`. Read [`disableSideloadFlags`](</docs/en/settings-reference#disablesideloadflags>) before you set it. -Mods built into Claude Code, such as `AGENTS.md` support, aren’t affected by these settings. Each has [its own switch](</docs/en/plugins/mods/overview#mods-built-into-claude-code>). A user whose mod didn’t load finds the reason in their debug log. [Refusal messages](</docs/en/plugins/mods/troubleshoot#refusal-messages>) lists the lines for `allowManagedHooksOnly` and `disableAllHooks`, and [Messages from the built-in guard](</docs/en/plugins/mods/troubleshoot#messages-from-the-built-in-guard>) has the line for `allowManagedModsOnly`. +Mods built into Claude Code, such as `AGENTS.md` support, aren’t affected by these settings. Each has [its own switch](</docs/en/plugins/mods/overview#mods-built-into-claude-code>). A user whose mod was refused or didn’t load finds the reason in their debug log. [Refusal messages](</docs/en/plugins/mods/troubleshoot#refusal-messages>) lists the lines for `allowManagedHooksOnly` and `disableAllHooks`, and [Messages from the built-in guard](</docs/en/plugins/mods/troubleshoot#messages-from-the-built-in-guard>) has the line for `allowManagedModsOnly`. ### @@ -216,7 +216,7 @@ Option| Unset| `true` ---|---|--- -`allowManagedModsOnly`| Users’ own mods load| Only your organization’s mods, and mods built into Claude Code, load. Claude Code refuses every other mod, including one a user installed or named with `--plugin-dir`. +`allowManagedModsOnly`| Users’ own mods run| Only your organization’s mods, and mods built into Claude Code, run their hooks. Claude Code refuses every other mod, including one a user installed or named with `--plugin-dir`. `allowModsToOverrideDenyRules`| Deny rules take precedence over users’ mods| A user’s mod that approves tool calls can approve a call that a `deny` rule refuses These rules decide whether an option takes effect: @@ -273,7 +273,7 @@ ] } -A plugin that Claude Code copies into its cache counts as a user’s, even when managed `enabledPlugins` enables it. That covers every plugin from a GitHub, git, URL, or npm source. Its mod runs among users’ mods, `prependPlugins` and `appendPlugins` skip it, and it doesn’t load under `allowManagedModsOnly` or `allowManagedHooksOnly`. The user’s debug log has a line that starts with the plugin’s id and `is enabled by managed settings, but`. Claude Code fires an event each time it’s about to act, such as run a tool, and passes it to each mod in turn. A mod that counts as yours [runs before users’ mods](</docs/en/plugins/mods/events#the-order-mods-run-in>) even when you list it nowhere. To set its place, list its id in one of two settings. The id is the plugin’s name, `@`, and the marketplace’s name, such as `acme-guard@acme-tools`. +A plugin that Claude Code copies into its cache counts as a user’s, even when managed `enabledPlugins` enables it. That covers every plugin from a GitHub, git, URL, or npm source. Its mod runs among users’ mods, `prependPlugins` and `appendPlugins` skip it, `allowManagedModsOnly` refuses it, and `allowManagedHooksOnly` keeps it from loading. The user’s debug log has a line that starts with the plugin’s id and `is enabled by managed settings, but`. Claude Code fires an event each time it’s about to act, such as run a tool, and passes it to each mod in turn. A mod that counts as yours [runs before users’ mods](</docs/en/plugins/mods/events#the-order-mods-run-in>) even when you list it nowhere. To set its place, list its id in one of two settings. The id is the plugin’s name, `@`, and the marketplace’s name, such as `acme-guard@acme-tools`. * **`prependPlugins`** : your mod sees every event before any user’s mod and every result after. It can change the event, refuse it, or skip the users’ mods. * **`appendPlugins`** : your mod runs after every user’s mod, so it sees only the events those mods pass on, in the form they pass them
modified Set up Claude Code for your organization View current →
--- a/admin-setup.md +++ b/admin-setup.md @@ -59,7 +59,7 @@ * Create a value named `disableWslSessions` under `HKLM\SOFTWARE\Policies\Claude` and set it to the `REG_SZ` string `false` or the `REG_DWORD` `0`. This value sits under the Claude Desktop policy key, separate from the `ClaudeCode` key that carries managed settings. Deploy the value under HKLM, which requires administrator privileges to write. A value under HKCU doesn’t enable WSL sessions. * Leave `C:\Program Files\ClaudeCode\managed-settings.json` in place if you deploy it. Once `disableWslSessions` is `false` under HKLM, Desktop allows WSL sessions even though that file is present. -Desktop reads the policy each time a WSL session starts, so you don’t need to restart the app after deploying it. If a device still refuses WSL sessions, open **Help > Troubleshooting > Show Logs in Explorer** in Claude Desktop on that device, which saves a copy of its log folder to Downloads. Search `main.log` in that copy for `[wslPolicyGate] denying WSL session`. The reason for the denial follows in parentheses, such as `(cli-file-present)`. If Claude Desktop was installed with the `.exe` installer, you can also read the live file at `%APPDATA%\Claude\logs\main.log`. After WSL sessions are enabled, extend your managed settings to them: +Desktop reads the policy each time a WSL session starts, so you don’t need to restart the app after deploying it. If a device still refuses WSL sessions, open **Help > Troubleshooting > Show Logs in File Explorer** in Claude Desktop on that device, which saves a copy of its log folder to Downloads. Search `main.log` in that copy for `[wslPolicyGate] denying WSL session`. The reason for the denial follows in parentheses, such as `(cli-file-present)`. After WSL sessions are enabled, extend your managed settings to them: * Deploy `wslInheritsWindowsSettings: true` through the HKLM registry or the `C:\Program Files\ClaudeCode` file so WSL sessions inherit the same policy as host sessions. * Verify by running `/status` inside a WSL session and reading the `Setting sources` line. To interpret what it lists, see [Read the source in /status](</docs/en/managed-settings#read-the-source-in-/status>).
modified Escalate hard decisions with the advisor tool View current →
--- a/advisor.md +++ b/advisor.md @@ -67,7 +67,7 @@ Claude Code uses the flag instead of the `advisorModel` setting for that session. It doesn’t list `--advisor` in `claude --help`. Claude Code exits with an error at launch if: * The session’s main model doesn’t support the advisor - * The requested model, such as Haiku, can’t act as an advisor + * The requested model, such as Haiku 4.5, can’t act as an advisor * Your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist excludes the requested model * You requested Fable and your account still requires the usage-credits consent @@ -83,17 +83,17 @@ Main model| Accepted advisors ---|--- -Haiku 4.5| Fable, Opus, Sonnet -Sonnet 4.6| Fable, Opus, Sonnet -Opus 4.6| Fable, Opus, Sonnet 5 or later -Sonnet 5| Fable, Opus 4.7 or later, Sonnet 5 or later +Haiku 4.5| Fable, Opus, Sonnet, Haiku 5.5 +Sonnet 4.6| Fable, Opus, Sonnet, Haiku 5.5 +Opus 4.6| Fable, Opus, Sonnet 5 or later, Haiku 5.5 +Sonnet 5 or Haiku 5.5| Fable, Opus 4.7 or later, Sonnet 5 or later, Haiku 5.5 Opus 4.7 or Opus 4.8| Fable, Opus 4.7 or later, Sonnet 5.5 Sonnet 5.5| Fable, Opus 5 or later, Sonnet 5.5 Opus 5 or Opus 5.5| Fable, Opus 5 or later Fable 5| Fable 5.1 or Fable 5 Fable 5.1| Fable 5.1 -Fable 5.1 requires Claude Code v2.1.257 or later. Fable models require [Fable access](</docs/en/model-config#work-with-fable>). Sonnet 5.5 as the advisor for an Opus 4.7 or Opus 4.8 main model requires Claude Code v2.1.287 or later. Set the advisor as `fable`, `opus`, or `sonnet`. These aliases resolve to Claude Code’s [built-in default version](</docs/en/model-config#model-aliases>) for each model family, which advances with new Claude Code releases. You can also pass a full model ID such as `claude-opus-5-5`. Haiku can call the advisor but can’t act as one. Subagents inherit the configured advisor and apply the same pairing check against their own model. Claude Code validates the pairing before sending a request, and the API validates it again: +Fable 5.1 requires Claude Code v2.1.257 or later. Fable models require [Fable access](</docs/en/model-config#work-with-fable>). Sonnet 5.5 as the advisor for an Opus 4.7 or Opus 4.8 main model requires Claude Code v2.1.287 or later. Haiku 5.5 as the main model or as the advisor requires Claude Code v2.1.293 or later. Set the advisor as `fable`, `opus`, or `sonnet`. These aliases resolve to Claude Code’s [built-in default version](</docs/en/model-config#model-aliases>) for each model family, which advances with new Claude Code releases. You can also pass a full model ID such as `claude-opus-5-5` or `claude-haiku-5-5`. Haiku 4.5 can call the advisor but can’t act as one. Subagents inherit the configured advisor and apply the same pairing check against their own model. Claude Code validates the pairing before sending a request, and the API validates it again: * For an advisor that ranks below the main model, Claude Code doesn’t attach it to the main model’s requests. The `/advisor` command output and a notification show this; see [Advisor is less capable than the current main model](</docs/en/errors#advisor-is-less-capable-than-the-current-main-model>). Subagents whose own model satisfies the pairing may still use the advisor. * If the API refuses the pairing of an advisor that Claude Code attached, Claude Code resends that request without the advisor. The conversation continues without one, so you see no error and get no advisor calls. If you then pick a different advisor with `/advisor`, it takes effect after `/clear` or `/compact` and in new sessions. @@ -176,7 +176,7 @@ The advisor tool requires all of the following: * **Anthropic API only** : the advisor is a server-executed tool. It is not available on Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry. Through an [LLM gateway](</docs/en/llm-gateway>) configured with `ANTHROPIC_BASE_URL`, availability depends on whether the gateway forwards the request intact to the Anthropic API. If the gateway or its upstream doesn’t recognize the advisor tool, see [Automatic retry and error forwarding](</docs/en/llm-gateway-protocol#automatic-retry-and-error-forwarding>) for how Claude Code responds. - * **Supported main model** : Fable, Opus 4.6 or later, Sonnet 4.6 or later, or Haiku 4.5. See Choose an advisor model for which advisors each accepts. + * **Supported main model** : Fable, Opus 4.6 or later, Sonnet 4.6 or later, Haiku 4.5, or Haiku 5.5. See Choose an advisor model for which advisors each accepts. * **Feature-flag fetching** : Claude Code turns the advisor on through a feature flag it fetches from Anthropic. In a session where a variable that turns flag fetching off is set, such as `DISABLE_TELEMETRY`, the advisor stays off. See [Features that need feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>). ##
modified Orchestrate teams of Claude Code sessions View current →
--- a/agent-teams.md +++ b/agent-teams.md @@ -129,7 +129,7 @@ 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. -If you set [`CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1`](</docs/en/sub-agents#run-every-subagent-on-one-model>), the first two sources don’t apply. Claude Code picks every teammate’s model from `CLAUDE_CODE_SUBAGENT_MODEL` when it’s set to anything other than `inherit`, and from the lead’s current model otherwise. Requires Claude Code v2.1.257 or later. Before v2.1.251, `CLAUDE_CODE_SUBAGENT_MODEL` came first in this order. +If an installed [mod](</docs/en/plugins/mods/overview>) sets a model in its [`agent.spawn`](</docs/en/plugins/mods/reference#subagents>) hook, Claude Code uses that model in place of the first source. If you set [`CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1`](</docs/en/sub-agents#run-every-subagent-on-one-model>), the first two sources don’t apply. Claude Code picks every teammate’s model from `CLAUDE_CODE_SUBAGENT_MODEL` when it’s set to anything other than `inherit`, and from the lead’s current model otherwise. Requires Claude Code v2.1.257 or later. 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.
modified Manage multiple agents with agent view View current →
--- a/agent-view.md +++ b/agent-view.md @@ -182,7 +182,7 @@ Any pull requests linked to the session are listed next. For a session that’s waiting on you, a line such as `waiting 3m` below them shows how long it has been waiting, and it’s the only time shown in the panel. The age at the right edge of the row is a different number: it counts from when the session started. Most of the time the peek panel is enough and you don’t need to open the full transcript. Type a reply in the peek panel and press `Enter` to send it to that session. Prefix a reply with `!` to send a Bash command instead. What happens to the reply depends on the session and on what you send: - * A session that’s working: the reply joins the session’s [message queue](</docs/en/interactive-mode#queue-messages-while-claude-works>) instead of interrupting the response, and takes effect [when queued input does](</docs/en/interactive-mode#when-claude-code-sends-what-you-queued>). A [command](</docs/en/commands>) waits for the turn to end, even one that runs as soon as you type it at a session’s own prompt + * A session that’s working: `/model`, `/effort`, `/rename`, and `/usage` run right away. Other replies join the session’s [message queue](</docs/en/interactive-mode#queue-messages-while-claude-works>) instead of interrupting the response, and take effect [when queued input does](</docs/en/interactive-mode#when-claude-code-sends-what-you-queued>). Other [commands](</docs/en/commands>) wait for the turn to end, even ones that run as soon as you type them at a session’s own prompt * A reply that is exactly `/stop`: stops the session at once instead of being delivered to it, whether the session is working or waiting on you * A shell job: the reply, `/stop` included, goes to the command’s terminal as typed input @@ -190,7 +190,7 @@ * A question with predefined choices: the panel lists the choices by number. With the reply input empty, press a choice’s number to fill it in, then `Enter` to send it, or type your own answer instead * A question without predefined choices: type your answer. When the empty input shows a suggested reply, press `Tab` to fill it in and edit it before sending - * A permission prompt or another dialog, such as a [sandbox](</docs/en/sandboxing>) prompt or an MCP server’s [request for input](</docs/en/mcp#respond-to-mcp-elicitation-requests>): replying doesn’t answer it. Your reply waits in the queue. To answer the dialog, attach with `→` + * A permission prompt or another dialog, such as a [sandbox](</docs/en/sandboxing>) prompt or an MCP server’s [request for input](</docs/en/mcp#respond-to-mcp-elicitation-requests>): replying doesn’t answer it. Your message waits in the queue. To answer the dialog, attach with `→` When a [`PermissionRequest`](</docs/en/hooks#permissionrequest>) or [`PreToolUse`](</docs/en/hooks#pretooluse>) hook returns output Claude Code can’t validate for the call the session is asking about, the row shows the hook event and `hook output invalid:` with the validation error before the pending request’s text. For a hook that fails another way, the row says the hook failed. The session still waits on the same request. A reply that can’t be delivered, because the background service is unreachable or the send fails, is saved and sent to the session as its next prompt when its process starts again, and the error message says the reply was saved. A reply prefixed with `!` isn’t saved, because the saved text would reach the session as a plain prompt rather than run as a Bash command. With [voice dictation](</docs/en/voice-dictation>) enabled in [hold mode](</docs/en/voice-dictation#hold-to-record>), hold your push-to-talk key while the reply input is focused to dictate a reply instead of typing it. The same works in the dispatch input at the bottom of agent view. Use `↑` and `↓` to peek at adjacent sessions without closing the panel, or `→` to attach. @@ -214,7 +214,13 @@ * Press `Esc` to undo the switch and return to the conversation. If `Esc` shows `Still starting — try again in a moment`, the background session isn’t ready yet, so press `Esc` again in a moment. * Press `Ctrl+C` twice to exit to your shell. -When Claude Code can’t reopen the conversation, it exits and prints a `claude --resume` command that resumes it. [Claude’s task list](</docs/en/interactive-mode#task-list>) moves to the background session with the conversation, so the checklist is intact when you return to that row. The row you pressed `←` from also keeps a bold, undimmed name after you move the selection with the arrow keys or the mouse, so you can tell which session you came from. If a tool is running when you press `←`, Claude Code waits up to about ten seconds for it to finish before backgrounding, and Claude continues the response in the background session. Press `←` again to background immediately instead of waiting. When in-flight work can’t carry over to the background session, Claude Code shows the `Background this session?` dialog first, the same as with `/background`. The ten-second limit doesn’t apply while the [foreground subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) Claude started in the conversation are still running. Claude Code keeps waiting so their work carries over, and shows a `Still backgrounding after the current tool` notice while it waits. Press `←` again to background without waiting, which restarts those subagents from the beginning. Claude Code doesn’t wait for the subagents a [dynamic workflow](</docs/en/workflows>) is running. When a workflow has subagents running, Claude Code shows the `Background this session?` dialog instead. Claude Code doesn’t background the session while you have unsent text in the prompt input, because the text stays in your terminal’s input box and wouldn’t move to the background session. If you type into the input while Claude Code waits to background the session, it cancels the switch with `Backgrounding cancelled — you have unsent text in the input. Send it or clear it, then press ← again.` Pressing `←` creates the session’s row even when the conversation has no messages yet, so `→` still returns to it. You can turn this shortcut off for foreground sessions with the [`leftArrowOpensAgents`](</docs/en/settings-reference#leftarrowopensagents>) setting in `/config`. +When Claude Code can’t reopen the conversation, it exits and prints a `claude --resume` command that resumes it. [Claude’s task list](</docs/en/interactive-mode#task-list>) moves to the background session with the conversation, so the checklist is intact when you return to that row. The row you pressed `←` from also keeps a bold, undimmed name after you move the selection with the arrow keys or the mouse, so you can tell which session you came from. If a tool is running when you press `←`, Claude Code waits for it to finish before backgrounding, and Claude continues the response in the background session. Press `←` again to background immediately instead of waiting. When in-flight work can’t carry over to the background session, Claude Code shows the `Background this session?` dialog first, the same as with `/background`. After about ten seconds, Claude Code backgrounds the session without waiting any longer, except in cases such as these: + + * **Foreground subagents are still running** : Claude Code keeps waiting so the work of the [foreground subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) Claude started carries over, and shows `Still backgrounding after the current tool`. Press `←` again to background without waiting, which restarts those subagents from the beginning. + * **A permission prompt or question is waiting for your answer** : while a permission prompt or a question Claude asked waits, Claude Code keeps waiting and shows `Still backgrounding after the current tool — a question is waiting for your answer.` + * **You type into the prompt input** : Claude Code cancels the switch, because unsent text stays in your terminal’s input box and wouldn’t move to the background session. It shows `Backgrounding cancelled — you have unsent text in the input. Send it or clear it, then press ← again.` + +Pressing `←` creates the session’s row even when the conversation has no messages yet, so `→` still returns to it. You can turn this shortcut off for foreground sessions with the [`leftArrowOpensAgents`](</docs/en/settings-reference#leftarrowopensagents>) setting in `/config`. ### @@ -689,7 +695,7 @@ The supervisor is a background service that runs your background sessions so they keep working after you close agent view or your terminal. Claude Code starts it the first time you background a session or open agent view, and you don’t need to manage it yourself. Each session is its own Claude Code process under the supervisor, and what happens to that process depends on the session’s state: - * **Working, paused on a permission prompt or other dialog, or attached** : the process keeps running. A running subagent, workflow, or monitor counts as working. + * **Working, paused on a permission prompt or other dialog, or attached** : the process keeps running. A running subagent, workflow, or monitor counts as working, and so does a pending [session-scoped scheduled task](</docs/en/scheduled-tasks>), such as a `/loop` wakeup. * **Finished or waiting for your next message, and unattached for about an hour** : the supervisor stops the process to free resources. A session that ended its turn by asking you a question counts as waiting for your next message. The conversation stays on disk, and the next time you attach or reply, the session resumes where it left off. Pin a session with `Ctrl+T` to keep its process running. * **Exited unexpectedly while the supervisor is running** : the supervisor restarts the process. Ending a session you backgrounded yourself with `←` or `/background`, for example with `kill`, marks it stopped instead of restarting it. For sessions that ended with a shutdown, see Sessions show as failed or stopped after shutdown. * **After an auto-update** : the supervisor restarts itself onto the new version and moves idle sessions over in the background. Sessions that are working, waiting on you, or attached aren’t interrupted. @@ -908,6 +914,7 @@ Version| Change ---|--- v2.1.290| `claude attach` and `claude logs` can take part of a running session’s name in place of the ID. +v2.1.290| `/model`, `/effort`, `/rename`, and `/usage` sent as a peek reply to a working session run right away. v2.1.288| `Ctrl+F` finds sessions by name, and `Alt+↑` / `Alt+↓` jump between group headers. Both, and `Ctrl+R`, can be [rebound](</docs/en/keybindings#agents-actions>). v2.1.287| The `n:<text>` filter finds sessions by name or first prompt. While any filter is active, groups you collapsed expand to show their matches and the first match is selected, so `Enter` opens it. v2.1.287| A command sent as a peek reply runs when the session’s current turn ends, including the commands that run as soon as you type them at a session’s own prompt. A reply that is exactly `/stop` stops the session at once.
modified Claude Code on Amazon Bedrock View current →
--- a/amazon-bedrock.md +++ b/amazon-bedrock.md @@ -70,31 +70,80 @@ 2\. Configure AWS credentials -Claude Code uses the default AWS SDK credential chain. Set up your credentials using one of these methods: **Option A: AWS CLI configuration** +Claude Code uses the default AWS SDK credential chain. If the machine already supplies credentials to that chain, such as an Amazon EC2 instance profile or Amazon ECS task credentials, skip to step 3. AWS [warns against using an IAM user’s access keys](<https://docs.aws.amazon.com/cli/latest/userguide/cli-authentication-user.html>) when you develop purpose-built software or work with real data. Set up your credentials with one of these methods: + + * `aws configure`: save an IAM user’s access key to a profile in your `~/.aws` directory + * Access key environment variables: set an access key, or temporary credentials with a session token, in the current shell only + * SSO profile: sign in through IAM Identity Center in your browser and get temporary credentials. Use this method if you access your AWS account through IAM Identity Center. + * AWS Management Console credentials: sign in through your browser with your AWS Management Console credentials and get temporary credentials. AWS [recommends this method](<https://docs.aws.amazon.com/signin/latest/userguide/command-line-sign-in.html>) if you access your AWS account as the root user, as an IAM user, or through federation with IAM. + * Amazon Bedrock API key: authenticate with a bearer token that works only for Amazon Bedrock, instead of AWS credentials + +#### + +​ + +Use `aws configure` + +Run `aws configure` and enter your access key ID, secret access key, and default region when prompted: aws configure -**Option B: Environment variables (access key)** +The AWS CLI saves the key to the `default` profile in `~/.aws/credentials`, where the credential chain reads it. + +#### + +​ + +Export an access key + +Export your access key as environment variables. `AWS_SESSION_TOKEN` is required only with temporary credentials, so leave that line out if your access key belongs to an IAM user: export AWS_ACCESS_KEY_ID=your-access-key-id export AWS_SECRET_ACCESS_KEY=your-secret-access-key export AWS_SESSION_TOKEN=your-session-token -**Option C: Environment variables (SSO profile)** Replace `your-profile-name` with the name of your AWS profile before running these commands. +#### + +​ + +Use an SSO profile + +Create a profile with `aws configure sso` if you don’t have one. Then sign in to IAM Identity Center and set `AWS_PROFILE` so the credential chain uses that profile. Replace `your-profile-name` with the name of your AWS profile before running these commands. aws sso login --profile=your-profile-name export AWS_PROFILE=your-profile-name -Claude Code requests role credentials from the IAM Identity Center region named by the profile’s `sso_region`, which doesn’t need to match the region you run Amazon Bedrock in. In v2.1.207, the Amazon Bedrock region overrode `sso_region`, so a profile whose IAM Identity Center instance is in a different region failed to authenticate with a `Session token not found or invalid` error. **Option D: AWS Management Console credentials** +Claude Code requests role credentials from the IAM Identity Center region named by the profile’s `sso_region`, which doesn’t need to match the region you run Amazon Bedrock in. In v2.1.207, the Amazon Bedrock region overrode `sso_region`, so a profile whose IAM Identity Center instance is in a different region failed to authenticate with a `Session token not found or invalid` error. + +#### + +​ + +Use AWS Management Console credentials + +The `aws login` command requires AWS CLI 2.32.0 or later. For the IAM policy your identity needs, see the [AWS instructions for `aws login`](<https://docs.aws.amazon.com/signin/latest/userguide/command-line-sign-in.html>). Run the command to sign in through your browser with your AWS Management Console credentials: aws login -[Learn more](<https://docs.aws.amazon.com/signin/latest/userguide/command-line-sign-in.html>) about `aws login`. **Option E: Amazon Bedrock API keys** +The session is valid for up to 12 hours, after which you run `aws login` again. + +#### + +​ + +Use an Amazon Bedrock API key + +An Amazon Bedrock API key is a bearer token that authenticates your requests in place of AWS credentials. AWS issues [two types of key](<https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html>): + + * **Short-term keys** : last up to 12 hours. AWS prefers them over long-term keys for production environments. + * **Long-term keys** : last until an expiration date you set. AWS recommends them only for exploration. + +Export the key as `AWS_BEARER_TOKEN_BEDROCK`: export AWS_BEARER_TOKEN_BEDROCK=your-bedrock-api-key -Amazon Bedrock API keys provide a simpler authentication method without needing full AWS credentials. [Learn more about Amazon Bedrock API keys](<https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/>). +When `AWS_BEARER_TOKEN_BEDROCK` is set, Claude Code authenticates with the key and doesn’t resolve the credential chain, even if other AWS credentials are present. [Learn more about Amazon Bedrock API keys](<https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/>). #### @@ -102,7 +151,7 @@ Credential caching and resolution timeout -Claude Code resolves the AWS default credential provider chain once and keeps the resolved credentials in memory. It reuses them until five minutes before they expire, or for one hour when they carry no expiration, so an SSO-backed profile requests credentials from IAM Identity Center about once per credential lifetime. A credential error from the API clears the cache, and the retry resolves fresh credentials. Requires Claude Code v2.1.207 or later. The cache covers every credential option above except an Amazon Bedrock API key, which doesn’t use the provider chain. To resolve the chain on every request instead, set [`CLAUDE_CODE_SKIP_AWS_CRED_CACHE=1`](</docs/en/env-vars>). Each resolve of the chain times out after 60 seconds. If a step in the chain stalls, for example a `credential_process` helper that waits for input it can’t receive, the request fails with [`AWS default-chain credential resolve timed out`](</docs/en/errors#aws-default-chain-credential-resolve-timed-out>). If your chain runs an interactive sign-in that legitimately needs longer, such as browser-based SSO with MFA through a wrapper like `aws-vault`, raise the limit in milliseconds with [`CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS`](</docs/en/env-vars>). Before v2.1.207, a stalled credential resolution left the request waiting indefinitely. Except when you authenticate with an Amazon Bedrock API key, the setup wizard applies the same limit to each AWS call it makes while verifying your credentials, and to the credential lookup before each model check. During credential verification, a check that exceeds it fails with [`Timed out after 60s waiting for AWS`](</docs/en/errors#bedrock-setup-verification-timed-out-waiting-for-aws>). +Claude Code resolves the AWS default credential provider chain once and keeps the resolved credentials in memory. It reuses them until five minutes before they expire, or for one hour when they carry no expiration, so an SSO-backed profile requests credentials from IAM Identity Center about once per credential lifetime. A credential error from the API clears the cache, and the retry resolves fresh credentials. Requires Claude Code v2.1.207 or later. The cache covers every credential method listed at the start of this step except an Amazon Bedrock API key, which doesn’t use the provider chain. To resolve the chain on every request instead, set [`CLAUDE_CODE_SKIP_AWS_CRED_CACHE=1`](</docs/en/env-vars>). The resolve that fills the cache times out after 60 seconds. If a step in the chain stalls, for example a `credential_process` helper that waits for input it can’t receive, the request fails with [`AWS default-chain credential resolve timed out`](</docs/en/errors#aws-default-chain-credential-resolve-timed-out>). If your chain runs an interactive sign-in that legitimately needs longer, such as browser-based SSO with MFA through a wrapper like `aws-vault`, raise the limit in milliseconds with [`CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS`](</docs/en/env-vars>). With `CLAUDE_CODE_SKIP_AWS_CRED_CACHE=1` set, each API request resolves the chain without this limit. Except when you authenticate with an Amazon Bedrock API key, the setup wizard applies the same limit to each AWS call it makes while verifying your credentials, and to the credential lookup before each model check. During credential verification, a check that exceeds it fails with [`Timed out after 60s waiting for AWS`](</docs/en/errors#bedrock-setup-verification-timed-out-waiting-for-aws>). ####
modified Use the mods API View current →
--- a/api.md +++ b/api.md @@ -58,6 +58,8 @@ }) When you ask about a ticket, Claude can call `mcp__my-mod__ticket` with its id. The second hook fetches the ticket and returns the response body, which Claude reads as the tool’s result. When the server answers with an error status, Claude reads `Lookup failed with status` and the number. + +When [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>) defers a registered tool, Claude sees its name but not its description until it searches for it. If Claude should consider the tool on every turn, add [`isDeferred: false`](</docs/en/plugins/mods/reference#tools>) to the registration to [load the full tool upfront](</docs/en/mcp#exempt-a-server-from-deferral>). The field requires Claude Code v2.1.293 or later, and earlier versions ignore it. ## @@ -186,7 +188,10 @@ * **`$.fs.list`** : returns one directory’s entries as `{ name, kind, size, isLink }` and isn’t recursive * **`$.process.run`** : takes an argument list and uses no shell. It resolves to `{ exitCode, stdout, stderr }` whatever the exit code. It rejects if the program can’t start or is still running at the timeout, which is 30 seconds by default, so wrap it in `try` and `catch`. -Every one of these calls is itself an event, named for its namespace and method without the `$.`, such as `fs.read` for `$.fs.read`. A mod [earlier in the chain](</docs/en/plugins/mods/events#the-order-mods-run-in>) can observe, rewrite, or refuse your call, which is how an organization restricts what mods reach. +Every one of these calls is itself an event, named for its namespace and method without the `$.`, such as `fs.read` for `$.fs.read`. A mod [earlier in the chain](</docs/en/plugins/mods/events#the-order-mods-run-in>) can observe, rewrite, or refuse your call, which is how an organization restricts what mods reach. A mod can refuse your `$.process.spawn` call after the command has produced output or exited, and nothing the command did is undone. The call then rejects with a message that ends with one of these strings and the refusing mod’s reason: + + * **`$.process.spawn started, and a plugin withheld its result:`** : the refusing mod hadn’t read the command’s output to the end. Claude Code stops the command if it’s still running. + * **`$.process.spawn ran, and a plugin withheld its result:`** : the refusing mod had read the command’s output to the end, so the command had exited ##
modified Authentication View current →
--- a/authentication.md +++ b/authentication.md @@ -6,7 +6,7 @@ Log in to Claude Code -After [installing Claude Code](</docs/en/setup#install-claude-code>), run `claude` in your terminal. On first launch, Claude Code opens a browser window for you to log in. If you’ve set the `ANTHROPIC_API_KEY` environment variable, Claude Code skips the login prompt and asks you to approve the key instead. If the browser doesn’t open automatically, press `c` to copy the login URL to your clipboard, then paste it into your browser. If your browser shows a login code instead of redirecting back after you sign in, paste it into the terminal at the `Paste code here if prompted` prompt. This happens when the browser can’t reach Claude Code’s local callback server, which is common in WSL2, SSH sessions, and containers. When login completes, the terminal shows `Login successful` and prompts you to press `Enter` to continue. You can authenticate with any of these account types: +After [installing Claude Code](</docs/en/setup#install-claude-code>), run `claude` in your terminal. On first launch, Claude Code opens a browser window for you to log in. If you’ve set the `ANTHROPIC_API_KEY` environment variable and you approve the key when Claude Code asks whether to use it, Claude Code skips the login prompt. If the browser doesn’t open automatically, press `c` to copy the login URL to your clipboard, then paste it into your browser. If your browser shows a login code instead of redirecting back after you sign in, paste it into the terminal at the `Paste code here if prompted` prompt. This happens when the browser can’t reach Claude Code’s local callback server, which is common in WSL2, SSH sessions, and containers. When login completes, the terminal shows `Login successful` and prompts you to press `Enter` to continue. You can authenticate with any of these account types: * **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.
modified Claude Code changelog View current →
--- a/changelog.md +++ b/changelog.md @@ -1,4 +1,76 @@ This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Run `claude --version` to check your installed version. + +​ + +2.1.294 + +October 8, 2026 + + * Fixed `prompt` and `agent` hooks written as instructions (such as “Block commands that…”) allowing what they should block + * Improved how `prompt` hooks on Stop and SubagentStop written as instructions (such as “Carry on if the build is broken”) are judged, so Claude is less likely to stop early + +​ + +2.1.293 + +October 7, 2026 + + * Added Claude Haiku 5.5 (`claude-haiku-5-5`), now the default Haiku model on the Anthropic API — 1M context, 0.10/0.10/0.10/0.50 per Mtok (0.50/0.50/0.50/2.50 for prompts over 100K) + * Added `agentType` to the `subagentStatusLine` payload, so scripts can tell custom subagent types apart + * Added `isDeferred` to `$.tool.register` for mods: `false` lists the tool’s schema in the prompt from the start instead of behind tool search + * Fixed Claude sometimes treating its own last actions before a context compaction as done after it, and retracting or redoing finished work + * Fixed a memory leak where an HTTP MCP connection kept every request it had sent until it closed + * Fixed a message sent while Claude was working being lost when `←` moved the session to the background; if a queued message can’t move, `←` now stays put and says so + * Fixed `/model` effort ←/→ wrapping past the highest or lowest level, which could accidentally save Low as a model’s default effort + * Fixed `/tui` disconnecting Claude in Chrome in a session started with `--chrome`, and ignoring `--no-chrome` + * Fixed Claude being told to continue or message subagents with `SendMessage` in sessions, including resumed ones, where a host, a permission rule or a `--tools` list removed that tool + * Fixed subagents and `--agent` sessions being told a built-in tool was disabled for the whole session when only their own tool list left it out + * Fixed a claude.ai-synced skill’s edited description sometimes not reaching the model until a new conversation or `/clear` + * Fixed `claude logs`, `stop`, `kill`, `rm` and `claude daemon status`, `stop`, `uninstall` sometimes signing you out when your login had expired or was about to + * Fixed the footer’s agents count disappearing after a momentary failure to read the sessions folder (for example, too many open files) + * Fixed a custom agent named `worker` being shown as “Agent” when it starts, and the agent detail dialog’s title losing the agent type once the agent finishes + * Fixed the Artifact tool’s transcript row briefly reading `Artifact("(unprintable path)")` while a publish call was still streaming in + * Fixed the `/ultrareview` upload on Linux wrongly refusing some repositories, such as one inside another checkout, over a settings file that “could not be parsed” while a sandboxed command was running + * Fixed the `/ultrareview` upload’s refusal over split-index files advising a git command that could leave git unable to read its index + * Fixed replies in very long Remote Control and cloud sessions that could still appear a block at a time instead of streaming in + * Fixed Remote Control uploading a session’s starting history again after every credential recovery + * Fixed PushNotification reporting “Remote Control inactive” in sessions started with `claude remote-control` + * Fixed a mod’s hooks on `classic.*` events being skipped while the plugin hooks worker restarts, which left settings hooks to answer without them + * Fixed `claude plugin test` failing for mods that call `$.session.append`; tests can read the appended rows back with the new `mock.session` + * Fixed `claude plugin eval` refusing every Bash-granting run on Macs with Docker Desktop (links under `~/.docker/bin`); the refusal now names which part of a credential store held the link + * Fixed the Claude apps gateway refusing to start when a `desktop` policy sets Claude Desktop’s built-in browser keys, such as `builtinBrowserEnabled` + * Fixed `claude agents` offering bypass permissions that background sessions then ignored when consent was saved only in `.claude/settings.local.json` or a `--settings` file; it now asks for consent first, and a session that ignores bypass shows a short notice that stays + * Fixed `←` backgrounding a session after 10 seconds while the prompt held unsent text (it now cancels the move) or a question was waiting for your answer + * Fixed Esc, or No without feedback, on a permission prompt not stopping the turn when `←` had just been pressed to move the session to the background + * Fixed the agents view briefly replacing the session list with placeholder rows when the sessions folder could not be read (for example, too many open files) + * Fixed path-scoped rules and nested CLAUDE.md files not loading when Claude views a file with a single-file cat, head, tail, sed -n or grep command in the Bash tool instead of the Read tool + * Fixed pasted text that begins and ends with the same words sometimes being sent to Claude as if it had been typed + * Fixed a skill name in pasted text being treated as typed when an accent typed or pasted right after the paste merged into its last letter + * Fixed `/feedback` returning to the drafts list after Ctrl+O or Ctrl+Z while a report was sending, leaving the send impossible to cancel + * Fixed `claude purge` stopping silently (exit 0, or a hang in a terminal) when a file or folder could not be deleted; it now deletes the rest, lists what it could not delete, and exits 1 + * Fixed keybindings.json checks: a lone ” ” (space key) is no longer reported as an error, and keys like “ctrl+ k” now get a warning + * Fixed vim mode `>>` and `<<` on a line of only spaces leaving the cursor past the end of the line, where a following `x` deleted nothing + * Fixed vim mode: after deleting whole lines in Visual mode (`V` then `d`) the cursor lands on the first non-blank, and `.` after it acts on the cursor’s line + * Windows: Fixed stopping a status line, hook, or shell command sometimes terminating an unrelated process that had been given the same process ID + * Reverted the auto mode denial message change from 2.1.281 that told Claude a denial covers the outcome, not only the exact command + * Reverted the 2.1.290 fix for cloud sessions staying asleep after a container restart lost a pending `/loop` wakeup or scheduled task; Claude is no longer told, and the session stays asleep + * Improved startup for Team and Enterprise organizations: policy and managed settings are fetched earlier, and a stalled request is retried after 3 seconds + * Improved Claude in Chrome: fewer page actions are refused when the browser is slow to report its tabs + * Improved the Claude in Chrome message in cloud sessions when the browser can’t be reached: if you belong to more than one organization, it now says the extension must be signed in to the same one, and how to change that + * Improved the Bash edit diff note to say the listed files changed while the command ran, which can include writes by other processes + * Improved artifacts: Claude pins libraries to exact versions two weeks old or older + * Changed claude.ai skill syncing to check for changes about every 40 minutes, instead of every 10, while no session is in use + * Changed the order of agent lists and of MCP servers announced to the model: names with non-ASCII characters now sort after ASCII names + * Changed OpenTelemetry `claude_code.at_mention` logging to emit at most 100 agent and 100 MCP-resource events each time a prompt is read + * Self-hosted runner: Changed the orchestrator to sleep 4 to 6 seconds between polls instead of a constant 5, so several replicas for one environment stop polling at the same moment + * [Claude Tag] Fixed Claude in Slack saying a workspace isn’t set up in Enterprise Grid channels shared across workspaces when Slack labels a message with a workspace that isn’t connected + * [Claude Tag] Fixed Claude in Slack stopping mid-task in a channel when an admin changed the channel’s connectors, plugins, skills or rules; the change now applies once Claude finishes + * [Claude Tag] Fixed asking Claude in Slack to run a thread’s routine now with extra notes starting a separate run that couldn’t post back; the run now continues in that thread + * [Claude Tag] Fixed an access bundle’s Add a connector dialog in Claude Tag admin settings showing every Google connector as connected after one Google sign-in + * [Claude Tag] Improved Claude Tag admin settings to list an Enterprise Grid that isn’t connected yet, with a Connect button + * [Claude Tag] Changed Claude in Slack to join announcement channels, where only admins can post, without posting its intro + * [Claude Tag] Changed the limit on channel rules in Claude Tag admin settings from 20 to 50 for each workspace and for the organization-wide Slack page + * [Code Review] Improved Code Review’s Add a repository dialog to list each repository that couldn’t be added and why, such as missing GitHub write access ​
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 @@ Allow a gateway on public address space you own -Some organizations number their internal network from a public IPv4 block they own, such as a carrier’s own address space or a legacy `/8`, so their gateway can’t have a private address. List those blocks in the `gatewayInternalNetworks` managed setting. `/login` then accepts a gateway inside a listed block when the developer’s machine connects to it from an address inside the same block. This requires Claude Code v2.1.268 or later on the developer machine; earlier versions ignore the key and apply the private-address rule. +Some organizations number their internal network from a public IPv4 block they own, such as a carrier’s own address space or a legacy `/8`, so their gateway has no private address. List those blocks in the `gatewayInternalNetworks` managed setting. `/login` then accepts a gateway inside a listed block when the developer’s machine connects to it from an address inside the same block. This requires Claude Code v2.1.268 or later on the developer machine; earlier versions ignore the key and apply the private-address rule. `gatewayInternalNetworks` is for internal networks that happen to be numbered from public address space. It doesn’t make it safe to expose a gateway to the internet: a trusted gateway can push settings that run commands on developer machines.Keep the gateway unreachable from outside your network with your firewall or load balancer rules. Set the gateway’s [`access_control.allow_cidrs`](</docs/en/claude-apps-gateway-config#http-tuning>) to the same blocks you declare here, so the gateway itself refuses clients from anywhere else. Behind a load balancer or ingress, set `listen.trusted_proxies` to that front end as well, because the gateway otherwise matches `allow_cidrs` against the front end’s own address rather than the developer’s.
modified Claude apps gateway configuration View current →
--- a/claude-apps-gateway-config.md +++ b/claude-apps-gateway-config.md @@ -800,8 +800,10 @@ The gateway keeps no user directory of its own. It authorizes each request from the user’s IdP token, reading group membership from the token’s `groups` claim and evaluating policies against it. There is no roster to enumerate and no accounts to pre-create, and therefore no SCIM endpoint, because there is nothing for SCIM to sync into.Run user and group lifecycle management at the source of truth, which is your IdP’s native SCIM provisioning or a dedicated identity-governance platform. Membership and deprovisioning governed there flow into the gateway automatically through the token. If you want SCIM provisioning of Claude accounts themselves, that is a [Claude for Enterprise](</docs/en/admin-setup>) capability.Two propagation clocks apply: - * **Policy contents** : editing a policy and redeploying reaches connected clients on their next managed-settings poll, within an hour, apart from the [changes that apply only at the next launch](</docs/en/server-managed-settings#fetch-and-caching-behavior>) + * **Policy contents** : editing a policy and redeploying reaches connected Claude Code clients on their next managed-settings poll, within an hour, apart from the [changes that apply only at the next launch](</docs/en/server-managed-settings#fetch-and-caching-behavior>) * **Group membership** : changing a user’s group membership changes which policy matches them. This takes effect on the next session re-mint, meaning the next silent refresh, bounded by `session.ttl_hours`. + +Claude Desktop follows its own schedule. #### @@ -938,14 +940,22 @@ Requires Claude Code v2.1.203 or later on the gateway server, and an explicit opt-in: `/user/bootstrap` returns 404 unless the policy matching the user carries a `desktop` key. An empty `desktop: {}` opts a policy in, and a `desktop` key on the `match: {}` base layer opts in every policy that inherits it. The audit log records each request as `desktop_bootstrap.serve` or `desktop_bootstrap.denied`. -The gateway derives much of the response from the matched policy’s `cli` block and from top-level gateway config: +If you don’t deploy Claude Desktop, leave `desktop` out of your policies entirely; the gateway then returns 404 from `/user/bootstrap` for every user. + +##### Settings the gateway derives for Claude Desktop + +The gateway derives much of the bootstrap response from the matched policy’s `cli` block and from top-level gateway config: * The model list, from `availableModels`. Extended context in Claude Desktop covers each model’s 1M context option * Disabled tools, from bare tool-name `permissions.deny` entries. If you set `disabledBuiltinTools` in the policy’s `desktop` block, the gateway serves the union of your value and the derived list, so you can disable more tools this way but can’t re-enable one you disabled through `permissions.deny` * The egress allowlist, from `sandbox.network.allowedDomains`. If you set `coworkEgressAllowedHosts` in the policy’s `desktop` block, the gateway uses that value instead of the derived list * An OTLP endpoint that points at the gateway itself, and the signed-in user’s identity attributes. The gateway relays the exports it receives at that endpoint to your `forward_to` destinations. It includes the endpoint and the attributes when you set both `telemetry.forward_to` and `listen.public_url`. Claude Desktop exports every signal with one encoding: `http/protobuf`, or `http/json` when you set `OTEL_EXPORTER_OTLP_PROTOCOL` or one of its per-signal variants to `http/json` in the policy’s `env`. Before Claude Code v2.1.261 on the gateway server, the response set `http/json` regardless, so a collector that accepts only protobuf rejected Claude Desktop’s exports -To set `disabledBuiltinTools`, `coworkEgressAllowedHosts`, or Claude Desktop’s own `managedMcpServers` setting in a policy’s `desktop` block, you need Claude Code v2.1.232 or later on the gateway server. Claude Desktop’s `managedMcpServers` takes an array value rather than an object. The gateway omits keys with no Claude Desktop equivalent, such as `hooks` and scoped permission rules like `Bash(npm *)`, from the bootstrap response. Add the optional `desktop` block alongside `cli` to set Claude Desktop settings directly. Write settings from Claude Desktop’s [managed configuration reference](<https://claude.com/docs/third-party/claude-desktop/configuration>) as flat key names. Leave out keys Claude Desktop reads only from MDM or local files, such as `bootstrapUrl`; the gateway rejects them at boot. Before v2.1.232, the gateway accepted a fixed list of 11 feature-gate keys, such as `chatTabEnabled` and `disableAutoUpdates`, and rejected every other key at boot. Before v2.1.227, the gateway also rejected `chatTabEnabled` and `chatAdvancedFileAnalysisEnabled` at boot. +To set `disabledBuiltinTools`, `coworkEgressAllowedHosts`, or Claude Desktop’s own `managedMcpServers` setting in a policy’s `desktop` block, you need Claude Code v2.1.232 or later on the gateway server. Claude Desktop’s `managedMcpServers` takes an array value rather than an object. The gateway omits keys with no Claude Desktop equivalent, such as `hooks` and scoped permission rules like `Bash(npm *)`, from the bootstrap response. + +##### Set Claude Desktop settings directly + +Add the optional `desktop` block alongside `cli` to set Claude Desktop settings directly. Write settings from Claude Desktop’s [managed configuration reference](<https://claude.com/docs/third-party/claude-desktop/configuration>) as flat key names. Leave out keys Claude Desktop reads only from MDM or local files, such as `bootstrapUrl`; the gateway rejects them at boot. This example sets three Claude Desktop keys for the `eng-contractors` group alongside its `cli` settings: managed: policies: @@ -958,19 +968,40 @@ disableAutoUpdates: true banner: { text: "Contractor build: internal use only" } -Every key is optional; Claude Desktop applies its own default for any key you omit. The gateway validates each `desktop` block at boot against the configuration schema Claude Desktop itself uses, so a mistake surfaces at gateway start as an error naming the key rather than reaching every connected desktop. The gateway fails at boot when a block contains: +Every key is optional; Claude Desktop applies its own default for any key you omit. + +##### What the gateway rejects at boot + +The gateway validates each `desktop` block at boot against the configuration schema Claude Desktop itself uses, so a mistake surfaces at gateway start as an error naming the key rather than reaching every connected desktop. The gateway fails at boot when a block contains: * An unknown key * A recognized key whose value Claude Desktop would reject or silently drop, such as an empty value or a misspelled sub-key inside a nested entry. Before v2.1.260, the gateway silently dropped a misspelled field inside a nested object of a `managedMcpServers` or `orgPluginSettings` entry instead of failing at boot. * A key the gateway computes itself: the inference connection, the model list, and the OTLP relay. Configure those through `upstreams`, `models`, and the `telemetry` section’s `forward_to`. * A legacy alias of a current key. In the boot error, the gateway names the canonical key to write. -If you use a deprecated value or entry shape, such as a `managedMcpServers` entry without `transport`, the gateway starts and logs a warning that names the replacement. The gateway validates a `desktop` block against the schema bundled with its installed version, as it does the `cli` block. To deliver a setting introduced by a newer Claude Desktop release, upgrade the gateway first. For example, `userPluginMarketplacesEnabled` and `userPluginUploadsEnabled` need Claude Code v2.1.260 or later on the gateway server and Claude Desktop 1.37937.0 or later on members’ machines. `blockReadsOutsideWorkingDirectories`, `disableBypassPermissionsMode`, `configRecheckIntervalMinutes`, and `sshClientPath` need Claude Code v2.1.281 or later on the gateway server. So do the `required` value of `microsoftAuthBroker` and the `continuousAccessEvaluation` field of a Microsoft 365 `managedMcpServers` entry. Claude Desktop releases that predate the `required` value read it as `disabled`, so set `required` only after every member’s Claude Desktop supports it. Claude Desktop’s [managed configuration reference](<https://claude.com/docs/third-party/claude-desktop/configuration>) lists the release that first reads each key. If you set `orgPluginSettings` in a policy’s `desktop` block, the gateway serves it in the array form that Claude Desktop 1.15200.0 and later reads. Older desktops ignore the array and enforce no plugin tool policy, so update members to 1.15200.0 or later before you rely on it. The gateway fills in keys a policy’s `desktop` block doesn’t set from the `match: {}` catch-all’s `desktop` block, the same way it fills in a policy’s `cli` block from the base. If you set `disabledBuiltinTools` or `builtinToolPolicy` in both the base and a role policy, the gateway keeps the base’s restriction: +If you use a deprecated value or entry shape, such as a `managedMcpServers` entry without `transport`, the gateway starts and logs a warning that names the replacement. Before v2.1.232, the gateway accepted a fixed list of 11 feature-gate keys, such as `chatTabEnabled` and `disableAutoUpdates`, and rejected every other key at boot. Before v2.1.227, the gateway also rejected `chatTabEnabled` and `chatAdvancedFileAnalysisEnabled` at boot. + +##### Keys that need a later gateway or Claude Desktop version + +The gateway validates a `desktop` block against the schema bundled with its installed version, as it does the `cli` block. To deliver a setting introduced by a newer Claude Desktop release, upgrade the gateway first. For example, `userPluginMarketplacesEnabled` and `userPluginUploadsEnabled` need Claude Code v2.1.260 or later on the gateway server and Claude Desktop 1.37937.0 or later on members’ machines. `blockReadsOutsideWorkingDirectories`, `disableBypassPermissionsMode`, `configRecheckIntervalMinutes`, and `sshClientPath` need Claude Code v2.1.281 or later on the gateway server. So do the `required` value of `microsoftAuthBroker` and the `continuousAccessEvaluation` field of a Microsoft 365 `managedMcpServers` entry. Claude Desktop releases that predate the `required` value read it as `disabled`, so set `required` only after every member’s Claude Desktop supports it. Claude Desktop’s [managed configuration reference](<https://claude.com/docs/third-party/claude-desktop/configuration>) lists the release that first reads each key. If you set `orgPluginSettings` in a policy’s `desktop` block, the gateway serves it in the array form that Claude Desktop 1.15200.0 and later reads. Older desktops ignore the array and enforce no plugin tool policy, so update members to 1.15200.0 or later before you rely on it. + +##### How a role policy inherits the base `desktop` block + +The gateway fills in keys a policy’s `desktop` block doesn’t set from the `match: {}` catch-all’s `desktop` block, the same way it fills in a policy’s `cli` block from the base. If you set `disabledBuiltinTools` or `builtinToolPolicy` in both the base and a role policy, the gateway keeps the base’s restriction: * `disabledBuiltinTools`: the gateway uses the union of the base’s list and the policy’s list * `builtinToolPolicy`: if you set a tool to a value other than `allow` in the base, the gateway keeps that value even if you set `allow` for the same tool in a role policy -For every other key, if you set it in the role policy, the gateway uses the role policy’s value. The gateway replaces an array or a nested object such as `banner` whole, so if you set `banner.text` in a role policy, the gateway drops the base’s `banner.backgroundColor`. If you don’t deploy Claude Desktop, leave `desktop` out of your policies entirely; the gateway then returns 404 from `/user/bootstrap` for every user. +For every other key, if you set it in the role policy, the gateway uses the role policy’s value. The gateway replaces an array or a nested object such as `banner` whole, so if you set `banner.text` in a role policy, the gateway drops the base’s `banner.backgroundColor`. + +##### When a policy change reaches Claude Desktop + +After you redeploy the gateway with a changed policy, Claude Desktop applies most settings only when it next starts: + + * **Closed** : Claude Desktop fetches the bootstrap response when it starts, so the change applies from the next start + * **Open** : Claude Desktop checks for a changed response every 10 minutes by default and applies a few settings without a restart. For the rest, such as [`skillCreationEnabled`](<https://claude.com/docs/third-party/claude-desktop/configuration#skillcreationenabled>), the user sees a **Relaunch Claude Desktop** card in the sidebar and keeps the previous configuration until they restart the app. After 24 hours by default, Claude Desktop shows a restart dialog and restarts on its own after 2 minutes of inactivity + +To shorten the 24 hours, set [`relaunchEnforcementHours`](<https://claude.com/docs/third-party/claude-desktop/configuration#relaunchenforcementhours>) in the policy’s `desktop` block. You need Claude Code v2.1.260 or later on the gateway server and Claude Desktop 1.40609.0 or later on members’ machines. With `0`, the dialog appears as soon as Claude Desktop finds the change. ####
modified Claude apps gateway deployment and operations View current →
--- a/claude-apps-gateway-deploy.md +++ b/claude-apps-gateway-deploy.md @@ -1,3 +1,5 @@ +**Plan your gateway’s network first.** At sign-in, Claude Code refuses a Claude apps gateway whose hostname resolves to a public IP address, even one the internet can’t reach.A Claude apps gateway can push settings to users’ machines, including hooks that run shell commands. The check helps keep users from accidentally signing in to a malicious gateway on the public internet. Keep your own gateway off the internet too.Choose the gateway’s address before you choose where it runs. Usually that’s a private address that users reach on your internal network or over a VPN. If your internal network uses public IPv4 ranges, you can list one range that holds both the gateway and your users’ machines. Claude Code takes that match as a sign that the gateway is on your internal network. See Choose an address for the gateway. If neither fits your network, contact your Anthropic account team. + This page covers the operational side of running [Claude apps gateway](</docs/en/claude-apps-gateway>): registering an OAuth client in your identity provider (IdP), deploying the gateway as a container, and running it day-to-day. For every option in the `gateway.yaml` file the gateway reads at boot, see the [Configuration reference](</docs/en/claude-apps-gateway-config>). A production deployment follows four steps in order, and the sections below match them. The first two are where you make choices; the second two are reference material to consult once it’s running. 1. Set up your identity provider: register the OAuth client and check the per-IdP notes for Okta, Entra, and Google @@ -7,8 +9,6 @@ If a sign-in or boot fails along the way, go straight to Troubleshooting, which is keyed on the error you see. -**Deploy on your private network.** Claude Code only connects to a gateway whose address is private. This is a security guard, because a trusted gateway can push settings that run commands on developer machines. Put the gateway you deploy behind an internal load balancer or VPN and give it a hostname that resolves to private IPs only. If your internal network is numbered from public IPv4 space your organization owns, see [Allow a gateway on public address space you own](</docs/en/claude-apps-gateway#allow-a-gateway-on-public-address-space-you-own>). - ## ​ @@ -35,7 +35,7 @@ Deployment -The gateway is a single stateless Linux binary that coordinates through Postgres, so deploy it the way you deploy any other stateless service in your environment. Keep it inside your network, where your developers and IdP can reach it over HTTPS, and treat it like any service holding a production credential. A few decisions shape the deployment beyond where it runs: +The gateway is a single stateless Linux binary that coordinates through Postgres, so deploy it the way you deploy any other stateless service in your environment. Keep it inside your network, where your developers can reach it over HTTPS and it can reach your IdP, and treat it like any service holding a production credential. A few decisions shape the deployment beyond where it runs: * **Cost** : no separate license or per-seat fee. The gateway is part of the `claude` binary, so you pay for inference through your existing commitment, plus the compute it runs on. * **Bypass** : the gateway doesn’t enforce that the only route to a model goes through it. A developer with their own credential can still call the provider directly, so closing that path is a network policy decision, for example blocking egress to `api.anthropic.com` except from the gateway. Blocking that egress also breaks the [WebFetch domain safety check](</docs/en/data-usage#webfetch-domain-safety-check>), which calls `api.anthropic.com` from each developer’s machine. Set `skipWebFetchPreflight: true` in the managed policy to disable it. @@ -48,6 +48,19 @@ * On `provider: anthropic`, the gateway passes the response through unchanged, including the Anthropic API’s own pings. A default such as the ALB’s 60 seconds is enough to keep a quiet stream open. The [AWS worked example](</docs/en/claude-apps-gateway-on-aws#troubleshooting>) raises it to an hour anyway, and its troubleshooting row covers gateways older than v2.1.229, which sent nothing during quiet periods on the upstreams that now get pings. + +### + +​ + +Choose an address for the gateway + +Claude Code accepts a gateway’s address in one of two ways: + + * **Private address** : put the gateway behind an internal load balancer or VPN, with a hostname that resolves only to private addresses, such as RFC 1918 or CGNAT `100.64.0.0/10`. Users’ machines can be on any address. The [private-network prerequisite](</docs/en/claude-apps-gateway#prerequisites>) lists the accepted ranges. + * **Declared block** : if your internal network uses public IPv4 space your organization owns, list the block in the `gatewayInternalNetworks` managed setting. The gateway and the user’s machine must both be in that block. See [Allow a gateway on public address space you own](</docs/en/claude-apps-gateway#allow-a-gateway-on-public-address-space-you-own>). + +If no single block contains both, give the gateway a private address instead. ### @@ -334,7 +347,7 @@ Troubleshooting -For questions and feedback, use [Claude Code support](<https://support.claude.com/en/collections/14445694-claude-code>), or open an issue on the [Claude Code GitHub repository](<https://github.com/anthropics/claude-code/issues>). When reporting a problem, include: +For questions and feedback, use [Claude Code support](<https://support.claude.com/en/collections/14445694-claude-code>), or open an issue on the [Claude Code GitHub repository](<https://github.com/anthropics/claude-code/issues>). You can also contact your Anthropic account team. When reporting a problem, include: * **Gateway issue** : the gateway’s stderr for the relevant window, your `gateway.yaml` with secrets redacted, the gateway version, shown on the landing page at `/` and in the `x-cc-gateway-version` response header on `/managed/settings`, and what changed recently * **Login issue** : the developer runs `claude --debug-file ./claude-debug.txt`, reproduces, and sends that file plus the gateway’s audit log for the same window @@ -353,7 +366,7 @@ CLI `/login`: `The gateway is limiting sign-in attempts right now`, or `Request failed with status code 429` on older versions. The `/device` page may show `Too many attempts` to developers who haven’t tried before| The per-IP sign-in rate limit was reached. Either `listen.trusted_proxies` doesn’t cover the load balancer, so every developer shares its address, or many developers share a NAT or VPN egress address. Audit events with `result: rate_limited` show the same one or few `client_ip` values.| Set `listen.trusted_proxies` to the load balancer’s source ranges first, then raise `rate_limits` if developers still share addresses. See Large rollouts. CLI `/login`: `Gateway hosts must be on your organization's private network; <host> resolves to the public (or unrecognized) address <ip>`| The gateway hostname resolves to at least one public IP address. Claude Code checks each resolved address and requires every one to be private. A common cause is a dual-stack name where one family resolves to a public address, including AWS internal dual-stack load balancers, which return public-range AAAA addresses.| Have the gateway name resolve only to private addresses on developer machines. For a dual-stack name, drop the public-range record or serve a separate internal-only DNS name. See the [private-network prerequisite](</docs/en/claude-apps-gateway#prerequisites>). If the address is public space your organization owns and uses internally, [declare that block](</docs/en/claude-apps-gateway#allow-a-gateway-on-public-address-space-you-own>) instead. CLI `/login`: `Gateway login would go through proxy <proxy>, which is not on a private network`| An `HTTPS_PROXY` or `HTTP_PROXY` applies to the gateway host and the proxy’s hostname resolves to a public address. A proxy whose host resolves only to private addresses is allowed and doesn’t trigger this error| Add the gateway host to `NO_PROXY` on the developer’s machine so the connection is direct, or use a proxy whose hostname resolves to private addresses. The message names the exact `NO_PROXY` entry to add -CLI `/login`: `Claude Code only signs in to <host> from inside its declared network <block> (managed settings), and this machine is connecting from <ip>, outside it`| The gateway is on a block declared in [`gatewayInternalNetworks`](</docs/en/claude-apps-gateway#allow-a-gateway-on-public-address-space-you-own>), and the developer’s machine reached it from an address outside that block: a VPN address pool, a container or WSL2 NAT segment, or a network that isn’t yours| Have the developer run `/login` from the host OS on your network. If the address shown is also your organization’s own public space, replace the gateway’s entry with a block that covers both, up to `/8`; a second, overlapping entry is refused +CLI `/login`: `Claude Code only signs in to <host> from inside its declared network <block> (managed settings), and this machine is connecting from <ip>, outside it`| The gateway is on a block declared in [`gatewayInternalNetworks`](</docs/en/claude-apps-gateway#allow-a-gateway-on-public-address-space-you-own>), and the developer’s machine reached it from an address outside that block: a VPN address pool, a container or WSL2 NAT segment, or a network that isn’t yours| Have the developer run `/login` from the host OS on your network. If the address shown is also your organization’s own public space, replace the gateway’s entry with a block that covers both, up to `/8`; a second, overlapping entry is refused. If no block covers both, see Choose an address for the gateway CLI `/login`: `Every address for gateway host <host> must be inside its declared network <block>, and it also resolves to <ip>`| The gateway’s name resolves to an address outside the block declared in [`gatewayInternalNetworks`](</docs/en/claude-apps-gateway#allow-a-gateway-on-public-address-space-you-own>): a second site, or an IPv6 record on a dual-stack name. Under a declared block every record must be inside that one IPv4 block, private and IPv6 addresses included| Publish only records inside the block for the gateway name on developer machines, or serve a separate internal-only name CLI `/login`: `<host> is on the declared network <block>, which Claude Code checks over a direct connection, not through an HTTP proxy`| An `HTTPS_PROXY` or `HTTP_PROXY` applies to a gateway on a declared block| On the developer’s machine, add the `NO_PROXY` entry the message names CLI `/login`: a message starting `gatewayInternalNetworks in managed settings`| The value breaks one of the [validation rules](</docs/en/claude-apps-gateway#allow-a-gateway-on-public-address-space-you-own>), and the message names which. Until you fix it, Claude Code refuses every new gateway `/login` on the machine, gateways on private addresses included; existing sign-ins keep working| In the managed settings source you deploy, correct the entry the message names, then rerun `/login`
modified Use Claude Code in the cloud View current →
--- a/claude-code-on-the-web.md +++ b/claude-code-on-the-web.md @@ -380,7 +380,7 @@ * **Isolated virtual machines** : each session runs in an isolated, Anthropic-managed VM. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own infrastructure instead, where isolation is your deployment’s responsibility * **Network access controls** : in Anthropic-hosted environments, network access is limited by default and can be disabled. See [Network access](</docs/en/cloud-environments#network-access>) for the access levels, the [default allowed domains](</docs/en/cloud-environments#default-allowed-domains>), and the traffic that doesn’t go through the allowlist. In a self-hosted environment, you restrict session egress at your own network boundary. When running with network access disabled, Claude Code can still communicate with the Anthropic API, which may allow data to exit the VM. * **Credential protection** : in Anthropic-hosted environments, git credentials and signing keys stay outside the sandbox, and a proxy authenticates on the session’s behalf with scoped credentials. In a self-hosted environment, your deployment supplies git credentials; see [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>) - * **API credentials** : in Anthropic-hosted environments on Pro and Max plans, keys you [add to a cloud environment](</docs/en/cloud-environments#add-api-credentials>) stay outside the sandbox the same way, attached to matching requests after they leave the session. A self-hosted environment doesn’t have API credentials, and Team and Enterprise plans don’t have them yet + * **Network secrets** : in Anthropic-hosted environments on Pro and Max plans, keys you [add to a cloud environment](</docs/en/cloud-environments#add-network-secrets>) stay outside the sandbox the same way, attached to matching requests after they leave the session. A self-hosted environment doesn’t have network secrets, and Team and Enterprise plans don’t have them yet * **Secure analysis** : code is analyzed and modified within the session’s isolated environment before creating PRs ##
modified Explore the .claude directory View current →
--- a/claude-directory.md +++ b/claude-directory.md @@ -18,7 +18,7 @@ File| Location| Purpose ---|---|--- -`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#security-keys-where-the-stricter-value-applies>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>). +`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that your own settings files and `--settings` values can’t override, apart from [narrow exceptions](</docs/en/settings#exceptions-to-managed-settings-precedence>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>). `CLAUDE.local.md`| Project root| Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to `.gitignore`. `AGENTS.md`| Project root, `.claude/`, or any directory| Project instructions you write for AI coding agents. Claude Code can [load it](</docs/en/memory#agents-md>) in place of a `CLAUDE.md`. Installed plugins| `~/.claude/plugins`| Cloned marketplaces, installed plugin versions, the `installed_plugins.json` install record, and per-plugin data, managed by `claude plugin` commands. Plugins [synced from your claude.ai account](</docs/en/plugins/loading#synced-plugins>) download into `~/.claude/plugins/synced/`. For a plugin installed from a marketplace [`command` source](</docs/en/plugins/marketplace-reference#command-plugin-source>) in link mode, Claude Code stores links here instead of a copy, and the plugin’s files stay in the directory the command prints. A `command` source requires Claude Code v2.1.229 or later. A plugin listed by relative path in a marketplace you added from a local path also [loads in place](</docs/en/plugins/loading#find-plugins-on-disk>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins/loading#find-plugins-on-disk>) for how orphaned versions are cleaned up. @@ -56,7 +56,7 @@ Several things can override what you put in these files: - * [Managed settings](</docs/en/server-managed-settings>) deployed by your organization take precedence over everything, apart from the [exceptions under Settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) + * [Managed settings](</docs/en/server-managed-settings>) deployed by your organization take precedence over every settings file and `--settings` value, apart from the [exceptions under Settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) * CLI flags like `--permission-mode` or `--settings` override `settings.json` for that session * Some environment variables take precedence over their equivalent setting, but this varies: check the [environment variables reference](</docs/en/env-vars>) for each one @@ -263,7 +263,7 @@ claude purge ~/work/my-repo --yes -Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. In a script, check the output rather than the exit status alone. A run that deletes everything in its plan ends with `Purged N item(s)`. Treat that line as the sign of success. The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. If anyone ran [`/heapdump`](</docs/en/troubleshooting#high-cpu-or-memory-usage>) on the machine, delete the `.heapsnapshot` files it wrote too. A heap snapshot contains the full conversation and any credentials the process held, and neither the retention sweep nor the purge touches it. You can also delete any of the application-data paths above by hand, apart from the state files to keep. New sessions are unaffected. The table below shows what you lose for past sessions. +Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. If anyone ran [`/heapdump`](</docs/en/troubleshooting#high-cpu-or-memory-usage>) on the machine, delete the `.heapsnapshot` files it wrote too. A heap snapshot contains the full conversation and any credentials the process held, and neither the retention sweep nor the purge touches it. You can also delete any of the application-data paths above by hand, apart from the state files to keep. New sessions are unaffected. The table below shows what you lose for past sessions. Delete| You lose ---|---
modified Claude Code on Claude Platform on AWS View current →
--- a/claude-platform-on-aws.md +++ b/claude-platform-on-aws.md @@ -27,7 +27,18 @@ 1\. Configure AWS credentials -Claude Code supports two authentication methods for Claude Platform on AWS. Choose the method that fits how your team manages access. **Option A: AWS credentials with SigV4** Claude Code signs requests with SigV4 using the standard AWS credential chain: environment variables, shared credentials in `~/.aws/credentials`, IAM roles, AWS SSO sessions, and any other sources the AWS SDK supports. For local use, log in with the AWS CLI before starting Claude Code. The example below uses an SSO profile, but any method that produces credentials in the standard locations works. +Claude Code supports two authentication methods for Claude Platform on AWS. Choose the method that fits how your team manages access: + + * AWS credentials with SigV4: authenticate as an IAM principal, with credentials from the standard AWS credential chain + * Workspace API key: authenticate with a long-lived key you generate in the AWS Console + +#### + +​ + +Use AWS credentials with SigV4 + +Claude Code signs requests with SigV4 using the standard AWS credential chain: environment variables, shared credentials in `~/.aws/credentials`, IAM roles, AWS SSO sessions, and any other sources the AWS SDK supports. For local use, log in with the AWS CLI before starting Claude Code. The example below uses an SSO profile, but any method that produces credentials in the standard locations works. aws sso login --profile my-profile export AWS_PROFILE=my-profile @@ -38,7 +49,15 @@ "awsAuthRefresh": "aws sso login --profile my-profile" } -Claude Code also runs this command at startup when it can’t validate your existing AWS credentials, and shows the command’s output in an `Authentication` panel until the login completes. With `awsAuthRefresh` configured, run `/login`, select **3rd-party platform** , then select **Claude Platform on AWS · refresh credentials** under **Using 3rd-party platforms**. Claude Code runs the configured command and re-reads your AWS credentials without a restart. **Option B: Workspace API key** A workspace API key is a long-lived secret, useful when you don’t want to manage federated AWS credentials. Generate one in the AWS Console under **Claude Platform on AWS → API keys** and set it as `ANTHROPIC_AWS_API_KEY`: +Claude Code also runs this command at startup when it can’t validate your existing AWS credentials, and shows the command’s output in an `Authentication` panel until the login completes. With `awsAuthRefresh` configured, run `/login`, select **3rd-party platform** , then select **Claude Platform on AWS · refresh credentials** under **Using 3rd-party platforms**. Claude Code runs the configured command and re-reads your AWS credentials without a restart. + +#### + +​ + +Use a workspace API key + +A workspace API key is a long-lived secret, useful when you don’t want to manage federated AWS credentials. Generate one in the AWS Console under **Claude Platform on AWS → API keys** and set it as `ANTHROPIC_AWS_API_KEY`: export ANTHROPIC_AWS_API_KEY=sk-ant-xxxxx
modified Let Claude coordinate ongoing work with Projects View current →
--- a/claude-projects.md +++ b/claude-projects.md @@ -52,7 +52,7 @@ * The project’s repositories and files, plus its instructions and memory * The `CLAUDE.md` and skills in each of the project’s repositories, and in a project with one repository, that repository’s permission rules and hooks too * The connectors on your claude.ai account - * A cloud environment that sets its network access, environment variables, API credentials, and installed tools + * A cloud environment that sets its network access, environment variables, network secrets, and installed tools * **The Overview pane** : where you see all the threads at once and which of them need you. Its other tabs are **Library** for the files you added and the files threads produced, **Pull requests** for the ones threads opened, and **Routines** for scheduled work in the project. Cloud threads don’t pick up anything from the Claude Code setup on your own machine. Get skills, plugins, connectors, and tools into threads covers how to give them what they’d otherwise be missing. Here is how those parts connect, from you through the conversation to the threads doing the work, with **Overview** tracking their state: @@ -80,7 +80,7 @@ * **Plan** : you’re on Pro or Max and **Projects** shows in your sidebar. * **GitHub, if the project will work on code** : your code is on github.com rather than GitHub Enterprise Server, GitLab, or Bitbucket, your connected GitHub account has push access to it, and the Claude GitHub App is installed on it. If you connected GitHub with [`/web-setup`](</docs/en/web-quickstart#connect-from-your-terminal>), that token lets your other cloud sessions reach a repository but isn’t enough for a project’s cloud threads, which need the Claude GitHub App. Set up GitHub access has the steps. - * **Network, credentials, and tools** : for cloud threads, these come from the project’s cloud environment. The default environment already reaches [common package registries](</docs/en/cloud-environments#default-allowed-domains>), so check this only if the work needs other domains, a secret, or a tool that isn’t preinstalled. If the work needs an MCP server, check that it shows as connected in your [claude.ai connectors](<https://claude.ai/customize/connectors>). + * **Network access, secrets, and tools** : for cloud threads, these come from the project’s cloud environment. The default environment already reaches [common package registries](</docs/en/cloud-environments#default-allowed-domains>), so check this only if the work needs other domains, a secret, or a tool that isn’t preinstalled. If the work needs an MCP server, check that it shows as connected in your [claude.ai connectors](<https://claude.ai/customize/connectors>). ### @@ -412,7 +412,7 @@ Choose an environment for threads -Every new cloud thread starts in the project’s [cloud environment](</docs/en/cloud-environments>). The environment sets which domains threads can reach, which environment variables they have, which API credentials are added to their requests, and what the setup script installs before Claude starts. Cloud threads use a default Anthropic-hosted environment until you pick one in **Project settings > Environment**. If cloud threads need to reach an internal API or a private package registry, or need a token your machine normally holds, change the environment rather than the project: see [Network access](</docs/en/cloud-environments#network-access>), [Add API credentials](</docs/en/cloud-environments#add-api-credentials>), and [Setup scripts](</docs/en/cloud-environments#setup-scripts>). +Every new cloud thread starts in the project’s [cloud environment](</docs/en/cloud-environments>). The environment sets which domains threads can reach, which environment variables they have, which network secrets are added to their requests, and what the setup script installs before Claude starts. Cloud threads use a default Anthropic-hosted environment until you pick one in **Project settings > Environment**. If cloud threads need to reach an internal API or a private package registry, or need a token your machine normally holds, change the environment rather than the project: see [Network access](</docs/en/cloud-environments#network-access>), [Add network secrets](</docs/en/cloud-environments#add-network-secrets>), and [Setup scripts](</docs/en/cloud-environments#setup-scripts>). ### @@ -632,7 +632,7 @@ Related resources * [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>): how the cloud sessions behind each cloud thread work, including GitHub access options and auto-fix on pull requests - * [Configure cloud environments](</docs/en/cloud-environments>): change what cloud threads can reach on the network, give them environment variables and API credentials, and install tools with a setup script + * [Configure cloud environments](</docs/en/cloud-environments>): change what cloud threads can reach on the network, give them environment variables and network secrets, and install tools with a setup script * [Automate work with routines](</docs/en/routines>): schedules, triggers, and management for routines, including the ones Claude creates from a project * [Manage multiple agents with agent view](</docs/en/agent-view>): run and track several sessions on your own machine when the work needs tools or services only your machine can reach * [Projects redesigned: from folder to conversation](<https://claude.com/blog/projects-redesigned>): the launch announcement, with the thinking behind making a project a conversation with Claude
modified CLI reference View current →
--- a/cli-reference.md +++ b/cli-reference.md @@ -90,7 +90,7 @@ `--exec`| Run a shell command as a PTY-backed background job instead of starting a Claude session. Use with `--bg` to launch from the shell| `claude --bg --exec 'pytest -x'` `--fallback-model`| Enable automatic fallback to the specified model(s) when the primary model is overloaded or not available, for example a retired model. Accepts a comma-separated list tried in order. See [Fallback model chains](</docs/en/model-config#fallback-model-chains>). To persist a chain across sessions, use the [`fallbackModel` setting](</docs/en/settings-reference#fallbackmodel>), which this flag overrides| `claude --fallback-model sonnet,haiku` `--fork-session`| When resuming, create a new session ID instead of reusing the original (use with `--resume` or `--continue`)| `claude --resume abc123 --fork-session` -`--forward-subagent-text`| Emit [subagent](</docs/en/sub-agents>) text and thinking blocks in the output stream as `assistant` and `user` messages with `parent_tool_use_id` set, so you can reconstruct each subagent’s transcript. Without this flag, Claude Code omits the text and thinking blocks of a subagent that runs in the [foreground](</docs/en/sub-agents#run-subagents-in-foreground-or-background>). Requires `--print` and `--output-format stream-json`. Claude Code also forwards messages from [nested subagents](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>), setting `parent_tool_use_id` to the ID of the Agent or Skill tool call that started each one; this requires Claude Code v2.1.219 or later, and messages of subagents that a forked skill spawns, and of nested forked skills, require v2.1.275 or later. The [`CLAUDE_CODE_FORWARD_SUBAGENT_TEXT`](</docs/en/env-vars>) environment variable enables the same behavior. Requires Claude Code v2.1.211 or later| `claude -p --output-format stream-json --verbose --forward-subagent-text "query"` +`--forward-subagent-text`| Emit [subagent](</docs/en/sub-agents>) text and thinking blocks in the output stream as `assistant` and `user` messages with `parent_tool_use_id` set, so you can reconstruct each subagent’s transcript. Without this flag, Claude Code omits the text and thinking blocks of a subagent that runs in the [foreground](</docs/en/sub-agents#run-subagents-in-foreground-or-background>). Requires `--print` and `--output-format stream-json`. For nested subagents, forked skills, and the version each needs, see [Follow subagent messages](</docs/en/headless#follow-subagent-messages>). The [`CLAUDE_CODE_FORWARD_SUBAGENT_TEXT`](</docs/en/env-vars>) environment variable enables the same behavior. Requires Claude Code v2.1.211 or later| `claude -p --output-format stream-json --verbose --forward-subagent-text "query"` `--from-pr`| Open the session picker filtered to sessions linked to a specific pull request. Accepts a PR number, a GitHub or GitHub Enterprise PR URL, a GitLab merge request URL, or a Bitbucket pull request URL. Sessions are linked automatically when Claude creates the pull request| `claude --from-pr 123` `--ide`| Automatically connect to IDE on startup if exactly one valid IDE is available| `claude --ide` `--init`| Run [Setup hooks](</docs/en/hooks#setup>) with the `init` matcher before the session (print mode only)| `claude -p --init "query"`
modified Configure cloud environments View current →
Show diff (242 lines)
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -1,6 +1,6 @@ Cloud environments apply to [cloud sessions](</docs/en/claude-code-on-the-web>), which are available on Pro, Max, and Team plans, and for Enterprise users with [premium seats or Chat + Claude Code seats](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). -Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, on Pro and Max plans store API credentials that sessions use without seeing them, and run a setup script before Claude starts working. The same environments apply wherever you start a cloud session: the [Desktop app](</docs/en/desktop>), the [Claude mobile app](</docs/en/mobile>), your browser at [claude.ai/code](<https://claude.ai/code>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>), [routines](</docs/en/routines>), and [Claude Tag](<https://claude.com/docs/claude-tag/overview>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. +Each [cloud session](</docs/en/claude-code-on-the-web>) runs in a cloud environment. You can configure an environment to allow or deny network access, set environment variables for the session, on Pro and Max plans store network secrets that sessions use without seeing them, and run a setup script before Claude starts working. The same environments apply wherever you start a cloud session: the [Desktop app](</docs/en/desktop>), the [Claude mobile app](</docs/en/mobile>), your browser at [claude.ai/code](<https://claude.ai/code>), the terminal with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>), [routines](</docs/en/routines>), and [Claude Tag](<https://claude.com/docs/claude-tag/overview>). Each of these surfaces can also route to a [self-hosted environment](</docs/en/self-hosted-environments>). [Availability and limitations](</docs/en/self-hosted-environments#availability-and-limitations>) covers what Claude can’t use yet when a Claude Tag session runs in one. [Remote Control](</docs/en/remote-control>) sessions connect the web and mobile interfaces to a session on your own machine, which uses your machine’s network and files, not a cloud environment. Claude Tag channel sessions use organization-level environments only, either shared environments or [self-hosted environments](</docs/en/self-hosted-environments>). @@ -46,7 +46,7 @@ Add or edit an environment -Select **Cloud** to list your environments. Then select **Add cloud environment** , or hover over an existing environment and select the settings icon that appears on the right.The dialog includes the name, network access level, environment variables, and setup script. When you edit an existing cloud environment on a Pro or Max plan, the dialog also includes API credentials. +Select **Cloud** to list your environments. Then select **Add cloud environment** , or hover over an existing environment and select the settings icon that appears on the right.The dialog includes the name, network access level, environment variables, and setup script. When you edit an existing cloud environment on a Pro or Max plan, the dialog also includes network secrets. ### @@ -65,15 +65,15 @@ * **The VM is restored after being idle** : after a few minutes without activity, a session’s VM pauses with its files saved. Your next message restores the same VM and starts Claude Code again. * **The VM was reclaimed and is rebuilt** : if the paused VM has since been [reclaimed](</docs/en/claude-code-on-the-web#environment-expired>), reopening the session provisions a fresh VM. -After you edit, add, or remove a variable, an existing session in an Anthropic-hosted environment keeps the values it last read until its VM is next restored or rebuilt, and uses your change from then on. Its VM pauses on its own once the session is idle, and you can’t pause it yourself. To use a new value right away, ask Claude to set it on the command it runs, for example `LOG_LEVEL=trace npm test`, or start a new session. A cloud session also sets some variables itself when it starts. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/claude-code-on-the-web#manage-context>), the value the session sets overrides one you add here, so adding that key here has no effect. Anyone who uses the environment can read the values. On Pro and Max plans, use an API credential instead for a key the agent proxy can attach to a request. The requests that never get a credential are listed there. - -### - -​ - -Add API credentials - -An API credential is an API key or token you store on a cloud environment so Claude can call that API from any session in the environment without seeing the key. Anthropic’s agent proxy adds the key to requests for the hosts you list, after each request leaves the session’s VM. The key never reaches Claude, the commands it runs, or the session’s environment variables. API credentials are available on Pro and Max plans. They aren’t available on Team or Enterprise plans yet, so the **API credentials** section doesn’t appear in the environment dialog on those plans. +After you edit, add, or remove a variable, an existing session in an Anthropic-hosted environment keeps the values it last read until its VM is next restored or rebuilt, and uses your change from then on. Its VM pauses on its own once the session is idle, and you can’t pause it yourself. To use a new value right away, ask Claude to set it on the command it runs, for example `LOG_LEVEL=trace npm test`, or start a new session. A cloud session also sets some variables itself when it starts. For [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/claude-code-on-the-web#manage-context>), the value the session sets overrides one you add here, so adding that key here has no effect. Anyone who uses the environment can read the values. On Pro and Max plans, use a network secret instead for a key the agent proxy can attach to a request. The requests that never get a secret are listed there. + +### + +​ + +Add network secrets + +A network secret is an API key or token you store on a cloud environment so Claude can call that API from any session in the environment without seeing the key. Anthropic’s agent proxy adds the key to requests for the hosts you list, after each request leaves the session’s VM, so the key itself stays outside the VM. Network secrets are available on Pro and Max plans. They aren’t available on Team or Enterprise plans yet, so the **Network secrets** section doesn’t appear in the environment dialog on those plans. #### @@ -81,36 +81,36 @@ Requirements -Two of these decide whether you can add a credential, and two decide whether the agent proxy can use it once added: +These requirements decide whether you can add a secret and whether the agent proxy can use it once added: * **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 - * **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have API credentials + * **Environment type** : an Anthropic-hosted cloud environment that already exists. A [self-hosted environment](</docs/en/self-hosted-environments>) doesn’t have network secrets * **API reachability** : the API accepts connections from the internet, because requests leave from Anthropic’s network - * **Encryption keys** : if your organization uses customer-managed encryption keys, you can’t save credentials + * **Encryption keys** : if your organization uses customer-managed encryption keys, you can’t save network secrets #### ​ -Add a credential - -You add credentials one at a time, and you can’t edit a credential after you add it. To change a credential’s hosts or value, delete it and add it again. +Add a secret + +You add secrets one at a time, and you can’t edit a secret after you add it. To change a secret’s hosts or value, delete it and add it again. 1 -Open the environment's API credentials - -Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit environment** dialog, find the **API credentials** section. You see the credentials already on the environment, each with the hosts it applies to. +Open the environment's network secrets + +Open the environment for editing at [claude.ai/code](<https://claude.ai/code>). In the **Edit environment** dialog, find the **Network secrets** section. You see the secrets already on the environment, each with the hosts it applies to. 2 -Add the credential - -Select **Add credential** and fill in the form. Keep the default **Credential type** , **Bearer** , for an API key that travels in a request header, and fill in these fields: - - * **Name** : a label for the credential, such as `Internal billing API` +Add the secret + +Select **Add secret** and fill in the form. Keep the default **Credential type** , **Bearer** , for an API key that travels in a request header, and fill in these fields: + + * **Name** : a label for the secret, such as `Internal billing API` * **Allowed websites** : the API’s hosts, such as `api.example.com`. A leading `*.` matches every subdomain * **Custom headers** : one row for the header that carries the key. The row starts with `Authorization` as the header’s **Name** and `Bearer` as its **Prefix** ; paste the key itself as the **Value**. For a header like `X-Api-Key` that takes the bare value, change the name and clear the prefix @@ -118,29 +118,29 @@ 3 -Save the credential - -Select **Connect**. The credential appears in the list with its hosts, saved without the dialog’s **Save changes** button. You can’t view the value again after saving. - -To confirm the credential works, start a session in the environment and ask Claude to call the API, for example with `curl`. The API answers as if the key were in the request, and the key doesn’t appear in the session’s environment variables or in any file. If the list marks a credential **Not sent** instead, the note under it says why and what to do. Two credentials whose hosts overlap without matching exactly get no marker, and the agent proxy sends only one of them. +Save the secret + +Select **Connect**. The secret appears in the list with its hosts, saved without the dialog’s **Save changes** button. You can’t view the value again after saving. + +To confirm the secret works, start a session in the environment and ask Claude to call the API, for example with `curl`. The API answers as if the key were in the request, and the key doesn’t appear in the session’s environment variables or in any file. If the list marks a secret **Not sent** instead, the note under it says why and what to do. Two secrets whose hosts overlap without matching exactly get no marker, and the agent proxy sends only one of them. #### ​ -Which requests get the credential - -The agent proxy attaches a credential to a request when the request’s host matches one you listed on that credential. Sessions can reach those hosts even when the environment’s network access level wouldn’t otherwise allow them, except the hosts that never get the credential. The credential applies in every session that runs in the environment, whoever started it, until you delete it. +Which requests get the secret + +The agent proxy attaches a secret to a request when the request’s host matches one you listed on that secret. Sessions can reach those hosts even when the environment’s network access level wouldn’t otherwise allow them, except the hosts that never get the secret. The secret applies in every session that runs in the environment, whoever started it, until you delete it. #### ​ -Requests that never get the credential - -The agent proxy never attaches a credential you add to these requests: - - * **GitHub** : the GitHub proxy authenticates requests to GitHub instead, so you don’t need an API credential for it +Requests that never get the secret + +The agent proxy never attaches a secret you add to these requests: + + * **GitHub** : the GitHub proxy authenticates requests to GitHub instead, so you don’t need a network secret for it * **The Anthropic API and public package registries** : `api.anthropic.com`, `registry.npmjs.org`, `jsr.io`, `npm.jsr.io`, `pypi.org`, `files.pythonhosted.org`, `index.crates.io`, and `proxy.golang.org` * **Setup script requests** : Claude Code connects to the agent proxy when it launches, after the setup script has run * **Claude Code’s telemetry export** : Claude Code sends its [telemetry export](</docs/en/monitoring-usage#telemetry-from-cloud-sessions-and-claude-tag>) itself rather than through a command it runs, and that request doesn’t go through the agent proxy @@ -163,7 +163,7 @@ * Sessions already running in the environment continue to work. * The environment disappears from the selector and from `/remote-env`, so you can’t pick it for new sessions. - * API credentials on the environment stay attached in its running sessions. Delete any you no longer want before you archive. + * Network secrets on the environment stay attached in its running sessions. Delete any you no longer want before you archive. * No new session can start in an archived environment, on any surface. If the environment was your saved CLI default, Claude Code starts CLI cloud sessions in the Anthropic-hosted environment when your list has one, and otherwise in the first environment in your list that isn’t a Remote Control bridge environment. Anything configured with the environment explicitly, such as a [routine](</docs/en/routines#environments-and-network-access>), can’t start new sessions in it. Point it at another environment. ### @@ -177,7 +177,7 @@ * **Create a shared environment** : use the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), which is also where Owners edit and archive shared environments. Each one has a name, a network access level, environment variables in `.env` format, and a setup script. * **Share a personal environment** : open one of your own environments for editing in the environment selector, then share it from the **Who can use it** row. The environment keeps its ID, so sessions and routines that already use it aren’t affected, and every member can then see it and start sessions in it. -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. API credentials, which give sessions a key they can’t read, aren’t available on Team or Enterprise plans yet. +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. Network secrets, which give sessions a key they can’t read, aren’t available on Team or Enterprise plans yet. ### @@ -219,7 +219,7 @@ * GitHub, through its separate proxy * MCP connectors you enable, whose traffic travels through Anthropic’s servers - * The hosts you listed on the environment’s API credentials, except the hosts that never get the credential + * The hosts you listed on the environment’s network secrets, except the hosts that never get the secret * The Anthropic API, for Claude Code’s own requests, even at **None** , as noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>) ### @@ -234,7 +234,7 @@ *.internal.example.com registry.example.com -Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s API credentials, other than the hosts that never get the credential, don’t go through this allowlist. A leading `*.` matches every subdomain. To keep the Trusted domains too, check **Also include default list of common package managers** ; leave it unchecked to allow only what you list. If your organization uses [artifacts](</docs/en/artifacts#availability>), you don’t need `*.frame.claudeusercontent.com` in the list for sessions to read them. When the list leaves that host out, Claude Code reads artifact content through the session’s connection to Anthropic instead. Keep the host in an allowlist in two situations: +Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network. GitHub traffic, MCP connector traffic, and requests to the hosts of the environment’s network secrets, other than the hosts that never get the secret, don’t go through this allowlist. A leading `*.` matches every subdomain. To keep the Trusted domains too, check **Also include default list of common package managers** ; leave it unchecked to allow only what you list. If your organization uses [artifacts](</docs/en/artifacts#availability>), you don’t need `*.frame.claudeusercontent.com` in the list for sessions to read them. When the list leaves that host out, Claude Code reads artifact content through the session’s connection to Anthropic instead. Keep the host in an allowlist in two situations: * **Sessions in this environment open another organization’s public artifacts** : Claude Code fetches those from the host directly, so add it to this list. * **You’re configuring the local CLI or a self-hosted runner** : keep the host in that allowlist. See [network access requirements](</docs/en/network-config#network-access-requirements>) and the self-hosted [network requirements](</docs/en/self-hosted-environments-deploy#network-requirements>). @@ -252,8 +252,8 @@ * **Git credentials** : the git client inside the VM uses a scoped credential, which the proxy verifies and swaps for your actual GitHub token. * **API requests** : requests from the built-in GitHub tools, and from `gh` under the `proxy-injected` placeholder, go out with your real credentials substituted. * **Push restrictions** : the proxy rejects branch deletions and pushes of anything other than a branch, such as a tag. It doesn’t limit which branches a push can update. To do that, use branch protection rules or rulesets on GitHub. - * **Repository scope** : GitHub API and release-asset requests reach only repositories attached to the session, so a setup script that downloads release assets from an unattached repository gets a 403. - * **GraphQL restrictions** : the proxy serves only a pinned set of GraphQL operations for pull-request workflows. The proxy rejects everything else on the GraphQL endpoint with a 403 that says `This GraphQL query is not enabled for this session` and names the REST fallback, `gh api repos/{owner}/{repo}/...`. The restriction applies to every request through the proxy regardless of the credentials you supply, so a `GH_TOKEN` you set gets the same 403. Claude can’t reach GitHub APIs that exist only in GraphQL, such as Projects v2, through the proxy. + * **Repository scope** : the proxy serves GitHub API requests for the repositories attached to the session. An API request for another repository gets a 403 whose message starts with `GitHub access to` and contains `is not enabled for this session`. + * **GraphQL restrictions** : the proxy rejects requests to GitHub’s GraphQL endpoint with a 403 whose message starts with `GitHub GraphQL is not available from Claude Code sessions` and names the REST fallback, `gh api repos/{owner}/{repo}/...`. `gh` subcommands that use GraphQL, such as `gh pr` and `gh issue`, get the same 403. The restriction applies to every request through the proxy regardless of the credentials you supply, so a `GH_TOKEN` you set gets the same 403. Claude can’t reach GitHub APIs that exist only in GraphQL, such as Projects v2, through the proxy. Committed files from public repositories arrive through `raw.githubusercontent.com`, which the security proxy handles instead. That domain is in the default Trusted list, so those files stay reachable unless the environment’s access level excludes it. @@ -267,8 +267,6 @@ * Protection against malicious requests * Rate limiting and abuse prevention - * Content filtering for enhanced security - * A DNS-level audit trail of requested hostnames ## @@ -297,15 +295,31 @@ Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone Plugins and marketplaces declared in your repo’s `.claude/settings.json`| No| A cloud session doesn’t install the plugins a repository turns on under [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>), including ones from the marketplaces it lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) Your organization’s [server-managed settings](</docs/en/server-managed-settings>)| Yes, except in [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions| Fetched from Anthropic’s servers when the session starts. See [Surface coverage](</docs/en/model-config#surface-coverage>) for how `availableModels` is enforced in cloud sessions. Settings deployed to your device through MDM or managed settings files don’t apply, because the session runs on an Anthropic-managed VM; in a [self-hosted environment](</docs/en/self-hosted-environments>), sessions also read the managed settings file in the runner image, per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) -Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo +Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo. See Add personal preferences without committing to the repo Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load skills you enable on claude.ai Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log -API keys and tokens for services Claude calls| On Pro and Max plans, as API credentials| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach, or any key on a Team or Enterprise plan, stays in an environment variable +API keys and tokens for services Claude calls| On Pro and Max plans, as network secrets| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach, or any key on a Team or Enterprise plan, stays in an environment variable Interactive auth like AWS SSO| No| Not supported. SSO requires browser-based login that can’t run in a cloud session -To make your own configuration available in cloud sessions, commit it to the repo. Anyone who uses the environment can read its environment variables and setup script. The dialog’s note under **Environment variables** says so and warns against putting secrets there. On Pro and Max plans, store a key the agent proxy can attach as an API credential instead. +To make your own configuration available in cloud sessions, commit it to the repo. Anyone who uses the environment can read its environment variables and setup script. The dialog’s note under **Environment variables** says so and warns against putting secrets there. On Pro and Max plans, store a key the agent proxy can attach as a network secret instead. + +#### + +​ + +Add personal preferences without committing to the repo + +In an Anthropic-hosted environment, add a setup script that writes `~/.claude/CLAUDE.md` for preferences you’d rather not put in a shared repository. Claude Code loads that file as [user instructions](</docs/en/memory#choose-where-to-put-claude-md-files>) in the session. This example sets a commit-message preference: + + #!/bin/bash + mkdir -p ~/.claude + cat > ~/.claude/CLAUDE.md <<'EOF' + Use conventional commit messages. + EOF + +Put the script on one of your own environments rather than a shared one. Run `/context` in your next cloud session and confirm `/root/.claude/CLAUDE.md` appears under **Memory files**. ### @@ -340,9 +354,9 @@ Cloud sessions include built-in GitHub tools that let Claude read issues, list pull requests, fetch diffs, and post comments without any setup. These tools authenticate through the GitHub proxy using whichever method you configured under [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>), so your token never enters the container. You can set `GH_TOKEN` or `GITHUB_TOKEN` yourself in environment settings, or leave both unset and let the GitHub proxy authenticate for you: * If you set a token, it passes through to the container unchanged, so your scripts and GitHub’s [`gh` CLI](<https://cli.github.com>) use it directly. - * If you set neither and the GitHub proxy is handling authentication for your session, both variables read as the placeholder string `proxy-injected` in the commands Claude runs, and the proxy substitutes your real credentials on outbound GitHub requests. `gh` works without a token of your own, but a script that reads `GITHUB_TOKEN` directly gets the placeholder, not a usable token. - -A token you set is an ordinary environment variable, so anyone who uses the environment can read it; the proxy path keeps the credential out of the environment configuration and the session VM. To check which case applies to your session, ask Claude to run `echo $GH_TOKEN`. GitHub’s [`gh` CLI](<https://cli.github.com>) is pre-installed. If you need a `gh` command the built-in tools don’t cover, like `gh release` or `gh workflow run`, ask Claude to run it. `gh` reads `GH_TOKEN` automatically, so you don’t need to run `gh auth login`. + * If you set neither and the GitHub proxy is handling authentication for your session, both variables read as the placeholder string `proxy-injected` in the commands Claude runs, and the proxy substitutes your real credentials on outbound GitHub requests. `gh api` calls for attached repositories work without a token of your own, but a script that reads `GITHUB_TOKEN` directly gets the placeholder, not a usable token. + +A token you set is an ordinary environment variable, so anyone who uses the environment can read it; the proxy path keeps the credential out of the environment configuration and the session VM. To check which case applies to your session, ask Claude to run `echo $GH_TOKEN`. GitHub’s [`gh` CLI](<https://cli.github.com>) is pre-installed. If you need a GitHub operation the built-in tools don’t cover, ask Claude to call the REST API with `gh api`. `gh` subcommands that use the REST API, such as `gh workflow list`, work too. The proxy rejects subcommands that use GraphQL, such as `gh pr` and `gh issue`. `gh` reads `GH_TOKEN` automatically, so you don’t need to run `gh auth login`. ###
modified Code Review View current →
--- a/code-review.md +++ b/code-review.md @@ -362,7 +362,7 @@ Tune effort and arguments -Pass an [effort level](</docs/en/model-config#adjust-effort-level>) to trade coverage for confidence. At `low` and `medium`, the review reports only the findings it’s most confident in, so you see fewer false positives; `high` through `max` broaden coverage and may include findings the review is less sure about. When you don’t type a level, the review reuses the last level from `low` through `max` you typed, even in an earlier session, and Claude Code shows a notice such as `Reusing high effort, the level you typed last time`. Type a level, like `/code-review high`, to change what later runs reuse; a level you pass in a non-interactive `-p` run doesn’t update it. `ultra` neither updates nor uses the remembered level. If you’ve never typed a level, the review uses the session’s current effort. Before v2.1.223, a `/code-review` without a level always used the session’s current effort. After the effort level and flags, Claude Code reads the rest of the line in one of two ways: +Pass an [effort level](</docs/en/model-config#adjust-effort-level>) to trade coverage for confidence. At `low`, the review reports the findings it’s most confident in, so you see fewer false positives. From `medium` through `max`, the review broadens coverage. When you don’t type a level, the review reuses the last level from `low` through `max` you typed, even in an earlier session, and Claude Code shows a notice such as `Reusing high effort, the level you typed last time`. Type a level, like `/code-review high`, to change what later runs reuse; a level you pass in a non-interactive `-p` run doesn’t update it. `ultra` neither updates nor uses the remembered level. If you’ve never typed a level, the review uses the session’s current effort. Before v2.1.223, a `/code-review` without a level always used the session’s current effort. After the effort level and flags, Claude Code reads the rest of the line in one of two ways: * **Without`ultra`**: everything left is the review target, even when it starts with another command name. `/code-review /fix-issue 123` reviews with `/fix-issue 123` as target text instead of loading `/fix-issue` as a second [stacked skill](</docs/en/skills#pass-arguments-to-skills>). Before v2.1.218, a command stacked after `/code-review` expanded as its own skill. * **With`ultra`**: Claude Code reads a single word as a base branch or PR number, and turns longer text that doesn’t name a branch or PR into [a note attached to the review](</docs/en/ultrareview#pass-a-request-in-plain-words>). `/code-review ultra check my auth changes` reviews your current branch, and Claude relates the findings to your note.
modified Commands View current →
--- a/commands.md +++ b/commands.md @@ -61,7 +61,7 @@ `/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. It needs claude.ai, which the CLI doesn’t contact on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS, or through a [Claude apps gateway](</docs/en/claude-apps-gateway#availability-and-limitations>), so the command is unavailable there `/desktop`| Continue the current session in the Claude Code Desktop app. Requires macOS or x64 Windows and a Claude subscription. Alias: `/app` `/diff`| Review the changes in your working tree, including the edits Claude has made so far. See [Review changes with /diff](</docs/en/interactive-mode#review-changes-with-%2Fdiff>) -`/doctor [prompt-audit [path]]`| **[Skill](</docs/en/skills#bundled-skills>).** Run a setup checkup that diagnoses issues and can fix them. Checks installation health, including duplicate or leftover installs, `PATH` problems, and unparseable settings files. Finds unused skills, MCP servers, and plugins versus their context cost, flags slow [hooks](</docs/en/hooks>), and checks for a newer version on your [release channel](</docs/en/setup#configure-release-channel>). Deduplicates local `CLAUDE.md` files against checked-in ones, trims checked-in [`CLAUDE.md`](</docs/en/memory#my-claude-md-is-too-large>) files by cutting content Claude could derive from the codebase, and migrates the always-loaded guidance that remains into [skills](</docs/en/skills>) and nested `CLAUDE.md` files that load on demand. Also offers to make [auto mode](</docs/en/permissions#permission-modes>) your default and to [pre-approve](</docs/en/permissions>) frequently denied read-only commands. Reports findings first and asks for confirmation before changing anything. From the terminal, `claude doctor` prints read-only installation diagnostics without starting a session. Alias: `/checkup`. Run `/doctor prompt-audit` to have Claude [audit your `CLAUDE.md` files, skills, and other configuration](</docs/en/memory#audit-your-instruction-files>) for outdated or conflicting instructions instead of running the checkup. The `prompt-audit` subcommand requires Claude Code v2.1.283 or later. The `CLAUDE.md` trim check requires Claude Code v2.1.206 or later. Before v2.1.205, `/doctor` opened a read-only diagnostics screen and pressing `f` sent the report to Claude +`/doctor [prompt-audit [path]]`| **[Skill](</docs/en/skills#bundled-skills>).** Run a setup checkup that diagnoses installation, settings, extension, and `CLAUDE.md` problems and proposes fixes that Claude applies after you confirm. For what the checkup covers, or to audit your instructions with `prompt-audit` instead, see [Check your setup with `/doctor`](</docs/en/skills#check-your-setup-with-/doctor>). The `prompt-audit` subcommand requires Claude Code v2.1.283 or later. Alias: `/checkup` `/effort [level|auto|status|ultracode [on|off]]`| Set the [effort level](</docs/en/model-config#adjust-effort-level>): `low` to `xhigh`, `max`, or `auto`; `status` prints it. `ultracode` or `ultracode on` turns [ultracode](</docs/en/workflows#let-claude-decide-with-ultracode>) on for the session at the current level, and `ultracode off` turns it off; the [`ultracode`](</docs/en/settings-reference#ultracode>) key persists. `max` is session-only. The `on` and `off` arguments and keeping the current level require Claude Code v2.1.284 or later. Before v2.1.284, `/effort ultracode` set the session to `xhigh`, and `/effort ultracode off` failed with `Invalid argument`. Run it while Claude is responding and, once you confirm the [cache warning](</docs/en/prompt-caching#changing-effort-level>), if Claude Code shows one, Claude Code applies the new level to the next request in that turn. Before v2.1.242, Claude Code decided from a feature flag it fetched from Anthropic whether to run the command mid-turn or queue it until the turn finished, and always queued it in a session that doesn’t [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), such as on a [third-party provider](</docs/en/third-party-integrations>). Works in `-p` `/exit`| Exit the CLI. In an attached [background session](</docs/en/agent-view#attach-to-a-session>), this detaches and the session keeps running. Alias: `/quit` `/export [filename]`| Export the current conversation as plain text. With a filename, writes directly to that file. Without, opens a dialog to copy to clipboard or save to a file
modified Common workflows View current →
--- a/common-workflows.md +++ b/common-workflows.md @@ -359,7 +359,7 @@ Explain the logic in @src/utils/auth.js -This includes the full content of the file in the conversation. +This includes the content of the file in the conversation when it fits the [Read tool](</docs/en/tools-reference#read-tool-behavior>)’s token limit, 25,000 tokens by default. A text file larger than 256KB isn’t included. 2
modified Add components to a plugin View current →
--- a/components.md +++ b/components.md @@ -406,7 +406,7 @@ } ] -The command runs in a shell, in the working directory the session started in. A monitor’s command is limited in where it starts and what it can reference: +The command runs in a shell, in the session’s current working directory. It runs with your full user permissions and outside the [sandbox](</docs/en/sandboxing>). A monitor’s command is limited in where it starts and what it can reference: * **Interactive sessions only** : plugin monitors start in an interactive session and never in non-interactive mode with the `-p` flag. They also don’t start in sessions where the API provider or telemetry settings make the [Monitor tool](</docs/en/tools-reference#monitor-tool>) unavailable * **No user configuration** : `command` gets the path variables and `${ENV_VAR}` from the environment, but never `${user_config.*}`. A monitor that references one doesn’t start, and monitor processes don’t receive `CLAUDE_PLUGIN_OPTION_<KEY>` either
modified Explore the context window View current →
--- a/context-window.md +++ b/context-window.md @@ -36,7 +36,7 @@ Context that hooks added earlier| Summarized with the rest of the conversation [SessionStart hooks](</docs/en/hooks-guide#re-inject-context-after-compaction>) that match the `compact` source| Claude Code runs them and adds their output to the compacted context -Right after compaction, Claude Code re-reads up to five of the files Claude has read or edited in the session, choosing the ones modified most recently. A file over 5,000 tokens comes back as a path reference without its content, shown as `Referenced file` instead of `Read`. Path-scoped rules and nested CLAUDE.md files load into message history when their trigger file is read, so compaction summarizes them away with everything else. If a rule must persist across compaction, drop the `paths:` frontmatter or move it to the project-root CLAUDE.md. Skill bodies are re-injected after compaction, but large skills are truncated to fit the per-skill cap, and the oldest invoked skills are dropped once the total budget is exceeded. Truncation keeps the start of the file, so put the most important instructions near the top of `SKILL.md`. +Right after compaction, Claude Code re-reads up to five of the files Claude has read or edited in the session, choosing the ones modified most recently. A file over 5,000 tokens comes back as a path reference without its content, shown as `Referenced file` instead of `Read`. Path-scoped rules and nested CLAUDE.md files load into message history when Claude reads, writes, or edits their trigger file, so compaction summarizes them away with everything else. If a rule must persist across compaction, drop the `paths:` frontmatter or move it to the project-root CLAUDE.md. Skill bodies are re-injected after compaction, but large skills are truncated to fit the per-skill cap, and the oldest invoked skills are dropped once the total budget is exceeded. Truncation keeps the start of the file, so put the most important instructions near the top of `SKILL.md`. ## @@ -52,7 +52,7 @@ * **Clear between tasks** : run `/clear` when switching to unrelated work. Old conversation crowds out the files you need next and costs tokens on every message. * **Delegate large reads** : send research to a [subagent](</docs/en/sub-agents>) so the file contents stay in its context window, not yours. -If you need a larger window rather than a smaller conversation, Fable models, Sonnet 5 and later, Opus 4.6 and later, and Sonnet 4.6 support a 1 million token context window. See [Extended context](</docs/en/model-config#extended-context>) for availability by plan and how to select a `[1m]` model variant. Compaction works the same way at the larger limit. Sonnet 5.5 and Sonnet 5 run with the 1M context window and have no `[1m]` variant to select. See [Sonnet 5.5 and Sonnet 5 context window](</docs/en/model-config#sonnet-5-5-and-sonnet-5-context-window>) for their auto-compaction thresholds, and [the context window behind a gateway](</docs/en/model-config#context-window-behind-a-gateway>) for how Claude Code sizes the window when you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>). The point where automatic compaction runs depends on your model and configuration. See [Default auto-compact thresholds](</docs/en/model-config#default-auto-compact-thresholds>) for the boundaries per model, and [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>) if Claude Code assumes the wrong window for your model ID, such as an [LLM gateway](</docs/en/llm-gateway>) alias. +If you need a larger window rather than a smaller conversation, Fable models, Sonnet 5 and later, Haiku 5.5, Opus 4.6 and later, and Sonnet 4.6 support a 1 million token context window. See [Extended context](</docs/en/model-config#extended-context>) for availability by plan and how to select a `[1m]` model variant. Compaction works the same way at the larger limit. Sonnet 5.5 and Sonnet 5 run with the 1M context window and have no `[1m]` variant to select. See [Sonnet 5.5 and Sonnet 5 context window](</docs/en/model-config#sonnet-5-5-and-sonnet-5-context-window>) for their auto-compaction thresholds, and [the context window behind a gateway](</docs/en/model-config#context-window-behind-a-gateway>) for how Claude Code sizes the window when you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>). The point where automatic compaction runs depends on your model and configuration. See [Default auto-compact thresholds](</docs/en/model-config#default-auto-compact-thresholds>) for the boundaries per model, and [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>) if Claude Code assumes the wrong window for your model ID, such as an [LLM gateway](</docs/en/llm-gateway>) alias. ##
modified Run Claude Code behind a corporate launcher View current →
--- a/corporate-launcher.md +++ b/corporate-launcher.md @@ -110,6 +110,7 @@ * **Reach`exec` within about three seconds each time the launcher runs.** A cold background dispatch runs the launcher twice in series before the first byte of output, so do slow work such as a single sign-on exchange lazily or from a cache. * **Tolerate being invoked from inside itself.** Claude Code applies the launcher to every nested self-spawn, so a launcher that acquires an exclusive resource must detect that it already holds it. * **Don’t write to the terminal before Claude Code starts.** Anything printed before the `exec` is reported as the crash cause if the session dies before initializing. + * **Don’t depend on how arguments are spelled.** A flag’s value can arrive as its own argument, `--flag value`, or joined to the flag, `--flag=value`. Which form a flag uses can change between versions. ###
modified Manage costs effectively View current →
--- a/costs.md +++ b/costs.md @@ -349,7 +349,7 @@ Adjust extended thinking -Extended thinking is enabled by default because it significantly improves performance on complex planning and reasoning tasks. Thinking tokens are billed as output tokens, and the default budget can be tens of thousands of tokens per request depending on the model. For simpler tasks where deep reasoning isn’t needed, you can reduce costs by lowering the [effort level](</docs/en/model-config#adjust-effort-level>) with `/effort` or in `/model`, or by disabling thinking in `/config`. You can’t turn off thinking on Opus 5.5, Sonnet 5.5, or the Fable models, which always use extended thinking. On models with a [fixed thinking budget](</docs/en/model-config#adaptive-reasoning-and-fixed-thinking-budgets>), you can also lower the budget by setting the `MAX_THINKING_TOKENS` [environment variable](</docs/en/env-vars>), for example `MAX_THINKING_TOKENS=8000`. Adaptive-reasoning models ignore nonzero budgets, so use effort levels there instead. +Extended thinking is enabled by default because it significantly improves performance on complex planning and reasoning tasks. Thinking tokens are billed as output tokens, and the default budget can be tens of thousands of tokens per request depending on the model. For simpler tasks where deep reasoning isn’t needed, you can reduce costs by lowering the [effort level](</docs/en/model-config#adjust-effort-level>) with `/effort` or in `/model`, or by disabling thinking in `/config`. You can’t turn off thinking on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models, which always use extended thinking. On models with a [fixed thinking budget](</docs/en/model-config#adaptive-reasoning-and-fixed-thinking-budgets>), you can also lower the budget by setting the `MAX_THINKING_TOKENS` [environment variable](</docs/en/env-vars>), for example `MAX_THINKING_TOKENS=8000`. Adaptive-reasoning models ignore nonzero budgets, so use effort levels there instead. ### @@ -386,7 +386,7 @@ * **Use plan mode for complex tasks** : Press Shift+Tab to cycle to [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) before implementation. Claude explores the codebase and proposes an approach for your approval, preventing expensive re-work when the initial direction is wrong. * **Course-correct early** : If Claude starts heading the wrong direction, press Escape to stop immediately. Use `/rewind` or double-tap Escape to restore conversation and code to a previous checkpoint. * **Give verification targets** : Include test cases, paste screenshots, or define expected output in your prompt. When Claude can verify its own work, it catches issues before you need to request fixes. - * **Test incrementally** : Write one file, test it, then continue. This catches issues early when they’re cheap to fix. + * **Test incrementally** : Write one file, test it, then continue. This catches issues early. ##
modified Create a mod View current →
--- a/create.md +++ b/create.md @@ -296,7 +296,7 @@ ✔ Validation passed -The `hooks:` line lists the events your module hooks, each with its filter in braces. The `calls:` line lists every mods API method it calls. A module that reads or sets environment variables also gets `env reads:` and `env writes:` lines, and one that uses [`$.state`](</docs/en/plugins/mods/interface#keep-state>) gets `state reads:` and `state writes:`. If an event you meant to handle is missing from the first line, Claude Code won’t call that hook either. The usual cause is a misspelled event name, which the command reports as an error such as `"tool.calls" is not an event`. Follow these rules so that static analysis can find every hook and call: +Check the `hooks:` line for the events your module hooks, each with its filter in braces, and `calls:` for every mods API method it calls. If your module reads or sets environment variables, look for `env reads:` and `env writes:` lines too, and `state reads:` and `state writes:` if it uses [`$.state`](</docs/en/plugins/mods/interface#keep-state>). You also see one line for each hook that can refuse an action, such as `gating hook without .catch: tool.call`, which says whether that hook has a [`.catch` handler](</docs/en/plugins/mods/events#handle-a-hook-that-fails>). If an event you meant to handle is missing from the first line, Claude Code won’t call that hook either. The usual cause is a misspelled event name, which the command reports as an error such as `"tool.calls" is not an event`. Follow these rules so that static analysis can find every hook and call: * Write each mods API call in full: `$`, the namespace, then the method, as in `$.store.get('notes')`. You can pass `$` to a function declared at the top level of the same file, and for a function of yours named `loadNotes`, the `calls:` line then reads `$.store.get (via loadNotes)`. Passing `$` to a method, a function defined inside the hook, or a function you import from another of your files fails validation. The `read` and `update` functions that [`$.state`](</docs/en/plugins/mods/interface#keep-state>) uses are the imports that can take it. Don’t assign `$` or one of its namespaces to a variable, destructure it, or index it with a computed name. `const ui = $.ui` fails with `$.ui is used as a value`. * Write the event name in each `on` call as a string literal, such as `'tool.call'`. A variable, or a loop over a list of names, fails with `the event name passed to on() is not a string literal`.
modified Launch sessions from links View current →
--- a/deep-links.md +++ b/deep-links.md @@ -146,7 +146,7 @@ Linux| `claude-code-url-handler.desktop` under `$XDG_DATA_HOME/applications`, defaulting to `~/.local/share/applications` Windows| `HKEY_CURRENT_USER\Software\Classes\claude-cli` -The handler launches Claude Code in a detected terminal emulator. On macOS, Claude Code remembers the terminal from your most recent interactive session and reuses it, supporting iTerm2, Ghostty, kitty, Alacritty, WezTerm, and Terminal.app. On Linux it honors the `$TERMINAL` environment variable, then `x-terminal-emulator`, then a list of common emulators. On Windows it prefers Windows Terminal, then PowerShell, then `cmd.exe`. To prevent registration entirely, set [`disableDeepLinkRegistration`](</docs/en/settings-reference#disabledeeplinkregistration>) to `"disable"` in `settings.json`. To enforce this across an organization so users cannot re-enable it, set it in [managed settings](</docs/en/server-managed-settings>) instead. +The handler launches Claude Code in a detected terminal emulator. On macOS, Claude Code remembers the terminal from your most recent interactive session and reuses it, supporting iTerm2, Ghostty, kitty, Alacritty, WezTerm, and Terminal.app. On Linux it honors the `$TERMINAL` environment variable, then `x-terminal-emulator`, then a list of common emulators. On Windows it prefers Windows Terminal, then PowerShell, then `cmd.exe`. To prevent registration entirely, set [`disableDeepLinkRegistration`](</docs/en/settings-reference#disabledeeplinkregistration>) to `"disable"` in `settings.json`. To enforce this across an organization so users cannot re-enable it, set it in [managed settings](</docs/en/server-managed-settings>) instead. Claude Code’s `disableDeepLinkRegistration` setting covers `claude-cli://` links only. ## @@ -155,6 +155,14 @@ Open a VS Code tab instead of a terminal The VS Code extension registers its own handler at `vscode://anthropic.claude-code/open`, which opens a Claude Code editor tab rather than a terminal window. See [Launch a VS Code tab from other tools](</docs/en/vs-code#launch-a-vs-code-tab-from-other-tools>) for that URL’s parameters. + +## + +​ + +Open a Claude Desktop session on an SSH connection + +Claude Desktop handles its own `claude://` links. To open a Desktop session on a remote machine over SSH, see [Open an SSH session from a link](</docs/en/desktop#open-an-ssh-session-from-a-link>). ##
modified Desktop application View current →
Show diff (213 lines)
--- a/desktop.md +++ b/desktop.md @@ -61,6 +61,19 @@ ​ +Accept a suggested prompt + +After Claude replies, the Code tab can show a suggested next prompt as gray text in the empty prompt box. Claude Code [generates each suggestion](</docs/en/interactive-mode#prompt-suggestions>) from your conversation with a short background request that counts toward your plan’s usage limits or your API costs. + + * **Use the suggestion** : press **Tab** or **Right arrow** to place it in the prompt box, edit it if you want, then press **Enter** to send it. Pressing **Enter** before you accept the suggestion doesn’t send it. + * **Write your own prompt** : start typing. The suggestion shows only while the prompt box is empty and has no attached files. + +Go to **Settings > Claude Code** and turn off **Prompt suggestions** under **Sessions** to stop suggestions in each session from the next time it starts or resumes. + +### + +​ + Add files and context to prompts The prompt box supports two ways to bring in external context: @@ -96,7 +109,7 @@ Auto mode availability -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 a [Fable model](</docs/en/model-config#work-with-fable>). 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. +Auto mode is available to all users on the Anthropic API and requires Claude Opus 4.6 or later, Sonnet 4.6 or later, Haiku 5.5, or a [Fable model](</docs/en/model-config#work-with-fable>). 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. ### @@ -205,7 +218,7 @@ Run commands in the terminal -The integrated terminal lets you run commands alongside your session without switching to another app. Click **Terminal** in the session’s title bar or press **Ctrl+`** on macOS or Windows. The terminal opens in your session’s working directory and shares the same environment as Claude, so commands like `npm test` or `git status` see the same files Claude is editing. To open a second terminal tab, click **+** in the terminal pane header or right-click a folder in the chat to choose **Open in terminal**. The terminal is available in local sessions only. +The integrated terminal lets you run commands alongside your session without switching to another app. Click **Terminal** in the session’s title bar or press **Ctrl+`** on macOS or Windows. The terminal opens in your session’s working directory and shares the same environment as Claude, so commands like `npm test` or `git status` see the same files Claude is editing. To open a second terminal tab, click **+** in the terminal pane header or right-click a folder in the chat to choose **Open in terminal**. The terminal is available in local and SSH sessions. ### @@ -260,6 +273,7 @@ `Ctrl` `Tab` / `Ctrl` `Shift` `Tab`| Next or previous session `Cmd` `Shift` `]` / `Cmd` `Shift` `[`| Next or previous session `Esc`| Stop Claude’s response +`Tab` / `Right arrow`| Accept the suggested prompt in an empty prompt box `Cmd` `Shift` `D`| Toggle diff pane `Cmd` `Shift` `B`| Toggle Browser pane `Cmd` `Shift` `S`| Select an element in the Browser @@ -272,7 +286,7 @@ `Cmd` `Shift` `E`| Open effort menu `1`–`9`| Select item in an open menu -These shortcuts apply only to the Code tab. The terminal-based [interactive mode shortcuts](</docs/en/interactive-mode#keyboard-shortcuts>), such as `Shift+Tab` to cycle permission modes, do not apply in Desktop. +These shortcuts apply to the Code tab. In Desktop, `Shift+Tab` doesn’t cycle permission modes as it does in the terminal’s [interactive mode](</docs/en/interactive-mode#keyboard-shortcuts>). ### @@ -431,6 +445,25 @@ * Select **Cloud** to continue the session as a [cloud session](</docs/en/claude-code-on-the-web>), with your conversation carried over as a summary. Before you confirm, the dialog states whether your files move too and whether this session is archived once the cloud one is ready. You can’t move a session that runs over SSH or in [WSL](</docs/en/desktop-wsl>) this way. * Select an installed editor or your file manager to open the session’s folder on disk there. + +### + +​ + +Control which sessions appear on your other devices + +A local session shows up on your other devices once [Remote Control](</docs/en/remote-control>) connects it. A connected session appears in the session list at [claude.ai/code](<https://claude.ai/code>) and in the Claude apps on devices signed in to your claude.ai account. A local session connects when you turn Remote Control on for it, or when it connects automatically as it starts: + + * **You turn it on for that session** : with the session’s **Remote Control** switch, or by typing `/remote-control` in its prompt box. + * **It connects when it starts** : new sessions connect automatically while **Connect new sessions to Remote Control** is on in **Settings > Claude Code**. If you’ve never changed that setting, Desktop follows [`remoteControlAtStartup`](</docs/en/settings-reference#remotecontrolatstartup>) in your user or managed settings, then your organization’s default. + +To see whether a session is connected, look at the laptop icon before the session title in the toolbar. The icon is highlighted while the session is connected or connecting. Click it to open the session’s **Remote Control** switch. To keep sessions off your other devices, turn Remote Control off at the level you need: + + * **One session** : turn off its **Remote Control** switch. In a session that connected when it started, typing `/remote-control` leaves Remote Control on and shows `Remote Control is already on. This session connected automatically when it started.` Click **Turn off** on that line to disconnect. + * **New Desktop sessions on this computer** : turn off **Connect new sessions to Remote Control** in **Settings > Claude Code**. If it already shows off, turn it on and then off so Desktop saves your choice. Once saved, it takes precedence over `remoteControlAtStartup` and the defaults. + * **Any session on this computer, including the CLI** : set [`disableRemoteControl`](</docs/en/settings-reference#disableremotecontrol>) to `true` in `~/.claude/settings.json` to stop sessions from connecting. A session that was already connected when you saved the file stays connected until you turn Remote Control off for it. + +To hide a session that already appears on your other devices, archive it in Desktop. Desktop archives the session’s Remote Control copy too, so it leaves the default session list on those devices. To view or delete it there, see [Archive sessions](</docs/en/claude-code-on-the-web#archive-sessions>). ### @@ -673,7 +706,7 @@ Local sessions -The desktop app does not always inherit your full shell environment. On macOS, when you launch the app from the Dock or Finder, it reads your shell profile, such as `~/.zshrc` or `~/.bashrc`, to extract `PATH` and a fixed set of Claude Code variables, but other variables you export there are not picked up. On Windows, the app inherits user and system environment variables but does not read PowerShell profiles. To set environment variables for local sessions and dev servers on any platform, open the environment dropdown in the prompt box, hover over **Local** , and click the gear icon to open the local environment editor. Variables you save here are stored encrypted on your machine and apply to every local session and preview server you start. You can also add variables to the `env` key in your `~/.claude/settings.json` file, though these reach Claude sessions only and not dev servers. See [environment variables](</docs/en/env-vars>) for the full list of supported variables. [Extended thinking](</docs/en/model-config#extended-thinking>) is enabled by default, which improves performance on complex reasoning tasks but uses additional tokens. On the Anthropic API, set `MAX_THINKING_TOKENS` to `0` in the local environment editor to turn thinking off; this has no effect on Opus 5.5, Sonnet 5.5, or the Fable models, which always use extended thinking. With thinking turned off on the Anthropic API, Claude Code sends effort `high` instead of a higher level to models it knows [don’t accept that combination](</docs/en/errors#effort-isnt-available-with-thinking-turned-off>), such as Opus 5. On models with [adaptive reasoning](</docs/en/model-config#adjust-effort-level>), Claude Code ignores the number itself in a positive `MAX_THINKING_TOKENS` value because adaptive reasoning controls thinking depth instead. On Opus 4.6 and Sonnet 4.6, set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` to `1` to use a fixed thinking budget; Fable models, Sonnet 5 and later, and Opus 4.7 and later always use adaptive reasoning and have no fixed-budget mode. +The desktop app does not always inherit your full shell environment. On macOS, when you launch the app from the Dock or Finder, it reads your shell profile, such as `~/.zshrc` or `~/.bashrc`, to extract `PATH` and a fixed set of Claude Code variables, but other variables you export there are not picked up. On Windows, the app inherits user and system environment variables but does not read PowerShell profiles. To set environment variables for local sessions and dev servers on any platform, open the environment dropdown in the prompt box, hover over **Local** , and click the gear icon to open the local environment editor. Variables you save here are stored encrypted on your machine and apply to every local session and preview server you start. You can also add variables to the `env` key in your `~/.claude/settings.json` file, though these reach Claude sessions only and not dev servers. See [environment variables](</docs/en/env-vars>) for the full list of supported variables. [Extended thinking](</docs/en/model-config#extended-thinking>) is enabled by default, which improves performance on complex reasoning tasks but uses additional tokens. On the Anthropic API, set `MAX_THINKING_TOKENS` to `0` in the local environment editor to turn thinking off; this has no effect on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models, which always use extended thinking. With thinking turned off on the Anthropic API, Claude Code sends effort `high` instead of a higher level to models it knows [don’t accept that combination](</docs/en/errors#effort-isnt-available-with-thinking-turned-off>), such as Opus 5. On models with [adaptive reasoning](</docs/en/model-config#adjust-effort-level>), Claude Code ignores the number itself in a positive `MAX_THINKING_TOKENS` value because adaptive reasoning controls thinking depth instead. On Opus 4.6 and Sonnet 4.6, set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` to `1` to use a fixed thinking budget; Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later always use adaptive reasoning and have no fixed-budget mode. #### @@ -715,9 +748,46 @@ ​ +Open an SSH session from a link + +A `claude://code/new` link opens Desktop’s new-session page, and it can name an SSH connection. Put such a link in a runbook, dashboard, or wiki page to open Desktop set up for the right machine and folder. For platforms that strip such links, see [The link renders as plain text instead of being clickable](</docs/en/deep-links#the-link-renders-as-plain-text-instead-of-being-clickable>). SSH links require Claude Desktop v2.110.0 or later. The following link names the user `dev` on `build.example.com`, port 2222, and the folder `/srv/payments`, and fills in a prompt: + + claude://code/new?ssh_host=dev%40build.example.com&ssh_port=2222&ssh_folder=/srv/payments&q=Investigate%20the%20failed%20deploy + +An SSH link takes these parameters, and only `ssh_host` is required: + +Parameter| Value +---|--- +`ssh_host`| `host` or `user@host`, written as in the **SSH host** field. The value can’t start with `-`, and the host part takes only letters, digits, `.`, `_`, `:`, and `-` +`ssh_port`| A port number from 1 to 65535 +`ssh_folder`| A folder on the remote machine. Start it with `/` or `~/`, or use `~` +`q`| URL-encoded text for the prompt box + +An alias from `~/.ssh/config` works as `ssh_host` only for people who have that entry. To match a connection people already have, give the link the same user, host, and port as that connection. When you open the link, Desktop asks you to confirm before it selects the connection: + + * **A connection you already have** : if the host, user, and port match one of your connections, Desktop asks whether to use it, and shows you the connection’s name and host, and the folder if the link names one. + * **A new connection** : otherwise Desktop opens the dialog for adding an SSH connection. When you add the connection, Desktop asks whether to connect before it saves anything, and shows you the host from the link, and the port and folder if the link names them. + +Until you confirm, Desktop doesn’t save the host, port, or folder from the link, and doesn’t select or open a connection with them. If an SSH connection is already selected, the new-session page can still connect to it on its own, as it does without a link, even when the link names the same host. A link can’t carry a key file, a password, or a command. Anyone can write a link, so check what it filled in: + + * **Before you confirm** : check the host and folder. + * **Before you send** : check the prompt and the selected environment. + +Desktop fills in the prompt when the link opens, in place of any text you haven’t sent, and never sends it for you. It treats the prompt as plain text, so a leading `/` or `!` and an `@` file mention don’t act as a command or a mention. If you cancel, the prompt stays in the box and the environment you had selected doesn’t change. A link doesn’t bypass `sshHostAllowlist`. Desktop checks the allowlist when it connects. If the link opens Desktop without a dialog about the connection, look for one of these causes: + + * **You’re signed out** : sign in, then open the link again. + * **Another dialog is open** : close it, then open the link again. + * **The link isn’t valid** : Desktop shows a message that says what to fix, and doesn’t fill in the prompt. + * **Desktop is older than v2.110.0** : earlier versions ignore the SSH parameters and open the new-session page with only the prompt. + * **SSH sessions are turned off** : if your administrator sets the allowlist to an empty array, Desktop refuses SSH links. + +#### + +​ + Pre-configure SSH connections for your team -Administrators can distribute SSH connections to team members by adding `sshConfigs` to a [managed settings](</docs/en/managed-settings>) file. Connections defined this way appear in each user’s environment dropdown automatically and are shown as managed, so users can select them but cannot edit or delete them in the app. The following example pre-configures a single connection: +Administrators can distribute SSH connections to team members by setting `sshConfigs` in [managed settings](</docs/en/managed-settings>). Connections defined this way appear in each user’s environment dropdown automatically and are shown as managed, so users can select them but can’t edit or delete them in the app. The following example pre-configures a single connection: { "sshConfigs": [ @@ -731,7 +801,7 @@ ] } -Each entry requires `id`, `name`, and `sshHost`. The `sshPort` and `sshIdentityFile` fields are optional. Users can also add `sshConfigs` to their own `~/.claude/settings.json`, which is where connections added through the dialog are stored. +Each entry requires `id`, `name`, and `sshHost`. The `sshPort` and `sshIdentityFile` fields are optional. Users can also add `sshConfigs` to their own `~/.claude/settings.json`. #### @@ -739,11 +809,13 @@ Restrict which SSH hosts users can connect to -Administrators can limit Desktop’s SSH sessions to an approved set of hosts by adding `sshHostAllowlist` to a [managed settings](</docs/en/managed-settings>) file. When set, users can only connect to hosts whose resolved hostname matches one of the patterns. Set it to an empty array to disable SSH sessions entirely. The following example allows connections to any host under `devboxes.example.com` and to a single named bastion host: +Administrators can limit Desktop’s SSH sessions to an approved set of hosts by setting `sshHostAllowlist` in [managed settings](</docs/en/managed-settings>). When set, users can only connect to hosts whose resolved hostname matches one of the patterns. Set it to an empty array to disable SSH sessions. The [`sshHostAllowlist` reference entry](</docs/en/settings-reference#sshhostallowlist>) says how an empty array combines with lists in other managed sources. The following example allows connections to any host under `devboxes.example.com` and to a single named bastion host: { "sshHostAllowlist": ["*.devboxes.example.com", "bastion.example.com"] } + +If your organization delivers [server-managed settings](</docs/en/server-managed-settings>), set `sshHostAllowlist` there. By default, Desktop reads the key only from the [highest-ranked managed source that delivers a policy key](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). If that source leaves the key unset, Desktop ignores a list in a lower-ranked MDM policy or managed settings file and treats the key as [unset](</docs/en/settings-reference#sshhostallowlist>). Desktop shows no warning.Also keep the same list on each user’s machine, in the highest-ranked MDM policy or managed settings file there. Desktop fetches server-managed settings at launch and keeps no cached copy, so until a fetch succeeds the machine’s list is the one that applies. Patterns are case-insensitive. `*` matches any host, and `*.example.com` matches `example.com` and any subdomain. Anything else is an exact match. The check runs against the hostname after `~/.ssh/config` resolution via `ssh -G`, so `Host` aliases and `ProxyCommand`/`ProxyJump` entries are permitted as long as the resolved `HostName` matches. `sshHostAllowlist` is read from managed settings only; values in user or project settings are ignored. Only the Claude Desktop app honors this setting; the Claude Code CLI and IDE extensions do not read it, and it does not restrict `ssh` commands run through the Bash tool. It governs which hosts the Desktop app connects to, not network egress, so pair it with your organization’s network or zero-trust controls if you need a hard boundary. @@ -788,15 +860,16 @@ `disableMobileSimulatorTools`| set to `true` to block Claude’s tools for controlling and capturing devices in the [iOS Simulator pane](</docs/en/desktop-ios-simulator#turn-off-simulator-access>). The pane stays usable for the user’s own taps; only Claude’s access is removed. The value must be the JSON boolean `true`; the string `"true"` is ignored. `disableBrowserExternalNavigation`| set to `true` to turn off external browsing in the Browser pane entirely. Neither users nor Claude can navigate to external sites, and localhost dev server previews are unaffected. The value must be the JSON boolean `true`; the string `"true"` is ignored. `sshConfigs`| pre-configure SSH connections that appear in the environment dropdown. Users cannot edit or delete managed connections. -`sshHostAllowlist`| restrict SSH sessions to hosts whose resolved hostname matches one of these patterns. An empty array disables SSH sessions. Read from managed settings only. +`sshHostAllowlist`| restrict SSH sessions to hosts whose resolved hostname matches one of these patterns. Read from managed settings only. `disableDesktopLocalSessions`| set to `true` to turn off Code sessions that run on the device, leaving SSH sessions to other hosts and cloud sessions available. The value must be the JSON boolean `true`. Read from managed settings only. Requires Claude Desktop v1.37937.0 or later. +`disableSshSavedPasswords`| set to `true` to stop Desktop from offering to remember SSH passwords and from using or showing the ones it saved earlier. Turning it on doesn’t delete them. Read from managed settings only. Requires Claude Desktop v1.49585.0 or later. `managedMcpServers`| push MCP server configurations to all users. Available in third-party (3P) Desktop deployments only. In each entry, set a transport of `"http"`, `"sse"`, or `"stdio"`, connection details, and optionally a `toolPolicy` map to restrict which of that server’s tools users can invoke. Deliver it through the managed settings file, MDM, or a Claude apps gateway policy’s [`desktop` block](</docs/en/claude-apps-gateway-config#claude-desktop-overlay>), since 3P deployments don’t receive admin-console settings. To deliver it through the gateway, you need Claude Code v2.1.232 or later on the gateway server. This is the desktop app’s own key; Claude Code reads a [same-named managed setting](</docs/en/managed-mcp#provide-servers-through-managed-settings>) of its own, with a different entry shape. Which managed settings reach a Desktop session depends on where that session runs. Model restrictions such as [`availableModels`](</docs/en/model-config#restrict-model-selection>) are enforced in Desktop’s Claude Code sessions the same way as in the terminal CLI; see [surface coverage](</docs/en/model-config#surface-coverage>). * **Local sessions on this machine** : a managed settings file deployed to disk applies. Managed settings pushed remotely through the admin console also reach these sessions on Anthropic’s API when the session authenticates with an [eligible login or key](</docs/en/server-managed-settings#platform-availability>), following the same [settings precedence](</docs/en/settings#settings-precedence>) as the terminal CLI. * **Cloud sessions** : receive [server-managed settings](</docs/en/server-managed-settings>); device-deployed files don’t reach them, because they run on Anthropic-managed VMs. Sessions routed to a [self-hosted environment](</docs/en/self-hosted-environments>) also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. - * **SSH sessions** : the session reads the managed settings file from the remote host. Desktop itself reads `sshConfigs`, `sshHostAllowlist`, and `disableDesktopLocalSessions` from the local machine’s managed settings. + * **SSH sessions** : the session reads the managed settings file from the remote host. Desktop itself reads `sshConfigs`, `sshHostAllowlist`, `disableSshSavedPasswords`, and `disableDesktopLocalSessions` on the local machine. If you deliver more than one managed source, it reads them from [one by default](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). * **[Cowork](<https://claude.com/docs/cowork/overview>) sessions**: in a Cowork session on this machine, Claude Code never fetches admin-console settings, even when the user signs in with a Team or Enterprise account, and reads policy deployed to the machine unless your Claude Desktop configuration sets `requireCoworkFullVmSandbox`. Remote Cowork sessions receive neither. See [where and when a policy applies](</docs/en/managed-settings#where-and-when-a-policy-applies>) for which device files reach Cowork, and [MCP permission rules](</docs/en/permissions#mcp>) for how `Bash` and `WebFetch` rules apply to Cowork’s tools. In local and SSH sessions, the desktop app delivers each user’s connected claude.ai connectors to Claude Code directly. No MCP setting or `managed-mcp.json` reaches those connectors, whichever settings source or file location you use. To block a connector’s tools in these sessions, use your organization’s [connector tool controls](</docs/en/mcp#organization-controls-on-connector-tools>). [How connectors reach Claude Code](</docs/en/mcp#how-connectors-reach-claude-code>) shows which settings govern connectors in each kind of session. `permissions.disableBypassPermissionsMode` and `disableAutoMode` also work in user and project settings, but placing them in managed settings prevents users from overriding them. For the permission, plugin, and delivery keys only a managed source can set, see [Keys only managed settings can set](</docs/en/managed-settings#managed-only-settings>). @@ -807,10 +880,11 @@ Device management policies -IT teams can manage the desktop app through MDM on macOS or group policy on Windows. Available policies include enabling or disabling the Claude Code feature, controlling auto-updates, and setting a custom deployment URL. +IT teams can manage the desktop app through MDM on macOS, group policy on Windows, or a policy file on Linux. Available policies include enabling or disabling the Claude Code feature, controlling auto-updates on macOS and Windows, and setting a custom deployment URL. * **macOS** : configure via `com.anthropic.claudefordesktop` preference domain using tools like Jamf or Kandji * **Windows** : configure via registry at `SOFTWARE\Policies\Claude` + * **Linux** : configure via a root-owned file at `/etc/claude-desktop/managed-settings.json`, which holds the policy keys as a JSON object. Desktop refuses the file if anyone but root can write to it or to its folder. It’s a different file from Claude Code’s [managed settings file](</docs/en/managed-settings>). ### @@ -841,7 +915,6 @@ assets-proxy.anthropic.com claude.ai a.claude.ai - a-cdn.claude.ai assets.claude.ai downloads.claude.ai *.livepreview.claude.ai @@ -981,7 +1054,7 @@ * **Third-party providers** : Desktop connects to Anthropic’s API by default. To route Desktop through a gateway, or to run the Code tab on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or a self-hosted LLM gateway, follow the links in the Third-party providers row. * **Linux (beta)** : Computer Use isn’t yet available in the Linux desktop app. See [Claude Desktop on Linux](</docs/en/desktop-linux>). - * **Inline code suggestions** : Desktop does not provide autocomplete-style suggestions. It works through conversational prompts and explicit code changes. + * **Inline code suggestions** : Desktop doesn’t offer autocomplete-style code completions. It works through conversational prompts and explicit code changes, and can suggest your next prompt after Claude replies. * **Agent teams** : coordinated teams, where Claude as the team lead assigns tasks to teammates from a shared task list, are available in the [CLI](</docs/en/agent-teams>), not in Desktop. For multi-agent work inside one session, use [dynamic workflows](</docs/en/workflows>), which run in Desktop; Claude can also message and manage your other sessions directly. * **Terminal-dialog commands** : built-in commands that open an interactive panel in the terminal behave differently in the Code tab. Edit [settings files](</docs/en/settings>) directly to manage permission rules and configuration, or run the commands from the standalone CLI. * Commands with no argument form, such as `/permissions`, reply with `isn't available in this environment`.
modified Environment variables View current →
Show diff (120 lines)
--- a/env-vars.md +++ b/env-vars.md @@ -73,7 +73,7 @@ } } -The file you choose controls who the variables apply to: +Claude Code copies these values into its environment as written. No shell processes them, so shorthand such as `~` or `$HOME` stays as typed. For a variable that takes a path, such as `CLAUDE_CONFIG_DIR`, write the absolute path: `"CLAUDE_CONFIG_DIR": "/home/you/.claude-work"`. The file you choose controls who the variables apply to: File| Applies to ---|--- @@ -194,7 +194,7 @@ `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. The effective window is also capped at the model’s context window. 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_AUTO_MODE_SERVER`| Controls whether Claude Code asks the server to [review auto mode actions](</docs/en/permission-modes#server-side-classifier-review>). Set to `0` to use Claude Code’s own classifier requests instead. On a direct connection to the Anthropic API, requires v2.1.281 or later. The linked section lists which sessions ask the server when the variable is unset, and from which version. Requires Claude Code v2.1.271 or later -`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 +`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 on Amazon Bedrock, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and the [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>). See [credential caching and resolution timeout](</docs/en/amazon-bedrock#credential-caching-and-resolution-timeout>). Requires Claude Code v2.1.207 or later `CLAUDE_CODE_BASH_EDIT_DIFF`| Set to `0` to turn off the [diff of the files that changed while a Bash command ran](</docs/en/hooks#bash>), or `1` to record it in every permission mode. Takes precedence over the [`bashEditDiffEnabled`](</docs/en/settings-reference#basheditdiffenabled>) setting. Requires Claude Code v2.1.269 or later `CLAUDE_CODE_BG_TASKS_REPORT_RUNNING`| Set to `0` to make a non-interactive session report an idle status to its host at every turn end, even while background work is still running. By default, the session keeps reporting a running status past turn end while background work such as a background agent or a [workflow](</docs/en/workflows>) run is still live. This keeps a host that watches the status, such as a remote session list, from announcing that Claude is waiting for your input mid-work. Background shell commands, such as a dev server, don’t hold the running status. The running-status default and the `0` opt-out require Claude Code v2.1.269 or later; on earlier versions, set `1` to hold the running status `CLAUDE_CODE_BRIDGE_SESSION_ID`| Set automatically in Bash tool and [hook command](</docs/en/hooks>) subprocesses while the session has an active [Remote Control](</docs/en/remote-control>) connection, and removed when the connection ends. The value is the session’s ID in `session_` form, the same identifier that appears in the session’s `claude.ai/code` URL, so a script can link back to the session that ran it. Requires Claude Code v2.1.199 or later. In [cloud sessions](</docs/en/claude-code-on-the-web>), read `CLAUDE_CODE_REMOTE_SESSION_ID` instead @@ -208,7 +208,7 @@ `CLAUDE_CODE_DEBUG_LOGS_DIR`| Override the debug log file path. Despite the name, this is a file path, not a directory. Requires debug mode to be enabled separately via `--debug`, `/debug`, or the `DEBUG` environment variable: setting this variable alone does not enable logging. The [`--debug-file`](</docs/en/cli-reference#cli-flags>) flag does both at once. Defaults to `~/.claude/debug/<session-id>.txt` `CLAUDE_CODE_DEBUG_LOG_LEVEL`| Minimum log level written to the debug log file. Values: `verbose`, `debug` (default), `info`, `warn`, `error`. Set to `verbose` to include high-volume diagnostics like full status line command output, or raise to `error` to reduce noise `CLAUDE_CODE_DISABLE_1M_CONTEXT`| Set to `1` to disable [1M context window](</docs/en/model-config#extended-context>) support. When set, 1M model variants are unavailable in the model picker, and Claude Code holds sessions on models with a native 1M window, such as [Sonnet 5.5](</docs/en/model-config#sonnet-5-5-and-sonnet-5-context-window>) and the Fable models, to a 200K window; see [Extended context](</docs/en/model-config#extended-context>) for how the hold is enforced. Useful for enterprise environments with compliance requirements. For its role in correcting the window for an unrecognized `[1m]` model ID, 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>) -`CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING`| Set to `1` to disable [adaptive reasoning](</docs/en/model-config#adjust-effort-level>) on Opus 4.6 and Sonnet 4.6 and fall back to the fixed thinking budget controlled by `MAX_THINKING_TOKENS`. Has no effect on [Fable models](</docs/en/model-config#extended-thinking>), Sonnet 5 and later, or Opus 4.7 and later, which always use adaptive reasoning +`CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING`| Set to `1` to disable [adaptive reasoning](</docs/en/model-config#adjust-effort-level>) on Opus 4.6 and Sonnet 4.6 and fall back to the fixed thinking budget controlled by `MAX_THINKING_TOKENS`. Has no effect on [Fable models](</docs/en/model-config#extended-thinking>), Sonnet 5 and later, Haiku 5.5, or Opus 4.7 and later, which always use adaptive reasoning `CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION`| Set to `1` to stop Claude Code from merging [managed settings](</docs/en/managed-settings#precedence-within-the-managed-tier>) `env` blocks per key across admin sources, so only the highest-priority source’s whole `env` block applies, as before v2.1.223. Set it in the environment that launches Claude Code, since Claude Code ignores a copy delivered through a settings `env` block. Requires Claude Code v2.1.223 or later `CLAUDE_CODE_DISABLE_ADVISOR_TOOL`| Set to `1` to disable the [advisor tool](</docs/en/advisor>). The `/advisor` command becomes unavailable, any configured `advisorModel` is ignored, and the `--advisor` flag is accepted but has no effect, so existing scripts that pass it continue to work without errors `CLAUDE_CODE_DISABLE_AGENT_VIEW`| Set to `1` to turn off [background agents and agent view](</docs/en/agent-view>): `claude agents`, `--bg`, `/background`, and the on-demand supervisor. Equivalent to the [`disableAgentView`](</docs/en/settings-reference#disableagentview>) setting @@ -250,7 +250,7 @@ `CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS`| Set to `1` to stop Claude Code from sending the structured-output `output_config.format` field and the `anthropic-beta` value that pairs with it, for an [LLM gateway](</docs/en/llm-gateway-protocol#feature-pass-through>) whose upstream rejects them. This leaves on the other pre-release capabilities that [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`](</docs/en/llm-gateway-protocol#disable-pre-release-capabilities>) turns off. Requires Claude Code v2.1.288 or later `CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT`| Set to `1` to turn off the [critical-path](</docs/en/permission-modes#critical-paths>) check for a recursive `rm` whose target is entirely the output of a command substitution, such as `rm -rf "$(pwd)"`. The other critical-path checks keep running. Set it in the environment that launches Claude Code, since Claude Code ignores a copy delivered through a settings `env` block. Requires Claude Code v2.1.281 or later `CLAUDE_CODE_DISABLE_TERMINAL_TITLE`| Set to `1` to disable automatic terminal title updates based on conversation context. This also skips the background small/fast-model request that [generates a session title](</docs/en/sessions#name-your-sessions>) -`CLAUDE_CODE_DISABLE_THINKING`| Set to `1` to omit the `thinking` parameter from API requests entirely. This is a compatibility option for proxies and gateways that reject the parameter. On models that think by default, omitting the parameter means the model may still think. To explicitly disable [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>) on the Anthropic API, use `MAX_THINKING_TOKENS=0` instead. Neither variable turns thinking off on Opus 5.5, Sonnet 5.5, or the Fable models, which can’t have thinking turned off. On [third-party providers](</docs/en/third-party-integrations>), `MAX_THINKING_TOKENS=0` likewise omits the parameter, so the two variables behave the same there +`CLAUDE_CODE_DISABLE_THINKING`| Set to `1` to omit the `thinking` parameter from API requests entirely. This is a compatibility option for proxies and gateways that reject the parameter. On models that think by default, omitting the parameter means the model may still think. To explicitly disable [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>) on the Anthropic API, use `MAX_THINKING_TOKENS=0` instead. Neither variable turns thinking off on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models, which can’t have thinking turned off. On [third-party providers](</docs/en/third-party-integrations>), `MAX_THINKING_TOKENS=0` likewise omits the parameter, so the two variables behave the same there `CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT`| Set to `1` to skip proactive [auto-compaction](</docs/en/costs#reduce-token-usage>) when Claude Code doesn’t recognize the model ID, such as an [LLM gateway](</docs/en/llm-gateway>) alias. Without this variable, Claude Code compacts at the context window it assumes for the ID. `CLAUDE_CODE_MAX_CONTEXT_TOKENS` can correct the assumed window instead; see [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>) for when each variable applies. Requires Claude Code v2.1.223 or later `CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL`| Set to `1` to disable virtual scrolling in [fullscreen rendering](</docs/en/fullscreen>) and render every message in the transcript. Use this if scrolling in fullscreen mode shows blank regions where messages should appear `CLAUDE_CODE_DISABLE_WEB_FETCH`| Set to `1` to turn off the [WebFetch](</docs/en/tools-reference#webfetch-tool-behavior>) tool. The [WebSearch](</docs/en/tools-reference#websearch-tool-behavior>) tool stays available. Requires Claude Code v2.1.285 or later @@ -276,6 +276,7 @@ `CLAUDE_CODE_FORCE_SESSION_PERSISTENCE`| Set to `1` to force transcript persistence, prompt history, and `claude agents` registration even when this `claude` was launched from inside another Claude Code session. Use when an inherited `CLAUDE_CODE_CHILD_SESSION` value, for example from a `screen` session or a background launcher first started by Claude Code’s Bash tool, causes a genuine top-level session to be misclassified as nested. As of v2.1.178, Claude Code detects the tmux case automatically and ignores the inherited marker, so tmux no longer needs this variable. Also honored on v2.1.169 and earlier; has no effect on v2.1.170 and v2.1.171, where the nested-session detection it overrides was removed `CLAUDE_CODE_FORCE_STRIKETHROUGH`| Set to `1` to force strikethrough rendering for `~~text~~` in Claude’s responses when your terminal supports it but is not auto-detected, such as over SSH without `TERM_PROGRAM` forwarded. Without this, undetected terminals show the literal `~~` markers instead of rendering the text as strikethrough. Requires Claude Code v2.1.186 or later `CLAUDE_CODE_FORCE_SYNC_OUTPUT`| Set to `1` to force-enable DEC private mode 2026 [synchronized output](<https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036>) when your terminal supports it but is not auto-detected. Useful for emulators such as Emacs `eat` that implement BSU/ESU but do not reply to the capability probe. Has no effect under tmux. Unlike `CLAUDE_CODE_NO_FLICKER`, which switches to [fullscreen rendering](</docs/en/fullscreen>), this doesn’t change the renderer +`CLAUDE_CODE_FORCE_TERMINAL_IMAGES`| Set to `1` to draw [mod `Image` elements](</docs/en/plugins/mods/reference#elements>) as pictures when your terminal draws kitty graphics protocol images with Unicode placeholders but is not auto-detected. See [which terminals Claude Code detects](</docs/en/plugins/mods/gallery#image-and-client>) and why it doesn’t help inside tmux or screen `CLAUDE_CODE_FORK_SUBAGENT`| Controls [fork mode](</docs/en/sub-agents#turn-fork-mode-on-or-off>), which lets Claude spawn [forked subagents](</docs/en/sub-agents#fork-the-current-conversation>) itself and is on by default in interactive sessions only. Set to `1` to turn it on in `claude -p` and the Agent SDK as well, or `0` to turn it off in every kind of session. You can run `/subtask` whether or not fork mode is on. The interactive default requires Claude Code v2.1.232 or later; on earlier versions, set the variable to `1` to turn fork mode on `CLAUDE_CODE_FORWARD_SUBAGENT_TEXT`| Set to `1` to emit [subagent](</docs/en/sub-agents>) text and thinking blocks in `claude -p --output-format stream-json` output, the same behavior as the [`--forward-subagent-text`](</docs/en/cli-reference#cli-flags>) flag. Use the variable when a harness invokes `claude` and can’t pass the flag itself. Unlike the flag, which exits with an error outside non-interactive mode with stream-json output, the variable is ignored there so that nested invocations keep working when it’s set process-wide. Requires Claude Code v2.1.211 or later `CLAUDE_CODE_GATEWAY_HINT_HEADERS`| Set to `1` to send the [gateway hint headers](</docs/en/llm-gateway-protocol#gateway-hint-headers>), such as `x-claude-code-request-class` and `x-claude-code-compaction`, on a custom proxy or a third-party provider such as Amazon Bedrock or Claude Platform on AWS. Set to `0` to stop sending them on every connection, including a direct connection to the Anthropic API, where Claude Code sends them by default. Requires Claude Code v2.1.273 or later @@ -299,14 +300,14 @@ `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`| Number of [subagent layers](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>) allowed below the main conversation (default: 3). At the default, subagents can spawn their own subagents, and a subagent at the third layer can’t spawn further; set `1` to turn nesting off. In v2.1.217 through v2.1.218, the default was 1, so a subagent couldn’t spawn its own unless you raised the limit; v2.1.219 raised the default to 3. Accepts a positive whole number in plain digits; anything else is ignored, so the limit can be adjusted but not removed. Requires Claude Code v2.1.217 or later `CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY`| Maximum number of read-only tools and subagents that can execute in parallel (default: 10). Higher values increase parallelism but consume more resources `CLAUDE_CODE_MAX_TURNS`| Cap the number of agentic turns when no explicit limit is passed. Equivalent to passing [`--max-turns`](</docs/en/cli-reference#cli-flags>), which takes precedence when both are set. A value that is not a positive integer is rejected at startup with an error rather than treated as no cap -`CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION`| Cap on the total number of [WebSearch](</docs/en/tools-reference#websearch-tool-behavior>) calls one session can make (default: 200). When Claude reaches the cap, further WebSearch calls return a notice telling it to continue with the information it already gathered. Accepts a positive whole number with no upper bound. Anything else is ignored and the default applies, so the cap can be raised but not turned off. Requires Claude Code v2.1.212 or later +`CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION`| Cap on [WebSearch](</docs/en/tools-reference#session-search-limit>) calls (default: 200). When Claude reaches the cap, further WebSearch calls return a notice telling it to continue with the information it already gathered. Accepts a positive whole number with no upper bound. Anything else is ignored and the default applies, so the cap can be raised but not turned off. Requires Claude Code v2.1.212 or later `CLAUDE_CODE_MCP_ALLOWLIST_ENV`| Set to `1` to spawn stdio MCP servers with only a safe baseline environment plus the server’s configured `env`, instead of inheriting your shell environment `CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS`| Elapsed time in milliseconds before a still-running MCP tool call [moves to a background task](</docs/en/mcp#automatic-backgrounding-of-long-tool-calls>) (default: 120000, or 2 minutes). Set to `0` to turn automatic backgrounding off. Requires Claude Code v2.1.212 or later `CLAUDE_CODE_MCP_STARTUP_WAIT_MS`| How long in milliseconds the first turn of a [non-interactive](</docs/en/headless>) session waits for MCP servers that are still connecting, in place of the default [first-turn wait](</docs/en/agent-sdk/mcp#connection-timing>). When set, the wait covers every pending server. Set to `0` to skip the wait. A [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) server keeps its own `MCP_TIMEOUT` wait regardless of the value. Requires Claude Code v2.1.274 or later `CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT`| Idle timeout in milliseconds for MCP tool calls. When a stdio, HTTP, SSE, WebSocket, or [claude.ai connector](</docs/en/mcp#use-mcp-servers-from-claude-ai>) MCP server sends no response and no progress notification for this long, the tool call aborts with an error instead of waiting for the overall `MCP_TOOL_TIMEOUT`. Overrides the per-transport defaults of 300000 (5 minutes) for network servers and 1800000 (30 minutes) for stdio servers. Set to `0` to disable the idle check. Values below 1000 are raised to one second, and the value is capped at the effective `MCP_TOOL_TIMEOUT`. A per-server `timeout` in `.mcp.json` of at least 1000 raises that server’s idle window to at least the `timeout` value. Doesn’t apply to IDE servers or SDK in-process servers. Requires Claude Code v2.1.187 or later. Before v2.1.203, stdio servers were exempt from the idle timeout `CLAUDE_CODE_MESSAGING_SOCKET`| Set by Claude Code, not by you: in sessions that bind an [inbox socket](</docs/en/cross-session-messaging#the-sessions-inbox-socket>), Claude Code exports that socket’s path to hooks and Bash commands when it binds the socket. In a session that starts with messaging on, Claude Code binds the socket before any hook runs. Other sessions on the machine deliver messages to this path. Each session exports its own socket rather than one inherited from a parent, and messages arriving on it go through the session’s [inbound controls](</docs/en/cross-session-messaging#control-inbound-messages>). Settings `env` blocks can’t set it. Requires Claude Code v2.1.224 or later `CLAUDE_CODE_MESSAGING_TOKEN`| Set by Claude Code, not by you: in sessions that bind an [inbox socket](</docs/en/cross-session-messaging#the-sessions-inbox-socket>), Claude Code exports this per-session token to hooks and Bash commands alongside `CLAUDE_CODE_MESSAGING_SOCKET`. A script posting to the socket can send `{"type":"auth","token":"<token>"}` as its first line to prove it belongs to the session. On native Windows, Claude Code requires this line and closes any connection that doesn’t open with a valid one. The [own-child rules](</docs/en/cross-session-messaging#the-sessions-inbox-socket>) say when Claude Code consults the token. Each session exports its own token, never one inherited from a parent session. Settings `env` blocks can’t set it. Requires Claude Code v2.1.228 or later -`CLAUDE_CODE_NATIVE_CURSOR`| Set to `1` to show the terminal’s own cursor at the input caret instead of a drawn block. The cursor respects the terminal’s blink, shape, and focus settings +`CLAUDE_CODE_NATIVE_CURSOR`| Set to `1` to show the terminal’s own cursor at the input caret instead of a drawn block. The cursor respects the terminal’s blink, shape, and focus settings. Setting `0` reads the same as leaving the variable unset, so it doesn’t bring the drawn block back in a session where the terminal’s own cursor is already on `CLAUDE_CODE_NEW_INIT`| Set to `1` to make `/init` run an interactive setup flow. The flow asks which files to generate, including CLAUDE.md, skills, and hooks, before exploring the codebase and writing them. Without this variable, `/init` generates a CLAUDE.md automatically without prompting `CLAUDE_CODE_NONBLOCKING_STDOUT`| Set to `1` to write terminal output through a second non-blocking file descriptor, so a terminal that stops reading, such as a paused tmux control-mode pane or a stalled SSH connection, can’t freeze Claude Code mid-session. Applies on macOS, Linux, and WSL when stdout is a terminal. Requires Claude Code v2.1.261 or later `CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES`| Limit how many times Claude Code re-sends a [non-streaming request](</docs/en/errors#streaming-response-ended-before-any-complete-data-was-received>) that times out. With `0`, the request fails on the first timeout. Unset by default, so `CLAUDE_CODE_MAX_RETRIES` limits these re-sends. See [Tune retry behavior](</docs/en/errors#tune-retry-behavior>) for the timeout. Requires Claude Code v2.1.285 or later @@ -353,7 +354,7 @@ `CLAUDE_CODE_SHELL`| Set the shell Claude Code uses to run Bash tool commands. Accepts a path to a `bash` or `zsh` binary, for example `/opt/homebrew/bin/bash`. Other shells such as `fish` are not supported. If the value is not a working `bash` or `zsh` path, Claude Code ignores it and falls back to auto-detection. Auto-detection uses your `$SHELL` when it points to `bash` or `zsh`, otherwise it picks the first working `zsh` then `bash` found on your `PATH` and standard install locations `CLAUDE_CODE_SHELL_PREFIX`| Command prefix that wraps shell commands Claude Code spawns: Bash tool calls, [hook](</docs/en/hooks>) commands, [status line](</docs/en/statusline>) commands, and stdio [MCP server](</docs/en/mcp>) startup commands. PowerShell hooks and exec-form hooks run without the prefix. Useful for logging or auditing. Setting a bare executable path such as `/path/to/logger.sh` runs each command as `/path/to/logger.sh '<command>'`. The wrapper receives the command line as a single shell-quoted argument in `$1`, so the wrapper must re-evaluate `$1` with a shell, for example `exec bash -c "$1"`. Treating `$1` as a bare executable path breaks stdio MCP servers that pass arguments such as `npx -y <package>`. For Bash tool calls, `$1` contains the full shell invocation Claude Code assembles, including environment setup, not only the command Claude ran `CLAUDE_CODE_SIMPLE`| Set to `1` to run with a minimal system prompt and only the Bash, file read, and file edit tools. MCP tools from `--mcp-config` are still available. Disables auto-discovery of hooks, skills, custom commands, subagents, installed plugins, MCP servers, auto memory, and CLAUDE.md. Skills in a directory you pass with `--add-dir` still load. OAuth tokens and keychain credentials are not read, so Anthropic authentication must come from `ANTHROPIC_API_KEY` or an `apiKeyHelper` in `--settings`. Equivalent to passing [`--bare`](</docs/en/headless#start-faster-with-bare-mode>) -`CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT`| Set to `1` to use a shorter system prompt and abbreviated tool descriptions on any model. Set to `0`, `false`, `no`, or `off` to opt out even on models where the experiment or server configuration would otherwise enable it. The full tool set, hooks, MCP servers, and CLAUDE.md discovery remain enabled +`CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT`| Choose between Claude Code’s full system prompt and a shorter one with abbreviated tool descriptions. When unset, Haiku 4.5, Sonnet 5, Opus 4.7, and earlier models in those families use the full prompt by default, and newer models use the shorter one. Set to `1` to use the shorter prompt on any model. Set to `0`, `false`, `no`, or `off` to use the full prompt on any model, even where an experiment or server configuration would otherwise select the shorter one. Either prompt keeps the full tool set, hooks, MCP servers, and CLAUDE.md discovery `CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH`| Skip client-side authentication for [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), for gateways that sign requests themselves `CLAUDE_CODE_SKIP_AWS_CRED_CACHE`| Set to `1` to turn off the in-process cache of credentials resolved from the AWS default credential provider chain, so Claude Code resolves the chain on every API request. With the cache off, an SSO-backed profile requests credentials from IAM Identity Center on every request. See [credential caching and resolution timeout](</docs/en/amazon-bedrock#credential-caching-and-resolution-timeout>). Requires Claude Code v2.1.207 or later `CLAUDE_CODE_SKIP_BEDROCK_AUTH`| Skip AWS authentication for Amazon Bedrock (for example, when using an LLM gateway) @@ -372,7 +373,7 @@ `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`| Set to `1` to strip credentials from the environments of the subprocesses Claude Code starts, such as Bash commands, hooks, and stdio MCP servers. The scrub recognizes a credential by its variable name or its value, and it leaves GitHub tokens and proxy settings in place. See What the subprocess environment scrub removes. `claude-code-action` sets this automatically when `allowed_non_write_users` is configured `CLAUDE_CODE_SYNC_PLUGIN_INSTALL`| Set to `1` in non-interactive mode (the `-p` flag) to wait for plugin installation to complete before the first query. Without this, plugins install in the background and may not be available on the first turn. Combine with `CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS` to bound the wait `CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS`| Timeout in milliseconds for synchronous plugin installation. When exceeded, Claude Code proceeds without plugins and logs an error. No default: without this variable, synchronous installation waits until complete -`CLAUDE_CODE_SYNC_SKILLS`| Set to `1` in non-interactive mode with the `-p` flag to make Claude Code download the skills enabled for your claude.ai account in that run and wait for the list of them, up to `CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS`, before it runs the first query. The downloads themselves finish in the background, and Claude waits for a skill’s download when it invokes that skill. Requires claude.ai authentication. Terminal sessions where you sign in with your claude.ai account [download these skills](</docs/en/skills#where-synced-skills-load>) into `~/.claude/skills/synced/` and resync about every 10 minutes without this variable, so set it only when a `-p` run needs your current skills on its first query. Before v2.1.273, terminal sessions downloaded them only in a `-p` run with this variable set. The `synced` folder name is [reserved for this download](</docs/en/skills#where-skills-live>). Before v2.1.227, the skills downloaded into `~/.claude/skills/` directly. Claude Code applies [extra rules to the downloaded skills](</docs/en/skills#how-synced-skills-behave>), such as not running their `!` commands on your machine +`CLAUDE_CODE_SYNC_SKILLS`| Set to `1` in non-interactive mode with the `-p` flag to make Claude Code download the skills enabled for your claude.ai account in that run and wait for the list of them, up to `CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS`, before it runs the first query. Requires claude.ai authentication. Terminal sessions where you sign in with your claude.ai account [sync these skills](</docs/en/skills#where-synced-skills-load>) without this variable, so set it only when a `-p` run needs your current skills on its first query `CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS`| Timeout in milliseconds for the skills resync that runs mid-session when an app built on the [Agent SDK](</docs/en/agent-sdk/typescript#query-object>) reloads skills (default: 30000). When exceeded, the reload continues with whichever skills have arrived, and the remaining downloads finish in the background `CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS`| Timeout in milliseconds for the first query to wait for the initial skill list when `CLAUDE_CODE_SYNC_SKILLS` is set (default: 5000). When exceeded, the first query runs with whichever skills have arrived. The downloads finish in the background either way, and Claude waits for a skill’s download when it invokes that skill `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 @@ -393,10 +394,11 @@ `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_WEBFETCH_DEADLINE_MS`| Upper bound in milliseconds on how long [WebFetch](</docs/en/tools-reference#webfetch-tool-behavior>) waits for a page to download, including any redirects it follows. A download that hasn’t completed by then fails with a deadline error. The default is `300000`, which is five minutes. Set to `0` to remove the limit. Takes plain digits only; a decimal or any other spelling keeps the default. Requires Claude Code v2.1.268 or later +`CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR`| Rate at which a session’s [WebSearch limit](</docs/en/tools-reference#session-search-limit>) refills, in calls per hour. The default is `100` in an interactive terminal session. In a [non-interactive](</docs/en/headless>) session the default is `0`, which turns refill off. Takes plain digits only; any other spelling reads as unset. Requires Claude Code v2.1.290 or later `CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE`| When `CLAUDE_AUTO_BACKGROUND_TASKS` is set to `1`, how long Claude Code waits before each reminder to Claude to check on [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) that are still running. Takes one or more comma-separated waits in whole seconds from `1` to `86400`, such as `600` or `600,1800,3600`. Each value is the wait before the next reminder, and the last value repeats. Takes plain digits only; any other value or spelling reads as unset. When unset, there are no reminders. Requires Claude Code v2.1.283 or later `CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS`| How many agents a single [workflow](</docs/en/workflows>) run executes at once, from `1` to `256`. By default, a run executes up to 16 agents at once, fewer when Claude Code has fewer CPUs available; queued `agent()` calls wait for a free slot. Each running agent’s transcript stays in Claude Code’s memory, so higher values raise memory use. Takes plain digits only; out-of-range values and other spellings keep the default. Requires Claude Code v2.1.269 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. 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_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. In a settings file, write the absolute path. 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`. 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>) @@ -447,7 +449,7 @@ `IS_DEMO`| Set to any non-empty value, such as `1`, to enable demo mode: hides your email and organization name from the header and `/status` output, and skips onboarding. **Setting it to`0` or `false` still enables demo mode**, unlike most on/off variables; unset the variable to turn it off. Useful when streaming or recording a session `MAX_MCP_OUTPUT_TOKENS`| Maximum number of tokens allowed in MCP tool responses (default: 25000). Claude Code displays a warning when output exceeds 10,000 tokens. Tools that declare [`anthropic/maxResultSizeChars`](</docs/en/mcp#raise-the-limit-for-a-specific-tool>) use that character limit for text content instead, but image content from those tools is still subject to this variable. A successful text result longer than 50,000 characters from a tool without that annotation is [saved to a file](</docs/en/mcp#mcp-output-limits-and-warnings>) regardless of this variable `MAX_STRUCTURED_OUTPUT_RETRIES`| Number of attempts Claude Code allows when the model’s response fails validation against the [`--json-schema`](</docs/en/cli-reference#cli-flags>) in non-interactive mode with the `-p` flag; after that many failed attempts with no valid output, the run fails. The same cap applies when a [workflow](</docs/en/workflows>) subagent’s structured output fails validation. Defaults to 5, a first attempt plus four retries -`MAX_THINKING_TOKENS`| Fixed token budget for [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>). Claude Code caps it at one token below the request’s max output tokens and never below 1,024. See `CLAUDE_CODE_MAX_OUTPUT_TOKENS` for how that limit is set. When unset and thinking is enabled, models with [adaptive reasoning](</docs/en/model-config#adjust-effort-level>) choose their own thinking depth, and other models use the cap. Set to `0` to disable thinking on the Anthropic API, except on Opus 5.5, Sonnet 5.5, and the Fable models, which can’t have thinking turned off. On [third-party providers](</docs/en/third-party-integrations>), `0` omits the `thinking` parameter instead. With thinking turned off on the Anthropic API, Claude Code sends effort `high` instead of a higher level to models it knows [don’t accept that combination](</docs/en/errors#effort-isnt-available-with-thinking-turned-off>), such as Opus 5. For a positive value, Claude Code ignores the number itself on adaptive reasoning models, except when `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` turns adaptive reasoning off +`MAX_THINKING_TOKENS`| Fixed token budget for [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>). Claude Code caps it at one token below the request’s max output tokens and never below 1,024. See `CLAUDE_CODE_MAX_OUTPUT_TOKENS` for how that limit is set. When unset and thinking is enabled, models with [adaptive reasoning](</docs/en/model-config#adjust-effort-level>) choose their own thinking depth, and other models use the cap. Set to `0` to disable thinking on the Anthropic API, except on Opus 5.5, Sonnet 5.5, Haiku 5.5, and the Fable models, which can’t have thinking turned off. On [third-party providers](</docs/en/third-party-integrations>), `0` omits the `thinking` parameter instead. With thinking turned off on the Anthropic API, Claude Code sends effort `high` instead of a higher level to models it knows [don’t accept that combination](</docs/en/errors#effort-isnt-available-with-thinking-turned-off>), such as Opus 5. For a positive value, Claude Code ignores the number itself on adaptive reasoning models, except when `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` turns adaptive reasoning off `MCP_CLIENT_SECRET`| OAuth client secret for MCP servers that require [pre-configured credentials](</docs/en/mcp#use-pre-configured-oauth-credentials>). Avoids the interactive prompt when adding a server with `--client-secret` `MCP_CONNECTION_NONBLOCKING`| Controls whether startup waits for MCP servers to connect before the first query. MCP startup is non-blocking by default: servers connect in the background and their tools become available as they finish. Set to `0` to make Claude Code wait for servers to connect before the first query. Servers configured with [`alwaysLoad: true`](</docs/en/mcp#exempt-a-server-from-deferral>) still make startup wait regardless, except when served from the [discovery cache](</docs/en/mcp#server-status-detail>), since their tools must be present when the first prompt is built. In non-interactive mode (`-p`) without `--input-format stream-json`, Claude Code also waits for still-pending servers before the first turn regardless of this variable. When you pass [`--mcp-config`](</docs/en/cli-reference#cli-flags>) explicitly, the wait has a longer deadline; see that flag’s entry for the cached-server exception `MCP_CONNECT_TIMEOUT_MS`| How long blocking MCP startup waits, in milliseconds, for the connection batch before snapshotting the tool list (default: 5000). Applies when `MCP_CONNECTION_NONBLOCKING=0` or for servers marked [`alwaysLoad: true`](</docs/en/mcp#exempt-a-server-from-deferral>). Servers still pending at the deadline keep connecting in the background. Distinct from `MCP_TIMEOUT`, which bounds an individual server’s connect attempt @@ -498,6 +500,7 @@ `VERTEX_REGION_CLAUDE_FABLE_5`| Override region for Claude Fable 5 when using Google Cloud’s Agent Platform. Added in v2.1.170 `VERTEX_REGION_CLAUDE_FABLE_5_1`| Override region for Claude Fable 5.1 when using Google Cloud’s Agent Platform. Added in v2.1.257 `VERTEX_REGION_CLAUDE_HAIKU_4_5`| Override region for Claude Haiku 4.5 when using Google Cloud’s Agent Platform +`VERTEX_REGION_CLAUDE_HAIKU_5_5`| Override region for Claude Haiku 5.5 when using Google Cloud’s Agent Platform. Added in v2.1.293 Standard OpenTelemetry exporter variables (`OTEL_METRICS_EXPORTER`, `OTEL_LOGS_EXPORTER`, `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_PROTOCOL`, `OTEL_EXPORTER_OTLP_HEADERS`, `OTEL_METRIC_EXPORT_INTERVAL`, `OTEL_RESOURCE_ATTRIBUTES`, and signal-specific variants) are also supported. See [Monitoring](</docs/en/monitoring-usage>) for configuration details. Set `CLAUDE_CODE_ENABLE_TELEMETRY` and the OpenTelemetry variables that turn on export, choose its destination, or capture content in your shell, user settings, or managed settings. Claude Code [ignores them in project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>), apart from the off values that section describes. `OTEL_RESOURCE_ATTRIBUTES` and the export interval, timeout, and compression variables, such as `OTEL_METRIC_EXPORT_INTERVAL`, still apply from project and local settings. @@ -546,7 +549,7 @@ * Use [the advisor tool](</docs/en/advisor#requirements>) * Read or reply to [comments on an artifact](</docs/en/artifacts#collect-comments-on-an-artifact>) * Have Claude read [another organization’s public artifact](</docs/en/artifacts#read-an-artifact-shared-with-you>) - * Have Claude Code probe claude.ai connector servers or stdio servers for [MCP protocol revision 2026-07-28](</docs/en/mcp#mcp-client-runtimes>) unless you set `MCP_PROTOCOL_NEGOTIATION=auto` + * Have Claude Code probe claude.ai connector servers for [MCP protocol revision 2026-07-28](</docs/en/mcp#mcp-client-runtimes>) 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 [treat large pastes as pasted rather than typed text](</docs/en/terminal-config#how-claude-treats-pasted-text>); the content behind a `[Pasted text #N]` placeholder reaches Claude unmarked
modified Error reference View current →
--- a/errors.md +++ b/errors.md @@ -120,7 +120,7 @@ `unable to get local issuer certificate`| Network `403` with `x-deny-reason: host_not_allowed` in a cloud or routine session| Network `proxy refused the connection`| Network -`403` with `This GraphQL query is not enabled for this session` in a cloud session| [GitHub proxy](</docs/en/cloud-environments#github-proxy>) +`403` with `GitHub GraphQL is not available from Claude Code sessions` in a cloud session| [GitHub proxy](</docs/en/cloud-environments#github-proxy>) `The cloud environments service returned an empty response` / `The cloud environments service returned a response in an unexpected format`| Network `Couldn't reconnect to your Remote Control session`| Network `N sessions ended while this machine was offline — the environment was cleaned up on the server and can't be resumed.`| Network
modified Speed up responses with fast mode View current →
--- a/fast-mode.md +++ b/fast-mode.md @@ -62,7 +62,7 @@ Opus 5| $10| $50 Opus 4.8| $10| $50 -Fast mode pricing is flat across the full 1M token context window. For the standard Opus rate to compare against, see the [Claude pricing reference](<https://platform.claude.com/docs/en/about-claude/pricing>). The first time you enable fast mode in a conversation, you pay the full fast mode uncached input token price for the entire conversation context. The deeper into a conversation you are, the more this costs, so enabling fast mode from the start is cheaper. The cost applies once per conversation, so toggling fast mode off and on again later does not repeat it. For the mechanism, see [how fast mode interacts with the prompt cache](</docs/en/prompt-caching#turning-on-fast-mode>). +Fast mode pricing is flat across the full 1M token context window. For the standard Opus rate to compare against, see the [Claude pricing reference](<https://platform.claude.com/docs/en/about-claude/pricing>). The first time you enable fast mode in a conversation, you pay the full fast mode uncached input token price for the entire conversation context. The deeper into a conversation you are, the more this costs, so the charge is smallest when you enable fast mode at the start. The cost applies once per conversation, so toggling fast mode off and on again later doesn’t repeat it. For the mechanism, see [how fast mode interacts with the prompt cache](</docs/en/prompt-caching#turning-on-fast-mode>). ###
modified Feature availability View current →
--- a/feature-availability.md +++ b/feature-availability.md @@ -69,7 +69,7 @@ These features work in the local CLI but depend on a server-side capability that not every provider exposes. Feature| Claude subscription| Anthropic Console| Amazon Bedrock| Claude Platform on AWS| Google Cloud’s Agent Platform| Microsoft Foundry ---|---|---|---|---|---|--- -[Web search](</docs/en/tools-reference#websearch-tool-behavior>)| ✓| ✓| ✗| ✓| See note 1| ✓ ([deployments hosted on Anthropic](<https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry#hosting-options>)) +[Web search](</docs/en/tools-reference#websearch-tool-behavior>)| ✓| ✓| ✗| ✓| See note 1| ✓ [Fast mode](</docs/en/fast-mode>)| ✓ ([Owner-enabled](</docs/en/fast-mode#enable-fast-mode-for-your-organization>) on Team and Enterprise)| ✓ (provisioned organizations)| ✗| ✗| ✗| ✗ [Auto mode](</docs/en/auto-mode-config>)| ✓| ✓| See note 2| ✓| See note 2| See note 2 [Advisor](</docs/en/advisor>)| ✓| ✓| ✗| ✗| ✗| ✗ @@ -90,7 +90,7 @@ [Server-managed settings](</docs/en/server-managed-settings>)| ✓ (Team and Enterprise)| ✓ (Team and Enterprise)| ✗| ✗| ✗| ✗ [Zero Data Retention](</docs/en/zero-data-retention>)| ✓ (qualified Enterprise accounts)| ✓ (qualified accounts)| See note 3| ✓ (qualified accounts)| See note 3| See note 3 1 On Google Cloud’s Agent Platform, web search is available for Claude 4 models and later. -2 On these providers, auto mode supports only Claude Sonnet 5 or later, Opus 4.7 or later, and the Fable models. See [Auto mode configuration](</docs/en/auto-mode-config>). For the permission mode a session on these providers starts in, see [Which mode a session starts in](</docs/en/permission-modes#which-mode-a-session-starts-in>). In v2.1.158 through v2.1.206, auto mode on these providers also required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. +2 On these providers, auto mode supports only Claude Sonnet 5 or later, Opus 4.7 or later, Haiku 5.5, and the Fable models. See [Auto mode configuration](</docs/en/auto-mode-config>). For the permission mode a session on these providers starts in, see [Which mode a session starts in](</docs/en/permission-modes#which-mode-a-session-starts-in>). In v2.1.158 through v2.1.206, auto mode on these providers also required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. 3 Subject to your agreement with the cloud provider. 4 Dashboard and API only. [Contribution metrics](</docs/en/analytics#enable-contribution-metrics>) requires a claude.ai Team or Enterprise organization. 5 Requires Claude Code v2.1.224 or later on macOS and Linux, including Linux inside WSL 2. On native Windows, requires Claude Code v2.1.234 or later. With API key authentication, messaging is same-machine only. On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, messaging is same-machine only and requires Claude Code v2.1.248 or later. Claude can find your [cloud sessions](</docs/en/claude-code-on-the-web>) and your sessions on other machines only from a session that is connected to [Remote Control](</docs/en/remote-control>). To connect, you need a claude.ai sign-in and the other [Remote Control requirements](</docs/en/remote-control#requirements>). See [Message sessions on other machines](</docs/en/cross-session-messaging#message-sessions-on-other-machines>). @@ -118,7 +118,7 @@ **Not available:** all features that require a Claude subscription, plus [web search](</docs/en/tools-reference#websearch-tool-behavior>), [fast mode](</docs/en/fast-mode>), [Advisor](</docs/en/advisor>), [Channels](</docs/en/channels>), the [analytics dashboard](</docs/en/analytics>), [server-managed settings](</docs/en/server-managed-settings>), and the [`/design-sync` and `/import` commands](</docs/en/commands#all-commands>).**Partial support:** * [Desktop](</docs/en/desktop>): only via [Claude Desktop on 3P](<https://claude.com/docs/third-party/claude-desktop/overview>) - * [Auto mode](</docs/en/auto-mode-config>): Sonnet 5 or later, Opus 4.7 or later, and Fable models only + * [Auto mode](</docs/en/auto-mode-config>): Sonnet 5 or later, Opus 4.7 or later, Haiku 5.5, and Fable models only * [Cross-session messaging](</docs/en/cross-session-messaging>): between your sessions on this machine only 5 * [Zero Data Retention](</docs/en/zero-data-retention>): subject to your AWS agreement @@ -134,7 +134,7 @@ * [Desktop](</docs/en/desktop>): via [managed settings](<https://claude.com/docs/third-party/claude-desktop/configuration>) or [Claude Desktop on 3P](<https://claude.com/docs/third-party/claude-desktop/overview>) * [Web search](</docs/en/tools-reference#websearch-tool-behavior>): Claude 4 models and later - * [Auto mode](</docs/en/auto-mode-config>): Sonnet 5 or later, Opus 4.7 or later, and Fable models only + * [Auto mode](</docs/en/auto-mode-config>): Sonnet 5 or later, Opus 4.7 or later, Haiku 5.5, and Fable models only * [Cross-session messaging](</docs/en/cross-session-messaging>): between your sessions on this machine only 5 * [Zero Data Retention](</docs/en/zero-data-retention>): subject to your Google Cloud agreement @@ -143,8 +143,7 @@ **Not available:** all features that require a Claude subscription, plus [fast mode](</docs/en/fast-mode>), [Advisor](</docs/en/advisor>), [Channels](</docs/en/channels>), [GitLab CI/CD](</docs/en/gitlab-ci-cd>), the [analytics dashboard](</docs/en/analytics>), [server-managed settings](</docs/en/server-managed-settings>), and the [`/design-sync` and `/import` commands](</docs/en/commands#all-commands>).**Partial support:** * [Desktop](</docs/en/desktop>): only via [Claude Desktop on 3P](<https://claude.com/docs/third-party/claude-desktop/overview>) - * [Web search](</docs/en/tools-reference#websearch-tool-behavior>): [deployments hosted on Anthropic](<https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry#hosting-options>) only - * [Auto mode](</docs/en/auto-mode-config>): Sonnet 5 or later, Opus 4.7 or later, and Fable models only + * [Auto mode](</docs/en/auto-mode-config>): Sonnet 5 or later, Opus 4.7 or later, Haiku 5.5, and Fable models only * [Cross-session messaging](</docs/en/cross-session-messaging>): between your sessions on this machine only 5 * [Zero Data Retention](</docs/en/zero-data-retention>): subject to your Azure agreement
modified Interface gallery for mods View current →
--- a/gallery.md +++ b/gallery.md @@ -347,7 +347,13 @@ `Image` and `Client` -Two more elements have no sample here. `Image` draws a PNG or raw pixels in the terminal. `Client` is a region that a second file of yours draws, for animation and pointer input. The [elements reference](</docs/en/plugins/mods/reference#elements>) lists their props. +Two more elements have no sample here. `Image` draws a PNG or raw pixels in the terminal. `Client` is a region that a second file of yours draws, for animation and pointer input. The [elements reference](</docs/en/plugins/mods/reference#elements>) lists their props. Unless Claude Code detects that the terminal draws kitty graphics protocol images with Unicode placeholders, the user sees an `Image`’s `alt` text, dimmed, in place of the picture. Write `alt` text that stands on its own. Detection runs at startup: it succeeds in kitty 0.28 or later and in Ghostty, once the terminal answers Claude Code’s graphics query, and fails in these cases: + + * **Other terminals** : any terminal that isn’t one of those two, or that doesn’t answer the query. + * **tmux and screen** : a session running inside tmux or screen, in any terminal, kitty and Ghostty included. + * **Background sessions** : every [background session](</docs/en/agent-view>), whatever terminal it’s attached from. + +If your mod’s users see the dimmed text in a terminal that does draw those placeholder images, they can set [`CLAUDE_CODE_FORCE_TERMINAL_IMAGES`](</docs/en/env-vars>) to `1`, which skips detection. Inside tmux or screen that doesn’t help: the `alt` text goes away, and Claude Code sends the picture without wrapping it for tmux or screen passthrough. ##
modified Claude Code GitHub Actions View current →
--- a/github-actions.md +++ b/github-actions.md @@ -124,11 +124,13 @@ Permission| Access ---|--- Actions| Read and write +Administration| Read Checks| Read and write Contents| Read and write Discussions| Read and write Issues| Read and write Members| Read +Merge queues| Read Metadata| Read Pull requests| Read and write Repository hooks| Read and write
modified Glossary View current →
--- a/glossary.md +++ b/glossary.md @@ -196,7 +196,7 @@ Effort level -A setting that controls adaptive reasoning, which lets the model decide whether and how much to think on each step. Higher effort means more thinking tokens and deeper reasoning; lower effort is faster and cheaper. Effort is supported on Fable models, on Opus 4.6 and later, and on Sonnet 4.6 and later. Learn more: [Adjust effort level](</docs/en/model-config#adjust-effort-level>) +A setting that controls adaptive reasoning, which lets the model decide whether and how much to think on each step. Higher effort means more thinking tokens and deeper reasoning; lower effort is faster and cheaper. Effort is supported on Fable models, on Opus 4.6 and later, on Sonnet 4.6 and later, and on Haiku 5.5. Learn more: [Adjust effort level](</docs/en/model-config#adjust-effort-level>) ### @@ -304,7 +304,7 @@ Output style -A configuration that changes the instructions Claude Code gives Claude, to set response behavior, tone, or format. Unlike CLAUDE.md, which adds project context alongside Claude Code’s default instructions, a custom output style can replace the default software engineering instructions. Learn more: [Output styles](</docs/en/output-styles>) +A configuration that changes the instructions Claude Code gives Claude, to set response behavior, tone, or format. Unlike CLAUDE.md, which adds project context alongside Claude Code’s default instructions, a custom output style adds its own instructions and can leave out the default software engineering instructions. Learn more: [Output styles](</docs/en/output-styles>) ## @@ -410,7 +410,7 @@ Settings layers -The hierarchy Claude Code reads configuration from, in precedence order from highest to lowest: managed policy, command-line arguments, local settings at `.claude/settings.local.json`, project settings at `.claude/settings.json`, then user settings at `~/.claude/settings.json`. Arrays merge across layers; scalars at a higher layer override lower ones. See [Settings precedence](</docs/en/settings#settings-precedence>). Learn more: [Settings files](</docs/en/settings#where-settings-live>) +The hierarchy Claude Code reads configuration from, in precedence order from highest to lowest: managed policy, settings you pass with the `--settings` flag, local settings at `.claude/settings.local.json`, project settings at `.claude/settings.json`, then user settings at `~/.claude/settings.json`. Arrays merge across layers; scalars at a higher layer override lower ones. See [Settings precedence](</docs/en/settings#settings-precedence>). Learn more: [Settings files](</docs/en/settings#where-settings-live>) ###
modified Run Claude Code programmatically View current →
--- a/headless.md +++ b/headless.md @@ -179,12 +179,26 @@ Follow subagent messages -Messages from [subagents](</docs/en/sub-agents>) appear in the stream as `assistant` and `user` messages whose `parent_tool_use_id` field is the ID of the tool call that spawned the subagent. Messages from the main conversation carry `null` in that field. The first message from a subagent running in the [foreground](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) is a `user` message carrying the prompt that drives it. After that first message, Claude Code emits: - - * **By default** : the subagent’s `tool_use` and `tool_result` blocks. - * **With[`--forward-subagent-text`](</docs/en/cli-reference#cli-flags>) or [`CLAUDE_CODE_FORWARD_SUBAGENT_TEXT`](</docs/en/env-vars>)**: the subagent’s text and thinking blocks too, so you can reconstruct each subagent’s transcript. This requires Claude Code v2.1.211 or later. - -When you enable either option, Claude Code forwards messages from [subagents at every nesting depth](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>), whether each one was spawned with the Agent tool or started as a [forked skill](</docs/en/skills#run-skills-in-a-subagent>). Messages of subagents that a forked skill spawns, and of forked skills started inside a subagent or another forked skill, require Claude Code v2.1.275 or later. In `parent_tool_use_id`, the nested subagent’s messages carry the ID of the Agent or Skill tool call that started it, so you can rebuild the full nesting tree by following those IDs. Before v2.1.219, messages from nested subagents didn’t appear in the stream. Skills that [run in a subagent](</docs/en/skills#run-skills-in-a-subagent>) appear in the stream the same way: the forked skill’s first message is a `user` message carrying the skill content that drives the run. If you enable either option, the stream also carries the forked skill’s text and thinking blocks. Before v2.1.265, only a forked skill’s `tool_use` and `tool_result` blocks appeared in the stream. +Messages from [subagents](</docs/en/sub-agents>) and from skills that [run in a subagent](</docs/en/skills#run-skills-in-a-subagent>) appear in the stream as `assistant` and `user` messages. Their `parent_tool_use_id` field says which run each one belongs to. Messages from the main conversation carry `null` in that field. The first message from a forked skill, or from a subagent running in the [foreground](</docs/en/sub-agents#run-subagents-in-foreground-or-background>), is a `user` message carrying the prompt or skill content that drives it. After that first message, Claude Code emits: + + * **By default** : the run’s `tool_use` and `tool_result` blocks. + * **With[`--forward-subagent-text`](</docs/en/cli-reference#cli-flags>) or [`CLAUDE_CODE_FORWARD_SUBAGENT_TEXT`](</docs/en/env-vars>)**: the run’s text and thinking blocks too, so you can reconstruct each run’s transcript. + +When you enable either option, Claude Code forwards messages from [subagents at every nesting depth](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>), whether each one was spawned with the Agent tool or started as a forked skill. In `parent_tool_use_id`, the nested subagent’s messages carry the ID of the Agent or Skill tool call that started it, so you can rebuild the full nesting tree by following those IDs. A run that Claude starts with a tool call carries that tool call’s ID. A forked skill that you start by passing `/<skill-name>` as the prompt has no tool call, so its messages carry a `forked-command-` value instead and arrive after it finishes. Find how the run started in the first column: + +How the run starts| `parent_tool_use_id`| When its messages arrive +---|---|--- +Claude calls the Agent tool from the main conversation| The ID of that Agent `tool_use` block| While the subagent works +Claude calls the Skill tool for a forked skill from the main conversation| The ID of that Skill `tool_use` block| While the forked skill works +You pass `/<skill-name>` as the prompt| A value that starts with `forked-command-`| Together and in order after the forked skill finishes + +For a forked skill started from the prompt, match `parent_tool_use_id` on the `forked-command-` prefix, because the name after it can differ from the one you typed. If some of these messages are missing from your stream, check your Claude Code version against these minimums: + + * **`--forward-subagent-text` and `CLAUDE_CODE_FORWARD_SUBAGENT_TEXT`**: v2.1.211 or later + * **Forwarding at every nesting depth** : v2.1.219 or later + * **A forked skill that Claude starts with the Skill tool from the main conversation** : v2.1.86 or later for its `tool_use` and `tool_result` blocks, and v2.1.265 or later for its first `user` message and its text and thinking blocks + * **Messages of subagents that a forked skill spawns, and of forked skills started inside a subagent or another forked skill** : v2.1.275 or later + * **Messages of a forked skill you start by passing`/<skill-name>` as the prompt**: v2.1.287 or later ####
modified Interactive mode View current →
--- a/interactive-mode.md +++ b/interactive-mode.md @@ -34,7 +34,7 @@ `Ctrl+Enter` or `Ctrl+X Ctrl+S`| Send queued messages now| Sends your queued messages, and your draft with them, right away. When Claude Code sends what you queued covers what happens to the turn Claude is working on. In shell mode, the key only queues your command. In terminals that don’t report extended keys, `Ctrl+Enter` arrives as plain `Enter`; `Ctrl+X Ctrl+S` works in any terminal. Requires Claude Code v2.1.275 or later `Shift+Tab`, or `Alt+M` on Windows when the Node or Bun runtime doesn’t enable VT input mode| Cycle permission modes| Cycle through `default` (labeled Manual in the mode indicator), `acceptEdits`, `plan`, and, when available, `bypassPermissions` and then `auto`. From `auto`, the first press switches to `default`. See [permission modes](</docs/en/permission-modes>). On a file permission prompt, the same key closes an open [comment field](</docs/en/permissions#add-a-comment-when-you-answer-a-permission-prompt>). With no field open, it selects the option that allows the action for the rest of the session, when the prompt offers that option `Option+P` (macOS) or `Alt+P` (Windows/Linux)| Switch model| Switch models without clearing your prompt -`Option+T` (macOS) or `Alt+T` (Windows/Linux)| Toggle extended thinking| Enable or disable extended thinking mode. Has no effect on Opus 5.5, Sonnet 5.5, or the Fable models, which always use extended thinking. Works on macOS without configuring Option as Meta +`Option+T` (macOS) or `Alt+T` (Windows/Linux)| Toggle extended thinking| Enable or disable extended thinking mode. Has no effect on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models, which always use extended thinking. Works on macOS without configuring Option as Meta `Option+O` (macOS) or `Alt+O` (Windows/Linux)| Toggle fast mode| Enable or disable [fast mode](</docs/en/fast-mode>) ###
modified Draw in the interface with a mod View current →
--- a/interface.md +++ b/interface.md @@ -722,6 +722,7 @@ Because the `ui.render` hook read `count`, Claude Code runs the hook again each time the button writes it. These rules apply to the code: * **Write`plugin` and `key` as string literals**: `claude plugin validate` reads them from your source + * **Hold the result of each`atom` call in a `const`**: if you declare `count` with `let`, validation fails with `takes a source the scan can read` * **Declare every value in the type declaration file** : otherwise validation fails with `hello-tabs.count is not declared` * **Write from a callback or another event’s hook** : a `ui.render` hook can read state and can’t write it, so write from `onPress`, `onSubmit`, or a hook for another event
modified Customize keyboard shortcuts View current →
--- a/keybindings.md +++ b/keybindings.md @@ -62,6 +62,9 @@ `EffortSlider`| Effort slider opened by `/effort` `Select`| Generic select/list components `Plugin`| Plugin dialog (browse, discover, manage) +`AbovePrompt`| The band above the prompt, or a button in it, has keyboard focus +`AbovePromptInput`| An input field in the band above the prompt or in a mod’s pane has keyboard focus +`AbovePromptSelect`| A select in the band above the prompt or in a mod’s pane has keyboard focus `Pane`| A pane drawn by a [mod](</docs/en/plugins/mods/interface#know-which-keys-your-mod-can-receive>) has keyboard focus `PaneField`| An input field or select in a mod’s pane has keyboard focus `Agents`| [Agent view](</docs/en/agent-view>) (`claude agents`) @@ -309,10 +312,11 @@ ---|---|--- `footer:next`| Right| Next footer item `footer:previous`| Left| Previous footer item -`footer:up`| Up| Navigate up in footer (deselects at top) -`footer:down`| Down| Navigate down in footer +`footer:up`| Up, Ctrl+P| Navigate up in footer (deselects at top) +`footer:down`| Down, Ctrl+N| Navigate down in footer `footer:openSelected`| Enter| Open selected footer item `footer:clearSelection`| Escape| Clear footer selection +`footer:close`| x| Stop the selected [agent](</docs/en/sub-agents#observe-and-steer-running-forks>) or [workflow](</docs/en/workflows#manage-runs>), or dismiss its row if it’s no longer running `footer:dismiss`| (unbound)| Binding a key to this action has no effect, and a `keybindings.json` that names it remains valid. Before v2.1.281, Backspace and Delete were bound to it and dismissed the selected artifact link from the footer. While a footer item is selected, such as a row in the agent panel below the prompt, `Enter` opens it even when you rebind `Enter` in the `Chat` context to `chat:queueSubmit` or `chat:newline`. `Chat` bindings on keys the `Footer` context doesn’t bind, such as `Shift+Tab` for `chat:cycleMode`, keep working while an item is selected. @@ -446,6 +450,56 @@ `plugin:toggle`| Space| Toggle plugin selection `plugin:install`| I| Install selected plugins `plugin:favorite`| F| Favorite the selected plugin so it sorts near the top of the Installed tab + +### + +​ + +Above-prompt actions + +Actions for the band above the prompt, the shared strip where [mods](</docs/en/plugins/mods/interface#pick-where-to-draw>) draw buttons, input fields, and selects. `abovePrompt:toggle` and `abovePrompt:focus` apply in the `Chat` context. The other actions apply in the context of whatever has keyboard focus in the band or a pane. + +Action| Default| Description +---|---|--- +`abovePrompt:toggle`| Ctrl+X Ctrl+A| Collapse the band to a one-row hint, or expand it again +`abovePrompt:focus`| Ctrl+X Tab| Move keyboard focus into the band, then to each open pane, and from the last pane back to the prompt +`abovePrompt:next`| Tab| Focus the next control +`abovePrompt:previous`| Shift+Tab| Focus the previous control +`abovePrompt:press`| Enter| Press the focused button, submit the focused input field, or pick the highlighted option in a select +`abovePrompt:leave`| Escape| Return keyboard focus to the prompt +`abovePrompt:highlightNext`| Down| Highlight the next option in a focused select +`abovePrompt:highlightPrevious`| Up| Highlight the previous option in a focused select + +Two contexts bind more keys to these actions by default: + + * **`AbovePrompt`** : Right and Left also run `abovePrompt:next` and `abovePrompt:previous`, and Space also runs `abovePrompt:press` + * **`AbovePromptInput`** : Down and Up also run `abovePrompt:next` and `abovePrompt:previous` + +The `AbovePrompt` context also binds Up, Down, PageUp, PageDown, Home, and End to the pane scroll actions `pane:scrollUp` through `pane:bottom`, so to change one of those keys for the band, bind the scroll action in an `AbovePrompt` block. + +### + +​ + +Pane actions + +Actions for a pane drawn by a [mod](</docs/en/plugins/mods/interface#know-which-keys-your-mod-can-receive>). The scroll, resize, and close actions apply in the `Pane` context. `pane:close` also applies in the `PaneField` context, so it works while one of the pane’s fields has focus. `pane:next` and `pane:previous` apply in the `Global` context while more than one pane is open. + +Action| Default| Description +---|---|--- +`pane:scrollUp`| Up| Scroll the pane up when it has more rows than it can show +`pane:scrollDown`| Down| Scroll the pane down when it has more rows than it can show +`pane:pageUp`| PageUp| Scroll the pane up a page +`pane:pageDown`| PageDown| Scroll the pane down a page +`pane:top`| Home| Jump to the top of the pane +`pane:bottom`| End| Jump to the bottom of the pane +`pane:grow`| Ctrl+X Left, Ctrl+X Up| Give the pane more room: width when it sits beside the transcript, height when it sits above the prompt +`pane:shrink`| Ctrl+X Right, Ctrl+X Down| Give the pane less room: width when it sits beside the transcript, height when it sits above the prompt +`pane:close`| Ctrl+X X| Close the pane +`pane:next`| (unbound)| Show the next open pane +`pane:previous`| (unbound)| Show the previous open pane + +The `Pane` context also binds Tab, Shift+Tab, Enter, and Escape to the same above-prompt actions as the band, and a pane’s input fields and selects use the `AbovePromptInput` and `AbovePromptSelect` contexts. [Keyboard focus and hotkeys](</docs/en/plugins/mods/interface#know-which-keys-your-mod-can-receive>) lists what each key does in a pane. ###
modified Connect Claude Code to an LLM gateway View current →
--- a/llm-gateway-connect.md +++ b/llm-gateway-connect.md @@ -204,7 +204,12 @@ * **Distributed by an administrator** : if your organization has [deployed the configuration](</docs/en/llm-gateway-rollout#distribute-through-managed-settings>), the desktop app routes through the gateway with no setup on your part * **Configured locally** : for devices without an administrator-distributed configuration, open Help → Troubleshooting → Enable Developer Mode, which restarts the app with a Developer menu. Then open Developer → Configure Third-Party Inference and enter your gateway base URL. An administrator-distributed configuration takes precedence and makes this form read-only -With the gateway configuration active, the desktop app runs sessions on your local machine only: the environment picker doesn’t offer SSH sessions or Anthropic-hosted cloud environments, and [Remote Control](</docs/en/remote-control>) is unavailable. To use Claude Code on a remote host through the gateway, run the CLI on that host with `ANTHROPIC_BASE_URL` and the gateway credential set there. If the desktop app shows `Gateway was unreachable`, the app couldn’t reach the configured base URL at startup; check the URL and network path with the curl test above. +With the gateway configuration active, the environment picker doesn’t offer Anthropic-hosted cloud environments, and [Remote Control](</docs/en/remote-control>) is unavailable. SSH sessions are in beta with a gateway configuration and require Claude Desktop v1.40609.0 or later. Before you connect, check the allowlist and the gateway’s address: + + * **Allowed hosts** : SSH sessions are off by default. To turn them on, you or your administrator lists the allowed hosts in the [`sshHostAllowlist`](<https://claude.com/docs/third-party/claude-desktop/configuration#sshhostallowlist>) key of the third-party inference configuration + * **Gateway address** : the remote machine connects to the gateway itself, so a gateway at `localhost` on your computer doesn’t work for SSH sessions + +See [SSH remote sessions in Claude Desktop on 3P](<https://claude.com/docs/third-party/claude-desktop/ssh-remote-sessions>). You can also run the CLI on the remote host with `ANTHROPIC_BASE_URL` and the gateway credential set there. If the desktop app shows `Gateway was unreachable`, the app couldn’t reach the configured base URL at startup; check the URL and network path with the curl test above. ###
modified Claude Code gateway compatibility guide View current →
--- a/llm-gateway-protocol.md +++ b/llm-gateway-protocol.md @@ -192,7 +192,7 @@ Header| What to return and why ---|--- -`content-type`| Return `text/event-stream` on streamed Anthropic Messages-format responses, and `application/vnd.amazon.eventstream`, unmodified, on Amazon Bedrock-format responses, where [a different type fails the request](</docs/en/amazon-bedrock#streaming-errors-behind-a-gateway-or-proxy>). Streaming lists which connections run stall detection on these streams +`content-type`| Return `text/event-stream` on streamed Anthropic Messages-format responses, and `application/vnd.amazon.eventstream`, unmodified, on Amazon Bedrock-format responses, where [a different type fails the request](</docs/en/amazon-bedrock#streaming-errors-behind-a-gateway-or-proxy>) `retry-after`| Return integer seconds rather than an HTTP date. Claude Code waits at least that long before the next [automatic retry](</docs/en/errors#automatic-retries>), and outside [`CLAUDE_CODE_RETRY_WATCHDOG`](</docs/en/env-vars>) sessions a value above 60 stops the retries and shows the error at once `x-should-retry`| Pass the upstream’s value through unchanged. Claude Code reads this header as one input when deciding whether to retry a failed request: `true` marks the response retryable and `false` marks it not retryable. For retry counts, backoff, and which failures Claude Code retries, see [automatic retries](</docs/en/errors#automatic-retries>) `anthropic-ratelimit-unified-*`| Forward the upstream’s values unchanged on every response. Claude Code reads them on successful responses to show usage against plan limits to developers signed in with claude.ai, and on a `429` to tell a plan limit or spend cap from a temporary throttle; see [usage limits](</docs/en/errors#usage-limits>)
modified Control MCP server access for your organization View current →
--- a/managed-mcp.md +++ b/managed-mcp.md @@ -331,15 +331,28 @@ How `serverUrl` entries match -URLs support `*` wildcards anywhere in the pattern, including the scheme. Hostname matching is case-insensitive and ignores a trailing FQDN dot, so `https://Mcp.Example.com/*` matches `https://mcp.example.com/api`. Paths stay case-sensitive. The table shows what common patterns allow: +URLs support `*` wildcards, including `*` as the whole scheme. Hostname matching is case-insensitive and ignores a trailing FQDN dot, so `https://Mcp.Example.com/*` matches `https://mcp.example.com/api`. Paths stay case-sensitive. If you give no port, how you write the hostname decides whether the pattern matches only the scheme’s default port or every port: + + * **Hostname written out in full** : the default port only, 443 for `https` and 80 for `http` + * **Hostname with a`*` in it**: every port + +The table shows what common patterns allow: Pattern| Allows ---|--- -`https://mcp.example.com/*`| All paths on a specific domain -`https://mcp.example.com`| Also all paths on that domain. A pattern with no path matches any path -`https://*.example.com/*`| Any subdomain of `example.com` +`https://mcp.example.com/*`| All paths on a specific domain, on port 443 only +`https://mcp.example.com`| Also all paths on that domain, on port 443 only. A pattern with no path matches any path +`https://mcp.example.com:8443/*`| All paths on that domain, on port 8443 only +`https://mcp.example.com:*/*`| All paths on that domain, on any port, 443 included +`https://*.example.com/*`| Any subdomain of `example.com`, on any port `http://localhost:*/*`| Any port on localhost -`*://mcp.example.com/*`| Any scheme to a specific domain +`*://mcp.example.com/*`| Any scheme to a specific domain, each scheme on its default port only + +Entries in `deniedMcpServers` match ports the same way, so choose an entry for `staging.example.com` by the ports and schemes you need to block: + + * `https://staging.example.com/*`: blocks `https` servers on that host on port 443 only, so it doesn’t block a server at `https://staging.example.com:8443/api` + * `https://staging.example.com:*/*`: blocks `https` servers on that host on every port + * `*://staging.example.com:*/*`: blocks that host over any scheme and on any port #### @@ -500,6 +513,7 @@ ---|--- HTTP server at `https://mcp.example.com/api`| Allowed: matches allowlist URL pattern, no denylist match HTTP server at `https://staging.example.com/api`| Blocked: matches both, but the denylist takes precedence +HTTP server at `https://staging.example.com:8443/api`| Allowed: matches allowlist URL pattern, no denylist match on this port HTTP server at `https://other.com/mcp`| Blocked: doesn’t match the allowlist ###
modified Marketplace reference View current →
--- a/marketplace-reference.md +++ b/marketplace-reference.md @@ -480,6 +480,7 @@ `Claude Code cannot install plugin "x". Each part of a plugin id (plugin@marketplace) may use only the letters a-z and A-Z, digits, ".", "_" and "-", and must start with a letter or digit. Change this entry's "name".`| Error| `plugins[i].name` `Duplicate plugin name "x" found in marketplace`| Error| Two entries share a `name` `plugins.i.source: Invalid input`| Error| The entry’s `source` matches no type. See Invalid input on a source +`plugins.i.source: Invalid string: must start with "./"`| Error| A relative-path `source` without the leading `./`. Before v2.1.285, this mistake printed `Invalid input` instead `plugins[i].source: Path contains "..": <path>`| Error| A relative `source` that escapes the marketplace root `source.source: 'unsupported' is a parse-time placeholder and cannot be authored`| Error| `plugins[i].source` `Plugin "x" sets headersHelper but is not "strict": false`| Error| `plugins[i].headersHelper`, on an `archive` entry @@ -508,10 +509,11 @@ `Invalid input` on a `source` means the object matched no source type. Check for these causes: - * A relative path that doesn’t start with `./`, other than `"."` or a bare name under `metadata.pluginRoot` * An `npm` `package` containing `..` * A `source` type that isn’t one of the plugin sources * A known type with a required field missing or of the wrong type, such as `github` without `repo` + +A relative path that doesn’t start with `./`, other than `"."` or a bare name under `metadata.pluginRoot`, fails with `Invalid string: must start with "./"`. Before v2.1.285, it printed `Invalid input` like the causes above. ###
modified How Claude remembers your project View current →
--- a/memory.md +++ b/memory.md @@ -238,7 +238,7 @@ Share rules across projects with symlinks -The `.claude/rules/` directory supports symlinks, so you can maintain a shared set of rules and link them into multiple projects. Circular symlinks are detected and handled gracefully. Claude Code treats a symlink whose target is outside your working directory like an external import. The linked rules don’t load until you approve external imports for the project, and after that only the ones without a `paths` field load. Claude Code asks for that approval only when a project memory file imports a file outside the working directory with `@path`, not for symlinks alone. To load shared rules without that approval, keep them in `~/.claude/rules/`, where they apply to every project on your machine. This example links both a shared directory and an individual file: +The `.claude/rules/` directory supports symlinks, so you can maintain a shared set of rules and link them into multiple projects. Circular symlinks are detected and handled gracefully. Claude Code treats a symlink whose target is outside your working directory like an external import. The linked rules don’t load until you approve external imports for the project, and after that only the ones without a `paths` field load. Claude Code asks for that approval once per project, in a dialog at the start of an interactive session. The dialog lists the linked rule files alongside any external `@path` imports. To load shared rules without that approval, keep them in `~/.claude/rules/`, where they apply to every project on your machine. This example links both a shared directory and an individual file: ln -s ~/shared-claude-rules .claude/rules/shared ln -s ~/company-standards/security.md .claude/rules/security.md
modified Claude Code on Microsoft Foundry View current →
--- a/microsoft-foundry.md +++ b/microsoft-foundry.md @@ -40,26 +40,52 @@ 2\. Configure Azure credentials -Claude Code supports three authentication methods for Microsoft Foundry. Choose the method that best fits your security requirements. **Option A: API key authentication** +Claude Code supports three authentication methods for Microsoft Foundry. Choose the method that best fits your security requirements: - 1. Navigate to your resource in the Microsoft Foundry portal - 2. Go to the **Endpoints and keys** section + * API key: you copy a key from the Microsoft Foundry portal and set it as `ANTHROPIC_FOUNDRY_API_KEY` + * Microsoft Entra ID: Claude Code gets tokens through the Azure SDK default credential chain, for example from an `az login` session, so there’s no API key to store + * Bearer token: another process obtains a Microsoft Entra ID access token and you pass it in `ANTHROPIC_FOUNDRY_AUTH_TOKEN` + +When using Microsoft Foundry, the `/logout` command is unavailable since authentication is handled through Azure credentials. + +#### + +​ + +Use an API key + +Copy a key from the Microsoft Foundry portal, then set it as an environment variable: + + 1. Go to your resource in the Microsoft Foundry portal + 2. Open the **Endpoints and keys** section 3. Copy **API Key** 4. Set the environment variable, replacing `your-azure-api-key` with the key you copied: export ANTHROPIC_FOUNDRY_API_KEY=your-azure-api-key -**Option B: Microsoft Entra ID authentication** When neither `ANTHROPIC_FOUNDRY_API_KEY` nor `ANTHROPIC_FOUNDRY_AUTH_TOKEN` is set, Claude Code automatically uses the Azure SDK [default credential chain](<https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/authentication/credential-chains#defaultazurecredential-overview>). This supports a variety of methods for authenticating local and remote workloads. On local environments, you commonly may use the Azure CLI: +#### + +​ + +Use Microsoft Entra ID + +Leave `ANTHROPIC_FOUNDRY_API_KEY` and `ANTHROPIC_FOUNDRY_AUTH_TOKEN` unset. Claude Code then uses the Azure SDK [default credential chain](<https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/authentication/credential-chains#defaultazurecredential-overview>). This supports a variety of methods for authenticating local and remote workloads. On a local machine, sign in with the Azure CLI: az login -**Option C: Bearer token authentication** Claude Code sends the value of `ANTHROPIC_FOUNDRY_AUTH_TOKEN` on every request as the `Authorization: Bearer` header. Use this option when another process, such as a host application or a sign-in script, has already obtained an access token for you. Requires Claude Code v2.1.203 or later. Set the variable to a bearer token that Microsoft Entra ID issued for your resource: +For the roles your identity needs, see Azure RBAC configuration. + +#### + +​ + +Use a bearer token + +Claude Code sends the value of `ANTHROPIC_FOUNDRY_AUTH_TOKEN` on every request as the `Authorization: Bearer` header. Use this option when another process, such as a host application or a sign-in script, has already obtained an access token for you. Requires Claude Code v2.1.203 or later. Set the variable to a bearer token that Microsoft Entra ID issued for your resource: export ANTHROPIC_FOUNDRY_AUTH_TOKEN=your-entra-access-token `ANTHROPIC_FOUNDRY_AUTH_TOKEN` takes precedence over `ANTHROPIC_FOUNDRY_API_KEY` and over the default credential chain. - -When using Microsoft Foundry, the `/logout` command is unavailable since authentication is handled through Azure credentials. ###
modified Claude Code on mobile View current →
--- a/mobile.md +++ b/mobile.md @@ -83,7 +83,7 @@ The mobile client covers most of what a session needs, with a few limitations: * **Local-only commands** : commands that only run in the terminal interface, such as `/plugin` and `/resume`, don’t work from the app. The [Remote Control limitations](</docs/en/remote-control#limitations>) list the commands that do work from mobile and how their behavior differs. - * **Permission modes** : cloud sessions offer Accept edits, Plan, and Auto in the mode dropdown, and Remote Control sessions offer Manual, Accept edits, and Plan. You can’t select Bypass permissions from the app in either case, and you can’t select Auto for a Remote Control session. See [switch permission modes](</docs/en/permission-modes#switch-permission-modes>). + * **Permission modes** : cloud sessions offer Accept edits, Plan, and Auto, and Remote Control sessions offer Manual, Accept edits, Plan, and Auto. You can’t select Bypass permissions from the app in either case. See [switch permission modes](</docs/en/permission-modes#switch-permission-modes>) for when Auto is available. * **Dispatch plans** : Dispatch requires a Pro or Max plan and isn’t available on Team or Enterprise. ##
modified Model configuration View current →
Show diff (175 lines)
--- a/model-config.md +++ b/model-config.md @@ -37,18 +37,18 @@ **`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions **`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution -The version that the `opus` and `sonnet` aliases resolve to depends on the provider: - -Provider| `opus`| `sonnet` ----|---|--- -Anthropic API| Opus 5.5| Sonnet 5.5 -[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 5.5| Sonnet 4.6 -Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5.5| Sonnet 4.5 -Microsoft Foundry| Opus 4.6| Sonnet 4.5 - -Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1, except in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where `fable` and `best` resolve to Fable 5. A gateway that isn’t configured to serve `claude-fable-5-1` rejects requests for that model. To use Fable 5.1 through a gateway that serves it, select it with `/model claude-fable-5-1`. Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Earlier versions resolve these aliases to older models. For the version at which each alias changed, see Version history. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. - -Sonnet 5.5 requires Claude Code v2.1.284 or later, and Opus 5.5 requires v2.1.280 or later. If a request for one of them from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Run `claude update` to upgrade. +The `opus`, `sonnet`, and `haiku` aliases resolve to the newest version on the Anthropic API and to an earlier version on some other providers: + +Provider| `opus`| `sonnet`| `haiku` +---|---|---|--- +Anthropic API| Opus 5.5| Sonnet 5.5| Haiku 5.5 +[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 5.5| Sonnet 4.6| Haiku 4.5 +Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5.5| Sonnet 4.5| Haiku 4.5 +Microsoft Foundry| Opus 4.6| Sonnet 4.5| Haiku 4.5 + +Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1, except in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where `fable` and `best` resolve to Fable 5. A gateway that isn’t configured to serve `claude-fable-5-1` rejects requests for that model. To use Fable 5.1 through a gateway that serves it, select it with `/model claude-fable-5-1`. Where `opus` or `sonnet` resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Earlier versions resolve these aliases to older models. For the version at which each alias changed, see Version history. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. + +Sonnet 5.5 requires Claude Code v2.1.284 or later, and Opus 5.5 requires v2.1.280 or later. If a request for one of them from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Use v2.1.293 or later with Haiku 5.5. Run `claude update` to upgrade. ### @@ -116,7 +116,7 @@ * If model restrictions exclude the recorded model or it isn’t available to your account, and your admin hasn’t set an organization default model, the Default option resolves as if nothing were recorded. * If you choose Default or `opusplan` in `/model`, the recorded choice doesn’t change. -If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch: +If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. If your `model` setting is `haiku`, a session saved on a Haiku model resumes on the model that `haiku` resolves to now. For example, once `haiku` resolves to Haiku 5.5, a session saved on Haiku 4.5 resumes on Haiku 5.5. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch: * **Agent SDK or an app** : with Claude Code v2.1.268 or later, unless Claude Code accepts a model ID locally, as it does for your custom model option, it confirms the ID with your provider the first time the session switches to it. The confirmation runs on every provider, and an ID your provider doesn’t offer is refused at the switch instead of failing on your next request. * **Remote Control** : on the Anthropic API, Claude Code checks the value locally and sends no request. @@ -450,13 +450,12 @@ Effort level after a fallback -When Claude Code switches your session to the fallback model, it keeps the effort level the flagged request ran at in place of that model’s default effort. For example, a session on Opus 5.5 at its default `medium` that falls back to Opus 4.8 stays at `medium`, although Opus 4.8 defaults to `high`. A different level applies in cases such as these: - - * **Settings or organization default** : a level in your settings that applies to the fallback model, or a default effort your organization set for it, applies instead. +When Claude Code switches your session to the fallback model, it keeps the effort level the flagged request ran at. For example, a session on Opus 5.5 at its default `medium` that falls back to Opus 4.8 stays at `medium`, although Opus 4.8 defaults to `high`. A different level applies in cases such as these: + * **Your own change** : once you choose an effort level, pick a model in `/model`, or resume the session later, the flagged request’s level no longer carries over. * **Skill effort** : a level that a skill’s `effort` frontmatter set for the flagged request applies to that turn, and later turns run at the level the effort resolution order gives the fallback model. -The session header shows the level in effect next to the model name. To change it, run `/effort` in the session. +In the session, run `/effort status` to see the level in effect, or `/effort` to change it. #### @@ -517,16 +516,16 @@ Model| Levels ---|--- Fable 5.1 and Fable 5| `low`, `medium`, `high`, `xhigh`, `max` -Opus 5.5, Sonnet 5.5, Opus 5, Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` +Opus 5.5, Sonnet 5.5, Haiku 5.5, 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 or your own settings can also cap the levels a model offers; see Organization effort limits. 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. 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>) - 3. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5 and Sonnet 5.5 default to `medium`, 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. After an automatic model fallback, see Effort level after a fallback for the level that applies. - -Opus 5.5 starts at `medium` unless one of the sources above sets a level for it, and a top-level `effortLevel` in your user settings file doesn’t count for Opus 5.5. That key is the older form `/effort` wrote before Claude Code saved levels per model: it keeps applying where it applied before, on Opus 5, Fable 5.1, and earlier models, while Opus 5.5 and models released after it start at their own default until you choose a level for them with `/effort` or the `/model` picker. A top-level `effortLevel` in project, local, or managed settings, or one passed with `--settings`, applies to every model. When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it: + 3. The model’s default effort: `high` on every model that supports effort, except that Opus 5.5, Sonnet 5.5, and Haiku 5.5 default to `medium`, 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 + +After an automatic model fallback, see Effort level after a fallback for the level that applies. Opus 5.5 starts at `medium` unless one of the sources above sets a level for it, and a top-level `effortLevel` in your user settings file doesn’t count for Opus 5.5. That key is the older form `/effort` wrote before Claude Code saved levels per model: it keeps applying where it applied before, on Opus 5, Fable 5.1, and earlier models, while Opus 5.5 and models released after it start at their own default until you choose a level for them with `/effort` or the `/model` picker. A top-level `effortLevel` in project, local, or managed settings, or one passed with `--settings`, applies to every model. When you set `low`, `medium`, `high`, or `xhigh` in an interactive session on your machine, you choose how long it lasts by how you confirm it: * `Enter` in the `/effort` slider or the `/model` picker, or a level typed after `/effort`: save the level as your default and apply it in later sessions * `s` in the `/effort` slider or the `/model` picker: apply the level to this session only. Requires Claude Code v2.1.257 or later @@ -559,8 +558,8 @@ Level| When to use it ---|--- `low`| Quick exchanges where you review each result, such as brainstorming, a first sketch, or a small change like a rename -`medium`| The default on Opus 5.5 and Sonnet 5.5, where it fits day-to-day engineering work with a clear scope, such as implementing a new feature. On other models, reduces token usage for cost-sensitive work that can trade off some intelligence -`high`| Work where verification matters or edge cases are likely, such as fixing a bug in an existing codebase. The default on every model except Opus 5.5, Sonnet 5.5, and Opus 4.7 +`medium`| The default on Opus 5.5, Sonnet 5.5, and Haiku 5.5. On Opus 5.5 and Sonnet 5.5, it fits day-to-day engineering work with a clear scope, such as implementing a new feature. On models with a higher default, reduces token usage for cost-sensitive work that can trade off some intelligence +`high`| Work where verification matters or edge cases are likely, such as fixing a bug in an existing codebase. The default on every model except Opus 5.5, Sonnet 5.5, Haiku 5.5, and Opus 4.7 `xhigh`| Deeper reasoning at higher token spend. The default on Opus 4.7 `max`| Hard problems you want Claude to work through without you, such as finding security vulnerabilities. `max` may show diminishing returns and is prone to overthinking, so test before adopting it broadly `ultracode`| A Claude Code setting rather than a level: plans a [dynamic workflow](</docs/en/workflows>) for each substantive task at any effort level @@ -599,7 +598,7 @@ Adaptive reasoning and fixed thinking budgets -Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable models, Sonnet 5 and later, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` don’t apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). +Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` don’t apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). ### @@ -613,9 +612,9 @@ ---|--- Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` -Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Opus 5.5, Sonnet 5.5, and Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think - -You can’t turn thinking off on Opus 5.5, Sonnet 5.5, or the Fable models. The session toggle and the `/config` row show `Thinking can't be turned off` for these models instead of offering the switch, and a saved `alwaysThinkingEnabled: false` or `MAX_THINKING_TOKENS=0` has no effect there. On these models, the model decides per step how much to think based on the effort level. The saved setting applies again when you switch to a model that accepts it. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. +Disable through an environment variable| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable models. On [third-party providers](</docs/en/third-party-integrations>), Claude Code omits the `thinking` parameter instead, and adaptive-reasoning models may still think + +You can’t turn thinking off on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models. The session toggle and the `/config` row show `Thinking can't be turned off` for these models instead of offering the switch, and a saved `alwaysThinkingEnabled: false` or `MAX_THINKING_TOKENS=0` has no effect there. On these models, the model decides per step how much to think based on the effort level. The saved setting applies again when you switch to a model that accepts it. Claude Code collapses thinking output by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. ### @@ -623,7 +622,7 @@ Extended context -Fable 5.1, Fable 5, Sonnet 5 and later, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. On the Anthropic API, Fable 5.1, Fable 5, Sonnet 5 and later, and Opus 4.7 and later run with the 1M window on every plan, including Pro. You don’t select a `[1m]` variant or turn on usage credits for the 1M window on these models. Fable usage itself can bill to usage credits on some plans; see Fable and usage credits. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. +Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) for long sessions with large codebases. On the Anthropic API, Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with the 1M window on every plan, including Pro. You don’t select a `[1m]` variant or turn on usage credits for the 1M window on these models. Fable usage itself can bill to usage credits on some plans; see Fable and usage credits. Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. Plan| Opus 4.6 with 1M context| Sonnet 4.6 with 1M context ---|---|--- @@ -631,12 +630,12 @@ Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) API and pay-as-you-go| Full access| Full access -Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. If you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>) or another proxy, Claude Code gives each model it recognizes the same context window the model has on the Anthropic API. Fable 5.1, Fable 5, Sonnet 5 and later, and Opus 4.7 and later get the 1M window with no `[1m]` variant to select, and a model that reaches 1M only through its `[1m]` variant, such as Opus 4.6, runs at 200K without it. Claude Code can’t detect a lower limit that the gateway or the server behind it enforces. If your gateway rejects requests above 200K tokens, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](</docs/en/env-vars>) in the environment that starts Claude Code, so sessions on every model compact at that boundary. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and the Fable models, it also treats the model as having a 200K context window: +Claude Code checks these plan requirements only when it connects to the Anthropic API directly. If you point `ANTHROPIC_BASE_URL` at an [LLM gateway](</docs/en/llm-gateway#subscriptions-and-gateways>) and your saved claude.ai login stays the active credential, Claude Code doesn’t check your plan’s usage credits. The `[1m]` options stay available in `/model`, and the gateway decides whether the request succeeds. Before v2.1.229, Claude Code rejected `/model sonnet[1m]` in that configuration when it couldn’t confirm usage credits on the account. If you set `ANTHROPIC_BASE_URL` to an [LLM gateway](</docs/en/llm-gateway>) or another proxy, Claude Code gives each model it recognizes the same context window the model has on the Anthropic API. Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later get the 1M window with no `[1m]` variant to select, and a model that reaches 1M only through its `[1m]` variant, such as Opus 4.6, runs at 200K without it. Claude Code can’t detect a lower limit that the gateway or the server behind it enforces. If your gateway rejects requests above 200K tokens, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](</docs/en/env-vars>) in the environment that starts Claude Code, so sessions on every model compact at that boundary. To turn off 1M context, set `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. Claude Code removes 1M model variants from the model picker. On models with a native 1M window, such as Sonnet 5 and the Fable models, it also treats the model as having a 200K context window: * With auto-compaction on, sessions compact at the 200K boundary through auto-compaction. Setting the auto-compact window above 200K doesn’t lift the hold, because Claude Code caps that window at the model’s context window. * With auto-compaction off, sessions stop at the 200K boundary with the [context-limit error](</docs/en/errors#prompt-is-too-long>) instead of compacting. -Before v2.1.223, Claude Code held only Sonnet 5, Opus 4.8, and Opus 5 sessions to 200K. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, restart your session, and on a third-party provider check whether your deployment pinned the model with an `ANTHROPIC_DEFAULT_*_MODEL` variable. You can also use the `[1m]` suffix with model aliases or full model names: +Before v2.1.223, Claude Code held only Sonnet 5, Opus 4.8, and Opus 5 sessions to 200K. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K, except on Haiku 5.5, which costs more on prompts longer than 100K tokens. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, restart your session, and on a third-party provider check whether your deployment pinned the model with an `ANTHROPIC_DEFAULT_*_MODEL` variable. You can also use the `[1m]` suffix with model aliases or full model names: # Use the opus[1m] or sonnet[1m] alias /model opus[1m] @@ -654,6 +653,14 @@ On the Anthropic API, Sonnet 5.5 and Sonnet 5 always run with the 1M context window. There is no 200K variant, no `[1m]` suffix to select, and no usage credits required on any plan. Sessions auto-compact before the window fills, at about 967K tokens by default; set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to choose a different threshold. Claude Code gives Sonnet 5.5 and Sonnet 5 the same 1M window behind an [LLM gateway](</docs/en/llm-gateway>) or another custom `ANTHROPIC_BASE_URL`. If your gateway enforces a lower limit, see the context window behind a gateway. This setting budgets the window at 200K instead: * **`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`** : holds sessions on every model with a native 1M window to a 200K window; see Extended context for how the hold is enforced. Useful for deployments that need to cap context. + +#### + +​ + +Haiku 5.5 context window and pricing + +On the Anthropic API, Haiku 5.5 runs with the 1M context window on every plan, with no `[1m]` suffix to select. Its model ID is `claude-haiku-5-5`. To use it, run `/model claude-haiku-5-5` in a session, or start Claude Code from your shell with `claude --model claude-haiku-5-5`. A Haiku 5.5 request costs more per token when its prompt is longer than 100K tokens. See [Anthropic pricing](<https://platform.claude.com/docs/en/about-claude/pricing>) for both rates. Sessions auto-compact at about 967K tokens by default. To compact earlier, set a smaller auto-compact window for the model. ## @@ -695,7 +702,7 @@ * [Cloud sessions](</docs/en/claude-code-on-the-web>) compact as the conversation approaches the model’s limit * Sonnet 4.6 and Opus 4.6 without extended context compact at the 200K boundary, and so do Opus 4.8 and later when they run with a 200K context window, such as on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry * When you set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>), models with a native 1M window, such as Sonnet 5 and the Fable models, compact at the 200K boundary - * Models running with a native 1M window compact before the window fills, at about 967K tokens by default. On the Anthropic API, these include Sonnet 5, the Fable models, and Opus 4.7 and later. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, see Pin models for third-party deployments for which models run with that window. Behind a custom `ANTHROPIC_BASE_URL`, see the context window behind a gateway + * Models running with a native 1M window compact before the window fills, at about 967K tokens by default. On the Anthropic API, these include Sonnet 5, Haiku 5.5, the Fable models, and Opus 4.7 and later. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, see Pin models for third-party deployments for which models run with that window. Behind a custom `ANTHROPIC_BASE_URL`, see the context window behind a gateway * Sessions on a model ID Claude Code doesn’t recognize, such as an [LLM gateway](</docs/en/llm-gateway>) alias, compact at the context window Claude Code assumes for the ID; see Correct the window for a gateway or custom model ID ### @@ -875,6 +882,7 @@ Version| Change ---|--- +v2.1.293| `haiku` resolves to Haiku 5.5 on the Anthropic API v2.1.284| `sonnet` resolves to Sonnet 5.5 on the Anthropic API v2.1.280| `opus` resolves to Opus 5.5 on the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform v2.1.257| `fable` resolves to Fable 5.1, except in Claude apps gateway sessions @@ -882,4 +890,4 @@ v2.1.207| `opus` resolves to Opus 4.8 on Claude Platform on AWS, Amazon Bedrock, and Agent Platform v2.1.197| `sonnet` resolves to Sonnet 5 on the Anthropic API v2.1.154| `opus` resolves to Opus 4.8 on the Anthropic API -Earlier| `opus` resolves to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Agent Platform. `fable` resolves to Fable 5 on every provider +Earlier| `opus` resolves to Opus 4.7 on Claude Platform on AWS and to Opus 4.6 on Amazon Bedrock and Agent Platform. `fable` resolves to Fable 5 and `haiku` resolves to Haiku 4.5 on every provider
modified Modifying system prompts View current →
--- a/modifying-system-prompts.md +++ b/modifying-system-prompts.md @@ -122,7 +122,7 @@ Create an output style -An output style is a markdown file with [frontmatter](</docs/en/output-styles#frontmatter>) for metadata, followed by the prompt content. Save it to `~/.claude/output-styles/` for a user-level style available in every project, or `.claude/output-styles/` in your repository for a project-level style you can commit and share with your team. A custom output style leaves the `claude_code` preset’s software engineering instructions out and uses your own. To keep them and layer your instructions on top, set `keep-coding-instructions: true` in the frontmatter. Those instructions are only in Claude Code’s full system prompt, so the setting has no effect in a session on the shorter system prompt, which you pin on or off with [`CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT`](</docs/en/env-vars#variables>). Keep them when your agent is still doing software engineering work. Leave them out when you’re replacing the role entirely. The example below defines a code-review persona that keeps the coding instructions, since reviewing code still benefits from Claude Code’s security and code-quality guidance. Save it as `~/.claude/output-styles/code-reviewer.md` to make it available across projects: +An output style is a markdown file with [frontmatter](</docs/en/output-styles#frontmatter>) for metadata, followed by the prompt content. Save it to `~/.claude/output-styles/` for a user-level style available in every project, or `.claude/output-styles/` in your repository for a project-level style you can commit and share with your team. A custom output style leaves the `claude_code` preset’s software engineering instructions out and uses your own. To keep them and layer your instructions on top, set `keep-coding-instructions: true` in the frontmatter. Those instructions are only in Claude Code’s full system prompt, so the setting has no effect in a session on the shorter system prompt; set [`CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT`](</docs/en/env-vars#variables>) to `0` to select the full prompt on any model. Keep them when your agent is still doing software engineering work. Leave them out when you’re replacing the role entirely. The example below defines a code-review persona that keeps the coding instructions, since reviewing code still benefits from Claude Code’s security and code-quality guidance. Save it as `~/.claude/output-styles/code-reviewer.md` to make it available across projects: ~/.claude/output-styles/code-reviewer.md @@ -515,7 +515,7 @@ **Management**| On filesystem| CLI + files| In code| In code **Default tools**| Preserved| Preserved| Preserved| Lost (unless included) **Built-in safety**| Maintained| Maintained| Maintained| Must be added -**Customization level**| Additions only| Replace or extend default| Additions only| Complete control +**Customization level**| Additions only| Additions; can omit coding instructions| Additions only| Complete control **Version control**| With project| Yes| With code| With code **Scope**| Project-specific| User or project| Code session| Code session
modified Monitoring View current →
--- a/monitoring-usage.md +++ b/monitoring-usage.md @@ -479,7 +479,7 @@ * **Server-managed settings** : add them to the `env` block of your organization’s [server-managed settings](</docs/en/server-managed-settings>). Claude Code fetches those settings at startup wherever [server-managed settings apply](</docs/en/model-config#surface-coverage>), which includes your users’ machines and cloud sessions other than Claude Tag channel sessions. Claude Tag sessions don’t receive your server-managed settings, so this route doesn’t configure them. * **The environment’s variables** : add them to a cloud environment’s [environment variables](</docs/en/cloud-environments#set-environment-variables>) to configure only the sessions that run in that environment. This is the route that reaches Claude Tag sessions. -Anyone who uses an environment can read its variables, so don’t put a credential there, such as a collector token in `OTEL_EXPORTER_OTLP_HEADERS`. An [API credential](</docs/en/cloud-environments#add-api-credentials>) on the environment doesn’t help either, because Claude Code’s own telemetry export is one of the [requests that never get the credential](</docs/en/cloud-environments#requests-that-never-get-the-credential>). If your collector requires a credential, configure the whole export through server-managed settings instead, because when you set a credential there, Claude Code removes endpoint variables set outside managed settings. Keep these constraints in mind when you configure telemetry for cloud sessions: +Anyone who uses an environment can read its variables, so don’t put a credential there, such as a collector token in `OTEL_EXPORTER_OTLP_HEADERS`. A [network secret](</docs/en/cloud-environments#add-network-secrets>) on the environment doesn’t help either, because Claude Code’s own telemetry export is one of the [requests that never get the secret](</docs/en/cloud-environments#requests-that-never-get-the-credential>). If your collector requires a credential, configure the whole export through server-managed settings instead, because when you set a credential there, Claude Code removes endpoint variables set outside managed settings. Keep these constraints in mind when you configure telemetry for cloud sessions: * **Let sessions reach the collector** : Claude Code sends the export through the session’s network, so whether it reaches the host in your `OTEL_EXPORTER_OTLP_ENDPOINT` depends on the environment’s [network access level](</docs/en/cloud-environments#access-levels>). If sessions can’t reach the collector’s domain at the level you chose, [add the domain to the environment’s allowlist](</docs/en/cloud-environments#allow-specific-domains>), because no server-managed setting adds domains to an environment’s network allowlist. * **Claude Tag channels use organization-level environments** : channel sessions run in organization-level environments rather than members’ personal ones, so make the allowlist and any environment-variable changes on the [shared environment](</docs/en/cloud-environments#organization-shared-environments>) set as your organization’s default or pinned to the channel.
modified Enterprise network configuration View current →
--- a/network-config.md +++ b/network-config.md @@ -169,7 +169,7 @@ ---|---|---|--- First-byte deadline| No response headers arrive after Claude Code sends the request| Direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), including through an HTTPS proxy, but not when `ANTHROPIC_BASE_URL` or `ANTHROPIC_AWS_BASE_URL` routes them through a [gateway](</docs/en/gateways>). Opt-in on Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry| 180 seconds on the direct Anthropic API, 300 seconds elsewhere, plus one second per 32KB of request body Event-level watchdog| No response events parse. Where the byte-level watchdog runs on a connection other than Amazon Bedrock, arriving bytes, including keep-alive pings, also reset this watchdog, for up to about five minutes without a parsed event| Every provider| 300 seconds -Byte-level watchdog| No bytes arrive on the wire, including SSE keep-alive pings| Direct Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and [gateway](</docs/en/gateways>) connections, including a custom `ANTHROPIC_BASE_URL`. Opt-in on Amazon Bedrock `vnd.amazon.eventstream` responses with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry| 180 seconds on the direct Anthropic API, 300 seconds elsewhere +Byte-level watchdog| No bytes arrive on the wire, including SSE keep-alive pings| Direct Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and [gateway](</docs/en/gateways>) connections, including a custom `ANTHROPIC_BASE_URL`. Opt-in on Amazon Bedrock `vnd.amazon.eventstream` responses with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry| 180 seconds on the direct Anthropic API. Through a custom `ANTHROPIC_BASE_URL`, 180 seconds when Claude Code has [fetched feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>) and 300 seconds when it hasn’t. 300 seconds elsewhere Body idle timeout| No bytes arrive for 5 minutes| Providers other than the direct Anthropic API, Claude Platform on AWS, and Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` set, unless [`API_FORCE_IDLE_TIMEOUT`](</docs/en/env-vars>) changes that| 5 minutes If you set `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`, the byte-level watchdog replaces the body idle timeout on Bedrock rather than running alongside it. `CLAUDE_STREAM_IDLE_TIMEOUT_MS` then also governs how long a Bedrock stream may stay silent before Claude Code treats the connection as dead, within the limits listed below. Arriving bytes still don’t reset the event-level watchdog on Bedrock. With debug logging on, each Bedrock stream then logs a debug message that starts with `wire-heartbeat: _chunkTimes absent`. Configure the timers with these variables, each detailed in the [environment variables reference](</docs/en/env-vars>):
modified Manage Claude Code plugins for your organization View current →
--- a/org.md +++ b/org.md @@ -194,7 +194,7 @@ `pluginTrustMessage`| Appends your text to the trust warning that `/plugin` shows before a plugin installs| Doesn’t change the warning’s own text `allowedChannelPlugins`| Replaces the default list of plugins allowed to push channel messages. Requires `channelsEnabled: true`| See [Restrict which channel plugins can run](</docs/en/channels#restrict-which-channel-plugins-can-run>) [`CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL=1`](</docs/en/env-vars>)| Stops interactive terminal sessions from auto-registering the official marketplace| Doesn’t remove a marketplace already registered. The allowlist and blocklist gate the same auto-registration without it. A machine that started once with it set doesn’t resume auto-registration after you unset it -[`allowManagedModsOnly`](</docs/en/plugins/mods/admin#stop-user-installed-mods-from-loading>)| Stops every installed [mod](</docs/en/plugins/mods/overview>) that doesn’t [count as your organization’s](</docs/en/plugins/mods/admin#install-your-organizations-mods>) from loading| Doesn’t stop a plugin that contains a mod from installing. For that, use the marketplace keys in this table +[`allowManagedModsOnly`](</docs/en/plugins/mods/admin#stop-user-installed-mods-from-loading>)| Stops every installed [mod](</docs/en/plugins/mods/overview>) that doesn’t [count as your organization’s](</docs/en/plugins/mods/admin#install-your-organizations-mods>) from running its hooks| Doesn’t stop a plugin that contains a mod from installing. For that, use the marketplace keys in this table Every key in the table is a managed setting, apart from `enabledPlugins`, `syncClaudeAiPlugins`, `CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL`, and `allowManagedModsOnly`:
modified Output styles View current →
--- a/output-styles.md +++ b/output-styles.md @@ -161,7 +161,7 @@ ---|---|--- `name`| No| Name of the output style, shown in the `/config` picker. Default: the file name `description`| No| Description of the output style, shown in the `/config` picker -`keep-coding-instructions`| No| Set to `true` to keep Claude Code’s built-in software engineering instructions alongside your style. Default: `false` +`keep-coding-instructions`| No| Set to `true` to keep Claude Code’s section of built-in software engineering instructions, which only the full system prompt includes, alongside your style. See How output styles work. Default: `false` `force-for-plugin`| No| Plugin output styles only. Set to `true` to apply this style automatically whenever the plugin is enabled, without requiring users to select it. Overrides the user’s `outputStyle` setting. If multiple enabled plugins set this, Claude Code uses the first one loaded. Default: `false` ## @@ -192,9 +192,9 @@ An output style changes the instructions Claude Code gives Claude. * Claude Code sends the active style’s instructions with every request. - * Custom output styles leave out Claude Code’s built-in software engineering instructions, such as how to scope changes, write comments, and verify work, unless `keep-coding-instructions` is set to `true`. - -Output styles apply to the main conversation and to a [fork](</docs/en/sub-agents#fork-the-current-conversation>), which inherits the parent’s full conversation and system prompt. Other [subagents run their own system prompt](</docs/en/sub-agents#what-loads-at-startup>), so styles don’t change how they respond. Token usage depends on the style. A style’s instructions add input tokens, though prompt caching reduces this cost after the first request in a session. The built-in Explanatory and Learning styles produce longer responses than Default by design, which increases output tokens. The Concise style does the opposite by instructing Claude to keep responses short by default. For custom styles, output token usage depends on what your instructions tell Claude to produce. + * On the full system prompt, custom output styles leave out Claude Code’s section of built-in software engineering instructions, such as how to scope changes, write comments, and verify work, unless `keep-coding-instructions` is set to `true`. The shorter system prompt doesn’t include that section, so the field has no effect there. To rely on the field, set [`CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT`](</docs/en/env-vars#variables>) to `0`, which selects the full prompt on any model. + +Output styles apply to the main conversation and to a [fork](</docs/en/sub-agents#fork-the-current-conversation>), which inherits the parent’s whole conversation and system prompt. Other [subagents run their own system prompt](</docs/en/sub-agents#what-loads-at-startup>), so styles don’t change how they respond. Token usage depends on the style. A style’s instructions add input tokens, though prompt caching reduces this cost after the first request in a session. The built-in Explanatory and Learning styles produce longer responses than Default by design, which increases output tokens. The Concise style does the opposite by instructing Claude to keep responses short by default. For custom styles, output token usage depends on what your instructions tell Claude to produce. ##
modified Choose a permission mode View current →
--- a/permission-modes.md +++ b/permission-modes.md @@ -181,10 +181,10 @@ The Cowork tab doesn’t use these modes. Cowork has its own permission modes, enabled separately, and the Cowork tab shows no mode selector at all until a mode beyond its default is enabled for your account. See the [Cowork docs](<https://claude.com/docs/cowork/overview>).For desktop-specific details, see [Choose a permission mode](</docs/en/desktop#choose-a-permission-mode>) in the Desktop guide.**As a default** : set `defaultMode` in [settings](</docs/en/settings#where-settings-live>). The desktop app reads the same settings files as the CLI and applies the permission mode to new local sessions.A mode you pick in the mode selector is remembered per folder and takes precedence over `defaultMode` for that folder. Plan is the exception: picking it applies to the current session only.For where `defaultMode` goes in a settings file, see the example under Start in a different permission mode. -Use the mode dropdown next to the prompt box on [claude.ai/code](<https://claude.ai/code>) or in the mobile app. Permission prompts appear in claude.ai for approval. Which modes appear depends on where the session runs: +On [claude.ai/code](<https://claude.ai/code>), use the mode dropdown next to the prompt box. In the mobile app, tap the **+** button in the prompt box, then **Permission**. Cloud sessions and Remote Control sessions offer different permission modes: * **[Cloud sessions](</docs/en/claude-code-on-the-web>)** : Accept edits, Plan, and Auto. Accept edits corresponds to `default` mode: cloud sessions pre-approve file edits regardless of mode, so the dropdown shows Accept edits instead of Manual. Cloud sessions still honor `defaultMode: "acceptEdits"` from settings. Auto mode appears only when your organization allows it and the selected model supports it. Bypass permissions isn’t available. - * **[Remote Control](</docs/en/remote-control>) sessions** on your local machine: Manual, Accept edits, and Plan for a session you started yourself, and you can’t select Auto or Bypass permissions from the app. For a project thread running on your computer, see [Run a thread on your own computer](</docs/en/claude-projects#run-a-thread-on-your-own-computer>). + * **[Remote Control](</docs/en/remote-control>) sessions** on your local machine: Manual, Accept edits, Plan, and Auto for a session you started yourself, and you can’t select Bypass permissions from the app. To use Auto, the session has to meet the auto mode availability requirements. For a project thread running on your computer, see [Run a thread on your own computer](</docs/en/claude-projects#run-a-thread-on-your-own-computer>). * Except for Bypass permissions, the dropdown shows the permission mode the local session is in, including one set from the terminal. It updates when the permission mode changes in the app or in the terminal. * Sessions hosted by the [desktop app](</docs/en/desktop>) or the [VS Code extension](</docs/en/vs-code>) report permission mode changes to claude.ai as they happen, the same as sessions hosted in a terminal. * Before v2.1.202, sessions connected with `/remote-control` or `claude --remote-control` didn’t report their permission mode at all, so claude.ai and the mobile app could show a permission mode the session wasn’t in. The mismatch affected only the label. Claude Code generated permission prompts from the session’s actual permission mode, and they still appeared in the app for approval. @@ -257,7 +257,7 @@ * **Plan** : All plans. * **Organization** : on Team and Enterprise, auto mode is available by default. Administrators can turn it off for the organization by setting `permissions.disableAutoMode` to `"disable"` in [managed settings](</docs/en/managed-settings>). - * **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 a [Fable model](</docs/en/model-config#work-with-fable>). 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 or later, Opus 4.7 or later, and the Fable models. Older models, including Sonnet 4.5, Opus 4.5, Haiku, and claude-3 models, are not supported on any provider. + * **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, Haiku 5.5, or a [Fable model](</docs/en/model-config#work-with-fable>). 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 or later, Opus 4.7 or later, Haiku 5.5, and the Fable models. Older models, including Sonnet 4.5, Opus 4.5, Haiku 4.5, 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, 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. @@ -268,7 +268,7 @@ Auto mode on Bedrock, Agent Platform, or Foundry -On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, auto mode is available by default. When nothing else sets a permission mode, it’s also the built-in starting permission mode, on the versions that section’s table lists. To choose the starting permission mode yourself, set `permissions.defaultMode` as Start in a different permission mode describes, or pick a permission mode from the VS Code extension’s mode indicator. Only Claude Sonnet 5 or later, Opus 4.7 or later, and the Fable models are supported on these providers. On any other model, the session starts in Manual instead. To prevent developers from using auto mode, set `disableAutoMode` to `"disable"` in [managed settings](</docs/en/managed-settings>). This removes `auto` from the `Shift+Tab` cycle, and a session started with `--permission-mode auto` starts in Manual instead. A session already running in auto mode leaves it when the setting reaches that session from an [admin-deployed source](</docs/en/managed-settings#which-managed-source-claude-code-uses>), and shows `auto mode disabled by settings`. Before v2.1.251, a running session kept auto mode until it ended. In v2.1.158 through v2.1.206, auto mode was off on these providers until you set `CLAUDE_CODE_ENABLE_AUTO_MODE=1`, and Claude Code ignored `defaultMode: "auto"` on these providers unless the variable was also set. The variable is still accepted for compatibility and has no effect from v2.1.207 onward. +On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, auto mode is available by default. When nothing else sets a permission mode, it’s also the built-in starting permission mode, on the versions that section’s table lists. To choose the starting permission mode yourself, set `permissions.defaultMode` as Start in a different permission mode describes, or pick a permission mode from the VS Code extension’s mode indicator. Only Claude Sonnet 5 or later, Opus 4.7 or later, Haiku 5.5, and the Fable models are supported on these providers. On any other model, the session starts in Manual instead. Auto mode with Haiku 5.5 on these providers requires Claude Code v2.1.293 or later. To prevent developers from using auto mode, set `disableAutoMode` to `"disable"` in [managed settings](</docs/en/managed-settings>). This removes `auto` from the `Shift+Tab` cycle, and a session started with `--permission-mode auto` starts in Manual instead. A session already running in auto mode leaves it when the setting reaches that session from an [admin-deployed source](</docs/en/managed-settings#which-managed-source-claude-code-uses>), and shows `auto mode disabled by settings`. Before v2.1.251, a running session kept auto mode until it ended. In v2.1.158 through v2.1.206, auto mode was off on these providers until you set `CLAUDE_CODE_ENABLE_AUTO_MODE=1`, and Claude Code ignored `defaultMode: "auto"` on these providers unless the variable was also set. The variable is still accepted for compatibility and has no effect from v2.1.207 onward. ###
modified Test plugins with evals View current →
--- a/plugin-evals.md +++ b/plugin-evals.md @@ -104,7 +104,7 @@ Open the report and iterate -Open the `Published:` URL, or the `Report:` path when no `Published:` line appears, to see each grader’s verdict and explanation for every run, and for `llm` graders the judge’s votes and the excerpt it judged. The `Published:` line appears only when your account can publish reports.The most common first finding is a `Δ` near zero with the case’s `tool_used: Skill` grader failing, which means Claude isn’t choosing your skill on natural phrasing. Adjust the skill’s [`description`](</docs/en/skills#frontmatter-reference>), run `claude plugin eval .` again, and compare.To iterate on one case cheaply, run a single arm once. A single run is noisy, so confirm any change at the default three runs before you trust it. With one arm the table shows `SCORE` and `PASS%` columns instead of `WITH`, `W/OUT`, and `Δ`: +Open the `Published:` URL, or the `Report:` path when no `Published:` line appears, to see each grader’s verdict and explanation for every run, and for `llm` graders the judge’s votes and the excerpt it judged. The `Published:` line appears only when your account can publish reports.The most common first finding is a `Δ` near zero with the case’s `tool_used: Skill` grader failing, which means Claude isn’t choosing your skill on natural phrasing. Adjust the skill’s [`description`](</docs/en/skills#frontmatter-reference>), run `claude plugin eval .` again, and compare.To iterate on one case with fewer runs, run a single arm once. A single run is noisy, so confirm any change at the default three runs before you trust it. With one arm the table shows `SCORE` and `PASS%` columns instead of `WITH`, `W/OUT`, and `Δ`: claude plugin eval . --case <case-name> --runs 1 --ablation none @@ -293,7 +293,7 @@ * **Substitutions** : insert fields from the call’s input with `{{input.<field>}}`, and the contents of a fixture file beside the mock with `{{file:fixtures/{input.<field>}.json}}`. * **`expect:`** : the `expect:` block guards the input. If a call violates it, the run aborts with score 0 and records why, so a case can assert what your plugin asked the server to do. * **`error: true`** : set `error: true` to return the body as a tool error instead. - * **`type: agent`** : set `type: agent` to have the judge model answer as the server from instructions in the body. + * **`type: agent`** : set `type: agent` to have the judge model answer as the server from instructions in the body. Calls to agent mocks share one budget per run of four times the case’s `max_turns`, and a call past it aborts the run with score 0. The mock file reference lists every key and the `_server.md` and `_tools.json` files. To grade the calls themselves, point a grader at `target: mock_calls`. To run against the plugin’s real MCP servers instead, pass one of these flags. Either way those processes run as you, outside the run’s sandbox, and their tools need an `--allow-tools` grant: @@ -450,7 +450,7 @@ `cases[].aggregates.score`| Mean with-arm run score for the case `cases[].aggregates.delta`| With-arm score minus without-arm score. Omitted when the case ran one arm or the arms aren’t comparable `cases[].arms.with[].error`| `null`, or why a run ended abnormally, such as `timed out after 300s`. A run that started but ended badly is still graded on what it produced, so a non-null error doesn’t imply score 0 -`cases[].arms.with[].aborted`| Present when a mock’s `expect:` or `abort_when` stopped the run, with `server`, `tool`, and `reason`. The run scores 0 and `error` stays `null` +`cases[].arms.with[].aborted`| Present when a mock stopped the run through `expect:`, `abort_when`, or the agent-mock call budget, with `server`, `tool`, and `reason`. The run scores 0 and `error` stays `null` `cases[].arms.with[].skippedPaidGraders`| `true` when the cost ceiling skipped this run’s judge graders, so its score isn’t comparable `costUsd`, `durationSeconds`, `claudeVersion`| Estimated cost at list price including judge calls, wall-clock seconds, and the Claude Code version that ran the suite @@ -622,10 +622,25 @@ Two optional files sit beside the tool files in a server’s directory: - * **`_server.md`** : a single `type: agent` mock that answers several tools, listed in its `tools:` frontmatter key. A `<tool>.md` for the same tool takes precedence. Put an `expect:` guard on the individual `<tool>.md`, not here + * **`_server.md`** : a single `type: agent` mock that answers several tools, listed in its `tools:` frontmatter key. A `<tool>.md` for the same tool takes precedence. An `expect:` guard here is a load error unless `tools:` lists a single tool, so put the guard on the individual `<tool>.md` instead * **`_tools.json`** : a saved `tools/list` response from the real server, so mocked tools carry their real descriptions and input schemas instead of a permissive placeholder A case’s own `mocks/` directory uses the same layout and overrides the suite’s mocks file by file. + +#### + +​ + +Regex patterns in expect + +A `/regex/` value in `expect:` uses a small dialect that Claude Code checks when it loads the suite: + + * Literal characters, `.`, escapes such as `\d`, and character classes such as `[a-z]` + * The quantifiers `*`, `+`, `?`, and the `{m,n}` forms, each on a single character, escape, or class + * An optional `^` at the start and `$` at the end + * The flags `i` and `s` only + +A pattern outside the dialect, such as one with a group, alternation, a backreference, lookaround, or another flag, stops the case from loading: the case scores 0 and its error names the pattern. To allow several exact values, write a list of literals instead of an alternation. Each pattern checks values only up to a maximum length, and a longer value counts as a violation. Quantifiers can lower that length, and a leading `^` raises it, so anchor patterns with `^` and keep quantifiers few. ## @@ -752,6 +767,14 @@ Runs fail with a usage-limit or rate-limit error partway through If your account reaches its plan’s usage limit or an API rate limit while a suite is running, each later run ends with that error, is graded on what it produced, and usually scores 0. The suite still finishes and isn’t marked `partial`, so the result can look like a regression. Check the `NOTES` column or `cases[].arms.with[].error` in the JSON for the limit message before trusting the scores, then re-run after the limit resets, with `--runs 1` or a `--case` filter if you need to stay under it. + +### + +​ + +“mock call budget exceeded” + +Every `type: agent` mock in a run draws on one call budget of four times the case’s `max_turns`, which is 40 calls at the default of 10. Calls answered from `.replay/` recordings count too, and the case’s `mock budget` progress line prints the budget. A call past it aborts the run with score 0 and this reason, so raise `max_turns` in the case for a skill that makes many calls to agent mocks. ###
modified How Claude Code uses prompt caching View current →
--- a/prompt-caching.md +++ b/prompt-caching.md @@ -17,7 +17,7 @@ A change to the conversation layer leaves the system prompt and project context cached. A change to the system prompt invalidates everything, because all later content now sits behind a different prefix. The third column gives common triggers rather than an exhaustive list, and the sections below cover the full set. The prefix-match rule explains most of the behaviors on this page. [Plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) and [skill loading](</docs/en/skills>), for example, append their instructions as conversation messages, so the cached prefix stays intact. Two settings don’t appear in the layer table but still affect what stays cached: * **Model** : each model has its own cache. Switching models recomputes the entire request even when the content is identical. See Switching models below. - * **Effort level** : on most models, each effort level has its own cache, so changing effort mid-session recomputes the entire request. On Opus 5.5, Sonnet 5.5, and Fable 5.1 with an API key or a Claude subscription, the cache stays intact by default. See Changing effort level below. + * **Effort level** : on most models, each effort level has its own cache, so changing effort mid-session recomputes the entire request. On Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.1 with an API key or a Claude subscription, the cache stays intact by default. See Changing effort level below. Pick your model and effort level at the top of a session, then save `/compact` for natural breaks between tasks. The fewer changes you make mid-task, the higher your cache hit rate. @@ -74,7 +74,7 @@ Changing effort level -On most models, changing the [effort level](</docs/en/model-config#adjust-effort-level>) mid-session means the next request reads the entire conversation history with no cache hits. While the cache is still warm, Claude Code asks you to confirm the change first. On Opus 5.5, Sonnet 5.5, and Fable 5.1 with an API key or a Claude subscription, changing effort keeps the cache, and Claude Code applies the new level without asking. This doesn’t apply on Amazon Bedrock, Google Cloud’s Agent Platform, or a [Claude apps gateway](</docs/en/claude-apps-gateway>), or when you set [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`](</docs/en/llm-gateway-protocol#disable-pre-release-capabilities>) or your organization has a HIPAA configuration. Before v2.1.260, changing effort on Fable 5.1 with an API key or a Claude subscription also invalidated the cache. +On most models, changing the [effort level](</docs/en/model-config#adjust-effort-level>) mid-session means the next request reads the entire conversation history with no cache hits. While the cache is still warm, Claude Code asks you to confirm the change first. On Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.1 with an API key or a Claude subscription, changing effort keeps the cache, and Claude Code applies the new level without asking. This doesn’t apply on Amazon Bedrock, Google Cloud’s Agent Platform, or a [Claude apps gateway](</docs/en/claude-apps-gateway>), or when you set [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`](</docs/en/llm-gateway-protocol#disable-pre-release-capabilities>) or your organization has a HIPAA configuration. Before v2.1.260, changing effort on Fable 5.1 with an API key or a Claude subscription also invalidated the cache. ### @@ -284,7 +284,7 @@ Cache lifetime -Cached prefixes expire after a period of inactivity. Each request that hits the cache resets the timer, so the cache stays warm as long as you keep working. After a long enough gap, the next request recomputes the full input and re-establishes the cache, which is why the first turn back after stepping away can be noticeably slower. On a Pro or Max plan, when you resume a large session after a long break, Claude Code [offers to resume from a summary](</docs/en/sessions#resume-from-a-summary>) so later requests don’t carry the full history. The time to live (TTL) controls how long a gap the cache survives. The API offers two: a five-minute TTL, and a [one-hour TTL](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#1-hour-cache-duration>) that keeps the cache warm through longer breaks but [bills cache writes at a higher rate](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing>). The longer TTL helps when you leave a session idle and come back to it, because you skip the reprocessing an expired prefix costs. It costs more on short bursts of work that never idle past five minutes, where the higher write rate applies and the longer cache lifetime goes unused. +Cached prefixes expire after a period of inactivity. Each request that hits the cache resets the timer, so the cache stays warm as long as you keep working. After a long enough gap, the next request recomputes the full input and re-establishes the cache, which is why the first turn back after stepping away can be noticeably slower. On a Pro or Max plan, when you resume a large session after a long break, Claude Code [offers to resume from a summary](</docs/en/sessions#resume-from-a-summary>) so later requests don’t carry the full history. The time to live (TTL) controls how long a gap the cache survives. The API offers two: a five-minute TTL, and a [one-hour TTL](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#1-hour-cache-duration>) that keeps the cache warm through longer breaks but [charges a higher rate for cache writes](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing>). The longer TTL helps when you leave a session idle and come back to it, because you skip the reprocessing an expired prefix costs. It costs more on short bursts of work that never idle past five minutes, where the higher write rate applies and the longer cache lifetime goes unused. ### @@ -304,7 +304,7 @@ Main conversation| One hour| Five minutes Everything else| Five minutes, except the server-controlled helper requests, which get one hour| Five minutes -Once you go over your plan’s usage limit and Claude Code draws on [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>), you are billed for that usage, so Claude Code drops the main conversation to the cheaper five-minute TTL. To keep the one-hour TTL there, choose the TTL yourself. +Once you go over your plan’s usage limit and Claude Code draws on [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>), you are billed for that usage, so Claude Code drops the main conversation to the five-minute TTL, which charges a lower rate for cache writes. To keep the one-hour TTL there, choose the TTL yourself. ###
modified Agent SDK reference - Python View current →
--- a/python.md +++ b/python.md @@ -942,7 +942,7 @@ `user`| `str | None`| `None`| On POSIX platforms, the OS user account the Claude Code subprocess runs as. Claude Code keeps the parent process’s environment, including `HOME`, and runs in `cwd` `include_partial_messages`| `bool`| `False`| Include partial message streaming events. When enabled, `StreamEvent` messages are yielded `include_hook_events`| `bool`| `False`| Include hook lifecycle events in the message stream as `HookEventMessage` objects -`forward_subagent_text`| `bool`| `False`| Forward subagent text and thinking blocks in the message stream. Without this option, Claude Code emits subagent `tool_use` and `tool_result` blocks but not text or thinking. Requires Python Agent SDK 0.2.140 or later +`forward_subagent_text`| `bool`| `False`| Forward subagent text and thinking blocks in the message stream. Without this option, Claude Code omits the text and thinking blocks of a subagent that runs in the [foreground](</docs/en/sub-agents#run-subagents-in-foreground-or-background>). For nested subagents, skills with `context: fork`, and the Claude Code version each needs, see [Follow subagent messages](</docs/en/headless#follow-subagent-messages>). Requires Python Agent SDK 0.2.140 or later `verbatim_prompts`| `bool`| `False`| Deliver every prompt as written. The SDK sends each user message with `client_composed` set to `True`. See [`client_composed`](</docs/en/agent-sdk/typescript#sdkusermessage>) for what Claude Code skips on those messages. Use this option when your prompt text includes content the end user didn’t type. For per-turn control, leave it off and set `"client_composed": True` on individual streamed messages instead. While the option is on, the SDK overwrites any `client_composed` value you set. Requires Python Agent SDK 0.2.158 or later and Claude Code v2.1.248 or later; the CLI bundled with those SDK versions satisfies the Claude Code requirement `fork_session`| `bool`| `False`| When resuming with `resume`, fork to a new session ID instead of continuing the original session `resume_session_at`| `str | None`| `None`| When resuming, load the conversation only up to and including the message with this UUID. Use with `resume`, and usually `fork_session`, to branch from an earlier point. Requires Python Agent SDK 0.2.137 or later @@ -1435,7 +1435,7 @@ `enabled`| `type`, `budget_tokens`, `display`| Enable thinking with a specific token budget `disabled`| `type`| Disable thinking -The optional `display` field controls whether thinking text is returned `"summarized"` or `"omitted"`. On Claude Opus 4.7 and later, the API default is `"omitted"`, so set `"summarized"` to receive thinking content in `ThinkingBlock` outputs. Claude Code leaves `display` out of requests to some providers, such as Amazon Bedrock and Google Cloud’s Agent Platform. On those providers, Opus 4.7 and later return empty `ThinkingBlock` outputs even when you set `display` to `"summarized"`. Because these are `TypedDict` classes, they’re plain dicts at runtime. Either construct them as dict literals or call the class like a constructor; both produce a `dict`. Access fields with `config["budget_tokens"]`, not `config.budget_tokens`: +The optional `display` field controls whether thinking text is returned `"summarized"` or `"omitted"`. On Claude Opus 4.7 and later, the API default is `"omitted"`, so set `"summarized"` to receive thinking content in `ThinkingBlock` outputs. Claude Code doesn’t pass your `display` value to some providers, such as Amazon Bedrock and Google Cloud’s Agent Platform. On those providers, Opus 4.7 and later return empty `ThinkingBlock` outputs even when you set `display` to `"summarized"`. Because these are `TypedDict` classes, they’re plain dicts at runtime. Either construct them as dict literals or call the class like a constructor; both produce a `dict`. Access fields with `config["budget_tokens"]`, not `config.budget_tokens`: from claude_agent_sdk import ClaudeAgentOptions, ThinkingConfigEnabled @@ -2725,6 +2725,7 @@ "prompt": str, # The task for the agent to perform "subagent_type": str | None, # The type of specialized agent to use "model": "sonnet" | "opus" | "haiku" | "fable" | None, # Model override for this agent + "effort": "low" | "medium" | "high" | "xhigh" | "max" | None, # Reasoning effort for this agent "run_in_background": bool | None, # Agents run in the background by default; set to False to run synchronously "name": str | None, # Name for the spawned agent "team_name": str | None, # Deprecated; ignored
modified Mods reference View current →
--- a/reference.md +++ b/reference.md @@ -279,14 +279,14 @@ [`Text`](</docs/en/plugins/mods/interface#build-a-tree-from-elements>)| `color`, `backgroundColor`, `bold`, `italic`, `underline`, `dimColor`, `inverse`, `wrap`| ✓| ✓ [`Button`](</docs/en/plugins/mods/interface#respond-to-presses-and-typing>)| `key`, `label`, `onPress`, `hotkey`, `plain`, `dimColor`, `autoFocus`, `action`| ✓| ✓ `Link`| `href`, `label`| ✓| ✓ -`Code`| The code| ✓| ✓ +[`Code`](</docs/en/plugins/mods/gallery#show-code-and-changes>)| `source`, `language`, `path`, `startLine`, `format`, `wrap`| ✓| ✓ `Markdown`| `text`, `key`, `dimColor`, `onLinkPress`, `pressableLinks`| ✓| ✓ [`Input`](</docs/en/plugins/mods/interface#take-typed-input-and-draw-a-row-for-each-item>)| `key`, `label`, `placeholder`, `value`, `submitLabel`, `onSubmit`, `onInput`, `autoFocus`| ✓| ✓ `Select`| `key`, `label`, `options`, `value`, `onSelect`, `autoFocus`| ✓| ✓ `Svg`| An SVG document, up to 131,072 characters| | ✓ [`Client`](</docs/en/plugins/mods/interface#build-a-tree-from-elements>)| `module`, `key`| ✓| ✓ [`Raster`](</docs/en/plugins/mods/interface#draw-a-grid-of-colored-cells>)| `key`, `columns` up to 512, `rows` up to 256, `cells`. See [Draw a grid of colored cells](</docs/en/plugins/mods/interface#draw-a-grid-of-colored-cells>).| ✓| -`Image`| PNG or RGBA bytes up to 2 MiB, or a file path| ✓| +`Image`| PNG or RGBA bytes up to 2 MiB, or a file path, `columns` and `rows` up to 255, and `alt` text.| ✓| More `Button` rules: `action` names one of Claude Code’s own [keybinding actions](</docs/en/keybindings>), and the user’s binding for it presses the button when that binding is a chord or a modified key. A digit `hotkey` on a button in the band also fires when the user types that digit alone into an empty prompt and pauses. When two buttons in one drawing name the same `hotkey`, the later one gets it. `autoFocus` accepts only `true` on any control, so omit the prop to leave it off. @@ -351,7 +351,7 @@ `CLAUDE_CODE_PLUGIN_DIRS`| Environment, or `env` in `~/.claude/settings.json`| Plugin directories to load as `--plugin-dir` does, for apps you can’t pass a flag to. Absolute paths separated by `:`, or `;` on Windows. `CLAUDE_CODE_PLUGIN_DIR_WATCH`| Environment| `1` makes a long-running non-interactive session reload `--plugin-dir` mods on save `prependPlugins`, `appendPlugins`| Managed settings. User settings only on a machine with no managed settings, for a user who isn’t signed in with a Team or Enterprise plan.| Lists of plugin ids, such as `acme-guard@acme-tools`. Mods in `prependPlugins` run before every mod a user installs, and mods in `appendPlugins` run after, in the listed order. See [The order mods run in](</docs/en/plugins/mods/events#the-order-mods-run-in>). -`allowManagedModsOnly`| Managed settings, as an [option on the built-in guard](</docs/en/plugins/mods/admin#set-options-on-the-built-in-guard>)| Only mods that [count as your organization’s](</docs/en/plugins/mods/admin#install-your-organizations-mods>), and mods built into Claude Code, load. Users’ settings hooks keep running. +`allowManagedModsOnly`| Managed settings, as an [option on the built-in guard](</docs/en/plugins/mods/admin#set-options-on-the-built-in-guard>)| Only mods that [count as your organization’s](</docs/en/plugins/mods/admin#install-your-organizations-mods>), and mods built into Claude Code, run their hooks. Users’ settings hooks keep running. `allowModsToOverrideDenyRules`| Managed settings, as an [option on the built-in guard](</docs/en/plugins/mods/admin#set-options-on-the-built-in-guard>)| Lets a mod a user installed approve a tool call that a `deny` rule refuses `allowManagedHooksOnly`| Managed settings| Blocks hooks and installed mods that aren’t your organization’s. See [what keeps running](</docs/en/settings-reference#what-runs-under-allowmanagedhooksonly>). `disableAllHooks`| Any settings file| In managed settings, no mod or hook from an installed plugin runs. In your own settings, what your organization manages keeps running. See [`disableAllHooks`](</docs/en/settings-reference#disableallhooks>).
modified Continue local sessions from any device with Remote Control View current →
--- a/remote-control.md +++ b/remote-control.md @@ -167,10 +167,10 @@ * **`false`** : turn auto-connect off, though a `true` from [managed settings](</docs/en/managed-settings>) outranks it, because Claude Code saves the choice to your user settings. A `false` in project or local settings (`.claude/settings.json`, `.claude/settings.local.json`) turns auto-connect off even over a managed `true`. * **`default`** : clear your choice and follow your organization’s admin default if one is set, otherwise Claude Code’s current default. -The same toggle appears outside the CLI: - - * **Desktop app** : **Settings > Claude Code > Connect new sessions to Remote Control**. +The VS Code extension and the Desktop app also have an auto-connect toggle: + * **VS Code extension** : **Enable Remote Control for all sessions** in the [command menu’s](</docs/en/vs-code#use-the-prompt-box>) Settings section. + * **Desktop app** : **Settings > Claude Code > Connect new sessions to Remote Control**. See [Control which sessions appear on your other devices](</docs/en/desktop#control-which-sessions-appear-on-your-other-devices>). To turn auto-connect on from a settings file instead, set [`remoteControlAtStartup`](</docs/en/settings-reference#remotecontrolatstartup>) to `true` in your user `~/.claude/settings.json` or in [managed settings](</docs/en/managed-settings>). In project or local settings (`.claude/settings.json`, `.claude/settings.local.json`), Claude Code honors a `false` and turns auto-connect off for that repository, but ignores a `true`, so a checked-in file can’t turn on Remote Control for everyone who opens the repository. Auto-connect signs in with your own claude.ai account, so a session it starts appears only in your own account’s Claude apps and grants no one else access. With this setting on, each interactive Claude Code process registers one remote session. If you run multiple instances, each one gets its own remote session. To run multiple concurrent sessions from a single process, use server mode instead. @@ -323,7 +323,7 @@ Limitations * **One remote session per interactive process** : outside of server mode, each Claude Code instance supports one remote session at a time. Use server mode to run multiple concurrent sessions from a single process. - * **Local process must keep running** : Remote Control runs as a local process. If you close the terminal, quit the Desktop app or VS Code, or otherwise stop the `claude` process, the session goes offline until you bring it back. To keep a session running on a remote machine after you disconnect from SSH, start it inside `tmux` or `screen`. + * **Local process must keep running** : Remote Control runs as a local process. If you close the terminal, quit the Desktop app or VS Code, or otherwise stop the `claude` process, the session goes offline until you bring it back. If you run `claude` from a terminal on a remote machine, start it inside `tmux` or `screen` to keep the session running after you disconnect from SSH. * **Crashed sessions in server mode** : if a session served by `claude remote-control` crashes, send it a message from a connected device. Claude Code serves it again. You don’t have to restart the server. Requires Claude Code v2.1.238 or later. * **HTTP 403 refusals on a connected session** : once an interactive session is connected, Claude Code keeps retrying for up to three minutes when something between your machine and Anthropic’s servers answers with HTTP 403, as can happen after a VPN or network change. If the refusals last longer, Claude Code disconnects, and the reason names what refused: a network edge, or a proxy, VPN, or firewall on your own network. * **Extended network outage** : if your machine is awake but can’t reach the network, what you do next depends on the mode:
modified Automate work with routines View current →
--- a/routines.md +++ b/routines.md @@ -63,7 +63,7 @@ Pick a [cloud environment](</docs/en/cloud-environments>) for the routine. Environments control what the cloud session has access to: * **Network access** : set the level of internet access available during each run - * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so on Pro and Max plans, store keys for the APIs Claude calls during a run as [API credentials](</docs/en/cloud-environments#add-api-credentials>) instead. That section also lists the requests that never get a credential + * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so on Pro and Max plans, store keys for the APIs Claude calls during a run as [network secrets](</docs/en/cloud-environments#add-network-secrets>) instead. That section also lists the requests that never get a secret * **Setup script** : install dependencies and tools the routine needs. The result is [cached](</docs/en/cloud-environments#environment-caching>), so the script doesn’t re-run on every session A **Default** environment is provided with **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains through the session’s network. Connectors you add to the routine reach their services through Anthropic’s servers, so they don’t need allowlist changes. If your routine needs to reach your own services directly, or a domain outside that list, edit the environment’s [network access](</docs/en/cloud-environments#network-access>) before running. To use a separate environment, [create one](</docs/en/cloud-environments#configure-your-environment>) first.
modified Choose a sandbox environment View current →
--- a/sandbox-environments.md +++ b/sandbox-environments.md @@ -12,7 +12,7 @@ Approach| What is isolated| Requires Docker| Setup effort ---|---|---|--- -Sandboxed Bash tool| Bash, PowerShell, and Monitor commands and their child processes| No| Minimal on macOS; low on Linux and WSL2 +Sandboxed Bash tool| Bash, PowerShell, and Monitor tool commands and their child processes| No| Minimal on macOS; low on Linux and WSL2 Sandbox runtime| The whole Claude Code process, including file tools, MCP servers, and hooks| No| Low Dev container| Full development environment| Yes| Medium Custom container| Full development environment| Yes| Medium to high @@ -58,10 +58,10 @@ This option does not support native Windows. On Windows hosts, use WSL2 or one of the container or VM approaches below. -The sandboxed Bash tool is built into Claude Code. It uses operating system primitives to restrict the filesystem and network access of every Bash, PowerShell, or Monitor command Claude runs. Run the `/sandbox` command to open the sandbox panel and choose a mode. The [Sandboxing](</docs/en/sandboxing>) guide covers the approval modes, the default boundary, and how to widen or narrow it. The per-command sandbox does not cover everything that runs in a session: +The sandboxed Bash tool is built into Claude Code. It uses operating system primitives to restrict the filesystem and network access of Bash, PowerShell, and Monitor tool commands Claude runs. Run the `/sandbox` command to open the sandbox panel and choose a mode. The [Sandboxing](</docs/en/sandboxing>) guide covers the approval modes, the default boundary, and how to widen or narrow it. The per-command sandbox does not cover everything that runs in a session: * Other [built-in tools](</docs/en/tools-reference>) such as Read, Edit, and WebFetch run inside the Claude Code process and do not spawn arbitrary code. [Permission rules](</docs/en/permissions>) for path or domain gate them instead. - * [MCP](</docs/en/mcp>) servers and [command hooks](</docs/en/hooks#command-hook-fields>) are separate processes that run unconstrained on the host. + * [MCP](</docs/en/mcp>) servers, [command hooks](</docs/en/hooks#command-hook-fields>), and [plugin monitors](</docs/en/plugins/components#monitors>) are separate processes that run unconstrained on the host. For other processes that run this way, see [What runs outside the sandbox](</docs/en/sandboxing#what-runs-outside-the-sandbox>). To put built-in tools, MCP servers, and hooks all behind one OS boundary, run the whole Claude Code process inside the sandbox runtime, the dev container, or a custom container.
modified Configure the sandboxed Bash tool View current →
--- a/sandboxing.md +++ b/sandboxing.md @@ -612,7 +612,7 @@ Permission rules and sandboxing control different things: * **Permission rules** control which tools Claude Code can use and are evaluated before any tool runs. They apply to every tool: Bash, Read, Edit, WebFetch, MCP, and others, except that a deny or ask rule can’t block [`EndConversation`](</docs/en/tools-reference#endconversation-tool-behavior>) while any other tool remains. - * **Sandboxing** provides OS-level enforcement that restricts what shell commands can access at the filesystem and network level. It applies only to Bash, PowerShell, and [Monitor](</docs/en/tools-reference#monitor-tool>) commands and their child processes. + * **Sandboxing** provides OS-level enforcement that restricts what shell commands can access at the filesystem and network level. It applies to Bash, PowerShell, and [Monitor](</docs/en/tools-reference#monitor-tool>) tool commands and their child processes. The two layers also differ in how they are enforced. Claude Code evaluates permission decisions before a command runs, based on the command string and, in auto mode, a separate classifier’s judgment about whether the command is safe. The operating system enforces the sandbox boundary on the running process, so it holds regardless of what the model chose to run and even if an allowed command does more than its name suggests. Filesystem and network restrictions are configured through both sandbox settings and permission rules:
modified Configure server-managed settings View current →
--- a/server-managed-settings.md +++ b/server-managed-settings.md @@ -143,7 +143,7 @@ Settings precedence -Server-managed settings and [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>) both occupy the highest tier in the Claude Code [settings hierarchy](</docs/en/settings#settings-precedence>). No other settings level can override them, including command line arguments, apart from the [exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>). Within the managed tier, Claude Code by default uses the first source that delivers at least one policy key, checking server-managed settings first and then endpoint-managed settings, apart from the exception keys covered next. [How Claude Code combines managed sources](</docs/en/managed-settings#precedence-within-the-managed-tier>) has the full ranking, the carve-out for the control keys, and the opt-in that applies every source. If the selected source is an MDM policy or managed settings file whose [`policyHelper`](</docs/en/settings-reference#policyhelper>) supplies managed settings, the helper’s output replaces that source as the only managed configuration for the run. Claude Code doesn’t consult a `policyHelper` configured in MDM or file-based settings while server-managed settings deliver a policy key. If a later fetch finds the server-managed settings removed, Claude Code runs that helper right away instead of at the next launch. The [`policyHelper`](</docs/en/settings-reference#policyhelper>) entry covers what happens when that run fails. If you clear your server-managed configuration in the admin console with the intent of falling back to an endpoint-managed plist or registry policy, be aware that cached settings persist on client machines until the next successful fetch, and the keys that apply only at the next launch, such as `model`, stay in effect until each client relaunches. Run `/status` to see which managed source is active. +Server-managed settings and [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>) both occupy the highest tier in the Claude Code [settings hierarchy](</docs/en/settings#settings-precedence>). A key you set here takes precedence over the same key in a user’s own settings files or in a `--settings` value, apart from the [exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>). Within the managed tier, Claude Code by default uses the first source that delivers at least one policy key, checking server-managed settings first and then endpoint-managed settings, apart from the exception keys covered next. [How Claude Code combines managed sources](</docs/en/managed-settings#precedence-within-the-managed-tier>) has the full ranking, the carve-out for the control keys, and the opt-in that applies every source. If the selected source is an MDM policy or managed settings file whose [`policyHelper`](</docs/en/settings-reference#policyhelper>) supplies managed settings, the helper’s output replaces that source as the only managed configuration for the run. Claude Code doesn’t consult a `policyHelper` configured in MDM or file-based settings while server-managed settings deliver a policy key. If a later fetch finds the server-managed settings removed, Claude Code runs that helper right away instead of at the next launch. The [`policyHelper`](</docs/en/settings-reference#policyhelper>) entry covers what happens when that run fails. If you clear your server-managed configuration in the admin console with the intent of falling back to an endpoint-managed plist or registry policy, be aware that cached settings persist on client machines until the next successful fetch, and the keys that apply only at the next launch, such as `model`, stay in effect until each client relaunches. Run `/status` to see which managed source is active. ###
modified Settings files and precedence View current →
--- a/settings.md +++ b/settings.md @@ -19,7 +19,7 @@ User| `~/.claude/settings.json`| You, in every project on this machine| Personal preferences: theme, editor mode, default model, your own permission rules Shared project| `.claude/settings.json`| Everyone working in the folder that contains it. In a git repository, commit it so teammates get it| Team permissions, hooks, plugins, and the environment variables the project needs Project local| `.claude/settings.local.json`| You, in this one project only. Claude Code keeps it out of git when it creates the file; if you create it by hand, add it to `.gitignore` yourself| Personal overrides for one project, and testing before you share -Managed| `managed-settings.json` and other [managed sources](</docs/en/managed-settings#delivery-mechanisms>)| Everyone your organization deploys it to; nothing you set overrides it, apart from a few security-sensitive exceptions| Security policy and compliance requirements +Managed| `managed-settings.json` and other [managed sources](</docs/en/managed-settings#delivery-mechanisms>)| Everyone your organization deploys it to; Settings precedence says what can override it| Security policy and compliance requirements In the File column, `~/.claude` is the `.claude` folder in your home directory, and a bare `.claude` is the `.claude` folder inside your project. @@ -207,8 +207,8 @@ When the same key appears in more than one place, Claude Code uses the value from the highest level that sets it. The stack below shows the levels, highest on top; a key at a higher level overrides the same key anywhere below it. In order, highest precedence first: - 1. **Managed settings** : settings your organization deploys, by a `managed-settings.json` file, an MDM policy, or [server-managed settings](</docs/en/server-managed-settings>) from the claude.ai console. Nothing you set overrides them: a key you pass with `--settings` doesn’t override the same managed key, and a flag such as `--model` picks only from the models your organization allows. A managed `model` sets the model each session starts with, and you can still switch with `/model`; the lock is [`availableModels`](</docs/en/settings-reference#availablemodels>), which constrains `/model`, `--model`, and the `model` key in your own files. When your organization delivers more than one managed source, the rules for [precedence within the managed tier](</docs/en/managed-settings#precedence-within-the-managed-tier>) say what Claude Code reads from each. - 2. **Command line arguments** : flags you pass when you start `claude` from a terminal, for one session; see Change a setting for one session. Claude Code merges JSON you pass with `--settings <file-or-json>` with your settings files by the same rules as the other levels: it takes a key you set here over the same key in local, project, or user settings, and keeps the lower-level value for a key you omit. + 1. **Managed settings** : settings your organization deploys, by a `managed-settings.json` file, an MDM policy, or [server-managed settings](</docs/en/server-managed-settings>) from the claude.ai console. Nothing in your own settings files or `--settings` overrides a managed key, and a flag such as `--model` picks only from the models your organization allows. A managed [`model`](</docs/en/settings-reference#model>) is a starting default, not a lock; the locks are [`availableModels`](</docs/en/settings-reference#availablemodels>) and [`deniedModels`](</docs/en/settings-reference#deniedmodels>). When your organization delivers more than one managed source, the rules for [precedence within the managed tier](</docs/en/managed-settings#precedence-within-the-managed-tier>) say what Claude Code reads from each. + 2. **Command line** : JSON you pass with `--settings <file-or-json>` when you start `claude`, for that session only; see Change a setting for one session. A key you set there overrides the same key in your project and user settings files, and a key you leave out keeps its value from those files. Other flags, such as `--model`, set one thing for the session and aren’t part of this stack; a key’s entry on the [settings reference](</docs/en/settings-reference>) says which flags override it. 3. **Project local settings** (`.claude/settings.local.json`): your personal settings for this project. 4. **Shared project settings** (`.claude/settings.json`): settings your team checks into source control. 5. **User settings** (`~/.claude/settings.json`): your personal settings for every project. @@ -338,6 +338,8 @@ [`disableClaudeAiConnectors`](</docs/en/settings-reference#disableclaudeaiconnectors>)| `true` from any scope| Honored even when a managed source sets `false` [`enableArtifact`](</docs/en/settings-reference#enableartifact>)| `false` from any scope, and `disableArtifact: true` from any scope| Honored even when a managed source sets `true`; nothing turns the [Artifact tool](</docs/en/artifacts#disable-artifacts>) back on. Requires Claude Code v2.1.242 or later [`isolatePeerMachines`](</docs/en/settings-reference#isolatepeermachines>)| `true` from any scope| Honored even when a managed source sets `false` +[`permissions.blockReadsOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockreadsoutsideworkingdirectories>)| `true` from any scope| Honored even when a managed source sets `false`. Requires Claude Code v2.1.257 or later +[`autoMode.classifyAllShell`](</docs/en/settings-reference#automode-classifyallshell>)| `true` from `~/.claude/settings.json` or `--settings`| Honored even when a managed source sets `false` [`remoteControlAtStartup`](</docs/en/settings-reference#remotecontrolatstartup>)| `false` from `.claude/settings.json` or `.claude/settings.local.json`| Honored even when a managed source sets `true`; a project or local `true` is ignored [`crossSessionInbound`](</docs/en/settings-reference#crosssessioninbound>)| A stricter value from `.claude/settings.json` or `.claude/settings.local.json`, on the `accept` < `hold` < `refuse` ladder| Honored over managed, `--settings`, and user values; a project or local value that isn’t stricter is ignored [`useAutoModeDuringPlan`](</docs/en/settings-reference#useautomodeduringplan>)| `false` from any managed source, `--settings`, `~/.claude/settings.json`, or `.claude/settings.local.json`| Honored even when the winning managed source sets `true`; a `false` in `.claude/settings.json` is ignored
modified All settings View current →
--- a/settings-reference.md +++ b/settings-reference.md @@ -289,7 +289,7 @@ `alwaysThinkingEnabled` -Turn [extended thinking](</docs/en/model-config#extended-thinking>) off for every session by setting this to `false`. Thinking is on by default, so `true` changes nothing. Most people set this through `/config` rather than by editing the file. On models that always think, such as Opus 5.5, Sonnet 5.5, and the Fable models, `false` has no effect. On [third-party providers](</docs/en/third-party-integrations>) Claude Code omits the `thinking` parameter instead of turning thinking off, so adaptive-reasoning models may still think. With thinking turned off on the Anthropic API, Claude Code sends effort `high` instead of a higher level to models it knows [don’t accept that combination](</docs/en/errors#effort-isnt-available-with-thinking-turned-off>), such as Opus 5. +Turn [extended thinking](</docs/en/model-config#extended-thinking>) off for every session by setting this to `false`. Thinking is on by default, so `true` changes nothing. Most people set this through `/config` rather than by editing the file. On models that always think, such as Opus 5.5, Sonnet 5.5, Haiku 5.5, and the Fable models, `false` has no effect. On [third-party providers](</docs/en/third-party-integrations>) Claude Code omits the `thinking` parameter instead of turning thinking off, so adaptive-reasoning models may still think. With thinking turned off on the Anthropic API, Claude Code sends effort `high` instead of a higher level to models it knows [don’t accept that combination](</docs/en/errors#effort-isnt-available-with-thinking-turned-off>), such as Opus 5. * **Scope** : `Any file` * **Type** : Boolean @@ -2647,7 +2647,7 @@ `plansDirectory` -Choose where Claude Code stores the plan files it writes in [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>). Claude Code resolves the path relative to the project root and keeps the default when the path resolves outside it. +Choose where Claude Code stores the plan files it writes in [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>). Claude Code resolves the path relative to the project root. * **Scope** : `Any file` * **Type** : string, a path relative to the project root @@ -2658,6 +2658,11 @@ { "plansDirectory": "./plans" } + +Claude Code stores plans in `~/.claude/plans` instead of the directory you set in cases such as these: + + * **Outside the project root** : the path resolves outside the project root, as `"../plans"` does. + * **Backslash on macOS, Linux, and WSL** : the resolved path contains a backslash, as the Windows-style `"docs\\plans"` does. Write `"docs/plans"`, which works on Windows too. ### @@ -5393,7 +5398,7 @@ Turn off Code sessions that run on the device in the [desktop app](</docs/en/desktop#local-sessions-on-managed-devices>), for deployments where developers should work on remote machines over SSH. In the Code tab, the **Local** environment stays in the environment dropdown but is grayed out and can’t be selected, with a tooltip saying your organization turned it off; on Windows the WSL entry is grayed out the same way, though whether WSL sessions run on a managed device at all is [governed separately](</docs/en/admin-setup#wsl-sessions-in-claude-code-desktop>). New sessions default to the first [SSH connection](</docs/en/desktop#ssh-sessions>) if one is configured, and the app refuses to start or resume a session on the device, including an SSH connection back to the same machine. SSH sessions to other hosts and cloud sessions are unaffected. The desktop app reads this key; the terminal CLI ignores it. Requires Claude Desktop v1.37937.0 or later. - * **Scope** : `Managed` + * **Scope** : `Managed`. By default, the desktop app reads the key from [one managed source](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). * **Type** : Boolean; only the JSON Boolean `true` takes effect * `true`: the desktop app offers no on-device Code sessions; existing local sessions stay listed but can’t continue * `false`: local sessions stay available @@ -5552,7 +5557,7 @@ Add SSH connections to the [Desktop](</docs/en/desktop#pre-configure-ssh-connections-for-your-team>) environment dropdown. Administrators use it to distribute shared connections to a team. Connections you define in managed settings show as managed, so users can select them but can’t edit or delete them in the app. - * **Scope** : `User or managed`. The desktop app reads this key. + * **Scope** : `User or managed`. The desktop app reads this key. By default, it reads managed connections from [one managed source](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). * **Type** : array of objects, each with required `id`, `name`, and `sshHost` and optional `sshPort` and `sshIdentityFile` * **Default** : unset @@ -5578,7 +5583,7 @@ Limit the hosts a [Desktop SSH session](</docs/en/desktop#restrict-which-ssh-hosts-users-can-connect-to>) can connect to. Only the Desktop app reads this key; the CLI doesn’t. Patterns are case-insensitive: `*` matches any host, `*.example.com` matches `example.com` and every subdomain, and anything else is an exact match against the hostname after `~/.ssh/config` resolution. An empty array turns SSH sessions off. - * **Scope** : `Managed` + * **Scope** : `Managed`. By default, Desktop reads the key from [one managed source](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). * **Type** : array of hostname patterns * **Default** : unset, so any host is allowed @@ -5589,6 +5594,8 @@ { "sshHostAllowlist": ["*.devboxes.example.com", "bastion.example.com"] } + +A value that Desktop can’t read as a list of hosts, such as `true` or an object, counts as an empty array until you correct it, except `null`, which counts as unset. Requires Claude Desktop v2.26454.0 or later. If you set `managedSourcesBehavior` to `"merge"` in your highest-ranked source, Desktop combines the lists from every [admin source](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) and allows a host that matches any of them. If you set an empty array in one source, SSH sessions stay on for the hosts another source lists. ##
modified Advanced setup View current →
--- a/setup.md +++ b/setup.md @@ -47,7 +47,7 @@ curl -fsSL https://claude.ai/install.sh | bash -**Windows PowerShell:** +On Windows, your prompt shows `PS C:\` when you’re in PowerShell and `C:\` without the `PS` when you’re in CMD.**Windows PowerShell:** irm https://claude.ai/install.ps1 | iex @@ -55,7 +55,7 @@ curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd -When the installer finishes, open a new terminal window and run `claude --version`. A working installation prints a version number. If your shell says `claude` isn’t found or isn’t recognized, the install directory isn’t on your PATH yet: see [Fix your PATH](</docs/en/troubleshoot-install#command-not-found-claude-after-installation>).If you see `The token '&&' is not a valid statement separator`, you’re in PowerShell, not CMD. If you see `'irm' is not recognized as an internal or external command`, you’re in CMD, not PowerShell. Your prompt shows `PS C:\` when you’re in PowerShell and `C:\` without the `PS` when you’re in CMD.If the install command fails with `syntax error near unexpected token '<'`, a `403`, or another curl error, see [Troubleshoot installation](</docs/en/troubleshoot-install#find-your-error>) to match the error to a fix and for alternative install methods.[Git for Windows](<https://git-scm.com/downloads/win>) is recommended on native Windows so Claude Code can use the Bash tool. If Git for Windows is not installed, Claude Code uses PowerShell as the shell tool instead. WSL setups do not need Git for Windows. +The install command shows no progress while it downloads Claude Code. When the installer finishes, open a new terminal window and run `claude --version`. A working installation prints a version number. If your shell says `claude` isn’t found or isn’t recognized, the install directory isn’t on your PATH yet: see [Fix your PATH](</docs/en/troubleshoot-install#command-not-found-claude-after-installation>).If you see `The token '&&' is not a valid statement separator`, you’re in PowerShell, not CMD. If you see `'irm' is not recognized as an internal or external command`, you’re in CMD, not PowerShell.If the install command fails with `syntax error near unexpected token '<'`, a `403`, or any other error, see [Troubleshoot installation](</docs/en/troubleshoot-install#find-your-error>) to match the error to a fix and for alternative install methods.[Git for Windows](<https://git-scm.com/downloads/win>) is recommended on native Windows so Claude Code can use the Bash tool. If Git for Windows is not installed, Claude Code uses PowerShell as the shell tool instead. WSL setups do not need Git for Windows. Native installations automatically update in the background to keep you on the latest version. @@ -89,7 +89,13 @@ WSL 2| WSL 2 enabled| Supported| Linux toolchains or sandboxed command execution WSL 1| WSL 1 enabled| Not supported| If WSL 2 is unavailable -**Option 1: Native Windows** Run the install command from PowerShell or CMD. You do not need to run as Administrator. Installing [Git for Windows](<https://git-scm.com/downloads/win>) is optional. It provides Git Bash, which the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) and the [Monitor tool](</docs/en/tools-reference#monitor-tool>) need. Whether you install from PowerShell or CMD only affects which install command you run. Your prompt shows `PS C:\Users\YourName>` in PowerShell and `C:\Users\YourName>` without the `PS` in CMD. If you’re new to the terminal, the [terminal guide](</docs/en/terminal-guide#windows>) walks through each step. After installation, launch `claude` from any terminal. +#### + +​ + +Install on native Windows + +Run the install command from PowerShell or CMD. You do not need to run as Administrator. Installing [Git for Windows](<https://git-scm.com/downloads/win>) is optional. It provides Git Bash, which the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) and the [Monitor tool](</docs/en/tools-reference#monitor-tool>) need. Whether you install from PowerShell or CMD only affects which install command you run. Your prompt shows `PS C:\Users\YourName>` in PowerShell and `C:\Users\YourName>` without the `PS` in CMD. If you’re new to the terminal, the [terminal guide](</docs/en/terminal-guide#windows>) walks through each step. After installation, launch `claude` from any terminal. * **Without Git for Windows** , Claude Code runs shell commands via the [PowerShell tool](</docs/en/tools-reference#powershell-tool>). * **With Git for Windows** , Claude Code uses Git Bash for the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>). If Claude Code can’t find Git Bash, set the path in your [settings.json file](</docs/en/settings>): @@ -100,7 +106,15 @@ } } -When Git for Windows is installed, the PowerShell tool is available alongside Bash: on by default for claude.ai and Console accounts, and enabled with `CLAUDE_CODE_USE_POWERSHELL_TOOL=1` in Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry sessions. Set it to `0` to turn the tool off. See [PowerShell tool](</docs/en/tools-reference#powershell-tool>) for setup and limitations. **Option 2: WSL** Open your WSL distribution and run the Linux installer from the install instructions above. You install and launch `claude` inside the WSL terminal, not from PowerShell or CMD. +When Git for Windows is installed, the PowerShell tool is available alongside Bash: on by default for claude.ai and Console accounts, and enabled with `CLAUDE_CODE_USE_POWERSHELL_TOOL=1` in Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry sessions. Set it to `0` to turn the tool off. See [PowerShell tool](</docs/en/tools-reference#powershell-tool>) for setup and limitations. + +#### + +​ + +Install in WSL + +Open your WSL distribution and run the Linux installer from the install instructions. You install and launch `claude` inside the WSL terminal, not from PowerShell or CMD. ### @@ -146,7 +160,7 @@ Authenticate -Claude Code requires a Pro, Max, Team, Enterprise, or Console account. The free claude.ai plan does not include Claude Code access. You can also use Claude Code with a third-party API provider like [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>). After installing, log in by running `claude` and following the browser prompts. If the `ANTHROPIC_API_KEY` environment variable is set, Claude Code prompts you once to approve the key instead of opening a browser. See [Authentication](</docs/en/authentication>) for all account types and team setup options. +Claude Code requires a Pro, Max, Team, Enterprise, or Console account. The free claude.ai plan does not include Claude Code access. You can also use Claude Code with a third-party API provider like [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>). After installing, log in by running `claude` and following the browser prompts. If you’ve set the `ANTHROPIC_API_KEY` environment variable and you approve the key when Claude Code asks whether to use it, Claude Code skips the login prompt. See [Authentication](</docs/en/authentication>) for all account types and team setup options. ##
modified Customize your status line View current →
Show diff (202 lines)
--- a/statusline.md +++ b/statusline.md @@ -124,7 +124,17 @@ How status lines work -Claude Code runs your script with JSON session data on stdin and displays whatever the script prints to stdout. **When it updates** Your script runs once when a session starts, including when you resume one. After that, it runs again when: +Claude Code runs your script with JSON session data on stdin and displays whatever the script prints to stdout. + +The status line runs locally and does not consume API tokens. It temporarily hides during certain UI interactions, including the help menu and permission prompts. + +### + +​ + +When the status line updates + +Your script runs once when a session starts, including when you resume one. After that, it runs again when: * A new assistant message arrives * `/compact` finishes @@ -135,15 +145,27 @@ * A rate-limit window in the data your script last received reaches its `resets_at` time * A warm prompt cache in the data your script last received reaches its `expires_at` time -Claude Code debounces updates at 300ms, so rapid changes batch together and your script runs once after the changes stop. A change to the `command` itself skips the debounce: Claude Code runs the new command right away. If a new update triggers while your script is still running, Claude Code cancels the in-flight script. If you edit your script, the changes appear the next time an update trigger re-runs it. The event-driven triggers can go quiet when the main session is idle, for example while a coordinator waits on background subagents. To keep time-based or externally-sourced segments current during idle periods, set `refreshInterval` to also re-run the command on a fixed timer. **What your script can output** +Claude Code debounces updates at 300ms, so rapid changes batch together and your script runs once after the changes stop. A change to the `command` itself skips the debounce: Claude Code runs the new command right away. If a new update triggers while your script is still running, Claude Code cancels the in-flight script. If you edit your script, the changes appear the next time an update trigger re-runs it. The event-driven triggers can go quiet when the main session is idle, for example while a coordinator waits on background subagents. To keep time-based or externally-sourced segments current during idle periods, set `refreshInterval` to also re-run the command on a fixed timer. + +### + +​ + +What your script can output + +Your script can print more than a single line of plain text: * **Multiple lines** : each `echo` or `print` statement displays as a separate row. See the multi-line example. * **Colors** : use [ANSI escape codes](<https://en.wikipedia.org/wiki/ANSI_escape_code#Colors>) like `\033[32m` for green (terminal must support them). See the git status example. * **Links** : use [OSC 8 escape sequences](<https://en.wikipedia.org/wiki/ANSI_escape_code#OSC>) to make text clickable (Cmd+click on macOS, Ctrl+click on Windows/Linux). Requires a terminal that supports hyperlinks like iTerm2, Kitty, or WezTerm. See the clickable links example. -**Sizing output to the terminal** Claude Code captures your script’s output instead of connecting it directly to the terminal, so `tput cols` and language-level width detection cannot read the terminal size from inside the script. Read the `COLUMNS` and `LINES` environment variables instead. Claude Code sets these to the current terminal dimensions before running your script. - -The status line runs locally and does not consume API tokens. It temporarily hides during certain UI interactions, including the help menu and permission prompts. +### + +​ + +Size output to the terminal + +Claude Code captures your script’s output instead of connecting it directly to the terminal, so `tput cols` and language-level width detection cannot read the terminal size from inside the script. Read the `COLUMNS` and `LINES` environment variables instead. Claude Code sets these to the current terminal dimensions before running your script. ## @@ -1100,7 +1122,32 @@ } } -The command runs once per refresh tick and receives all visible subagent rows as a single JSON object on stdin. The input includes the [base hook fields](</docs/en/hooks#common-input-fields>), a `columns` field with the usable row width, and a `tasks` array. Each task has `id`, `name`, `type`, `status`, `description`, `label`, `startTime`, `model`, `effort`, `contextWindowSize`, `tokenCount`, `tokenSamples`, and `cwd`. The per-task `model` field is the resolved model ID the task runs on. `contextWindowSize` is that model’s context window in tokens, computed the same way as the main status line’s `context_window.context_window_size`, so you can render a per-row percentage from `tokenCount`. Both fields require Claude Code v2.1.205 or later and are omitted for a task whose model isn’t resolved yet. The per-task `effort` field is the reasoning effort set for that subagent, in its [definition frontmatter](</docs/en/sub-agents#supported-frontmatter-fields>) or on the individual invocation. The value is either one of the effort level strings `low`, `medium`, `high`, `xhigh`, or `max`, or a numeric token budget. The field reports the configured value as written: if the model doesn’t support that level, the effort Claude Code actually applies may differ. The field requires Claude Code v2.1.214 or later and is absent when no level is set for the subagent. Write one JSON line to stdout per row you want to override, in the form `{"id": "<task id>", "content": "<row body>"}`. The `content` string is rendered as-is, including ANSI colors and OSC 8 hyperlinks. Omit a task’s `id` to keep the default rendering for that row; emit an empty `content` string to hide it. The same trust, `disableAllHooks`, and [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>) gates that apply to `statusLine` apply here. Plugins can ship a default `subagentStatusLine` in their [`settings.json`](</docs/en/plugins/manifest-reference#standard-layout>), but unlike hooks, plugin values don’t run under `allowManagedHooksOnly` even when the plugin is force-enabled in managed settings `enabledPlugins`. +The command runs once per refresh tick and receives all visible subagent rows as a single JSON object on stdin. The input includes the [base hook fields](</docs/en/hooks#common-input-fields>), a `columns` field with the usable row width, and a `tasks` array with one entry per row, described in Task fields. Write one JSON line to stdout per row you want to override, in the form `{"id": "<task id>", "content": "<row body>"}`. The `content` string is rendered as-is, including ANSI colors and OSC 8 hyperlinks. Omit a task’s `id` to keep the default rendering for that row; emit an empty `content` string to hide it. The same trust, `disableAllHooks`, and [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>) gates that apply to `statusLine` apply here. Plugins can ship a default `subagentStatusLine` in their [`settings.json`](</docs/en/plugins/manifest-reference#standard-layout>), but unlike hooks, plugin values don’t run under `allowManagedHooksOnly` even when the plugin is force-enabled in managed settings `enabledPlugins`. + +### + +​ + +Task fields + +Each entry in the `tasks` array describes one subagent row with the fields below. Fields marked optional are omitted when they have no value, so guard for their absence in your script. + +Field| Type| Description +---|---|--- +`id`| string| Identifier of the task. Echo it as `id` in the line you write back for this row +`name`| string, optional| Name the subagent is [addressed by](</docs/en/sub-agents#subagent-names>), when it has one +`type`| string| Kind of task: `local_agent` +`agentType`| string| Subagent type the task runs as, such as the built-in [`Explore`](</docs/en/sub-agents#built-in-subagents>) or a custom `code-reviewer`. Holds the same value that hooks receive as [`agent_type`](</docs/en/hooks#subagentstart>). Requires Claude Code v2.1.293 or later +`status`| string| State of the task, such as `running`, `completed`, `failed`, or `killed` +`description`| string| Short description of the task, such as the one Claude gave when it spawned the subagent +`label`| string| Short progress summary of the task when Claude Code has one, otherwise the same text as `description` +`startTime`| number| When the task started, in milliseconds since the Unix epoch +`model`| string, optional| ID of the resolved model the task runs on. Omitted until the model is resolved. Requires Claude Code v2.1.205 or later +`effort`| string or number, optional| Reasoning effort set for the subagent in its [definition frontmatter](</docs/en/sub-agents#supported-frontmatter-fields>) or on the individual invocation: `low`, `medium`, `high`, `xhigh`, `max`, or a numeric token budget. This is the configured value, and the effort Claude Code applies can differ when the model doesn’t support that level. Omitted when no effort is set. Requires Claude Code v2.1.213 or later +`contextWindowSize`| number, optional| Context window of `model` in tokens, computed the same way as the main status line’s `context_window.context_window_size`, so you can render a per-row percentage from `tokenCount`. Omitted when `model` is. Requires Claude Code v2.1.205 or later +`tokenCount`| number| Running token count of the subagent, the figure the default row shows +`tokenSamples`| array of numbers| Up to the last 16 `tokenCount` readings, one per refresh tick, oldest first and ending with the current one +`cwd`| string| Working directory of the subagent: its own directory when it runs in one, such as an isolated worktree, otherwise the session’s working directory ## @@ -1120,7 +1167,15 @@ Troubleshooting -**Status line not appearing** +If the status line is blank, start with Status line not appearing. A folder you haven’t trusted and a script that fails also leave it blank, as Workspace trust required and Script errors or hangs describe. + +### + +​ + +Status line not appearing + +If you configured a status line and nothing shows at the bottom of the interface, work through these checks: * Verify your script is executable: `chmod +x ~/.claude/statusline.sh` * Check that your script outputs to stdout, not stderr @@ -1131,18 +1186,29 @@ * Run `claude --debug` to log your script’s stderr on every status line invocation, and its exit code on the first invocation in a session * Ask Claude to read your settings file and execute the `statusLine` command directly to surface errors -**Status line shows`--` or empty values** - - * Fields may be `null` before the first API response completes - * Handle null values in your script with fallbacks such as `// 0` in jq - * Restart Claude Code if values remain empty after multiple messages - -**Context percentage shows unexpected values** - - * Use `used_percentage` for the simplest accurate context state - * The status line reports the counts from the last API response, while `/context` adds an estimate for messages added since that response, so `/context` can read higher until the next response - -**OSC 8 links not clickable** +### + +​ + +Status line shows `--` or empty values + +Fields may be `null` before the first API response completes, so handle null values in your script with fallbacks such as `// 0` in jq. Restart Claude Code if values remain empty after multiple messages. + +### + +​ + +Context percentage shows unexpected values + +The status line reports the counts from the last API response, while `/context` adds an estimate for messages added since that response, so `/context` can read higher until the next response. Use `used_percentage` for the simplest accurate context state. For the formula behind `used_percentage`, see Context window fields. + +### + +​ + +OSC 8 links not clickable + +Whether a link is clickable depends on your terminal, on whether Claude Code detects hyperlink support in it, on whether SSH or tmux strips the escape sequence, and on how your script prints it: * Verify your terminal supports OSC 8 hyperlinks (iTerm2, Kitty, WezTerm) * Terminal.app does not support clickable links @@ -1157,25 +1223,42 @@ * SSH and tmux sessions may strip OSC sequences depending on configuration * If escape sequences appear as literal text like `\e]8;;`, use `printf '%b'` instead of `echo -e` for more reliable escape handling -**Display glitches with escape sequences** - - * Complex escape sequences (ANSI colors, OSC 8 links) can occasionally cause garbled output if they overlap with other UI updates - * If you see corrupted text, try simplifying your script to plain text output - * Multi-line status lines with escape codes are more prone to rendering issues than single-line plain text - -**Workspace trust required** - - * Because `statusLine` executes a shell command, Claude Code runs it under the same [workspace trust rule as hooks in settings files](</docs/en/permissions#what-runs-before-you-trust-a-folder>). Accepting the dialog for the folder, or for a parent directory whose trust extends to it, is enough. - * Until then, the status line stays blank, and `claude --debug` logs `Status line command skipped: workspace trust not accepted`. Restart Claude Code and accept the trust dialog to enable it. - -**Script errors or hangs** +### + +​ + +Display glitches with escape sequences + +Complex escape sequences (ANSI colors, OSC 8 links) can occasionally cause garbled output if they overlap with other UI updates. Multi-line status lines with escape codes are more prone to rendering issues than single-line plain text. If you see corrupted text, try simplifying your script to plain text output. + +### + +​ + +Workspace trust required + +Until you accept the workspace trust dialog, the status line stays blank. Because `statusLine` executes a shell command, Claude Code runs it under the same [workspace trust rule as hooks in settings files](</docs/en/permissions#what-runs-before-you-trust-a-folder>). Accepting the dialog for the folder, or for a parent directory whose trust extends to it, is enough. Until then, `claude --debug` logs `Status line command skipped: workspace trust not accepted`. Restart Claude Code and accept the trust dialog to enable it. + +### + +​ + +Script errors or hangs + +Claude Code displays your script’s output only after the script exits with code 0: * Scripts that exit with non-zero codes or produce no output cause the status line to go blank * Slow scripts block the status line from updating until they complete. Keep scripts fast to avoid stale output. * If a new update triggers while a slow script is running, the in-flight script is cancelled * Test your script independently with mock input before configuring it -**Notifications share the status line row** Outside [fullscreen rendering](</docs/en/fullscreen>), Claude Code shows notifications on the same row as your status line. In fullscreen rendering, Claude Code gives notifications a row of their own. +### + +​ + +Notifications share the status line row + +Outside [fullscreen rendering](</docs/en/fullscreen>), Claude Code shows notifications on the same row as your status line. In fullscreen rendering, Claude Code gives notifications a row of their own. * System notifications like MCP server errors and auto-updates display on the right side of the row. Transient notifications such as the context-low warning also cycle through this area. * Enabling verbose mode adds a token counter to this area
modified Create custom subagents View current →
--- a/sub-agents.md +++ b/sub-agents.md @@ -8,7 +8,7 @@ * **Enforce constraints** by limiting which tools a subagent can use * **Reuse configurations** across projects with user-level subagents * **Specialize behavior** with focused system prompts for specific domains - * **Control costs** by routing tasks to faster, cheaper models like Haiku + * **Control costs** by routing tasks to faster, lower-cost models like Haiku Claude uses each subagent’s description to decide when to delegate tasks. When you create a subagent, write a clear description so Claude knows when to use it. Those descriptions take up context, so keep them short. When the combined descriptions of your subagents, except the built-in ones, exceed 15,000 tokens, Claude Code shows a [warning at startup with the total token count](</docs/en/errors#agent-descriptions-are-over-the-15000-token-limit>). Trim the `description` fields of your subagents, and move detail into each subagent’s system prompt, which only loads when that subagent runs. @@ -304,7 +304,7 @@ 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 -In two cases, a family alias such as `opus` in the per-invocation parameter or the frontmatter resolves to the main conversation’s model instead of the [version the alias points to](</docs/en/model-config#model-aliases>): +If an installed [mod](</docs/en/plugins/mods/overview>) sets a model in its [`agent.spawn`](</docs/en/plugins/mods/reference#subagents>) hook, Claude Code uses that model in place of the per-invocation parameter. In two cases, a family alias such as `opus` in the per-invocation parameter or the frontmatter resolves to the main conversation’s model instead of the [version the alias points to](</docs/en/model-config#model-aliases>): * **The main conversation’s model belongs to that family** : the subagent runs on the main conversation’s exact model, including any `[1m]` suffix, so it gets the same [extended context](</docs/en/model-config#extended-context>) window as the main conversation. * **Claude Code can’t tell the main conversation’s model family, on[a provider other than the Anthropic API](</docs/en/third-party-integrations>)**: this can happen with an [application inference profile ARN](</docs/en/amazon-bedrock#iam-configuration>) on Amazon Bedrock that Claude Code hasn’t resolved to a backing model. This case covers only the `opus` alias, and doesn’t apply when you set [`ANTHROPIC_DEFAULT_OPUS_MODEL`](</docs/en/model-config#environment-variables>), since `opus` then resolves to the model you set. @@ -963,7 +963,7 @@ * When a subagent completes, Claude receives its agent ID. * The built-in Explore and Plan agents are one-shot and return no agent ID, so Claude can’t resume them. Use `general-purpose` or a custom subagent when you need to continue the work. - * When a subagent stops at its `maxTurns` limit, Claude Code marks the returned output as partial. For subagents that return an agent ID, Claude Code also notes in the result that Claude can message the subagent to continue from where it stopped. + * When a subagent stops at its `maxTurns` limit, Claude Code marks the returned output as partial, and Claude can resume the subagent to continue its work. Claude uses the `SendMessage` tool with the agent’s ID or name as the `to` field to resume it. `SendMessage` doesn’t require [agent teams](</docs/en/agent-teams>) to be enabled; only structured team-protocol messages such as `shutdown_request` and `plan_approval_response` do. Beyond subagents and teammates, in sessions where cross-session messaging is enabled, Claude can use the same tool to message [your other Claude Code sessions](</docs/en/cross-session-messaging>), on this machine or [beyond it](</docs/en/cross-session-messaging#message-sessions-on-other-machines>). To resume a subagent, ask Claude to continue the previous work: @@ -1050,7 +1050,7 @@ Permissions| Prompts surface in your terminal| Prompts surface in your main session when running in the background Prompt cache| Shared with main session| Separate cache -Because a fork’s system prompt and tool definitions are identical to the parent, its first request reuses the parent’s [prompt cache](</docs/en/prompt-caching#subagents-and-the-cache>). This makes forking cheaper than spawning a fresh subagent for tasks that need the same context. When Claude spawns a fork through the Agent tool, it can pass `isolation: "worktree"` so the fork’s file edits are written to a separate git worktree instead of your checkout. A fork can’t spawn further forks. +Because a fork’s system prompt and tool definitions are identical to the parent, its first request reuses the parent’s [prompt cache](</docs/en/prompt-caching#subagents-and-the-cache>). Because of that reuse, a fork costs less than a fresh subagent for tasks that need the same context. When Claude spawns a fork through the Agent tool, it can pass `isolation: "worktree"` so the fork’s file edits are written to a separate git worktree instead of your checkout. A fork can’t spawn further forks. ###
modified Test a mod View current →
--- a/test.md +++ b/test.md @@ -91,7 +91,7 @@ The test passes because the hook’s `reply` is the object under `value`, whose `text` starts with `PASS`. To check the other branch, add a second test whose stub returns a `text` that starts with `FAIL`, and expect `Try again`. A stub for a mods API call returns an object with a `value` field, which holds what the call resolves to in your mod: `{ value: 7 }` makes `$.store.get` resolve to `7`. A stub for one of Claude Code’s events, such as [`turn.step`](</docs/en/plugins/mods/reference#turns>) or `tool.call`, returns that event’s own result, such as `{ result: 'ok' }`. `$.session.send` and `$.prompt.fill` take their event’s result too, as the table shows. Look up what a stub returns shows which form each common name takes. These errors mean a stub is wrong or missing. A failed test’s output includes a block headed `the engine reported:`, and each error appears there: - * `returned neither { value } nor { deny }`: a stub for a mods API call returned a bare value + * `returned neither { value } nor { deny }`: a stub for a mods API call returned a bare value, which fails the test * `no implementation for` followed by a name: your mod made that call and no stub answers it The kit also exports in-memory mocks that answer a whole namespace for you. `mock.clock(on)` answers [`$.clock`](</docs/en/plugins/mods/api#run-work-in-the-background>), `mock.store(on, { count: 7 })` answers `$.store` from a store that starts with those entries, and `mock.env(on, { CI: 'true' })` answers `$.env.get` from those variables. `mock.clock` returns a mock clock that your test advances, so a test of a timer doesn’t wait. `mock.store` returns nothing, so to check what your mod saved, write the two `store` stubs yourself as the drawing test does. @@ -172,7 +172,7 @@ `session.receive`| `($, e) => ({ text: e.text })`. Fire it with `$.session.receive({ origin: { kind: 'peer-send-message' }, text })`. `ui.render`| `() => ({ type: 'Text', props: {}, children: ['...'] })` -`expect` has the assertions `toBe`, `toEqual`, `toMatch`, `toMatchObject`, `toContain`, `toBeDefined`, `toBeUndefined`, and `toThrow`, and `.not` before any of them. +`expect` has the assertions `toBe`, `toEqual`, `toMatch`, `toMatchObject`, `toContain`, `toBeDefined`, `toBeUndefined`, and `toThrow`, and `.not` before any of them. When an `expect` fails inside a stub or hook that you passed to `on` as a plain function rather than an async generator, the test fails. The engine skips that hook, and the failure output names it, such as `in the test's store.set hook`. ##
modified Tools reference View current →
--- a/tools-reference.md +++ b/tools-reference.md @@ -622,7 +622,7 @@ WebSearch runs a query against Anthropic’s [web search](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool>) backend and returns result titles and URLs. It doesn’t fetch the result pages. To read a page Claude finds in search results, it follows up with WebFetch. The tool may issue up to eight backend searches per call, refining the search internally before returning results. Claude can scope results with `allowed_domains` to include only certain hosts, or `blocked_domains` to exclude them. The two lists can’t be combined in a single call. When the search request hits an overloaded API, Claude Code retries it with backoff; a call that still fails returns an error result. Before v2.1.212, the API error text could reach Claude as if it were search results. WebSearch permission rules take no specifier. A bare `WebSearch` entry in `allow` or `deny` is the only form. The search backend is not configurable. To search with a different provider, add an [MCP server](</docs/en/mcp>) that exposes a search tool. -WebSearch is available on the Claude API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). On Microsoft Foundry it requires a [deployment hosted on Anthropic](<https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry#hosting-options>): deployments hosted on Azure don’t support server-side tools, so the WebSearch call fails. On Google Cloud’s Agent Platform it works with Claude 4 and later models, including Opus, Sonnet, and Haiku. Amazon Bedrock doesn’t expose the server-side web search tool. +WebSearch is available on the Claude API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and Microsoft Foundry. On Google Cloud’s Agent Platform it works with Claude 4 and later models, including Opus, Sonnet, and Haiku. Amazon Bedrock doesn’t expose the server-side web search tool. ### @@ -630,7 +630,7 @@ Session search limit -A session can make at most 200 WebSearch calls, counted across the main conversation and every [subagent](</docs/en/sub-agents>) it spawns, so searches made by parallel research fan-outs count against the same limit. The limit requires Claude Code v2.1.212 or later. When Claude reaches the limit, further calls return a notice telling Claude to continue with the information it already gathered, rather than an error that would invite a retry. You don’t see the notice: a capped call appears in the conversation as a search that did nothing, and if Claude needs more searches, the notice tells it to ask you to raise the limit. Set the [`CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION`](</docs/en/env-vars>) environment variable to change the cap; it accepts a positive whole number, so the cap can be raised but not turned off. Running [`/clear`](</docs/en/commands#all-commands>) resets the count. If work that can still spawn [subagents](</docs/en/sub-agents>) survives the clear, such as a running workflow, the count carries over instead. +An interactive terminal session can make 200 WebSearch calls, counted across the main conversation and every [subagent](</docs/en/sub-agents>) it spawns, so searches made by parallel research fan-outs count against the same limit. The limit requires Claude Code v2.1.212 or later. When Claude reaches the limit, further calls return a notice telling Claude to continue with the information it already gathered, rather than an error that would invite a retry. You don’t see the notice: a capped call appears in the conversation as a search that did nothing, and if Claude needs more searches, the notice tells it to ask you to raise the limit. Set the [`CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION`](</docs/en/env-vars>) environment variable to change the cap; it accepts a positive whole number, so the cap can be raised but not turned off. An interactive terminal session’s limit refills at about 100 calls per hour, and [`CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR`](</docs/en/env-vars#variables>) sets the rate. Running [`/clear`](</docs/en/commands#all-commands>) resets the count. If work that can still spawn [subagents](</docs/en/sub-agents>) survives the clear, such as a running workflow, the count carries over instead. ##
modified Troubleshoot a mod View current →
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -26,7 +26,7 @@ `hooks modules are turned off here`| A setting is blocking your mods: `disableAllHooks` in your own settings, or your organization’s policy `hooks modules are turned off in this process`| Anthropic has turned installed mods off remotely. No setting on your machine turns them back on. -An organization can also set `allowManagedModsOnly` to allow only its own mods, which this command doesn’t report. In that case a mod you install doesn’t load, and [a message says why](</docs/en/plugins/mods/troubleshoot#messages-from-the-built-in-guard>). +An organization can also set `allowManagedModsOnly` to allow only its own mods, which this command doesn’t report. In that case Claude Code refuses a mod you install, and [a message says why](</docs/en/plugins/mods/troubleshoot#messages-from-the-built-in-guard>). ## @@ -86,7 +86,7 @@ Message contains| What it means| Where it appears ---|---|--- -`mods are limited to your organization's by policy (allowManagedModsOnly)`| Your organization allows only [its own mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>), so yours wasn’t loaded| The debug log, and the transcript in a session that hot-reloads a plugin directory +`mods are limited to your organization's by policy (allowManagedModsOnly)`| Your organization allows only [its own mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>), so yours was refused| The debug log, and the transcript in a session that hot-reloads a plugin directory `tried to lift a deny rule in your settings`| Your mod’s [`tool.check`](</docs/en/plugins/mods/reference#tools>) hook approved a call that a `deny` rule refuses. The call stays denied.| The transcript and the debug log, once for each mod in a session. In a `claude -p` run, the debug log only. `the deny rules in your settings could not be checked for this call, so it is refused`| The guard failed while checking a call that a mod approved, so it refused the call| The reason Claude reads for the denied call
modified Agent SDK reference - TypeScript View current →
--- a/typescript.md +++ b/typescript.md @@ -575,7 +575,7 @@ `extraArgs`| `Record<string, string | null>`| `{}`| Additional arguments `fallbackModel`| `string`| `undefined`| Model to use if the primary model fails. Accepts a comma-separated list. For the order and the cap, see [Fallback model chains](</docs/en/model-config#fallback-model-chains>). For guidance, see [Choose a model](</docs/en/agent-sdk/configuration#choose-a-model>) `forkSession`| `boolean`| `false`| When resuming with `resume`, fork to a new session ID instead of continuing the original session -`forwardSubagentText`| `boolean`| `false`| Forward subagent text and thinking blocks as assistant and user messages with `parent_tool_use_id` set, so consumers can render a nested transcript. Without this option, Claude Code emits subagent `tool_use` and `tool_result` blocks but not text or thinking. Messages from subagents at every nesting depth are forwarded on Claude Code v2.1.219 and later; before v2.1.219, only messages from depth-1 subagents appeared. Messages of subagents that a forked skill spawns, and of nested forked skills, require v2.1.275 or later +`forwardSubagentText`| `boolean`| `false`| Forward subagent text and thinking blocks as assistant and user messages with `parent_tool_use_id` set, so consumers can render a nested transcript. Without this option, Claude Code omits the text and thinking blocks of a subagent that runs in the [foreground](</docs/en/sub-agents#run-subagents-in-foreground-or-background>). For nested subagents, skills with `context: fork`, and the Claude Code version each needs, see [Follow subagent messages](</docs/en/headless#follow-subagent-messages>) `hooks`| `Partial<Record<``HookEvent``, ``HookCallbackMatcher``[]>>`| `{}`| Hook callbacks for events `includeHookEvents`| `boolean`| `false`| Include hook lifecycle events in the message stream as `SDKHookStartedMessage`, `SDKHookProgressMessage`, and `SDKHookResponseMessage`. Lifecycle events for `SessionStart` and `Setup` hooks are always included and don’t need this option. Some hook events, such as `Notification`, `SessionEnd`, `PreCompact`, and `PostCompact`, never produce an `SDKHookStartedMessage`, even with this option. For those events, Claude Code still emits an `SDKHookProgressMessage` while a command hook that runs for more than a second produces output, and emits an `SDKHookResponseMessage` only when a hook [that runs in the background](</docs/en/hooks#run-hooks-in-the-background>) finishes `includePartialMessages`| `boolean`| `false`| Include partial message events @@ -3711,7 +3711,7 @@ }>; }; -Reports code-review findings as a structured list so Claude Code can render them instead of printing them as text. `level` is the effort level the review ran at. Findings are ordered most-severe first, with at most 32 per call, and the array is empty when none survived. Requires Claude Code v2.1.196 or later. Each finding carries these fields: +Reports code-review findings as a structured list so Claude Code can render them instead of printing them as text. Findings are ordered most-severe first, with at most 32 per call, and the array is empty when none survived. Requires Claude Code v2.1.196 or later. `level` is optional and holds the effort level Claude reports for the review. Claude Code doesn’t compare it with the level the review ran at, so the two can differ. Each finding carries these fields: * `file`: repo-relative path the finding is in. The optional `line` is the 1-indexed line it anchors to. * `summary`: one-sentence statement of the defect. `failure_scenario` describes the concrete inputs and state that lead to the wrong output or crash. @@ -4731,7 +4731,7 @@ }>; }; -Returns the number of findings reported, the effort level the review ran at, and the findings echoed back for the result body. Requires Claude Code v2.1.196 or later. The echoed `short_summary` field requires Claude Code v2.1.212 or later. +Returns the number of findings reported, the `level` value Claude passed, and the findings echoed back for the result body. Requires Claude Code v2.1.196 or later. The echoed `short_summary` field requires Claude Code v2.1.212 or later. ### @@ -5342,7 +5342,7 @@ | { type: "enabled"; budgetTokens?: number; display?: ThinkingDisplay } // Fixed thinking token budget | { type: "disabled" }; // No extended thinking -The optional `display` field controls whether thinking text is returned `"summarized"` or `"omitted"`. On Claude Opus 4.7 and later, the API default is `"omitted"`, so set `"summarized"` to receive thinking content in `thinking` blocks. Claude Code leaves `display` out of requests to some providers, such as Amazon Bedrock and Google Cloud’s Agent Platform. On those providers, Opus 4.7 and later return empty `thinking` blocks even when you set `display` to `"summarized"`. +The optional `display` field controls whether thinking text is returned `"summarized"` or `"omitted"`. On Claude Opus 4.7 and later, the API default is `"omitted"`, so set `"summarized"` to receive thinking content in `thinking` blocks. Claude Code doesn’t pass your `display` value to some providers, such as Amazon Bedrock and Google Cloud’s Agent Platform. On those providers, Opus 4.7 and later return empty `thinking` blocks even when you set `display` to `"summarized"`. ### @@ -5703,12 +5703,15 @@ tasks: { task_id: string; task_type: string; + subagent_type?: string; description: string; ambient?: boolean; }[]; uuid: UUID; session_id: string; }; + +`subagent_type` names the subagent type on entries whose `task_type` is `"local_agent"`, such as `general-purpose` or a custom subagent’s name. The field requires Agent SDK v0.3.293 or later. ###
modified Use Claude Code in VS Code View current →
--- a/vs-code.md +++ b/vs-code.md @@ -24,7 +24,7 @@ * [Install for VS Code](<vscode:extension/anthropic.claude-code>) * [Install for Cursor](<cursor:extension/anthropic.claude-code>) -Or in VS Code, press `Cmd+Shift+X` (Mac) or `Ctrl+Shift+X` (Windows/Linux) to open the Extensions view, search for “Claude Code”, and click **Install**. The extension’s version number is the Claude Code version it bundles. For example, a feature that requires Claude Code v2.1.286 or later needs version 2.1.286 or later of the extension, which the Extensions view shows. The extension also installs in other VS Code forks like Devin Desktop or Kiro. Search for “Claude Code” in the editor’s Extensions view, or install from the [Open VSX registry](<https://open-vsx.org/extension/Anthropic/claude-code>). If your editor can’t install the extension, [install the CLI](</docs/en/quickstart>) and run `claude` in its integrated terminal instead. The CLI works in any terminal. +Or in VS Code, press `Cmd+Shift+X` (Mac) or `Ctrl+Shift+X` (Windows/Linux) to open the Extensions view, search for “Claude Code”, and click **Install**. The extension’s version number is the Claude Code version it bundles. For example, a feature that requires Claude Code v2.1.286 or later needs version 2.1.286 or later of the extension, which the Extensions view shows. The extension also installs in other VS Code forks like Devin Desktop or Kiro. Search for “Claude Code” in the editor’s Extensions view, or install from the [Open VSX registry](<https://open-vsx.org/extension/Anthropic/claude-code>). If your editor can’t install the extension, [install the CLI](</docs/en/quickstart>) and run `claude` in its integrated terminal instead. The CLI works in any terminal. To run Claude Code inside a dev container, see [Development containers](</docs/en/devcontainer>). If the extension doesn’t appear after installation, restart VS Code or run “Developer: Reload Window” from the Command Palette. @@ -521,6 +521,7 @@ * **Claude’s replies** : the extension announces each reply once, when it’s complete, and stays silent while text streams in. Your screen reader reads code blocks as a line-count summary, reads links by their label, and reads tables cell by cell; the full reply stays readable in the transcript. * **Permission requests and questions** : the extension announces a request when its permission prompt appears, naming the tool Claude wants to use. It announces in the same way when Claude asks you a question and when Claude finishes a plan and waits for your review. * **Status changes** : the extension announces when Claude starts working, when Claude is ready for your input, and when Claude Code starts compacting the conversation. + * **Queued messages** : when you send a message while Claude is working, the extension announces “Message queued.” for that message. * **Errors and model prompts** : the extension announces errors in the conversation, and announces when the [usage-credits consent prompt](</docs/en/model-config#fable-and-usage-credits>) or the [flagged-request prompt](</docs/en/model-config#ask-before-switching>) appears. While Claude works, your screen reader reads a text label in place of the progress spinner’s animation. When you reopen a session or switch to another one, the extension announces nothing: restored history, pending permission prompts, and in-progress status stay silent until something new happens. @@ -719,6 +720,19 @@ Fix common issues +Sign-in, network, and launch errors have their own entries on the install troubleshooting and error reference pages. Find what you see in the table, then follow the link. + +What you see| Where to go +---|--- +`API Error: 403 Request not allowed` after you sign in| [403 Forbidden after login](</docs/en/troubleshoot-install#403-forbidden-after-login>) +You’re asked to sign in again after you already signed in| [Not logged in or token expired](</docs/en/troubleshoot-install#not-logged-in-or-token-expired>) +Cloud provider credentials work in your terminal but not in the extension| [Bedrock, Agent Platform, or Foundry credentials not loading](</docs/en/troubleshoot-install#bedrock-agent-platform-or-foundry-credentials-not-loading>) +`SSL certificate verification failed` or `Self-signed certificate detected`| [SSL certificate errors](</docs/en/errors#ssl-certificate-errors>) +`Claude Code process exited with code 1`, or another code| [Claude Code process exited with code N](</docs/en/errors#claude-code-process-exited-with-code-n>) +`Could not locate the Claude CLI on PATH`| [Could not locate the Claude CLI on PATH](</docs/en/errors#could-not-locate-the-claude-cli-on-path>) +`The connection to Claude Code ended before this message completed`| [The connection to Claude Code ended before this message completed](</docs/en/errors#the-connection-to-claude-code-ended-before-this-message-completed>) +`claude` isn’t found in VS Code’s integrated terminal| Run CLI in VS Code + ### ​
modified Get started with Claude Code in the cloud View current →
--- a/web-quickstart.md +++ b/web-quickstart.md @@ -40,7 +40,7 @@ **Uses your local config**| No, repo only| Yes| Yes **Requires GitHub**| Yes, or [bundle a local repo](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) via `--cloud`| No| No **Keeps running if you disconnect**| Yes| No| While the session stays open on your machine -**[Permission modes](</docs/en/permission-modes>)**| Accept edits, Plan, Auto| All modes in the terminal; see [Switch permission modes](</docs/en/permission-modes#switch-permission-modes>) for the IDE and Desktop app| Manual, Accept edits, or Plan from claude.ai and the mobile app +**[Permission modes](</docs/en/permission-modes>)**| Accept edits, Plan, Auto| All modes in the terminal; see [Switch permission modes](</docs/en/permission-modes#switch-permission-modes>) for the IDE and Desktop app| Manual, Accept edits, Plan, or Auto from claude.ai and the mobile app **Network access**| Configurable per environment| Your machine’s network| Your machine’s network See the [terminal quickstart](</docs/en/quickstart>), [Desktop app](</docs/en/desktop>), or [Remote Control](</docs/en/remote-control>) docs to set up local sessions. @@ -138,7 +138,7 @@ Choose a permission mode -The mode dropdown next to the input shows the mode the session will run in: +The [permission mode control](</docs/en/permission-modes#switch-permission-modes>) shows the permission mode the session will run in: * **Auto** : a classifier reviews Claude’s actions instead of asking you. Appears when your organization allows auto mode and the selected model supports it * **Accept edits** : Claude makes changes and pushes a branch without stopping for approval
modified Orchestrate subagents at scale with dynamic workflows View current →
--- a/workflows.md +++ b/workflows.md @@ -462,7 +462,12 @@ * Set `"disableWorkflows": true` in `~/.claude/settings.json`. Persists across sessions. * Set `CLAUDE_CODE_DISABLE_WORKFLOWS=1`. Read at startup, so it applies wherever you set it. -To turn workflows off for your whole organization, set `"disableWorkflows": true` in [managed settings](</docs/en/server-managed-settings>), or use the toggle on the [Claude Code admin settings](<https://claude.ai/admin-settings/claude-code>) page. When workflows are disabled, the bundled workflow commands and the `/workflow-authoring` skill are unavailable, the `ultracode` keyword no longer triggers a run, and the **Ultracode** toggle is removed from `/effort`. A run that was already in progress keeps going. Turning workflows off also makes ultracode unavailable. No managed setting rules out ultracode alone: wherever it’s [available](</docs/en/model-config#when-ultracode-is-available>), users can turn it on with `/effort ultracode`. An [effort cap](</docs/en/model-config#organization-effort-limits>) lowers the effort level a session with ultracode on runs at, but doesn’t turn ultracode off. +To turn workflows off for your whole organization, set `"disableWorkflows": true` in [managed settings](</docs/en/server-managed-settings>), or use the toggle on the [Claude Code admin settings](<https://claude.ai/admin-settings/claude-code>) page. When workflows are disabled: + + * `/workflows`, the workflow commands, and the `/workflow-authoring` skill are unavailable + * The `ultracode` keyword no longer triggers a run, and the **Ultracode** toggle is removed from `/effort` + +A run that was already in progress keeps going. Turning workflows off also makes ultracode unavailable. No managed setting rules out ultracode alone: wherever it’s [available](</docs/en/model-config#when-ultracode-is-available>), users can turn it on with `/effort ultracode`. An [effort cap](</docs/en/model-config#organization-effort-limits>) lowers the effort level a session with ultracode on runs at, but doesn’t turn ultracode off. ##