modified Orchestrate teams of Claude Code sessions View current →
--- a/agent-teams.md +++ b/agent-teams.md @@ -138,7 +138,7 @@ * **Family alias such as`opus`**: On the Anthropic API and Claude Platform on AWS, Claude Code runs the teammate on the newest version of that family the allowlist permits. On providers with provider-specific model IDs, where the [substitution doesn’t operate](</docs/en/model-config#restrict-model-selection>), a blocked alias falls back like any other blocked value per the next bullet * **Any other blocked value, including a family alias on providers where the substitution doesn’t operate, or one whose family has no permitted version** : Claude Code runs the teammate on the lead’s model instead. If you set `CLAUDE_CODE_SUBAGENT_MODEL`, Claude Code tries that model first, under these same rules -Teammates inherit the lead’s [effort level](</docs/en/model-config#adjust-effort-level>). In split-pane mode this applies from v2.1.186; earlier versions did not pass the lead’s session effort to split-pane teammates. +By default, teammates inherit the lead’s [effort level](</docs/en/model-config#adjust-effort-level>). In split-pane mode this applies from v2.1.186; earlier versions did not pass the lead’s session effort to split-pane teammates. ### @@ -168,7 +168,7 @@ * `/compact`, `/clear`, and `/rewind` act on the lead’s conversation, so Claude Code asks you to confirm before running one of them from this view. * `/model` and `/fast` set the lead’s model and fast mode, not the teammate’s, so they don’t run from this view. A notice tells you why. -A teammate’s model and fast mode are fixed when it spawns. `/effort` still applies to the viewed teammate’s later turns, because teammates follow the lead’s [effort level](</docs/en/model-config#adjust-effort-level>). +A teammate’s model and fast mode are fixed when it spawns. ### @@ -251,7 +251,7 @@ Use subagent definitions for teammates -When spawning a teammate in either display mode, you can reference a [subagent](</docs/en/sub-agents>) type from the project, user, or managed [subagent scope](</docs/en/sub-agents#choose-the-subagent-scope>). This lets you define a role once, such as a security-reviewer or test-runner, and reuse it both as a delegated subagent and as an agent team teammate. To use a subagent definition, name it when you ask Claude to spawn the teammate: +When spawning a teammate in either display mode, you can reference a [subagent](</docs/en/sub-agents>) type from the project, user, managed, or plugin [subagent scope](</docs/en/sub-agents#choose-the-subagent-scope>). This lets you define a role once, such as a security-reviewer or test-runner, and reuse it both as a delegated subagent and as an agent team teammate. To use a subagent definition, name it when you ask Claude to spawn the teammate: Spawn a teammate using the security-reviewer agent type to audit the auth module. @@ -259,6 +259,8 @@ * **`tools`** : Claude Code limits the teammate to the tools in the definition’s `tools` list. For an in-process teammate, Claude Code adds `SendMessage` to that list, and in a [session that has the Task tools](</docs/en/tools-reference#task-tool-availability>) it adds `TaskCreate`, `TaskGet`, `TaskList`, and `TaskUpdate` too. * **`model`** : Claude Code uses the definition’s `model` in either display mode when your spawn prompt doesn’t name one. See how Claude Code picks a teammate’s model. + * **`disallowedTools`** : for an in-process teammate, Claude Code removes the tools in the definition’s `disallowedTools` from the teammate’s set. `SendMessage` and the Task tools it adds stay available even when the list names them. + * **`effort`** : for an in-process teammate, Claude Code applies the definition’s [`effort`](</docs/en/sub-agents#supported-frontmatter-fields>) under the [frontmatter effort rules](</docs/en/model-config#set-the-effort-level>). * **Body** : for an in-process teammate, Claude Code appends the definition’s body to its default system prompt as additional instructions. For a split-pane teammate, Claude Code uses the body in place of its default system prompt. * **`skills`** : Claude Code doesn’t apply the definition’s `skills` to a teammate in either display mode. The teammate loads skills from your project and user settings. * **`mcpServers`** : for a split-pane teammate, Claude Code applies the definition’s `mcpServers` under the [rules for that field](</docs/en/sub-agents#scope-mcp-servers-to-a-subagent>), which cover a session started with `--agent` as well. An in-process teammate ignores the field and loads MCP servers from your project and user settings.
modified Manage multiple agents with agent view View current →
--- a/agent-view.md +++ b/agent-view.md @@ -255,7 +255,7 @@ A pull or merge request number, such as `#1234`, or its URL| The session working on that pull request or merge request Any other URL| The session whose first prompt contained that URL -To combine filters, start with `a:`, `s:`, `n:`, or `o:` and add more, separated by spaces. The list shows the sessions that match all of them. For example, `s:blocked a:reviewer` lists the `reviewer` sessions that are waiting on you. While a filter is active, groups you collapsed expand to show their matches and the first match is selected, so pressing `Enter` opens it. Clear the input to remove the filter, and those groups collapse again. +To combine filters, start with `a:`, `s:`, `n:`, or `o:` and add more, separated by spaces. The list shows the sessions that match all of them. For example, `s:blocked a:reviewer` lists the `reviewer` sessions that are waiting on you. While a filter is active, groups you collapsed expand to show their matches and a match is selected, so pressing `Enter` opens it. Clear the input to remove the filter, and those groups collapse again. ### @@ -279,6 +279,8 @@ `Tab`| On an empty input, browse all subagents. Otherwise apply the highlighted suggestion `Ctrl+S`| Switch grouping between state and directory `Ctrl+T`| Pin or unpin the selected session +`Ctrl+F`| Find sessions by name, with the `n:` filter +`Alt+↑` / `Alt+↓`| Jump to the previous or next group header `Ctrl+R`| Rename the selected session `Ctrl+G`| Open the dispatch prompt in your `$VISUAL` or `$EDITOR` `Ctrl+J`| Insert a newline in the dispatch input @@ -288,7 +290,7 @@ `Ctrl+C`| Clear the input; press twice to exit `?`| Show all shortcuts -`Ctrl+S`, `Ctrl+T`, and `Ctrl+G` follow your [`keybindings.json`](</docs/en/keybindings>). Rebind or unbind `Ctrl+S` and `Ctrl+T` with the `agents:switchView` and `agents:togglePin` actions in the [`Agents` context](</docs/en/keybindings#agents-actions>), and `Ctrl+G` through the `Chat` context’s `chat:externalEditor` binding. The other shortcuts in the table can’t be rebound. +The shortcuts that have an action in the [`Agents` context](</docs/en/keybindings#agents-actions>) follow your [`keybindings.json`](</docs/en/keybindings>). So does `Ctrl+G`, through the `Chat` context’s `chat:externalEditor` binding. ## @@ -902,6 +904,7 @@ Version| Change ---|--- +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. v2.1.281| A [`--setting-sources`](</docs/en/cli-reference#cli-flags>) restriction carries over to a session you background with `←` or `/bg` and to the sessions you dispatch from agent view. Before this release, the spawned session loaded every settings source.
modified Claude Code on Amazon Bedrock View current →
--- a/amazon-bedrock.md +++ b/amazon-bedrock.md @@ -253,6 +253,21 @@ Startup model checks When Claude Code starts with Amazon Bedrock configured, it verifies that the models it intends to use are accessible in your account. If you have pinned a model version that is older than the current Claude Code default, and your account can invoke the newer version, Claude Code prompts you to update the pin. Accepting writes the new model ID to your [user settings file](</docs/en/settings>) and restarts Claude Code. Declining is remembered until the next default version change. Pins that point to an application inference profile ARN are skipped, since those are managed by your administrator. If you have not pinned a model and the current default is unavailable in your account, Claude Code falls back for the current session and shows a notice. It tries earlier versions of the default model first and, when the default is an Opus model and no Opus version is available, falls back to the default Sonnet model. The fallback is not persisted. Enable the newer model in your Amazon Bedrock account or pin a version to make the choice permanent. When you start the session on a specific Sonnet or Opus version, for example with `--model`, `ANTHROPIC_MODEL`, or the [`model` setting](</docs/en/settings-reference#model>), that version acts as the session’s pinned default for the matching `sonnet` or `opus` alias. Claude Code skips the availability check for the built-in default your model replaces and starts on the model you configured, with no fallback notice. Model aliases such as `opus` don’t act as pins, and neither does a model ID Claude Code doesn’t recognize, such as an application inference profile ARN. When these checks find a model your account can’t invoke, Claude Code remembers the refusal on this machine for up to a day, and launches during that time skip the remembered model without asking Amazon Bedrock again. Claude Code checks a remembered refusal of a current default model again at launch once ten minutes have passed since the last check, so a default your administrator re-enables comes back. To turn the memory off, set [`CLAUDE_CODE_SKIP_MODEL_ACCESS_MEMORY=1`](</docs/en/env-vars>). + +### + +​ + +When your organization enforces a model allowlist + +If you set [`enforceAvailableModels`](</docs/en/model-config#enforce-the-allowlist-for-the-default-model>) in managed settings, the startup model checks use only models your `availableModels` list permits. This applies on the Amazon Bedrock Invoke API and requires Claude Code v2.1.287 or later. A list without `enforceAvailableModels` doesn’t restrict these checks. The checks compare each entry with the inference profile ID they would send, including its region prefix, so write the list in those IDs. This example permits Opus 4.8 and Sonnet 4.5 for a deployment whose models resolve to `us.` profiles: + + { + "availableModels": ["us.anthropic.claude-opus-4-8", "us.anthropic.claude-sonnet-4-5-20250929-v1:0"], + "enforceAvailableModels": true + } + +For aliases, version prefixes, and `modelOverrides` entries, see [Pin models for third-party deployments](</docs/en/model-config#pin-models-for-third-party-deployments>). ###
modified Share session output as artifacts View current →
--- a/artifacts.md +++ b/artifacts.md @@ -124,7 +124,7 @@ Let Claude reply to comments on its own -After your session publishes an artifact, Claude Code watches that artifact for comments for as long as the session runs. When someone who can edit the artifact sends a comment to Claude, it reaches your session right away, and Claude can read the thread and reply without you asking. You need Claude Code v2.1.228 or later. If you turned [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) off, Claude Code doesn’t watch for comments. Your [permission mode](</docs/en/permission-modes>) decides what Claude does when a sent comment arrives: +After your session publishes an artifact, Claude Code watches that artifact for comments. When someone who can edit the artifact sends a comment to Claude, it reaches your session right away, and Claude can read the thread and reply without you asking. You need Claude Code v2.1.228 or later. If you turned [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) off, Claude Code doesn’t watch for comments. Your [permission mode](</docs/en/permission-modes>) decides what Claude does when a sent comment arrives: * **Claude replies on its own** : when your permission mode lets Claude post the reply without asking you, Claude reads the thread and replies, and edits the artifact when the comment asks for a change. You see `Auto-replied to comment thread on Artifact: <name>` or `Auto-edited Artifact: <name> in response to a comment thread`. * **Claude waits for you** : outside plan mode, when posting the reply would need your approval, you see `Comments are waiting on Artifact: <name>`. Claude then asks you for approval to read the thread, and again to post the reply. @@ -136,7 +136,7 @@ * **Stop the task in`/tasks`**: Claude stops replying on that artifact until you ask it to resume replies there. Publishing the artifact again doesn’t start replies again, and the stop still applies when you resume the session later. * **Press`Ctrl+X Ctrl+K` twice within 3 seconds**: the chord that [stops every running background subagent](</docs/en/interactive-mode#general-controls>) also stops Claude from replying on every artifact for the rest of the session. Asking Claude to resume replies doesn’t undo this stop. -If the service that delivers comments becomes unavailable or stops answering, Claude Code keeps trying to reconnect for a while, then stops watching each artifact your session was watching. +A watch that Claude Code started on its own can end after the artifact goes several hours without activity. To start the watch again, publish the artifact again or ask Claude to watch it. If the service that delivers comments becomes unavailable or stops answering, Claude Code keeps trying to reconnect for a while, then stops watching each artifact your session was watching. ##
modified Best practices for Claude Code View current →
--- a/best-practices.md +++ b/best-practices.md @@ -489,7 +489,7 @@ Fan out across files -Loop through tasks calling `claude -p` for each. Use `--allowedTools` to scope permissions for batch operations. +Loop through tasks calling `claude -p` for each. Use `--allowedTools` to pre-approve tools for batch operations. For large migrations or analyses, you can distribute work across many parallel Claude invocations. Run [`/batch <instruction>`](</docs/en/commands#all-commands>) to have Claude split the change across 5 to 30 subagents. Each subagent works in its own worktree. To drive the fan-out from your own script instead, loop over `claude -p`: @@ -505,14 +505,15 @@ for file in $(cat files.txt); do claude -p "Migrate $file from Python 2 to Python 3. Return OK or FAIL." \ - --allowedTools "Edit,Bash(git commit *)" + --allowedTools "Edit,Bash(git commit *)" \ + --permission-mode dontAsk done 3 Test on a few files, then run on all of them -Refine your prompt based on what goes wrong with the first 2-3 files, then run on the full set. The `--allowedTools` flag restricts what Claude can do, which matters when you’re running unattended. +Refine your prompt based on what goes wrong with the first 2-3 files, then run on the full set. The `--allowedTools` flag pre-approves the tools the migration needs, and [`--permission-mode dontAsk`](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>) denies anything else that would need approval, which matters when you’re running unattended. You can also integrate Claude into existing data/processing pipelines:
modified Claude Code changelog View current →
--- a/changelog.md +++ b/changelog.md @@ -1,4 +1,38 @@ 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.289 + +October 3, 2026 + + * Fixed a deny or ask rule on a nested part of a compound shell command not holding over a user-installed mod’s approval on managed machines + * Fixed the terminal freezing on short code blocks with many unclosed `<script>` tags or deeply nested `${` substitutions + * Fixed `Read` deny rules not applying to files @-mentioned, changed, or selected in the IDE through a symlink + * [VSCode] Reverted a 2.1.288 change to `claude auth status` that may have made sign-outs more frequent + * Improved how quickly large files open in a plugin code pane by laying the highlighted view out once at its final width + * Fixed `plugin list`, `plugin eval` and `plugin update` showing a stale copy of a plugin installed from a local folder marketplace, and hot reload for a symlinked `--plugin-dir` + * Fixed installed mods not loading in the first session after an upgrade + * Fixed a plugin’s rows above the prompt showing a stale row while the Background tasks dialog was open in fullscreen + * Fixed plugin panes drawing nothing when a link used a localhost address, an `@` in its path, an uppercase host or a `file:` path + * Fixed a user-installed plugin being able to rewrite the descriptions of an organization-managed MCP server’s sign-in tools + * Fixed a freeze or forced quit at launch when a plugin drew a Box with a border style the terminal does not know + * Fixed supervised and background sessions ending when a plugin’s on-screen handler threw asynchronously + * Fixed sessions ending with an interface error when a plugin region with no height kept growing + * Fixed Bash deny and ask rules missing a command behind an environment variable prefix with an expanded value (e.g. `TZ="$HOME" rm -rf build`) when the sandbox auto-allows commands + * Fixed a Bash deny or ask rule being skipped under sandbox auto-allow when a bare variable assignment came before the command + * Fixed `claude plugin validate` skipping the plugin when the folder also holds a marketplace manifest + * Added `agent.spawn` for teammates, one agent id across plugin hook events, and idle and waiting states in `$.agent.list()` + * Fixed sessions ending with “unrecoverable interface error” when a value a mod’s `ui.render` hook wrote made a row throw while drawn; the engine now draws its own row instead + * Fixed text with a tab, a stray escape and a C1 control, or a short text with a tab and CRLF line endings, drawing over the rows below it + * Fixed right-aligned content in a mod’s pane or band drawing under the close mark or `[-]`, which now also keep one column in from the terminal’s edge + * Fixed a mod’s `Client` that fails while drawn taking down everything the mod drew around it; it now fails alone and raises `ui.fault` + * Fixed `claude plugin validate` failing an Anthropic marketplace’s own plugin and listing a clean `plugin.json` in `--json` + * Fixed a mod’s band that fails to draw briefly telling the cards under it to step aside + * Fixed a failed plugin component showing `Error` or nothing as its reason when the failure carried no message + * Improved the line a mod’s author sees when its band or pane fails to draw: it names the mod and says nothing was drawn + * Fixed published artifact pages freezing or crashing the reader’s browser tab on short code blocks with many unclosed `<script>` tags + * Fixed a mod’s Client region staying failed for the whole session after the terminal threw while drawing it ​
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 @@ -382,15 +382,18 @@ Settings the locks don’t cover -Six parent-supplied settings pass the filter even with all five locks set. Under the default first-wins setting, an admin value blocks the parent’s only when it sits in the highest-priority admin source, except for `allowedMcpServers` while the MCP server lock is on. Under the `managedSourcesBehavior` merge opt-in, [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s value applies instead. +These parent-supplied settings pass the filter even with all five locks set: * **`forceLoginOrgUUID`** : Claude Code honors a parent-supplied value when the highest-priority admin source doesn’t set an org UUID. Gateway sign-in doesn’t check this key. An org UUID in the highest-priority admin source blocks the parent’s value and is the one Claude Code enforces. * **`allowedMcpServers`** : Claude Code honors a parent-supplied allowlist when no admin list is in force. `allowManagedMcpServersOnly` doesn’t block it, because the lock enforces whichever list wins as the managed value, including a parent-supplied one when no admin source supplies a list. A list in the highest-priority admin source blocks the parent’s and is the list Claude Code enforces, so set `allowedMcpServers` there, next to the lock. Before v2.1.223, a value for either key in any admin source blocked the parent’s. * **`availableModels`** : Claude Code honors a parent-supplied model list when the winning managed source doesn’t set one. If your fleet restricts models, set `availableModels` in the winning source. + * **`allowedProviders`** : Claude Code honors a parent-supplied API provider allowlist when the winning managed source doesn’t set one. If your fleet restricts which API providers developers can use, set `allowedProviders` in the winning source. Requires Claude Code v2.1.285 or later. * **`strictKnownMarketplaces`** : Claude Code honors a parent-supplied plugin marketplace allowlist when the winning managed source doesn’t set one. Claude Desktop 2.16120.0 or later sends one when its managed configuration turns user-added plugin marketplaces off. If your fleet restricts marketplaces, set `strictKnownMarketplaces` in the winning source. Requires Claude Code v2.1.282 or later. * **`blockedMarketplaces`** : a parent-supplied marketplace blocklist passes and adds to any blocklist that a managed source sets, since a blocklist can only restrict further. Requires Claude Code v2.1.282 or later. * **`strictPluginOnlyCustomization`** : this key passes the filter regardless of any lock, and it makes Claude Code ignore the developer’s own customization, including protective hooks. No lock blocks it. +Under the default first-wins setting, an admin value blocks the parent’s only when it sits in the highest-priority admin source, except for `allowedMcpServers` while the MCP server lock is on. Under the `managedSourcesBehavior` merge opt-in, [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s value applies instead. + ### ​ @@ -415,7 +418,7 @@ These guarantees apply to every session signed in through `/login`. The embedded sessions Claude Desktop launches get their policy as described in Deliver policy to Claude Desktop sessions, and the telemetry bullet says where their exports go. - * **Model access** : requests for models the policy doesn’t grant return 400, and the `/model` picker is filtered to the policy’s `availableModels` allowlist. Set [`enforceAvailableModels: true`](</docs/en/model-config#default-model-behavior>) in the policy so the Default option resolves to a model inside `availableModels` instead of to Claude Code’s built-in default; without it, Default stays selectable and is rejected at request time if that model isn’t granted. + * **Model access** : requests for models the policy doesn’t grant return 400, and the `/model` picker is filtered to the policy’s `availableModels` allowlist. This includes the model a session starts on before the developer picks one; see [Start sessions on a model the policy allows](</docs/en/claude-apps-gateway-config#start-sessions-on-a-model-the-policy-allows>). * **Telemetry destination** : in sessions signed in through `/login`, the CLI sends its OTLP/HTTP exports to the gateway rather than to a locally set `OTEL_EXPORTER_OTLP_ENDPOINT`, unless a policy [names your collector as the endpoint](</docs/en/claude-apps-gateway-config#export-directly-to-your-collector>). The gateway relays the exports it receives to the destinations in [`telemetry.forward_to`](</docs/en/claude-apps-gateway-config#telemetry>). * In the embedded sessions Claude Desktop launches, the CLI sends its exports to the configured `OTEL_EXPORTER_OTLP_ENDPOINT`. The CLI attaches the gateway session token to those exports only when that endpoint points at the gateway itself. * With no destination configured for a signal, the gateway accepts and discards it. @@ -447,7 +450,7 @@ Feature| Status| Notes ---|---|--- -Inference forwarding (Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, Microsoft Foundry, Anthropic)| Available| With per-upstream model translation and failover. The Amazon Bedrock upstream uses the `bedrock-runtime` endpoint and the AWS default credential chain; the Amazon Bedrock [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is not a supported upstream. The [Claude Platform on AWS upstream](</docs/en/claude-apps-gateway-config#claude-platform-on-aws>) requires Claude Code v2.1.198 or later on the gateway server. +Inference forwarding (Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, Microsoft Foundry, Anthropic)| Available| With per-upstream model translation and failover. The Amazon Bedrock upstream uses the `bedrock-runtime` endpoint and the AWS default credential chain. The [Amazon Bedrock Mantle upstream](</docs/en/claude-apps-gateway-config#amazon-bedrock-mantle-endpoint>) requires Claude Code v2.1.283 or later on the gateway server, and the [Claude Platform on AWS upstream](</docs/en/claude-apps-gateway-config#claude-platform-on-aws>) requires v2.1.198 or later. Model access and managed settings by IdP group| Available| Model access is enforced server-side; managed settings are delivered per IdP group and applied by the CLI at the [managed settings tier](</docs/en/settings#settings-precedence>) Claude Desktop| Available with opt-in| The gateway serves Claude Desktop’s configuration at `/user/bootstrap` once a policy [opts in with a `desktop` key](</docs/en/claude-apps-gateway-config#claude-desktop-overlay>), and Claude Desktop sends model requests from its Cowork and Code tabs, and from the Chat tab when you enable it, through the gateway. To turn on the Chat tab, see Connect Claude Desktop. Requires Claude Code v2.1.203 or later on the gateway server. Telemetry fan-out (OTLP/HTTP)| Available| Identity-stamped per export; both protobuf and JSON encodings
modified Claude apps gateway configuration View current →
Show diff (172 lines)
--- a/claude-apps-gateway-config.md +++ b/claude-apps-gateway-config.md @@ -355,7 +355,7 @@ The gateway doesn’t support guardrail input tags. It adds no guard content tags to prompts, so a guardrail filter that Amazon Bedrock applies only to tagged input doesn’t run on traffic through the gateway. For which filters depend on input tags, see [input tags](<https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-tagging.html>) in the Amazon Bedrock documentation. -Also grant `bedrock:ApplyGuardrail` on the guardrail to the principal that signs this upstream’s requests: the gateway’s AWS principal, or with `assume_role` the role named in `role_arn`. Set `guardrail` on every `bedrock` upstream or on none. The gateway refuses to start on a mix, because failover could otherwise send a request to a Bedrock upstream that has no guardrail. The guardrail covers Bedrock upstreams only. If you list another provider in `upstreams`, the gateway sends requests to that provider without the guardrail. When a `/v1/messages` request whose body carries an `amazon-bedrock-*` field, such as `amazon-bedrock-guardrailConfig`, reaches a Bedrock upstream that has `guardrail` set, the gateway answers 400 instead of forwarding it. +Also grant `bedrock:ApplyGuardrail` on the guardrail to the principal that signs this upstream’s requests: the gateway’s AWS principal, or with `assume_role` the role named in `role_arn`. Set `guardrail` on every `bedrock` upstream or on none. The gateway refuses to start on a mix, because failover could otherwise send a request to a Bedrock upstream that has no guardrail. The guardrail covers Bedrock upstreams only. If you list another provider in `upstreams`, the gateway sends requests to that provider without the guardrail, or refuses to start if that provider is `mantle`. When a `/v1/messages` request whose body carries an `amazon-bedrock-*` field, such as `amazon-bedrock-guardrailConfig`, reaches a Bedrock upstream that has `guardrail` set, the gateway answers 400 instead of forwarding it. ##### Bedrock in another AWS account @@ -393,7 +393,7 @@ * If STS refuses or is unreachable, the gateway doesn’t send the request with the upstream’s own credentials. It logs the STS error with what to check, then tries the next upstream you listed. Upstream error messages covers what the client receives when no upstream succeeds. A later upstream without `assume_role` would serve the request with its own credentials, so list one only if that is what you want. * The gateway calls the regional STS endpoint `sts.<region>.amazonaws.com`, which its network must reach. For the FIPS endpoint, set `AWS_USE_FIPS_ENDPOINT=true` in the gateway’s environment rather than `use_fips_endpoint` in an AWS config file. * `assume_role` applies to `provider: bedrock` only and needs SigV4 source credentials: the gateway refuses to start when it’s set beside `aws_bearer_token`. - * Every developer the gateway admits can use this upstream; `managed` governs which developers may use which models. To keep a model served through the role from also being served from another account, give it a custom id whose `upstream_model` map has only this upstream’s name. For such an id the gateway skips every other upstream, so neither the request nor the token count for an aborted request can fail over to another account. Built-in model names are still tried on every upstream in order, this one included, and a request that reaches it is signed with the same role, so list this upstream last unless its account should also serve them. + * Every developer the gateway admits can use this upstream; `managed` governs which developers may use which models. To keep a model served through the role from also being served from another account, give it a custom id whose `upstream_model` map has only this upstream’s name. For such an id the gateway skips every other upstream, so neither the request nor the token count for an aborted request can fail over to another account. A request for a built-in model name can still reach this upstream, and the gateway signs it with the same role. List this upstream last unless its account should also serve those models. This example gives one model a custom id that only the isolated upstream serves: @@ -415,6 +415,39 @@ session_name: email # or sub `session_name` selects which verified claim becomes the AWS `RoleSessionName`: `email` or `sub`. The gateway writes any character other than ASCII letters, digits, and `_+,.@-` as `=XX` hex per UTF-8 byte, and shortens a result longer than 64 characters to a prefix plus a hash, so each developer’s session name stays valid and unique. A request from a developer whose token lacks the claim isn’t sent through this upstream, and the operator log says to switch to `sub` or set `oidc.email_claim`. An active developer costs one STS call per hour per gateway replica, and concurrent first requests share one call. The gateway also makes one call of its own on this role: the token count for a request the client abandoned, so that [spend limits](</docs/en/claude-apps-gateway-spend-limits>) stay accurate. That count and its one-token fallback request are signed by the shared `claude-apps-gateway` session, so AWS attributes the fallback to `claude-apps-gateway` rather than to the developer. For strict per-developer attribution, set `assume_role` with `session_name` on every Bedrock upstream you list. An upstream without it signs the requests it serves with its own credentials. + +#### + +​ + +Amazon Bedrock Mantle endpoint + +The `mantle` provider sends inference to Amazon Bedrock’s [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>). It requires Claude Code v2.1.283 or later on the gateway server. Earlier gateway releases reject it at boot, so upgrade every replica before adding it. The example below puts Mantle first, with an Amazon Bedrock upstream behind it to serve every model the `models` field leaves out: + + upstreams: + - provider: mantle + region: us-east-1 + models: [claude-opus-4-7, claude-haiku-4-5] # required + auth: {} # AWS default credential chain + - provider: bedrock + region: us-east-1 + auth: {} + +The table below lists the fields specific to a `mantle` upstream. + +Field| Required| Description +---|---|--- +`region`| Yes| AWS region. The gateway derives the endpoint from it as `https://bedrock-mantle.<region>.api.aws/anthropic`. +`models`| Yes| The models your AWS account has been granted on Mantle, named as clients send them, such as `claude-haiku-4-5`. Only these go to this upstream, and every other model skips to the next one. +`auth`| No| Takes the same keys as the Amazon Bedrock upstream’s `auth` block, under the same rules. +`base_url`| No| Override the derived endpoint. Keep the `/anthropic` path at the end. + +Grant the upstream’s AWS identity Mantle’s own IAM actions for inference and token counting, which [Use the Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) lists. For a Mantle model ID that the gateway doesn’t know, add an entry to the top-level `models:` block whose `upstream_model` maps this upstream’s name to that ID. Then put that entry’s `id` in this upstream’s `models` field too. A `bedrock` upstream’s `guardrail` and `assume_role` settings don’t extend to the requests Mantle serves: + + * **`guardrail`** : the gateway applies no Bedrock guardrail to requests it sends to Mantle, so it refuses to start when a `mantle` upstream is listed while any `bedrock` upstream sets `guardrail`. + * **`assume_role`** : a `mantle` upstream takes no `assume_role`. Requests that Mantle serves are sent with the `mantle` upstream’s own `auth` credentials, and aren’t attributed per developer. + +For what Mantle’s own error responses mean, see [Mantle endpoint errors](</docs/en/amazon-bedrock#mantle-endpoint-errors>). #### @@ -586,7 +619,7 @@ Different accounts| One Amazon Bedrock upstream per account. The default chain (`auth: {}`) uses the pod’s identity; for a second account, add `assume_role` to reach it with short-lived credentials, or set explicit credentials or a bearer token in `auth:`. Provisioned throughput| Map the model to the provisioned-throughput ARN in `models:` for that upstream’s name. Other upstreams keep the on-demand ID, so PT capacity is exhausted before failing over. VPC / FIPS endpoints| Set `base_url:` on the upstream to your VPC endpoint or FIPS endpoint URL -Model-scoped routing| Only a custom model `id`, one that isn’t a built-in Claude model, skips the upstreams absent from its `upstream_model:` map. The gateway tries built-in models on every upstream in order and uses the provider’s default ID where the map has no entry, so for built-in models the map changes which ID an upstream receives rather than whether it is tried; an upstream that rejects the ID follows the same failover rules as any other upstream error. +Model-scoped routing| Only a custom model `id`, one that isn’t a built-in Claude model, skips the upstreams absent from its `upstream_model:` map. A `mantle` upstream is tried only for the models listed in its `models` field. On every other upstream the gateway tries built-in models in order and uses the provider’s default ID where the map has no entry, so for built-in models the map changes which ID an upstream receives rather than whether it is tried; an upstream that rejects the ID follows the same failover rules as any other upstream error. Failing over between cloud providers, or to the direct Anthropic API, changes which agreement, geography, and other terms govern the request. The CLI applies the same feature gating to gateways regardless of which upstream serves a given request, so failover doesn’t send a body field an upstream would reject. @@ -741,6 +774,9 @@ - match: {} cli: availableModels: [claude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5] + # Make the Default option in /model resolve inside each policy's + # list. The eng-contractors policy inherits enforceAvailableModels. + enforceAvailableModels: true A `match: {}` catch-all, conventionally listed last, is treated as a base layer. Every other policy inherits any key it doesn’t set from the catch-all, so per-role entries only need to list what differs from the org default. The merge rules depend on the key type: @@ -748,7 +784,7 @@ * **Deny-lists and hook arrays** : `permissions.deny`, `permissions.ask`, `disabledMcpjsonServers`, `deniedMcpServers`, `blockedMarketplaces`, and every `hooks` event-type array. These take the union of base and policy, so an org-wide deny or audit hook can’t be accidentally dropped by a per-role override. * **Record-typed keys** : `env`, `modelOverrides`, and `skillOverrides`. These shallow-merge, so a per-role `env` block overrides keys it sets and inherits the rest from the base. -`availableModels` is also enforced server-side at `/v1/messages`, so a denied model returns `400` regardless of what the client sends. The gateway validates the `model` value itself before it relays a request, so a malformed value never reaches an upstream. It rejects the request with a `400` in two cases: +`availableModels` is also enforced server-side at `/v1/messages`, so a denied model returns `400` regardless of what the client sends. An empty list denies every model. The check also covers the model a session starts on before the developer picks one, so start sessions on a model the policy allows. The gateway validates the `model` value itself before it relays a request, so a malformed value never reaches an upstream. It rejects the request with a `400` in two cases: * When the value is missing or empty, the gateway rejects the request with the message `model is required`. That check requires a gateway running Claude Code v2.1.228 or later. * When the value is present but isn’t a string, the gateway rejects the request with the message `model must be a string`. Requires a gateway running Claude Code v2.1.221 or later. @@ -771,6 +807,27 @@ ​ +Start sessions on a model the policy allows + +If `availableModels` leaves out Claude Code’s default model, sessions get `400` responses until the developer picks a listed model, for example with `/model`. In gateway sessions the default is the Opus model the `opus` alias resolves to, and `availableModels` on its own doesn’t change it. To fix this, set [`enforceAvailableModels: true`](</docs/en/model-config#enforce-the-allowlist-for-the-default-model>) in the same `cli` block, then check which kind of entry the list has: + + * **An alias such as`sonnet`, or a built-in ID such as `claude-sonnet-4-6`**: sessions start on one of those models, and the Default option in `/model` resolves to it + * **No alias or built-in ID in the list** : sessions can keep starting on the built-in default, so also set [`model`](</docs/en/model-config#control-the-model-users-run-on>) to one of the listed IDs in that policy’s `cli` block + +This policy lists one custom ID that `models` defines, and starts sessions on that ID: + + managed: + policies: + - match: { groups: [restricted-projects] } + cli: + availableModels: [claude-opus-restricted] + enforceAvailableModels: true + model: claude-opus-restricted + +#### + +​ + Matcher values that stop the gateway at boot At boot, the gateway checks the `match` block of every policy and the `admin_groups` list. Any of these values stops the gateway with an error that names the field: @@ -801,6 +858,7 @@ cli: # Model access (also enforced server-side at /v1/messages) availableModels: [claude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5] + enforceAvailableModels: true # Default resolves inside the list # Permission policy permissions: @@ -894,6 +952,7 @@ - match: { groups: [eng-contractors] } cli: availableModels: [claude-sonnet-4-6] + enforceAvailableModels: true desktop: isLocalDevMcpEnabled: false disableAutoUpdates: true @@ -1205,6 +1264,11 @@ # region: us-east-1 # auth: {} + # - provider: mantle + # region: us-east-1 + # models: [claude-opus-4-8, claude-opus-4-7, claude-haiku-4-5] + # auth: {} + # - provider: anthropicAws # region: us-east-1 # workspace_id: wrkspc_... @@ -1227,6 +1291,7 @@ upstream_model: anthropic: claude-opus-4-8 # bedrock: us.anthropic.claude-opus-4-8 + # mantle: anthropic.claude-opus-4-8 # anthropicAws: claude-opus-4-8 # vertex: claude-opus-4-8 # foundry: <your-opus-deployment-name> @@ -1244,15 +1309,16 @@ - match: { groups: [contractors] } cli: availableModels: [claude-haiku-4-5] - # Constrain the Default picker option to availableModels instead of - # the tier default, so contractors don't get a 400 on the default. - enforceAvailableModels: true # allow auto-approves these tools; it does not block the rest. # Add deny rules to restrict tools. permissions: { allow: [Read, Grep] } - match: {} cli: availableModels: [claude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5] + # Constrain the Default picker option to each policy's availableModels + # instead of the built-in default, so no role gets a 400 on Default. + # The contractors policy inherits this key. + enforceAvailableModels: true permissions: allow: [Read, Grep, Bash, Edit] deny: ["WebFetch"]
modified Claude apps gateway deployment and operations View current →
--- a/claude-apps-gateway-deploy.md +++ b/claude-apps-gateway-deploy.md @@ -384,12 +384,19 @@ Request headers too large after sign-in -A developer’s requests can fail with a `431` error after sign-in when the developer belongs to many IdP groups. The gateway answers `431` when a request’s headers total more than 256 KiB, or more than [`limits.max_request_header_bytes`](</docs/en/claude-apps-gateway-config#http-tuning>) if you set it. It writes no log line or audit event for these requests. Gateway versions before v2.1.284 answer `431` above 16 KiB. What to change depends on your gateway’s version and configuration: +A developer’s requests can fail with a `431` error after sign-in when the developer belongs to many IdP groups. The gateway answers `431` when a request’s headers total more than 256 KiB, or more than [`limits.max_request_header_bytes`](</docs/en/claude-apps-gateway-config#http-tuning>) if you set it. It writes no log line or audit event for these requests. Gateway versions before v2.1.284 answer `431` above 16 KiB. Start with the first of these that applies to your gateway: * **Gateway older than v2.1.284** : upgrade the gateway * **`limits.max_request_header_bytes` set**: raise the value or remove the key * **Neither applies, or`431` continues afterward**: have your IdP emit fewer groups. Identity provider setup covers how Okta, Microsoft Entra ID, and Google Workspace supply groups +When you trim the groups claim, keep the groups you named in these settings, which decide a developer’s access, policy, and spend caps: + + * **[`oidc.allowed_groups`](</docs/en/claude-apps-gateway-config#oidc>)** : decides who can sign in + * **[`admin.admin_groups`](</docs/en/claude-apps-gateway-config#admin>)** : decides who can call the admin API with their gateway session + * **`match.groups` in [`managed.policies`](</docs/en/claude-apps-gateway-config#managed>)**: decides which policy applies to a developer + * **`rbac_group` [spend caps](</docs/en/claude-apps-gateway-spend-limits>)**: decide which group caps apply to a developer + ## ​
modified Use Claude Code in the cloud View current →
Show diff (625 lines)
--- a/claude-code-on-the-web.md +++ b/claude-code-on-the-web.md @@ -1,6 +1,6 @@ Cloud sessions are available on Pro, Max, and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats. -A cloud session is a Claude Code session that runs on cloud infrastructure instead of on your machine. By default it runs on infrastructure Anthropic manages, or on your organization’s [self-hosted environment](</docs/en/self-hosted-environments>) when routed there. The session keeps running after you close your laptop, and you can check on it or steer it from any device. You can start a cloud session from any of these surfaces: +A cloud session is a Claude Code session that runs on cloud infrastructure instead of on your machine. By default it runs on infrastructure Anthropic manages, or on your organization’s [self-hosted environment](</docs/en/self-hosted-environments>) when routed there. The session keeps running after you close your laptop, and you can check on it or steer it from any device. To let cloud sessions clone your code from GitHub and push branches, connect GitHub with one of the GitHub connection methods. If your repository is on GitLab, Bitbucket, or another host, see Platform restrictions for what works. You can start a cloud session from any of these surfaces: * **Browser** : [claude.ai/code](<https://claude.ai/code>), also called Claude Code on the web * **Mobile** : the **Code** tab in the [Claude app](</docs/en/mobile>) @@ -8,19 +8,13 @@ * **Terminal** : `claude --cloud` * **Routines** : [scheduled and triggered runs](</docs/en/routines>) each run as a cloud session -To have Claude start and keep track of many cloud sessions for one body of work, use a [project](</docs/en/claude-projects>). A session in your terminal, your IDE, or the Desktop app with **Local** selected runs on your own machine instead. To steer one of those local sessions from your phone or browser, use [Remote Control](</docs/en/remote-control>). - -New to cloud sessions? Start with [Get started](</docs/en/web-quickstart>) to connect your GitHub account and submit your first task. - -This page covers: - - * Cloud environments: where sessions run, and where to configure that - * GitHub authentication options: two ways to connect GitHub - * Move tasks between terminal and cloud with `--cloud` and `--teleport` - * Work with sessions: permission modes, reviewing, sharing, archiving, deleting - * Auto-fix pull requests: respond automatically to CI failures and review comments - * Security and isolation: how sessions are isolated - * Limitations: rate limits and platform restrictions +Once you’re set up, use this page to move work between your terminal and the cloud, manage and share sessions, turn on auto-fix for pull requests, and troubleshoot. + +These cases are covered on other pages: + + * **Starting your first cloud session** : [Get started with cloud sessions](</docs/en/web-quickstart>) connects GitHub and walks through a task in the browser + * **Many cloud sessions for one body of work** : a [project](</docs/en/claude-projects>) has Claude start and keep track of them for you + * **Steering a local session from another device** : sessions in your terminal, IDE, or the Desktop app with **Local** selected run on your machine, and [Remote Control](</docs/en/remote-control>) lets you reach them from your phone or browser ## @@ -28,7 +22,12 @@ Cloud environments -Every cloud session runs in a [cloud environment](</docs/en/cloud-environments>), the saved configuration that controls network access, environment variables, and setup scripts. If you don’t have an environment yet, onboarding sets up a **Default** environment with [**Trusted** network access](</docs/en/cloud-environments#access-levels>), either by creating it for you or by asking you to create it. See [The Default environment](</docs/en/cloud-environments#the-default-environment>) for which of those happens on your plan and how sessions choose an environment when you have more than one. The same environments apply wherever you start a cloud session: the browser, the terminal, [Claude Tag](<https://claude.com/docs/claude-tag/overview>), [routines](</docs/en/routines>), and the mobile and Desktop apps. Claude Tag channel sessions use organization-level environments only, either [shared environments](</docs/en/cloud-environments#organization-shared-environments>) or [self-hosted environments](</docs/en/self-hosted-environments>). See [Configure cloud environments](</docs/en/cloud-environments>) to change what an environment allows, set variables, or add a setup script, and [Installed tools](</docs/en/cloud-environments#installed-tools>) for what sessions include without any configuration. +Every cloud session runs in a [cloud environment](</docs/en/cloud-environments>), the saved configuration that controls network access, environment variables, and setup scripts. + + * **Your first environment** : if you don’t have one yet, onboarding sets up a **Default** environment with [**Trusted** network access](</docs/en/cloud-environments#access-levels>), either by creating it for you or by asking you to create it. See [The Default environment](</docs/en/cloud-environments#the-default-environment>) for which of those happens on your plan + * **Which environment a session uses** : see [The Default environment](</docs/en/cloud-environments#the-default-environment>) for how sessions choose an environment when you have more than one + * **Change what sessions can reach or run at startup** : see [Configure cloud environments](</docs/en/cloud-environments>) + * **What’s installed without any configuration** : see [Installed tools](</docs/en/cloud-environments#installed-tools>) ## @@ -43,10 +42,29 @@ **GitHub App**| Authorize the Claude GitHub App during [web onboarding](</docs/en/web-quickstart>)| Any public repository, and private repositories that the Claude GitHub App is installed on| Browser onboarding; teams that want Auto-fix **`/web-setup`**| Run `/web-setup` in your terminal to send your local `gh` CLI token to your Claude account| Any repository your `gh` token can access, whether or not the Claude GitHub App is installed| Individual developers who already use `gh` -Installing the Claude GitHub App on a repository also enables Auto-fix for pull requests in it. Threads in a [project](</docs/en/claude-projects>) need the Claude GitHub App installed on each repository they clone, whichever method you connected with. See [Set up GitHub access](</docs/en/claude-projects#set-up-github-access>). In Anthropic-hosted environments, your GitHub credentials stay encrypted on Anthropic’s servers and never enter a session’s VM. GitHub operations from the VM go through the [GitHub proxy](</docs/en/cloud-environments#github-proxy>), which attaches the credential on the server side. For how `/schedule` checks repository access before creating a routine, see [Repositories and branch permissions](</docs/en/routines#repositories-and-branch-permissions>). See [Connect from your terminal](</docs/en/web-quickstart#connect-from-your-terminal>) for the `/web-setup` walkthrough, including what `/web-setup` stores and how to remove it. Quick web setup is an organization setting that lets members connect GitHub with `/web-setup`, skips the Claude GitHub App install prompt during browser onboarding, and has browser onboarding create the [**Default** environment](</docs/en/cloud-environments#the-default-environment>) for them instead of showing the environment form. On Team and Enterprise plans it’s off by default, which hides `/web-setup`. An [Owner](</docs/en/server-managed-settings#access-control>) turns it on with the **Quick web setup** toggle at [**Admin settings > Claude Code**](<https://claude.ai/admin-settings/claude-code>). +These features depend on the Claude GitHub App being installed on the repository: + + * **Auto-fix** : installing the Claude GitHub App on a repository also enables Auto-fix for pull requests in it + * **Projects** : threads in a [project](</docs/en/claude-projects>) need the Claude GitHub App installed on each repository they clone, whichever method you connected with. See [Set up GitHub access](</docs/en/claude-projects#set-up-github-access>) + +In Anthropic-hosted environments, your GitHub credentials stay encrypted on Anthropic’s servers and never enter a session’s VM. GitHub operations from the VM go through the [GitHub proxy](</docs/en/cloud-environments#github-proxy>), which attaches the credential on the server side. See [Connect from your terminal](</docs/en/web-quickstart#connect-from-your-terminal>) for the `/web-setup` walkthrough, including what `/web-setup` stores and how to remove it. Organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled can’t use `/web-setup` or other cloud session features. +### + +​ + +Quick web setup for Team and Enterprise + +Quick web setup is an organization setting that removes steps from members’ GitHub and environment setup. On Team and Enterprise plans it’s off by default. Here’s what changes for members when it’s on: + + * **`/web-setup`** : members can connect GitHub with `/web-setup`. While the setting is off, the command is hidden + * **GitHub App prompt** : browser onboarding skips the Claude GitHub App install prompt + * **First environment** : browser onboarding creates the [**Default** environment](</docs/en/cloud-environments#the-default-environment>) for members instead of showing the environment form + +An [Owner](</docs/en/server-managed-settings#access-control>) turns it on with the **Quick web setup** toggle at [**Admin settings > Claude Code**](<https://claude.ai/admin-settings/claude-code>). + ## ​ @@ -55,7 +73,7 @@ These workflows require the [Claude Code CLI](</docs/en/quickstart>) signed in to the same claude.ai account. You can start new cloud sessions from your terminal, or pull cloud sessions into your terminal to continue locally. Cloud sessions persist even if you close your laptop, and you can monitor them from anywhere including the Claude mobile app. -From the CLI, session handoff is one-way: you can pull cloud sessions into your terminal with `--teleport`, but you can’t push an existing terminal session to the cloud. The `--cloud` flag with a task description creates a new cloud session for your current repository; with `-p` and a session ID or claude.ai/code URL it instead [queues a message into that existing session](</docs/en/claude-code-on-the-web#send-follow-ups-from-the-cli>). The [Desktop app](</docs/en/desktop#continue-in-another-surface>) provides a **Continue in** menu that can send a local session to the cloud. +From the CLI, session handoff is one-way: you can pull cloud sessions into your terminal with `--teleport`, but you can’t push an existing terminal session to the cloud. The `--cloud` flag with a task description creates a new cloud session for your current repository; with `-p` and a session ID or claude.ai/code URL it instead [queues a message into that existing session](</docs/en/claude-code-on-the-web#send-follow-ups-from-the-cli>). The [Desktop app](</docs/en/desktop#continue-in-another-surface>) can send a local session in its Code tab to the cloud from its **Open in** menu. ### @@ -133,7 +151,7 @@ Send follow-ups from the CLI -Once a cloud session is running, wherever it executes, send it a follow-up message from the `claude` CLI on any machine where you’re logged in with `claude auth login`. The CLI authenticates with your Anthropic account credentials and sends no local session state, so the command doesn’t need to run from the machine that started the session, and it’s the same in every shell, including PowerShell. The command posts one message and exits: +Once a cloud session is running, wherever it executes, send it a follow-up message from the `claude` CLI on any machine where you’re logged in with `claude auth login`. The CLI authenticates with your Anthropic account credentials and sends no local session state, so the command doesn’t need to run from the machine that started the session. The command posts one message and exits: claude -p "your message" --cloud <session-id> @@ -145,7 +163,7 @@ ​ -Output and errors +Output On success, the command prints the session ID and a link to view the session: @@ -153,7 +171,271 @@ Session ID: session_01DiUkqY2kzbUbDmW1w96rfi View: https://claude.ai/code/session_01DiUkqY2kzbUbDmW1w96rfi?from=cli&m=0 -Pass `--output-format json` for a machine-readable result: `{ok, session_id, url}` on success, or `{ok: false, session_id, error}` when the send fails, for example when the session is missing or archived. Configuration errors, such as an unsupported provider or a disabled organization policy, print to stderr without JSON. `--output-format stream-json` isn’t supported with `--cloud <session-id>`. The CLI prefixes errors with `Error: `. A failed delivery is wrapped as `failed to send message to cloud session <id>: <reason>`. +Pass `--output-format json` for a machine-readable result: `{ok, session_id, url}` on success, or `{ok: false, session_id, error}` when the send fails, for example when the session is missing or archived. Configuration errors, such as an unsupported provider or a disabled organization policy, print to stderr without JSON. `--output-format stream-json` isn’t supported with `--cloud <session-id>`. If the send fails, see Errors when sending to a cloud session. + +### + +​ + +From cloud to terminal + +Pull a cloud session into your terminal using any of these: + + * **Using`--teleport`**: from the command line, run `claude --teleport` for an interactive session picker, or `claude --teleport <session-id>` to resume a specific session directly. If you have uncommitted changes, you’ll be prompted to stash them first. + * **Using`/teleport`**: inside an existing CLI session, run `/teleport` or `/tp` to open the same session picker without restarting Claude Code. + * **From`/tasks`**: run `/tasks` to see your background sessions, then press `t` to teleport into one. + * **From claude.ai/code** : select **Open in > Terminal** from the session menu to copy a command you can paste into your terminal. + * **From inside the cloud session** : type `/teleport` and Claude Code replies with the exact `claude --teleport <session-id>` command for that session, ready to run from a checkout of the repository. Requires Claude Code v2.1.223 or later in the session’s environment. + +When you teleport a session, Claude verifies you’re in the correct repository, fetches and checks out the branch from the cloud session, and loads the full conversation history into your terminal. The terminal gets its own copy of the session: new work there stays local and doesn’t appear in the cloud session on claude.ai or the Claude mobile app. To keep steering from your phone after teleporting, start [`/remote-control`](</docs/en/remote-control>) in the local session. `--teleport` is distinct from `--resume`. `--resume` reopens a conversation from this machine’s local history and doesn’t list cloud sessions; `--teleport` pulls a cloud session and its branch. + +#### + +​ + +Teleport requirements + +Teleport checks these requirements before resuming a session. If any requirement isn’t met, you’ll see an error or be prompted to resolve the issue. + +Requirement| Details +---|--- +Clean git state| Your working directory must have no uncommitted changes. Teleport prompts you to stash changes if needed. +Correct repository| You must run `--teleport` from a checkout of the same repository, not a fork. If you run it from a checkout of a different repository, Claude Code shows an error that names both the session’s repository and your checkout’s. If Claude Code can’t parse your remote into a hostname, for example an SSH host alias like `git@work:owner/repo.git`, it asks you to confirm, and accepts the checkout when the remote’s owner and repository name match the session’s repository. +Branch available| The branch from the cloud session must have been pushed to the remote. Teleport automatically fetches and checks it out. +Same account| You must be authenticated to the same claude.ai account used in the cloud session. + +When teleport fetches the session’s branch, the fetch never waits for input in your terminal. If git or ssh would ask for a password, a key passphrase, or confirmation of a new SSH host, the fetch fails, and the checkout then works only if your local clone already has the branch. For the two SSH cases, load your key into `ssh-agent` and run `git fetch` once by hand first to record the host. + +#### + +​ + +`--teleport` is unavailable + +Teleport requires claude.ai subscription authentication. Find the case that matches yours: + + * **You’re authenticated via API key** : run `/login` to sign in with your claude.ai account instead + * **The error names your provider** : cloud sessions aren’t available through third-party providers. See the error table + * **You’re already signed in via claude.ai** : your organization may have disabled cloud sessions + +## + +​ + +Work with sessions + +Sessions appear in the sidebar at claude.ai/code. From there you can review changes, share with teammates, archive finished work, or delete sessions permanently. + +### + +​ + +Permission modes in cloud sessions + +You pick a cloud session’s [permission mode](</docs/en/permission-modes>) from the [mode dropdown](</docs/en/permission-modes#switch-permission-modes>), both when you create the task and while the session runs. Claude Code resumes a session in the permission mode it was in when you do either of these: + + * Reopen a session whose Anthropic-hosted environment expired + * Send a message to a session that a self-hosted runner [released while it was idle](</docs/en/self-hosted-environments-reference#runner-cli-flags>) + +### + +​ + +Review changes + +Each session shows a diff indicator with lines added and removed, like `+42 -18`. Select it to open the diff view, leave inline comments on specific lines, and send them to Claude with your next message. The diff view compares the session’s changes against its base branch by default. To compare against any other branch in the repository, select **Compare against** and pick one. Claude Code computes these diffs from raw git blob content, so diff drivers and `textconv` filters configured in the repository don’t apply. These steps are covered elsewhere: + + * **The full walkthrough, including PR creation** : see [Review and iterate](</docs/en/web-quickstart#review-and-iterate>) + * **Having Claude monitor the PR for CI failures and review comments automatically** : see Auto-fix pull requests + +### + +​ + +Manage context + +Cloud sessions support [built-in commands](</docs/en/commands>) that produce text output. Commands that only run in the terminal interface, such as `/plugin` or `/resume`, aren’t available. Commands that open a picker or panel in the terminal behave differently in cloud sessions: + + * **`/model`, `/effort`, `/color`, and `/rename`**: pass the value as an argument, for example `/model sonnet`, instead of opening the terminal picker or slider. The argument forms require Claude Code v2.1.205 or later in the session’s environment and follow each command’s [availability notes](</docs/en/commands#all-commands>). + * **`/fast`** : toggles [fast mode](</docs/en/fast-mode#use-fast-mode-in-cloud-sessions>) for the session when fast mode is [available on your account](</docs/en/fast-mode#requirements>). Requires Claude Code v2.1.271 or later in the session’s environment. + * **`/config`** : in your browser at claude.ai/code, opens the Claude Code section of your settings instead of setting a value, and text after the command, including `key=value`, is ignored. To change a setting for a cloud session, set an [environment variable](</docs/en/cloud-environments#set-environment-variables>) on the environment, or in a session with one repository, commit the key to that repository’s `.claude/settings.json`. [Settings in cloud sessions](</docs/en/settings#settings-in-cloud-sessions>) lists what each session reads. + +For context management specifically: + +Command| Works in cloud sessions| Notes +---|---|--- +`/compact`| Yes| Summarizes the conversation to free up context. Accepts optional focus instructions like `/compact keep the test output` +`/context`| Yes| Shows what’s currently in the context window +`/clear`| No| Start a new session from the sidebar instead + +Auto-compaction runs automatically when the context window approaches capacity. Cloud sessions set [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/env-vars>) themselves, so compaction triggers partway through the [auto-compact window](</docs/en/model-config#set-the-auto-compact-window>) rather than when the window fills. That value overrides one you add in your [environment variables](</docs/en/cloud-environments#set-environment-variables>), so adding the variable there doesn’t change when compaction triggers. To change the auto-compact window instead, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) in your environment variables, or run [`/autocompact`](</docs/en/commands#all-commands>) with a token count in a session where the variable isn’t set. [Subagents](</docs/en/sub-agents>) work the same way they do locally. Claude can spawn them with the Agent tool to offload research or parallel work into a separate context window, keeping the main conversation lighter. Subagents defined in your repo’s `.claude/agents/` are picked up automatically. [Agent teams](</docs/en/agent-teams>) are off by default but can be enabled by adding `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` to your [environment variables](</docs/en/cloud-environments#set-environment-variables>). + +### + +​ + +Take back a queued message + +If you send a message while Claude is working, the message queues until Claude reads it. To take a queued message back, click the ✕ on it. The text returns to the message box so you can edit it or send something else. If Claude has already read the message, it stays in the conversation. + +### + +​ + +Share sessions + +To share a session, toggle its visibility according to the account types below. After that, share the session link as-is. Recipients see the latest state when they open the link, but their view doesn’t update in real time. + +#### + +​ + +Share from an Enterprise or Team account + +Sharing works as follows for Enterprise and Team accounts: + + * **Visibility options** : **Private** and **Team**. Team visibility makes the session visible to other members of your claude.ai organization + * **Repository access** : verification is enabled by default, based on the GitHub account connected to the recipient’s account + * **Your name** : your account’s display name is visible to all recipients with access + * **Slack sessions** : [Claude in Slack](</docs/en/slack>) sessions are automatically shared with Team visibility + +#### + +​ + +Share from a Max or Pro account + +Sharing works as follows for Max and Pro accounts: + + * **Visibility options** : **Private** and **Public**. Public visibility makes the session visible to any user logged into claude.ai + * **Repository access** : verification isn’t enabled by default + * **Sensitive content** : check your session before sharing. Sessions may contain code and credentials from private GitHub repositories + +To require recipients to have repository access, or to hide your name from shared sessions, go to [**Settings > Claude Code > Sharing settings**](<https://claude.ai/settings/claude-code>). + +### + +​ + +Archive sessions + +You can archive sessions to keep your session list organized. Archived sessions are hidden from the default session list but can be viewed by filtering for archived sessions. To archive a session, hover over the session in the sidebar and select the archive icon. + +### + +​ + +Delete sessions + +Deleting a session permanently removes the session and its data. This action can’t be undone. You can delete a session in two ways: + + * **From the sidebar** : filter for archived sessions, then hover over the session you want to delete and select the delete icon + * **From the session menu** : open a session, select the dropdown next to the session title, and select **Delete** + +You will be asked to confirm before a session is deleted. + +## + +​ + +Auto-fix pull requests + +Claude can watch a pull request and automatically respond to CI failures and review comments. Claude subscribes to GitHub activity on the PR, and when a check fails or a reviewer leaves a comment, Claude investigates and pushes a fix if one is clear. + +Auto-fix requires the Claude GitHub App to be installed on your repository. If you haven’t already, install it from the [GitHub App page](<https://github.com/apps/claude>). + +There are a few ways to turn on auto-fix depending on where the PR came from and what device you’re using: + + * **PRs created in a cloud session** : open the session at claude.ai/code, open the CI status bar, and select **Auto-fix** + * **From your terminal** : run [`/autofix-pr`](</docs/en/commands>) while on the PR’s branch. Claude Code detects the open PR with `gh`, spawns a cloud session, and turns on auto-fix in one step + * **From the mobile app** : tell Claude to auto-fix the PR, for example “watch this PR and fix any CI failures or review comments” + * **Any existing PR** : paste the PR URL into a session and tell Claude to auto-fix it + +Auto-fix is a per-PR toggle. To stop monitoring, open the CI status bar in the session at claude.ai/code and clear the **Auto-fix** toggle, or tell Claude to stop watching the PR. + +### + +​ + +How Claude responds to PR activity + +When auto-fix is active, Claude receives GitHub events for the PR including new review comments and CI check failures. For each event, Claude investigates and decides how to proceed: + + * **Clear fixes** : if Claude is confident in a fix and it doesn’t conflict with earlier instructions, Claude makes the change, pushes it, and explains what was done in the session + * **Ambiguous requests** : if a reviewer’s comment could be interpreted multiple ways or involves something architecturally significant, Claude asks you before acting + * **Duplicate or no-action events** : if an event is a duplicate or requires no change, Claude notes it in the session and moves on + +GitHub does not emit a webhook when the base branch advances and creates a merge conflict, so auto-fix can’t react to conflicts on its own. To resolve a conflict, open the session and ask Claude to rebase. Claude may reply to review comment threads on GitHub as part of resolving them. These replies are posted using your GitHub account, so they appear under your username, but each reply is labeled as coming from Claude Code so reviewers know it was written by the agent and not by you directly. + +If your repository uses comment-triggered automation such as Atlantis, Terraform Cloud, or custom GitHub Actions that run on `issue_comment` events, be aware that Claude can reply on your behalf, which can trigger those workflows. Review your repository’s automation before enabling auto-fix, and consider disabling auto-fix for repositories where a PR comment can deploy infrastructure or run privileged operations. + +## + +​ + +Security and isolation + +Each cloud session is separated from your machine and from other sessions through several layers: + + * **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 + * **Secure analysis** : code is analyzed and modified within the session’s isolated environment before creating PRs + +## + +​ + +Troubleshooting + +For runtime API errors that appear in the conversation such as `API Error: 500`, `529 Overloaded`, `429`, or `Prompt is too long`, see the [Error reference](</docs/en/errors>). Those errors and their fixes are shared with the CLI and Desktop app. The sections below cover issues specific to cloud sessions. + +### + +​ + +Session creation failed + +If a new session fails to start with `Session creation failed` or stalls at provisioning, Claude Code could not allocate a VM for the session. + + * Check [status.claude.com](<https://status.claude.com>) for cloud session incidents + * Retry after a minute, as capacity is provisioned on demand + * Confirm your GitHub connection can reach the repository by following [No repositories appear after connecting GitHub](</docs/en/web-quickstart#no-repositories-appear-after-connecting-github>) + +### + +​ + +Unable to get organization UUID + +`claude --cloud` and `claude --teleport` require sign-in with a claude.ai account. If you authenticate with an API key, or your stored account details are stale, you see one of these: + + * `Unable to get organization UUID` + * A message that API key authentication is not sufficient + * `Error loading Claude Code sessions` in the session picker, when you run `claude --teleport` without a session ID + +Run `/login` to sign in with your claude.ai account, then retry the command. If the error names your provider instead, see the error table: cloud sessions aren’t available through third-party providers. + +### + +​ + +Remote Control session expired or access denied + +`--teleport` connects through the same Remote Control session infrastructure that cloud sessions use, so authentication and session-expiry errors surface with Remote Control wording. You may see `Remote Control session expired` or `Access denied`. The connection token is short-lived and scoped to your account. + + * Run `/login` locally to refresh your credentials, then reconnect + * Confirm you are signed in to the same account that owns the session + * If you see `Remote Control may not be available for this organization`, an Owner has not enabled cloud sessions for your organization + +### + +​ + +Errors when sending to a cloud session + +These errors come from running `claude` with `--cloud <session-id>`, with or without `-p`. The CLI prefixes errors with `Error: `. A failed delivery is wrapped as `failed to send message to cloud session <id>: <reason>`. Message| What it means ---|--- @@ -168,238 +450,12 @@ ​ -From cloud to terminal - -Pull a cloud session into your terminal using any of these: - - * **Using`--teleport`**: from the command line, run `claude --teleport` for an interactive session picker, or `claude --teleport <session-id>` to resume a specific session directly. If you have uncommitted changes, you’ll be prompted to stash them first. - * **Using`/teleport`**: inside an existing CLI session, run `/teleport` or `/tp` to open the same session picker without restarting Claude Code. - * **From`/tasks`**: run `/tasks` to see your background sessions, then press `t` to teleport into one. - * **From claude.ai/code** : select **Open in > Terminal** from the session menu to copy a command you can paste into your terminal. - * **From inside the cloud session** : type `/teleport` and Claude Code replies with the exact `claude --teleport <session-id>` command for that session, ready to run from a checkout of the repository. Requires Claude Code v2.1.223 or later in the session’s environment. - -When you teleport a session, Claude verifies you’re in the correct repository, fetches and checks out the branch from the cloud session, and loads the full conversation history into your terminal. The terminal gets its own copy of the session: new work there stays local and doesn’t appear in the cloud session on claude.ai or the Claude mobile app. To keep steering from your phone after teleporting, start [`/remote-control`](</docs/en/remote-control>) in the local session. `--teleport` is distinct from `--resume`. `--resume` reopens a conversation from this machine’s local history and doesn’t list cloud sessions; `--teleport` pulls a cloud session and its branch. - -#### - -​ - -Teleport requirements - -Teleport checks these requirements before resuming a session. If any requirement isn’t met, you’ll see an error or be prompted to resolve the issue. - -Requirement| Details ----|--- -Clean git state| Your working directory must have no uncommitted changes. Teleport prompts you to stash changes if needed. -Correct repository| You must run `--teleport` from a checkout of the same repository, not a fork. If you run it from a checkout of a different repository, Claude Code shows an error that names both the session’s repository and your checkout’s. Before v2.1.219, the error didn’t name your checkout’s repository. If Claude Code can’t parse your remote into a hostname, for example an SSH host alias like `git@work:owner/repo.git`, it asks you to confirm, and accepts the checkout when the remote’s owner and repository name match the session’s repository. -Branch available| The branch from the cloud session must have been pushed to the remote. Teleport automatically fetches and checks it out. -Same account| You must be authenticated to the same claude.ai account used in the cloud session. - -When teleport fetches the session’s branch, the fetch never waits for input in your terminal. If git or ssh would ask for a password, a key passphrase, or confirmation of a new SSH host, the fetch fails, and the checkout then works only if your local clone already has the branch. For the two SSH cases, load your key into `ssh-agent` and run `git fetch` once by hand first to record the host. - -#### - -​ - -`--teleport` is unavailable - -Teleport requires claude.ai subscription authentication. If you’re authenticated via API key, run `/login` to sign in with your claude.ai account instead. If the error names your provider instead, cloud sessions aren’t available through third-party providers; see the error table. If you’re already signed in via claude.ai and `--teleport` is still unavailable, your organization may have disabled cloud sessions. - -## - -​ - -Work with sessions - -Sessions appear in the sidebar at claude.ai/code. From there you can review changes, share with teammates, archive finished work, or delete sessions permanently. - -### - -​ - -Take back a queued message - -If you send a message while Claude is working, the message queues until Claude reads it. To take a queued message back, click the ✕ on it. The text returns to the message box so you can edit it or send something else. If Claude has already read the message, it stays in the conversation. - -### - -​ - -Manage context - -Cloud sessions support [built-in commands](</docs/en/commands>) that produce text output. Commands that only run in the terminal interface, such as `/plugin` or `/resume`, aren’t available. Commands that open a picker or panel in the terminal behave differently in cloud sessions: - - * **`/model`, `/effort`, `/color`, and `/rename`**: pass the value as an argument, for example `/model sonnet`, instead of opening the terminal picker or slider. The argument forms require Claude Code v2.1.205 or later in the session’s environment and follow each command’s [availability notes](</docs/en/commands#all-commands>). - * **`/fast`** : toggles [fast mode](</docs/en/fast-mode#use-fast-mode-in-cloud-sessions>) for the session when fast mode is [available on your account](</docs/en/fast-mode#requirements>). Requires Claude Code v2.1.271 or later in the session’s environment. - * **`/config`** : in your browser at claude.ai/code, opens the Claude Code section of your settings instead of setting a value, and text after the command, including `key=value`, is ignored. To change a setting for a cloud session, set an [environment variable](</docs/en/cloud-environments#set-environment-variables>) on the environment, or in a session with one repository, commit the key to that repository’s `.claude/settings.json`. [Settings in cloud sessions](</docs/en/settings#settings-in-cloud-sessions>) lists what each session reads. - -For context management specifically: - -Command| Works in cloud sessions| Notes ----|---|--- -`/compact`| Yes| Summarizes the conversation to free up context. Accepts optional focus instructions like `/compact keep the test output` -`/context`| Yes| Shows what’s currently in the context window -`/clear`| No| Start a new session from the sidebar instead - -Auto-compaction runs automatically when the context window approaches capacity. Cloud sessions set [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/env-vars>) themselves, so compaction triggers partway through the [auto-compact window](</docs/en/model-config#set-the-auto-compact-window>) rather than when the window fills. That value overrides one you add in your [environment variables](</docs/en/cloud-environments#set-environment-variables>), so adding the variable there doesn’t change when compaction triggers. To change the auto-compact window instead, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) in your environment variables, or run [`/autocompact`](</docs/en/commands#all-commands>) with a token count in a session where the variable isn’t set. [Subagents](</docs/en/sub-agents>) work the same way they do locally. Claude can spawn them with the Agent tool to offload research or parallel work into a separate context window, keeping the main conversation lighter. Subagents defined in your repo’s `.claude/agents/` are picked up automatically. [Agent teams](</docs/en/agent-teams>) are off by default but can be enabled by adding `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` to your [environment variables](</docs/en/cloud-environments#set-environment-variables>). - -### - -​ - -Permission modes in cloud sessions - -You pick a cloud session’s [permission mode](</docs/en/permission-modes>) from the [mode dropdown](</docs/en/permission-modes#switch-permission-modes>), both when you create the task and while the session runs. When you reopen a session whose Anthropic-hosted environment expired, or send a message to a session that a self-hosted runner [released while it was idle](</docs/en/self-hosted-environments-reference#runner-cli-flags>), Claude Code resumes the session in the permission mode it was in. - -### - -​ - -Review changes - -Each session shows a diff indicator with lines added and removed, like `+42 -18`. Select it to open the diff view, leave inline comments on specific lines, and send them to Claude with your next message. The diff view compares the session’s changes against its base branch by default. To compare against any other branch in the repository, select **Compare against** and pick one. Claude Code computes these diffs, including the per-file diffs shown as Claude edits, from raw git blob content, so diff drivers and `textconv` filters configured in the repository don’t apply. For a file in a repository that isn’t one of the session’s own checkouts, such as one cloned inside the workspace during the session, the per-file diff shows Claude’s edit itself rather than a git comparison. See [Review and iterate](</docs/en/web-quickstart#review-and-iterate>) for the full walkthrough including PR creation. To have Claude monitor the PR for CI failures and review comments automatically, see Auto-fix pull requests. - -### - -​ - -Share sessions - -To share a session, toggle its visibility according to the account types below. After that, share the session link as-is. Recipients see the latest state when they open the link, but their view doesn’t update in real time. - -#### - -​ - -Share from an Enterprise or Team account - -For Enterprise and Team accounts, the two visibility options are **Private** and **Team**. Team visibility makes the session visible to other members of your claude.ai organization. [Claude in Slack](</docs/en/slack>) sessions are automatically shared with Team visibility. Repository access verification is enabled by default, based on the GitHub account connected to the recipient’s account. Your account’s display name is visible to all recipients with access. - -#### - -​ - -Share from a Max or Pro account - -For Max and Pro accounts, the two visibility options are **Private** and **Public**. Public visibility makes the session visible to any user logged into claude.ai. Check your session for sensitive content before sharing. Sessions may contain code and credentials from private GitHub repositories. Repository access verification is not enabled by default. To require recipients to have repository access, or to hide your name from shared sessions, go to [**Settings > Claude Code > Sharing settings**](<https://claude.ai/settings/claude-code>). - -### - -​ - -Archive sessions - -You can archive sessions to keep your session list organized. Archived sessions are hidden from the default session list but can be viewed by filtering for archived sessions. To archive a session, hover over the session in the sidebar and select the archive icon. - -### - -​ - -Delete sessions - -Deleting a session permanently removes the session and its data. This action can’t be undone. You can delete a session in two ways: - - * **From the sidebar** : filter for archived sessions, then hover over the session you want to delete and select the delete icon - * **From the session menu** : open a session, select the dropdown next to the session title, and select **Delete** - -You will be asked to confirm before a session is deleted. - -## - -​ - -Auto-fix pull requests - -Claude can watch a pull request and automatically respond to CI failures and review comments. Claude subscribes to GitHub activity on the PR, and when a check fails or a reviewer leaves a comment, Claude investigates and pushes a fix if one is clear. - -Auto-fix requires the Claude GitHub App to be installed on your repository. If you haven’t already, install it from the [GitHub App page](<https://github.com/apps/claude>). - -There are a few ways to turn on auto-fix depending on where the PR came from and what device you’re using: - - * **PRs created in a cloud session** : open the session at claude.ai/code, open the CI status bar, and select **Auto-fix** - * **From your terminal** : run [`/autofix-pr`](</docs/en/commands>) while on the PR’s branch. Claude Code detects the open PR with `gh`, spawns a cloud session, and turns on auto-fix in one step - * **From the mobile app** : tell Claude to auto-fix the PR, for example “watch this PR and fix any CI failures or review comments” - * **Any existing PR** : paste the PR URL into a session and tell Claude to auto-fix it - -Auto-fix is a per-PR toggle. To stop monitoring, open the CI status bar in the session at claude.ai/code and clear the **Auto-fix** toggle, or tell Claude to stop watching the PR. - -### - -​ - -How Claude responds to PR activity - -When auto-fix is active, Claude receives GitHub events for the PR including new review comments and CI check failures. For each event, Claude investigates and decides how to proceed: - - * **Clear fixes** : if Claude is confident in a fix and it doesn’t conflict with earlier instructions, Claude makes the change, pushes it, and explains what was done in the session - * **Ambiguous requests** : if a reviewer’s comment could be interpreted multiple ways or involves something architecturally significant, Claude asks you before acting - * **Duplicate or no-action events** : if an event is a duplicate or requires no change, Claude notes it in the session and moves on - -GitHub does not emit a webhook when the base branch advances and creates a merge conflict, so auto-fix can’t react to conflicts on its own. To resolve a conflict, open the session and ask Claude to rebase. Claude may reply to review comment threads on GitHub as part of resolving them. These replies are posted using your GitHub account, so they appear under your username, but each reply is labeled as coming from Claude Code so reviewers know it was written by the agent and not by you directly. - -If your repository uses comment-triggered automation such as Atlantis, Terraform Cloud, or custom GitHub Actions that run on `issue_comment` events, be aware that Claude can reply on your behalf, which can trigger those workflows. Review your repository’s automation before enabling auto-fix, and consider disabling auto-fix for repositories where a PR comment can deploy infrastructure or run privileged operations. - -## - -​ - -Security and isolation - -Each cloud session is separated from your machine and from other sessions through several layers: - - * **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 - * **Secure analysis** : code is analyzed and modified within the session’s isolated environment before creating PRs - -## - -​ - -Troubleshooting - -For runtime API errors that appear in the conversation such as `API Error: 500`, `529 Overloaded`, `429`, or `Prompt is too long`, see the [Error reference](</docs/en/errors>). Those errors and their fixes are shared with the CLI and Desktop app. The sections below cover issues specific to cloud sessions. - -### - -​ - -Session creation failed - -If a new session fails to start with `Session creation failed` or stalls at provisioning, Claude Code could not allocate a VM for the session. - - * Check [status.claude.com](<https://status.claude.com>) for cloud session incidents - * Retry after a minute, as capacity is provisioned on demand - * Confirm your GitHub connection can reach the repository by following [No repositories appear after connecting GitHub](</docs/en/web-quickstart#no-repositories-appear-after-connecting-github>) - -### - -​ - -Unable to get organization UUID - -`claude --cloud` and `claude --teleport` require sign-in with a claude.ai account. If you authenticate with an API key, or your stored account details are stale, these commands fail with `Unable to get organization UUID` or a message that API key authentication is not sufficient. With API key authentication or stale account details, running `claude --teleport` without a session ID shows `Error loading Claude Code sessions` in the session picker instead of either message, and the same fix applies. Run `/login` to sign in with your claude.ai account, then retry the command. If the error names your provider instead, see the error table: cloud sessions aren’t available through third-party providers. - -### - -​ - -Remote Control session expired or access denied - -`--teleport` connects through the same Remote Control session infrastructure that cloud sessions use, so authentication and session-expiry errors surface with Remote Control wording. You may see `Remote Control session expired` or `Access denied`. The connection token is short-lived and scoped to your account. - - * Run `/login` locally to refresh your credentials, then reconnect - * Confirm you are signed in to the same account that owns the session - * If you see `Remote Control may not be available for this organization`, an Owner has not enabled cloud sessions for your organization - -### - -​ - Environment expired -Cloud sessions stop after a period of inactivity and the session’s VM is reclaimed. A session counts as inactive while it waits for you to approve an [MCP connector](</docs/en/cloud-environments#network-access>) tool call or to sign in to an MCP server, and it can expire during that wait. Reopen the session from [claude.ai/code](<https://claude.ai/code>) to provision a fresh VM with your conversation history restored. Background work that was still running when the VM was reclaimed, such as subagents and shell commands, isn’t restored. +Cloud sessions stop after a period of inactivity and the session’s VM is reclaimed. A session counts as inactive while it waits for you to approve an [MCP connector](</docs/en/cloud-environments#network-access>) tool call or to sign in to an MCP server, and it can expire during that wait. Reopen the session from [claude.ai/code](<https://claude.ai/code>) to provision a fresh VM: + + * **Restored** : your conversation history + * **Not restored** : background work that was still running when the VM was reclaimed, such as subagents and shell commands ##
modified Explore the .claude directory View current →
--- a/claude-directory.md +++ b/claude-directory.md @@ -21,7 +21,7 @@ `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>). `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>) on its own or alongside `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 local-directory marketplace 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. +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. `~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
modified Configure cloud environments View current →
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -14,7 +14,7 @@ * **CLI flows such as`/web-setup`**: create **Default** for you * **Web onboarding on Pro and Max** : creates **Default** for you - * **Web onboarding on Team and Enterprise** : shows a **Create your first cloud environment** form unless an Owner has turned on [Quick web setup](</docs/en/claude-code-on-the-web#github-authentication-options>); keep the form’s defaults and click **Create & finish** to get the same **Default** environment + * **Web onboarding on Team and Enterprise** : shows a **Create your first cloud environment** form unless an Owner has turned on [Quick web setup](</docs/en/claude-code-on-the-web#quick-web-setup-for-team-and-enterprise>); keep the form’s defaults and click **Create & finish** to get the same **Default** environment **Default** carries no configuration of its own:
modified Code Review View current →
--- a/code-review.md +++ b/code-review.md @@ -285,9 +285,12 @@ ​ -Review didn’t run and the PR shows a spend-cap message - -When your organization’s monthly spend cap is reached, Code Review posts a single comment on the PR explaining that the review was skipped. Reviews resume automatically at the start of the next billing period, or immediately when an admin raises the cap at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). +Review didn’t run and the PR shows a budget message + +When your organization’s monthly spend cap for Code Review is reached or its usage-credits balance is used up, Code Review skips the review and posts a single comment on the PR. The comment and the check-run card both name the cause and link the admin page where an admin fixes it: + + * **Spend cap reached** : reviews resume at the start of the next billing period, or immediately after an admin raises the cap at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) + * **Usage credits used up** : reviews resume once an admin adds more [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) ### @@ -307,7 +310,7 @@ Review a diff locally -The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. It reports correctness bugs and reuse, simplification, and efficiency cleanups. `/review` is an alias of `/code-review`; before v2.1.223, it was a separate command that ran a single-pass, read-only review of a GitHub pull request. +The [`/code-review` command](</docs/en/commands>) reviews a diff in your terminal without installing the GitHub App. It reports correctness bugs. Depending on your model and effort level, the review also covers reuse, simplification, and efficiency cleanups. `/review` is an alias of `/code-review`; before v2.1.223, it was a separate command that ran a single-pass, read-only review of a GitHub pull request. 1
modified Let Claude use your computer from the CLI View current →
--- a/computer-use.md +++ b/computer-use.md @@ -208,7 +208,7 @@ Feature| Desktop| CLI ---|---|--- Platforms| macOS and Windows| macOS only -Enable| Toggle in **Settings > General** (under **Desktop app**)| Enable `computer-use` in `/mcp` +Enable| Toggle in **Settings > This computer > System**| Enable `computer-use` in `/mcp` Denied apps list| Configurable in Settings| Not yet available Auto-unhide toggle| Optional| Always on Dispatch integration| Dispatch-spawned sessions can use computer use| Not applicable
modified Message your other Claude Code sessions View current →
--- a/cross-session-messaging.md +++ b/cross-session-messaging.md @@ -167,9 +167,10 @@ What a message looks like -When a message arrives, Claude Code shows it in the conversation as a dim one-line preview, and the preview line stays in the conversation afterward. The preview carries the sender’s name and the first line of the message, cut with `…` when it’s long, such as `› Message from @api-worker: Schema migration finished (ctrl+o to expand)`. Either of these shows you the full text: +When a message arrives, Claude Code shows it in the conversation as a dim one-line preview, and the preview line stays in the conversation afterward. The preview carries the sender’s name and the first line of the message, cut with `…` when it’s long, such as `› Message from @api-worker: Schema migration finished (ctrl+o to expand)`. Any of these shows you the full text: * Press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>) and read the full text under the sender’s session name. + * In [fullscreen rendering](</docs/en/fullscreen#use-the-mouse>), click a preview line that leaves part of the message out to expand it in place. * In a session started with [`--verbose`](</docs/en/cli-reference#cli-flags>), Claude Code shows the full text instead of the preview. The preview shortens only what you see. Whether or not you expand it, Claude reads the full message. Claude receives the message with the sender’s name and a reply address, except for a one-way cross-machine message, which carries no reply address. This example is a message one Claude wrote to another, as its full text reads when you expand it:
modified Desktop application View current →
--- a/desktop.md +++ b/desktop.md @@ -326,7 +326,7 @@ Turn on the toggle -In the desktop app, go to **Settings > General** (under **Desktop app**). Find the **Computer use** toggle and turn it on. On Windows, the toggle takes effect immediately and setup is complete. On macOS, continue to the next step.If you don’t see the toggle, confirm you’re on macOS or Windows with a Pro or Max plan, then update and restart the app. +In the desktop app, go to **Settings > This computer > System**. Under **Computer use** , turn on **Enable computer use**. On Windows, the toggle takes effect immediately and setup is complete. On macOS, continue to the next step.If you don’t see the toggle, confirm you’re on macOS or Windows with a Pro or Max plan, then update and restart the app. 3 @@ -353,7 +353,7 @@ Click only| Click and scroll, but not type or use keyboard shortcuts| Terminals, IDEs Full control| Click, type, drag, and use keyboard shortcuts| Everything else -Apps with broad reach, like terminals, Finder or File Explorer, and System Settings or Settings, show an extra warning in the prompt so you know what approving them grants. You can configure two settings in **Settings > General** (under **Desktop app**): +Apps with broad reach, like terminals, Finder or File Explorer, and System Settings or Settings, show an extra warning in the prompt so you know what approving them grants. The **Computer use** section in **Settings > This computer > System** includes these options: * **Denied apps** : add apps here to reject them without prompting. Claude may still affect a denied app indirectly through actions in an allowed app, but it can’t interact with the denied app directly. * **Unhide apps when Claude finishes** : when computer use isn’t running in the background, Claude hides your other windows while it works so it interacts with only the approved app. When Claude finishes, hidden windows are restored unless you turn this setting off. @@ -423,10 +423,10 @@ Continue in another surface -The **Continue in** menu, accessible from the VS Code icon in the bottom right of the session toolbar, lets you move your session to another surface: - - * **Claude Code on the Web** : sends your local session to continue running in the cloud. Desktop pushes your branch, generates a summary of the conversation, and creates a new cloud session with the full context. You can then choose to archive the local session or keep it. This requires a clean working tree, and is not available for SSH sessions. - * **Your IDE** : opens your project in a supported IDE at the current working directory. +To continue a session somewhere else, open the session menu from the caret beside the session title or from the session’s row in the sidebar, then select **Open in** : + + * 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. ### @@ -669,7 +669,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>), `MAX_THINKING_TOKENS` values other than `0` are ignored 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, 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. ####
modified Get started with the desktop app View current →
--- a/desktop-quickstart.md +++ b/desktop-quickstart.md @@ -115,7 +115,7 @@ * **Accept edits** : Claude auto-accepts file edits for faster iteration. * **Plan** : Claude proposes an approach without editing any files, which is useful before a large refactor. -**Add plugins for more capabilities.** Click the **+** button next to the prompt box and select **Plugins** to browse and install [plugins](</docs/en/desktop#install-plugins>) that add skills, agents, MCP servers, and more. **Arrange your workspace.** Drag the chat, diff, terminal, file, and browser panes into whatever layout you want. Open the terminal with **Ctrl+`** to run commands alongside your session, or click a file path to open it in the file pane. See [Arrange your workspace](</docs/en/desktop#arrange-your-workspace>). **Preview your app.** When you run your dev server in the desktop, your app opens in the Browser pane, which can also [open external sites](</docs/en/desktop#browse-external-sites>). Claude can view the running app, test endpoints, inspect logs, and iterate on what it sees. See [Preview your app](</docs/en/desktop#preview-your-app>). **Track your pull request.** After opening a PR, Claude Code monitors CI check results and can automatically fix failures or merge the PR once all checks pass. See [Monitor pull request status](</docs/en/desktop#monitor-pull-request-status>). **Put Claude on a schedule.** Set up [scheduled tasks](</docs/en/desktop-scheduled-tasks>) to run Claude automatically on a recurring basis: a daily code review every morning, a weekly dependency audit, or a briefing that pulls from your connected tools. **Scale up when you’re ready.** Open [parallel sessions](</docs/en/desktop#work-in-parallel-with-sessions>) from the sidebar to work on multiple tasks at once, optionally each in its own Git worktree, and open the [tasks pane](</docs/en/desktop#watch-background-tasks>) to watch the subagents and background commands a session has running. Open a [side chat](</docs/en/desktop#ask-a-side-question-without-derailing-the-session>) to ask a question without derailing the main thread. Send [long-running work to the cloud](</docs/en/desktop#run-long-running-tasks-in-the-cloud>) so it continues even if you close the app, or [continue a session on the web or in your IDE](</docs/en/desktop#continue-in-another-surface>) if a task takes longer than expected. [Connect external tools](</docs/en/desktop#extend-claude-code>) like GitHub, Slack, and Linear to bring your workflow together. +**Add plugins for more capabilities.** Click the **+** button next to the prompt box and select **Plugins** to browse and install [plugins](</docs/en/desktop#install-plugins>) that add skills, agents, MCP servers, and more. **Arrange your workspace.** Drag the chat, diff, terminal, file, and browser panes into whatever layout you want. Open the terminal with **Ctrl+`** to run commands alongside your session, or click a file path to open it in the file pane. See [Arrange your workspace](</docs/en/desktop#arrange-your-workspace>). **Preview your app.** When you run your dev server in the desktop, your app opens in the Browser pane, which can also [open external sites](</docs/en/desktop#browse-external-sites>). Claude can view the running app, test endpoints, inspect logs, and iterate on what it sees. See [Preview your app](</docs/en/desktop#preview-your-app>). **Track your pull request.** After opening a PR, Claude Code monitors CI check results and can automatically fix failures or merge the PR once all checks pass. See [Monitor pull request status](</docs/en/desktop#monitor-pull-request-status>). **Put Claude on a schedule.** Set up [scheduled tasks](</docs/en/desktop-scheduled-tasks>) to run Claude automatically on a recurring basis: a daily code review every morning, a weekly dependency audit, or a briefing that pulls from your connected tools. **Scale up when you’re ready.** Open [parallel sessions](</docs/en/desktop#work-in-parallel-with-sessions>) from the sidebar to work on multiple tasks at once, optionally each in its own Git worktree, and open the [tasks pane](</docs/en/desktop#watch-background-tasks>) to watch the subagents and background commands a session has running. Open a [side chat](</docs/en/desktop#ask-a-side-question-without-derailing-the-session>) to ask a question without derailing the main thread. Send [long-running work to the cloud](</docs/en/desktop#run-long-running-tasks-in-the-cloud>) so it continues even if you close the app, or [move a session you already started to the cloud](</docs/en/desktop#continue-in-another-surface>) if a task takes longer than expected. [Connect external tools](</docs/en/desktop#extend-claude-code>) like GitHub, Slack, and Linear to bring your workflow together. ##
modified Schedule recurring tasks in Claude Code Desktop View current →
--- a/desktop-scheduled-tasks.md +++ b/desktop-scheduled-tasks.md @@ -63,7 +63,7 @@ How scheduled tasks run -Scheduled tasks run on your machine. Desktop checks the schedule every minute while the app is open and starts a fresh session when a task is due, independent of any manual sessions you have open. Each task gets a small delay of a few minutes after the scheduled time to stagger API traffic. The delay is deterministic: the same task always starts at the same offset. When a task fires, you get a desktop notification and a new session appears under a **Scheduled** section in the sidebar. Open it to see what Claude did, review changes, or respond to permission prompts. Claude can edit files, run commands, create commits, and open pull requests, the same as in a session you start yourself, but can’t send or receive [messages between your desktop sessions](</docs/en/desktop#work-across-sessions>) through the desktop app’s session surface. Tasks only run while the desktop app is running and your computer is awake. If your computer sleeps through a scheduled time, the run is skipped. To prevent idle-sleep, enable **Keep computer awake** in Settings under **Desktop app → General**. Closing the laptop lid still puts it to sleep. For tasks that need to run even when your computer is off, or that should trigger on an API call or GitHub event, create a remote [routine](</docs/en/routines>) instead. +Scheduled tasks run on your machine. Desktop checks the schedule every minute while the app is open and starts a fresh session when a task is due, independent of any manual sessions you have open. Each task gets a small delay of a few minutes after the scheduled time to stagger API traffic. The delay is deterministic: the same task always starts at the same offset. When a task fires, you get a desktop notification and a new session appears under a **Scheduled** section in the sidebar. Open it to see what Claude did, review changes, or respond to permission prompts. Claude can edit files, run commands, create commits, and open pull requests, the same as in a session you start yourself, but can’t send or receive [messages between your desktop sessions](</docs/en/desktop#work-across-sessions>) through the desktop app’s session surface. Tasks only run while the desktop app is running and your computer is awake. If your computer sleeps through a scheduled time, the run is skipped. To prevent idle-sleep, turn on **Keep computer awake** in **Settings > This computer > System**. Closing the laptop lid still puts it to sleep. For tasks that need to run even when your computer is off, or that should trigger on an API call or GitHub event, create a remote [routine](</docs/en/routines>) instead. ##
modified Environment variables View current →
Show diff (104 lines)
--- a/env-vars.md +++ b/env-vars.md @@ -190,7 +190,7 @@ `CLAUDE_CODE_ARTIFACT_COMMENTS`| Set to `0` to stop Claude reading and replying to [comments on an artifact](</docs/en/artifacts#collect-comments-on-an-artifact>). Has no effect when `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` has [turned artifacts off](</docs/en/artifacts#availability>). Requires Claude Code v2.1.221 or later `CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT`| Set to `0` to stop Claude [replying on its own to comments sent to it](</docs/en/artifacts#let-claude-reply-to-comments-on-its-own>). Requires Claude Code v2.1.228 or later `CLAUDE_CODE_ATTRIBUTION_HEADER`| Set to `0` to omit the [attribution block](</docs/en/llm-gateway-protocol#system-prompt-attribution-block>), which carries the client version and a prompt fingerprint, from the start of the system prompt. Caching on a direct connection to the Anthropic API is unaffected either way. In some direct-connection setups, Claude Code keeps the block on [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) classifier requests even when you set `0`. In [System prompt attribution block](</docs/en/llm-gateway-protocol#system-prompt-attribution-block>), check which connections and credentials this covers. Before v2.1.181 the block included a per-request token on custom base URLs and Microsoft Foundry connections, so on those versions set it to `0` when your LLM gateway caches on the request body or forwards requests to a third-party provider, or when you connect to Microsoft Foundry directly -`CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS`| When `CLAUDE_AUTO_BACKGROUND_TASKS` is enabled, seconds between reminders to Claude to check on [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) that are still running. Accepts a plain integer from `1` to `86400` only; any other value or spelling reads as unset. When unset, there are no check-in reminders. Requires Claude Code v2.1.248 or later +`CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS`| Removed in v2.1.283. Use `CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE` instead `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 @@ -233,6 +233,7 @@ `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY`| Set to `1` to disable the “How is Claude doing?” session quality surveys. Surveys are also disabled when `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set, unless `CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL` opts back in. To set a sample rate instead of disabling outright, use the [`feedbackSurveyRate`](</docs/en/settings-reference#feedbacksurveyrate>) setting. See [Session quality surveys](</docs/en/data-usage#session-quality-surveys>) `CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING`| Set to `1` to disable file [checkpointing](</docs/en/checkpointing>). The `/rewind` command will not be able to restore code changes. Overrides the [`fileCheckpointingEnabled`](</docs/en/settings-reference#filecheckpointingenabled>) setting `CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS`| Set to `1` to remove built-in commit and PR workflow instructions and the git status snapshot from Claude’s context. Useful when using your own git workflow skills. Takes precedence over the [`includeGitInstructions`](</docs/en/settings-reference#includegitinstructions>) setting when set +`CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT`| Set to `1` to stop Claude Code from reading scripts passed to a shell with `-c`, such as `bash -c 'rm -rf ~'`, for [critical-path](</docs/en/permission-modes#removals-inside-nested-commands-and-inline-scripts>) removals. Claude Code still checks the shell variable and positional parameter targets in those scripts, and 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.288 or later `CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP`| Set to `1` to prevent automatic remapping of Opus 4.0 and 4.1 to the current Opus version on the Anthropic API. Use when you intentionally want to pin an older model. The remap does not run on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry `CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK`| Set to `1` to stop Claude Code on [Amazon Bedrock](</docs/en/amazon-bedrock#when-a-model-is-disabled-mid-session>) and [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai#when-a-model-is-disabled-mid-session>) from switching to an older model when your account loses access to a session’s model mid-session; the refused request fails at once instead. A [fallback model chain](</docs/en/model-config#fallback-model-chains>) you configure still switches on that refusal, and the [startup model checks](</docs/en/amazon-bedrock#startup-model-checks>) still fall back at launch. Requires Claude Code v2.1.285 or later `CLAUDE_CODE_DISABLE_MOUSE`| Set to `1` to disable mouse tracking in [fullscreen rendering](</docs/en/fullscreen>). Keyboard scrolling with `PgUp` and `PgDn` still works. Use this to keep your terminal’s native copy-on-select behavior @@ -245,6 +246,7 @@ `CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS`| Set to `1` to stop Claude Code from running your [`Notification` hooks for unanswered permission requests](</docs/en/hooks#notification>) in sessions where Claude Code sends them to the Agent SDK’s `canUseTool` callback, which is how Claude Desktop and the VS Code extension host Claude Code. Has no effect in terminal sessions. Requires Claude Code v2.1.233 or later `CLAUDE_CODE_DISABLE_POLICY_SKILLS`| Set to `1` to skip loading skills from the system-wide managed skills directory. Useful for container or CI sessions that should not load operator-provisioned skills `CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY`| Set to `1` to turn off the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) check that denies the `cmd` built-ins `rd`, `rmdir`, `del`, and `erase` on a [system path](</docs/en/permission-modes#remove-item-in-powershell>), such as a drive root or your home directory. Claude Code ignores this variable in a settings file’s `env` block. Requires Claude Code v2.1.283 or later +`CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK`| Set to `1` to turn off the [automatic model switch when a safety classifier flags a request](</docs/en/model-config#automatic-model-fallback>), the behavior the [`switchModelsOnFlag`](</docs/en/settings-reference#switchmodelsonflag>) setting controls `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>) @@ -364,7 +366,7 @@ `CLAUDE_CODE_SUBAGENT_MODEL`| The default model for [subagents](</docs/en/sub-agents#choose-a-model>), [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammates, and [workflow](</docs/en/workflows>) agents that aren’t assigned a model another way. Accepts an alias such as `haiku` or a full model name. Two sources take precedence over it: a model Claude passes when it spawns the agent, and a `model` field in the agent’s definition, including `inherit`. To change that, set [`CLAUDE_CODE_SUBAGENT_MODEL_FORCE`](</docs/en/sub-agents#run-every-subagent-on-one-model>). See [Choose a model](</docs/en/sub-agents#choose-a-model>) for the full order. Setting it to `inherit` is the same as leaving it unset. Before v2.1.251, this variable overrode both the per-invocation model and the definition’s `model` field `CLAUDE_CODE_SUBAGENT_MODEL_FORCE`| Set to `1` to force one model onto subagents, teammates, and workflow agents. [Run every subagent on one model](</docs/en/sub-agents#run-every-subagent-on-one-model>) says which model that is. Requires Claude Code v2.1.257 or later `CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL`| Set `5m` or `1h`, the only values Claude Code accepts, to choose the [prompt cache TTL](</docs/en/prompt-caching#cache-lifetime>) for requests outside the main conversation, such as [subagents](</docs/en/sub-agents>), workflows, and background work. Takes precedence over the `subagentPromptCacheTtl` setting and over `ENABLE_PROMPT_CACHING_1H`, and `FORCE_PROMPT_CACHING_5M` overrides it. The API bills 1-hour cache writes at a higher rate. Requires Claude Code v2.1.242 or later -`CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`| Set to `1` to strip credentials from subprocess environments (Bash tool, hooks, MCP stdio servers): Anthropic and cloud provider credentials, any other variable that Claude Code recognizes as a credential, and credentials embedded in package registry URLs. The parent Claude process keeps these credentials for API calls, but child processes cannot read them, reducing exposure to prompt injection attacks that attempt to exfiltrate secrets via shell expansion. On v2.1.251 or later, the scrub also removes Claude Code’s own configuration-store pointer variables (such as `CLAUDE_CONFIG_DIR`), so a child process cannot locate a relocated configuration directory. Leave the scrub unset if a subprocess needs these variables. On Linux, this also runs Bash subprocesses in an isolated PID namespace so they cannot read host process environments via `/proc`; as a side effect, `ps`, `pgrep`, and `kill` cannot see or signal host processes. `claude-code-action` sets this automatically when `allowed_non_write_users` is configured +`CLAUDE_CODE_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 @@ -377,6 +379,7 @@ `CLAUDE_CODE_TMUX_TRUECOLOR`| Set to any non-empty value, such as `1`, to allow 24-bit truecolor output inside tmux. **Setting it to`0` or `false` still allows truecolor**, unlike most on/off variables; unset the variable to restore the 256-color clamp. By default, Claude Code clamps to 256 colors when `$TMUX` is set because tmux does not pass through truecolor escape sequences unless configured to. Set this after adding `set -ga terminal-overrides ',*:Tc'` to your `~/.tmux.conf`. See [Terminal configuration](</docs/en/terminal-config>) for other tmux settings `CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE`| On Linux and WSL, set to a comma-separated list of the kinds of processes Claude Code [excludes from the tool memory cap](</docs/en/tools-reference#memory-limit-on-linux-and-wsl>), such as `mcp` or `lsp`. Set `none` to cap every kind, or `all-new` to cap only Bash, PowerShell, and Monitor tool commands. Claude Code keeps Bash, PowerShell, and Monitor tool commands under the cap whatever you list. Requires Claude Code v2.1.246 or later `CLAUDE_CODE_TOOL_MEMORY_LIMIT`| On Linux and WSL, set to a size such as `4G` to [cap the memory that Bash and PowerShell tool commands can use](</docs/en/tools-reference#memory-limit-on-linux-and-wsl>), and Monitor tool commands on v2.1.246 or later. Write the size in plain digits, alone for a number of bytes or with a `K`, `M`, `G`, or `T` suffix. Set `0` or `off` to turn the cap off. Once the first process Claude Code starts has turned the cap on or off, a changed value takes effect the next time you launch `claude`. Requires Claude Code v2.1.233 or later +`CLAUDE_CODE_TRANSCRIPT_LOCAL_GC`| Set to `1` to limit how large the [transcript file](</docs/en/sessions#where-transcripts-are-stored>) of a long `-p` or Agent SDK session grows. After each compaction, once the file is larger than 5 MB, Claude Code removes the history from before that compaction. Resuming the session restores the same conversation whether or not the file was trimmed. Set it in the environment you start Claude Code from, since a settings `env` block can’t turn it on. Requires Claude Code v2.1.287 or later `CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS`| Deadline in milliseconds before Claude Code cancels a dialog it forwards to a remote client such as a [Remote Control](</docs/en/remote-control>) or SDK host, or the approval dialog for a [held cross-session message](</docs/en/cross-session-messaging#control-inbound-messages>); permission prompts and `AskUserQuestion` questions use their own flows and aren’t governed by it. On Claude Code v2.1.236 or later, it also bounds the mid-session [Fable usage-credits consent prompt](</docs/en/model-config#fable-and-usage-credits>) in a session that may be running unattended. [Control inbound messages](</docs/en/cross-session-messaging#control-inbound-messages>) and [non-interactive sessions](</docs/en/cross-session-messaging#non-interactive-sessions>) cover the full held-message expiry rules, including the cases where the deadline doesn’t apply. Overrides the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) setting. `0` or a negative value disables the deadline `CLAUDE_CODE_USE_ANTHROPIC_AWS`| Use [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) `CLAUDE_CODE_USE_BEDROCK`| Use [Amazon Bedrock](</docs/en/amazon-bedrock>) @@ -387,6 +390,7 @@ `CLAUDE_CODE_USE_VERTEX`| Use [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) `CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS`| Set to the number of milliseconds [WebFetch](</docs/en/tools-reference#webfetch-tool-behavior>) keeps each fetched URL’s response cached. The default is `900000`, which is 15 minutes. Takes plain digits only; `0`, a decimal, or any other spelling keeps the default. Claude Code reads the value once per launch, so a change in a settings `env` block applies when you next launch `claude`. Requires Claude Code v2.1.233 or later `CLAUDE_CODE_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_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>) @@ -440,7 +444,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. 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 (default: 25000) `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. Claude Code ignores nonzero values on adaptive reasoning models, except on the models where `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, 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 +502,28 @@ ​ +What the subprocess environment scrub removes + +When you set `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` to `1`, Claude Code removes credentials from the environments of the subprocesses it starts, such as Bash commands, hooks, and stdio MCP servers. This reduces what a prompt injection attack can read through shell expansion. The Claude Code process keeps the credentials for its own API calls. The scrub recognizes a credential by its variable name or by the shape of its value, so use it as one layer alongside narrow [permission rules](</docs/en/permissions>) rather than as the only control. The table shows what the scrub does to example variables: + +Example variable| What the scrub does +---|--- +`ANTHROPIC_API_KEY`, `AWS_SECRET_ACCESS_KEY`| Removes it +`NPM_TOKEN`, `DB_PASSWORD`| Removes it, because the name looks like a credential +`DATABASE_URL` that contains a password| Removes it, because the value looks like a credential +`PIP_INDEX_URL` or `NPM_CONFIG_REGISTRY` that contains a password| Keeps the URL and cuts the username and password from it +`CLAUDE_CONFIG_DIR`| Removes it. Requires Claude Code v2.1.251 or later +`GITHUB_TOKEN`, `GH_TOKEN`, `GH_ENTERPRISE_TOKEN`, `GITHUB_ENTERPRISE_TOKEN`| Leaves it in place, so that `gh` and scripts that call the GitHub API keep working +`HTTP_PROXY`, `HTTPS_PROXY`| Leaves it in place, including a [username and password in the URL](</docs/en/network-config#basic-authentication>). The [sandbox](</docs/en/sandboxing#network-isolation>) can set these variables itself for sandboxed commands +`GIT_CONFIG_COUNT`, `GIT_CONFIG_KEY_<n>`, `GIT_CONFIG_VALUE_<n>`| Leaves it in place, whatever it holds +A secret whose variable name and value don’t look like a credential| Leaves it in place + +Because the scrub leaves `GITHUB_TOKEN` in place, give a GitHub Actions job the narrowest `permissions` it needs. To remove a GitHub token from sandboxed Bash commands, add a `deny` entry under [`sandbox.credentials`](</docs/en/sandboxing#protect-credentials>). Leave the scrub unset if a subprocess needs one of the removed variables. On Linux, the scrub also runs Bash subprocesses in an isolated PID namespace so they can’t read host process environments through `/proc`. As a side effect, `ps`, `pgrep`, and `kill` can’t see or signal host processes. + +## + +​ + Features that need feature-flag fetching Claude Code turns some features on through feature flags it fetches from Anthropic. Claude Code skips that fetch in these sessions: @@ -529,7 +555,12 @@ First session after an install or upgrade -In your first session after you install Claude Code, or upgrade to a version that adds a feature, a flag-gated feature can be missing. That session can also start in a different [permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>) than your later sessions do. Claude Code fetches the flags during that session, so your next session has the feature and the usual starting permission mode. After a fresh install, in a non-interactive session such as `claude -p`, the Agent SDK, or the VS Code extension, Claude Code can still pick the flags up before it [chooses the starting permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>). +In your first session after you install Claude Code, or upgrade to a version that adds a feature, a flag-gated feature can be missing. That session can also start in a different [permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>) than your later sessions do. When Claude Code fetches the flags during that session, it saves them on the machine, so your next session on that machine has the feature and the usual starting permission mode. After a fresh install, in a non-interactive session such as `claude -p`, the Agent SDK, or the VS Code extension, Claude Code can pick the flags up before it [chooses the starting permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>), but it doesn’t always wait for them. In setups such as these, sessions after the first also start without freshly fetched flags: + + * **A clean environment on every run** : if each run starts in a CI container, or any other environment without the flags an earlier session saved, every run is a first session + * **A gateway token with no API key** : if you authenticate with `ANTHROPIC_AUTH_TOKEN` and no API key, and `ANTHROPIC_BASE_URL` points at a host other than Anthropic’s, such as an [LLM gateway](</docs/en/llm-gateway>), Claude Code has no credential to fetch the flags with + +To choose the permission mode that sessions in these setups start in, see [Start in a different permission mode](</docs/en/permission-modes#start-in-a-different-mode>). ##
modified Error reference View current →
--- a/errors.md +++ b/errors.md @@ -356,6 +356,7 @@ `Invalid permission rule "..." was skipped: Malformed Tool(content) rule`| Configuration warnings `... is not matched by file permission checks`| Configuration warnings `... has a wildcard before the rest of the command`| Configuration warnings +`Denying Bash also turns off the PowerShell tool, so Claude has neither`| Configuration warnings `CLAUDE_CODE_DISABLE_1M_CONTEXT is set, but the 200K limit isn't enforced`| Configuration warnings `[claude-code:unrecognized_model]`| Configuration warnings `Stale sandbox mask files left by a killed session`| Configuration warnings @@ -4944,6 +4945,23 @@ ​ +Denying Bash also turns off the PowerShell tool + +You removed the whole Bash tool, for example with `--disallowedTools Bash` or with a bare `Bash` or `Bash(*)` [deny rule](</docs/en/permissions#match-all-uses-of-a-tool>) in one of your settings files. On Windows with Git Bash installed, [denying Bash also turns the PowerShell tool off](</docs/en/tools-reference#bash-deny-rules-also-turn-off-the-powershell-tool>), so the session starts with no shell tool. Claude Code prints this warning at startup: + + Denying Bash also turns off the PowerShell tool, so Claude has neither. To use PowerShell, set CLAUDE_CODE_USE_POWERSHELL_TOOL=1. + +**What to do:** + + * To have Claude use PowerShell, set [`CLAUDE_CODE_USE_POWERSHELL_TOOL`](</docs/en/env-vars>) to `1` in your environment or in the `env` block of a settings file, as [Enable the PowerShell tool](</docs/en/tools-reference#enable-the-powershell-tool>) shows. The PowerShell tool then stays on alongside your Bash deny rule. + * To block particular commands instead of the whole tool, replace the bare `Bash` entry with scoped rules such as `Bash(git push *)` in the same settings file or flag. Claude keeps the Bash tool, and the PowerShell tool stays off until you also set the variable or add a scoped [`PowerShell` permission rule](</docs/en/permissions#powershell>). + +In a [background session](</docs/en/agent-view>) or with `--output-format json` or `stream-json`, Claude Code writes the warning to the debug log instead of stderr. Run with `--debug` to capture it at `~/.claude/debug/<session-id>.txt`. Before v2.1.287, Claude Code turned the PowerShell tool off the same way without printing a warning. + +### + +​ + crossSessionInbound must be one of accept, hold, refuse A settings file sets [`crossSessionInbound`](</docs/en/settings-reference#crosssessioninbound>) to a value Claude Code doesn’t recognize, such as the typo `"reject"`. The warning’s second sentence depends on which file holds the value; in a user, project, local, or `--settings` file it reads:
modified Extend Claude Code View current →
--- a/features-overview.md +++ b/features-overview.md @@ -220,7 +220,7 @@ **Subagents**| When spawned| Fresh context with specified skills, or the parent conversation for a [fork](</docs/en/sub-agents#fork-the-current-conversation>)| Isolated from main session **Hooks**| On trigger| Nothing (runs externally)| Zero, unless hook returns additional context -*By default, skill descriptions load at session start so Claude can decide when to use them. Set `disable-model-invocation: true` in a skill’s frontmatter to hide it from Claude entirely until you invoke it manually. For a skill you didn’t write, set [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) in settings to do the same without editing its file. +*Set [`disable-model-invocation: true`](</docs/en/skills#control-who-invokes-a-skill>) in a skill’s frontmatter to keep its description out of Claude’s context. For a skill you didn’t write, set [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) in settings to do the same without editing its file. ### @@ -246,9 +246,9 @@ Keep CLAUDE.md under 200 lines. Move reference material to skills, which load on demand. To get [trim proposals for a checked-in CLAUDE.md](</docs/en/memory#my-claude-md-is-too-large>), run `/doctor`. -Skills are extra capabilities in Claude’s toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Claude Code includes [bundled skills](</docs/en/commands>) like `/code-review`, `/batch`, and `/debug` that work without setup. You can also create your own.**When:** Depends on the skill’s configuration. By default, descriptions load at session start and full content loads when used. For user-only skills (`disable-model-invocation: true`), nothing loads until you invoke them.**What loads:** For model-invocable skills, Claude sees names and descriptions in every request. When you invoke a skill with `/<name>` or Claude loads it automatically, the full content loads into your conversation.**How Claude chooses skills:** Claude matches your task against skill descriptions to decide which are relevant. If descriptions are vague or overlap, Claude may load the wrong skill or miss one that would help. To tell Claude to use a specific skill, invoke it with `/<name>`. Skills with `disable-model-invocation: true` are invisible to Claude until you invoke them.**Context cost:** Low until used. User-only skills have zero cost until invoked.**In subagents:** Skills work differently in subagents. Instead of on-demand loading, skills listed in the subagent’s `skills` field are fully preloaded into its context at launch. Subagents can still discover and invoke unlisted project, user, and plugin skills through the Skill tool. - -Use `disable-model-invocation: true` for skills with side effects. This saves context and ensures only you trigger them. +Skills are extra capabilities in Claude’s toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Claude Code includes [bundled skills](</docs/en/commands>) like `/code-review`, `/batch`, and `/debug` that work without setup. You can also create your own.**When:** Depends on the skill’s configuration. By default, descriptions load at session start and full content loads when used. For user-only skills (`disable-model-invocation: true`), nothing loads until you invoke them.**What loads:** For model-invocable skills, Claude sees names and descriptions in every request. When you invoke a skill with `/<name>` or Claude loads it automatically, the full content loads into your conversation.**How Claude chooses skills:** Claude matches your task against skill descriptions to decide which are relevant. If descriptions are vague or overlap, Claude may load the wrong skill or miss one that would help. To tell Claude to use a specific skill, invoke it with `/<name>`.**Context cost:** Low until used. User-only skills have zero cost until invoked.**In subagents:** Skills work differently in subagents. Instead of on-demand loading, skills listed in the subagent’s `skills` field are fully preloaded into its context at launch. Subagents can still discover and invoke unlisted project, user, and plugin skills through the Skill tool. + +Use `disable-model-invocation: true` for skills with side effects. This saves context and ensures they run only when you name them. **When:** Session start.**What loads:** Tool names and server instructions from connected servers. Full JSON schemas stay deferred until Claude needs a specific tool.**Context cost:** [Tool search](</docs/en/mcp#scale-with-mcp-tool-search>) is on by default, so idle MCP tools consume minimal context.
modified Fullscreen rendering View current →
--- a/fullscreen.md +++ b/fullscreen.md @@ -91,7 +91,7 @@ * **Click the`↑ N more` or `↓ N more` row at the edge of a list** to jump to that end of the list without choosing an option. Requires Claude Code v2.1.286 or later. * **Click a collapsed tool result** to expand it and see the full output. Click again to collapse. The tool call and its result expand together. Only messages that have more to show are clickable. * Clicking also expands the output of a `!` shell command, whether an older truncated result or the live progress row while the command runs. Requires Claude Code v2.1.257 or later. - * Clicking also expands a dim `Message from @<sender>` line when the sender is a [teammate](</docs/en/agent-teams>) or another agent running in your session. The line for a message from [one of your other sessions](</docs/en/cross-session-messaging#what-a-message-looks-like>) also shows the message’s first line and isn’t clickable, so press `Ctrl+o` to read that one. + * Clicking also expands a dim `Message from @<sender>` line when the sender is a [teammate](</docs/en/agent-teams>) or another agent running in your session. * **Hold`Cmd` on macOS, or `Ctrl` on Linux and Windows, and click a URL or file path** to open it. Plain `http://` and `https://` URLs open in your browser, and file paths in tool output, like the ones printed after an Edit or Write, open in your default application. A plain click without the modifier doesn’t open links, matching native terminal behavior. * Claude Code renders a network (UNC) path, such as `\\server\share\file.ts`, as plain text with no link, because opening a network path can send your Windows credentials to the host it names. * Some macOS terminals forward `Cmd`+click to the running app instead of opening the link themselves, and the terminal mouse protocol has no way to encode the `Cmd` key, so Claude Code receives a plain click. In Ghostty, and in Warp on macOS, Claude Code detects this and lets a plain click on a link open it, and holding `Cmd` still works.
modified Claude Code on Google Cloud's Agent Platform View current →
--- a/google-vertex-ai.md +++ b/google-vertex-ai.md @@ -199,6 +199,21 @@ ​ +When your organization enforces a model allowlist + +If you set [`enforceAvailableModels`](</docs/en/model-config#enforce-the-allowlist-for-the-default-model>) in managed settings, the startup model checks use only models your `availableModels` list permits. This requires Claude Code v2.1.287 or later. A list without `enforceAvailableModels` doesn’t restrict these checks. The checks compare each entry with the model ID they would send to Agent Platform, so write the list in those IDs. This example permits Opus 4.8 and Sonnet 4.5: + + { + "availableModels": ["claude-opus-4-8", "claude-sonnet-4-5@20250929"], + "enforceAvailableModels": true + } + +For aliases, version prefixes, and `modelOverrides` entries, see [Pin models for third-party deployments](</docs/en/model-config#pin-models-for-third-party-deployments>). + +### + +​ + When a model is disabled mid-session If your project loses access to the model your session is running on, for example because an administrator disables it in [Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>), Claude Code switches the session to another model instead of failing each request, and shows `Switched to <fallback> because <model> is not available`. It tries the same models as the startup fallback: earlier versions of the same tier first and, for an Opus session with no Opus version available, the default Sonnet model. The switch applies only to a tier you haven’t pinned, the same condition as the startup fallback. A session on a specific version you picked keeps its model and, without a fallback model chain, the request fails instead. In [auto mode](</docs/en/permission-modes#enable-auto-mode-on-bedrock-agent-platform-or-foundry>), Claude Code switches only to a model auto mode supports on Agent Platform. If none of those models is available either, the request fails. A [fallback model chain](</docs/en/model-config#fallback-model-chains>) you configure replaces the tier switch: on these refusals Claude Code switches to your configured fallback instead. To have refused requests fail rather than switch, set [`CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK=1`](</docs/en/env-vars>). A fallback chain you configured still switches on these refusals; remove the chain as well if you want every refused request to fail.
modified Run Claude Code programmatically View current →
--- a/headless.md +++ b/headless.md @@ -39,7 +39,7 @@ System prompt additions| `--append-system-prompt`, `--append-system-prompt-file` Settings| `--settings <file-or-json>` MCP servers| `--mcp-config <file-or-json>` -Custom agents| `--agents <json>` +[Custom agents](</docs/en/sub-agents#choose-the-subagent-scope>)| `--agents <file-or-json>` A plugin| `--plugin-dir <path>`, `--plugin-url <url>` Bare mode also limits what happens while the session runs:
modified Host and maintain a marketplace View current →
--- a/host-marketplace.md +++ b/host-marketplace.md @@ -209,7 +209,7 @@ Release a new version -To release a new version to users, change the plugin’s `version`. Users get a new copy only when the plugin’s computed version differs from the one they have. That version comes from `plugin.json` first, then from the marketplace entry, per [Versions and updates](</docs/en/plugins/loading#versions-and-updates>). A plugin that users [load in place](</docs/en/plugins/loading#find-plugins-on-disk>) from a marketplace they added as a local directory isn’t controlled by `version`. It loads your current files at every session start, whatever its version string says. For every install other than an in-place load or one from a `command` source, either increase `version` on each release or omit it: +To release a new version to users, change the plugin’s `version`. Users get a new copy only when the plugin’s computed version differs from the one they have. That version comes from `plugin.json` first, then from the marketplace entry, per [Versions and updates](</docs/en/plugins/loading#versions-and-updates>). A plugin that users [load in place](</docs/en/plugins/loading#find-plugins-on-disk>) from a marketplace they added from a local path isn’t controlled by `version`. It loads your current files at every session start, whatever its version string says. For every install other than an in-place load or one from a `command` source, either increase `version` on each release or omit it: * **Bump`version` on each release**: users stay on their cached copy until the string changes. If you set `"version": "1.0.0"` and push new commits without changing it, users don’t receive them. * **Omit`version`**: users track your commits instead. Leave `version` out of both `plugin.json` and the marketplace entry.
modified Interactive mode View current →
--- a/interactive-mode.md +++ b/interactive-mode.md @@ -460,7 +460,7 @@ * Your account is close to or at its usage limit. To keep suggestions on until you reach the limit, set [`CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION`](</docs/en/env-vars>) to `true`. Before v2.1.238, Claude Code skipped them near the limit even with the variable set to `true` * In an [agent team](</docs/en/agent-teams>), in teammates’ sessions by default. The lead’s session shows suggestions -In print mode, Claude Code doesn’t generate suggestions by default. Pass [`--prompt-suggestions`](</docs/en/cli-reference#cli-flags>) with `-p "<prompt>" --output-format stream-json --verbose` to have Claude Code emit a `prompt_suggestion` message after each turn that generates one. The generator skips very short conversations and cold prompt caches here too, so a single short `-p` query can emit none. +The notice `Showing fewer prompt suggestions · use one to bring them back` means Claude Code is showing suggestions less often because you left many in a row unused. To return to the usual frequency, use a suggestion or set [`CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION`](</docs/en/env-vars>) to `true`. In print mode, Claude Code doesn’t generate suggestions by default. Pass [`--prompt-suggestions`](</docs/en/cli-reference#cli-flags>) with `-p "<prompt>" --output-format stream-json --verbose` to have Claude Code emit a `prompt_suggestion` message after each turn that generates one. The generator skips very short conversations and cold prompt caches here too, so a single short `-p` query can emit none. ###
modified Draw in the interface with a mod View current →
--- a/interface.md +++ b/interface.md @@ -356,7 +356,7 @@ `Link`, `Code`, `Markdown`| A link with `href` and an optional `label`, a code block, and text formatted the way Claude’s replies are. `Markdown` takes its content in a `text` prop, not in `children`, and needs a `key` when you pass `onLinkPress`.| Everywhere `Input`, `Select`| A text field and a dropdown| Terminal, Desktop `Svg`| An SVG document| Desktop -`Client`| A region drawn by a second file of yours, for animation and pointer input. That file gets no mods API. It reaches your hooks only by posting data, which arrives as a `ui.message` event.| Terminal, Desktop +`Client`| A region drawn by a second file of yours, for animation and pointer input. That file gets no mods API. It reaches your hooks by posting data, which arrives as a `ui.message` event. If it fails to load, draw, or run, your hooks receive a [`ui.fault`](</docs/en/plugins/mods/reference#interface>) event.| Terminal, Desktop `Raster`, `Image`| A grid of colored cells, and a picture| Terminal If your module is a `.tsx` or `.jsx` file, you can write the tree as JSX. Destructure the elements from `$.ui.resolve(e)` first. If a tree uses an element the app doesn’t have, a prop an element doesn’t take, or a child where none goes, Claude Code draws its own version of the site. In a session started with `--plugin-dir`, a transcript line says so, such as `ui.render (Pane) refused: Text prop "bogusProp" is not allowed; the engine drew its own`. The [debug log](</docs/en/plugins/mods/troubleshoot#read-the-debug-log>) records it as `ui.render (Pane): a hook returned a tree that does not validate` with the same reason. Nothing else appears in the session, so when a drawing doesn’t show up, check that line or the log. @@ -580,7 +580,7 @@ When Claude Code redraws without being asked -Claude Code runs your `ui.render` hook again when the site’s props change or the terminal’s width changes. It doesn’t run the hook on a timer, and it can’t tell when a variable in your module changes. +Claude Code runs your `ui.render` hook again when the site’s props change or the terminal’s width changes. When a `Client` in the site fails and your mod handles [`ui.fault`](</docs/en/plugins/mods/reference#interface>), Claude Code runs the hook once more after your `ui.fault` hooks return, so your `ui.render` hook can leave the `Client` out. It doesn’t run the hook on a timer, and it can’t tell when a variable in your module changes. ###
modified Customize keyboard shortcuts View current →
--- a/keybindings.md +++ b/keybindings.md @@ -474,6 +474,10 @@ ---|---|--- `agents:switchView`| Ctrl+S| Switch [session grouping](</docs/en/agent-view#organize-the-list>) between state and directory `agents:togglePin`| Ctrl+T| [Pin or unpin](</docs/en/agent-view#organize-the-list>) the selected session +`agents:find`| Ctrl+F| Find sessions by name, with the [`n:` filter](</docs/en/agent-view#filter-sessions>). Requires v2.1.288 or later +`agents:rename`| Ctrl+R| [Rename](</docs/en/agent-view#organize-the-list>) the selected session. Requires v2.1.288 or later +`agents:previousGroup`| Ctrl+Up, Meta+Up| Jump to the previous [group header](</docs/en/agent-view#organize-the-list>). Requires v2.1.288 or later +`agents:nextGroup`| Ctrl+Down, Meta+Down| Jump to the next group header. Requires v2.1.288 or later While agent view is open, Claude Code uses the `Agents` binding for any key the `Agents` context binds, and it ignores a `Chat` or `Global` binding on the same key. For example, pressing Ctrl+S in agent view switches the session grouping rather than triggering the default `chat:stash`. The dispatch input’s external-editor shortcut isn’t an `Agents` action. Agent view follows the `Chat` context’s `chat:externalEditor` binding, Ctrl+G by default. Bindings fire on single keystrokes in agent view, so the Ctrl+X Ctrl+E chord bound to `chat:externalEditor` doesn’t open the editor there.
modified Plugin loading reference View current →
--- a/loading.md +++ b/loading.md @@ -200,7 +200,7 @@ Claude Code loads some plugins in place from where you keep them and copies the rest into the cache, according to their origin: * **`--plugin-dir` and skills-directory plugins**: the directory loads in place and is never copied. A `--plugin-url` archive or a `--plugin-dir` `.zip` is extracted into a session temp directory first - * **Relative-path plugins in a marketplace you added from a local directory** : the plugin loads in place from its path inside the marketplace folder. Your edits to the source directory take effect at the next session start or `/reload-plugins`, and you don’t need to increase the version. The plugin’s hook processes and MCP and LSP servers receive a `CLAUDE_PLUGIN_ROOT` that points at the source directory. For its Node.js package dependencies, see When the dependency install runs + * **Relative-path plugins in a marketplace you added from a local path** : the plugin loads in place from its path inside the marketplace folder. Your edits to the source directory take effect at the next session start or `/reload-plugins`, and you don’t need to increase the version. The plugin’s hook processes and MCP and LSP servers receive a `CLAUDE_PLUGIN_ROOT` that points at the source directory. For its Node.js package dependencies, see When the dependency install runs * **`command`-source plugins in [link mode](</docs/en/plugins/marketplace-reference#command-plugin-source>)**: the directory the command printed loads in place, through links in the cache entry * **Every other marketplace plugin** : Claude Code copies the plugin into `cache/<marketplace>/<plugin>/<version>/` at install and loads that copy. Files outside the plugin directory aren’t copied, so when a script inside a copied plugin reads a path above the plugin root, such as `../shared`, it doesn’t find them @@ -246,7 +246,7 @@ * When Claude Code updates a plugin to a new version * At session start when an enabled plugin isn’t cached yet, such as on a new machine -For a relative-path plugin loaded in place from a local-directory marketplace, Claude Code doesn’t install the dependencies into the source directory. Install them there yourself, or from a hook into [`${CLAUDE_PLUGIN_DATA}`](</docs/en/plugins/components#path-variables-and-persistent-data>). The install runs only when the plugin’s root directory contains both a `package.json` and a supported lockfile. The lockfile decides which package manager Claude Code runs: +For a relative-path plugin loaded in place from a marketplace you added from a local path, Claude Code doesn’t install the dependencies into the source directory. Install them there yourself, or from a hook into [`${CLAUDE_PLUGIN_DATA}`](</docs/en/plugins/components#path-variables-and-persistent-data>). The install runs only when the plugin’s root directory contains both a `package.json` and a supported lockfile. The lockfile decides which package manager Claude Code runs: Lockfile| Package manager ---|--- @@ -293,7 +293,7 @@ Versions and updates -If a plugin’s author pushed new commits and `claude plugin update` prints `<name> is already at the latest version (<version>).`, the version Claude Code computes for the plugin is unchanged, so the plugin’s files on disk don’t change. Claude Code computes a version for every plugin it installs, and that version is how it detects an update. `claude plugin update` and background auto-update compute the version again and don’t replace the cached copy when it matches what `installed_plugins.json` records. An update that you start can still [retry an unfinished dependency install](</docs/en/plugins/troubleshooting#the-packages-it-lists-are-not-installed>) in that copy. The version also names the plugin’s cache directory. A manifest that pins `"version"` is one way the computed version stays the same across commits. See How Claude Code computes the version for the resolution order. A plugin loaded in place from a local-directory marketplace loads its current source files at every session start, whatever its version string says. For a plugin from a [marketplace hosted on claude.ai](</docs/en/plugins/install#add-from-claude-ai>), the version claude.ai records for the plugin is its version, and the manifest’s `version` isn’t read. +If a plugin’s author pushed new commits and `claude plugin update` prints `<name> is already at the latest version (<version>).`, the version Claude Code computes for the plugin is unchanged, so the plugin’s files on disk don’t change. Claude Code computes a version for every plugin it installs, and that version is how it detects an update. `claude plugin update` and background auto-update compute the version again and don’t replace the cached copy when it matches what `installed_plugins.json` records. An update that you start can still [retry an unfinished dependency install](</docs/en/plugins/troubleshooting#the-packages-it-lists-are-not-installed>) in that copy. The version also names the plugin’s cache directory. A manifest that pins `"version"` is one way the computed version stays the same across commits. See How Claude Code computes the version for the resolution order. A plugin loaded in place from a marketplace you added from a local path loads its current source files at every session start, whatever its version string says. For a plugin from a [marketplace hosted on claude.ai](</docs/en/plugins/install#add-from-claude-ai>), the version claude.ai records for the plugin is its version, and the manifest’s `version` isn’t read. ###
modified Control MCP server access for your organization View current →
Show diff (141 lines)
--- a/managed-mcp.md +++ b/managed-mcp.md @@ -270,7 +270,7 @@ Policy-based control with allowlists and denylists -Allowlists and denylists filter which configured servers are allowed to load. They aren’t a registry: a server still has to be added by a user, a plugin, or your organization before either list applies to it. Servers your organization delivers through `managedMcpServers` load without an allowlist entry, and How a server is evaluated covers `managed-mcp.json` servers. The denylist applies to every server regardless of where it came from, other than in-process `type: "sdk"` entries. To deploy servers to users, use `managed-mcp.json` or `managedMcpServers`. Both lists also filter servers a user passes with the [`--mcp-config` CLI flag](</docs/en/cli-reference#cli-flags>), other than in-process `type: "sdk"` entries; `--strict-mcp-config` limits which configuration files load and doesn’t bypass either list. To make the allowlist authoritative, set `allowedMcpServers` and `allowManagedMcpServersOnly: true` together in a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>), such as server-managed settings or a deployed `managed-settings.json` file. The lock applies from every admin-controlled managed source, so a lockdown in a deployed file still applies when server-managed settings that don’t mention MCP are also in use. While the lock is on, the managed allowlist comes from the highest-ranked admin source that sets one. Reading the lock and the allowlist across sources requires Claude Code v2.1.273 or later. Restrict the allowlist to managed settings only shows the configuration. Without `allowManagedMcpServersOnly`, allowlists from every settings scope merge, including a user’s own `~/.claude/settings.json`, so a user can broaden what your allowlist permits. Denylists merge from every scope regardless. +Allowlists and denylists filter which configured servers are allowed to load. They aren’t a registry: a server still has to be added by a user, a plugin, or your organization before either list applies to it. Servers your organization delivers through `managedMcpServers` load without an allowlist entry, and Servers that skip the allowlist check covers `managed-mcp.json` servers. The denylist applies to every server regardless of where it came from, other than in-process `type: "sdk"` entries. To deploy servers to users, use `managed-mcp.json` or `managedMcpServers`. Both lists also filter servers a user passes with the [`--mcp-config` CLI flag](</docs/en/cli-reference#cli-flags>), other than in-process `type: "sdk"` entries; `--strict-mcp-config` limits which configuration files load and doesn’t bypass either list. To make the allowlist authoritative, set `allowedMcpServers` and `allowManagedMcpServersOnly: true` together in a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>), such as server-managed settings or a deployed `managed-settings.json` file. The lock applies from every admin-controlled managed source, so a lockdown in a deployed file still applies when server-managed settings that don’t mention MCP are also in use. While the lock is on, the managed allowlist comes from the highest-ranked admin source that sets one. Reading the lock and the allowlist across sources requires Claude Code v2.1.273 or later. Restrict the allowlist to managed settings only shows the configuration. Without `allowManagedMcpServersOnly`, allowlists from every settings scope merge, including a user’s own `~/.claude/settings.json`, so a user can broaden what your allowlist permits. Denylists merge from every scope regardless. `allowManagedMcpServersOnly` is separate from `allowManagedPermissionRulesOnly`, which locks down [permission rules](</docs/en/permissions#managed-settings>) only. Setting that flag does not enforce the MCP allowlist. @@ -286,7 +286,7 @@ ---|---|--- `serverUrl`| A remote server URL, exact or with `*` wildcards| HTTP and SSE servers `serverCommand`| The exact command and arguments that start a stdio server| Stdio servers -`serverName`| The user-assigned label. Exact match only; wildcards are not expanded| Either type, but see the Warning below +`serverName`| The user-assigned label. Exact match only; wildcards are not expanded| Either type, but see How `serverName` entries match Leaving `allowedMcpServers` unset is different from setting it to an empty array: @@ -297,6 +297,14 @@ See [Invalid entries in managed settings](</docs/en/managed-settings#invalid-entries-in-managed-settings>) for what happens when an entry fails schema validation. +#### + +​ + +How `serverName` entries match + +A `serverName` entry matches the user-assigned label exactly, with no wildcards. + A `serverName` entry, in either list, is not a security control. The name is the label a user assigns when running `claude mcp add` or editing a config file, not the underlying server, so a user can call any server `github`. For claude.ai connectors the name is the display name returned by claude.ai, which can change. To enforce which servers actually run, add `serverCommand` or `serverUrl` entries. The `serverName` validation differs between the two lists: @@ -306,32 +314,24 @@ To turn off all the claude.ai connectors Claude Code fetches itself, see [`disableClaudeAiConnectors`](</docs/en/mcp#disable-claude-ai-connectors>). -### - -​ - -How a server is evaluated - -Before loading a server, including one from `managed-mcp.json`, Claude Code runs the three checks below in order. It runs them again when a user reconnects a server or turns a disabled one back on in `/mcp`. In-process `type: "sdk"` servers, which the [app that started the session registers](</docs/en/mcp#how-connectors-reach-claude-code>), skip all three. - - 1. **Merge the lists.** Allowlist and denylist entries from every settings scope combine into one allowlist and one denylist. When `allowManagedMcpServersOnly` is `true`, only the managed allowlist is kept; the denylist always merges from every scope. When more than one managed source is present, [Keys read from every admin source](</docs/en/managed-settings#keys-read-from-every-admin-source>) says which of them supply the managed scope’s lists. - 2. **Check the denylist.** A server that matches any denylist entry, by URL, command, or name, is blocked. Nothing overrides a denylist match. - 3. **Check the allowlist.** If `allowedMcpServers` isn’t set anywhere, every server that passed the denylist loads. If it is set, what the server must match depends on its type, shown in the table below. Three groups of servers skip this check: - * The organization’s own servers: every `managedMcpServers` entry, and any `managed-mcp.json` entry whose values use no `${VAR}` expansion. - * Built-in servers, such as Claude in Chrome, the `ide` server Claude Code connects to in a running VS Code or JetBrains IDE, and servers the CLI itself configures. - * A [Claude Tag](</docs/en/claude-tag>) session’s Slack tools: the servers it uses to read the thread and post its replies load without an allowlist entry. -A `managed-mcp.json` server that uses `${VAR}` expansion in its command, arguments, `env`, URL, or headers is still checked. So is every server a user, a plugin, or claude.ai adds, and every server a user passes with `--mcp-config`. - -Server type| Allowed when it matches ----|--- -Remote (HTTP or SSE)| A `serverUrl` entry. A `serverName` match counts only when the allowlist contains no `serverUrl` entries -Stdio| A `serverCommand` entry. A `serverName` match counts only when the allowlist contains no `serverCommand` entries - -Three matching rules apply inside those checks: +#### + +​ + +How `serverCommand` entries match + +A `serverCommand` entry holds the command and its arguments as one array, as in `{ "serverCommand": ["npx", "-y", "server"] }`. Claude Code compares that array with the command and arguments in the server’s configuration: * **Commands match exactly.** Every argument, in order. `["npx", "-y", "server"]` does not match `["npx", "server"]` or `["npx", "-y", "server", "--flag"]`. - * **`serverCommand` and `serverUrl` values expand before matching.** Both the policy entry and the server’s configured value go through [`${VAR}` and `${VAR:-default}` expansion](</docs/en/mcp#environment-variable-expansion-in-mcp-json>), so an entry written as `["${HOME}/bin/server"]` matches a server config that uses either the same reference or the expanded path. On Windows, reference an environment variable that is set there, such as `${USERPROFILE}` instead of `${HOME}`. `serverName` values match literally and never expand. The two sides read different environments; How policy entries expand covers which, and how allowlist and denylist entries differ. - * **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`env` block isn’t compared.** `["node", "server.js"]` matches a server that runs that command with any `env` values. Some environment variables change what `node` loads at startup. To set the `env` values yourself, define the server in `managed-mcp.json`. + +#### + +​ + +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: Pattern| Allows ---|--- @@ -345,16 +345,52 @@ ​ -How policy entries expand - -The server’s configured value expands from the live process environment, like the rest of `.mcp.json`. A policy entry expands from a pinned environment instead, so a variable set by a project or user settings file can’t change what an allowlist entry means. Because a policy entry still depends on the launching shell’s value for any variable it references, use literal URLs and commands for entries you rely on for enforcement. +Environment variables in `serverCommand` and `serverUrl` entries + +`serverCommand` and `serverUrl` values expand before matching. Both the policy entry and the server’s configured value go through [`${VAR}` and `${VAR:-default}` expansion](</docs/en/mcp#environment-variable-expansion-in-mcp-json>), so an entry written as `["${HOME}/bin/server"]` matches a server config that uses either the same reference or the expanded path. `serverName` values match literally and never expand. The two sides read different environments: + + * **The server’s configured value** : expands from the live process environment, like the rest of `.mcp.json` + * **A policy entry** : expands from a pinned environment, so a variable set by a project or user settings file can’t change what an allowlist entry means + +Because a policy entry still depends on the launching shell’s value for any variable it references, use literal URLs and commands for entries you rely on for enforcement. On Windows, reference an environment variable that is set there, such as `${USERPROFILE}` instead of `${HOME}`. The two lists expand differently: Entry list| Expands from| Expansion that would change a URL entry’s scheme, host, or path scope ---|---|--- `allowedMcpServers`| The environment Claude Code started with, plus `env` values from managed settings| Claude Code ignores the entry `deniedMcpServers`| The same, and a variable with no startup value and no `:-default` fills from settings files outside the repository, such as user or managed settings, which only ever widens what the entry matches| The entry still matches -Requires Claude Code v2.1.219 or later. +The pinned environment and the rules in this table require Claude Code v2.1.219 or later. + +### + +​ + +How a server is evaluated + +Before loading a server, including one from `managed-mcp.json`, Claude Code runs the three checks below in order. It runs them again when a user reconnects a server or turns a disabled one back on in `/mcp`. In-process `type: "sdk"` servers, which the [app that started the session registers](</docs/en/mcp#how-connectors-reach-claude-code>), skip all three. + + 1. **Merge the lists.** Allowlist and denylist entries from every settings scope combine into one allowlist and one denylist. When `allowManagedMcpServersOnly` is `true`, only the managed allowlist is kept; the denylist always merges from every scope. When more than one managed source is present, [Keys read from every admin source](</docs/en/managed-settings#keys-read-from-every-admin-source>) says which of them supply the managed scope’s lists. + 2. **Check the denylist.** A server that matches any denylist entry, by URL, command, or name, is blocked. Nothing overrides a denylist match. + 3. **Check the allowlist.** Some servers skip this check. If `allowedMcpServers` isn’t set anywhere, every server that passed the denylist loads. If it is set, what the server must match depends on its type, shown in the table below. + +Server type| Allowed when it matches +---|--- +Remote (HTTP or SSE)| A `serverUrl` entry. A `serverName` match counts only when the allowlist contains no `serverUrl` entries +Stdio| A `serverCommand` entry. A `serverName` match counts only when the allowlist contains no `serverCommand` entries + +#### + +​ + +Servers that skip the allowlist check + +Three groups of servers skip the allowlist check, in addition to the in-process `type: "sdk"` servers that skip all three checks: + + * The organization’s own servers: every `managedMcpServers` entry, and any `managed-mcp.json` entry whose values use no `${VAR}` expansion. + * Built-in servers, such as Claude in Chrome, the `ide` server Claude Code connects to in a running VS Code or JetBrains IDE, and servers the CLI itself configures. + * A [Claude Tag](</docs/en/claude-tag>) session’s Slack tools: the servers it uses to read the thread and post its replies load without an allowlist entry. + +A `managed-mcp.json` server that uses `${VAR}` expansion in its command, arguments, `env`, URL, or headers is still checked. Claude Code also checks every server a user, a plugin, or claude.ai adds, and every server a user passes with `--mcp-config`. ###
modified Deploy managed settings View current →
--- a/managed-settings.md +++ b/managed-settings.md @@ -225,6 +225,7 @@ * Claude Code enforces the `forceLoginOrgUUID` or `allowedMcpServers` value in the managed settings it applies and blocks a parent-supplied one. Outside the MCP allowlist lock, a value in a lower admin source that Claude Code doesn’t apply neither applies nor blocks the parent’s. On Claude Code v2.1.273 or later, while `allowManagedMcpServersOnly` is on, the `allowedMcpServers` list from the highest-ranked admin source that sets one applies and blocks the parent’s, as a cross-source key. The parent’s list applies only when no admin source sets one. The [`managedSourcesBehavior`](</docs/en/settings-reference#managedsourcesbehavior>) entry says which source supplies each key under `"merge"`. Before v2.1.223, a value in any admin source blocked the parent’s * For `availableModels`, Claude Code enforces the value in the managed settings it applies and blocks a parent-supplied list * For `strictKnownMarketplaces`, Claude Code likewise enforces the list in the managed settings it applies and blocks a parent-supplied one. The parent’s list applies only when no applied managed source sets one. Requires Claude Code v2.1.282 or later + * For `allowedProviders`, a list in the selected managed source blocks a parent-supplied one, and under the [`managedSourcesBehavior`](</docs/en/settings-reference#managedsourcesbehavior>) `"merge"` opt-in a list in any admin source does. Requires Claude Code v2.1.285 or later * A parent-supplied `blockedMarketplaces` applies in addition to any blocklist that a managed source sets. Requires Claude Code v2.1.282 or later #### @@ -257,6 +258,7 @@ A developer’s own settings files, `--settings` values, and project files never override a managed value; the [exceptions](</docs/en/settings#exceptions-to-managed-settings-precedence>) only let a stricter lower-level value count. These cases sit outside that rule: * **The model for a session** : a managed `model` is a default, not a lock. `--model` and `ANTHROPIC_MODEL` still pick the model for that session, so deploy [`availableModels`](</docs/en/settings-reference#availablemodels>) to restrict the choice. + * **The auto-compact window for a session** : a managed [`autoCompactWindow`](</docs/en/settings-reference#autocompactwindow>) is a default too. The `--autocompact` flag and the `CLAUDE_CODE_AUTO_COMPACT_WINDOW` variable still set the [auto-compact window](</docs/en/model-config#set-the-auto-compact-window>) for that session. * **Local admin rights** : a developer who is an administrator on the machine can edit the managed source itself, which is why MDM tooling can redeploy the profile or file on a schedule and why the HKLM registry and the macOS managed preferences domain exist. * **The server-managed cache** : server-managed settings come from Anthropic’s servers, and an edit to the local cache [lasts only until the next successful fetch](</docs/en/server-managed-settings#security-considerations>). * **Other tools** : managed settings bind Claude Code only. A developer who calls the API from another tool isn’t under them. @@ -342,7 +344,7 @@ Field| Behavior when present but invalid ---|--- -`allowedMcpServers`| Enforced as an empty allowlist until the value is fixed, so no MCP servers that users add are admitted. Servers your organization delivers through [`managedMcpServers`](</docs/en/settings-reference#managedmcpservers>) still load, and `managed-mcp.json` servers load per [How a server is evaluated](</docs/en/managed-mcp#how-a-server-is-evaluated>). An individual invalid entry is stripped and the valid subset is enforced. +`allowedMcpServers`| Enforced as an empty allowlist until the value is fixed, so no MCP servers that users add are admitted. Servers your organization delivers through [`managedMcpServers`](</docs/en/settings-reference#managedmcpservers>) still load, and `managed-mcp.json` servers load per [Servers that skip the allowlist check](</docs/en/managed-mcp#servers-that-skip-the-allowlist-check>). An individual invalid entry is stripped and the valid subset is enforced. [`allowedProviders`](</docs/en/settings-reference#allowedproviders>)| Enforced as an empty allowlist until the value is fixed, so every API provider is refused and Claude Code doesn’t start on the machine. If only an individual entry isn’t a known provider name, Claude Code drops and reports that entry and enforces the rest. `allowedHttpHookUrls`| Claude Code enforces an empty managed [allowlist](</docs/en/settings-reference#allowedhttphookurls>) until you fix the value, so an HTTP hook runs only if another settings file lists its URL. If only an individual entry is invalid, Claude Code strips that entry and enforces the rest. `httpHookAllowedEnvVars`| Claude Code enforces an empty managed [allowlist](</docs/en/settings-reference#httphookallowedenvvars>) until you fix the value, so a header variable is interpolated only if another settings file names it. If only an individual entry is invalid, Claude Code strips that entry and enforces the rest.
modified Plugin manifest reference View current →
--- a/manifest-reference.md +++ b/manifest-reference.md @@ -183,7 +183,7 @@ `version` -A version string, not checked against semver. Setting it pins the plugin to that version until you change it; see [Versions and updates](</docs/en/plugins/loading#versions-and-updates>). A plugin with a [`command` source](</docs/en/plugins/marketplace-reference>), a plugin from a [marketplace hosted on claude.ai](</docs/en/plugins/install#add-from-claude-ai>), and a plugin [loaded in place](</docs/en/plugins/loading#find-plugins-on-disk>) from a marketplace added as a local directory aren’t pinned by this field. +A version string, not checked against semver. Setting it pins the plugin to that version until you change it; see [Versions and updates](</docs/en/plugins/loading#versions-and-updates>). A plugin with a [`command` source](</docs/en/plugins/marketplace-reference>), a plugin from a [marketplace hosted on claude.ai](</docs/en/plugins/install#add-from-claude-ai>), and a plugin [loaded in place](</docs/en/plugins/loading#find-plugins-on-disk>) from a marketplace added from a local path aren’t pinned by this field. ###
modified Connect to external tools with MCP View current →
--- a/mcp.md +++ b/mcp.md @@ -877,6 +877,18 @@ ​ +A tool is missing from an SDK MCP server + +In the TypeScript SDK, when a tool’s input schema can’t be converted to JSON Schema, the server you created with [`createSdkMcpServer()`](</docs/en/agent-sdk/typescript#createsdkmcpserver>) leaves that tool out when it lists its tools. The SDK emits a warning at that point. Under Node.js the warning is a process warning with code `CLAUDE_SDK_MCP_TOOL_SCHEMA_UNCONVERTIBLE`, and it starts with this text: + + Tool "<name>" on SDK MCP server "<server>" was left out of the server's tool list, because its input schema cannot be converted to JSON Schema + +The rest of the warning gives the conversion error’s message when it has one, then says what to check and change. Before TypeScript Agent SDK v0.3.286, one unconvertible schema made the server’s whole tool listing fail without this warning, so none of that server’s tools reached Claude. + +### + +​ + Connection timeouts MCP server connections time out after 30 seconds by default. To change how long a running tool call may take, set [`MCP_TOOL_TIMEOUT`](</docs/en/env-vars>). If your server takes longer to start, the connection fails. Raise the connection limit with the [`MCP_TIMEOUT`](</docs/en/env-vars>) environment variable, in milliseconds. For servers that need more startup time, also consider:
modified Model configuration View current →
--- a/model-config.md +++ b/model-config.md @@ -211,6 +211,7 @@ * **Automatic model fallback** : a fallback whose target is excluded does not run, so the flagged request ends with a refusal instead * **[Auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier’s Claude Sonnet 5 default applies only when the allowlist permits Sonnet 5. When it’s excluded, the classifier runs on the session’s model, which the allowlist already governs, or on an Opus model when the session runs on a Fable model. On providers other than the Anthropic API, that Opus fallback runs on the model you set in `ANTHROPIC_DEFAULT_OPUS_MODEL` or otherwise on Opus 5, without consulting the allowlist. Requires Claude Code v2.1.210 or later * **[Fast mode](</docs/en/fast-mode>)** : enabling fast mode is refused when the model the session would run on afterward is outside the allowlist + * **Availability fallback on Amazon Bedrock and Google Cloud’s Agent Platform** : when your account loses access to a model mid-session, the switch to another model skips excluded models. The startup model checks on [Amazon Bedrock](</docs/en/amazon-bedrock#when-your-organization-enforces-a-model-allowlist>) and [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai#when-your-organization-enforces-a-model-allowlist>) skip excluded models only when managed settings also set `enforceAvailableModels` { "availableModels": ["sonnet", "haiku"] @@ -612,7 +613,7 @@ ---|--- 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. Other values apply only with a fixed thinking budget +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.
modified Monitoring View current →
--- a/monitoring-usage.md +++ b/monitoring-usage.md @@ -308,7 +308,24 @@ `num_non_blocking_error`| Count of hooks that failed without blocking| `num_cancelled`| Count of hooks cancelled before completion| -Additional content-bearing attributes such as `new_context`, `system_prompt_preview`, `user_system_prompt`, `tool_input`, and `response.model_output` are emitted only when detailed beta tracing is active. They are not part of the stable span schema.The gate on `new_context` depends on which span carries it, and each copy is truncated at the content limit (60 KB by default). On the `claude_code.tool` span it carries that tool call’s result, whatever the tool, and requires `OTEL_LOG_TOOL_CONTENT=1`. On the `claude_code.interaction` span it carries the user prompt, and on the `claude_code.llm_request` span the new user messages and tool results of that request. Both of those require `OTEL_LOG_USER_PROMPTS=1`.`user_system_prompt` additionally requires `OTEL_LOG_USER_PROMPTS=1`. It carries only the system prompt text you provide via the `systemPrompt` SDK option or `--system-prompt` and `--append-system-prompt` flags, truncated at the content limit (60 KB by default), and is emitted once per session rather than per request. +**Content attributes under detailed beta tracing** + +Additional content-bearing attributes such as `new_context`, `system_reminders`, `system_prompt_preview`, `user_system_prompt`, `tool_input`, and `response.model_output` are emitted only when detailed beta tracing is active. They are not part of the stable span schema. + +These attributes appear on the spans below, and `Gated by` names the variable an attribute needs on top of detailed beta tracing. Values longer than the content limit (60 KB by default) are truncated. + +Attribute| Span| Description| Gated by +---|---|---|--- +`new_context`| `claude_code.interaction`| The user prompt| `OTEL_LOG_USER_PROMPTS` +`new_context`| `claude_code.llm_request`| The new user messages and tool results sent with the request| `OTEL_LOG_USER_PROMPTS` +`system_reminders`| `claude_code.llm_request`| The text of the [system reminders](</docs/en/glossary#system-reminder>) among the request’s new messages| `OTEL_LOG_USER_PROMPTS` +`system_prompt_preview`| `claude_code.llm_request`| First 500 characters of the complete system prompt sent with the request| `OTEL_LOG_USER_PROMPTS` +`user_system_prompt`| `claude_code.llm_request`| Only the system prompt text you provide via the `systemPrompt` SDK option or `--system-prompt` and `--append-system-prompt` flags. Emitted once per session rather than per request| `OTEL_LOG_USER_PROMPTS` +`response.model_output`| `claude_code.llm_request`| Text of the model’s response to the request| `OTEL_LOG_USER_PROMPTS` +`new_context`| `claude_code.tool`| The tool call’s result, whatever the tool| `OTEL_LOG_TOOL_CONTENT` +`tool_input`| `claude_code.tool`| The tool call’s serialized input| `OTEL_LOG_TOOL_DETAILS` + +Under detailed beta tracing with `OTEL_LOG_USER_PROMPTS=1`, Claude Code also emits a `claude_code.system_prompt` event that carries the complete system prompt, truncated at the content limit. It arrives the first time a session sends each distinct system prompt, and again after compaction. ### @@ -711,6 +728,7 @@ * `event.sequence`: per-process counter for ordering events, described under Event correlation attributes * `prompt_length`: Length of the prompt * `prompt`: Prompt content. Redacted by default. Set `OTEL_LOG_USER_PROMPTS=1` to include it + * `prompt_text`: Same value as `prompt`, redacted under the same gate. A backend that stores dotted attribute names as nested objects reads `prompt.id` as `id` inside an object named `prompt` and can lose the prompt string. Read `prompt_text` there instead. Requires Claude Code v2.1.287 or later * `message.uuid`: UUID of the resulting user message, matching the persisted transcript entry. Absent on command dispatches, which can produce zero or many messages. Requires Claude Code v2.1.214 or later * `command_name`: Command name when the prompt invokes one. Built-in and bundled command names such as `compact` or `debug` are emitted as-is; aliases such as `reset` emit as typed rather than the canonical name. Custom, plugin, and MCP command names collapse to `custom` or `mcp` unless `OTEL_LOG_TOOL_DETAILS=1` is set * `command_source`: Origin of the command when present: `builtin`, `custom`, or `mcp`. Plugin-provided commands report as `custom` @@ -1560,14 +1578,26 @@ * OpenTelemetry export to your backend is opt-in and requires explicit configuration. For Anthropic’s separate operational telemetry and how to disable it, see [Data usage](</docs/en/data-usage#telemetry-services>) * Raw file contents and code snippets are not included in metrics or events. Trace spans are a separate data path: see the `OTEL_LOG_TOOL_CONTENT` bullet below * When authenticated via OAuth, `user.email` is included in telemetry attributes, sent only to the OTel endpoint you configure, never to Anthropic. If this is a concern for your organization, work with your telemetry backend to filter or redact this field - * User prompt content is not collected by default. Only prompt length is recorded. To include prompt content, set `OTEL_LOG_USER_PROMPTS=1`. Under detailed beta tracing this variable reaches further than prompt text: it also gates the `new_context` span attribute, which carries tool results on the `claude_code.llm_request` span - * Assistant response text is not collected by default. Only response length is recorded. To include response text, set `OTEL_LOG_ASSISTANT_RESPONSES=1`. Like all OpenTelemetry data from Claude Code, the response text is sent only to the OTel endpoint you configure, never to Anthropic. When this variable is unset, `OTEL_LOG_USER_PROMPTS` is used as a fallback, so set `OTEL_LOG_ASSISTANT_RESPONSES=0` if you want prompt content without response content + * User prompt content is not collected by default. Only prompt length is recorded. To include prompt content, set `OTEL_LOG_USER_PROMPTS=1`. When enabled: + * `user_prompt` events carry the prompt text in two attributes, `prompt` and `prompt_text`. If you drop or mask the event’s prompt text by attribute name in your collector, name both attributes in the rule This OpenTelemetry Collector `attributes` processor deletes both attributes in the pipelines that list it: + + processors: + attributes/drop-prompt-text: + actions: + - key: prompt + action: delete + - key: prompt_text + action: delete + + * With tracing on, the `claude_code.interaction` span carries the prompt text in its `user_prompt` attribute + * Under detailed beta tracing, spans also carry the new user messages, tool results, and system reminders sent with each request, system prompt text, and model output. Content attributes under detailed beta tracing lists each attribute. The `claude_code.system_prompt` event carries the complete system prompt + * Assistant response text is not collected by default. Only response length is recorded. To include response text, set `OTEL_LOG_ASSISTANT_RESPONSES=1`. Like all OpenTelemetry data from Claude Code, the response text is sent only to the OTel endpoint you configure, never to Anthropic. When this variable is unset, `OTEL_LOG_USER_PROMPTS` is used as a fallback, so set `OTEL_LOG_ASSISTANT_RESPONSES=0` if you want prompt content without response content in events. Under detailed beta tracing, the `claude_code.llm_request` span still carries model output in `response.model_output`, which follows `OTEL_LOG_USER_PROMPTS` rather than this variable * Tool input arguments and parameters are not logged by default. To include them, set `OTEL_LOG_TOOL_DETAILS=1`. For Claude Desktop’s built-in servers, in sessions Claude Desktop owns, `tool_decision` and `tool_result` carry the `mcp_server_name`/`mcp_tool_name` pair, host-authored names rather than argument content, even with the flag off. The exception requires Claude Code v2.1.214 or later. This data is sent only to the OTEL endpoint you configure, never to Anthropic. Arguments may still contain sensitive values, so configure your telemetry backend to filter or redact these attributes as needed. When enabled: * `tool_result` and `tool_decision` events include a `tool_parameters` attribute with Bash commands, MCP server and tool names, and skill names. Fields such as `full_command` are emitted untruncated * `tool_result` events additionally include a `tool_input` attribute with file paths, URLs, search patterns, and other arguments. Individual values over 512 characters are truncated and the total is bounded to ~4 K characters * `user_prompt` events include the verbatim `command_name` for custom, plugin, and MCP commands * The cost and token counters and the `api_request`, `api_error`, and `api_refusal` events carry real agent, skill, plugin, and MCP server and tool names in their attribution attributes - * Trace spans include the same `tool_input` attribute and input-derived attributes such as `file_path`, with the same truncation as `tool_input` + * The `claude_code.tool` span carries input-derived attributes such as `file_path`. Under detailed beta tracing it also carries a `tool_input` attribute * Tool content is not logged in trace spans by default. To include it, set `OTEL_LOG_TOOL_CONTENT=1`. The `claude_code.tool` span then carries a `tool.output` span event with raw file contents, Bash command output, and what MCP tools, WebFetch, and WebSearch return, truncated at the content limit (60 KB by default) per attribute. Results from MCP tools, WebFetch, and WebSearch require Claude Code v2.1.283 or later. Tool content also reaches spans through `new_context`, whose gate differs per span. Configure your telemetry backend to filter or redact these attributes as needed * Raw Anthropic Messages API request and response bodies are not logged by default. To include them, set `OTEL_LOG_RAW_API_BODIES` in your shell, user settings, or managed settings. It’s ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). The bodies contain the full conversation history, including the system prompt, every prior user and assistant turn, and tool results, so enabling this implies consent to everything the other `OTEL_LOG_*` content flags would reveal. Claude Code always redacts Claude’s extended-thinking content from these bodies, regardless of other settings. The value you set determines how Claude Code delivers the bodies: * With `=1`, Claude Code emits `api_request_body` and `api_response_body` log events for each API call. The events’ `body` attribute carries the JSON-serialized payload, truncated at the content limit (60 KB by default)
modified Choose a permission mode View current →
--- a/permission-modes.md +++ b/permission-modes.md @@ -73,7 +73,7 @@ `claude -p` or the [Agent SDK](</docs/en/agent-sdk/permissions#permission-modes>)| `default` in sessions that [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>). In sessions that don’t, such as on a third-party provider or with telemetry off, `auto` with Claude Code v2.1.285 or later and `default` on earlier versions. A session in an organization whose policy withholds the `auto` default starts in `default` instead In a terminal or through the [VS Code extension](</docs/en/vs-code>)| `auto` with Claude Code v2.1.283 or later; on earlier versions, `auto` on Pro, Max, or Team plans in sessions that [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), and `default` otherwise -In your [first session after an install or upgrade](</docs/en/env-vars#first-session-after-an-install-or-upgrade>), Claude Code can choose the starting permission mode before its feature flags arrive. That session can start in a different permission mode than the table gives, and your next session matches the table. When the flag, a settings file, or the built-in default selects `auto` but auto mode isn’t available to the session, Claude Code starts the session in Manual instead. Auto mode is unavailable when the session doesn’t meet the availability requirements, such as a settings file turning it off or a model that doesn’t support it, or when Anthropic has temporarily turned it off server-side. The first time the built-in default starts one of your sessions in auto mode, Claude Code shows a notice that links to this page: +In your [first session after an install or upgrade](</docs/en/env-vars#first-session-after-an-install-or-upgrade>), Claude Code can choose the starting permission mode before its feature flags arrive. That session can start in a different permission mode than the table gives. When the flag, a settings file, or the built-in default selects `auto` but auto mode isn’t available to the session, Claude Code starts the session in Manual instead. Auto mode is unavailable when the session doesn’t meet the availability requirements, such as a settings file turning it off or a model that doesn’t support it, or when Anthropic has temporarily turned it off server-side. The first time the built-in default starts one of your sessions in auto mode, Claude Code shows a notice that links to this page: * In a terminal, once, at the top of the session * In the VS Code extension, as a card on the new-conversation screen that stays until you dismiss it @@ -534,7 +534,7 @@ * `.devcontainer` * `.yarn` * `.mvn` - * `.claude`, except for `.claude/worktrees` where Claude stores its own git worktrees + * `.claude`, except for `.claude/worktrees` where Claude stores its own git worktrees, and except for the markdown files in Claude’s own [auto memory](</docs/en/memory#storage-location>) directory in a session started without `--restricted` * A directory you loaded with [`--plugin-dir`](</docs/en/plugins/mods/create#change-a-mod-with-claude>), because Claude Code reloads and runs a mod’s code from it when a file changes Protected files: @@ -601,9 +601,11 @@ Claude Code also looks inside these constructs: * **Nested commands** : a subshell with `(...)`, a brace group with `{ ...; }`, command substitution with `$(...)` or backticks, or process substitution with `<(...)`. Claude Code finds a critical-path removal whether it sits inside the nested form, as in `(rm -rf ~)` or `echo "$(rm -rf ~)"`, or elsewhere in the same command. - * **Inline scripts** : Claude Code checks a script passed to a shell such as `sh -c` or `bash -c` for the shell variable and positional parameter targets. + * **Inline scripts** : a script passed to `sh`, `bash`, `zsh`, or a similar POSIX shell with `-c`, as in `bash -c 'rm -rf ~'`. * When the script is double-quoted, the invoking shell expands its variables before the inner shell receives the script. In `find . -name '*.tmp' -exec sh -c "rm -rf \"$1\"/*" _ {} \;`, the command expands to a removal from the filesystem root once per match, and Claude Code treats it as a critical-path removal. * A single-quoted script that binds `$1` to a real value, as `sh -c 'rm -rf "$1"/*' _ {}` does, isn’t flagged. + +To turn off the check on a critical path typed directly in a `-c` script, such as `~`, set [`CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT=1`](</docs/en/env-vars#variables>) in the environment that launches Claude Code. ###
modified Mods reference View current →
--- a/reference.md +++ b/reference.md @@ -1,4 +1,4 @@ -Look up any event a [mod](</docs/en/plugins/mods/overview>) can handle, mods API method it can call, or render site it can draw in, for the Claude Code CLI and the Desktop app as of v2.1.287. Each entry gives the name and a one-line description, and links to the guide section that explains it where there is one. +Look up any event a [mod](</docs/en/plugins/mods/overview>) can handle, mods API method it can call, or render site it can draw in, for the Claude Code CLI and the Desktop app as of v2.1.289. Each entry gives the name and a one-line description, and links to the guide section that explains it where there is one. The complete reference is Claude Code’s [TypeScript declarations for mods](<https://github.com/anthropics/claude-code/blob/main/mods/types/claude-code.d.ts>), which describe every event, method, and element, with examples. The copy on GitHub can be older than the Claude Code version you have installed. When the two disagree, trust [the copy Claude Code writes for your version](</docs/en/plugins/mods/create#get-the-types-for-your-build>). @@ -134,12 +134,12 @@ Subagents -Subagent events fire when a subagent type is offered to Claude and when one is about to start: +Subagent events fire when a subagent type is offered to Claude and when a subagent or an agent-team teammate is about to start: Event| Fires when| A hook can return ---|---|--- `agent.offer`| A subagent type is offered to Claude| `{ isOffered: false }` to withhold it -`agent.spawn`| A subagent is about to start| `{ model }` or `{ deny: reason }` +`agent.spawn`| A subagent or an [agent team](</docs/en/agent-teams>) teammate is about to start. For a teammate, `e.isTeammate` is `true`.| `next({ ...e, model })` to choose its model, or `{ deny: reason }` ### @@ -157,6 +157,7 @@ `ui.focus`, `ui.scroll`| The focused control or the scroll position of a pane or the band is about to change `ui.close`| A pane is about to close. `e.id` is the pane and `e.origin.kind` is `plugin`, `person`, or `unload`. [`ui.message`](</docs/en/plugins/mods/interface#build-a-tree-from-elements>)| A `Client` element posts data to its mod +[`ui.fault`](</docs/en/plugins/mods/interface#redraw-when-something-changes>)| A `Client` element your mod drew failed to load, draw, or run. `e.phase` is `load`, `render`, or `run`, and `e.reason` is the error message. Requires Claude Code v2.1.289 or later. ### @@ -210,7 +211,7 @@ Namespace| Methods ---|--- `$.plugin`| `name`, `root`: this plugin’s name and directory -[`$.ui`](</docs/en/plugins/mods/interface#pick-where-to-draw>)| `resolve`, `invalidate`, `open`, `close`, `panes`, `focus`, `scroll`, `toast`, `status`, `log`, `notice`, `ask`, `copy`, `blit` +[`$.ui`](</docs/en/plugins/mods/interface#pick-where-to-draw>)| `resolve`, `invalidate`, `open`, `close`, `panes`, `focus`, `scroll`, `toast`, `status`, `log`, `notice`, `ask`, `copy`, `selection`, `blit` [`$.command`](</docs/en/plugins/mods/api#add-a-command>)| `register`, `run`, `list` [`$.tool`](</docs/en/plugins/mods/api#add-a-tool>)| `register`, `call`, `check`, `list` `$.agent`| `register`, `spawn`, `list` @@ -298,9 +299,9 @@ Limit| Value ---|--- -A hook’s own execution time for one event, not counting time inside `next` or a mods API call other than `$.clock.sleep`| 10 seconds +A hook’s own execution time for one event, not counting time inside `next` or a mods API call other than `$.clock.sleep`| 10 seconds, or 50 milliseconds for a `prompt.edit` hook A `.catch` handler’s execution time| 1 second -All `session.end` hooks together| 1.5 seconds +All `session.end` hooks together| As long as the [SessionEnd hook budget](</docs/en/hooks#sessionend-input>), 1.5 seconds unless you change it, counted from when your settings `SessionEnd` hooks finish `$.process.run` timeout| 30 seconds by default, 10 minutes at most `$.model.complete` `maxTokens`| 1024 by default, up to 64,000 or the model’s output limit `$.fs.read` and `$.fs.write`| 4 MiB for one file
modified Configure the sandboxed Bash tool View current →
--- a/sandboxing.md +++ b/sandboxing.md @@ -387,7 +387,7 @@ When you mask a credential, Claude Code shows sandboxed commands a per-session placeholder called the sentinel, and the sandbox proxy substitutes the real value on outbound requests to hosts you allow. A `deny` entry under Protect credentials blocks the credential instead. For files on macOS, Claude Code blocks the file instead of masking it. The [`sandbox.credentials`](</docs/en/settings-reference#sandbox-credentials>) reference lists every field. Masking requires the following: - * **TLS termination** : the proxy substitutes the real value inside request contents, so it has to see them. Set [`network.tlsTerminate`](</docs/en/settings-reference#sandbox-network-tlsterminate>) so the proxy terminates TLS itself. Without it, masking fails without exposing anything: the command still sees only the sentinel, but the sentinel reaches the server unchanged and authentication fails. Claude Code reports this misconfiguration at startup. + * **TLS termination** : the proxy substitutes the real value inside request contents, so it has to see them. Set [`network.tlsTerminate`](</docs/en/settings-reference#sandbox-network-tlsterminate>) so the proxy terminates TLS itself. Without it, masking fails without exposing anything: the command still sees only the sentinel, but the sentinel reaches the server unchanged and authentication fails. To check for this misconfiguration, run `claude doctor` in your terminal and look for the `TLS termination is unavailable` warning. * **An allowed destination** : each `mask` entry can list `injectHosts`, the hosts the real value is allowed to reach. The proxy injects only on connections the domain allowlist admits, so each `injectHosts` host must also be reachable through `network.allowedDomains`. For a `mask` entry with no `injectHosts`, the proxy substitutes the real value on requests to every host in `network.allowedDomains`. * **A trusted settings scope** : masking authorizes the proxy to send your real credential somewhere, so Claude Code honors `mask` entries, `network.tlsTerminate`, [`credentials.allowPlaintextInject`](</docs/en/settings-reference#sandbox-credentials-allowplaintextinject>), `awsPairs`, and `sigv4` only from user settings, managed settings, and the `--settings` flag. It ignores them in a repository’s `.claude/settings.json` or `.claude/settings.local.json`. When your administrator delivers `mask` entries, `network.tlsTerminate`, or `credentials.allowPlaintextInject` through server-managed settings, they count as [settings that need approval](</docs/en/server-managed-settings#security-approval-dialogs>).
modified Deploy self-hosted environments to production View current →
--- a/self-hosted-environments-deploy.md +++ b/self-hosted-environments-deploy.md @@ -178,6 +178,23 @@ The Kubernetes and Docker Compose recipes on this page use `--capacity 4`. If you add `--use-anthropic-git-proxy` or `CLAUDE_RUNNER_USE_GIT_PROXY=1` to one of them without changing the capacity to `1`, the runner exits at startup every time your orchestrator restarts it. Set `--capacity 1` and run more replicas for parallelism. When the runner exits shows the line the runner prints. The runner also reports the opt-in to Anthropic when it registers, printing `Registering as opted in to Anthropic-managed git (--use-anthropic-git-proxy)` at startup. Reporting the opt-in requires Claude Code v2.1.267 or later, and earlier versions accept the flag without reporting it or printing that line. Each session on an opted-in runner then uses either Anthropic-managed git or the per-session proxy URL. When a session uses the per-session proxy URL, the runner logs one `[runner:warn]` line saying so. + +#### + +​ + +GitHub API access without the GitHub CLI + +If your runner image doesn’t include the GitHub CLI, Claude Code can provide a built-in `gh`, so Claude can still open pull requests, comment, and read CI results. The built-in `gh` is for runners that use Anthropic-managed git. It supports one command, `gh api`, which calls GitHub’s REST API. Requires Claude Code v2.1.287 or later in the runner image. This command opens a pull request in place of `gh pr create`. The built-in `gh` fills in `{owner}` and `{repo}` for the current repository: + + gh api repos/{owner}/{repo}/pulls -f title='Fix' -f head='my-branch' -f base='main' + + * **Credentials** : the built-in `gh` sends its REST requests through Anthropic-managed git, which supplies the GitHub credential on Anthropic’s side, so the image needs no GitHub token for it + * **Which sessions get it** : Anthropic decides per session whether Anthropic-managed git serves the session’s `gh`. When it does, the `[runner:session] governed git ACTIVE` line that the runner logs for the session shows `gh_path_shim=true`. When it doesn’t, the session has no `gh` + * **`jq`** : install `jq` in the image if you want `--jq` to work + * **[`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>)** : if the session environment sets it, Claude Code doesn’t provide the built-in `gh`, and the session has no `gh` + +When the image includes the GitHub CLI, sessions use it. ####
modified Self-hosted environments quickstart View current →
--- a/self-hosted-environments-quickstart.md +++ b/self-hosted-environments-quickstart.md @@ -105,7 +105,7 @@ claude -p "your message" --cloud <session-id> -For `<session-id>`, pass the bare `session_...` or `cse_...` ID or the session’s claude.ai/code URL. A successful send prints `Sent to cloud session.` with the session ID and a view link. Accepted ID forms, JSON output, the account and policy requirements, and the error reference are on [Send follow-ups from the CLI](</docs/en/claude-code-on-the-web#send-follow-ups-from-the-cli>), since the command works the same against Anthropic-hosted sessions. +For `<session-id>`, pass the bare `session_...` or `cse_...` ID or the session’s claude.ai/code URL. A successful send prints `Sent to cloud session.` with the session ID and a view link. Accepted ID forms, JSON output, and the account and policy requirements are on [Send follow-ups from the CLI](</docs/en/claude-code-on-the-web#send-follow-ups-from-the-cli>), since the command works the same against Anthropic-hosted sessions. ##
modified All settings View current →
--- a/settings-reference.md +++ b/settings-reference.md @@ -409,7 +409,7 @@ `enforceAvailableModels` -The `/model` picker has a **Default** option, and [`default` model setting](</docs/en/model-config#default-model-setting>) describes the model it resolves to. An `availableModels` allowlist limits the models you can name, but with the default prefix matching it doesn’t remap your account type’s default, so **Default** can still resolve to a model outside the list. This key closes that gap. Requires Claude Code v2.1.175 or later. When your organization deploys any managed settings, Claude Code reads this key from the managed source alone and ignores it in your other files. +The `/model` picker has a **Default** option, and [`default` model setting](</docs/en/model-config#default-model-setting>) describes the model it resolves to. An `availableModels` allowlist limits the models you can name, but with the default prefix matching it doesn’t remap your account type’s default, so **Default** can still resolve to a model outside the list. This key closes that gap. Requires Claude Code v2.1.175 or later. When your organization deploys any managed settings, Claude Code reads this key from the managed source alone and ignores it in your other files. For how this key applies to the startup model checks, see [Amazon Bedrock](</docs/en/amazon-bedrock#when-your-organization-enforces-a-model-allowlist>) and [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai#when-your-organization-enforces-a-model-allowlist>). * **Scope** : `Any file` * **Type** : Boolean @@ -2616,7 +2616,7 @@ * [`CLAUDE_CODE_PROJECT_DIR_NAME`](</docs/en/sessions#name-the-project-directory-yourself>), which Claude Code reads from the launch environment only, is ignored from every file; requires v2.1.234 or later. * [`CLAUDE_CODE_RESTRICTED`](</docs/en/env-vars#variables>), which Claude Code reads from the launch environment only, is ignored from every file. * [`CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY`](</docs/en/env-vars#variables>), which Claude Code reads from the launch environment only, is ignored from every file. The variable requires Claude Code v2.1.283 or later. - * [`CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT` and `CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT`](</docs/en/env-vars#variables>), which Claude Code reads from the launch environment only, are ignored from every file. + * [`CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT`, `CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT`, and `CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT`](</docs/en/env-vars#variables>), which Claude Code reads from the launch environment only, are ignored from every file. ###
modified Create custom subagents View current →
--- a/sub-agents.md +++ b/sub-agents.md @@ -511,7 +511,7 @@ Implement API endpoints. Follow the conventions and patterns from the preloaded skills. -The full content of each listed skill is injected into the subagent’s context at startup. This field controls which skills are preloaded, not which skills the subagent can access: without it, the subagent can still discover and invoke project, user, and plugin skills through the Skill tool during execution. To prevent a subagent from invoking skills entirely, omit `Skill` from the `tools` list or add it to `disallowedTools`. You can’t preload skills that set [`disable-model-invocation: true`](</docs/en/skills#control-who-invokes-a-skill>), since preloading draws from the same set of skills Claude can invoke. This includes the bundled `/verify` skill: only you can run it, so it can’t be preloaded either. If a listed skill is missing or disabled, for example by your organization’s policy, Claude Code skips it and logs a warning to the debug log. +The full content of each listed skill is injected into the subagent’s context at startup. This field controls which skills are preloaded, not which skills the subagent can access: without it, the subagent can still discover and invoke project, user, and plugin skills through the Skill tool during execution. To prevent a subagent from invoking skills entirely, omit `Skill` from the `tools` list or add it to `disallowedTools`. You can’t preload skills that set [`disable-model-invocation: true`](</docs/en/skills#control-who-invokes-a-skill>), since preloading draws from the same set of skills Claude can invoke. This includes the bundled `/verify` skill, which Claude can’t run on its own. If a listed skill is missing or disabled, for example by your organization’s policy, Claude Code skips it and logs a warning to the debug log. This is the inverse of [running a skill in a subagent](</docs/en/skills#run-skills-in-a-subagent>). With `skills` in a subagent, the subagent controls the system prompt and loads skill content. With `context: fork` in a skill, the skill content is injected into the agent you specify. In both cases the subagent starts without your conversation history.
modified Tools reference View current →
--- a/tools-reference.md +++ b/tools-reference.md @@ -423,6 +423,19 @@ ​ +Bash deny rules also turn off the PowerShell tool + +On Windows with Git Bash installed, denying Bash also turns the PowerShell tool off for the session. This applies to scoped rules such as `Bash(git push *)` as well as a bare `Bash`, and to rules from one of your settings files or `--disallowedTools`. Claude Code does this because a `Bash` rule doesn’t restrict the PowerShell tool, which has [its own permission rules](</docs/en/permissions#powershell>). With PowerShell left on, Claude could run there what your rule denies in Bash. To keep the PowerShell tool on alongside a Bash deny rule, do either of these: + + * Set `CLAUDE_CODE_USE_POWERSHELL_TOOL=1` in your environment or in the `env` block of a settings file, as shown in Enable the PowerShell tool. + * Add a scoped [`PowerShell` permission rule](</docs/en/permissions#powershell>) to a settings file, such as a `PowerShell(git push *)` deny rule. + +Without one of these, a scoped Bash deny rule leaves the Bash tool available, and Claude Code turns PowerShell off without a warning. A rule that removes the whole Bash tool leaves Claude with no shell tool for the session. + +### + +​ + Shell selection in settings, hooks, and skills Three additional settings control where PowerShell is used:
modified Troubleshoot the Agent SDK View current →
--- a/troubleshooting.md +++ b/troubleshooting.md @@ -3,7 +3,7 @@ Symptom| Go to ---|--- Skills not found, a skill not being used, `Invalid skill name` error| [Skills troubleshooting](</docs/en/agent-sdk/skills#troubleshooting>) -MCP server shows `failed` status, tools not being called, connection timeouts, tool output that exceeds the maximum allowed tokens| [MCP troubleshooting](</docs/en/agent-sdk/mcp#troubleshooting>) +MCP server shows `failed` status, tools not being called, a tool missing from an SDK MCP server, connection timeouts, tool output that exceeds the maximum allowed tokens| [MCP troubleshooting](</docs/en/agent-sdk/mcp#troubleshooting>) Plugin not loading, plugin skills not appearing| [Plugins troubleshooting](</docs/en/agent-sdk/plugins#troubleshooting>) Claude not delegating to subagents, filesystem-based agents not loading| [Subagents troubleshooting](</docs/en/agent-sdk/subagents#troubleshooting>) Checkpointing options not recognized, user messages without UUIDs, `No file checkpoint found`, `File rewinding is not enabled`, `ProcessTransport is not ready for writing`| [File checkpointing troubleshooting](</docs/en/agent-sdk/file-checkpointing#troubleshooting>)
modified Agent SDK reference - TypeScript View current →
--- a/typescript.md +++ b/typescript.md @@ -864,6 +864,14 @@ fast_mode_state?: "off" | "cooldown" | "on"; fast_mode_disabled_reason?: FastModeDisabledReason; hooks_applied?: boolean; + sdk_mcp_manifests_parked?: Record< + string, + | "parked" + | "already_connected" + | "protocol_version_mismatch" + | "malformed" + | "not_honoured" + >; }; `hooks_applied` reports whether Claude Code registered the `hooks` that the `initialize` request carried. The SDK sends that request once when the session starts and again on each `reinitialize()` call. The field requires Agent SDK v0.3.238 or later. Claude Code omits the field when the request carried no hooks. When the request carried hooks, the value depends on whether the request is the session’s first initialize and, for a repeated one, on how it reached the session: @@ -871,7 +879,7 @@ * `true`: Claude Code registered the hooks. A session’s first initialize returns this value. A repeated initialize sent over the CLI’s stdin also returns `true`. In that case the hooks in the new request replace the hooks registered earlier. * `false`: Claude Code ignored the hooks. A repeated initialize sent to a remote session returns this value, so a second client that joins a session can’t replace the hooks the first client registered. -Before Agent SDK v0.3.238, the response never carried the field, and Claude Code ignored `hooks` on every repeated initialize. The response always reports `fast_mode_state`, and when something blocks [fast mode](</docs/en/fast-mode>), `fast_mode_disabled_reason` carries the reason code alongside it, so you can explain the blocked state instead of re-deriving availability. Both behaviors require Claude Code v2.1.219 or later. Before v2.1.219, the response omitted `fast_mode_state` when fast mode wasn’t available and never carried a reason. For the reason codes and their meanings, see `fast_mode_disabled_reason` on the result message. The control-response wrapper for a successful `initialize` also carries a `pending_permission_requests` array. The field is on the response wrapper itself, not in the `SDKControlInitializeResponse` payload above. Each entry is a complete `control_request` message with the same `{ type: "control_request", request_id, request }` shape the session streams for permission requests while running. The array lists the permission requests that this Claude Code process has issued and not yet resolved. The SDK reads the array for you and dispatches each entry to your `canUseTool` callback, the same redelivery that `reinitialize()` triggers after a transport gap. Handle repeated request IDs idempotently, because an entry can repeat a request the callback already received before the connection dropped. The array is always present on a successful `initialize` response and is empty when this process has no unresolved permission request. Requires Claude Code v2.1.268 or later. Earlier versions could omit the field, so if you parse the wire protocol yourself, treat a missing field as an older CLI rather than as proof that nothing is pending. +Before Agent SDK v0.3.238, the response never carried the field, and Claude Code ignored `hooks` on every repeated initialize. The request’s `sdkMcpServerManifests` field and the response’s `sdk_mcp_manifests_parked` field are for the in-process [SDK MCP servers](</docs/en/agent-sdk/custom-tools>) you created with `createSdkMcpServer()`. Your application doesn’t set or read either field. The response always reports `fast_mode_state`, and when something blocks [fast mode](</docs/en/fast-mode>), `fast_mode_disabled_reason` carries the reason code alongside it, so you can explain the blocked state instead of re-deriving availability. Both behaviors require Claude Code v2.1.219 or later. Before v2.1.219, the response omitted `fast_mode_state` when fast mode wasn’t available and never carried a reason. For the reason codes and their meanings, see `fast_mode_disabled_reason` on the result message. The control-response wrapper for a successful `initialize` also carries a `pending_permission_requests` array. The field is on the response wrapper itself, not in the `SDKControlInitializeResponse` payload above. Each entry is a complete `control_request` message with the same `{ type: "control_request", request_id, request }` shape the session streams for permission requests while running. The array lists the permission requests that this Claude Code process has issued and not yet resolved. The SDK reads the array for you and dispatches each entry to your `canUseTool` callback, the same redelivery that `reinitialize()` triggers after a transport gap. Handle repeated request IDs idempotently, because an entry can repeat a request the callback already received before the connection dropped. The array is always present on a successful `initialize` response and is empty when this process has no unresolved permission request. Requires Claude Code v2.1.268 or later. Earlier versions could omit the field, so if you parse the wire protocol yourself, treat a missing field as an older CLI rather than as proof that nothing is pending. ### @@ -1895,6 +1903,8 @@ ---|--- `interrupt_receipt_v1`| `interrupt()` resolves with an `SDKControlInterruptResponse` receipt listing the messages that were pending when the interrupt arrived `interrupt_cancel_queued_v1`| The `interrupt` control request honors `cancel_queued: true`, cancelling the messages the receipt would otherwise list under `still_queued` and listing them under `cancelled` instead. See `SDKControlInterruptResponse`. Requires Claude Code v2.1.219 or later +`sdk_mcp_manifests`| The `initialize` control request accepts `sdkMcpServerManifests`, MCP handshake results captured from your in-process [SDK MCP servers](</docs/en/agent-sdk/custom-tools>). Claude Code advertises this capability in v2.1.286 or later +`sdk_mcp_tools_list_changed`| A `tools/list_changed` notification from an [SDK MCP server](</docs/en/agent-sdk/custom-tools>) makes Claude Code list that server’s tools again, so a tool the server adds mid-session reaches Claude. Claude Code advertises this capability in v2.1.286 or later The `plugin_errors` array lists plugin load failures. An entry describes either a plugin that didn’t load and is absent from `plugins`, or a plugin that loaded without one of its parts, such as its hooks file. The key is omitted when nothing failed. `SDKSystemMessage` declares `plugin_errors` in Agent SDK v0.3.283 or later. When a directory or archive from your `plugins` option itself fails to load, the entry’s `plugin` field holds a positional tag such as `inline[0]` instead of a plugin name. This happens, for example, when the path doesn’t exist or the manifest is invalid. Match such an entry to your option by its `path` field. The table below lists the fields of each `plugin_errors` entry.
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 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. If the extension doesn’t appear after installation, restart VS Code or run “Developer: Reload Window” from the Command Palette. @@ -113,12 +113,13 @@ * To report a bug, click **Report a problem** at the bottom of the menu, or type `/bug` or `/feedback` with an optional description that prefills the report. When you submit the report and you’re signed in to Anthropic on a first-party connection, Claude Code sends it to Anthropic. Requires Claude Code v2.1.229 or later. On a third-party provider, or without Anthropic credentials, nothing is sent. The dialog says so before you write. Submitting saves the report as a [local archive under `~/.claude/feedback-bundles/`](</docs/en/data-usage#telemetry-services>) with known API key and token patterns redacted. Send that file to your Anthropic account representative or attach it to a support request. The confirmation names the file and includes a **Show folder** button. Saving the report on your computer requires Claude Code v2.1.284 or later. If your organization’s policy turns product feedback off, **Report a problem** doesn’t appear in the menu, and `/bug` and `/feedback` show a `Feedback is turned off by your organization's policy or this environment's settings.` notice instead of opening the report. With Claude Code v2.1.284 or later, if you set the `DISABLE_FEEDBACK_COMMAND` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` environment variable, feedback is also turned off and opening the report shows that notice instead. * **Side questions** : type `/btw` followed by a question to ask about your session [without adding to the conversation](</docs/en/interactive-mode#side-questions-with-%2Fbtw>). The answer opens in a panel beside the chat, where you can ask follow-up questions. The thread survives window reloads. Claude Code keeps the newest 20 exchanges and expires stored threads on the [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) schedule, as long as Claude Code can [safely determine the retention period](</docs/en/claude-directory#cleaned-up-automatically>). To clear a thread, click the trash icon in the panel. Requires Claude Code v2.1.227 or later. * **Copy a response** : hover over a response and click **Copy response** to copy it to your clipboard, or type `/copy` to copy the latest response. `/copy 2` copies the second-to-last. Requires Claude Code v2.1.277 or later. + * **Bookmarks** : hover over a response and click **Bookmark response** to save it, or click **Remove bookmark** on a saved response to remove it. To review saved responses, open the Bookmarks panel: click the bookmark icon at the top of the Claude Code panel, select **Bookmarks** in the Context section of the command menu, or type `/bookmarks`. Requires Claude Code v2.1.286 or later. * **Context indicator** : the prompt box shows how much of Claude’s context window you’re using. Claude automatically compacts when needed, or you can run `/compact` manually. * **Prompt cache clock** : a clock icon next to the context indicator estimates how much time the conversation’s [prompt cache](</docs/en/prompt-caching>) has left before it expires. It counts down from the cache’s five-minute or one-hour [lifetime](</docs/en/prompt-caching#cache-lifetime>), and each response that uses the cache restarts the countdown. Apart from compaction, the [actions that invalidate the cache](</docs/en/prompt-caching#actions-that-invalidate-the-cache>) don’t reset the clock, so it can still show minutes left after you switch models. * Until the countdown runs out, the icon shows the minutes left, such as **12m**. * When the countdown runs out, the minutes disappear and the icon turns red, or your theme’s error color, until the next response. The cache has likely expired, so expect a slower, more expensive response to your next message while the cache rebuilds. If the five-minute lifetime keeps running out between your messages, see [Choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>). * Right after the conversation is [compacted](</docs/en/prompt-caching#compacting-the-conversation>), the icon also turns red without minutes until the next response, because the cache doesn’t cover the compacted conversation yet. - * **Agent map** : when the conversation includes [subagents](</docs/en/sub-agents>), an agent count such as **2 agents** appears at the bottom of the prompt box. Its dot shows whether any subagent is working or waiting for your permission. Click the agent count to open the agent map, which draws the conversation’s subagents as a tree under the main agent, each with its status, elapsed time, and token count. Click a subagent to see its prompt and tool calls, open its read-only transcript, or stop it while it runs. Requires Claude Code v2.1.269 or later. The map also lists the session’s other [background tasks](</docs/en/tools-reference#background-commands>), such as background shell commands and [monitors](</docs/en/tools-reference#monitor-tool>), below the agents. Click a row to open the task’s card and stop it there. To open the map when no agent count is showing, such as when Claude has started a background shell but no subagents, type `/tasks` in the prompt box. Background tasks in the map and the typed `/tasks` require Claude Code v2.1.277 or later. + * **Agent map** : when the conversation includes [subagents](</docs/en/sub-agents>), an agent count such as **2 agents** appears at the bottom of the prompt box. Its dot shows whether any subagent is working or waiting for your permission. Click the agent count to open the agent map, which draws the conversation’s subagents as a tree under the main agent, each with its status, elapsed time, and token count. Click a subagent to see its prompt and tool calls, open its read-only transcript, or stop it while it runs. Requires Claude Code v2.1.269 or later. The map also lists the session’s other [background tasks](</docs/en/tools-reference#background-commands>), such as background shell commands and [monitors](</docs/en/tools-reference#monitor-tool>), below the agents. Click a row to open the task’s card and stop it there. To open the map when no agent count is showing, such as when Claude has started a background shell but no subagents, type `/tasks` in the prompt box. Background tasks in the map and the typed `/tasks` require Claude Code v2.1.277 or later. With Claude Code v2.1.286 or later, when you click **Stop** or press `Esc`, the current turn ends. Background agents keep running until they finish or you stop them from the map. * **Extended thinking** : lets Claude spend more time reasoning through complex problems. Toggle it on via the command menu (`/`). Claude’s reasoning appears in the conversation as collapsed blocks: click a block to read it, or press `Ctrl+O` to expand or collapse every thinking block in the session. See [Extended thinking](</docs/en/model-config#extended-thinking>) for details. * **Multi-line input** : press `Shift+Enter` to add a new line without sending. This also works in the “Other” free-text input of question dialogs.
modified Get started with Claude Code in the cloud View current →
--- a/web-quickstart.md +++ b/web-quickstart.md @@ -53,7 +53,7 @@ Connecting GitHub is a one-time step. If you already use the GitHub CLI, you can do this from your terminal instead of the browser. -On Team and Enterprise plans, the **Sign in with GitHub** step works only after an [Owner](</docs/en/server-managed-settings#access-control>) of your Claude organization turns on the GitHub connector at [**Admin settings > Connectors**](<https://claude.ai/admin-settings/connectors>). Until then, that step shows “GitHub access is required for Claude Code on the web” instead of a sign-in button. After the connector is on, reload [claude.ai/code](<https://claude.ai/code>) and start again from the first step. A second toggle, [Quick web setup](</docs/en/claude-code-on-the-web#github-authentication-options>) at [**Admin settings > Claude Code**](<https://claude.ai/admin-settings/claude-code>), is optional: with it on, `/web-setup` works and onboarding creates the environment for members. +On Team and Enterprise plans, the **Sign in with GitHub** step works only after an [Owner](</docs/en/server-managed-settings#access-control>) of your Claude organization turns on the GitHub connector at [**Admin settings > Connectors**](<https://claude.ai/admin-settings/connectors>). Until then, that step shows “GitHub access is required for Claude Code on the web” instead of a sign-in button. After the connector is on, reload [claude.ai/code](<https://claude.ai/code>) and start again from the first step. A second toggle, [Quick web setup](</docs/en/claude-code-on-the-web#quick-web-setup-for-team-and-enterprise>) at [**Admin settings > Claude Code**](<https://claude.ai/admin-settings/claude-code>), is optional: with it on, `/web-setup` works and onboarding creates the environment for members. 1 @@ -74,7 +74,7 @@ A [cloud environment](</docs/en/cloud-environments>) is the saved configuration that controls what network access Claude has during sessions and what runs when a session starts. What happens after you connect GitHub depends on your plan: * **Pro and Max** : onboarding creates an environment named **Default** for you. - * **Team and Enterprise** : onboarding shows a **Create your first cloud environment** form. Leave the prefilled name and network access unchanged and click **Create & finish** to create the **Default** environment. If an Owner has turned on [Quick web setup](</docs/en/claude-code-on-the-web#github-authentication-options>), onboarding creates **Default** for you instead. + * **Team and Enterprise** : onboarding shows a **Create your first cloud environment** form. Leave the prefilled name and network access unchanged and click **Create & finish** to create the **Default** environment. If an Owner has turned on [Quick web setup](</docs/en/claude-code-on-the-web#quick-web-setup-for-team-and-enterprise>), onboarding creates **Default** for you instead. **Default** uses [`Trusted` network access](</docs/en/cloud-environments#access-levels>): sessions reach [common package registries](</docs/en/cloud-environments#default-allowed-domains>) and other allowlisted domains, and nothing else through the session’s network. See [Installed tools](</docs/en/cloud-environments#installed-tools>) for what’s available without any configuration.For a first project, the **Default** environment works as is. To change its network access, add environment variables, or run a [setup script](</docs/en/cloud-environments#setup-scripts>) before sessions start, [edit it or create additional environments](</docs/en/cloud-environments#configure-your-environment>). @@ -84,7 +84,7 @@ Connect from your terminal -If you already use the GitHub CLI (`gh`), you can connect GitHub for cloud sessions from your terminal. This requires the [Claude Code CLI](</docs/en/quickstart>). On Team and Enterprise plans, `/web-setup` is available only after an Owner turns on [Quick web setup](</docs/en/claude-code-on-the-web#github-authentication-options>). When you run `/web-setup`, Claude Code reads the token that `gh auth token` prints, asks you to confirm, and sends the token to Anthropic. Anthropic stores it encrypted with your claude.ai account, and your cloud sessions use it for GitHub access until you remove it. A cloud session you start yourself can then access any repository that token can access, with no Claude GitHub App installation. Threads in a [project](</docs/en/claude-projects#set-up-github-access>) still need the Claude GitHub App. If you already connected GitHub in the browser, `/web-setup` warns you that continuing replaces that connection for your cloud sessions. +If you already use the GitHub CLI (`gh`), you can connect GitHub for cloud sessions from your terminal. This requires the [Claude Code CLI](</docs/en/quickstart>). On Team and Enterprise plans, `/web-setup` is available only after an Owner turns on [Quick web setup](</docs/en/claude-code-on-the-web#quick-web-setup-for-team-and-enterprise>). When you run `/web-setup`, Claude Code reads the token that `gh auth token` prints, asks you to confirm, and sends the token to Anthropic. Anthropic stores it encrypted with your claude.ai account, and your cloud sessions use it for GitHub access until you remove it. A cloud session you start yourself can then access any repository that token can access, with no Claude GitHub App installation. Threads in a [project](</docs/en/claude-projects#set-up-github-access>) still need the Claude GitHub App. If you already connected GitHub in the browser, `/web-setup` warns you that continuing replaces that connection for your cloud sessions. Organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled cannot use `/web-setup` or other cloud session features. If the GitHub CLI isn’t installed or isn’t authenticated, Claude Code opens the browser onboarding flow instead. @@ -261,7 +261,7 @@ `/web-setup` shows “No commands match” or “Unknown command” -`/web-setup` runs inside the Claude Code CLI, not your shell. Launch `claude` first, then type `/web-setup` at the prompt. If you typed it inside Claude Code and the command menu shows `No commands match "/web-setup"`, or submitting it returns `Unknown command: /web-setup`, the command is hidden because a requirement isn’t met. The cause is usually that you’re authenticated with an API key or third-party provider instead of a claude.ai subscription. Run `/login` to sign in with your claude.ai account. On Team and Enterprise plans, the command is hidden by default: the [Quick web setup toggle](</docs/en/claude-code-on-the-web#github-authentication-options>) is off until an Owner turns it on. While it’s off, connect GitHub from the browser instead. The command is also hidden in two other cases: +`/web-setup` runs inside the Claude Code CLI, not your shell. Launch `claude` first, then type `/web-setup` at the prompt. If you typed it inside Claude Code and the command menu shows `No commands match "/web-setup"`, or submitting it returns `Unknown command: /web-setup`, the command is hidden because a requirement isn’t met. The cause is usually that you’re authenticated with an API key or third-party provider instead of a claude.ai subscription. Run `/login` to sign in with your claude.ai account. On Team and Enterprise plans, the command is hidden by default: the [Quick web setup toggle](</docs/en/claude-code-on-the-web#quick-web-setup-for-team-and-enterprise>) is off until an Owner turns it on. While it’s off, connect GitHub from the browser instead. The command is also hidden in two other cases: * An administrator has disabled cloud sessions for your organization. In this case, submitting `/web-setup` returns [`Cloud sessions are disabled by your organization's policy`](</docs/en/errors#cloud-sessions-are-disabled-by-your-organizations-policy>). Before v2.1.268, this case also returned `Unknown command: /web-setup`. * Your Enterprise organization has [Zero Data Retention](</docs/en/zero-data-retention>) enabled, which makes cloud sessions unavailable.