modified Week 13 · March 23–27, 2026 View current →
--- a/2026-w13.md +++ b/2026-w13.md @@ -2,7 +2,7 @@ Auto moderesearch preview -Auto mode hands your permission prompts to a classifier. Safe edits and commands run without interrupting you; anything destructive or suspicious gets blocked and surfaced. It’s the middle ground between approving every file write and running with `—dangerously-skip-permissions`. +Auto mode hands your permission prompts to a classifier. Safe edits and commands run without interrupting you; anything destructive or suspicious gets blocked and surfaced. It’s the middle ground between approving every file write and running with `--dangerously-skip-permissions`. Cycle to auto with Shift+Tab, or set it as your default:
modified Week 14 · March 30 – April 3, 2026 View current →
--- a/2026-w14.md +++ b/2026-w14.md @@ -69,7 +69,7 @@ Auto mode follow-ups: new `PermissionDenied` hook fires on classifier denials (return `retry: true` to let Claude try a different approach), and `/permissions` → Recently denied lets you retry manually with `r` -New `defer` value for `permissionDecision` in `PreToolUse` hooks: `-p` sessions pause at a tool call and exit with a `deferred_tool_use` payload so an SDK app or custom UI can surface it, then resume with `—resume` +New `defer` value for `permissionDecision` in `PreToolUse` hooks: `-p` sessions pause at a tool call and exit with a `deferred_tool_use` payload so an SDK app or custom UI can surface it, then resume with `--resume` `/buddy`: hatch a small creature that watches you code. An April Fools’ joke, no longer available
modified Week 16 · April 13–17, 2026 View current →
--- a/2026-w16.md +++ b/2026-w16.md @@ -64,7 +64,7 @@ New [`/ultrareview`](</docs/en/ultrareview>): comprehensive code review in the cloud using parallel multi-agent analysis and an adversarial critique pass. Run it bare to review your current branch, or `/ultrareview <PR#>` for a specific PR -[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) is now available for Max subscribers on Opus 4.7, and the `—enable-auto-mode` flag is no longer required +[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) is now available for Max subscribers on Opus 4.7, and the `--enable-auto-mode` flag is no longer required [Session recap](</docs/en/interactive-mode#session-recap>) shows a one-line summary of what happened while you were away; run `/recap` on demand or turn it off from `/config`
modified Week 17 · April 20–24, 2026 View current →
--- a/2026-w17.md +++ b/2026-w17.md @@ -64,7 +64,7 @@ Native macOS and Linux builds replace the `Glob` and `Grep` tools with embedded `bfs` and `ugrep` available through Bash, for faster searches without a separate tool round-trip -`—from-pr` now accepts GitLab merge request, Bitbucket pull request, and GitHub Enterprise PR URLs in addition to github.com +`--from-pr` now accepts GitLab merge request, Bitbucket pull request, and GitHub Enterprise PR URLs in addition to github.com Auto mode: include `“$defaults”` in [`autoMode.allow`, `soft_deny`, or `environment`](</docs/en/auto-mode-config>) to add custom rules alongside the built-in list instead of replacing it
modified Week 18 · April 27 – May 1, 2026 View current →
--- a/2026-w18.md +++ b/2026-w18.md @@ -56,15 +56,15 @@ MCP servers can opt out of tool-search deferral with `alwaysLoad: true` in their config so all of that server’s tools are always available -New `claude plugin prune` removes orphaned auto-installed plugin dependencies, and `plugin uninstall —prune` cascades +New `claude plugin prune` removes orphaned auto-installed plugin dependencies, and `plugin uninstall --prune` cascades `/skills` now has a type-to-filter search box so you can find a skill in a long list without scrolling `PostToolUse` hooks can replace tool output for any tool via `hookSpecificOutput.updatedToolOutput`, not only MCP tools -New [`claude ultrareview`](</docs/en/ultrareview>) subcommand runs `/ultrareview` non-interactively from CI or scripts: prints findings to stdout (`—json` for raw output) and exits 0 on completion or 1 on failure +New [`claude ultrareview`](</docs/en/ultrareview>) subcommand runs `/ultrareview` non-interactively from CI or scripts: prints findings to stdout (`--json` for raw output) and exits 0 on completion or 1 on failure -`—dangerously-skip-permissions` now bypasses prompts for writes to `.claude/`, `.git/`, `.vscode/`, shell config files, and other previously protected paths, while catastrophic removal commands still prompt as a safety net +`--dangerously-skip-permissions` now bypasses prompts for writes to `.claude/`, `.git/`, `.vscode/`, shell config files, and other previously protected paths, while catastrophic removal commands still prompt as a safety net The `/model` picker can list models from your gateway’s `/v1/models` endpoint when `ANTHROPIC_BASE_URL` points at an Anthropic-compatible gateway; opt in with `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` since v2.1.129
modified Week 19 · May 4–8, 2026 View current →
--- a/2026-w19.md +++ b/2026-w19.md @@ -20,7 +20,7 @@ Other wins -New `worktree.baseRef` setting (`fresh` | `head`) controls whether `—worktree`, the `EnterWorktree` tool, and agent-isolation worktrees branch from the remote default branch or local `HEAD`; the default `fresh` keeps unpushed commits out of new worktrees +New `worktree.baseRef` setting (`fresh` | `head`) controls whether `--worktree`, the `EnterWorktree` tool, and agent-isolation worktrees branch from the remote default branch or local `HEAD`; the default `fresh` keeps unpushed commits out of new worktrees New `settings.autoMode.hard_deny` rules block matching actions unconditionally in auto mode, regardless of allow exceptions, for actions that should never run automatically even when broader allow rules apply @@ -34,7 +34,7 @@ `/mcp` now shows the tool count for connected servers and flags servers that connected with 0 tools -`—channels` now works with console (API key) authentication +`--channels` now works with console (API key) authentication Subprocesses such as Bash, hooks, MCP, and LSP no longer inherit `OTEL_*` environment variables, so OTEL-instrumented apps run via the Bash tool no longer pick up the CLI’s own OTLP endpoint
modified Week 20 · May 11–15, 2026 View current →
--- a/2026-w20.md +++ b/2026-w20.md @@ -38,7 +38,7 @@ Other wins -`claude agents` gained dispatch flags (`—add-dir`, `—settings`, `—mcp-config`, `—plugin-dir`, `—permission-mode`, `—model`, `—effort`, `—dangerously-skip-permissions`) to configure background sessions, and `claude agents —cwd <path>` scopes the session list to a directory +`claude agents` gained dispatch flags (`--add-dir`, `--settings`, `--mcp-config`, `--plugin-dir`, `--permission-mode`, `--model`, `--effort`, `--dangerously-skip-permissions`) to configure background sessions, and `claude agents --cwd <path>` scopes the session list to a directory New hook `args: string[]` exec form spawns the command directly without a shell, so path placeholders never need quoting
modified Week 21 · May 18–22, 2026 View current →
--- a/2026-w21.md +++ b/2026-w21.md @@ -20,11 +20,11 @@ ”Extra usage” is renamed to “usage credits” across the CLI, and `/extra-usage` is now `/usage-credits`. The old name still works. The command requires signing in with your claude.ai subscription through `/login` and isn’t available with API key authentication. -New [`/code-review`](</docs/en/code-review>) command reports correctness bugs at a chosen effort level such as `/code-review high`, and `—comment` posts findings as inline GitHub PR comments. `/simplify` remains as a separate cleanup-only review. +New [`/code-review`](</docs/en/code-review>) command reports correctness bugs at a chosen effort level such as `/code-review high`, and `--comment` posts findings as inline GitHub PR comments. `/simplify` remains as a separate cleanup-only review. Background sessions now appear in `/resume` alongside interactive ones, marked with `bg`, and sessions pinned with `Ctrl+T` in `claude agents` stay alive when idle -`claude agents —json` lists live sessions as JSON for scripting, such as status bars and session pickers +`claude agents --json` lists live sessions as JSON for scripting, such as status bars and session pickers The PowerShell tool is now enabled by default on Windows for Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry users; opt out with `CLAUDE_CODE_USE_POWERSHELL_TOOL=0`
modified Week 22 · May 25–29, 2026 View current →
--- a/2026-w22.md +++ b/2026-w22.md @@ -56,7 +56,7 @@ Other wins -In `claude agents`, prefix a shell command with `!` to run it as a background job you can attach to and detach from; also available as `claude —bg —exec ‘pytest -x’` +In `claude agents`, prefix a shell command with `!` to run it as a background job you can attach to and detach from; also available as `claude --bg --exec 'pytest -x'` Plugins in `.claude/skills` directories are now loaded automatically, no marketplace required, and `claude plugin init <name>` scaffolds a new plugin @@ -66,7 +66,7 @@ New `MessageDisplay` hook event lets hooks transform or hide assistant message text as it is displayed -Claude Code now switches to your configured `—fallback-model` for the rest of the session when the primary model is not found, instead of failing every request +Claude Code now switches to your configured `--fallback-model` for the rest of the session when the primary model is not found, instead of failing every request Plugins can declare `defaultEnabled: false` in `plugin.json` or a marketplace entry, so they install without turning on until you enable them
modified Week 33 · August 10–14, 2026 View current →
--- a/2026-w33.md +++ b/2026-w33.md @@ -24,7 +24,7 @@ GitLab merge requests and marketplacesv2.1.232 -Plugin marketplaces clone bare `gitlab.com` URLs, including nested subgroups. On v2.1.233 or later, pass a GitLab merge request URL to `—worktree` to branch from it, and the `claude agents` view labels sessions linked to a merge request as `!N`. Claude Code also redacts GitLab token families such as `glpat-` and `glrt-`, and protects the `glab` CLI’s config store the same way it protects `gh`. +Plugin marketplaces clone bare `gitlab.com` URLs, including nested subgroups. On v2.1.233 or later, pass a GitLab merge request URL to `--worktree` to branch from it, and the `claude agents` view labels sessions linked to a merge request as `!N`. Claude Code also redacts GitLab token families such as `glpat-` and `glrt-`, and protects the `glab` CLI’s config store the same way it protects `gh`. Start a session in a worktree branched from a merge request:
modified Manage multiple agents with agent view View current →
--- a/agent-view.md +++ b/agent-view.md @@ -44,7 +44,35 @@ This step needs a running session. If you followed the earlier steps you don’t have one open in this terminal, so open a regular `claude` session in another terminal and send it a message first.To move a session you already have open into agent view, run `/bg` inside it, or press `←` on an empty prompt to background it and open agent view in one step. In a fresh session with no messages yet, `/bg` asks you to send a message first, while `←` works right away. The session keeps running and appears as a row alongside the ones you dispatched. -You can use `claude agents` as your primary entry point instead of `claude`: dispatch every task from agent view, attach when you want the full conversation, and press `←` to return to the table. Inside a regular `claude` session, the prompt footer’s `←` hint counts the background agents that are waiting on you, such as `← 2 agents`, and returns to `← for agents` when none need input. Counts above 99 show as `99+`. The count refreshes about every ten seconds while the terminal is focused and immediately when focus returns. It briefly changes color when it moves and when an agent completes, and when a background session finishes while none need your input it briefly shows the number completed, such as `← 2 done`. Both flashes are off when the [`prefersReducedMotion` setting](</docs/en/settings-reference#prefersreducedmotion>) is on, and the hint is hidden in [screen reader mode](</docs/en/accessibility>). +Inside a regular `claude` session, the prompt footer’s `←` hint counts the background agents that are waiting on you, such as `← 2 agents`, and returns to `← for agents` when none need input. Counts above 99 show as `99+`. The count refreshes about every ten seconds while the terminal is focused and immediately when focus returns. It briefly changes color when it moves and when an agent completes, and when a background session finishes while none need your input it briefly shows the number completed, such as `← 2 done`. Both flashes are off when the [`prefersReducedMotion` setting](</docs/en/settings-reference#prefersreducedmotion>) is on, and the hint is hidden in [screen reader mode](</docs/en/accessibility>). + +### + +​ + +Open agent view by default + +To have `claude` with no arguments open agent view instead of a new conversation, turn on a `/config` setting. + +1 + +Turn on the setting + +In a regular `claude` session, run `/config` and turn on **Open agents view by default**. To skip the menu, set the [`defaultToAgentsView`](</docs/en/settings-reference#defaulttoagentsview>) key directly: + + /config defaultToAgentsView=true + +2 + +Start Claude Code + +Exit the session, then run `claude` with no arguments: + + claude + +Agent view opens in place of a new conversation. + +To start a regular session while the setting is on, pass a prompt: `claude "fix the login test"`. To turn the setting off, run `/config defaultToAgentsView=false` in a regular session or in one you attach to from agent view. ##
modified Claude Code on Amazon Bedrock View current →
--- a/amazon-bedrock.md +++ b/amazon-bedrock.md @@ -342,7 +342,7 @@ 1M token context window -Claude Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support the [1M token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) on Amazon Bedrock. Sonnet 5 always runs with the 1M window on both the Invoke API and the Mantle endpoint, with no `[1m]` variant to select. For the other models on the Invoke API, Claude Code automatically enables the extended context window when you select a 1M model variant. The setup wizard offers a 1M context option when it pins models. To enable it for a manually pinned model instead, append `[1m]` to the model ID. See [Pin models for third-party deployments](</docs/en/model-config#pin-models-for-third-party-deployments>) for details. +Claude Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support the [1M token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) on Amazon Bedrock. Sonnet 5 always runs with the 1M window on both the Invoke API and the Mantle endpoint, with no `[1m]` variant to select. For the other models on the Invoke API, Claude Code automatically enables the extended context window when you select a 1M model variant. The setup wizard offers a 1M context option when it pins models. To enable it for a manually pinned model instead, append `[1m]` to the model ID. See [Pin models for third-party deployments](</docs/en/model-config#pin-models-for-third-party-deployments>) for details, including how to use the 1M window without changing the pin. ##
modified Share session output as artifacts View current →
Show diff (118 lines)
--- a/artifacts.md +++ b/artifacts.md @@ -39,18 +39,7 @@ Build a dashboard artifact of last week's deploy failures by service and keep it updated as you investigate. -Unless you name a location, Claude writes the page to an HTML or Markdown file in a temporary directory outside your project, then publishes it. Publishing a new artifact goes through your session’s [permission mode](</docs/en/permission-modes>): - - * **Auto mode** : the classifier reviews the publish instead of prompting you, so Claude can publish a page without you seeing a prompt. Which mode your sessions start in depends on your plan; see [the starting permission mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). - * **Manual and Accept edits modes** : Claude Code asks for permission; it might say something like `Claude wants to publish deploy-failures.html, uploading it to claude.ai (Anthropic's servers) to host as the page "Deploy failures by service", private to you until you share it`. Select **Yes** to publish. - -After you approve an artifact once, Claude Code republishes it without asking, and asks again in some cases, including when: - - * Claude declares a runtime capability for the page, such as connector calls or file downloads - * You have since shared it publicly - * You have since shared it with specific people or your organization with the latest version chosen as the version viewers see - -After the first publish, Claude prints the URL, and your browser opens to the new page. If you sent the prompt through [Remote Control](</docs/en/remote-control>) from claude.ai, Claude Desktop, or the Claude mobile app, no tab opens on the machine running the session. The browser opens there the next time Claude publishes the artifact from a prompt you type at the terminal. Press `Ctrl+]` at any time to reopen the session’s most recent artifact. Claude picks the artifact’s title and an emoji, and both appear in your gallery of artifacts on claude.ai and in shared links. Claude can also pick a browser-tab icon that matches what the page is, such as a chart or a calendar. Ask Claude for a specific title, emoji, or tab icon if you want one. To stop the browser from opening automatically when a new artifact is published, set `CLAUDE_CODE_ARTIFACT_AUTO_OPEN=0` in your environment. If Claude responds that it cannot publish, or writes a local HTML file without a link, the tool is not enabled for your session. Check the Availability requirements. +Unless you name a location, Claude writes the page to an HTML or Markdown file in a temporary directory outside your project, then publishes it. Outside [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>), a new artifact that Claude publishes in response to a prompt you type goes through without a permission prompt or classifier review, unless that publish declares runtime capabilities for the page, such as connector calls or file downloads. In plan mode, Claude Code asks you before the first publish of each artifact. The artifact stays private to you until you share it. After you share it publicly, Claude Code asks for your approval once per conversation before changing it, or in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) has the classifier review the change. If you turned [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) off, Claude Code asks before the first publish of each artifact, or in auto mode has the classifier review it. After the first publish, Claude prints the URL, and your browser opens to the new page. If you sent the prompt through [Remote Control](</docs/en/remote-control>) from claude.ai, Claude Desktop, or the Claude mobile app, no tab opens on the machine running the session. The browser opens there the next time Claude publishes the artifact from a prompt you type at the terminal. Press `Ctrl+]` at any time to reopen the session’s most recent artifact. Claude picks the artifact’s title and an emoji, and both appear in your gallery of artifacts on claude.ai and in shared links. Claude can also pick a browser-tab icon that matches what the page is, such as a chart or a calendar. Ask Claude for a specific title, emoji, or tab icon if you want one. To stop the browser from opening automatically when a new artifact is published, set `CLAUDE_CODE_ARTIFACT_AUTO_OPEN=0` in your environment. If Claude responds that it cannot publish, or writes a local HTML file without a link, the tool is not enabled for your session. Check the Availability requirements. ## @@ -83,7 +72,7 @@ A new artifact is visible only to you. To share it, open the artifact in your browser and use the **Share** control in the page header. The header also links to your gallery at [claude.ai/code/artifacts](<https://claude.ai/code/artifacts>), which lists every artifact you have created. Viewers in your organization can see who published the page: on an artifact shared within your organization, your name is in the title menu, and on a public artifact it’s in the page header for signed-in viewers in your organization. A viewer who opens a public link without signing in, or from outside your organization, sees the label `Content is user-generated and unverified.` instead of your name. Who you can share with depends on your plan: * **Within your organization** : on Team and Enterprise plans, grant access to specific people in your organization, or to everyone in it. Viewers sign in to claude.ai as members of your organization to see the page. - * **Publicly** : share a link that anyone on the internet can open, with no claude.ai sign-in required. On Pro and Max plans, a public link is the only way to share an artifact. On Team and Enterprise plans, public sharing is off until an Owner enables it for the organization. + * **Publicly** : share a link that anyone on the internet can open, with no claude.ai sign-in required. On Team and Enterprise plans, public sharing is off until an Owner enables it for the organization. ### @@ -107,12 +96,12 @@ Collect comments on an artifact -When you share an artifact within your organization, the people you share it with can leave comments on the page, and you can have Claude read those comments and reply to them. You need Claude Code v2.1.221 or later and a Team or Enterprise plan, because only an artifact you share within your organization takes comments. Claude reads the comments in two cases: +When you share an artifact within your organization, the people you share it with can leave comments on the page, and you can have Claude read those comments and reply to them. You need Claude Code v2.1.221 or later. Claude reads the comments in two cases: * **You ask Claude to read them** : give Claude the artifact’s URL and ask for the comments. Claude lists each thread and marks the comments someone who can edit the artifact sent to it. * **Someone who can edit the artifact sends a comment to Claude** : in a thread on the page, they send a comment with **Send to Claude** , or mention `@claude` in one. Either way, they activate the thread. -Claude can reply to or resolve only an activated thread. Other threads stay open until a person resolves them on the page. Viewers see each reply attributed to Claude, via you. If you share an artifact publicly, viewers can’t comment on it: the page says `Comments aren't available while this Artifact is shared publicly.` To switch an artifact that already has comment threads to a public link, delete the threads first. To ask for the comments yourself, give Claude the URL: +Claude can reply to or resolve only an activated thread. Other threads stay open until a person resolves them on the page. Viewers see each reply attributed to Claude, via you. If you share an artifact publicly, people whose only access is the public link don’t see its comments and can’t add any. Existing comment threads stay on the artifact, and you and its editors can still read and reply to them. To ask for the comments yourself, give Claude the URL: Read the comments on https://claude.ai/code/artifact/5fbea6f3-... and make the changes the commenters ask for. @@ -166,7 +155,7 @@ * **Viewers approve access first** : claude.ai asks each viewer for permission before the page’s first connector call. A viewer who declines, or who hasn’t connected a connector the page uses, still sees the page without its live sections. * **Actions use the viewer’s account too** : a page can offer controls that invoke connector tools with side effects, such as posting a message or updating an issue. The action goes through the account of whoever selects the control. -When you plan to share a connector-backed page, ask Claude to include a fallback message in each live section that names the connector it needs. A viewer who’s missing the connection then sees what to connect instead of an empty section. An artifact that calls connectors can’t be shared to a public link on any plan. On Team and Enterprise plans, you can keep it private or share it within your organization. On Pro and Max plans, where a public link is the only way to share, a connector-backed artifact stays private to you. +When you plan to share a connector-backed page, ask Claude to include a fallback message in each live section that names the connector it needs. A viewer who’s missing the connection then sees what to connect instead of an empty section. You can share a connector-backed page within your organization or publicly, as your plan and organization settings allow. Connector calls don’t run for a viewer who opens the public link without signing in to claude.ai, or from outside your organization. That viewer sees the page without its live sections. ### @@ -174,7 +163,7 @@ The page shows no live data for a viewer -When a connector-backed page renders but its live sections stay empty for someone you shared it with, work through these causes: +When a connector-backed page renders but its live sections stay empty for a viewer in your organization, work through these causes: * **The viewer hasn’t connected the connector** : connectors are per-account, so each viewer needs their own connection to every connector the page calls. They can add one under **Settings > Connectors** on claude.ai, then reload the page. * **The viewer declined the permission ask** : a denial lasts for the rest of that page load. Reloading the page brings the permission ask back. @@ -342,7 +331,7 @@ Requirement| Available when ---|--- -Plan| Pro, Max, Team, or Enterprise. On Pro and Max plans, artifacts are private to you until you share them, and no admin management applies. On Team plans, artifacts are on by default. On Enterprise plans, an Owner enables them in claude.ai admin settings. +Plan| Pro, Max, Team, or Enterprise. On Pro and Max plans, artifacts are private to you until you share them, and no admin management applies. On Team and Enterprise plans, artifacts are on by default, and an Owner can turn them off for the organization in claude.ai admin settings. Authentication| The session is backed by a claude.ai account: sign in with `/login` in the CLI or desktop app. Claude Tag sessions are signed in through the agent’s identity, so no step is needed there. Sessions using an API key, [gateway token](</docs/en/llm-gateway>), or cloud-provider credential cannot publish. Model provider| Anthropic API. Not available on [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>). Organization policy| Customer-managed encryption keys (CMEK), HIPAA, and [Zero Data Retention](</docs/en/zero-data-retention>) are not enabled for the organization. @@ -373,7 +362,7 @@ Manage artifacts for your organization -Owners on Team and Enterprise plans control artifacts from [claude.ai admin settings](<https://claude.ai/admin-settings/claude-code>). Artifact content is stored on Anthropic-operated infrastructure and is visible only to authenticated members of the publishing organization, unless the artifact is shared publicly. +Owners on Team and Enterprise plans control artifacts from [claude.ai admin settings](<https://claude.ai/admin-settings/artifacts>). Artifact content is stored on Anthropic-operated infrastructure and is visible only to authenticated members of the publishing organization and the people they share it with, unless the artifact is shared publicly. ### @@ -381,7 +370,7 @@ Enable or disable artifacts -To enable or disable artifacts for the whole organization, go to [**Settings > Claude Code > Capabilities**](<https://claude.ai/admin-settings/claude-code>) and use the **Artifacts** toggle. On Enterprise plans with role-based access control, you can additionally scope artifacts to specific roles: go to [**Settings > Roles**](<https://claude.ai/admin-settings/roles>), edit a role, and set the **Artifacts** permission under the **Claude Code** group. +To enable or disable artifacts for the whole organization, go to [**Organization settings > Artifacts**](<https://claude.ai/admin-settings/artifacts>) and use the **Artifacts** toggle. On Enterprise plans with role-based access control, you can additionally scope artifacts to specific roles: go to [**Organization settings > Roles**](<https://claude.ai/admin-settings/roles>), edit a role, and set the **Artifacts** permission. ### @@ -389,7 +378,7 @@ Control connector calls from artifacts -Connector calls from artifacts have their own toggle, separate from the **Artifacts** toggle that turns artifacts on or off. Go to [**Settings > Capabilities**](<https://claude.ai/admin-settings/capabilities>) and use the **Enable artifact connectors** toggle. The same toggle governs connector calls from artifacts created in claude.ai conversations, which is why it sits under **Settings > Capabilities** rather than **Settings > Claude Code**. +Connector calls from artifacts have their own toggle, separate from the **Artifacts** toggle that turns artifacts on or off. Go to [**Organization settings > Capabilities**](<https://claude.ai/admin-settings/capabilities>) and use the **Enable artifact connectors** toggle. The same toggle governs connector calls from artifacts created in claude.ai conversations. ### @@ -397,7 +386,7 @@ Control public sharing -Public sharing is off by default on Team and Enterprise plans, so members can share artifacts only within the organization until an Owner turns it on. To let members publish artifacts to public links that anyone can view without signing in, go to **Settings > Claude Code > Capabilities** and turn on **External sharing** under the **Artifacts** toggle. Turning it back off blocks access through existing public links without changing each artifact’s audience; access resumes if you re-enable it. +Public sharing is off by default on Team and Enterprise plans. To let members publish artifacts to public links that anyone can view without signing in, go to [**Organization settings > Artifacts**](<https://claude.ai/admin-settings/artifacts>) and turn on **External sharing** under the **Artifacts** toggle. Turning it back off blocks access through existing public links without changing each artifact’s audience; access resumes if you re-enable it. ### @@ -405,7 +394,7 @@ Set a retention policy -To set how long artifacts are kept before automatic deletion, go to [**Settings > Data & privacy controls**](<https://claude.ai/admin-settings/data-privacy-controls>). You can set separate retention periods for artifacts that are still private to their author and artifacts that have been shared. +To set how long artifacts are kept before automatic deletion, go to [**Organization settings > Data and privacy**](<https://claude.ai/admin-settings/data-privacy-controls>). You can set separate retention periods for artifacts that are still private to their author and artifacts that have been shared. ###
modified Authentication View current →
--- a/authentication.md +++ b/authentication.md @@ -14,11 +14,19 @@ * **Cloud providers** : if your organization uses [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>), set the required environment variables before running `claude`, or select **3rd-party platform** at the login prompt, which launches an interactive setup wizard for Bedrock and Vertex AI. No browser login is needed. * **Cloud gateway** : if your organization runs a self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>), sign in with corporate SSO through `/login`. The gateway-issued token is the session’s only credential. -Admins can direct which login method developers use and require claude.ai logins to belong to a specific organization; see Restrict login to your organization. To log out and re-authenticate, type `/logout` at the Claude Code prompt. Logging out also resets your first-launch setup state, so the next time you run `claude` it walks you through login and setup again. To stay signed in to multiple accounts at once, such as work and personal accounts, give each account its own configuration directory. When you start `claude`, set the [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars#variables>) environment variable to the directory for the account you want to use. Each directory has its own settings, session history, and claude.ai login or API key. For example, in Bash or Zsh, add this alias to `~/.bashrc` or `~/.zshrc` so that `claude-work` uses your work account while `claude` keeps your personal one: +Admins can direct which login method developers use and require claude.ai logins to belong to a specific organization; see Restrict login to your organization. To log out and re-authenticate, type `/logout` at the Claude Code prompt. Logging out also resets your first-launch setup state, so the next time you run `claude` it walks you through login and setup again. If you’re having trouble logging in, see [authentication troubleshooting](</docs/en/troubleshoot-install#login-and-authentication>). + +### + +​ + +Log in with multiple accounts + +To stay signed in to multiple accounts at once, such as work and personal accounts, give each account its own configuration directory. When you start `claude`, set the [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars#variables>) environment variable to the directory for the account you want to use. Each directory has its own settings, session history, and claude.ai login or API key. For example, in Bash or Zsh, add this alias to `~/.bashrc` or `~/.zshrc` so that `claude-work` uses your work account while `claude` keeps your personal one: alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude' -After you open a new terminal and run `claude-work` for the first time, Claude Code walks you through login and setup for the new directory. Separate directories don’t keep two Claude Console sign-ins without an API key apart, because Claude Code stores that kind of sign-in outside the configuration directory. If you’re having trouble logging in, see [authentication troubleshooting](</docs/en/troubleshoot-install#login-and-authentication>). +After you open a new terminal and run `claude-work` for the first time, Claude Code walks you through login and setup for the new directory. Separate directories don’t keep two Claude Console sign-ins without an API key apart, because Claude Code stores that kind of sign-in outside the configuration directory. ##
modified Claude Code changelog View current →
Show diff (150 lines)
--- a/changelog.md +++ b/changelog.md @@ -1,4 +1,147 @@ 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.285 + +September 29, 2026 + + * Added `CLAUDE_CODE_DISABLE_WEB_FETCH` environment variable to turn off the WebFetch tool + * Added `claude --desktop` to open the Claude desktop app on the current directory, or on a session with `--continue` / `--resume <id>` + * Added `claude plugin configure <plugin>` to show a plugin’s options and which are unset, or save new values read from stdin with `--values-stdin` + * Added `<server>.<key>=<value>` to `claude plugin install --config`, so a bundled `.mcpb` MCP server’s own settings can be set at install time and it starts without visiting `/plugin` → Configure + * Added `allowedProviders` managed setting to limit which API providers a machine may use (Anthropic API, a custom endpoint, Bedrock, Mantle, Vertex AI, Foundry, Claude Platform on AWS, or a Cloud gateway) + * Added `CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES` environment variable to cap re-sends of a non-streaming fallback request that timed out + * Fixed `claude -p` with `CLAUDE_CODE_FORK_SUBAGENT=1`: a subagent’s own Agent call now runs in the foreground, so the subagent gets the child’s result + * Fixed plugin and marketplace installs and updates over SSH ignoring the ssh program set in `GIT_SSH` or in your git config’s `core.sshCommand` + * Fixed Claude Code refusing to start when the OS denies reading the managed settings file; it now warns and starts without that file’s policies. Other read errors and unparseable files stop every session + * Fixed cloud sessions that restarted after their conversation was compacted refusing the next update to an artifact the session had already read or published + * Fixed `claude plugin disable` and `enable` with a full `name@marketplace` id changing a settings entry in another letter case instead of the installed plugin’s own + * Fixed files attached to a message sent over Remote Control being left out after a single failed download; a network error, timeout or server error is now retried up to twice + * Fixed switching models mid-session with a `set_model` request (such as the Agent SDK’s `setModel`) leaving the new model on the built-in output-token limit and auto-compact window until restart + * Fixed redacted logs and transcripts showing part of a URL password that contains `@`, or all of it when the URL writes its `@` as `%40` + * Fixed SSH passphrase and new-host prompts from worktree and `/teleport` fetches taking over the terminal; these fetches now fail fast instead of asking + * Fixed switching off an MCP server added mid-session in SDK and `-p` sessions leaving its tools available + * Fixed `claude -p --permission-prompt-tool`: a background subagent’s permission request now goes to the prompt tool instead of being auto-denied + * Fixed `claude mcp list` and `claude mcp get`, and the not-found error of `claude mcp remove`, `login` and `logout`, printing line breaks and terminal escape sequences from MCP server names and values + * Fixed sandbox auto-allow asking for approval on every run of many inline scripts (`python3 -c`, `node -e`) just because they contain `=` + * Fixed fork subagents not keeping the session’s plan mode or `dontAsk` mode: a fork now runs under its parent’s permission mode and cannot exit plan mode + * Fixed `claude remote-control --help` saying `--[no-]chrome` defaults to the machine’s `/chrome` setting; spawned sessions keep Claude in Chrome off unless `--chrome` is passed + * Fixed background subagents in auto mode prompting a second, redundant reply after each report + * Fixed cloud session creation and `/remote-env` reading only the newest 20 of an account’s environments + * Fixed Remote Control marking a message as read as soon as it arrived instead of when Claude started on it, and losing a message still queued when the terminal quit (it now arrives on the next resume) + * Fixed installing a plugin with `claude plugin install` or `/plugin` putting it into an installed plugin’s cache or data folder when their ids differ only in `.`, `-`, `@` or (macOS, Windows) capitals; the install is now refused + * Fixed hooks and SDK permission callbacks seeing a missing or outdated plan on ExitPlanMode when the plan was written in the same response + * Fixed the first reply in cloud sessions arriving tens of milliseconds late, a regression in 2.1.283 + * Fixed sessions that authenticate with `ANTHROPIC_AUTH_TOKEN` against the Anthropic API never loading the organization’s policy + * Fixed a failed `agent()`, `parallel()` or `pipeline()` call that a workflow script awaits later, or not at all, being treated as an unhandled promise rejection, which could end a background session + * Fixed synchronous hooks hanging Claude Code while a background process the hook started (for example `some-daemon &`) kept its output open; the hook now finishes shortly after its own process exits + * Fixed WebFetch reporting a rate-limited domain safety check as a network or enterprise policy block + * Fixed the fullscreen ctrl+o transcript freezing briefly when opened on turns with hundreds of file reads or searches; tool calls still running when the transcript opens now show their results when they finish + * Fixed Amazon Bedrock mid-stream `modelTimeoutException` and `serviceUnavailableException` errors showing a raw JSON body instead of the error message + * Fixed `/autofix-pr` and `/schedule` saying the Claude GitHub App is not installed on a repository whose install status had not been checked yet + * Fixed dismissing a row (x) in `/artifacts` unlinking its file from the artifact, so publishing the same file again created a new artifact instead of updating it + * Fixed Artifact tool publishes after a conversation rewind (Esc Esc) overwriting a file’s newer content that Claude had read only in the rewound turns; the publish is now refused until Claude re-reads the file + * Fixed an `Artifact` allow rule (“don’t ask again”) letting the Artifact tool publish a file outside the working directories without asking; add the file’s folder with `--add-dir` for the rule to cover it + * Fixed `/cost` and SDK `modelUsage` reporting a turn under the wrong model when the server answered a refusal with a different fallback model than the client expected + * Fixed the Artifact tool so that publishing a page no longer lets Claude overwrite its source file without re-reading it when Claude’s earlier read was cut short or the file had changed since + * Fixed auto mode skipping its classifier for Artifact tool asset uploads and reads of someone else’s artifact when you had approved that artifact earlier in another permission mode + * Fixed a misleading “core.worktree is set” error from `/ultrareview` when the project folder briefly could not be read + * Fixed `/ultrareview` on macOS and Linux failing to upload the working tree from a git worktree whose per-worktree config sets `core.longpaths` + * Fixed the Artifact tool sometimes reporting a publish as a conflict with another session after retrying a temporary server error, when the first attempt had actually succeeded + * Fixed `/ultrareview` uploads including uncommitted changes to credential files whose name has a colon before the extension, such as `server:8443.key` + * Fixed a rare auth failure when two sessions recover a login refresh lock left by a crashed process at the same time + * Fixed the PowerShell tool’s permission check skipping deny and ask rules, and caching that failure for later checks, when its command parser failed to start (for example when the machine was out of memory) + * Fixed `/ultrareview` uploads on macOS and Linux running slowly on some unusual file names, and their credential-file check missing file or folder names with many backup or editor marks + * Fixed a cancelled shell command or hook still starting, and running to its end, when the cancel arrived while it was being set up + * Fixed vim mode: after editing in the external editor (Ctrl+G), `x` or `r` in NORMAL mode no longer breaks a pasted-text placeholder at the end of the prompt + * Fixed responses blocked by the API’s output content filter being re-sent and retried, sometimes for minutes, instead of showing the filter’s error right away + * Fixed plugins silently skipping a bundled `.mcpb` MCP server that still needs configuration: `/plugin`, the install message and `claude plugin install` now say so and point to Configure + * Fixed compacting or resuming a session failing, opening without its history, or crashing when its saved transcript holds a compaction marker or loop wakeup entry with missing or malformed fields + * WSL: Fixed `/ultrareview` refusing to upload a checkout on a Linux volume when a changed file’s name has a colon or ends in a dot or space + * Fixed `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` re-running a turn that had ended at `--max-turns` + * Fixed sign-in that could wait forever after the browser showed success + * Windows: Fixed `/ultrareview` uploading a linked worktree of a repository rooted at your home folder in some cases + * Fixed cloud sessions reporting the uploads folder as missing before any file had been uploaded + * Fixed a reply sent from `claude agents` to a background session waiting on a permission prompt sometimes approving the pending command + * Fixed `claude attach`, `logs`, `stop`, `respawn` and `rm` starting a new session with the command name as its prompt when options came before it, such as from a shell alias + * Fixed `claude mcp list` leaving out WebSocket (`ws`) MCP servers; each is now listed with its URL and health status + * Fixed `claude mcp get` showing no Type, Command, Args, or Environment for stdio servers whose config entry omits the `type` field + * Fixed `.claude/settings.local.json` allow rules being held back outside a git repository when git’s trace2 output is configured + * Fixed the `/claude-api` eval runner scaffold and report builder writing through a symlink or hard link planted at an output file + * Fixed the `/claude-api` eval runner scaffold counting responses cut off at `max_tokens` in the score averages; they are now marked truncated and counted separately + * Fixed `&nbsp;` showing as literal text in the terminal when a reply uses it to indent text, such as row labels in a markdown table + * Fixed a brief freeze (up to a second) partway through long sessions outside fullscreen mode, which came back after `/clear` or `/compact` + * Fixed an approved Edit never going through when its target is a device, such as a file symlinked to /dev/null, and the approval came from the IDE diff view or changed the edit + * Fixed a failing API request being retried up to 21 times when streaming kept failing; the non-streaming fallback now shares the request’s retry budget instead of getting a fresh set of retries + * Improved Claude in Chrome: the native host now reports your computer’s name, so connected browsers can be labeled by computer instead of “Browser 1” / “Browser 2” + * Improved Bedrock and Vertex AI sessions to switch to an older available model of the same tier, instead of failing, when an admin removes access to the default model; session titles and summaries now fall back with it + * Improved plugin marketplace errors to name why a git address is refused instead of citing enterprise policy + * Improved validation of git URLs for plugins, marketplaces and the current repository’s remote + * Improved Artifact tool results: they now suggest publishing in the same step as writing or editing the page, which can save a round trip + * Improved Remote Control: a `/btw` side question asked of a session hosted by an app such as Claude Desktop now sees the turn in progress, not only the last finished one + * Improved pictures Claude sends as BMP, HEIC, HEIF, AVIF or TIFF files: the Claude apps now show a preview where Claude Code can convert them + * Improved subagents in auto mode: a subagent’s run now ends as soon as it hands its report back to its caller, instead of taking extra turns that reach no one + * Improved Bedrock and Vertex start-up model checks: models your account cannot use are now remembered for up to a day instead of being re-checked on every launch + * Improved Artifact tool publish results to use fewer tokens: the note on updating an artifact is shorter, and where to find your artifacts is no longer repeated after every publish + * Improved SDK liveness during a non-streaming fallback request: with partial messages on, a `ping` stream event is now sent every 30 seconds on the Anthropic API, Claude Platform on AWS and gateways + * Improved `/resume` and `claude --resume` on a session that is running in the background: they now open that session instead of refusing, and a prompt given with `claude --resume <id> "prompt"` is sent to it as its next turn + * Improved per-turn performance when many permission deny rules and MCP tools are configured + * Improved responsiveness when leaving the ctrl+o transcript view in long sessions when fullscreen rendering is off + * Improved Bedrock, Vertex and Mantle start-up model checks to send the same User-Agent, x-app and session ID headers as regular requests + * Changed MCP tools so a tool that sets its own `_meta['anthropic/alwaysLoad']` to false stays deferred when its `--mcp-config`, Agent SDK or plugin server is set to `alwaysLoad` + * Changed background Bash and PowerShell commands to stop after a time limit (their `timeout` with `run_in_background`, default 30 min, max 2 h); Claude is notified when one is stopped + * Changed Code Review’s pull request reviews and `/ultrareview` to run when `disableWorkflows` is on, unless the machine running the review has it set by its own administrator (MDM or the managed-settings file) + * Changed sessions behind a custom `ANTHROPIC_BASE_URL` to use the 1M context window of models that have one (Opus 4.7+, Sonnet 5+, Fable); run `/autocompact 200k` if your gateway stops at 200K + * Changed Team and Enterprise sessions, and sessions whose sign-in plan Claude Code can’t determine, to withhold WebFetch until the organization policy loads if it couldn’t be loaded at startup + * Changed /memory so that Auto-memory can no longer be turned on from a background session or from a session one of Claude Code’s own tools started; turning it off there still works + * Changed the one-time offer to make auto mode your default permission mode to also show on third-party providers and with telemetry off, when your user settings default to another mode + * Changed `claude -p` and Python Agent SDK sessions on third-party providers or with telemetry off to start in auto mode when no permission mode is configured, like interactive sessions; `--permission-mode` still overrides it + * Changed Bedrock, Mantle and Claude Platform on AWS requests to a base URL with a non-default port to include the port in the SigV4-signed Host header + * Changed the MCP server name `widgets` to be reserved in cloud sessions and on self-hosted runners: your own server under it, or a close spelling such as `widgets_`, no longer loads, so rename it + * Changed `/ultrareview` on macOS and Linux to leave symbolic refs out when uploading a local checkout; a checkout whose current branch is a symbolic ref is now refused with an explanation + * Windows: Changed project and local settings `env` to no longer set `ALLUSERSPROFILE`, `SystemDrive`, or the `CommonProgramFiles` variables; set them in user or managed settings instead + * Changed `/tasks` to fold background work Claude Code runs for itself under one “System tasks” row; press Enter on it to show those tasks + * Changed `/ultrareview` on macOS and Linux to require git 2.31 or newer to upload a local repository; checkouts made with `--separate-git-dir` are now refused instead of being uploaded with an older method + * Changed `/ultrareview` uploads on macOS and Linux to send a partial clone as a working-tree snapshot on git 2.31 or newer, instead of falling back or refusing when git’s version looked too old + * Changed `/ultrareview` uploads on macOS and Linux to refuse, instead of fetching, a partial clone missing some of its working tree’s files on older git versions; a clone made without `--filter` uploads + * Changed Bedrock, Vertex and Mantle start-up model checks to identify themselves as Claude Code, like other Claude Code requests + * Changed `claude mcp get` to hide the command, arguments, and environment values of stdio MCP servers provided by plugins; variable names are still shown + * Changed `/claude-api` so it can no longer be run from Remote Control clients + * Changed `/config chrome=true` to direct you to the /config panel instead of enabling Claude in Chrome by default; `/config chrome=false` still turns it off when it was on + * Changed sandbox settings so project settings cannot widen or turn off an admin-required sandbox, replace the proxy behind a managed deny list, extend a strict allowlist, or reopen managed read-denies + * [VSCode] Added a note under a restored tab’s last message when a window reload interrupted it and no reply will follow + * [VSCode] Added a plugin options form to Manage plugins: installing a plugin that has options asks for the unset ones, and a gear on its row changes them later + * [VSCode] Added an on-demand diagnostics tool so Claude in the panel can read the Problems panel’s current errors and warnings at any time, not only right after it edits a file + * [VSCode] Fixed pressing Enter after typing a slash command running an unrelated menu item picked by fuzzy match, or doing nothing + * [VSCode] Fixed an open agent transcript losing the agent’s newer messages during a long session + * [VSCode] Fixed a message that quotes a Claude Code or IDE tag losing the rest of its text in the chat + * [VSCode] Fixed a message sent while Claude was working disappearing from the conversation after the session was reopened + * [VSCode] Fixed the session list’s Web tab showing the previous account’s sessions after an account switch + * [VSCode] Fixed restored tabs re-running an interrupted turn when VS Code was started with `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` set, even with Continue After Reload off + * [VSCode] Fixed Escape stopping the running turn instead of closing the command menu after clicking one of its rows + * [VSCode] Fixed opening Past conversations replacing a live conversation with its saved copy + * [VSCode] Fixed a Claude tab reloaded after an extension restart staying blank instead of saying how to recover + * [VSCode] Fixed opening a conversation that is already open in another window or app starting a second copy of it without warning; it now asks first + * [VSCode] Fixed a hook’s reason for blocking or stopping a prompt disappearing after a window reload + * [VSCode] Fixed tabs stuck on a conversation that can’t be resumed: the error now says so and offers to start a new conversation + * [VSCode] Fixed every file Read, Write and Edit stalling for ten minutes and then being skipped when the editor stops responding to the extension’s automatic save before the tool runs + * [VSCode] Fixed the agent map labeling a sub-agent with the session’s model instead of the model it actually ran on (e.g. under `CLAUDE_CODE_SUBAGENT_MODEL_FORCE` or an agent’s own `model`) + * [VSCode] Fixed uninstalling a plugin from the Manage plugins dialog, which removed the wrong installation or failed for a plugin installed for the project + * [VSCode] Fixed sign-in staying on the authorization-code step after going back and choosing the same sign-in method again + * [VSCode] Fixed the chat panel stalling when a long session trims its oldest rows + * [VSCode] Fixed the conversation disappearing from a session when many agents run + * [VSCode] Fixed the editor tab keeping an old name after a session was renamed with /rename, by a SessionStart hook, or on claude.ai + * [VSCode] Fixed the agent map’s transcript view leaving out messages sent to a running agent + * [VSCode] Improved the Manage plugins dialog: a failed plugin action now opens a popup that explains it and, where there is one, offers the fix + * [VSCode] Changed the Manage plugins dialog to ask before removing a marketplace or turning off a plugin that your project’s shared `.claude/settings.json` turns on + * [Cloud sessions] Fixed Run now on a routine showing internal error text when the run is refused before it starts; it now shows the same explanation as the routine’s failure notification + * [Cloud sessions] Changed `MCP_DISCOVERY_CACHE=1`, when set in your cloud environment’s variables rather than a settings file, to reuse your connectors’ tool lists after a session restart; other MCP servers are no longer cached and connect at startup + * [Claude Tag] Added direct messages with Claude for members on an Enterprise plan Standard or Usage-Based Chat seat who also have Cowork; a seat that includes Claude Code is no longer required + * [Claude Tag] Fixed the Default model setting in admin settings and a channel’s Configure page offering models your organization can’t use, which made saves or new sessions fail + * [Claude Tag] Fixed the note under Claude’s Slack messages saying it answered on a fallback model, and why, disappearing when Claude later edited that message + * [Code Review] Fixed the organization menu in Code Review’s “Add a repository” dialog showing only a few of your GitHub organizations; it now loads more as you scroll + * [Code Review] Improved the Code Review check run to say when your repository’s REVIEW.md wasn’t applied, for example on a very large pull request or when REVIEW.md is a symbolic link ​
modified Channels reference View current →
--- a/channels-reference.md +++ b/channels-reference.md @@ -136,7 +136,9 @@ The payload arrives in Claude’s context as a `<channel>` tag: - <channel source="webhook" path="/" method="POST">build failed on main: https://ci.example.com/run/1234</channel> + <channel source="webhook" path="/" method="POST"> + build failed on main: https://ci.example.com/run/1234 + </channel> Your terminal renders the event as a one-line summary, `← webhook: build failed on main: https://ci.example.com/run/1234`, rather than the raw tag. You’ll then see Claude start responding: reading files, running commands, or whatever the message calls for. This is a one-way channel, so Claude acts in your session but doesn’t send anything back through the webhook. To add replies, see Expose a reply tool.If the event doesn’t arrive, the diagnosis depends on what `curl` returned:
modified Use Claude Code with Chrome View current →
--- a/chrome.md +++ b/chrome.md @@ -80,7 +80,10 @@ * **Not now** : continues the task without browser tools. Claude Code can ask again in a later session. * **Don’t ask again** : stops the prompt in future sessions. You can still set up the integration anytime with `/chrome`. -If your organization blocks the `claude-in-chrome` MCP server with the [`deniedMcpServers` managed setting](</docs/en/managed-mcp#policy-based-control-with-allowlists-and-denylists>), Claude Code doesn’t show the install prompt. +Two managed MCP policies turn the prompt off: + + * If your organization blocks the `claude-in-chrome` MCP server with the [`deniedMcpServers` managed setting](</docs/en/managed-mcp#policy-based-control-with-allowlists-and-denylists>), Claude Code doesn’t show the install prompt. + * If your organization deploys a [`managed-mcp.json`](</docs/en/managed-mcp#exclusive-control-with-managed-mcp-json>) file without [allowing Claude in Chrome alongside the managed set](</docs/en/managed-mcp#allow-claude-in-chrome-alongside-the-managed-set>), Claude Code doesn’t show the install prompt. ### @@ -98,7 +101,7 @@ Manage site permissions -Site-level permissions are inherited from the Chrome extension. Manage permissions in the Chrome extension settings to control which sites Claude can browse, click, and type on. +Site-level permissions are inherited from the Chrome extension. Manage permissions in the Chrome extension settings to control which sites Claude can browse, click, and type on. In [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), when the auto mode classifier itself approves a browser call to a site, the extension skips its own per-site check for that call, unless your permission rules deny any site to Claude in Chrome. ###
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 @@ -292,7 +292,7 @@ Which machines need the opt-in -Machines that only run Claude Desktop need it. Claude Desktop applies the model list and the disabled-tools list to embedded sessions itself, but the egress allowlist reaches them only as parent settings, in the form of `WebFetch` domain rules and sandbox network rules. Without the opt-in, those sessions run without the egress restriction, and nothing warns you. The gateway still rejects inference requests for models the policy doesn’t grant. Machines where developers sign in through `/login` don’t need it; each Claude Code session fetches its policy from the gateway. Fleets whose [`policyHelper`](</docs/en/settings-reference#policyhelper>) supplies managed settings can’t use it: Claude Code never merges parent settings on those fleets, because it reads managed settings from the helper’s output alone. +Machines that only run Claude Desktop need it. Claude Desktop applies the model list and the disabled-tools list to embedded sessions itself, but the egress allowlist reaches them only as parent settings, in the form of `WebFetch` domain rules and sandbox network rules. Without the opt-in, those sessions run without the egress restriction, and nothing warns you. The gateway still rejects inference requests for models the policy doesn’t grant. A plugin marketplace allowlist also reaches embedded sessions only as parent settings. When you turn user-added plugin marketplaces off in Claude Desktop’s managed configuration, Claude Desktop 2.16120.0 or later hides marketplaces your organization didn’t provision and refuses installs from them. To stop embedded sessions from loading plugins already installed from those marketplaces, it sends them a `strictKnownMarketplaces` list as parent settings. Without the opt-in, Claude Code ignores that list, and those plugins keep loading. Machines where developers sign in through `/login` don’t need it; each Claude Code session fetches its policy from the gateway. Fleets whose [`policyHelper`](</docs/en/settings-reference#policyhelper>) supplies managed settings can’t use it: Claude Code never merges parent settings on those fleets, because it reads managed settings from the helper’s output alone. #### @@ -387,7 +387,7 @@ * **`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. - * **`strictKnownMarketplaces`** : Claude Code honors a parent-supplied plugin marketplace allowlist when the winning managed source doesn’t set one. If your fleet restricts marketplaces, set `strictKnownMarketplaces` in the winning source. Requires Claude Code v2.1.282 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.
modified Claude apps gateway configuration View current →
--- a/claude-apps-gateway-config.md +++ b/claude-apps-gateway-config.md @@ -275,6 +275,23 @@ ECS / EC2| Attach the IAM role to the task definition or instance profile. `auth: {}` picks it up. Anywhere else| Pass credentials via the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` env vars, or set them explicitly in `auth:` with `${VAR}` expansion Region| `region:` is the API endpoint region. Cross-region inference profiles route across the geo (US, EU, APAC) regardless of which one you pick. For non-US regions or provisioned-throughput ARNs, add a `models:` block with the right per-upstream IDs. + +##### Apply an Amazon Bedrock guardrail + +To apply an Amazon Bedrock guardrail to every inference request the gateway sends through a Bedrock upstream, add a `guardrail` block to that upstream. Requires Claude Code v2.1.281 or later on the gateway server. + + upstreams: + - provider: bedrock + region: us-east-1 + auth: {} + guardrail: + id: gr-abc123 # guardrail ID or full ARN + version: "1" # a published version number, or DRAFT + # keep the quotes: a bare 1 fails at boot + +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 the gateway’s AWS principal `bedrock:ApplyGuardrail` on the guardrail. 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. #### @@ -703,7 +720,7 @@ * the sandbox binary settings `sandbox.bwrapPath`, `sandbox.socatPath`, and `sandbox.ripgrep` * Sandbox settings that intercept traffic, inject credentials, or weaken isolation, such as `sandbox.network.tlsTerminate` and the proxy port settings. [Security approval dialogs](</docs/en/server-managed-settings#security-approval-dialogs>) lists them all. -[Approval memory](</docs/en/server-managed-settings#approval-memory>) covers how long an approval lasts and when the dialog appears again. Claude Code applies some delivered `env` variables without showing the developer the approval dialog, such as model selection settings and numeric limits. Other delivered variables can require the developer’s approval before they take effect; a non-empty proxy, base-URL, or `OTEL_EXPORTER_OTLP_ENDPOINT` value always does. When a delivered variable needs approval, the dialog names it. [Environment variables and the approval dialog](</docs/en/server-managed-settings#environment-variables-and-the-approval-dialog>) has the details, including four privacy toggles whose delivered value decides whether they need approval. Before v2.1.218, Claude Code applied fewer variables without asking the developer, so more delivered variables triggered the dialog. The gateway’s telemetry configuration pushes `OTEL_EXPORTER_OTLP_ENDPOINT`, so setting `telemetry.forward_to` triggers the dialog on each interactive client. The dialog protects the developer’s machine from a compromised or hostile gateway, not the organization from the developer. A non-interactive run with the `-p` flag can’t show the dialog. It applies the pushed settings for that run only and doesn’t record them as approved, so the developer’s next interactive session still shows the dialog. Before v2.1.207, a non-interactive run saved the settings as approved and no later interactive session showed the dialog for them. If a developer declines, Claude Code exits that session rather than applying the policy. When you push a new hook, or any env var that triggers the dialog, to a broad policy, Claude Code therefore shows the dialog to every matching developer. It shows the dialog in a running session on the next hourly poll, and otherwise at the developer’s next startup. The `cli` key was named `settings` in earlier releases. That spelling is still accepted as an alias, but new deployments should use `cli`. +[Approval memory](</docs/en/server-managed-settings#approval-memory>) covers how long an approval lasts and when the dialog appears again. Claude Code applies some delivered `env` variables without showing the developer the approval dialog, such as model selection settings and numeric limits. Other delivered variables can require the developer’s approval before they take effect; a non-empty proxy, base-URL, or `OTEL_EXPORTER_OTLP_ENDPOINT` value always does. When a delivered variable needs approval, the dialog names it. [Environment variables and the approval dialog](</docs/en/server-managed-settings#environment-variables-and-the-approval-dialog>) has the details, including four privacy toggles whose delivered value decides whether they need approval. Before v2.1.218, Claude Code applied fewer variables without asking the developer, so more delivered variables triggered the dialog. The gateway’s telemetry configuration pushes `OTEL_EXPORTER_OTLP_ENDPOINT`, so setting `telemetry.forward_to` triggers the dialog on each interactive client. The dialog protects the developer’s machine from a compromised or hostile gateway, not the organization from the developer. A [non-interactive run](</docs/en/server-managed-settings#security-approval-dialogs>), such as `claude -p` or an Agent SDK session, can’t show the dialog. It applies the pushed settings for that run only and doesn’t record them as approved, so the developer’s next interactive session still shows the dialog. Before v2.1.207, a non-interactive run saved the settings as approved and no later interactive session showed the dialog for them. If a developer declines, Claude Code exits that session rather than applying the policy. When you push a new hook, or any env var that triggers the dialog, to a broad policy, every matching developer therefore sees the dialog in their interactive sessions. A running interactive session shows it on the next hourly poll, and otherwise it appears at the developer’s next interactive startup. The `cli` key was named `settings` in earlier releases. That spelling is still accepted as an alias, but new deployments should use `cli`. #### @@ -749,7 +766,7 @@ * A key the gateway computes itself: the inference connection, the model list, and the OTLP relay. Configure those through `upstreams`, `models`, and the `telemetry` section’s `forward_to`. * A legacy alias of a current key. In the boot error, the gateway names the canonical key to write. -If you use a deprecated value or entry shape, such as a `managedMcpServers` entry without `transport`, the gateway starts and logs a warning that names the replacement. The gateway validates a `desktop` block against the schema bundled with its installed version, as it does the `cli` block. To deliver a setting introduced by a newer Claude Desktop release, upgrade the gateway first. For example, `userPluginMarketplacesEnabled` and `userPluginUploadsEnabled` need Claude Code v2.1.260 or later on the gateway server and Claude Desktop 1.37937.0 or later on members’ machines. If you set `orgPluginSettings` in a policy’s `desktop` block, the gateway serves it in the array form that Claude Desktop 1.15200.0 and later reads. Older desktops ignore the array and enforce no plugin tool policy, so update members to 1.15200.0 or later before you rely on it. The gateway fills in keys a policy’s `desktop` block doesn’t set from the `match: {}` catch-all’s `desktop` block, the same way it fills in a policy’s `cli` block from the base. If you set `disabledBuiltinTools` or `builtinToolPolicy` in both the base and a role policy, the gateway keeps the base’s restriction: +If you use a deprecated value or entry shape, such as a `managedMcpServers` entry without `transport`, the gateway starts and logs a warning that names the replacement. The gateway validates a `desktop` block against the schema bundled with its installed version, as it does the `cli` block. To deliver a setting introduced by a newer Claude Desktop release, upgrade the gateway first. For example, `userPluginMarketplacesEnabled` and `userPluginUploadsEnabled` need Claude Code v2.1.260 or later on the gateway server and Claude Desktop 1.37937.0 or later on members’ machines. `blockReadsOutsideWorkingDirectories`, `disableBypassPermissionsMode`, `configRecheckIntervalMinutes`, and `sshClientPath` need Claude Code v2.1.281 or later on the gateway server. So do the `required` value of `microsoftAuthBroker` and the `continuousAccessEvaluation` field of a Microsoft 365 `managedMcpServers` entry. Claude Desktop releases that predate the `required` value read it as `disabled`, so set `required` only after every member’s Claude Desktop supports it. Claude Desktop’s [managed configuration reference](<https://claude.com/docs/third-party/claude-desktop/configuration>) lists the release that first reads each key. If you set `orgPluginSettings` in a policy’s `desktop` block, the gateway serves it in the array form that Claude Desktop 1.15200.0 and later reads. Older desktops ignore the array and enforce no plugin tool policy, so update members to 1.15200.0 or later before you rely on it. The gateway fills in keys a policy’s `desktop` block doesn’t set from the `match: {}` catch-all’s `desktop` block, the same way it fills in a policy’s `cli` block from the base. If you set `disabledBuiltinTools` or `builtinToolPolicy` in both the base and a role policy, the gateway keeps the base’s restriction: * `disabledBuiltinTools`: the gateway uses the union of the base’s list and the policy’s list * `builtinToolPolicy`: if you set a tool to a value other than `allow` in the base, the gateway keeps that value even if you set `allow` for the same tool in a role policy @@ -770,7 +787,7 @@ `telemetry` -The CLI sends metrics, logs, and, when enabled, traces to the gateway, which relays them verbatim to each configured destination. The exports use OpenTelemetry Protocol (OTLP) over HTTP. To skip the relay and have sessions export straight to your collector, name the collector in a policy. See [Monitoring usage](</docs/en/monitoring-usage>) for the metrics and events the CLI emits. The CLI stamps each export with the authenticated user’s identity, read from the gateway-issued JWT: the `user.id`, `user.email`, and `user.groups` attributes. Per-developer cost and usage attribution therefore works with no developer-side configuration. Claude Desktop and Cowork sessions signed in through the gateway stamp their telemetry with `user.email` and `user.groups` alongside `enduser.id`, so you can cover terminal, Desktop, and Cowork usage with one query on `user.email` or `user.groups`. `user.groups` is the comma-separated IdP group list. Desktop and Cowork telemetry also carries `enduser.sub`, the `sub` claim your identity provider issues for the user, which stays the same when a user’s email changes. Terminal sessions stamp the same value under `user.id`, so a query that matches `enduser.sub` against terminal `user.id` covers one user’s terminal, Desktop, and Cowork usage together. On Desktop and Cowork exports, `user.id` is an anonymous identifier, not the subject. Like all OpenTelemetry data from Claude Code, these attributes go only to destinations your organization configures, never to Anthropic. If a user’s group list is longer than 255 characters once percent-encoded, or a group name contains a comma or equals sign, the gateway leaves `user.groups` off that user’s Desktop and Cowork telemetry rather than truncating it. That user’s terminal sessions still carry the full list. The gateway leaves `enduser.sub` off when the subject is longer than 255 characters once percent-encoded, or contains a space, a character outside printable ASCII, or one of `,` `;` `=` `\` `"` `%`. That user’s Desktop and Cowork telemetry keeps its other attributes. You need Claude Code v2.1.265 or later on the gateway server for `user.email` and `user.groups` on Desktop and Cowork telemetry, and Claude Desktop 1.24012 or later on each developer’s machine for `user.groups`. You need Claude Code v2.1.274 or later on the gateway server for `enduser.sub`. +The CLI sends metrics, logs, and, when enabled, traces to the gateway, which relays them verbatim to each configured destination. The exports use OpenTelemetry Protocol (OTLP) over HTTP. To skip the relay and have sessions export straight to your collector, name the collector in a policy. See [Monitoring usage](</docs/en/monitoring-usage>) for the metrics and events the CLI emits. In sessions signed in through `/login`, the CLI stamps each export with the authenticated user’s identity, read from the gateway-issued JWT: the `user.id`, `user.email`, and `user.groups` attributes. Per-developer cost and usage attribution therefore works with no developer-side configuration. Claude Desktop and Cowork sessions signed in through the gateway stamp their telemetry with `user.email` and `user.groups` alongside `enduser.id`, so you can cover terminal, Desktop, and Cowork usage with one query on `user.email` or `user.groups`. `user.groups` is the comma-separated IdP group list. Desktop and Cowork telemetry also carries `enduser.sub`, the `sub` claim your identity provider issues for the user, which stays the same when a user’s email changes. Terminal sessions stamp the same value under `user.id`, so a query that matches `enduser.sub` against terminal `user.id` covers one user’s terminal, Desktop, and Cowork usage together. On Desktop and Cowork exports, `user.id` is an anonymous identifier, not the subject. Like all OpenTelemetry data from Claude Code, these attributes go only to destinations your organization configures, never to Anthropic. If a user’s group list is longer than 255 characters once percent-encoded, or a group name contains a comma or equals sign, the gateway leaves `user.groups` off that user’s Desktop and Cowork telemetry rather than truncating it. That user’s terminal sessions still carry the full list. The gateway leaves `enduser.sub` off when the subject is longer than 255 characters once percent-encoded, or contains a space, a character outside printable ASCII, or one of `,` `;` `=` `\` `"` `%`. That user’s Desktop and Cowork telemetry keeps its other attributes. You need Claude Code v2.1.265 or later on the gateway server for `user.email` and `user.groups` on Desktop and Cowork telemetry, and Claude Desktop 1.24012 or later on each developer’s machine for `user.groups`. You need Claude Code v2.1.274 or later on the gateway server for `enduser.sub`. telemetry: forward_to:
modified Claude apps gateway deployment and operations View current →
--- a/claude-apps-gateway-deploy.md +++ b/claude-apps-gateway-deploy.md @@ -264,7 +264,7 @@ ---|---|--- Inference (prompts, completions)| CLI → gateway → your upstream| Only if the Anthropic API is a configured upstream Telemetry (OTLP metrics, plus [opt-in logs and traces](</docs/en/claude-apps-gateway-config#telemetry>))| CLI → gateway → your collector| Never -Identity (email, groups, sub)| IdP → gateway → JWT → CLI; the CLI stamps it on OTLP exports. If you turn on [`forward_user_identity`](</docs/en/claude-apps-gateway-config#per-user-identity-headers-for-a-proxy-you-run>), the gateway also sends the developer’s email and IdP subject as headers to your proxy| Never +Identity (email, groups, sub)| IdP → gateway → CLI; the CLI stamps it on OTLP exports. If you turn on [`forward_user_identity`](</docs/en/claude-apps-gateway-config#per-user-identity-headers-for-a-proxy-you-run>), the gateway also sends the developer’s email and IdP subject as headers to your proxy| Never Managed settings| Your gateway YAML → CLI| Never Audit log| Gateway stderr → your aggregator| Never
modified Deploy Claude apps gateway on AWS View current →
--- a/claude-apps-gateway-on-aws.md +++ b/claude-apps-gateway-on-aws.md @@ -452,7 +452,7 @@ Telemetry -The gateway gives you per-developer usage metrics without any per-machine OTEL configuration. Claude Code emits OpenTelemetry (OTLP) metrics, logs, and opt-in traces; [Monitoring usage](</docs/en/monitoring-usage>) covers everything the CLI reports. On gateway sessions the CLI stamps each export with the authenticated IdP identity attributes `user.id`, `user.email`, and `user.groups`, so usage rolls up per developer with no `OTEL_RESOURCE_ATTRIBUTES` plumbing. The gateway itself is an authenticated OTLP relay. Set [`telemetry.forward_to`](</docs/en/claude-apps-gateway-config#telemetry>) together with `listen.public_url`, and it pushes the OTEL exporter settings to every connected client and forwards their OTLP traffic verbatim to each destination you list. Each destination opts into metrics, logs, and traces independently, and the default is metrics only; see the [`telemetry` reference](</docs/en/claude-apps-gateway-config#telemetry>) for the per-signal fields and their sensitivity tradeoffs. The gateway doesn’t buffer, aggregate, or store telemetry, so where the data lands is entirely the collector’s exporter configuration. Client telemetry is off by default; configuring `telemetry.forward_to` is what turns it on for connected developers, and each interactive client shows a security approval dialog for the pushed settings, as described in the [configuration reference](</docs/en/claude-apps-gateway-config#telemetry>). On AWS, each signal maps to a destination as follows. +The gateway gives you per-developer usage metrics without any per-machine OTEL configuration. Claude Code emits OpenTelemetry (OTLP) metrics, logs, and opt-in traces; [Monitoring usage](</docs/en/monitoring-usage>) covers everything the CLI reports. In sessions signed in through `/login`, the CLI stamps each export with the authenticated IdP identity attributes `user.id`, `user.email`, and `user.groups`, so usage rolls up per developer. The gateway itself is an authenticated OTLP relay. Set [`telemetry.forward_to`](</docs/en/claude-apps-gateway-config#telemetry>) together with `listen.public_url`, and it pushes the OTEL exporter settings to every connected client and forwards their OTLP traffic verbatim to each destination you list. Each destination opts into metrics, logs, and traces independently, and the default is metrics only; see the [`telemetry` reference](</docs/en/claude-apps-gateway-config#telemetry>) for the per-signal fields and their sensitivity tradeoffs. The gateway doesn’t buffer, aggregate, or store telemetry, so where the data lands is entirely the collector’s exporter configuration. Client telemetry is off by default; configuring `telemetry.forward_to` is what turns it on for connected developers, and each interactive client shows a security approval dialog for the pushed settings, as described in the [configuration reference](</docs/en/claude-apps-gateway-config#telemetry>). On AWS, each signal maps to a destination as follows. ###
modified Use Claude Code in the cloud View current →
--- a/claude-code-on-the-web.md +++ b/claude-code-on-the-web.md @@ -110,6 +110,7 @@ * The directory must be a git repository with at least one commit * The bundled repository must be under 100 MB. Larger repositories fall back to bundling only the current branch, then to a single squashed snapshot of the working tree, and fail if the snapshot is still too large * Untracked files are not included; run `git add` on files you want the cloud session to see + * On macOS, Linux, and WSL, Claude Code refuses the upload when it can’t follow a git setting that affects which attribute rules apply to your files, such as `core.attributesFile` set in an included config file. The [refusal message](</docs/en/errors#the-repository-upload-cant-follow-a-git-setting>) names the setting and the fix * Sessions created from a bundle can push back to a GitHub remote only when your GitHub connection has push access to that repository ###
modified Explore the .claude directory View current →
--- a/claude-directory.md +++ b/claude-directory.md @@ -145,6 +145,7 @@ `feedback/drafts/`| Queued [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>) awaiting your review in `/feedback`. Swept after `cleanupPeriodDays` or 30 days, whichever is shorter. When the queue is at its 10-draft limit, Claude Code deletes the oldest draft to make room. `usage-data/`| `report.html` and timestamped report copies written by [`/insights`](</docs/en/costs#analyze-your-usage-patterns>), plus cached per-session analysis data used to build them `skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins/loading#synced-plugins>) that the claude.ai sync removed, such as after you turn one off on claude.ai or stop syncing. The files stay here so you can recover them until the sweep deletes them +`plugins/installed_plugins.set-aside.<date>.<hash>.json`, `plugins/installed_plugins.unreadable.<date>.<hash>.kept`| Dated copies Claude Code makes before rewriting [`installed_plugins.json`](</docs/en/plugins/loading#find-plugins-on-disk>): install records it dropped, and the contents of a file it couldn’t read. `todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory. Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule: @@ -269,6 +270,7 @@ `~/.claude/policy-limits.json`| Nothing. Refreshed automatically. `~/.claude/tasks/`| Task lists that a resumed session would pick up `~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/`| The chance to recover [synced skills](</docs/en/skills#how-synced-skills-behave>) and [synced plugins](</docs/en/plugins/loading#synced-plugins>) that Claude Code removed +`~/.claude/plugins/installed_plugins.set-aside.<date>.<hash>.json`, `~/.claude/plugins/installed_plugins.unreadable.<date>.<hash>.kept`| The copies of plugin install records that Claude Code dropped or couldn’t read. Nothing reads them back `~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing `~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`, `~/.claude/image-cache/`| Nothing. Legacy directories not written by current versions.
modified Let Claude coordinate ongoing work with Projects View current →
Show diff (113 lines)
--- a/claude-projects.md +++ b/claude-projects.md @@ -66,7 +66,7 @@ You create and use projects at [claude.ai/code](<https://claude.ai/code>), in the Code tab of the desktop app, or in the Claude mobile app for [iOS](<https://apps.apple.com/us/app/claude-by-anthropic/id6473753684>) and [Android](<https://play.google.com/store/apps/details?id=com.anthropic.claude>). In the browser and the desktop app there are two ways to start a project: * **From scratch** , when you know the stream of work you want Claude to run: open the **New project** dialog and name it. Start a new project from scratch walks through the dialog. - * **From a cloud session that’s already doing the work** : choose **Continue as a project** from that session’s menu, and Claude proposes the project’s setup from what the session was doing. See Start from an existing cloud session. + * **From a cloud session that’s already doing the work** : choose **Continue as project** from that session’s menu, and Claude proposes the project’s setup from what the session was doing. See Start from an existing cloud session. Either way, check the prerequisites first. @@ -125,10 +125,12 @@ Start from an existing cloud session -If you already have a cloud session doing work that belongs in a project, open the session’s menu in the sidebar and choose **Continue as a project** or **Move to project** : - - * **Continue as a project** creates a new project named after the session and opens it. Claude reads the session and posts **Setup recommendations** in the conversation for you to confirm. The original session stays in your session list, and if it was in the middle of a turn it keeps running, so stop it yourself if you don’t want both working at once. If you use the **Set up project** banner that can appear above a cloud session’s message box instead, the result is the same, except that the session’s running turn stops once the project opens. +If you already have a cloud session doing work that belongs in a project, open the session’s menu in the sidebar and choose **Continue as project** or **Move to project** : + + * **Continue as project** creates a new project named after the session and opens it. Claude reads the session and posts **Setup recommendations** in the conversation for you to confirm. The original session stays in your session list, and if it was in the middle of a turn it keeps running, so stop it yourself if you don’t want both working at once. If you use the **Set up project** banner that can appear above a cloud session’s message box instead, the result is the same, except that the session’s running turn stops once the project opens. * **Move to project** brings the session’s work into an existing project. It posts a message in that project’s conversation asking Claude to read the session and pick up where it left off, and new work continues in the project’s own threads. The original session stays in your session list, unchanged. + +A local session doesn’t have these options. To continue its work in a project, describe the work in the project conversation, or push its branch, add that repository to the project, and name the branch in the task. ### @@ -283,7 +285,7 @@ Unblock a thread waiting on approval -Threads run in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) when the thread’s model supports it, so most tool calls run without asking you. When a thread needs your approval, the prompt is inside that thread and the thread waits until you answer it there. Telling Claude in the project conversation to go ahead doesn’t reach it. Each approval covers that prompt, or the rest of that thread if you choose the broader option. To let every thread run certain commands without asking, or to block some, add [permission rules](</docs/en/permissions>) to the repository’s `.claude/settings.json`. Cloud threads apply them only in a project with one repository; see What threads pick up from your repositories. +Threads run in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) when the thread’s model supports it, so most tool calls run without asking you. When a thread needs your approval, the prompt is inside that thread and the thread waits until you answer it there. Telling Claude in the project conversation to go ahead doesn’t reach it. Each approval covers that prompt, or the rest of that thread if you choose the broader option. To let every thread run certain commands without asking, or to block some, add [permission rules](</docs/en/permissions>) to the repository’s `.claude/settings.json`. Cloud threads apply them only in a project with one repository; see What threads pick up from your repositories. In a project with several repositories, no repository’s permission rules reach a cloud thread, so you rely on auto mode and on the approvals you give inside each thread. ### @@ -293,7 +295,7 @@ When a task needs something only your computer has, such as a local database, a device emulator, or an API behind your VPN, ask Claude to run the thread for that task on your computer instead of in the cloud. When you ask in the project conversation, the thread is a Claude Code session in a folder on your machine, connected through [Remote Control](</docs/en/remote-control>). The project’s other threads keep running in the cloud. Compared with a cloud thread, a thread on your computer: - * Works with the files, tools, MCP servers, and Claude Code settings on that machine instead of the project’s cloud environment + * Works with the files, tools, MCP servers, and Claude Code settings on that machine, including its hooks and permission rules, instead of the project’s cloud environment * Starts with the project’s instructions, but not with its memory files loaded * Runs only while that computer is awake with Remote Control turned on @@ -304,7 +306,7 @@ On the computer that has the folder the task needs, make it available through Remote Control in one of two ways. Both need Claude Code v2.1.280 or later on that computer. * **In the Claude desktop app** : open **Settings > Claude Code**, turn on **Use this computer from your phone and claude.ai** , and add the folder to the list under that switch. Threads can run on this computer while the app is open. - * **In a terminal** : run `claude remote-control` in the folder and leave it running. + * **In a terminal** : run `claude remote-control` in the folder and leave it running. In a git repository, add `--spawn worktree` to give each thread there its own [worktree](</docs/en/worktrees>) instead of the folder itself. 2 @@ -316,7 +318,7 @@ Allow it on the card -Claude answers with an **Allow Claude to work in a folder on your device** card. Pick the folder if you connected several. Then click **Allow once**. +Claude answers with an **Allow Claude to work in a folder on your device** card. Pick the folder if you connected several. Two threads working in one folder at the same time can overwrite each other’s changes, so if the folder is a git repository, you can turn on **Worktree** in the folder’s options to give this thread its own worktree instead. Then click **Allow once**. The thread runs in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), so Claude runs commands and edits files in that folder without asking you each time. If auto mode is unavailable or turned off in that computer’s Claude Code, the thread runs without it, and any permission prompt it raises waits for your answer in the thread, as Unblock a thread waiting on approval describes. While the thread runs, a laptop icon in its header shows whether your computer is connected. Click it to see which folder the thread is using or to turn the connection off. The thread pauses while that computer is asleep, and stops if the desktop app or `claude remote-control` quits. Lost contact with your folder covers getting it going again. In the desktop app, turn on **Keep this computer awake for Remote Control** under **Settings > Claude Code** to stop the computer from sleeping on its own. A project can’t run a thread on your computer while [**Require trusted devices**](</docs/en/remote-control#trusted-devices>) is on for your account. @@ -373,6 +375,19 @@ * **Leave it off and let threads add it when needed.** A cloud thread whose task needs a repository the project doesn’t have can add it to itself, and a note in the thread says it was added to this thread only. The clone happens partway through the task, so that repository’s `CLAUDE.md` and skills weren’t there when the thread started. The next thread starts without it. A repository added this way needs the same prerequisites as a project repository: the Claude GitHub App installed on it and push access from your GitHub account. A project doesn’t need a repository at all. Its cloud threads can still research, write documents, and write and run code in their own sandbox, and they deliver files to the **Library** tab. Any of its cloud threads can still add a repository to itself when a task calls for one. Once the project has repositories, Claude can only add repositories from a GitHub owner the project already uses, whether it adds one to the project or a thread adds one to itself. To bring in a repository from a different owner, add it to the project yourself in **Project settings > Environment**. For a project that spans many repositories, such as one feature with server, web, mobile, and desktop code, add the one or two repositories nearly every task touches and name the others in project instructions so Claude knows where the rest of the code lives. Cloud threads then start small and pull in the other repositories only for the tasks that need them. + +### + +​ + +Add files and folders + +Add the files and folders you want threads to read in the **New project** dialog’s **Context** field, or afterward with **Add** on the **Library** tab in **Overview**. These limits apply to what you add: + + * **Library tab** : up to 100 files and 2 GB in one pick, with a single file up to 480 MB. + * **New project dialog** : files over 30 MB are skipped, so add larger files from the **Library** tab after you create the project. + * **Folders** : when you add a folder from either place, the project receives a copy of its first 100 files up to 200 MB, without any files over 30 MB, hidden files, or `node_modules`. A project holds up to 10 folders and Google Drive folders combined, and single files don’t count toward that limit. + * **Changes after upload** : uploads are copies, so a change you make on your computer afterward doesn’t reach the project until you upload the file again and choose **Replace** when asked about the existing name. ### @@ -492,12 +507,13 @@ Several Claude Code features let more than one session work at the same time, so running work in parallel is not by itself what a project is for. In a project, Claude starts and tracks the sessions instead of you, and each one starts from the same instructions. This is how each neighboring feature connects to a project: * **Claude Tag** : [Claude Tag](<https://claude.com/docs/claude-tag/overview>) is Claude in your team’s Slack channels, on Team and Enterprise plans. Anyone in a channel can give it work, everyone in the channel sees and steers it, and it uses connections an admin set up for that channel. A project is yours alone: you’re the only one who sends it work or sees its threads, it uses your own GitHub access and connectors, and it’s on Pro and Max. [How Claude Tag differs from Cowork and Claude Code](<https://claude.com/docs/claude-tag/concepts/how-it-works#how-claude-tag-differs-from-cowork-and-claude-code>) has the side-by-side. - * **Cloud sessions** : every thread is a [cloud session](</docs/en/claude-code-on-the-web>) unless you ask Claude to run it on your machine. Either way, Claude starts and tracks it instead of you. A cloud session you started yourself can become a project or feed one through **Continue as a project** or **Move to project**. + * **Cloud sessions** : every thread is a [cloud session](</docs/en/claude-code-on-the-web>) unless you ask Claude to run it on your machine. Either way, Claude starts and tracks it instead of you. A cloud session you started yourself can become a project or feed one through **Continue as project** or **Move to project**. * **Routines** : when you ask for scheduled work in a project, Claude creates a [routine](</docs/en/routines>) that runs as threads in that project and appears on its **Routines** tab. Routines you create outside a project keep working on their own. * **Remote Control** : [Remote Control](</docs/en/remote-control>) connects claude.ai to a Claude Code session running on your machine. When you ask Claude in a project to run a thread on your computer, the project uses Remote Control to do it. * **Local sessions and agent view** : a session you start yourself in your terminal, IDE, or the desktop app’s local environment can’t be added to a project. [Agent view](</docs/en/agent-view>) is a screen for tracking several local sessions side by side, and you still start each one and give it its task yourself. * **Worktrees** : a [worktree](</docs/en/worktrees>) gives each local session its own working copy of a repository so parallel sessions on your machine don’t overwrite each other. Cloud threads don’t need them: each clones its repositories into its own cloud sandbox and works on its own branch. * **Agent teams** : an [agent team](</docs/en/agent-teams>) is one session that starts teammate sessions for a single task, on your machine or inside a cloud session, and ends with that task. + * **Subagents** : a [subagent](</docs/en/sub-agents>) runs inside one session, does a side task in its own context window, and returns a summary to that session. A project’s threads are whole sessions that Claude starts and that report back to the project conversation, and a thread can still use subagents for its own side tasks. * **Projects in claude.ai chat and Cowork** : the [earlier Projects experience](<https://support.claude.com/en/articles/9517075-what-are-projects>), which groups conversations and reference files without threads or a coordinator. Those projects keep working as they do today until the redesigned experience reaches them. [Run agents in parallel](</docs/en/agents>) compares these options side by side. @@ -508,12 +524,12 @@ Limitations - * Projects are available at claude.ai/code, in the desktop app, and in the Claude mobile app, not in the terminal CLI or through Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. The CLI’s [`claude project`](</docs/en/cli-reference>) command, which manages local Claude Code state for a directory, is unrelated. + * Projects are available at claude.ai/code, in the desktop app, and in the Claude mobile app, not in the terminal CLI, the VS Code extension, or the JetBrains plugin, and not through Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. The CLI’s [`claude project`](</docs/en/cli-reference>) command, which manages local Claude Code state for a directory, is unrelated. * Project threads are [cloud sessions](</docs/en/claude-code-on-the-web>), or sessions on your own machine through [Remote Control](</docs/en/remote-control>), with Anthropic as the model provider in both cases. [Security](</docs/en/security>) and [Data usage](</docs/en/data-usage>) cover how cloud sessions are isolated and what’s retained, and [Connection and security](</docs/en/remote-control#connection-and-security>) covers how a thread on your machine connects and what’s stored. * You can’t add a session you started yourself on your machine to a project. A project reaches your machine only by running a thread there through Remote Control, and that section lists what it needs. * A cloud thread’s sandbox pauses between turns and resumes when the thread continues. If the sandbox can’t be resumed, the thread continues from a fresh clone, so uncommitted changes can be lost. On long tasks, ask Claude to commit and push work in progress. * A project belongs to one user. You can’t share a project or its threads with another user, and thread transcripts don’t have the share option other cloud sessions have. There are no organization-level controls for projects during the beta. - * A thread belongs to the one project that started it. You can’t move or copy a thread to another project, or move it out to stand alone. **Move to project** goes the other way only: it brings a cloud session’s work into a project. + * A thread belongs to the one project that started it. You can’t move or copy a thread to another project, or move it out to stand alone. **Move to project** goes the other way only: it brings a cloud session’s work into a project. You can’t merge two projects into one. ##
modified Scan your codebase for vulnerabilities View current →
--- a/claude-security.md +++ b/claude-security.md @@ -1,4 +1,4 @@ -The Claude Security plugin runs a multi-agent vulnerability scan of your codebase inside a Claude Code session. A team of Claude agents maps your architecture, builds a threat model, hunts for vulnerabilities, and independently reviews every finding before writing the report. Use the plugin to scan a whole repository or only a set of changes, such as a branch’s diff, a pull request’s diff, or a single commit, then turn the findings you choose into patches that you review and apply yourself. The plugin runs locally in your session, uses whichever models you have access to in Claude Code, and each scan counts against your plan’s usage limits. If you want a managed service that monitors your repositories, or want to run scans on [Claude Mythos 5](<https://platform.claude.com/docs/en/about-claude/models/introducing-claude-fable-5-and-claude-mythos-5>), see the [Claude Security](<https://claude.com/product/claude-security>) product, available on the Enterprise plan. The plugin reaches code the managed product can’t reach, such as repositories hosted on GitLab or Bitbucket, or on networks that don’t allow inbound connections. The plugin is also distinct from the review tools already in Claude Code: the [security guidance plugin](</docs/en/security-guidance>) reviews code as Claude writes it, [`/security-review`](</docs/en/commands#all-commands>) runs a single pass over your branch, and [Code Review](</docs/en/code-review>) reviews pull requests. For how the layers stack, see How the plugin fits with other security tools. +The Claude Security plugin runs a multi-agent vulnerability scan of your codebase inside a Claude Code session. A team of Claude agents maps your architecture, builds a threat model, hunts for vulnerabilities, and independently reviews every finding before writing the report. Use the plugin to scan a whole repository or only a set of changes, such as a branch’s diff, a pull request’s diff, or a single commit, then turn the findings you choose into patches that you review and apply yourself. The plugin runs locally in your session, uses whichever models you have access to in Claude Code, and each scan counts toward your [usage](</docs/en/costs>). If you want a managed service that monitors your repositories, or want to run scans on [Claude Mythos](<https://platform.claude.com/docs/en/about-claude/models/introducing-claude-fable-5-and-claude-mythos-5>), see the [Claude Security](<https://claude.com/product/claude-security>) product, available on the Enterprise plan. The plugin reaches code the managed product can’t reach, such as repositories hosted on GitLab or Bitbucket, or on networks that don’t allow inbound connections. The plugin is also distinct from the review tools already in Claude Code: the [security guidance plugin](</docs/en/security-guidance>) reviews code as Claude writes it, [`/security-review`](</docs/en/commands#all-commands>) runs a single pass over your branch, and [Code Review](</docs/en/code-review>) reviews pull requests. For how the layers stack, see How the plugin fits with other security tools. ## @@ -8,10 +8,23 @@ To run the plugin, you need: - * A paid plan, for the [dynamic workflows](</docs/en/workflows>) the scan uses to orchestrate its agents. On Pro, turn them on from the Dynamic workflows row in `/config`. + * A paid plan, Anthropic API access, or a third-party provider, for the [dynamic workflows](</docs/en/workflows>) the scan uses to orchestrate its agents. On Pro, turn them on from the Dynamic workflows row in `/config`. * Python 3.9 or later available on your `PATH` as `python3`. Check with `python3 --version`. The plugin’s tooling uses only the Python standard library, so nothing is installed. * Linux, macOS, or Windows. * Git, for change scans and for turning findings into patches; those jobs don’t support other version control systems. A full scan works in any directory, with or without version control. + +## + +​ + +Models and providers + +A scan runs inside your Claude Code session. The plugin makes no model calls of its own, so there’s no separate API key or provider setting to configure. + + * **Model** : the agents that hunt for vulnerabilities, verify findings, and write and review patches run on [your session’s model](</docs/en/sub-agents#choose-a-model>). To change it, run [`/model`](</docs/en/model-config#setting-your-model>) in your session before you start a scan. A few supporting steps, such as mapping the repository, use the [`sonnet` alias](</docs/en/model-config#model-aliases>) instead. + * **Provider** : scans run on a paid plan, with Anthropic API access, or on a [third-party provider](</docs/en/third-party-integrations>) such as [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>). + +On a third-party provider, the `sonnet` alias can resolve to a different version than it does on the Anthropic API. If your account can’t use that version, [pin your model versions](</docs/en/model-config#pin-models-for-third-party-deployments>), including `ANTHROPIC_DEFAULT_SONNET_MODEL`. [Automatic model fallback](</docs/en/model-config#automatic-model-fallback>) re-runs a request that a model’s safeguards flag. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the request can end with a refusal message instead, depending on [how your deployment is set up](</docs/en/model-config#enable-fallback-on-bedrock-agent-platform-and-foundry>). ## @@ -160,7 +173,7 @@ Troubleshooting -**The`/claude-security` menu opens with a Python warning.** The plugin needs `python3` 3.9 or later on your `PATH`. When it can’t find `python3` at all, the menu warns that Claude Security won’t work until one is installed; when the first `python3` on your `PATH` is older, the warning names the version it found. Install Python 3, or put a newer `python3` first on your `PATH`, then start a new session. **You may see a “safeguards flagged this message” notice when scanning on a Fable model.** The message names the model, for example “Fable 5.1’s safeguards flagged this message”. Fable’s cybersecurity safety classifiers flag certain requests, and Claude Code re-runs a flagged request on an Opus model through [automatic model fallback](</docs/en/model-config#automatic-model-fallback>). This is expected, and the scan should still complete successfully. +**The`/claude-security` menu opens with a Python warning.** The plugin needs `python3` 3.9 or later on your `PATH`. When it can’t find `python3` at all, the menu warns that Claude Security won’t work until one is installed; when the first `python3` on your `PATH` is older, the warning names the version it found. Install Python 3, or put a newer `python3` first on your `PATH`, then start a new session. **You may see a “safeguards flagged this message” notice when scanning on a Fable model.** The message names the model you’re running. Fable’s cybersecurity safety classifiers flag certain requests, and Claude Code re-runs a flagged request on an Opus model through [automatic model fallback](</docs/en/model-config#automatic-model-fallback>). This is expected. When the request re-runs, the scan should still complete successfully. ##
added Claude Tag View current →
Show diff (147 lines)
--- a/claude-tag.md +++ b/claude-tag.md @@ -0,0 +1,144 @@ +Public Beta + +Tag @Claude in. Get results back in the thread. + +Anyone in a Slack channel can tag Claude into a problem and hand it work: reproduce a bug and open a pull request, turn a decision thread into a doc, assemble the state of a project. It posts a checklist in the thread as it goes, and the whole exchange stays visible to the channel. + +[I’m setting it up →](</docs/claude-tag/admins/setup-overview>)Use it in your channel ↓ + +# platform-eng38 members + +D + +Dana2:14 PM + +checkout has felt slow all morning — anyone else seeing it? + +L + +Leo2:15 PM + +same. @Claude can you investigate? Compare latency against this morning’s deploy and find what’s causing it. + +ClaudeAPP2:15 PM + +On it. I’ll compare latency before and after the deploy, track down the cause, and report back here. + +Done: Pulled p99 latency from DatadogDone: Diffed deploy 4f2c1 against mainDone: Reproduced the slow query locallyIn progress: Opening a pull request with the fix… + +## + +​ + +Plans that include Claude Tag + +Claude Tag is available on Team and Enterprise plans, on Anthropic’s first-party service. It isn’t available on individual plans (Free, Pro, or Max), or for third-party deployments. To use it, your organization pairs its Slack workspace with its Claude organization; see [the setup overview](</docs/claude-tag/admins/setup-overview>) for the full prerequisites. If you’re choosing between Claude products for Slack-shaped work, [how Claude Tag differs from Cowork and Claude Code](</docs/claude-tag/concepts/how-it-works#how-claude-tag-differs-from-cowork-and-claude-code>) compares them directly: team work in shared channels is Claude Tag; personal work on your own files is Cowork or Claude Code. + +### + +​ + +Who needs a Claude seat + +Slack users don’t each need a Claude seat to work with Claude in channels. + + * **In channels** : by default, anyone in the paired Slack workspace can tag `@Claude` in a channel, and an Owner can [restrict who can use Claude](</docs/claude-tag/admins/restrict-access#restrict-who-can-use-claude>) to people in your Claude organization or, on Enterprise, to specific roles. Channel work bills by usage to your organization’s usage balance, under a [spend limit](</docs/claude-tag/admins/set-spend-limit>) an Owner sets. + * **In DMs** : a DM from a member who has connected a Claude account runs on that account and bills to that person’s seat. The seat must include Claude Code, or, on the Enterprise plan, be a **Standard** or **Usage-Based Chat** seat held by someone who also has Cowork. A [DM from a member who hasn’t connected a Claude account](</docs/claude-tag/admins/restrict-access#direct-messages-from-members-without-a-claude-account>) can bill to your organization for a limited time. + +## + +​ + +Where Claude Tag runs + +Claude Tag works in Slack. You interact with it by writing in a Slack channel, thread, or direct message, and it replies there. Mention `@Claude` in a channel to guarantee it picks the message up. When Claude works on a task, it runs in an ephemeral sandbox, not on your computer. The sandbox is created when a conversation starts, holds any code or files Claude is working with, and is discarded when the conversation goes idle. See [how Claude Tag works](</docs/claude-tag/concepts/how-it-works>) for the full lifecycle. You extend what Claude can reach, like your repositories, ticketing systems, data warehouses, and custom tools, through [connections](</docs/claude-tag/admins/add-connections>), [plugins, and skills](</docs/claude-tag/admins/customize>). An Owner configures these per scope (a channel, a workspace, or the whole organization). Members’ own claude.ai connectors are separate from that configuration; Claude can use them in a channel for the member’s own requests, as [personal connectors in channels](</docs/claude-tag/concepts/personal-connectors>) describes. + +[For administratorsSet up Claude Tag](</docs/claude-tag/admins/setup-overview>) + +[Where do I start?Pair your Slack workspace, connect the services Claude will work in, launch, and test that it works](</docs/claude-tag/admins/setup-overview>)[What can Claude Tag access?How admins set access per channel, and where credentials are stored](</docs/claude-tag/concepts/agent-identity>)[How do I connect each service?Credential types, allowed hosts, and what each connection lets Claude reach](</docs/claude-tag/admins/add-connections>) + +For end usersPut Claude Tag to work + +[How do I hand Claude Tag a task?Mention Claude in any channel it’s in, with nothing to install](</docs/claude-tag/users/getting-started>)[What is Claude Tag good at?Use cases for coding, data, incidents, and go-to-market](</docs/claude-tag/users/use-cases>)[How do I get good results?Good habits for scoping and reviewing work](</docs/claude-tag/users/good-habits>)[What does Claude Tag remember?Channel memory, what’s shared across the workspace, and who can see what](</docs/claude-tag/users/memory>)[Can Claude Tag run tasks on a schedule?Scheduled jobs, channel watching, and triggers](</docs/claude-tag/users/proactivity>) + +## + +​ + +Billing and spend limits + +Adding Claude to Slack doesn’t add a per-seat charge. Channel and thread work is billed by usage instead: it draws from a **usage balance** , an amount in your organization’s billing currency that an Owner funds. A [spend limit](</docs/claude-tag/admins/set-spend-limit>) caps how much of that balance Claude Tag can use each billing period. Direct messages from members who have connected a Claude account don’t draw from this balance. Such a DM runs on the sender’s own claude.ai account and follows that seat’s usual usage limits, so the organization spend limit doesn’t apply to it. A [DM from a member who hasn’t connected a Claude account](</docs/claude-tag/admins/restrict-access#direct-messages-from-members-without-a-claude-account>) can draw from this balance. To learn what your team’s usage costs, run a pilot with a spend limit set and watch the per-channel breakdown on the [usage page in your admin settings](<https://claude.ai/admin-settings/usage/claude-tag>). Your organization may already have a [launch usage credit](<https://support.claude.com/en/articles/15575654-claude-tag-launch-promo-for-claude-team-and-enterprise>) to run that pilot against before it funds the balance itself. The usage page doesn’t count usage that a credit covers, so that usage shows as $0.00 there. While the credit covers your pilot, watch the **List price** column of the **Spend by channel** table at [`claude.ai/analytics/claude-tag`](<https://claude.ai/analytics/claude-tag>) instead. That column shows each channel’s list-price spend for the current month, including covered usage. [Set a spend limit](</docs/claude-tag/admins/set-spend-limit>) covers how to fund the balance on each plan, set the limit, and what happens when usage reaches it. + +For end users + +## + +​ + +Put Claude Tag to work + +If Claude Tag is in your channel, you can use it now. (If it isn’t there yet, an Owner in your Claude organization runs setup: see [Set up Claude Tag](</docs/claude-tag/admins/setup-overview>).) Anyone in the channel can hand it work, and channel work bills to the organization, not to you. What it can reach starts with the channel you’re in. The fastest way to find out is to ask it: `@Claude what can you access from this channel?` Or, if you’re signed in to your Claude organization, click **Configure** in the footer of a Claude reply in the channel to see its [connections](</docs/claude-tag/concepts/glossary#connection>), the external services an admin has connected for that channel. Replies in org-shared channels have no Configure link. For your own requests, Claude can also [use the connectors on your claude.ai account](</docs/claude-tag/concepts/personal-connectors>), after you allow it. The one exception is a DM, where it runs on your own claude.ai account instead of the channel’s setup. Owners can disable DMs organization-wide; see [Allow or disable direct messages](</docs/claude-tag/admins/restrict-access#allow-or-disable-direct-messages>). + +### + +​ + +Common uses + +The list below covers common ways teams use Claude Tag. Each link opens a guide with the prompts to paste and the connections the task needs. + + * [Watch monitors and alerts](</docs/claude-tag/users/use-cases/watch-monitors>): scheduled dashboard checks, and alerts investigated as they arrive. Needs a monitoring connection like Datadog, Sentry, or PagerDuty. + * [Triage requests](</docs/claude-tag/users/use-cases/triage-requests>): an intake channel where Claude answers what it can, flags duplicates, and routes the rest. Works on Slack content alone. + * [Find answers in your docs](</docs/claude-tag/users/use-cases/find-answers>): policy and runbook questions answered with the source. Needs a docs connection like Google Drive, Notion, or Confluence. + * [Answer data questions](</docs/claude-tag/users/use-cases/answer-data-questions>): a plain-language question becomes a warehouse query and a chart. Needs a data warehouse connection. + * [Track projects and chase approvals](</docs/claude-tag/users/use-cases/track-projects>): standing status digests and follow-ups that run until an approval lands + * [Turn threads into docs and tickets](</docs/claude-tag/users/use-cases/create-artifacts>): a settled discussion becomes the decision doc, the customer reply, or the filed tickets + * [Fix bugs](</docs/claude-tag/users/use-cases/fix-bugs>): a bug reported in the channel comes back as a draft pull request. Needs GitHub. + * [Work from your own channel](</docs/claude-tag/users/use-cases/your-own-channel>): scratch questions, digests of channels you don’t follow, and follow-ups on what you said you’d do + +[Get started](</docs/claude-tag/users/getting-started>) covers your first message, what you see while Claude works, and how to shape Claude’s behavior in your channel. + +For administrators + +## + +​ + +Set Claude Tag up once for everyone + +You set up Claude Tag once, at [`claude.ai/admin-settings/claude-tag`](<https://claude.ai/admin-settings/claude-tag>), and you must be an Owner in your Claude organization to do it. The setup page at that URL walks you through it: + + * **Pair your Slack workspace** : send `@Claude connect` in Slack to get a pairing code, then enter it on the setup page. + * **Connect the services Claude will work in** : for each one, such as your issue tracker or data warehouse, create an account for Claude and enter its credential. + * **Grant repositories** : choose which repositories the Claude GitHub App can reach. + * **Set a monthly spend limit and launch**. + +Claude Tag starts with no access to your external systems. The services you connect during setup form an [Access bundle](</docs/claude-tag/concepts/glossary#access-bundle>), the set of tools Claude can reach, attached to the workspace or channels you paired. Once you launch, everyone in a channel Claude is in can use Claude Tag immediately, with no per-user setup. [Set up Claude Tag](</docs/claude-tag/admins/setup-overview>) walks through those steps with what to have ready, what each choice means, and how to verify Claude Tag works once you launch. + +Security review + +[Security and data handling](</docs/claude-tag/concepts/security-and-data>) + +The security model, what admins can and can’t restrict, audit trails, and network requirements. + +## + +​ + +Where to start with Claude Tag + +## Set up Claude Tag + +Admins: pair your Slack workspace, connect the services Claude will work in, and launch + +## Hand Claude Tag your first task + +It’s already in your channel: send your first message + +## How Claude Tag works + +The session model, what it can read, and how memory follows places + +## Use case library + +Prompts to paste, by team and connection
modified CLI reference View current →
--- a/cli-reference.md +++ b/cli-reference.md @@ -16,7 +16,7 @@ `claude -c -p "query"`| Continue via SDK| `claude -c -p "Check for type errors"` `claude -r "<session>" "query"`| Resume session by ID or name| `claude -r "auth-refactor" "Finish this PR"` `claude update`| Update to latest version| `claude update` -`claude gateway`| Start the self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>) server, for administrators deploying SSO and policy in front of Claude Code on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. Requires `--config` pointing at a [`gateway.yaml`](</docs/en/claude-apps-gateway-config>). Available in Claude Code v2.1.195 and later.| `claude gateway --config gateway.yaml` +`claude gateway`| Start the self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>) server, for administrators deploying SSO and policy in front of Claude Code on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. Requires `--config` pointing at a [`gateway.yaml`](</docs/en/claude-apps-gateway-config>).| `claude gateway --config gateway.yaml` `claude install [version]`| Install or reinstall the native binary. Accepts a version like `2.1.118`, or `stable` or `latest`. See [Install a specific version](</docs/en/setup#install-a-specific-version>)| `claude install stable` `claude auth login`| Sign in to your Anthropic account. Use `--email` to pre-fill your email address, `--sso` to force SSO authentication, and `--console` to sign in with Anthropic Console for API usage billing instead of a Claude subscription| `claude auth login --console` `claude auth logout`| Log out from your Anthropic account| `claude auth logout`
modified Configure cloud environments View current →
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -536,6 +536,10 @@ * platform.claude.com * code.claude.com * claude.ai + * claude.com + * support.claude.com + * anthropic.com + * [www.anthropic.com](<http://www.anthropic.com>) Version control @@ -566,6 +570,7 @@ * hub.docker.com * [www.docker.com](<http://www.docker.com>) * production.cloudflare.docker.com + * production.cloudfront.docker.com * download.docker.com * gcr.io * *.gcr.io
modified Code Review View current →
--- a/code-review.md +++ b/code-review.md @@ -32,7 +32,7 @@ 🟡| Nit| A minor issue, worth fixing but not blocking 🟣| Pre-existing| A bug that exists in the codebase but was not introduced by this PR -Findings include a collapsible extended reasoning section you can expand to understand why Claude flagged the issue and how it verified the problem. +Findings include a collapsed **Why this was flagged** section that you can expand to read why Claude flagged the issue and how it verified the problem. ###
modified Commands View current →
--- a/commands.md +++ b/commands.md @@ -30,6 +30,8 @@ `/add-dir <path>`| Add a working directory for file access during the current session. Type a partial path to see matching directory suggestions; press `Tab` to accept one. Most `.claude/` configuration [isn’t discovered](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) from the added directory. You can’t add most [network paths](</docs/en/errors#working-directory-is-a-network-path>), such as `\\server\share`. After a successful add, your [`DirectoryAdded` hooks](</docs/en/hooks#directoryadded>) run. When you run it while Claude is responding, Claude Code asks you to confirm the directory right away, and once you confirm, Claude’s next tool call in the same turn can access it. Before v2.1.234, Claude Code queued the command until the turn finished `/advisor [model|off]`| Enable or disable the [advisor tool](</docs/en/advisor>), which consults a second model for guidance at key moments during a task. Accepts `fable`, `opus`, `sonnet`, or a full model ID. `fable` requires [Fable access](</docs/en/advisor#choose-an-advisor-model>). Without an argument, opens a picker. In a session without an interactive terminal, or over [Remote Control](</docs/en/remote-control#limitations>), pass the model or `off` as an argument; with no argument there, the command prints the current advisor as text. These forms require Claude Code v2.1.260 or later `/agents`| As of v2.1.198, running `/agents` prints a reminder to ask Claude to create or manage [subagents](</docs/en/sub-agents>), or to edit `.claude/agents/` or `~/.claude/agents/` directly. On v2.1.197 and earlier, opens an interactive interface for creating and managing subagent configurations +`/artifact-capabilities`| **[Skill](</docs/en/skills#bundled-skills>).** Load the reference for the runtime capabilities a published [artifact](</docs/en/artifacts>) can use, such as [calling your connectors](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) or [offering a file download](</docs/en/artifacts#offer-a-file-download>), including which ones your account has. Claude normally loads it on its own before building a page that uses one. Available where [artifacts](</docs/en/artifacts#availability>) are +`/artifact-diagramming`| **[Skill](</docs/en/skills#bundled-skills>).** Load diagramming guidance for Claude to follow in [artifacts](</docs/en/artifacts>): when a diagram helps, what to draw, and how to write inline SVG that stays legible in light and dark themes. Requires Claude Code v2.1.221 or later `/artifacts`| List the [artifacts](</docs/en/artifacts#find-an-artifact-again>) you own or that are shared with you, then attach one to the session, open it in your browser, or copy its link. Available where [artifacts](</docs/en/artifacts#availability>) are. Requires Claude Code v2.1.208 or later; attaching with `Enter` requires v2.1.216 `/auto-mode-setup`| [Draft `autoMode.environment` entries](</docs/en/auto-mode-config#generate-environment-entries>) from your project and recent sessions, then review the draft and save it to your user settings. Requires a Pro, Max, or Team plan and Claude Code v2.1.228 or later. On native Windows, requires v2.1.233 or later `/autocompact [auto|<tokens>]`| Set the auto-compact window: how full the context window gets before Claude Code compacts automatically. Pass a size such as `500k`, or `auto` to return to the window tuned for your model. Claude Code saves the value to user settings and applies it to the current session. See [Set the auto-compact window](</docs/en/model-config#set-the-auto-compact-window>) for accepted values and what overrides it. Without an argument, opens a dialog that shows the current window. Requires Claude Code v2.1.221 or later @@ -41,7 +43,8 @@ `/bug [report]`| Report a bug or share your conversation. You choose how much session history to include and confirm on a consent screen before anything is sent. When you’re signed in to Anthropic on a first-party connection, the report goes to Anthropic; on a third-party provider, or without Anthropic credentials, Claude Code writes the report to a [local archive under `~/.claude/feedback-bundles/`](</docs/en/data-usage#telemetry-services>) that you forward yourself. In the [VS Code extension](</docs/en/vs-code#use-the-prompt-box>), `/bug` opens the extension’s own feedback dialog instead; requires Claude Code v2.1.229 or later. When you run it while Claude is responding, Claude Code opens the dialog immediately. Before v2.1.232, Claude Code queued the command until the turn finished. Alias: `/share`. Before v2.1.212, `/bug` and `/share` were aliases of `/feedback` `/cd <path>`| Move this session to a new working directory, keeping the conversation. Type a partial path to see matching directory suggestions; press `Tab` to accept one. The suggestions require Claude Code v2.1.206 or later. For what Claude Code applies from the new directory as soon as you move, and how `/cd` differs from `/add-dir`, see [Move the session to another directory](</docs/en/permissions#move-the-session-to-another-directory>) `/chrome`| Configure [Claude in Chrome](</docs/en/chrome>) settings -`/claude-api [migrate|upgrade|managed-agents-onboard|prompt-audit|cost-optimize|build-eval|hillclimb]`| **[Skill](</docs/en/skills#bundled-skills>).** Load [Claude API](<https://platform.claude.com/docs/en/api/overview>) and [Managed Agents](<https://platform.claude.com/docs/en/managed-agents/overview>) reference material for your project’s language. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk`. Run `migrate` to update existing Claude API code to a newer model. Run `upgrade` to move your project’s Anthropic SDK dependency across a major version, currently the Python `anthropic` package from 0.x to 1.x. Run `managed-agents-onboard` for a walkthrough that creates a new Managed Agent. Run `prompt-audit` to flag instructions written for older models in your prompts, skills, and tool descriptions and propose fixes as a diff. Run `cost-optimize` to profile where your project’s Claude API spend goes and propose savings from options such as prompt caching, trimming unneeded input and output tokens, batch processing, effort, and model choice, one change at a time. Run `build-eval` to build an eval set for your Claude-powered app, and `hillclimb` to iteratively improve the app against an existing eval. The `prompt-audit` subcommand requires Claude Code v2.1.221 or later, `upgrade` requires v2.1.236 or later, `cost-optimize` requires v2.1.247 or later, and `build-eval` and `hillclimb` require v2.1.259 or later +`/claude-api [migrate|upgrade|managed-agents-onboard|prompt-audit|cost-optimize|build-eval|hillclimb|preserved-thinking-migration]`| **[Skill](</docs/en/skills#bundled-skills>).** Load [Claude API](<https://platform.claude.com/docs/en/api/overview>) and [Managed Agents](<https://platform.claude.com/docs/en/managed-agents/overview>) reference material for your project’s language. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk`. For what each subcommand does and the version it requires, see [Work on Claude API projects](</docs/en/skills#work-on-claude-api-projects>) +`/claude-in-chrome [task]`| **[Skill](</docs/en/skills#bundled-skills>).** Have Claude carry out a task in your browser, such as testing a page, filling a form, or reading console logs, through [Claude in Chrome](</docs/en/chrome>). Available when Chrome integration is enabled for the session, for example with `claude --chrome`, or when Claude Code can offer to [install the extension](</docs/en/chrome#install-the-extension-when-claude-asks>) `/clear [name]`| Start a new conversation with empty context. Pass a name to label the previous conversation in the `/resume` picker. To free up context while continuing the same conversation, use `/compact` instead. Resume the previous conversation with `/resume`, or, in the same Claude Code process, restore it from [the rewind menu’s previous-session entry](</docs/en/checkpointing#rewind-past-a-cleared-conversation>). Aliases: `/reset`, `/new` `/code-review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [pr#|branch|path]`| **[Skill](</docs/en/skills#bundled-skills>).** Review the current diff, or a PR number, branch, or path you pass, for correctness bugs. Depending on your model and effort level, the review also covers cleanup opportunities. Pass `--fix` to apply findings, `--comment` to post them on the GitHub PR or GitLab merge request, or `ultra` to run a deep [cloud review](</docs/en/ultrareview>). Posting to a GitLab merge request requires Claude Code v2.1.257 or later. With `ultra` on a `github.com` PR target, pass `--post` to preselect [posting the finished findings to the PR](</docs/en/ultrareview#post-findings-to-the-pull-request>) in the launch dialog; `--post` requires Claude Code v2.1.227 or later. See [Review a diff locally](</docs/en/code-review#review-a-diff-locally>) for the effort levels, targeting, and how it relates to `/simplify`. Alias: `/review` `/color [color|default]`| Set the prompt bar color for the current session. Available colors: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan`. Use `default` to reset, or run with no argument to pick a random color. When [Remote Control](</docs/en/remote-control>) is connected, the color syncs to claude.ai/code. Also available in non-interactive mode (`-p`); requires Claude Code v2.1.205 or later @@ -58,14 +61,14 @@ `/design-sync [hint]`| **[Skill](</docs/en/skills#bundled-skills>).** Convert your repo’s React design system and upload it to [Claude Design](<https://claude.ai/design>), so designs it produces use your real components. Optionally name the design system, for example `/design-sync Acme DS`. A first-time sync verifies every component and can take a few hours on a large repo. Available on the Anthropic API. It needs claude.ai, which the CLI doesn’t contact on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS, or through a [Claude apps gateway](</docs/en/claude-apps-gateway#availability-and-limitations>), so the command is unavailable there `/desktop`| Continue the current session in the Claude Code Desktop app. Requires macOS or x64 Windows and a Claude subscription. Alias: `/app` `/diff`| Review the changes in your working tree, including the edits Claude has made so far. See [Review changes with /diff](</docs/en/interactive-mode#review-changes-with-%2Fdiff>) -`/doctor [prompt-audit [path]]`| **[Skill](</docs/en/skills#bundled-skills>).** Run a setup checkup that diagnoses issues and can fix them. Checks installation health, including duplicate or leftover installs, `PATH` problems, and unparseable settings files. Finds unused skills, MCP servers, and plugins versus their context cost, flags slow [hooks](</docs/en/hooks>), and checks for a newer version on your [release channel](</docs/en/setup#configure-release-channel>). Deduplicates local `CLAUDE.md` files against checked-in ones, trims checked-in [`CLAUDE.md`](</docs/en/memory#my-claude-md-is-too-large>) files by cutting content Claude could derive from the codebase, and migrates the always-loaded guidance that remains into [skills](</docs/en/skills>) and nested `CLAUDE.md` files that load on demand. Also offers to make [auto mode](</docs/en/permissions#permission-modes>) your default and to [pre-approve](</docs/en/permissions>) frequently denied read-only commands. Reports findings first and asks for confirmation before changing anything. From the terminal, `claude doctor` prints read-only installation diagnostics without starting a session. Alias: `/checkup`. Run `/doctor prompt-audit` to have Claude [audit your `CLAUDE.md` files, skills, and other configuration](</docs/en/memory#write-effective-instructions>) for outdated or conflicting instructions instead of running the checkup. The `prompt-audit` subcommand requires Claude Code v2.1.283 or later. The `CLAUDE.md` trim check requires Claude Code v2.1.206 or later. Before v2.1.205, `/doctor` opened a read-only diagnostics screen and pressing `f` sent the report to Claude +`/doctor [prompt-audit [path]]`| **[Skill](</docs/en/skills#bundled-skills>).** Run a setup checkup that diagnoses issues and can fix them. Checks installation health, including duplicate or leftover installs, `PATH` problems, and unparseable settings files. Finds unused skills, MCP servers, and plugins versus their context cost, flags slow [hooks](</docs/en/hooks>), and checks for a newer version on your [release channel](</docs/en/setup#configure-release-channel>). Deduplicates local `CLAUDE.md` files against checked-in ones, trims checked-in [`CLAUDE.md`](</docs/en/memory#my-claude-md-is-too-large>) files by cutting content Claude could derive from the codebase, and migrates the always-loaded guidance that remains into [skills](</docs/en/skills>) and nested `CLAUDE.md` files that load on demand. Also offers to make [auto mode](</docs/en/permissions#permission-modes>) your default and to [pre-approve](</docs/en/permissions>) frequently denied read-only commands. Reports findings first and asks for confirmation before changing anything. From the terminal, `claude doctor` prints read-only installation diagnostics without starting a session. Alias: `/checkup`. Run `/doctor prompt-audit` to have Claude [audit your `CLAUDE.md` files, skills, and other configuration](</docs/en/memory#audit-your-instruction-files>) for outdated or conflicting instructions instead of running the checkup. The `prompt-audit` subcommand requires Claude Code v2.1.283 or later. The `CLAUDE.md` trim check requires Claude Code v2.1.206 or later. Before v2.1.205, `/doctor` opened a read-only diagnostics screen and pressing `f` sent the report to Claude `/effort [level|auto|status|ultracode [on|off]]`| Set the [effort level](</docs/en/model-config#adjust-effort-level>): `low` to `xhigh`, `max`, or `auto`; `status` prints it. `ultracode` or `ultracode on` turns [ultracode](</docs/en/workflows#let-claude-decide-with-ultracode>) on for the session at the current level, and `ultracode off` turns it off; the [`ultracode`](</docs/en/settings-reference#ultracode>) key persists. `max` is session-only. The `on` and `off` arguments and keeping the current level require Claude Code v2.1.284 or later. Before v2.1.284, `/effort ultracode` set the session to `xhigh`, and `/effort ultracode off` failed with `Invalid argument`. Run it while Claude is responding and, once you confirm the [cache warning](</docs/en/prompt-caching#changing-effort-level>), if Claude Code shows one, Claude Code applies the new level to the next request in that turn. Before v2.1.242, Claude Code decided from a feature flag it fetched from Anthropic whether to run the command mid-turn or queue it until the turn finished, and always queued it in a session that doesn’t [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), such as on a [third-party provider](</docs/en/third-party-integrations>). Works in `-p` `/exit`| Exit the CLI. In an attached [background session](</docs/en/agent-view#attach-to-a-session>), this detaches and the session keeps running. Alias: `/quit` `/export [filename]`| Export the current conversation as plain text. With a filename, writes directly to that file. Without, opens a dialog to copy to clipboard or save to a file `/fast [on|off]`| Toggle [fast mode](</docs/en/fast-mode>) on or off. Run it while Claude is responding and Claude Code toggles fast mode without waiting for the turn to end, though the running turn finishes at its original speed. Before v2.1.242, Claude Code decided from a feature flag it fetched from Anthropic whether to run the command mid-turn or queue it until the turn finished, and always queued it in a session that doesn’t [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>). Availability in non-interactive mode with `-p` is limited; see [Toggle fast mode](</docs/en/fast-mode#toggle-fast-mode>). Requires Claude Code v2.1.205 or later `/feedback [report]`| Send product feedback about Claude Code. Opens the same dialog as `/bug`, with the same consent step, sending rules, and mid-turn behavior. In sessions with [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>), `/feedback` with no argument opens the drafts queue instead, where you review, edit, send, or discard the drafts Claude queued; the queue includes an option to write a new report in the dialog. With an argument, and for `/bug` always, the dialog opens directly `/fewer-permission-prompts`| **[Skill](</docs/en/skills#bundled-skills>).** Scan your transcripts for common read-only Bash and MCP tool calls, then add a prioritized allowlist to project `.claude/settings.json` to reduce permission prompts -`/focus`| Toggle the focus view, which shows only your last prompt, a one-line tool-call summary with edit diffstats, and the final response. The tool-call summary also counts the subagents launched in the turn and collapses completed background-task notifications into a single count. The selection persists across sessions; set [`viewMode`](</docs/en/settings-reference#viewmode>) in settings to override it. Only available in [fullscreen rendering](</docs/en/fullscreen>). The [VS Code extension](</docs/en/vs-code#use-the-prompt-box>) offers its own Focus view as a command-menu toggle, stored as an extension setting, independent of `viewMode` +`/focus`| Toggle the focus view, which shows only your last prompt, a one-line tool-call summary with edit diffstats, and the final response. The tool-call summary also counts the subagents launched in the turn and collapses completed background-task notifications into a single count. The selection persists across sessions; set [`viewMode`](</docs/en/settings-reference#viewmode>) in settings to override it. Only available in [fullscreen rendering](</docs/en/fullscreen>). From a [Remote Control](</docs/en/remote-control>) client, run `/focus [on|off]` to turn the focus view on or off for the current session only, without changing your saved selection; this requires Claude Code v2.1.281 or later. The [VS Code extension](</docs/en/vs-code#use-the-prompt-box>) offers its own Focus view as a command-menu toggle, stored as an extension setting, independent of `viewMode` `/fork [prompt]`| [Copy the current conversation](</docs/en/agent-view#copy-the-session-with-%2Ffork>) into a new background session and keep working here. Pass a prompt and the copy starts working on it immediately; without one it waits in agent view for its first prompt. Except when the copy [edits in place](</docs/en/agent-view#how-file-edits-are-isolated>), Claude Code instructs it to create a worktree of its own before making code changes; the isolation instruction requires Claude Code v2.1.221 or later. To hand a side task to a subagent whose result comes back into this conversation, use `/subtask`; to switch into a copy yourself, use `/branch`. Requires Claude Code v2.1.212 or later; on v2.1.161 through v2.1.211, and whenever [agent view is turned off](</docs/en/agent-view#turn-off-agent-view>), `/fork` starts a [forked subagent](</docs/en/sub-agents#fork-the-current-conversation>) instead `/goal [condition|clear]`| Set a [goal](</docs/en/goal>): Claude keeps working across turns until the condition is met or the goal [clears for another reason](</docs/en/goal#how-evaluation-works>). With no argument, shows the current or most recently achieved goal. `clear`, `stop`, `off`, `reset`, `none`, or `cancel` removes an active goal early `/heapdump`| Write a JavaScript heap snapshot and a memory breakdown to `~/Desktop`, or your home directory on Linux without a Desktop folder, for diagnosing high memory usage. Attach only the `-diagnostics.json` file when reporting a memory issue; the `.heapsnapshot` contains your full conversation and credentials, so don’t share it. Hidden from the command menu; type it in full. See [what to do with the output](</docs/en/troubleshooting#high-cpu-or-memory-usage>) @@ -95,7 +98,7 @@ `/pr-comments [PR]`| Removed in v2.1.91. Ask Claude directly to view pull request comments instead. On earlier versions, fetches and displays comments from a GitHub pull request; automatically detects the PR for the current branch, or pass a PR URL or number. Requires the `gh` CLI `/privacy-settings`| View and update your privacy settings. Only available for Pro and Max plan subscribers `/radio`| Open Claude FM lo-fi radio in your browser. Prints the stream URL when no browser is available -`/rate-limit-options`| Show ways to keep working when a claude.ai usage limit blocks a request: wait and [continue automatically when the limit resets](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>), add [usage credits](</docs/en/costs#add-usage-credits-to-your-subscription>), or upgrade your plan. Claude Code can also open this menu on its own when you hit a limit at your own terminal. See [Turn automatic continue off](</docs/en/interactive-mode#turn-automatic-continue-off>). Requires a claude.ai subscription. Doesn’t appear in the command menu; type it in full. The wait-and-continue rows require Claude Code v2.1.234 or later +`/rate-limit-options`| Show ways to keep working when a claude.ai usage limit blocks a request: wait and [continue automatically when the limit resets](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>), add [usage credits](</docs/en/costs#add-usage-credits-to-your-subscription>), or upgrade your plan. Claude Code can also open this menu on its own when you hit a limit at your own terminal. See [Turn automatic continue off](</docs/en/interactive-mode#turn-automatic-continue-off>). Requires a claude.ai subscription. The wait-and-continue rows require Claude Code v2.1.234 or later `/recap`| Generate a one-line summary of the current session on demand. See [Session recap](</docs/en/interactive-mode#session-recap>) for the automatic recap that appears after you’ve been away `/release-notes`| View the changelog in an interactive version picker. Select a specific version to see its release notes, or choose to show all versions. The notes appear in your transcript without entering the conversation Claude sees `/reload-plugins [--force]`| Reload all active [plugins](</docs/en/plugins/overview>) to apply pending changes without restarting. Reports counts for each reloaded component and flags any load errors. When the reload would change which MCP tools are loaded and invalidate the prompt cache, the command warns and skips unless you pass `--force`. Also available in non-interactive mode (`-p`), the Agent SDK, and the desktop app, where it runs only on input typed directly into the session and doesn’t apply plugin MCP server changes; requires Claude Code v2.1.260 or later. See [Apply plugin changes without restarting](</docs/en/plugins/cli-reference#reload-plugins>)
modified Communications kit View current →
--- a/communications-kit.md +++ b/communications-kit.md @@ -66,7 +66,7 @@ Where your code goes: Claude Code runs in your terminal and talks directly to Anthropic's API, with no third-party servers in the loop. It asks before - editing files or running commands. Under our Enterprise agreement, Anthropic + editing files or running commands. On our Team or Enterprise plan, Anthropic does not use your code or prompts to train its models. Details: https://code.claude.com/docs/en/data-usage https://code.claude.com/docs/en/security @@ -89,8 +89,8 @@ *First thing to try* → run `/init`, then: "the test in [file] is flaky, figure out why and fix it." - 🔒 Runs in your terminal, talks only to Anthropic's API. Under our - Enterprise plan your code and prompts are not used to train models. + 🔒 Runs in your terminal, talks only to Anthropic's API. On our Team or + Enterprise plan, your code and prompts are not used to train models. Data usage → https://code.claude.com/docs/en/data-usage 📚 Quickstart · VS Code · Free 1-hr course @@ -475,7 +475,7 @@ Permission-first by design. Every file edit, shell command, and external call is gated by your approval. The CLI runs in your terminal and talks directly to Anthropic's API, with no third-party servers, and supports - optional OS-level sandboxing for shell commands. Under our Enterprise plan, + optional OS-level sandboxing for shell commands. On a Team or Enterprise plan, Anthropic does not use your code or prompts to train its models. *Try it now:* save these two links for the next time the question comes up. @@ -520,7 +520,7 @@ ---|--- ”Does it work in VS Code?”| Yes. There is a VS Code extension and a JetBrains plugin with the same features, embedded in your editor. [VS Code →](</docs/en/vs-code>) “Do I have to configure anything first?”| No. Install, then run `claude` in any repo. Run `/init` once and you’re set. [Quickstart →](</docs/en/quickstart>) -“Where does my code go?”| The CLI runs in your terminal and sends context to Anthropic’s API for inference, with no third-party servers. Under your Enterprise plan, your code and prompts are not used to train models. [Data usage →](</docs/en/data-usage>) +“Where does my code go?”| The CLI runs in your terminal and sends context to Anthropic’s API for inference, with no third-party servers. On a Team or Enterprise plan, your code and prompts are not used to train models. [Data usage →](</docs/en/data-usage>) “Can it see my whole repo?”| It reads what you give it access to. File reads inside your working directory don’t prompt; permission prompts gate edits, non-read-only shell commands, and file-tool reads outside that directory. A built-in set of read-only shell commands such as `ls` and `cat` runs without prompting; restrict it with [sandbox `denyRead` rules](</docs/en/sandboxing#filesystem-isolation>). [Permissions →](</docs/en/permissions>) “How is this different from Copilot?”| Copilot autocompletes lines. Claude Code is an agent that reads files, runs commands, and makes multi-file edits. [Overview →](</docs/en/overview>) “What should I try first?”| A bug you’ve been putting off because it’s tedious. “The test in [file] is flaky, figure out why.” [Quickstart →](</docs/en/quickstart>)
modified Add components to a plugin View current →
--- a/components.md +++ b/components.md @@ -69,7 +69,7 @@ * **Additional directories** : list them in the `skills` manifest key. They add to the default `skills/` scan rather than replacing it, unlike `commands` and `agents` * **A single skill at the plugin root** : with no `skills/` directory and no `skills` manifest key, a `SKILL.md` at the plugin root loads as one skill. Set `name` in its frontmatter, because otherwise a marketplace install names the skill after its [cache directory](</docs/en/plugins/loading#find-plugins-on-disk>) rather than your plugin -To include instructions in a plugin, write them as a skill. Claude Code doesn’t load a `CLAUDE.md` at the plugin root, and `claude plugin validate` warns `CLAUDE.md at the plugin root is not loaded as project context`. For frontmatter fields and supporting files, see [Skills](</docs/en/skills>). +To include instructions in a plugin, write them as a skill. Claude Code doesn’t load a `CLAUDE.md` at the plugin root, and `claude plugin validate` warns `CLAUDE.md at the plugin root is not loaded as project context`. If a rule must hold every time, such as [blocking edits to protected files](</docs/en/hooks-guide#block-edits-to-protected-files>), add it to the plugin as a hook rather than a skill. To choose between the two, see the Hook vs Skill tab under [Compare similar features](</docs/en/features-overview#compare-similar-features>). For frontmatter fields and supporting files, see [Skills](</docs/en/skills>). ###
modified Manage costs effectively View current →
--- a/costs.md +++ b/costs.md @@ -84,7 +84,7 @@ Analyze your usage patterns -Run [`/insights`](</docs/en/commands#all-commands>) for a report on how you work rather than how many tokens you’ve used. It analyzes your recent sessions on this machine and writes an HTML report covering what you work on, friction points such as misunderstood requests or buggy code, and suggestions for using Claude Code more effectively. A single run analyzes up to 200 sessions it hasn’t seen before and skips very short ones. When sessions are left out, the report header shows the analyzed count with the total in parentheses, for example `200 sessions (412 total)`. Claude Code writes the latest report to `~/.claude/usage-data/report.html` and saves a timestamped copy of each run in the same directory, so earlier reports aren’t overwritten. Claude Code deletes reports on the same schedule as the rest of your session data: at startup, it removes files older than [`cleanupPeriodDays`](</docs/en/claude-directory#cleaned-up-automatically>), 30 days by default. You can run `/insights` on any plan and with any provider. The analysis runs through the same provider and account as your regular sessions, and the tokens count against your plan or API usage. Sessions from other devices and claude.ai aren’t included. +Run [`/insights`](</docs/en/commands#all-commands>) for a report on how you work rather than how many tokens you’ve used. It analyzes your recent sessions on this machine and writes an HTML report covering what you work on, friction points such as misunderstood requests or buggy code, and suggestions for using Claude Code more effectively. A single run analyzes up to 200 sessions it hasn’t seen before and skips very short ones. When sessions are left out, the report header shows the analyzed count with the total in parentheses, for example `200 sessions (412 total)`. When [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) is available to the session and your recent sessions mostly ran without it, the report can also include an estimate of how many permission prompts auto mode could have handled across those sessions. Claude Code writes the latest report to `~/.claude/usage-data/report.html` and saves a timestamped copy of each run in the same directory, so earlier reports aren’t overwritten. Claude Code deletes reports on the same schedule as the rest of your session data: at startup, it removes files older than [`cleanupPeriodDays`](</docs/en/claude-directory#cleaned-up-automatically>), 30 days by default. You can run `/insights` on any plan and with any provider. The analysis runs through the same provider and account as your regular sessions, and the tokens count against your plan or API usage. Sessions from other devices and claude.ai aren’t included. ###
modified Create a marketplace View current →
--- a/create-marketplace.md +++ b/create-marketplace.md @@ -100,7 +100,7 @@ Every plugin you distribute is one object in the `plugins` array of `marketplace.json`. To add a second plugin, add a second object. These fields cover most entries: - * `name`: the identifier people type before `@` when they install. It can’t contain spaces. + * `name`: the identifier people type before `@` when they install. [Plugin entries](</docs/en/plugins/marketplace-reference#plugin-entries>) gives the characters a name can use. * `source`: where Claude Code fetches the plugin from. Write a relative path string for a plugin inside the marketplace directory, as in the walkthrough, or a source object for a plugin outside it. See Choose a plugin source. * `description`: the line people see next to the plugin when they browse your marketplace in `/plugin`. @@ -179,7 +179,7 @@ * JSON syntax errors, as `json: Invalid JSON syntax: <reason>` * Missing required fields, such as `owner: Invalid input` - * A marketplace name with spaces, non-ASCII characters, or a form that imitates an official Anthropic marketplace, such as `claude-official` + * A marketplace or plugin name that breaks the naming rules in the [marketplace reference](</docs/en/plugins/marketplace-reference#top-level-fields>) * A relative `source` that contains `..` * Unknown fields at the top level or in a plugin entry, as warnings * Problems in the `plugin.json` of each relative-path plugin, as `plugins[N] plugin.json → <field>: <message>`
modified Launch sessions from links View current →
--- a/deep-links.md +++ b/deep-links.md @@ -36,7 +36,7 @@ Build a link -Every deep link starts with `claude-cli://open`, which is the only path the handler accepts, followed by optional query parameters. The minimal form opens Claude Code in your home directory with an empty prompt: +A deep link starts with `claude-cli://open`, followed by optional query parameters. The minimal form opens Claude Code in your home directory with an empty prompt: claude-cli://open
modified Desktop application View current →
--- a/desktop.md +++ b/desktop.md @@ -756,6 +756,8 @@ * **Remote Control** : enable or disable [Remote Control](</docs/en/remote-control>) for your organization * **Disable Bypass permissions mode** : prevent users in your organization from enabling bypass permissions mode +The OpenTelemetry form for Cowork under **Monitoring** in the admin console’s [Data and privacy settings](<https://claude.ai/admin-settings/data-privacy-controls>) applies to Cowork sessions only. In a Cowork session on this machine, the desktop app passes that collector to Claude Code as `OTEL_*` environment variables, so the form takes effect even though Claude Code in that session never fetches admin-console settings.To export telemetry from Code tab sessions, set `CLAUDE_CODE_ENABLE_TELEMETRY` and the `OTEL_*` variables in the `env` block of your Claude Code managed settings, as shown in [administrator configuration for monitoring](</docs/en/monitoring-usage#administrator-configuration>). Local, cloud, and SSH sessions each read managed settings from different sources. For the hosts a cloud session can reach, see [network access](</docs/en/cloud-environments#network-access>). For the `service.name` that Code tab sessions report, see [service information](</docs/en/monitoring-usage#service-information>). + ### ​ @@ -844,7 +846,7 @@ Authentication and SSO -Enterprise organizations can require SSO for all users. See [authentication](</docs/en/authentication>) for plan-level details and [Setting up SSO](<https://support.claude.com/en/articles/13132885-setting-up-single-sign-on-sso>) for SAML configuration; OIDC setup is covered in the [Claude Enterprise Administrator Guide](<https://claude.com/resources/tutorials/claude-enterprise-administrator-guide>). +Team and Enterprise organizations can require SSO for all users. See [authentication](</docs/en/authentication>) for plan-level details and [Setting up SSO](<https://support.claude.com/en/articles/13132885-setting-up-single-sign-on-sso>) for SAML configuration; OIDC setup is covered in the [Claude Enterprise Administrator Guide](<https://claude.com/resources/tutorials/claude-enterprise-administrator-guide>). ### @@ -873,7 +875,13 @@ Coming from the CLI? -If you already use the Claude Code CLI, Desktop runs the same underlying engine with a graphical interface. You can run both simultaneously on the same machine, even on the same project. Each keeps its own session list, and you can bring a CLI session into Desktop. They share configuration and project memory via CLAUDE.md files. To move a CLI session into Desktop, run `/desktop` in the terminal. Claude saves your session and opens it in the desktop app, then exits the CLI. This command is available on macOS and x64 Windows when you are signed in with a Claude subscription. It is not available with API key authentication or on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. To pick up a CLI session from inside Desktop instead, type `/resume` in the prompt box. Desktop lists the sessions you started from the CLI, and you can search them by title, folder, or branch and preview where each one left off. Select a session and it continues in the app with its full conversation and context. +If you already use the Claude Code CLI, Desktop runs the same underlying engine with a graphical interface. You can run both simultaneously on the same machine, even on the same project. Each keeps its own session list, and you can bring a CLI session into Desktop. They share configuration and project memory via CLAUDE.md files. To move a CLI session into Desktop, run `/desktop` in the terminal. Claude saves your session and opens it in the desktop app, then exits the CLI. This command is available on macOS and x64 Windows when you are signed in with a Claude subscription. It is not available with API key authentication or on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. You can also pick up a CLI session from inside Desktop with `/resume`. The command is available in local sessions, not in SSH, WSL, or cloud sessions. To continue a terminal session in Desktop: + + 1. Close the session in the terminal. + 2. In the Desktop prompt box, type `/resume`. Desktop lists the sessions you started from the CLI on this computer. Search by title, folder, or branch, and preview where each one left off. + 3. Select the session. It continues in the app with its full conversation and context. + +Desktop continues the same session rather than a copy, so `claude --resume` in the terminal still finds it afterwards. When to use Desktop vs CLI: use Desktop when you want to manage parallel sessions in one window, arrange panes side by side, or review changes visually. Use the CLI when you need scripting, automation, or prefer a terminal workflow.
modified Test iOS apps in the simulator View current →
--- a/desktop-ios-simulator.md +++ b/desktop-ios-simulator.md @@ -13,11 +13,23 @@ * Claude Desktop v1.24012.0 or later * A Mac, since Apple’s iOS Simulator runs only on macOS * [Xcode](<https://developer.apple.com/xcode/>) with the iOS platform installed, which provides the simulator devices. If Xcode lists no simulators yet, see The simulator pane says no simulators were found - * Use Xcode 26.x. The pane doesn’t yet work with Xcode 27, which replaces the Simulator app with Device Hub. If `xcode-select` points at Xcode 27 on your Mac, see The simulator pane fails with Xcode 27 + * Xcode 26.x or Xcode 27 is recommended, and the pane works with either. If you have more than one Xcode installed, see Choose which Xcode the simulator pane uses On this page, “device” refers to a simulated iPhone or iPad, one of the same simulator devices you manage in Xcode under **Window → Devices and Simulators** , not physical hardware. The simulator pane is available in local sessions only. In [cloud](</docs/en/desktop#run-long-running-tasks-in-the-cloud>) and [SSH](</docs/en/desktop#ssh-sessions>) sessions, Claude runs on a machine that can’t reach the simulators on your Mac. + +### + +​ + +Choose which Xcode the simulator pane uses + +If you have more than one Xcode installed, such as Xcode 26.x alongside Xcode 27, the pane uses whichever one `xcode-select` points at. To use a different install, select it by its path. For example, if the Xcode you want is installed as `/Applications/Xcode-26.4.app`, run this in Terminal: + + sudo xcode-select -s /Applications/Xcode-26.4.app + +Then quit and reopen Claude Desktop so the pane uses the newly selected Xcode. To check which install is selected, run `xcode-select -p`. It prints the selected install’s Developer folder, such as `/Applications/Xcode-26.4.app/Contents/Developer`. ## @@ -47,7 +59,7 @@ When the app launches in a simulator, the iOS Simulator pane opens next to the conversation. The first time Claude uses a device, the desktop app asks you to allow it; see Grant Claude access to a device. Claude installs the app, taps through it, and reads the screen to verify its own changes while you watch. -The simulator pane opens whenever Claude launches the app in a simulator, at any point in the session. When your request is about seeing the app, for example “does the new screen look right?”, Claude starts a simulator before it begins the work. After Claude fixes a bug or changes a screen, ask it to verify the change: relaunching the app reopens the pane if it isn’t open. The simulator pane shows whichever device the app actually launched in. To test on a specific device, name it in your request, for example “run it on the iPhone SE simulator”, and Claude targets that device when it builds and launches. A device Claude boots also appears in Apple’s Simulator app, and Claude can install the app on a device you already have booted. You can also open the simulator pane yourself. Once the session has a simulator attached or has edited Swift files, the **Views** menu in the session toolbar shows an **iOS Simulator** entry. If the pane isn’t showing a device yet, click **Attach simulator** , or pick a specific device from the device menu next to it; picking a shut-down device boots it. If Xcode or its simulators are missing, the pane shows the setup steps instead and checks them off as you complete them. +The simulator pane opens whenever Claude launches the app in a simulator, at any point in the session. When your request is about seeing the app, for example “does the new screen look right?”, Claude starts a simulator before it begins the work. After Claude fixes a bug or changes a screen, ask it to verify the change: relaunching the app reopens the pane if it isn’t open. The simulator pane shows whichever device the app actually launched in. To test on a specific device, name it in your request, for example “run it on the iPhone SE simulator”, and Claude targets that device when it builds and launches. A device Claude boots also appears in Apple’s Simulator app, or in Device Hub on Xcode 27. Claude can install the app on a device you already have booted. You can also open the simulator pane yourself. Once the session has a simulator attached or has edited Swift files, the **Views** menu in the session toolbar shows an **iOS Simulator** entry. If the pane isn’t showing a device yet, click **Attach simulator** , or pick a specific device from the device menu next to it; picking a shut-down device boots it. If Xcode or its simulators are missing, the pane shows the setup steps instead and checks them off as you complete them. ## @@ -72,7 +84,7 @@ How sessions manage devices -Each device belongs to the session that launched it, so [parallel sessions](</docs/en/desktop#work-in-parallel-with-sessions>) don’t share a device: what you see in one session’s pane reflects that session’s work, not another’s. Switching sessions in the sidebar switches the simulator view along with the conversation, and switching back resumes the same device where it left off. If Claude works with more than one device, each opens its own pane, up to 4 per session. Claude Code Desktop shuts down the simulators it booted once they’re no longer in use: when you quit the app, when you archive the session, or 10 minutes after you detach a device from its pane. Devices you boot yourself, whether from the pane or in Apple’s Simulator app, are never shut down automatically. To shut down the attached device right away, use the shutdown button in the pane. +Each device belongs to the session that launched it, so [parallel sessions](</docs/en/desktop#work-in-parallel-with-sessions>) don’t share a device: what you see in one session’s pane reflects that session’s work, not another’s. Switching sessions in the sidebar switches the simulator view along with the conversation, and switching back resumes the same device where it left off. If Claude works with more than one device, each opens its own pane, up to 4 per session. Claude Code Desktop shuts down the simulators it booted once they’re no longer in use: when you quit the app, when you archive the session, or 10 minutes after you detach a device from its pane. Devices you boot outside Claude Code Desktop, such as in Apple’s Simulator app or in Device Hub, are never shut down automatically. To shut down the attached device right away, use the shutdown button in the pane. ## @@ -137,7 +149,7 @@ Claude may not have recognized that you wanted to run or test the app, or the simulator tooling may be missing. Check the following: * State the goal explicitly, for example “run the app in the iOS Simulator and tap through the signup flow”. - * Confirm Xcode and the iOS simulators are installed and that your Xcode version meets the requirements. + * Confirm Xcode and the iOS simulators are installed and that you’re using a recommended Xcode version. * If your organization manages Claude Code, the simulator tools may be disabled by policy. * If you’re in an Enterprise organization that has a HIPAA configuration enabled, the simulator pane isn’t available to you. * The simulator pane requires Claude Desktop v1.24012.0 or later. Open **Claude → Check for Updates** , then restart the app. @@ -148,19 +160,7 @@ The simulator pane says no simulators were found -If `xcode-select` points at Xcode 27, the pane can report no simulators even though devices exist; see The simulator pane fails with Xcode 27. Otherwise, Xcode is installed but has no iOS simulators to list. The simulator pane shows the setup steps to follow and checks them off as each one completes. To install the missing piece manually, download the iOS simulator runtime from Xcode’s settings, or run `xcodebuild -downloadPlatform iOS`. - -### - -​ - -The simulator pane fails with Xcode 27 - -The pane doesn’t yet work with Xcode 27, which replaces the Simulator app with Device Hub. With Xcode 27 selected, attaching a device fails, or the pane reports that no simulators were found even though devices exist. The pane uses whichever Xcode `xcode-select` points at. If Xcode 27 is your only install, install Xcode 26.x alongside it first. Then select the 26.x install by its path. For example, if it’s installed as `/Applications/Xcode-26.4.app`: - - sudo xcode-select -s /Applications/Xcode-26.4.app - -Run `xcode-select -p` to check which install is selected. +Xcode is installed but has no iOS simulators to list. The simulator pane shows the setup steps to follow and checks them off as each one completes. To install the missing piece manually, download the iOS simulator runtime from Xcode’s settings, or run `xcodebuild -downloadPlatform iOS`. ##
modified Claude Desktop on Linux (beta) View current →
--- a/desktop-linux.md +++ b/desktop-linux.md @@ -143,7 +143,7 @@ ​ -Running as root without —no-sandbox is not supported +Running as root without `--no-sandbox` is not supported If `claude-desktop` exits with this message, you launched it as root. Log in as a regular user and launch it from there.
modified Environment variables View current →
--- a/env-vars.md +++ b/env-vars.md @@ -90,7 +90,7 @@ Precedence -Some behaviors have both an environment variable and a dedicated settings key, and which one Claude Code reads first differs per key. For `ANTHROPIC_MODEL` and `CLAUDE_CODE_AUTO_CONNECT_IDE`, Claude Code reads the variable first and uses the `model` or `autoConnectIde` setting only when the variable is unset. For the pair you’re setting, check the variable’s row below and the key’s entry on the [settings reference](</docs/en/settings-reference>). When the same variable is set in both your shell and a settings file `env` block, the settings file value applies. Claude Code writes each `env` entry into the process environment, replacing the value inherited from the shell. The [`env` setting](</docs/en/settings-reference#when-claude-code-applies-env-values>) says when it applies them. A few variables are special-cased; the [`env` setting](</docs/en/settings-reference#env>) lists the exceptions. In a settings file you can set a variable but you can’t remove one. To override a variable you can’t unset, such as a stale `CLAUDE_CODE_USE_VERTEX` exported by a shell profile you don’t control, set it to an empty string in the `env` block: `"CLAUDE_CODE_USE_VERTEX": ""`. Claude Code treats the empty value as unset for provider selection. Subprocesses still inherit the empty value. Between settings files, `env` values follow [settings precedence](</docs/en/settings#settings-precedence>), so a managed settings entry overrides the same variable in user or project settings. Project and local settings can’t set some variables, such as `CLAUDE_CONFIG_DIR` and the OpenTelemetry exporter variables. [Variables Claude Code ignores in `env`](</docs/en/settings-reference#variables-claude-code-ignores-in-env>) lists them, along with the OpenTelemetry off values that still apply. How an environment variable interacts with CLI flags and in-session commands varies per feature: `--model` and `/model` override `ANTHROPIC_MODEL`, while `CLAUDE_CODE_EFFORT_LEVEL` overrides `--effort` and `/effort`. When a variable interacts with another configuration source, its row in the Variables list states the precedence or links to the page that documents it. Claude Code reads shell environment variables at startup, so changes to them take effect the next time you launch `claude`. Variables set under the `env` key in settings files are reapplied to a running session when the file changes, with the startup-only exception described in In settings files. +Some behaviors have both an environment variable and a dedicated settings key, and which one Claude Code reads first differs per key. For `ANTHROPIC_MODEL` and `CLAUDE_CODE_AUTO_CONNECT_IDE`, Claude Code reads the variable first and uses the `model` or `autoConnectIde` setting only when the variable is unset. For the pair you’re setting, check the variable’s row below and the key’s entry on the [settings reference](</docs/en/settings-reference>). When the same variable is set in both your shell and a settings file `env` block, the settings file value applies in most sessions. Claude Code writes each `env` entry into the process environment, replacing the value inherited from the shell. [How `env` values interact with your shell](</docs/en/settings-reference#how-env-values-interact-with-your-shell>) covers the sessions that keep the inherited value instead, and the [`env` setting](</docs/en/settings-reference#when-claude-code-applies-env-values>) says when it applies them. A few variables are special-cased; the [`env` setting](</docs/en/settings-reference#env>) lists the exceptions. In a settings file you can set a variable but you can’t remove one. To override a variable you can’t unset, such as a stale `CLAUDE_CODE_USE_VERTEX` exported by a shell profile you don’t control, set it to an empty string in the `env` block: `"CLAUDE_CODE_USE_VERTEX": ""`. Claude Code treats the empty value as unset for provider selection. Subprocesses still inherit the empty value. Between settings files, `env` values follow [settings precedence](</docs/en/settings#settings-precedence>), so a managed settings entry overrides the same variable in user or project settings. Project and local settings can’t set some variables, such as `CLAUDE_CONFIG_DIR` and the OpenTelemetry exporter variables. [Variables Claude Code ignores in `env`](</docs/en/settings-reference#variables-claude-code-ignores-in-env>) lists them, along with the OpenTelemetry off values that still apply. How an environment variable interacts with CLI flags and in-session commands varies per feature: `--model` and `/model` override `ANTHROPIC_MODEL`, while `CLAUDE_CODE_EFFORT_LEVEL` overrides `--effort` and `/effort`. When a variable interacts with another configuration source, its row in the Variables list states the precedence or links to the page that documents it. Claude Code reads shell environment variables at startup, so changes to them take effect the next time you launch `claude`. Variables set under the `env` key in settings files are reapplied to a running session when the file changes, with the startup-only exception described in In settings files. ## @@ -159,7 +159,7 @@ `ANTHROPIC_VERTEX_BASE_URL`| Override Google Cloud’s Agent Platform endpoint URL. Use for custom Google Cloud’s Agent Platform endpoints or when routing through an [LLM gateway](</docs/en/llm-gateway>). See [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) `ANTHROPIC_VERTEX_PROJECT_ID`| GCP project ID that Google Cloud’s Agent Platform requests are addressed to. See [Configure GCP credentials](</docs/en/google-vertex-ai#3-configure-gcp-credentials>) `ANTHROPIC_WORKSPACE_ID`| Workspace ID for [workload identity federation](<https://platform.claude.com/docs/en/manage-claude/workload-identity-federation>). Set this when your federation rule is scoped to more than one workspace so the token exchange knows which workspace to target -`API_FORCE_IDLE_TIMEOUT`| Override the 5-minute body idle timeout that aborts a streaming model response when no bytes arrive. Set to `0` to turn the timeout off, for example when a slow [gateway](</docs/en/llm-gateway>) or local model pauses longer than 5 minutes between chunks, or `1` to keep it on for every provider. When unset, the timeout is active on providers other than the direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). The [stream watchdogs](</docs/en/network-config#streaming-idle-watchdogs>) run independently of it and abort a long silent pause even when you set `0` here +`API_FORCE_IDLE_TIMEOUT`| Override the 5-minute body idle timeout that aborts a streaming model response when no bytes arrive. Set to `0` to turn the timeout off, for example when a slow [gateway](</docs/en/llm-gateway>) or local model pauses longer than 5 minutes between chunks, or `1` to keep it on for every provider. When unset, the timeout is active on providers other than the direct Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` set. The [stream watchdogs](</docs/en/network-config#streaming-idle-watchdogs>) run independently of it and abort a long silent pause even when you set `0` here `API_TIMEOUT_MS`| Timeout for API requests in milliseconds (default: 600000, or 10 minutes; maximum: 2147483647). Increase this when requests time out on slow networks or when routing through a proxy. Values above the maximum overflow the underlying timer and cause requests to fail immediately `AWS_BEARER_TOKEN_BEDROCK`| Amazon Bedrock API key for authentication (see [Amazon Bedrock API keys](<https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/>)) `BASH_DEFAULT_TIMEOUT_MS`| Default timeout for long-running bash commands (default: 120000, or 2 minutes) @@ -285,7 +285,7 @@ `CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS`| How many [subagents](</docs/en/sub-agents#concurrent-subagent-limit>) can be running in one session before the Agent tool refuses to spawn another (default: 20). Accepts a positive whole number in plain digits; anything else is ignored, so the variable can adjust the cap but can’t disable it. Requires Claude Code v2.1.217 or later `CLAUDE_CODE_MAX_CONTEXT_TOKENS`| Override the context window size Claude Code assumes for the active model. As of v2.1.193, how it applies depends on how Claude Code resolves the model ID; see [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>). Use this when routing to a model through `ANTHROPIC_BASE_URL` whose context window does not match the built-in size for its name `CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH`| Maximum length in characters of each MCP tool description and each MCP server’s instructions that Claude Code sends to the model (default: 2048). Claude Code [truncates longer text](</docs/en/mcp#for-mcp-server-authors>). Accepts a positive whole number in plain digits. Anything else is ignored and the default applies. Requires Claude Code v2.1.280 or later -`CLAUDE_CODE_MAX_OUTPUT_TOKENS`| Set the maximum number of output tokens for most requests. Defaults and caps vary by model; see [max output tokens](<https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison>). Claude Code defaults to 32000 for model IDs it doesn’t recognize, such as gateway-specific names, and lowers values above a model’s cap to the cap. Increasing this value reduces the effective context window available before [auto-compaction](</docs/en/costs#reduce-token-usage>) triggers +`CLAUDE_CODE_MAX_OUTPUT_TOKENS`| Set the maximum number of output tokens for most requests. Defaults and caps vary by model; see [max output tokens](<https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison>). Claude Code lowers a value above a model’s cap to the cap. For a model ID Claude Code can’t resolve to a model it knows, the default is 32000 and the cap is 128000. Increasing this value reduces the effective context window available before [auto-compaction](</docs/en/costs#reduce-token-usage>) triggers `CLAUDE_CODE_MAX_RETRIES`| Override the number of times to retry failed API requests (default: 10). Capped at 15 as of v2.1.186; as of v2.1.199, `CLAUDE_CODE_RETRY_WATCHDOG` raises the default and removes the cap. For unattended sessions that need to wait through longer outages, set `CLAUDE_CODE_RETRY_WATCHDOG` instead `CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION`| Removed in v2.1.224 and now a no-op. Previously capped the total number of [subagents](</docs/en/sub-agents>) Claude could spawn with the Agent tool in one session (default: 200); spawning past the cap failed with `Subagent spawn limit reached`. The [concurrent subagent limit](</docs/en/sub-agents#concurrent-subagent-limit>) and the [depth limit](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>) still apply `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`| Number of [subagent layers](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>) allowed below the main conversation (default: 3). At the default, subagents can spawn their own subagents, and a subagent at the third layer can’t spawn further; set `1` to turn nesting off. In v2.1.217 through v2.1.218, the default was 1, so a subagent couldn’t spawn its own unless you raised the limit; v2.1.219 raised the default to 3. Accepts a positive whole number in plain digits; anything else is ignored, so the limit can be adjusted but not removed. Requires Claude Code v2.1.217 or later @@ -367,7 +367,7 @@ `CLAUDE_CODE_SYNTAX_HIGHLIGHT`| Set to `false` to disable syntax highlighting in diff output. Useful when colors interfere with your terminal setup. To also disable highlighting in code blocks and file previews, use the [`syntaxHighlightingDisabled`](</docs/en/settings-reference#syntaxhighlightingdisabled>) setting `CLAUDE_CODE_TASK_LIST_ID`| Share a task list across sessions. Set the same ID in multiple Claude Code instances to coordinate on a shared task list, in [sessions that have the Task tools](</docs/en/tools-reference#task-tool-availability>). See [Task list](</docs/en/interactive-mode#task-list>) `CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS`| Override, in milliseconds, how long a non-interactive session waits at exit for its [agent team](</docs/en/agent-teams>) to finish tearing down. Accepts 1000 to 60000; an out-of-range value is ignored and the default of 10000 applies. Requires Claude Code v2.1.206 or later -`CLAUDE_CODE_TMPDIR`| Override the temp directory used for internal temp files. Claude Code appends `/claude-{uid}/` on Unix or `/claude/` on Windows to this path. Default: `/tmp` on macOS, `os.tmpdir()` on Linux and Windows. On macOS and Linux, [sandboxed](</docs/en/sandboxing>) Bash subprocesses receive a short fallback `$TMPDIR` under the system default when your override is a long path, since some tools fail when temp paths get too long. Unsandboxed Bash commands inherit your shell’s `$TMPDIR` when it is set. Claude Code’s own temp files always use your override. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>) +`CLAUDE_CODE_TMPDIR`| Override the temp directory used for internal temp files. Claude Code appends `/claude-{uid}/` to this path on Unix, or `/claude/` on Windows. Default: `/tmp` on macOS, `os.tmpdir()` on Linux and Windows. On macOS and Linux, [sandboxed](</docs/en/sandboxing>) Bash subprocesses receive a short fallback `$TMPDIR` under the system default when your override is a long path, since some tools fail when temp paths get too long. Unsandboxed Bash commands inherit your shell’s `$TMPDIR` when it is set. On native Windows, when your shell doesn’t set `$TMPDIR`, a Bash command that references `$TMPDIR` receives your override, or `%TEMP%` when you haven’t set one. Claude Code’s own temp files always use your override. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>) `CLAUDE_CODE_TMUX_TRUECOLOR`| Set to any non-empty value, such as `1`, to allow 24-bit truecolor output inside tmux. **Setting it to`0` or `false` still allows truecolor**, unlike most on/off variables; unset the variable to restore the 256-color clamp. By default, Claude Code clamps to 256 colors when `$TMUX` is set because tmux does not pass through truecolor escape sequences unless configured to. Set this after adding `set -ga terminal-overrides ',*:Tc'` to your `~/.tmux.conf`. See [Terminal configuration](</docs/en/terminal-config>) for other tmux settings `CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE`| On Linux and WSL, set to a comma-separated list of the kinds of processes Claude Code [excludes from the tool memory cap](</docs/en/tools-reference#memory-limit-on-linux-and-wsl>), such as `mcp` or `lsp`. Set `none` to cap every kind, or `all-new` to cap only Bash, PowerShell, and Monitor tool commands. Claude Code keeps Bash, PowerShell, and Monitor tool commands under the cap whatever you list. Requires Claude Code v2.1.246 or later `CLAUDE_CODE_TOOL_MEMORY_LIMIT`| On Linux and WSL, set to a size such as `4G` to [cap the memory that Bash and PowerShell tool commands can use](</docs/en/tools-reference#memory-limit-on-linux-and-wsl>), and Monitor tool commands on v2.1.246 or later. Write the size in plain digits, alone for a number of bytes or with a `K`, `M`, `G`, or `T` suffix. Set `0` or `off` to turn the cap off. Once the first process Claude Code starts has turned the cap on or off, a changed value takes effect the next time you launch `claude`. Requires Claude Code v2.1.233 or later @@ -414,8 +414,8 @@ `DISABLE_PROMPT_CACHING`| Set to `1` to disable [prompt caching](</docs/en/prompt-caching#disable-prompt-caching>) for all models (takes precedence over per-model settings) `DISABLE_PROMPT_CACHING_FABLE`| Set to `1` to disable prompt caching for Fable models `DISABLE_PROMPT_CACHING_HAIKU`| Set to `1` to disable prompt caching for the [default Haiku model](</docs/en/prompt-caching#disable-prompt-caching>), wherever it runs -`DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for Opus models -`DISABLE_PROMPT_CACHING_SONNET`| Set to `1` to disable prompt caching for Sonnet models +`DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for the [default Opus model](</docs/en/prompt-caching#disable-prompt-caching>) +`DISABLE_PROMPT_CACHING_SONNET`| Set to `1` to disable prompt caching for the [default Sonnet model](</docs/en/prompt-caching#disable-prompt-caching>) `DISABLE_TELEMETRY`| Set to any non-empty value, such as `1`, to opt out of telemetry. **Setting it to`0` or `false` still opts out**, unlike most on/off variables; unset the variable to turn telemetry back on. Telemetry events don’t include user data like code, file paths, or Bash commands. Also disables feature-flag fetching. See [Turn telemetry off for your organization](</docs/en/managed-settings#turn-telemetry-off-for-your-organization>) `DISABLE_UPDATES`| Set to `1` to block all updates including manual `claude update` and `claude install`. Stricter than `DISABLE_AUTOUPDATER`. Use when distributing Claude Code through your own channels and users should not self-update `DISABLE_UPGRADE_COMMAND`| Set to `1` to hide the `/upgrade` command
modified Error reference View current →
Show diff (330 lines)
--- a/errors.md +++ b/errors.md @@ -68,6 +68,7 @@ `OAuth token revoked` / `OAuth token has expired`| Authentication `API Error: 401 Invalid authentication credentials`| Authentication `Login expired · Please run /login`| Authentication +`Failed to start OAuth callback server`| Authentication `Claude login not accepted · Run /login, then try again`| Authentication `Artifacts need a claude.ai login`| Authentication `Not signed in to the Cloud gateway — run /login.`| Authentication @@ -134,19 +135,21 @@ `Request too large for the API's 32MB request limit`| Request errors `Image was too large`| Request errors `Unable to resize image`| Request errors -`PDF too large` / `PDF is password protected`| Request errors +`PDF too large` / `PDF is password protected` / `pdftoppm is not installed`| Request errors `Extra inputs are not permitted`| Request errors `API Error: 400 ... tools.N.custom.input_schema: JSON schema is invalid` / `Property keys should match pattern`| Request errors `tool_use.name: String should have at most 200 characters`| Request errors `There's an issue with the selected model`| Request errors `Model ... is not a recognized model id`| Request errors `Model ... not found`| Request errors +`Couldn't confirm model ... with the API`| Request errors `API error: ... · model not changed`| Request errors `Claude Opus is not available with the Claude Pro plan`| Request errors `Claude Code ... does not support this model; version ... or newer is required`| Request errors `Claude Code ... is older than the minimum version required by your organization's policy`| Request errors `Model ... is restricted by your organization's settings`| Request errors `Model ... is not available. Your organization restricts model selection.`| Request errors +`Can't switch to the default model`| Request errors `Model switch ... blocked by a PreModelSwitch hook`| Request errors `couldn't save it as your default` / `couldn't confirm it was saved as your default`| Request errors `thinking.type.enabled is not supported for this model`| Request errors @@ -208,6 +211,7 @@ `Ultrareview clones <owner>/<repo> in the cloud with the GitHub account connected to your Claude account, and none is connected`| Command-line errors `Your connected GitHub account can't see <owner>/<repo>`| Command-line errors `The GitHub App preflight failed transiently (network or service hiccup) — retry in a moment to start from GitHub instead`| Command-line errors +`Not uploading this working tree` with `the upload cannot follow that setting`| Command-line errors `GitHub isn't connected to your Claude account, so this repository can't be cloned in the cloud`| Command-line errors `Single sign-on authorization needed`| Command-line errors `Failed to resume the conversation`| Command-line errors @@ -241,6 +245,7 @@ `Plugin "<name>@synced" is required by your organization and can't be disabled here`| Plugin errors `"<plugin>" was not uninstalled: it is still switched on in <file>`| Plugin errors `"<plugin>" was not uninstalled: <file> is there and could not be read`| Plugin errors +`Plugin "<plugin>" was not uninstalled: installed_plugins.json`| [Plugin troubleshooting](</docs/en/plugins/troubleshooting#installed-plugins-json-holds-a-record-this-version-cannot-read>) `would be spawned with zero tools — refusing`| Tool errors `File is covered by a Read deny rule in your permission settings`| Tool errors `cannot contain null bytes (\0)`| Tool errors @@ -253,6 +258,7 @@ `Its agent definition was not restored: the folder its definition file came from is not trusted`| Tool errors `Message too large for cross-session delivery`| Tool errors `Too many messages to this session just now`| Tool errors +`Cross-session message was dropped at the recipient session's inbox`| Tool errors `Refusing to send: reply target is a symlink` / `Refusing to send: cannot vet reply target`| Tool errors `Refusing to read <path>: its symlink resolution changed after permission was checked (<reason>)` / `Refusing to search <path>: its symlink resolution changed after permission was checked`| Tool errors `Refusing to write <path>: its parent-directory symlink resolution changed after permission was checked` / `Refusing to write <path>: it is a symbolic link. Write to the link's target path instead`| Tool errors @@ -665,16 +671,16 @@ The prompt to confirm went unanswered -If your account requires the [Fable usage-credits consent](</docs/en/model-config#fable-and-usage-credits>), Claude Code asks you to confirm before a Fable request bills usage credits. When nobody answers that consent prompt in a session that may have no one at its terminal, Claude Code closes the prompt and ends the turn with one of these messages: +If your account requires the [Fable usage-credits consent](</docs/en/model-config#fable-and-usage-credits>), Claude Code asks you to confirm before a Fable request bills usage credits. When the consent prompt closes with nobody answering it, Claude Code ends the turn with one of these messages: Fable limit reached · continuing on Fable 5.1 uses usage credits, and the prompt to confirm went unanswered — nothing was sent · answer it where this session is running, or /model to change Fable 5.1 now uses usage credits · the prompt to confirm went unanswered — nothing was sent · answer it where this session is running, or /model to change -The messages name the session’s Fable model, so on Fable 5 they read `continuing on Fable 5` and `Fable 5 now uses usage credits`. Before v2.1.257, the first message began `Fable 5 limit reached`. This happens in [Remote Control](</docs/en/remote-control>) sessions, [background sessions](</docs/en/agent-view>), and [agent team](</docs/en/agent-teams>) teammate sessions. Claude Code shows the consent prompt only in the session’s own interactive view: the terminal where it runs, or, for a background session, the [agents view](</docs/en/agent-view>) once you attach. A Remote Control client can’t display it. Claude Code closes the prompt at the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, five minutes by default, or as soon as a new prompt arrives while nobody has typed at that terminal, such as a prompt sent from a Remote Control client. Typing at the terminal where the session runs cancels the deadline, and Claude Code waits for your answer. In a background session’s attached view, typing doesn’t cancel the deadline, and a new prompt still closes the consent prompt, so answer before either happens. Claude Code sends nothing and keeps your model, so when you send your next prompt, Claude Code shows the consent prompt again. **What to do:** - - * At the terminal where the session runs, send another prompt and answer the consent prompt when it reappears. For a background session, attach to it from the [agents view](</docs/en/agent-view>) first. Resending from a Remote Control client shows this message again, because the client can’t display the prompt. +The messages name the session’s Fable model, so on Fable 5 they read `continuing on Fable 5` and `Fable 5 now uses usage credits`. Before v2.1.257, the first message began `Fable 5 limit reached`. This happens in [Remote Control](</docs/en/remote-control>) sessions, [background sessions](</docs/en/agent-view>), [agent team](</docs/en/agent-teams>) teammate sessions, and sessions that another application hosts through the Agent SDK. For when Claude Code closes the prompt, see [Fable and usage credits](</docs/en/model-config#fable-and-usage-credits>). **What to do:** + + * Where the session runs, at the terminal or in the application hosting it, send another prompt and answer the consent prompt when it reappears. For a background session, attach to it from the [agents view](</docs/en/agent-view>) first. Resending from a Remote Control client shows this message again, because the client can’t display the prompt. * Run `/model` to switch to a model that doesn’t bill usage credits - * To give yourself more time to reach that terminal, set [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) to a longer value or `"never"` + * To give yourself more time, set [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) to a longer value or `"never"` Before v2.1.236, this message didn’t appear: while a Remote Control client was connected, Claude Code waited 60 seconds for an answer and then continued the turn on your default model. @@ -1150,6 +1156,21 @@ ​ +Failed to start OAuth callback server + +When `/login`, `claude auth login`, or `claude setup-token` signs you in through the browser, Claude Code opens a listening port on `127.0.0.1` so your browser can return the sign-in result to it. This message means Claude Code couldn’t open that port, and the sign-in stops before a browser window or login URL appears: + + Failed to start OAuth callback server: Failed to start server. Is port 0 in use? + +If your message ends with `Is port 0 in use?`, the attempt to listen on the IPv4 loopback address `127.0.0.1` failed outright. Because the failure happens before a login URL exists, the `Paste code here if prompted` flow isn’t available as a workaround. **What to do:** + + * To sign in right away without the local listener: if you use a claude.ai subscription, run [`claude setup-token`](</docs/en/authentication#generate-a-long-lived-token>) on a machine where sign-in works and set the token it prints as `CLAUDE_CODE_OAUTH_TOKEN` on this machine. Otherwise set `ANTHROPIC_API_KEY` to a key from the [Claude Console](<https://platform.claude.com/settings/keys>). [Authentication precedence](</docs/en/authentication#authentication-precedence>) explains how Claude Code chooses between credentials. + * To use browser sign-in on this machine instead, Claude Code must be able to listen on `127.0.0.1`. If it runs inside a sandbox, check that the sandbox’s policy allows listening on local ports, then run `/login` again. If it should be able to and still fails, run `/feedback` so the report includes your environment details. + +### + +​ + Claude login not accepted You tried to start a [cloud session](</docs/en/claude-code-on-the-web>), and the server refused to create it with a 401: it didn’t accept the Claude login this machine sent, usually because the login expired or was revoked. The first part of the line is the server’s own reason when it gives one. Otherwise the line reads: @@ -1936,6 +1957,12 @@ * For oversized PDFs, ask Claude to read a page range with the Read tool instead of attaching the whole file, or extract text with a tool like `pdftotext` and reference the output file by path * For protected or invalid PDFs, remove the password or re-export the file from its source application, then try again +When Claude reads a page range from a PDF with the Read tool, the read can fail with a different message: + + pdftoppm is not installed. Install poppler-utils (e.g. `brew install poppler` or `apt-get install poppler-utils`) to enable PDF page rendering. + +Page-range reads render pages with `pdftoppm`. Install poppler-utils with the command the message gives, or on other platforms a poppler build that puts `pdftoppm` on your `PATH`. See [Read tool behavior](</docs/en/tools-reference#read-tool-behavior>) for which PDFs are read by page range. + ### ​ @@ -2010,16 +2037,16 @@ Model is not a recognized model id -The model string you passed to a model switch isn’t a model alias, a model ID this Claude Code version knows, or an ID that starts with `claude-`. The usual causes are a typo in the ID, a display name such as `Sonnet 5` where the ID `claude-sonnet-5` is expected, or an alias that only newer Claude Code versions recognize. Claude Code rejects the switch immediately. Before v2.1.200, Claude Code saved the string and failed on the next request with There’s an issue with the selected model. - - Model "claud-sonnet-5" is not a recognized model id. Did you mean 'claude-sonnet-5'? - -The trailing hint names the closest matching alias or model ID. When nothing is close enough, it reads `Run /model to see available models.` instead. In a session that the [Desktop app](</docs/en/desktop>) starts for you, the no-match hint reads `Switch to a different model.` Claude Code produces this error locally at the moment the switch is requested, before any API request is made. It applies when a model is set through the [Agent SDK](</docs/en/agent-sdk/typescript>) `setModel()` method, by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, or when you pick a model from a device connected through [Remote Control](</docs/en/remote-control>). Before v2.1.260, the check didn’t cover Remote Control picks, so Claude Code applied the pick and the next request failed with There’s an issue with the selected model. **What to do:** +The string you passed to a model switch isn’t one Claude Code can use as a model, so it refused the switch without sending a request and the session keeps its current model. You can get this error when a model is set through the [Agent SDK](</docs/en/agent-sdk/typescript>) `setModel()` method, by an app that runs the Claude Code CLI for you, such as the [Desktop app](</docs/en/desktop>), or when you pick a model from a device connected through [Remote Control](</docs/en/remote-control>). Before v2.1.200, Claude Code saved the string and failed on the next request with There’s an issue with the selected model. + + Model "Sonnet5" is not a recognized model id. Did you mean 'claude-sonnet-5'? + +In this example an app sent the display name `Sonnet 5`, which the message repeats without its space. The trailing hint names the closest matching alias or model ID. When nothing is close enough, it reads `Run /model to see available models.` instead. In a session that the [Desktop app](</docs/en/desktop>) starts for you, the no-match hint reads `Switch to a different model.` When you switch through the Agent SDK or an app on the Anthropic API, only a string that can’t be a model ID gets this error, such as a display name or an empty string. When you pick a model from a Remote Control device, Claude Code checks the string locally. Any string that isn’t a model alias, a model Claude Code lists or you configured, or an ID that starts with `claude-` gets this error, a mistyped ID such as `claud-sonnet-5` included. Before v2.1.260, this check didn’t cover Remote Control picks, so an unrecognized string was applied and failed on the next request. **What to do:** * Run `/model` with no argument to open the picker and choose from the models available to your account, then pass the alias or ID shown there - * If you used an alias that a newer Claude Code version supports, run `claude update`. A full ID that starts with `claude-` passes this local check even when the model is newer than your Claude Code version. The server can still require a minimum version for that model; see Claude Code does not support this model. + * If you used an alias that only a newer Claude Code version supports, run `claude update`, or pass the model’s full ID instead. The server can still require a minimum Claude Code version for that model; see Claude Code does not support this model. * A model saved before v2.1.200 isn’t repaired by this check. If a stale value keeps coming back, remove it from the locations listed under [Setting your model](</docs/en/model-config#setting-your-model>). - * The check runs only on the Anthropic API. On any other provider or gateway, including a custom `ANTHROPIC_BASE_URL`, the provider defines the model names, so Claude Code accepts any string and passes it through. Claude Code can still write the unrecognized-model diagnostic line at request time, on every provider. + * On any provider other than the Anthropic API, or behind a gateway or custom `ANTHROPIC_BASE_URL`, only an empty string gets this error. Claude Code can still write the unrecognized-model diagnostic line at request time, on every provider. ### @@ -2027,7 +2054,7 @@ Model not found -You picked a model with `/model <name>` and Claude Code couldn’t confirm that a model with that name exists. When the name isn’t a [model alias](</docs/en/model-config#model-aliases>) or another spelling Claude Code accepts locally, `/model` verifies it with a minimal API request, and this error is usually your API endpoint’s answer. A name that can’t be a model ID at all, such as one containing spaces, gets the same message. +You switched to a model by name and Claude Code couldn’t confirm that a model with that name exists. When the name isn’t a [model alias](</docs/en/model-config#model-aliases>) or another spelling Claude Code accepts locally, Claude Code verifies it with a minimal API request, and this error is usually your API endpoint’s answer. With `/model <name>`, a name that can’t be a model ID at all, such as one containing spaces, gets the same message. Model 'claude-opus-9' not found @@ -2035,7 +2062,23 @@ * Run `/model` with no argument and pick from the models available to your account, or use a [model alias](</docs/en/model-config#model-aliases>) such as `sonnet`, which resolves to a maintained default * If you typed a full ID, check it against your provider’s model catalog. A newly launched model can be available on the Anthropic API before your provider or region offers it. + * In the Agent SDK, `setModel()` fails with this message and the session keeps running on its previous model. In the TypeScript SDK, call [`supportedModels()`](</docs/en/agent-sdk/typescript#query-object>) to list the models you can switch to. * Before v2.1.265, `/model` also rejected the `opusplan[1m]` alias spelling with this error. On those versions, update Claude Code, or set the model in [settings](</docs/en/model-config#setting-your-model>) or with `--model` instead. + +### + +​ + +Couldn’t confirm model with the API + +You switched models through the [Agent SDK](</docs/en/agent-sdk/typescript>) `setModel()` method or an app that runs the Claude Code CLI for you, such as the [Desktop app](</docs/en/desktop>), and the request that confirms the model ID with your API endpoint got no answer within five seconds. The session keeps its current model. + + Couldn't confirm model "claude-sonnet-5" with the API. Try again, or run /model to see available models. + +In a session that the [Desktop app](</docs/en/desktop>) starts for you, the message ends at `Try again.` **What to do:** + + * Switch to the model again + * If the switch keeps failing, check that Claude Code can reach your API endpoint; see Network and connection errors ### @@ -2082,10 +2125,16 @@ API Error: 400 Claude Code 2.1.240 is older than the minimum version required by your organization's policy. Run 'claude update', or update the Claude desktop app, to continue. -**What to do:** - - * Run `claude update`, or update the Claude desktop app, then start a new session - * For the per-model wording, you can keep working in the current session by switching to another model with `/model` +The version the API checks is the one reported by the Claude Code binary that made the request. **What to do:** Update that binary, then start a new session. Where the binary came from decides how, except in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#pin-the-version>): + +The binary that made the request| How to update it +---|--- +A Claude Code you installed| Run `claude update` +The Claude desktop app| Update the app +The binary the [VS Code extension](</docs/en/vs-code>) bundles| Update the extension +The binary an Agent SDK package bundles| [Upgrade the SDK package](</docs/en/agent-sdk/hosting#runtime-dependencies>), then restart your application. In a [compiled single-file executable](</docs/en/agent-sdk/typescript#compile-to-a-single-executable>), rebuild it + + * For the per-model wording, you can keep working in the current session by switching to another model: run `/model` in the CLI, call [`setModel()`](</docs/en/agent-sdk/typescript#query-object>) on the TypeScript SDK’s `Query` object in streaming input mode, or call [`set_model()`](</docs/en/agent-sdk/python#claudesdkclient>) on the Python SDK’s `ClaudeSDKClient` * For the organization-policy wording, update before you continue ### @@ -2103,6 +2152,30 @@ * Run `/model` to pick from the models your organization allows. Restricted models are hidden from the picker. * If the restricted model was set in `--model`, `ANTHROPIC_MODEL`, the `model` field of a settings file, or the `model` frontmatter of a [subagent](</docs/en/sub-agents#choose-a-model>), skill, or command, remove or update that value so the notice doesn’t recur * If you need access to the restricted model, ask your organization admin to enable it. See [Organization model restrictions](</docs/en/model-config#organization-model-restrictions>). + +### + +​ + +Can’t switch to the default model + +You picked the Default model, for example by selecting the Default row in the `/model` picker or typing `/model default`. Claude Code refused the switch, so the session keeps its current model. + + Can't switch to the default model: your organization's managed settings block it (claude-opus-4-6) in "deniedModels", and none of the models they allow can be used as the default instead. Ask your administrator to update "deniedModels" or "availableModels". + +The wording after the colon names what blocked the switch: + + * **`your organization's managed settings block it ... in "deniedModels"`** : a managed deny list blocks the model the Default option resolves to + * **`your organization allows only the models listed in "availableModels"`** : a managed [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist with [`availableModelsMatch`](</docs/en/settings-reference#availablemodelsmatch>) set to `"exact"` leaves out the model the Default option resolves to + * **`Claude Code couldn't read your organization's managed settings to check which models they allow`** : the [managed settings](</docs/en/managed-settings>) couldn’t be read, and Claude Code refuses the switch rather than apply it unchecked + +**What to do:** + + * For the [`deniedModels`](</docs/en/settings-reference#deniedmodels>) and `availableModels` wordings, run `/model` and pick a model your organization allows by name + * Ask your administrator to update the managed setting the message names + * For the `couldn't read` wording, restart Claude Code; if it keeps happening, ask your administrator to check the managed settings + +If a session instead fails to start with a `Claude Code can't start` message under these managed settings, see Managed settings block the default model. ### @@ -2361,7 +2434,7 @@ ​ -Conflict between —bg and —print +Conflict between `--bg` and `--print` This message requires Claude Code v2.1.198 or later. You combined `--bg` with `-p` or `--print` in the same `claude` invocation. `--bg` starts a [background session](</docs/en/agent-view#from-your-shell>) that you later attach to with `claude agents`, while `--print` runs [non-interactively](</docs/en/headless>) and never starts the interactive session that `claude agents` attaches to. Before v2.1.198 this combination silently created a background job that could never be attached to. @@ -2376,7 +2449,7 @@ ​ -Invalid —agents configuration +Invalid `--agents` configuration The value you passed to `--agents` is invalid, so `claude` exits with code 1 instead of starting the session. When you pass `--safe-mode` or set [`CLAUDE_CODE_SAFE_MODE`](</docs/en/env-vars#variables>), Claude Code ignores `--agents` entirely. With `--resume` or `--continue`, an inline JSON value isn’t checked and the session starts; a value read from a file is checked on every launch. Before v2.1.242, Claude Code started the session anyway. @@ -2402,7 +2475,7 @@ ​ -Cloud sessions cannot be created from a —restricted session +Cloud sessions cannot be created from a `--restricted` session When you start a session with [`--restricted`](</docs/en/cli-reference#cli-flags>), Claude Code refuses to create [cloud sessions](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>) from it, because the new session would run outside the restricted process and wouldn’t enforce restricted mode. Claude Code refuses on the client, before contacting the server, so no cloud session is created: @@ -2434,7 +2507,7 @@ ​ -The —json-schema value is not a valid JSON Schema +The `--json-schema` value is not a valid JSON Schema The schema you passed to [`--json-schema`](</docs/en/cli-reference#cli-flags>) in [non-interactive mode](</docs/en/headless#get-structured-output>) failed JSON Schema compilation, so `claude` exits with code 1 instead of running the prompt. Before v2.1.205, an invalid schema produced unstructured output with no error, and any schema that used the `format` keyword was treated as invalid. @@ -2747,7 +2820,7 @@ ​ -Input must be provided when using —print +Input must be provided when using `--print` Bare `claude` needs stdout to be a terminal to start the interactive UI. When stdout is redirected, or the console isn’t a real terminal, such as PowerShell ISE and some IDE output panes, `claude` runs [non-interactively](</docs/en/headless>) instead. That is the same mode as `claude -p`, which requires a prompt, so the message names `--print` even when you didn’t pass the flag. Passing `-p`/`--print` with no prompt and nothing piped on stdin produces the same error anywhere. @@ -2922,6 +2995,20 @@ ​ +The repository upload can’t follow a git setting + +You started a [cloud session that uploads your local repository](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>), or an [ultrareview](</docs/en/ultrareview>) of a branch, and the upload can’t follow one of the git settings that decide which attribute rules apply to your files. If the upload went ahead and missed a rule, a file that git transforms before storing it, such as one a clean filter encrypts, could reach the cloud as it is on disk. Claude Code refuses the upload instead, and nothing is uploaded: + + Not uploading this working tree: core.ignoreCase (which decides whether .gitattributes patterns match file names regardless of letter case) is set in <file>, and the upload cannot follow that setting, so a file git would change before storing it (to encrypt it, for example) could be uploaded as it is on disk. Move the core.ignoreCase line into this repository’s .git/config or directly into your ~/.gitconfig, then retry. + +The message names the setting and where it’s set, and ends with the fix for the case you hit. The same refusal appears for `core.attributesFile` and `attr.tree`, each with its own fix. The message can name a config file that your git configuration pulls in through an `include` or `includeIf` directive, even when that directive’s condition doesn’t apply to this repository. **What to do:** + + * Apply the fix in the message’s final sentence + +### + +​ + GitHub isn’t connected to your Claude account You started a [cloud session](</docs/en/claude-code-on-the-web>) from your local repository, for example with `/autofix-pr`. No GitHub account is connected to your Claude account, or the connection expired, so Claude Code refuses the launch: @@ -3380,7 +3467,7 @@ Plugin was not uninstalled -You ran [`claude plugin uninstall`](</docs/en/plugins/cli-reference#plugin-uninstall>), or chose **Uninstall** in the `/plugin` **Installed** tab, and the uninstall stopped with a message starting `"<plugin>" was not uninstalled:`. When Claude Code removed the plugin’s entry from `enabledPlugins` and read that scope’s settings files back, either the plugin was still switched on there, or a file that could switch it on couldn’t be read or checked. Deleting the plugin’s saved options, secrets, and data while a settings entry could switch it back on would lose them, so the uninstall stops instead: the plugin stays installed and nothing it saved is deleted. +You ran [`claude plugin uninstall`](</docs/en/plugins/cli-reference#plugin-uninstall>), or chose **Uninstall** in the `/plugin` **Installed** tab, and the uninstall stopped with a message starting `"<plugin>" was not uninstalled:`. If the text after that colon starts with `installed_plugins.json` instead of naming a settings file, the cause is content in `installed_plugins.json` that this version of Claude Code can’t read. For that form, see [`installed_plugins.json` holds a record this version can’t read](</docs/en/plugins/troubleshooting#installed-plugins-json-holds-a-record-this-version-cannot-read>). When Claude Code removed the plugin’s entry from `enabledPlugins` and read that scope’s settings files back, either the plugin was still switched on there, or a file that could switch it on couldn’t be read or checked. Deleting the plugin’s saved options, secrets, and data while a settings entry could switch it back on would lose them, so the uninstall stops instead: the plugin stays installed and nothing it saved is deleted. ✘ Failed to uninstall plugin "formatter": "formatter" was not uninstalled: it is still switched on in /home/user/project/.claude/settings.local.json, although the settings change reported no error. It is still installed. Take it out of "enabledPlugins" in that file yourself, then uninstall it again. @@ -3577,6 +3664,31 @@ * If you prompted the burst yourself, ask Claude to combine what’s left into a single message Before v2.1.236, Claude Code reported these sends as sent. The receiving session dropped them unread. + +### + +​ + +Cross-session message was dropped at the recipient session’s inbox + +Claude sent a [cross-session message](</docs/en/cross-session-messaging>) to another of your sessions on this machine, and that session’s inbox discarded it before Claude in that session read it. The line names the recipient’s address and, when the recipient gave a reason, adds the reason after a dash: + + Cross-session message was dropped at the recipient session's inbox (recipient: uds:/tmp/cc-socks/13605.sock) and not delivered — its queue of undelivered peer messages was full. Claude was told not to resend right away. + +One line can cover several dropped messages. It then starts in the plural, for example `Cross-session messages (12) were dropped`. To find which session an address belongs to, compare it with the [`Peer address` row](</docs/en/cross-session-messaging#the-sessions-inbox-socket>) that `/status` shows in each session. After the dash, the line gives one or more of these reasons: + + * `its queue of undelivered peer messages was full`: the recipient already held as many undelivered messages from other sessions as its queue allows + * `you sent faster than that session accepts`: the sending session’s messages arrived faster than the recipient accepts from one sender + * `it repeated your previous message`: the message was identical to one the sending session sent this recipient shortly before + * `a relay loop between sessions was cut`: the message continued a chain of sessions messaging each other, and the chain had passed through the recipient too many times or grown too long + +**What to do:** + + * Assume the recipient never saw the dropped messages. Claude Code tells Claude the same, and tells it to include anything that still matters in one later message instead of resending right away + * If your sessions send each other frequent updates, ask Claude to send fewer, larger messages, such as one report when a session finishes its work + * For `a relay loop between sessions was cut`, type the next instruction into one of the sessions yourself. A message Claude sends in response to your own prompt begins a new chain + +Before v2.1.238, the sending session got no report when the recipient’s inbox discarded a message. ###
modified Speed up responses with fast mode View current →
--- a/fast-mode.md +++ b/fast-mode.md @@ -46,7 +46,7 @@ Use fast mode in cloud sessions -Fast mode works in [cloud sessions](</docs/en/claude-code-on-the-web>) when it’s available on your account, whether the session runs on Anthropic-managed infrastructure or a [self-hosted runner](</docs/en/self-hosted-environments>). Requires Claude Code v2.1.271 or later in the session’s environment. Type `/fast on` in the session to turn fast mode on. It stays on for that session only and isn’t saved as your default. The requirements apply in cloud sessions too. +Fast mode works in [cloud sessions](</docs/en/claude-code-on-the-web>) when it’s available on your account, whether the session runs on Anthropic-managed infrastructure or a [self-hosted runner](</docs/en/self-hosted-environments>). Requires Claude Code v2.1.271 or later in the session’s environment. Type `/fast on` in the session to turn fast mode on. It stays on for that session only and isn’t saved as your default. The requirements apply in cloud sessions too. In the browser at [claude.ai/code](<https://claude.ai/code>), you can also turn fast mode on and off from the model menu on the message box. The menu shows the switch when your plan includes fast mode and the selected model supports it. ##
modified Feature availability View current →
--- a/feature-availability.md +++ b/feature-availability.md @@ -168,7 +168,7 @@ [Computer use](</docs/en/computer-use>)| ✓| ✓| ✗| ✗ Dispatch ([Desktop](</docs/en/desktop#sessions-from-dispatch>))| ✓| ✓| ✗| ✗ [Code Review](</docs/en/code-review>)| ✗| ✗| ✓| ✓ -[Artifacts](</docs/en/artifacts>)| ✓| ✓| ✓| Admin-enabled +[Artifacts](</docs/en/artifacts>)| ✓| ✓| ✓| ✓ [Analytics dashboard and contribution metrics](</docs/en/analytics>)| ✗| ✗| ✓| ✓ [Enterprise Analytics API](</docs/en/analytics#access-data-programmatically>)| ✗| ✗| ✗| ✓ [Server-managed settings](</docs/en/server-managed-settings>)| ✗| ✗| ✓| ✓
modified Rewind file changes with checkpointing View current →
Show diff (161 lines)
--- a/file-checkpointing.md +++ b/file-checkpointing.md @@ -1,8 +1,4 @@ -File checkpointing tracks file modifications made through the Write, Edit, and NotebookEdit tools during an agent session, allowing you to rewind files to any previous state. Want to try it out? Jump to the interactive example. With checkpointing, you can: - - * **Undo unwanted changes** by restoring files to a known good state - * **Explore alternatives** by restoring to a checkpoint and trying a different approach - * **Recover from errors** when the agent makes incorrect modifications +File checkpointing tracks file modifications made through the [Write](</docs/en/tools-reference#write-tool-behavior>), [Edit](</docs/en/tools-reference#edit-tool-behavior>), and [NotebookEdit](</docs/en/tools-reference#notebookedit-tool-behavior>) tools during an agent session, allowing you to rewind files to any previous state. To watch a rewind restore a file, jump to the interactive example. Only changes made through the Write, Edit, and NotebookEdit tools are tracked. Changes made through Bash commands (like `echo > file.txt` or `sed -i`) are not captured by the checkpoint system, and neither are edits a [subagent](</docs/en/agent-sdk/subagents>) applies, except a [skill with `context: fork`](</docs/en/skills#run-skills-in-a-subagent>) that runs in the foreground. @@ -24,7 +20,7 @@ Implement checkpointing -To use file checkpointing, enable it in your options, capture checkpoint UUIDs from the response stream, then call `rewindFiles()` (TypeScript) or `rewind_files()` (Python) when you need to restore. The following example shows the complete flow: enable checkpointing, capture the checkpoint UUID and session ID from the response stream, then resume the session later to rewind files. Each step is explained in detail below. The examples in this section use the prompt “Refactor the authentication module”. Run them in a project that contains an authentication module, or change the prompt to name files that exist in your project, so you can watch files change and see the rewind restore them. +To use file checkpointing, enable it in your options, capture checkpoint UUIDs from the response stream, then call `rewindFiles()` (TypeScript) or `rewind_files()` (Python) when you need to restore. The examples in this section use the prompt “Refactor the authentication module”. Run them in a project that contains an authentication module, or change the prompt to name files that exist in your project, so you can watch files change and see the rewind restore them. This example enables checkpointing, captures the checkpoint UUID and session ID from the response stream, then resumes the session later to rewind files. The example’s numbered comments match the steps that follow. Python @@ -139,27 +135,7 @@ Enable checkpointing| `enable_file_checkpointing=True`| `enableFileCheckpointing: true`| Tracks file changes for rewinding Receive checkpoint UUIDs| `extra_args={"replay-user-messages": None}`| `extraArgs: { 'replay-user-messages': null }`| Required to get user message UUIDs in the stream -Python - -TypeScript - - options = ClaudeAgentOptions( - enable_file_checkpointing=True, - permission_mode="acceptEdits", - extra_args={"replay-user-messages": None}, - ) - - async with ClaudeSDKClient(options) as client: - await client.query("Refactor the authentication module") - - const response = query({ - prompt: "Refactor the authentication module", - options: { - enableFileCheckpointing: true, - permissionMode: "acceptEdits" as const, - extraArgs: { "replay-user-messages": null } - } - }); +The lead example under Implement checkpointing also sets the permission mode to `acceptEdits`, which approves the agent’s file edits without a prompt. For more information, see [Permission modes](</docs/en/agent-sdk/permissions#permission-modes>). 2 @@ -167,67 +143,11 @@ With the `replay-user-messages` option set, each user message in the response stream has a UUID that serves as a checkpoint.For most use cases, capture the first user message UUID (`message.uuid`); rewinding to it restores the tracked files to their original state. To store multiple checkpoints and rewind to intermediate states, see Multiple restore points.Capturing the session ID (`message.session_id`) is optional; you only need it if you want to rewind later, after the stream completes. If you’re calling `rewindFiles()` immediately while still processing messages (as the example in Checkpoint before risky operations does), you can skip capturing the session ID. -Python - -TypeScript - - checkpoint_id = None - session_id = None - - async for message in client.receive_response(): - # Capture the first user message UUID as the checkpoint - if isinstance(message, UserMessage) and message.uuid and checkpoint_id is None: - checkpoint_id = message.uuid - # Capture session ID from the result message - if isinstance(message, ResultMessage): - session_id = message.session_id - - let checkpointId: string | undefined; - let sessionId: string | undefined; - - for await (const message of response) { - // Capture the first user message UUID as the checkpoint - if (message.type === "user" && message.uuid && !checkpointId) { - checkpointId = message.uuid; - } - // Capture session ID from any message that has it - if ("session_id" in message) { - sessionId = message.session_id; - } - } - 3 Rewind files -To rewind after the stream completes, resume the session with an empty prompt and call `rewind_files()` (Python) or `rewindFiles()` (TypeScript) with your checkpoint UUID. You can also rewind during the stream; see Checkpoint before risky operations for that pattern. - -Python - -TypeScript - - async with ClaudeSDKClient( - ClaudeAgentOptions(enable_file_checkpointing=True, resume=session_id) - ) as client: - await client.query("") # Empty prompt to open the connection - async for message in client.receive_response(): - if checkpoint_id: - await client.rewind_files(checkpoint_id) - break - - const rewindQuery = query({ - prompt: "", // Empty prompt to open the connection - options: { ...opts, resume: sessionId } - }); - - for await (const msg of rewindQuery) { - if (checkpointId) { - await rewindQuery.rewindFiles(checkpointId); - } - break; - } - -If you capture the session ID and checkpoint ID, you can also rewind from the CLI. This command requires the `claude` executable, which comes from [installing Claude Code](</docs/en/setup>). The SDK enables checkpointing for you, but when you run `claude -p` directly you must set the `CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING` environment variable: +To rewind after the stream completes, resume the session with an empty prompt and call `rewind_files()` (Python) or `rewindFiles()` (TypeScript) with your checkpoint UUID. Enable checkpointing on the resumed session’s options too, and call rewind from inside the response loop. You can also rewind during the stream. See Checkpoint before risky operations for that pattern.If you capture the session ID and checkpoint ID, you can also rewind from the CLI. This command requires the `claude` executable, which comes from [installing Claude Code](</docs/en/setup>). The SDK enables checkpointing for you, but when you run `claude -p` directly you must set the `CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING` environment variable: CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true claude -p --resume <session-id> --rewind-files <checkpoint-uuid> @@ -737,40 +657,7 @@ ”ProcessTransport is not ready for writing” error -This error occurs when you call `rewindFiles()` or `rewind_files()` after you’ve finished iterating through the response. The connection to the CLI process closes when the loop completes. **Solution** : Resume the session with an empty prompt, then call rewind on the new query: - -Python - -TypeScript - - # Resume session with empty prompt, then rewind - async with ClaudeSDKClient( - ClaudeAgentOptions(enable_file_checkpointing=True, resume=session_id) - ) as client: - await client.query("") - async for message in client.receive_response(): - if checkpoint_id: - await client.rewind_files(checkpoint_id) - break - - // Resume session with empty prompt, then rewind - const rewindQuery = query({ - prompt: "", - options: { ...opts, resume: sessionId } - }); - - try { - for await (const msg of rewindQuery) { - if (checkpointId) { - await rewindQuery.rewindFiles(checkpointId); - } - break; - } - } catch (error) { - // An error here means the rewind didn't complete, for example the checkpoint - // wasn't found or the session couldn't be resumed. - console.error(`Rewind session ended with an error: ${error}`); - } +This error occurs when you call `rewindFiles()` or `rewind_files()` after you’ve finished iterating through the response. The connection to the CLI process closes when the loop completes. **Solution** : Resume the session with an empty prompt, then call rewind on the new query. The lead example under Implement checkpointing shows the resume-and-rewind call in both languages, at the comment marked Step 3. ##
modified Fullscreen rendering View current →
--- a/fullscreen.md +++ b/fullscreen.md @@ -232,7 +232,7 @@ CLAUDE_CODE_NO_FLICKER=1 CLAUDE_CODE_DISABLE_MOUSE=1 claude -With mouse capture disabled, keyboard scrolling with `PgUp`, `PgDn`, `Ctrl+Home`, and `Ctrl+End` still works, and your terminal handles selection natively. You lose click-to-position-cursor, click-to-expand, URL clicking, and wheel scrolling inside Claude Code. To keep wheel scrolling but turn off click, drag, and hover handling, set `CLAUDE_CODE_DISABLE_MOUSE_CLICKS=1` instead. Requires Claude Code v2.1.195 or later. `CLAUDE_CODE_DISABLE_MOUSE` takes precedence when both variables are set. With clicks disabled, Claude Code still captures the mouse, so the wheel and touchpad scroll the conversation but left clicks do nothing inside Claude Code. You still need to hold your terminal’s key for native click-and-drag selection. Right-click and middle-click paste continue to work on terminals that support them. +With mouse capture disabled, keyboard scrolling with `PgUp`, `PgDn`, `Ctrl+Home`, and `Ctrl+End` still works, and your terminal handles selection natively. You lose click-to-position-cursor, click-to-expand, URL clicking, and wheel scrolling inside Claude Code. To keep wheel scrolling but turn off click, drag, and hover handling, set `CLAUDE_CODE_DISABLE_MOUSE_CLICKS=1` instead. `CLAUDE_CODE_DISABLE_MOUSE` takes precedence when both variables are set. With clicks disabled, Claude Code still captures the mouse, so the wheel and touchpad scroll the conversation but left clicks do nothing inside Claude Code. You still need to hold your terminal’s key for native click-and-drag selection. Right-click and middle-click paste continue to work on terminals that support them. ##
modified Claude Code GitHub Actions View current →
--- a/github-actions.md +++ b/github-actions.md @@ -29,7 +29,7 @@ * If Claude Code already has an API key, it reuses that key, and offers to keep the repository’s existing `ANTHROPIC_API_KEY` secret if one is already set * Otherwise, choose between creating a long-lived token with your Claude subscription and pasting in an API key -Claude Code saves the credential as a repository secret, named `ANTHROPIC_API_KEY` for an API key or `CLAUDE_CODE_OAUTH_TOKEN` for a subscription token. Claude Code then pushes a branch with the workflow files you select, already set to use that secret, and opens GitHub in your browser with a pull request ready to create. Create and merge that pull request, and `@claude` works in the repository. If you select the review workflow, Claude posts each review on the pull request itself, as an inline comment on each issue it finds or as one summary comment when it finds none. Claude skips some pull requests, such as drafts. The review workflow example uses the same skill and lists them. Before v2.1.229, Claude wrote its review only to the workflow run log. To update a review workflow that an earlier version generated, do one of the following: +Claude Code saves the credential as a repository secret, named `ANTHROPIC_API_KEY` for an API key or `CLAUDE_CODE_OAUTH_TOKEN` for a subscription token. Claude Code then pushes a branch with the workflow files you select, already set to use that secret, and opens GitHub in your browser with a pull request ready to create. Create and merge that pull request, and `@claude` works in the repository. To stop setup partway through, press Esc. A step already in progress finishes, and no later step starts. The closing message lists what already happened in the repository, such as a pushed branch or a saved secret. If you select the review workflow, Claude posts each review on the pull request itself, as an inline comment on each issue it finds or as one summary comment when it finds none. Claude skips some pull requests, such as drafts. The review workflow example uses the same skill and lists them. Before v2.1.229, Claude wrote its review only to the workflow run log. To update a review workflow that an earlier version generated, do one of the following: * Run `/install-github-app` again. When the repository already has a `claude.yml`, select **Update workflow file with latest version**. Claude Code pushes fresh copies of the workflow files to a new branch and opens the pull request, the same as a first install. * Add the `--comment` argument and the `claude_args` line from the review workflow example to the checked-in file yourself, which keeps any other edits you made to it.
modified Claude Code with GitHub Enterprise Server View current →
--- a/github-enterprise-server.md +++ b/github-enterprise-server.md @@ -95,7 +95,7 @@ Network requirements -For Anthropic-hosted sessions, your GHES instance must be reachable from Anthropic infrastructure so Claude can clone repositories and post review comments. If your GHES instance is behind a firewall, allowlist Anthropic’s [outbound IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses#outbound-ip-addresses>). Sessions in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#configure-git>) clone from inside your network instead, unless the runner opts into the [Anthropic git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), which fetches from Anthropic’s side and needs the same reachability; the [SCM connector](</docs/en/self-hosted-environments-reference#scm-connector-flags>) covers the hosted pre-session flows, such as the repository picker, for a GHES host that’s only routable internally. +For Anthropic-hosted sessions, your GHES instance must be reachable from Anthropic infrastructure so Claude can clone repositories and post review comments. If your GHES instance is behind a firewall, allowlist Anthropic’s [outbound IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses#outbound-ip-addresses>). Sessions in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#configure-git>) clone from inside your network instead, unless the runner opts into the [Anthropic git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), which fetches from Anthropic’s side and needs the same reachability. Hosted pre-session flows, such as the repository picker, run on Anthropic’s side before a session starts. They need your GHES instance to be reachable from Anthropic infrastructure even when the session runs in a self-hosted environment. The [SCM connector](</docs/en/self-hosted-environments-reference#scm-connector-flags>) isn’t available, so those flows can’t reach a GHES host that’s only routable internally. ## @@ -248,7 +248,7 @@ GHES instance not reachable -If reviews or Anthropic-hosted cloud sessions time out, your GHES instance may not be reachable from Anthropic infrastructure. Confirm your firewall allows inbound connections from Anthropic’s [outbound IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses#outbound-ip-addresses>). Sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) reach GHES from inside your network, so for them check the runner’s own network path and the [SCM connector](</docs/en/self-hosted-environments-reference#scm-connector-flags>) instead. +If reviews or Anthropic-hosted cloud sessions time out, your GHES instance may not be reachable from Anthropic infrastructure. Confirm your firewall allows inbound connections from Anthropic’s [outbound IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses#outbound-ip-addresses>). Sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) reach GHES from inside your network, so when one of them can’t clone, check the runner’s own network path instead. For the repository picker and other hosted pre-session flows, see Network requirements. ### @@ -256,7 +256,7 @@ Session start fails with `Unable to get organization UUID` -Sign in with `/login` using your organization account. If you authenticate with an API key instead, cloud sessions fail earlier with a message asking you to run `/login`. +Claude Code couldn’t read a claude.ai organization from your credentials. Sign in with `/login` using an account in your Team or Enterprise organization, since GitHub Enterprise Server support is limited to those plans. See [Unable to get organization UUID](</docs/en/claude-code-on-the-web#unable-to-get-organization-uuid>) for the causes and the other messages this state produces. ##
modified Glossary View current →
--- a/glossary.md +++ b/glossary.md @@ -52,7 +52,7 @@ Artifact -A live, interactive web page Claude Code publishes from your session to a private URL on claude.ai, so you can see output visually or share it instead of reading terminal text. The page updates in place when the session republishes. Artifacts you create from Claude Code appear in the same gallery as artifacts created in claude.ai conversations. Sharing depends on your plan: on Pro and Max, a public link that anyone can open; on Team and Enterprise, sharing within your organization, plus public links once an Owner enables them. Learn more: [Share session output as artifacts](</docs/en/artifacts>) +A live, interactive web page Claude Code publishes from your session to a private URL on claude.ai, so you can see output visually or share it instead of reading terminal text. The page updates in place when the session republishes. Artifacts you create from Claude Code appear in the same gallery as artifacts created in claude.ai conversations. Sharing options depend on your plan: see [Share an artifact](</docs/en/artifacts#share-an-artifact>). Learn more: [Share session output as artifacts](</docs/en/artifacts>) ###
modified Claude Code on Google Cloud's Agent Platform View current →
--- a/google-vertex-ai.md +++ b/google-vertex-ai.md @@ -215,7 +215,7 @@ 1M token context window -Claude Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support the [1M token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) on Google Cloud’s Agent Platform. Sonnet 5 always runs with the 1M window, with no `[1m]` variant to select. For the other models, Claude Code automatically enables the extended context window when you select a 1M model variant. The setup wizard offers a 1M context option when it pins models. To enable it for a manually pinned model instead, append `[1m]` to the model ID. See [Pin models for third-party deployments](</docs/en/model-config#pin-models-for-third-party-deployments>) for details. +Claude Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support the [1M token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>) on Google Cloud’s Agent Platform. Sonnet 5 always runs with the 1M window, with no `[1m]` variant to select. For the other models, Claude Code automatically enables the extended context window when you select a 1M model variant. The setup wizard offers a 1M context option when it pins models. To enable it for a manually pinned model instead, append `[1m]` to the model ID. See [Pin models for third-party deployments](</docs/en/model-config#pin-models-for-third-party-deployments>) for details, including how to use the 1M window without changing the pin. ##
modified Automate actions with hooks View current →
--- a/hooks-guide.md +++ b/hooks-guide.md @@ -168,7 +168,7 @@ `elicitation_url_dialog`| An MCP server asks you to open a browser URL and you haven’t typed for about six seconds `elicitation_complete`| An MCP server reports that a [URL-mode elicitation](</docs/en/hooks#elicitation-input>) is complete `elicitation_response`| An MCP elicitation response is sent back to the server -`agent_needs_input`| A background session starts waiting on your input while [agent view](</docs/en/agent-view>) is open, or the current session asks you an [agent team teammate’s terminal setup question](</docs/en/agent-teams#choose-a-display-mode>) and you haven’t typed for about six seconds +`agent_needs_input`| A background session starts waiting on your input while [agent view](</docs/en/agent-view>) is open. Also fires when a terminal session shows you an [agent team teammate’s terminal setup question](</docs/en/agent-teams#choose-a-display-mode>) or auto mode’s notice about [classifier request charges](</docs/en/auto-mode-classifier-billing>) and you haven’t typed for about six seconds `agent_completed`| A background session finishes or fails. Fires only while [agent view](</docs/en/agent-view>) is open `quota_auto_resume_fired`| Claude Code continues your task after a claude.ai usage limit paused it: at the reset, or sooner when something you do in Claude Code during the wait, such as adding usage credits, upgrading your plan, or switching models, makes usage available again, with the [model-setting exception](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>) `quota_auto_resume_stale`| A claude.ai usage limit reset while your computer slept for more than about 30 minutes. Claude Code waits for you to press `Enter` instead of continuing. After a shorter sleep it continues and fires `quota_auto_resume_fired` instead
modified Host and maintain a marketplace View current →
--- a/host-marketplace.md +++ b/host-marketplace.md @@ -39,6 +39,26 @@ Avoid relative-path entries in a URL-hosted marketplace When users add your marketplace as a bare `marketplace.json` URL, Claude Code downloads only that file. An entry in your `plugins` array whose `source` is a relative path such as `./plugins/formatter` then fails at install with [`its marketplace entry path does not stay inside the marketplace directory`](</docs/en/plugins/troubleshooting#plugins-with-relative-paths-fail-in-url-based-marketplaces>). Give every entry a source that can be fetched on its own, such as a `github` repository or an `archive` URL, or host the marketplace in a git repository so Claude Code clones the whole tree. + +### + +​ + +Stay within the download limits for hosted files + +When users add your marketplace as a `marketplace.json` URL, or install an entry with an [`archive`](</docs/en/plugins/marketplace-reference#archive-plugin-source>) source, Claude Code downloads the file from your server. The download fails past the limits in this table, so size your files and configure your server to stay inside them. + +File| Largest download| Time for your server to respond| Redirects +---|---|---|--- +`marketplace.json` from a `url` marketplace source| 5 MiB| 10 seconds| A redirect to a different origin must use `https://` and can’t point at a loopback, link-local, or cloud-metadata host, so a redirect from `https://` to `http://` fails +Zip from an `archive` plugin source| 256 MiB| 120 seconds| At most five. Every redirect target must use `https://` and can’t point at a loopback, link-local, or cloud-metadata host + +A request that a redirect sends to a different origin carries none of the headers you configured on the marketplace source or the plugin entry. After an archive downloads, the install fails when the zip exceeds any of these extraction limits: + + * **Entries** : 100,000 files and directories + * **File size** : 512 MiB for any one file, uncompressed + * **Total size** : 1 GiB uncompressed + * **Compression ratio** : uncompressed content 50 times the size of the zip ###
modified Customize keyboard shortcuts View current →
--- a/keybindings.md +++ b/keybindings.md @@ -16,7 +16,7 @@ `$docs`| Optional documentation URL `bindings`| Array of binding blocks by context -This example binds `Ctrl+E` to open an external editor in the chat context, and unbinds `Ctrl+U`: +This example binds `Ctrl+E` to open an external editor in the chat context, and unbinds `Ctrl+S`: { "$schema": "https://www.schemastore.org/claude-code-keybindings.json", @@ -26,7 +26,7 @@ "context": "Chat", "bindings": { "ctrl+e": "chat:externalEditor", - "ctrl+u": null + "ctrl+s": null } } ] @@ -51,7 +51,7 @@ `Help`| Help menu is visible `Transcript`| Transcript viewer `HistorySearch`| History search mode (Ctrl+R) -`Task`| Background task is running +`Task`| A task is running in the foreground `ThemePicker`| Theme picker dialog `Attachments`| Image attachment navigation in select dialogs `Footer`| Footer indicator navigation (tasks, teams, diff, artifacts) @@ -311,7 +311,7 @@ `footer:down`| Down| Navigate down in footer `footer:openSelected`| Enter| Open selected footer item `footer:clearSelection`| Escape| Clear footer selection -`footer:dismiss`| (unbound)| Removed in v2.1.281. A `keybindings.json` that still names the action remains valid, and the binding does nothing. Before v2.1.281, Backspace and Delete dismissed the selected artifact link from the footer +`footer:dismiss`| (unbound)| Binding a key to this action has no effect, and a `keybindings.json` that names it remains valid. Before v2.1.281, Backspace and Delete were bound to it and dismissed the selected artifact link from the footer. While a footer item is selected, such as a row in the agent panel below the prompt, `Enter` opens it even when you rebind `Enter` in the `Chat` context to `chat:queueSubmit` or `chat:newline`. `Chat` bindings on keys the `Footer` context doesn’t bind, such as `Shift+Tab` for `chat:cycleMode`, keep working while an item is selected. @@ -429,7 +429,7 @@ `select:accept`| Enter| Accept selection `select:cancel`| Escape| Cancel selection -In list panels such as `/skills` and `/mcp`, Claude Code applies your `select:pageUp`, `select:pageDown`, `select:first`, and `select:last` bindings. In most other lists, such as the `/model` picker, your `select:first` and `select:last` bindings apply. PageUp and PageDown page through the options in those lists regardless of your bindings. Before v2.1.280, those other lists ignored Home, End, and your `select:first` and `select:last` bindings. +In list panels such as `/skills`, `/mcp`, and `/tasks`, Claude Code applies your `select:pageUp`, `select:pageDown`, `select:first`, and `select:last` bindings. In most other lists, such as the `/model` picker, your `select:first` and `select:last` bindings apply. PageUp and PageDown page through the options in those lists regardless of your bindings. Before v2.1.280, those other lists ignored Home, End, and your `select:first` and `select:last` bindings. Before v2.1.283, the `/mcp` tool list paged with fixed PageUp and PageDown keys regardless of your bindings. ### @@ -711,13 +711,14 @@ Validation -Claude Code validates your keybindings and shows warnings for: +Claude Code validates your keybindings and writes a warning to the debug log for: * Parse errors (invalid JSON or structure) + * Misspelled modifiers, such as `ctl+k`. Claude Code drops the part it doesn’t recognize and applies the binding to the keystroke that remains, `k` in this example. * Invalid context names * Invalid action values, such as an action that isn’t a string or `null` * Unknown action names, such as a typo of a registered action. Claude Code skips the binding and keeps any default binding for that key in effect. Before v2.1.246, a binding with an unknown action name silently disabled that key * Reserved shortcut conflicts * Duplicate bindings in the same context -Claude Code reports warnings when the file loads and writes each one to the debug log. Start Claude Code with [`--debug`](</docs/en/cli-reference#cli-flags>) to see the details. +Start Claude Code with [`--debug`](</docs/en/cli-reference#cli-flags>) to see the details.
modified Claude Code gateway compatibility guide View current →
--- a/llm-gateway-protocol.md +++ b/llm-gateway-protocol.md @@ -61,7 +61,7 @@ Streaming -Stream inference responses. Claude Code reads the stream as it arrives, so if your gateway buffers complete responses before relaying them, Claude Code stalls. Deliver each response’s full event sequence without dropping, duplicating, or reordering events. When an event references a content block whose `content_block_start` never arrived, or a block whose `content_block_stop` already arrived, Claude Code stops reading the stream at that event instead of applying it, so a duplicated `content_block_stop` can’t run the same tool call twice. [The response above may be incomplete](</docs/en/errors#the-response-above-may-be-incomplete>) describes what the user sees, under the `Part of the response never arrived` and `The response stream was malformed` variants. Relay each response through its final `message_delta` and `message_stop` events before ending the body. A body that ends after a `message_delta` carrying a `stop_reason`, with no content block still open and no content block event after that frame, counts as complete even when `message_stop` is missing. A body that your gateway ends cleanly any earlier, once a content block has started, is treated the same as a dropped connection: [Automatic retries](</docs/en/errors#automatic-retries>) says when Claude Code re-issues the request, and [The response above may be incomplete](</docs/en/errors#the-response-above-may-be-incomplete>) covers what it keeps once visible content has arrived. Claude Code keeps the `stop_reason` a `message_delta` delivers, so a later usage-only `message_delta` whose `delta` has `stop_reason: null` or no `stop_reason` key doesn’t clear it. When the client speaks the Amazon Bedrock format, relay the `InvokeModelWithResponseStream` response body and its `Content-Type: application/vnd.amazon.eventstream` header unmodified, and don’t convert the stream to server-sent events. See [Streaming errors behind a gateway or proxy](</docs/en/amazon-bedrock#streaming-errors-behind-a-gateway-or-proxy>). Forward keep-alive pings as well. On connections through `ANTHROPIC_BASE_URL` or `ANTHROPIC_AWS_BASE_URL`, Claude Code counts every byte your gateway relays, including SSE `ping` events and comment lines, and aborts a stream that goes silent for 300 seconds by default. The upstream’s pings are the only traffic during long thinking pauses, so if your gateway strips or buffers them, Claude Code aborts the stream during those pauses; [Automatic retries](</docs/en/errors#automatic-retries>) covers what an aborted stream reports based on how far the response had progressed. An upstream that sends no pings at all, such as Amazon Bedrock’s binary event-stream, leaves those pauses with nothing to forward. When translating from such an upstream, emit your own `ping` events during silent gaps. Gateways reached through `ANTHROPIC_BEDROCK_BASE_URL`, `ANTHROPIC_VERTEX_BASE_URL`, or `ANTHROPIC_FOUNDRY_BASE_URL` aren’t wrapped by this byte-level watchdog, even when they relay the Anthropic Messages format; there, a [5-minute idle timeout](</docs/en/env-vars>) aborts a silent stream instead, and on `ANTHROPIC_BEDROCK_BASE_URL` connections you can add the byte watchdog with [`CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK`](</docs/en/env-vars>). +Stream inference responses. Claude Code reads the stream as it arrives, so if your gateway buffers complete responses before relaying them, Claude Code stalls. Deliver each response’s full event sequence without dropping, duplicating, or reordering events. When an event references a content block whose `content_block_start` never arrived, or a block whose `content_block_stop` already arrived, Claude Code stops reading the stream at that event instead of applying it, so a duplicated `content_block_stop` can’t run the same tool call twice. [The response above may be incomplete](</docs/en/errors#the-response-above-may-be-incomplete>) describes what the user sees, under the `Part of the response never arrived` and `The response stream was malformed` variants. Relay each response through its final `message_delta` and `message_stop` events before ending the body. A body that ends after a `message_delta` carrying a `stop_reason`, with no content block still open and no content block event after that frame, counts as complete even when `message_stop` is missing. A body that your gateway ends cleanly any earlier, once a content block has started, is treated the same as a dropped connection: [Automatic retries](</docs/en/errors#automatic-retries>) says when Claude Code re-issues the request, and [The response above may be incomplete](</docs/en/errors#the-response-above-may-be-incomplete>) covers what it keeps once visible content has arrived. Claude Code keeps the `stop_reason` a `message_delta` delivers, so a later usage-only `message_delta` whose `delta` has `stop_reason: null` or no `stop_reason` key doesn’t clear it. When the client speaks the Amazon Bedrock format, relay the `InvokeModelWithResponseStream` response body and its `Content-Type: application/vnd.amazon.eventstream` header unmodified, and don’t convert the stream to server-sent events. See [Streaming errors behind a gateway or proxy](</docs/en/amazon-bedrock#streaming-errors-behind-a-gateway-or-proxy>). Forward keep-alive pings as well, because Claude Code aborts a streaming response once no bytes reach it for [five minutes by default](</docs/en/network-config#streaming-idle-watchdogs>). During a long thinking pause, the upstream’s SSE `ping` events can be the only bytes on the stream. If your gateway strips or buffers them, Claude Code aborts the response partway through the pause. When you translate from an upstream that sends no pings at all, such as Amazon Bedrock’s binary event-stream, emit your own `ping` events during silent gaps. ###
modified Plugin loading reference View current →
--- a/loading.md +++ b/loading.md @@ -107,7 +107,14 @@ Sign-in requirements for terminal sync -In your terminal, plugins sync only in sessions where you sign in with your claude.ai account. If you signed in on an earlier version of Claude Code, that sign-in doesn’t cover plugins until Claude Code renews it in the background. To get access sooner, run `/login` again. Plugin sync then starts the next time you start Claude Code. +In your terminal, plugins sync only in sessions where you sign in with your claude.ai account. Claude Code neither downloads nor loads synced plugins in these terminal sessions, even after you sign in with `/login`: + + * A session where `ANTHROPIC_AUTH_TOKEN`, `CLAUDE_CODE_OAUTH_TOKEN`, or an `apiKeyHelper` script supplies the credential in place of that sign-in + * A session that doesn’t [fetch feature flags from Anthropic](</docs/en/env-vars#features-that-need-feature-flag-fetching>), such as one where you set `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` + * A session in [bare mode](</docs/en/headless#start-faster-with-bare-mode>) or one you start with `--safe-mode` + * A session you start with a [`--setting-sources`](</docs/en/cli-reference#cli-flags>) list that leaves out `user` + +If you signed in on an earlier version of Claude Code, that sign-in doesn’t cover plugins until Claude Code renews it in the background. To get access sooner, run `/login` again. Plugin sync then starts the next time you start Claude Code. #### @@ -180,6 +187,7 @@ `.trash/`| Plugins that the claude.ai sync removed, such as after you turn one off on claude.ai or stop syncing `installed_plugins.json` and `known_marketplaces.json`| The records of what Claude Code has installed and which marketplaces it has fetched, described under Check which stage a plugin reached. A [marketplace hosted on claude.ai](</docs/en/plugins/install#add-from-claude-ai>) is recorded in `known_marketplaces_claudeai.json` instead `flagged-plugins.json`| Plugins Claude Code uninstalled because their marketplace delisted them. They appear in the **Flagged** section of `/plugin`; see [Host a marketplace](</docs/en/plugins/host-marketplace>) +`installed_plugins.set-aside.<date>.<hash>.json` and `installed_plugins.unreadable.<date>.<hash>.kept`| Dated copies Claude Code keeps before it drops install records that no version of Claude Code can use or rebuilds an unreadable `installed_plugins.json`. See [the recovery notes](</docs/en/plugins/troubleshooting#installed-plugins-json-could-not-be-read-and-was-rebuilt>). They age out on the [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) schedule Because `${CLAUDE_PLUGIN_ROOT}` points at a version directory, a plugin’s root path changes with every version. Keep a plugin’s durable files in `${CLAUDE_PLUGIN_DATA}` instead.
modified Control MCP server access for your organization View current →
--- a/managed-mcp.md +++ b/managed-mcp.md @@ -19,7 +19,7 @@ Pattern| What it does| Configure ---|---|--- -**Disable MCP**| No servers load, apart from in-process servers the app that started the session registers and any you provide through `managedMcpServers`| `managed-mcp.json` with an empty server map +**Disable MCP**| No servers load except the few that load under exclusive control| `managed-mcp.json` with an empty server map **Fixed deployment**| Every user gets the same servers and can’t add others| `managed-mcp.json` with the servers you want **Provided servers**| Every user gets the remote servers you list and keeps their own| `managedMcpServers` in managed settings **Approved catalog**| Publish a list of approved servers; users add the ones they want, anything else is blocked| `allowedMcpServers` \+ `allowManagedMcpServersOnly: true` @@ -41,6 +41,7 @@ * The servers the file defines * Servers you provide through `managedMcpServers` * In-process servers that the app that started the session registers, such as the VS Code extension’s own server or the [connectors the desktop app delivers](</docs/en/mcp#how-connectors-reach-claude-code>) + * The built-in [Claude in Chrome](</docs/en/chrome>) server, if you allow it alongside the managed set Users can’t add, modify, or use any other MCP servers, including plugin-provided servers and servers passed with the [`--mcp-config` CLI flag](</docs/en/cli-reference#cli-flags>). The file also suppresses the claude.ai connectors Claude Code fetches itself unless you allow them alongside the managed set. @@ -138,13 +139,13 @@ Disable MCP entirely -Deploy a `managed-mcp.json` containing an empty server map to block every MCP server apart from in-process servers the app that started the session registers: +Deploy a `managed-mcp.json` containing an empty server map to block every MCP server except the ones that load under exclusive control: { "mcpServers": {} } -`claude mcp add` fails with the enterprise-policy error above. Servers users had previously configured stop loading the next time they start a session, with no warning that policy is the reason. Servers you provide through `managedMcpServers` still load under an empty map, so leave that key unset as well to disable MCP completely. +`claude mcp add` fails with the enterprise-policy error above. Servers users had previously configured stop loading the next time they start a session, with no warning that policy is the reason. Servers you provide through `managedMcpServers`, and anything else you allow alongside the managed set, still load under an empty map, so leave those keys unset to turn MCP off completely. ### @@ -153,6 +154,14 @@ Allow claude.ai connectors alongside the managed set By default, deploying `managed-mcp.json` suppresses the [claude.ai connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>) Claude Code fetches itself, including connectors an administrator configured for the organization in the claude.ai admin console. To load those connectors alongside the servers in `managed-mcp.json`, set `"allowAllClaudeAiMcps": true` in a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>). With the setting enabled, Claude Code loads the same claude.ai connectors it would load if `managed-mcp.json` weren’t deployed. Allowlists and denylists still apply to those connectors, so you can block specific ones with `deniedMcpServers`. The setting affects only the claude.ai connectors Claude Code fetches itself; plugin-provided servers stay suppressed. Cloud sessions and the desktop app’s local and SSH sessions receive connectors another way, described in [How connectors reach Claude Code](</docs/en/mcp#how-connectors-reach-claude-code>). A `managed-mcp.json` on the host that runs a cloud session, such as a [self-hosted runner host](</docs/en/self-hosted-environments-configuration#mcp-servers>), suppresses that session’s connectors whether or not you set `allowAllClaudeAiMcps`. No `managed-mcp.json` reaches the connectors the desktop app delivers to its local and SSH sessions. Claude Code reads `allowAllClaudeAiMcps` only from admin-controlled policy tiers: server-managed settings, an MDM-deployed plist or HKLM registry key, or a system `managed-settings.json` file. Placing it in user or project settings has no effect, so users cannot re-enable connectors that exclusive control suppressed. + +### + +​ + +Allow Claude in Chrome alongside the managed set + +By default, when you deploy `managed-mcp.json`, Claude Code blocks the built-in [Claude in Chrome](</docs/en/chrome>) server in terminal sessions. Users don’t get the [extension install prompt](</docs/en/chrome#install-the-extension-when-claude-asks>), and a session where the user [enabled Chrome by default](</docs/en/chrome#enable-chrome-by-default>) starts without Chrome and prints no warning. When a user who could otherwise run Claude in Chrome starts it with `claude --chrome` or `CLAUDE_CODE_ENABLE_CFC=1`, Claude Code exits at startup with an error that names the `allowClaudeInChromeWithManagedMcp` setting. To let users run Claude in Chrome alongside the servers in `managed-mcp.json`, set `"allowClaudeInChromeWithManagedMcp": true` in the device’s own managed settings. Put it in an MDM-deployed plist or HKLM registry key, or a system `managed-settings.json` file, whichever of those Claude Code [selects](</docs/en/managed-settings#precedence-within-the-managed-tier>) on that device. Requires Claude Code v2.1.282 or later. Before v2.1.282, Claude Code ignores the setting, and the startup error reads `You cannot dynamically configure MCP servers when an enterprise MCP config is present` instead. Claude Code reads the setting from those device sources even when [server-managed settings](</docs/en/server-managed-settings>) deliver the rest of your policy. It ignores the setting in server-managed settings themselves, in the user-writable HKCU registry, and in user or project settings. A `deniedMcpServers` entry for `claude-in-chrome` still blocks the server with the setting on. ## @@ -261,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 passed 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 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. `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. @@ -283,7 +292,7 @@ Setting| Unset (default)| Empty array `[]`| Populated ---|---|---|--- -`allowedMcpServers`| All servers allowed| No servers allowed, apart from the organization’s own| Only matching servers allowed, apart from the organization’s own +`allowedMcpServers`| All servers allowed| No servers allowed, apart from those that skip the allowlist check| Only matching servers allowed, apart from those that skip the allowlist check `deniedMcpServers`| No servers blocked| No servers blocked| Matching servers blocked See [Invalid entries in managed settings](</docs/en/managed-settings#invalid-entries-in-managed-settings>) for what happens when an entry fails schema validation. @@ -307,7 +316,11 @@ 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. The organization’s own servers skip this check: every `managedMcpServers` entry, and any `managed-mcp.json` entry whose values use no `${VAR}` expansion. Built-in servers skip it too, 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 `managed-mcp.json` server that uses `${VAR}` expansion in its command, arguments, `env`, URL, or headers is still checked, as is every server a user, a plugin, `--mcp-config`, or claude.ai adds. + 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 ---|--- @@ -482,6 +495,7 @@ Restriction| What the user sees ---|--- `managed-mcp.json` is present and the user runs `claude mcp add`| `Cannot add MCP server: enterprise MCP configuration is active and has exclusive control over MCP servers` +`managed-mcp.json` is present and a user who could otherwise run Claude in Chrome runs `claude --chrome`| Claude Code exits at startup with `Claude in Chrome is blocked by your organization's managed MCP configuration (managed-mcp.json). An administrator can allow it with allowClaudeInChromeWithManagedMcp in device policy.` The server is on a denylist and the user runs `claude mcp add`| `Cannot add MCP server "<name>": server is explicitly blocked by enterprise policy` The server isn’t on the allowlist and the user runs `claude mcp add`| `Cannot add MCP server "<name>": not allowed by enterprise policy` The user runs `claude mcp remove` on a server from `managedMcpServers`| `MCP server "<name>" is provided by your organization (managed settings) and cannot be removed locally.` @@ -513,6 +527,7 @@ `allowedMcpServers`| Allowlist of permitted servers| Any [settings scope](</docs/en/settings#where-settings-live>); How a server is evaluated says how lists from several scopes and managed sources combine| For enforcement, a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>): server-managed settings, `managed-settings.json`, MDM profile, or registry `deniedMcpServers`| Denylist of blocked servers| Any settings scope; How a server is evaluated says how lists from several scopes and managed sources combine| Same as `allowedMcpServers` `allowManagedMcpServersOnly`| Locks the allowlist to managed sources only| Managed settings sources only; [Keys read from every admin source](</docs/en/managed-settings#keys-read-from-every-admin-source>) says which managed sources can turn it on. The setting has no effect in other scopes| Same as `allowedMcpServers` +`allowClaudeInChromeWithManagedMcp`| Lets the built-in Claude in Chrome server run alongside `managed-mcp.json`| Managed settings on the device only: an MDM profile, the HKLM registry, or `managed-settings.json`. Server-managed settings and user-writable sources have no effect| MDM, GPO, fleet management, or any process with administrator privileges `allowAllClaudeAiMcps`| Loads the claude.ai connectors Claude Code fetches itself alongside `managed-mcp.json`. A `managed-mcp.json` on the host that runs a cloud session still suppresses that session’s connectors| Managed settings sources only; the setting has no effect elsewhere| Same as `allowedMcpServers` ##
modified Deploy managed settings View current →
--- a/managed-settings.md +++ b/managed-settings.md @@ -377,7 +377,7 @@ [`blockedMarketplaces`](</docs/en/settings-reference#blockedmarketplaces>)| Blocklist of marketplace sources. Blocked sources are checked before downloading, so they never touch the filesystem. See [managed marketplace restrictions](</docs/en/plugins/org#restrict-what-users-can-install>) [`channelsEnabled`](</docs/en/settings-reference#channelsenabled>)| Allow [channels](</docs/en/channels>) for the organization. See [enterprise controls](</docs/en/channels#enterprise-controls>) for the default on each plan [`disableCommandPluginSources`](</docs/en/settings-reference#disablecommandpluginsources>)| When `true`, blocks [`command` plugin sources](</docs/en/plugins/marketplace-reference#command-plugin-source>) entirely, so the marketplace-declared command never runs. Also blocks marketplace [`headersHelper` commands](</docs/en/plugins/host-marketplace#authenticate-archive-downloads>), except for a marketplace that managed settings themselves declare. When unset, follows `allowManagedHooksOnly`. Requires Claude Code v2.1.229 or later, and the `headersHelper` block requires v2.1.238 or later -[`disableSideloadFlags`](</docs/en/settings-reference#disablesideloadflags>)| Reject the `--plugin-dir`, `--plugin-url`, `--agents`, and `--mcp-config` flags at startup. In cloud sessions, Claude Code drops the MCP servers the server delivered through `--mcp-config`, other than in-process `type: "sdk"` entries, and starts the session. Requires Claude Code v2.1.193 or later +[`disableSideloadFlags`](</docs/en/settings-reference#disablesideloadflags>)| Reject the `--plugin-dir`, `--plugin-url`, `--agents`, and `--mcp-config` flags at startup. In cloud sessions, Claude Code instead starts the session and drops the server-delivered `--mcp-config` servers, apart from the exceptions its [reference entry](</docs/en/settings-reference#disablesideloadflags>) lists. Requires Claude Code v2.1.193 or later [`forceRemoteSettingsRefresh`](</docs/en/settings-reference#forceremotesettingsrefresh>)| When `true`, blocks CLI startup until remote managed settings are freshly fetched and exits if the fetch fails. See [fail-closed enforcement](</docs/en/server-managed-settings#enforce-fail-closed-startup>) [`managedMcpServers`](</docs/en/settings-reference#managedmcpservers>)| Remote MCP servers provided to every user alongside their own. It provides servers rather than locking anything down. See [Provide servers through managed settings](</docs/en/managed-mcp#provide-servers-through-managed-settings>). Requires Claude Code v2.1.259 or later [`managedSourcesBehavior`](</docs/en/settings-reference#managedsourcesbehavior>)| Whether Claude Code applies only the highest-priority managed source or composes every one of them
modified Marketplace reference View current →
--- a/marketplace-reference.md +++ b/marketplace-reference.md @@ -32,7 +32,7 @@ * **Community marketplace names** : `claude-community`, `claude-plugins-community`, and `healthcare`. Reserved under the same rule as the official names. * **Plugin directory names** : `anthropic-plugin-directory` and `claude-plugin-directory`. Reserved under the same rule as the official names. * **Names that impersonate an official marketplace** : names such as `official-claude-plugins` or `claude-plugins-v2`, and any name containing a non-ASCII character. The error is `Marketplace name impersonates an official Anthropic/Claude marketplace`. A control or bidirectional-formatting character in a name also reports `Marketplace name cannot contain control or bidirectional-formatting characters`. A marketplace already registered under such a name stops loading, along with its plugins. - * **Another spelling of a reserved name** : a name that differs from a reserved name only by a trailing dot, or by a symbol other than an underscore in place of a hyphen, so `claude.code.plugins` counts as `claude-code-plugins`. `claude plugin validate` accepts such a name; adding the marketplace fails with [`is another spelling of "<reserved>", a reserved marketplace name`](</docs/en/errors#marketplace-name-is-another-spelling-of-a-reserved-name>), and a marketplace already registered under one stops loading. This check requires Claude Code v2.1.280 or later. + * **Another spelling of a reserved name** : a name that differs from a reserved name only by a trailing dot, or by a symbol other than an underscore in place of a hyphen, so `claude.code.plugins` counts as `claude-code-plugins`. Adding the marketplace fails with [`is another spelling of "<reserved>", a reserved marketplace name`](</docs/en/errors#marketplace-name-is-another-spelling-of-a-reserved-name>), and a marketplace already registered under one stops loading. This check requires Claude Code v2.1.280 or later. * **Names Claude Code uses for plugins that don’t come from a marketplace** : `inline` for plugins loaded with [`--plugin-dir`](</docs/en/cli-reference>), `builtin` for built-in plugins, `skills-dir` for plugins auto-loaded from [`.claude/skills/`](</docs/en/skills>), and `synced` for plugins synced from your claude.ai account. `claude-plugin-test` is also reserved. `skills-dir` also appears as `{"source": "skills-dir"}` in `strictKnownMarketplaces` and `blockedMarketplaces`, described under Source values valid only in policy lists. * **`npm`, `pip`, `uv`, `cargo`, `github`, and `gh`**: reserved in any casing. This check requires Claude Code v2.1.275 or later. * **Names starting with`claudeai-`**: reserved for marketplaces hosted on claude.ai. `claude plugin marketplace add` refuses any other marketplace that uses one with `Cannot add marketplace "<name>": names starting with "claudeai-" are reserved for marketplaces hosted on claude.ai`. @@ -49,7 +49,7 @@ Field| Type| Description ---|---|--- -`name`| string| Marketplace identifier. No spaces, control characters, or bidirectional-formatting characters, no `/` or `\`, no `..`, and not `.`. See Reserved names. Users type it after `@` when they install a plugin +`name`| string| Marketplace identifier: letters, digits, `.`, `_`, and `-`, starting with a letter or digit, and no `..`. It forms the half after `@` of every [plugin id](</docs/en/plugins/loading#find-where-a-plugin-came-from>) installed from the marketplace, so `claude plugin validate` fails other names. See Reserved names `owner`| object| Maintainer information. `name` is required; `email` and `url` are optional `plugins`| array| Plugin entries. Each entry is validated on its own, so one invalid entry doesn’t fail the marketplace `$schema`| string| JSON Schema URL for editor autocomplete. Ignored at load time @@ -71,7 +71,7 @@ Field| Type| Description ---|---|--- -`name`| string| Plugin identifier, with no spaces, control characters, or bidirectional-formatting characters. Users type it before `@` when they install, even when the plugin’s own `plugin.json` sets a different `name` +`name`| string| Plugin identifier: letters, digits, `.`, `_`, and `-`, starting with a letter or digit. `claude plugin validate` fails other names, which Claude Code can’t install. Users type it before `@` when they install, even when the plugin’s own `plugin.json` sets a different `name` `source`| string or object| Where to fetch the plugin. See Plugin sources `description`| string| Shown in [`/plugin`](</docs/en/plugins/install>) listings and details `version`| string| Version string for the plugin. When `plugin.json` also sets `version`, `plugin.json` takes precedence and `claude plugin validate` warns. See [Plugin loading reference](</docs/en/plugins/loading>) @@ -268,7 +268,7 @@ archive plugin source -`url` must use `https://` and can’t point at a loopback, link-local, or cloud-metadata host. The plugin root may be at the top of the zip or one directory down. `sha256` is the archive’s digest as 64 hex characters, uppercase or lowercase. When you set it, Claude Code refuses a download that doesn’t match. +`url` must use `https://` and can’t point at a loopback, link-local, or cloud-metadata host. For the size, timeout, redirect, and extraction limits on the download, see [Stay within the download limits for hosted files](</docs/en/plugins/host-marketplace#stay-within-the-download-limits-for-hosted-files>). The plugin root may be at the top of the zip or one directory down. `sha256` is the archive’s digest as 64 hex characters, uppercase or lowercase. When you set it, Claude Code refuses a download that doesn’t match. { "name": "formatter", @@ -373,7 +373,7 @@ ---|---|---|---|---|--- `url`| `url`, `headers`, `headersHelper`| An `http://` or `https://` URL that doesn’t match a git form| Loads| Allows the same URL| Blocks the same URL `github`| `repo`, `ref`, `path`, `sparsePaths`| `owner/repo`, `owner/repo@ref`, or `owner/repo#ref`| Loads| Allows the same `repo`, `ref`, and `path`. `repo` may be `owner/*`| Blocks the same, and a `git` URL to the same repository -`git`| `url`, `ref`, `path`, `sparsePaths`| A `user@host:path` URL, or an `https://` URL that ends in `.git`, contains `/_git/`, or names a github.com or gitlab.com repository. `#ref` pins a ref| Loads| Allows the same URL, `ref`, and `path`| Blocks the same, and other spellings of the same github.com repository +`git`| `url`, `ref`, `path`, `sparsePaths`| A `user@host:path` URL, or an `http://` or `https://` URL that ends in `.git`, contains `/_git/`, or names a github.com or gitlab.com repository. `#ref` pins a ref| Loads| Allows the same URL, `ref`, and `path`| Blocks the same, and other spellings of the same github.com repository `npm`| `package`| Not produced| Fails to load: `NPM marketplace sources not yet implemented`| Parses but matches nothing, because nothing registers an `npm` marketplace| Parses but matches nothing `file`| `path`| A path to a `.json` file| Loads| Allows the same path| Blocks the same path `directory`| `path`| A path to a directory| Loads| Allows the same path| Blocks the same path @@ -392,7 +392,7 @@ Field| Types| Description ---|---|--- -`url`| `url`| Link to the `marketplace.json` file. Claude Code downloads only that file, so the marketplace’s plugins can’t use relative-path sources +`url`| `url`| Link to the `marketplace.json` file. Claude Code downloads only that file, so the marketplace’s plugins can’t use relative-path sources. See [Stay within the download limits for hosted files](</docs/en/plugins/host-marketplace#stay-within-the-download-limits-for-hosted-files>) for the size, timeout, and redirect limits `url`| `git`| The git repository to clone `headers`| `url`| Map of HTTP headers Claude Code sends with the fetch, for authenticated hosts `headersHelper`| `url`| Command that prints headers whose values are too short-lived to list in `headers`. Requires Claude Code v2.1.238 or later. See [Authenticate archive downloads](</docs/en/plugins/host-marketplace#authenticate-archive-downloads>) @@ -455,7 +455,7 @@ Validation messages -`claude plugin validate <path>` takes the marketplace root or the marketplace file itself. It prints errors and warnings. For exit codes and `--strict`, see [plugin validate](</docs/en/plugins/cli-reference#plugin-validate>). A message names a plugin entry by its index, written as `plugins.1.source` or `plugins[1].source`. A message prefixed with an entry index and `plugin.json →`, such as `plugins[2] plugin.json →`, is about that plugin’s own files. [`claude plugin validate` reports errors](</docs/en/plugins/troubleshooting#claude-plugin-validate-reports-errors>) lists those messages with their fixes. Warnings that mention Claude Desktop flag names that Claude Code accepts but Claude Desktop rejects, because Claude Desktop’s name rules are stricter. The table maps marketplace-level messages to the field each is about. +`claude plugin validate <path>` takes the marketplace root or the marketplace file itself. It prints errors and warnings. For exit codes and `--strict`, see [plugin validate](</docs/en/plugins/cli-reference#plugin-validate>). A message names a plugin entry by its index, written as `plugins.1.source` or `plugins[1].source`. A message prefixed with an entry index and `plugin.json →`, such as `plugins[2] plugin.json →`, is about that plugin’s own files. [`claude plugin validate` reports errors](</docs/en/plugins/troubleshooting#claude-plugin-validate-reports-errors>) lists those messages with their fixes. Warnings that mention Claude Desktop flag names that Claude Desktop rejects. The table maps marketplace-level messages to the field each is about. Message| Level| Field ---|---|--- @@ -468,6 +468,8 @@ `Author name cannot be empty`| Error| `owner.name` `Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")`| Error| `plugins[i].name` `Plugin name cannot contain control or bidirectional-formatting characters`| Error| `plugins[i].name` +`Claude Code cannot install plugins from marketplace "x". Each part of a plugin id (plugin@marketplace) may use only the letters a-z and A-Z, digits, ".", "_" and "-", and must start with a letter or digit. Change the marketplace's "name".`| Error| `name` +`Claude Code cannot install plugin "x". Each part of a plugin id (plugin@marketplace) may use only the letters a-z and A-Z, digits, ".", "_" and "-", and must start with a letter or digit. Change this entry's "name".`| Error| `plugins[i].name` `Duplicate plugin name "x" found in marketplace`| Error| Two entries share a `name` `plugins.i.source: Invalid input`| Error| The entry’s `source` matches no type. See Invalid input on a source `plugins[i].source: Path contains "..": <path>`| Error| A relative `source` that escapes the marketplace root
modified How Claude remembers your project View current →
--- a/memory.md +++ b/memory.md @@ -87,13 +87,25 @@ Write effective instructions -CLAUDE.md files are loaded into the context window at the start of every session, consuming tokens alongside your conversation. The [context window visualization](</docs/en/context-window>) shows where CLAUDE.md loads relative to the rest of the startup context. Because they’re context rather than enforced configuration, how you write instructions affects how reliably Claude follows them. Specific, concise, well-structured instructions work best. **Size** : target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence. If your instructions are growing large, use path-scoped rules so instructions load only when Claude works with matching files. You can also split content into imports for organization, though imported files still load and enter the context window at launch. **Structure** : use markdown headers and bullets to group related instructions. Claude scans structure the same way readers do: organized sections are easier to follow than dense paragraphs. **Specificity** : write instructions that are concrete enough to verify. For example: +Claude treats CLAUDE.md files as context, not enforced configuration, so how you write instructions affects how reliably Claude follows them. Write instructions that are concrete enough to verify: * “Use 2-space indentation” instead of “Format code properly” * “Run `npm test` before committing” instead of “Test your changes” * “API handlers live in `src/api/handlers/`” instead of “Keep files organized” -**Consistency** : if two rules contradict each other, Claude may pick one arbitrarily. Review your CLAUDE.md files, nested CLAUDE.md files in subdirectories, and `.claude/rules/` periodically to remove outdated or conflicting instructions. In monorepos, use `claudeMdExcludes` to skip CLAUDE.md files from other teams that aren’t relevant to your work. To have Claude check these files for outdated or conflicting instructions, run `/doctor prompt-audit` in a session. Claude reads your CLAUDE.md, CLAUDE.local.md, and AGENTS.md files, plus the rules, skills, commands, subagents, and output styles under `.claude/` and `~/.claude/`. It looks for problems such as instructions written for older models, references to files or commands that don’t exist, and files that contradict each other. You get a report of findings and a set of proposed edits, and nothing in your files changes until you ask Claude to apply them. To audit one file or directory instead, pass its path, for example `/doctor prompt-audit .claude/skills/deploy`. The audit runs through the bundled `/claude-api` skill, so it’s unavailable while that skill is turned off in [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) or with [`disableBundledSkills`](</docs/en/settings-reference#disablebundledskills>). `/doctor prompt-audit` requires Claude Code v2.1.283 or later. +Keep your files short, organized, and consistent: + + * **Size** : target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence. Move instructions that matter for only part of the codebase into path-scoped rules, which load only when Claude works with matching files. Imports help you organize a long file but don’t reduce its context cost, because imported files also load at launch. + * **Structure** : group related instructions under markdown headers and bullets. Organized sections are easier for Claude to follow than dense paragraphs. + * **Consistency** : if two instructions contradict each other, Claude may pick one arbitrarily. Review your CLAUDE.md files, nested CLAUDE.md files in subdirectories, and `.claude/rules/` periodically to remove outdated or conflicting instructions. To have Claude find them for you, run a prompt audit. + +#### + +​ + +Audit your instruction files + +To have Claude check your instruction files for outdated or conflicting content, run `/doctor prompt-audit` in a session. Claude looks for problems such as instructions written for older models, references to files or commands that don’t exist, and files that contradict each other. You get a report of findings with proposed edits, and nothing in your files changes until you ask Claude to apply them. By default, the audit covers your CLAUDE.md, CLAUDE.local.md, and AGENTS.md files, plus the rules, skills, commands, subagents, and output styles under `.claude/` and `~/.claude/`. To audit one file or directory instead, pass its path, for example `/doctor prompt-audit .claude/skills/deploy`. The audit runs through the bundled `/claude-api` skill. It’s unavailable while that skill is turned off in [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) or with [`disableBundledSkills`](</docs/en/settings-reference#disablebundledskills>). `/doctor prompt-audit` requires Claude Code v2.1.283 or later. ### @@ -101,7 +113,11 @@ Import additional files -CLAUDE.md files can import additional files using `@path/to/import` syntax. Imported files are expanded and loaded into context at launch alongside the CLAUDE.md that references them. Both relative and absolute paths are allowed. Relative paths resolve relative to the file containing the import, not the working directory. Imported files can recursively import other files, with a maximum depth of four hops. Import parsing skips Markdown code spans and fenced code blocks. To mention a path in your CLAUDE.md without importing it, wrap it in backticks: writing ``@README`` keeps the text literal, while `@README` outside backticks imports the file. To pull in a README, package.json, and a workflow guide, reference them with `@` syntax anywhere in your CLAUDE.md: +CLAUDE.md files can import additional files using `@path/to/import` syntax. Imported files are expanded and loaded into context at launch alongside the CLAUDE.md that references them. Both relative and absolute paths are allowed. Relative paths resolve relative to the file containing the import, not the working directory. Imported files can recursively import other files, with a maximum depth of four hops. To import a file whose path contains spaces, put a backslash before each space. Without the backslashes, the path ends at the first space, even when the import is on a line of its own. A path wrapped in quotes isn’t imported at all, with or without the backslashes. This import loads a file from a folder named `Design Docs`: + + - API conventions @Design\ Docs/api-conventions.md + +Import parsing skips Markdown code spans and fenced code blocks. To mention a path in your CLAUDE.md without importing it, wrap it in backticks: writing ``@README`` keeps the text literal, while `@README` outside backticks imports the file. To pull in a README, package.json, and a workflow guide, reference them with `@` syntax anywhere in your CLAUDE.md: See @README for project overview and @package.json for available npm commands for this project.
modified Model configuration View current →
Show diff (112 lines)
--- a/model-config.md +++ b/model-config.md @@ -48,7 +48,7 @@ Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5.1, except in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where `fable` and `best` resolve to Fable 5. A gateway that isn’t configured to serve `claude-fable-5-1` rejects requests for that model. To use Fable 5.1 through a gateway that serves it, select it with `/model claude-fable-5-1`. Where an alias resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Earlier versions resolve these aliases to older models. For the version at which each alias changed, see Version history. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`. -Sonnet 5.5 requires Claude Code v2.1.284 or later, and Opus 5.5 requires v2.1.280 or later. Run `claude update` to upgrade. +Sonnet 5.5 requires Claude Code v2.1.284 or later, and Opus 5.5 requires v2.1.280 or later. If a request for one of them from an older version fails, see [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Run `claude update` to upgrade. ### @@ -80,7 +80,7 @@ Depending on your plan and seat tier, Fable usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code shows a consent prompt before a Fable request bills usage credits. Members of Enterprise plans with organization billing don’t see the prompt. You can continue on Fable using usage credits or switch to your default model. You can also dismiss the prompt: - * In the `/model` picker, you keep your current model. + * When you select a Fable model with `/model`, you keep your current model. * Mid-session, Claude Code continues the turn on your default model. After you choose to continue on Fable using usage credits, Claude Code doesn’t show the prompt again. In a session with [Remote Control](</docs/en/remote-control>) connected, a [background session](</docs/en/agent-view>), or an [agent team](</docs/en/agent-teams>) teammate’s session, nobody may be at the terminal, so Claude Code holds the mid-session consent prompt for the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, five minutes by default. If nobody has answered by the deadline, Claude Code ends the turn without sending the request and adds a notice to the transcript, which the Remote Control client also shows. Your model selection is unchanged, and Claude Code asks for consent again on your next message. What you can do while the prompt is waiting depends on the session: @@ -89,7 +89,7 @@ * In a background session, answer before the deadline. * If you send a new message from the remote client before anyone has typed at the terminal, Claude Code ends the turn the same way, and your new message starts the next turn. After someone types at the terminal, Claude Code keeps waiting for the answer and queues your new message behind it. -In [non-interactive mode](</docs/en/headless>) with the `-p` flag and through the Agent SDK, Claude Code never shows the consent prompt. When a Fable request there would bill to usage credits, Claude Code bills it without asking. +In a session another application hosts through the [Agent SDK](</docs/en/agent-sdk/overview>), whether the prompt appears is up to that application. If it appears and nobody answers before the same [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, Claude Code ends the turn without sending the request. In [non-interactive mode](</docs/en/headless>) with the `-p` flag, and in an Agent SDK application that doesn’t show the prompt, Claude Code never asks for consent. When a Fable request there would bill to usage credits, Claude Code bills it without asking. ### @@ -116,14 +116,12 @@ * If model restrictions exclude the recorded model or it isn’t available to your account, and your admin hasn’t set an organization default model, the Default option resolves as if nothing were recorded. * If you choose Default or `opusplan` in `/model`, the recorded choice doesn’t change. -If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or from a device connected through [Remote Control](</docs/en/remote-control>), or an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI switches for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. Checking a Remote Control pick requires Claude Code v2.1.260 or later on your machine. On the Anthropic API, Claude Code recognizes: - - * a model alias - * an entry from the `/model` picker - * any name that starts with `claude-` - * a value you configured yourself as a custom model option or in `modelOverrides` - -Claude Code rejects an unrecognized string with `Model "<name>" is not a recognized model id.` and the session keeps its current model, instead of saving the string and failing on the next request. See [the error reference](</docs/en/errors#model-is-not-a-recognized-model-id>) for recovery steps. The check runs only on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and behind an [LLM gateway](</docs/en/llm-gateway>) or a custom `ANTHROPIC_BASE_URL`, your provider or gateway defines the model names, so Claude Code passes any string through without checking it. The check also doesn’t cover the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting; a mistyped value there produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>) on the first request instead. Claude Code can still write the [unrecognized-model diagnostic line](</docs/en/errors#unrecognized-model-id-on-a-request>) at request time, on every provider. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus: +If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch: + + * **Agent SDK or an app** : with Claude Code v2.1.268 or later, unless Claude Code accepts a model ID locally, as it does for your custom model option, it confirms the ID with your provider the first time the session switches to it. The confirmation runs on every provider, and an ID your provider doesn’t offer is refused at the switch instead of failing on your next request. + * **Remote Control** : on the Anthropic API, Claude Code checks the value locally and sends no request. + +See [Model is not a recognized model id](</docs/en/errors#model-is-not-a-recognized-model-id>) and [Model not found](</docs/en/errors#model-not-found>) for the messages. If you set the model with the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting, Claude Code doesn’t check it up front, and a mistyped value produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>) on the first request. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus: claude --model opus @@ -181,7 +179,7 @@ Restrict model selection -Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/managed-settings>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. A version prefix also matches later model IDs that extend it with another segment, so `claude-fable-5` permits both Fable 5 and Fable 5.1, while `claude-fable-5-1` permits Fable 5.1 only. To block a model the list permits, or to make each model ID entry permit only the version it names, see Block specific models or versions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: +Administrators can use `availableModels` in [managed or policy settings](</docs/en/managed-settings>) to restrict which models users can select. Entries match a model family such as `sonnet`, a version prefix such as `claude-sonnet-4-5`, or a full model ID such as `claude-sonnet-4-5-20250929`. A version prefix also matches later model IDs that extend it with another segment, so `claude-fable-5` permits both Fable 5 and Fable 5.1, while `claude-fable-5-1` permits Fable 5.1 only. To block a model the list permits, or to make each model ID entry permit only the version it names, see Block specific models or versions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model: * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, `ANTHROPIC_DEFAULT_MODEL`, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list @@ -223,12 +221,12 @@ Delivery mechanism| CLI and IDE| Desktop local sessions| Web, mobile, and cloud sessions| Agent SDK and non-interactive| Cowork ---|---|---|---|---|--- -[Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced, except in [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions| Enforced| Not delivered +[Server-managed settings](</docs/en/server-managed-settings>) from the admin console| Enforced| Enforced| Enforced, except in [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions| Enforced| Remote Cowork sessions: the server checks the model. On the user’s machine: not delivered. [MDM or managed settings files](</docs/en/managed-settings#delivery-mechanisms>)| Enforced| Enforced| Not delivered in Anthropic-hosted environments; in [self-hosted environments](</docs/en/self-hosted-environments>), enforced from the runner image per [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>)| Enforced| Enforced where deployed * [Cloud sessions](</docs/en/claude-code-on-the-web>), including those you start from the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. When the `availableModels` list in your server-managed settings is non-empty, the server rejects a request to start a cloud session at claude.ai/code or from the Desktop app on a model the list excludes. * [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions run in cloud environments but don’t receive server-managed settings; in a [self-hosted environment](</docs/en/self-hosted-environments>), they still read the managed settings file in the runner image. To set the model for those sessions, see [Choose the model for a scope](<https://claude.com/docs/claude-tag/admins/customize#choose-the-model-for-a-scope>) in the Claude Tag admin guide. - * Cowork, the agentic-work tab in the Claude Desktop app, runs its sessions on Claude Code but, by design, does not receive server-managed settings from the claude.ai admin console. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. + * Cowork, the agentic-work tab in the Claude Desktop app, runs its sessions on Claude Code but, by design, does not receive server-managed settings from the claude.ai admin console. When the `availableModels` list in your server-managed settings is non-empty and a user picks a model outside it, the server rejects that model for a remote Cowork session. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. * Server-managed delivery also requires the session to authenticate with an [eligible login or key](</docs/en/server-managed-settings#platform-availability>). Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script should deliver the allowlist through MDM or managed settings files. * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). @@ -597,7 +595,7 @@ 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 -You can’t turn thinking off on Opus 5.5, Sonnet 5.5, or the Fable models. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and the model decides per step how much to think based on the effort level. 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. +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. ### @@ -618,7 +616,7 @@ * With auto-compaction on, sessions compact at the 200K boundary through auto-compaction. Setting the auto-compact window above 200K doesn’t lift the hold, because Claude Code caps that window at the model’s context window. * With auto-compaction off, sessions stop at the 200K boundary with the [context-limit error](</docs/en/errors#prompt-is-too-long>) instead of compacting. -Before v2.1.223, Claude Code held only Sonnet 5, Opus 4.8, and Opus 5 sessions to 200K. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, try restarting your session. You can also use the `[1m]` suffix with model aliases or full model names: +Before v2.1.223, Claude Code held only Sonnet 5, Opus 4.8, and Opus 5 sessions to 200K. See [environment variables](</docs/en/env-vars>). The 1M context window uses standard model pricing with no premium for tokens beyond 200K. For plans where extended context is included with your subscription, usage remains covered by your subscription. For plans that access extended context through usage credits, tokens are billed to usage credits. If your account supports 1M context, the option appears in the `/model` picker in the latest versions of Claude Code. If you don’t see it, restart your session, and on a third-party provider check whether your deployment pinned the model with an `ANTHROPIC_DEFAULT_*_MODEL` variable. You can also use the `[1m]` suffix with model aliases or full model names: # Use the opus[1m] or sonnet[1m] alias /model opus[1m] @@ -769,6 +767,8 @@ * Claude Code strips the suffix before sending the model ID to your provider. * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>). * The suffix is read per variable, not per model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. Sonnet 5 always runs with the 1M window on these providers and never needs the suffix. + +When you set an `ANTHROPIC_DEFAULT_*_MODEL` variable, the `/model` picker shows one row for that model in place of the family’s built-in rows, including any 1M context rows. To reach the 1M window without adding the suffix to that variable, your users run `/model opus[1m]`, and Claude Code applies the suffix to the model the variable names. `/model sonnet[1m]` works the same way. An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/managed-settings#delivery-mechanisms>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>).Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list its full provider-form ID, or map it through `modelOverrides`. For a pinned model, that ID is the value you set in its `ANTHROPIC_DEFAULT_*_MODEL` variable. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching. @@ -839,8 +839,8 @@ ---|--- `DISABLE_PROMPT_CACHING`| Set to `1` to disable prompt caching for all models. Takes precedence over the per-model settings `DISABLE_PROMPT_CACHING_HAIKU`| Set to `1` to disable prompt caching for the [default Haiku model](</docs/en/prompt-caching#disable-prompt-caching>) -`DISABLE_PROMPT_CACHING_SONNET`| Set to `1` to disable prompt caching for Sonnet models only -`DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for Opus models only +`DISABLE_PROMPT_CACHING_SONNET`| Set to `1` to disable prompt caching for the [default Sonnet model](</docs/en/prompt-caching#disable-prompt-caching>) +`DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for the [default Opus model](</docs/en/prompt-caching#disable-prompt-caching>) `DISABLE_PROMPT_CACHING_FABLE`| Set to `1` to disable prompt caching for Fable models only To choose the cache TTL for the main conversation and for subagents separately, see [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>). For what triggers a cache miss, see [How Claude Code uses prompt caching](</docs/en/prompt-caching>).
modified Monitoring View current →
--- a/monitoring-usage.md +++ b/monitoring-usage.md @@ -50,7 +50,7 @@ } } -Claude Code ignores the [OpenTelemetry exporter variables](</docs/en/settings-reference#variables-claude-code-ignores-in-env>) in a repository’s `.claude/settings.json` and `.claude/settings.local.json`, so a repository can’t use them to turn telemetry on, choose where it goes, or capture content. Set them in managed settings, or have each developer set them in their shell or `~/.claude/settings.json`. A repository can still turn a signal off by setting its exporter selector, such as `OTEL_LOGS_EXPORTER`, to `none`, unless managed settings, a `--settings` file, or the environment you start Claude Code from sets that variable. Claude Code doesn’t pass `OTEL_*` environment variables to the subprocesses it spawns, including the Bash tool, hooks, MCP servers, and language servers. An OpenTelemetry-instrumented application that you run through the Bash tool doesn’t inherit Claude Code’s exporter endpoint or headers, so set those variables directly in the command if that application needs to export its own telemetry. +In the Claude Desktop app, Code tab sessions read these managed settings from the sources that [reach each kind of Desktop session](</docs/en/desktop#managed-settings>). The OpenTelemetry form for Cowork under **Monitoring** in the admin console’s [Data and privacy settings](<https://claude.ai/admin-settings/data-privacy-controls>) applies to Cowork sessions only, so neither the terminal CLI nor the Code tab exports to a collector you set there. Claude Code ignores the [OpenTelemetry exporter variables](</docs/en/settings-reference#variables-claude-code-ignores-in-env>) in a repository’s `.claude/settings.json` and `.claude/settings.local.json`, so a repository can’t use them to turn telemetry on, choose where it goes, or capture content. Set them in managed settings, or have each developer set them in their shell or `~/.claude/settings.json`. A repository can still turn a signal off by setting its exporter selector, such as `OTEL_LOGS_EXPORTER`, to `none`, unless managed settings, a `--settings` file, or the environment you start Claude Code from sets that variable. Claude Code doesn’t pass `OTEL_*` environment variables to the subprocesses it spawns, including the Bash tool, hooks, MCP servers, and language servers. An OpenTelemetry-instrumented application that you run through the Bash tool doesn’t inherit Claude Code’s exporter endpoint or headers, so set those variables directly in the command if that application needs to export its own telemetry. ### @@ -510,7 +510,7 @@ Keys from `OTEL_RESOURCE_ATTRIBUTES`| Custom attributes you set, such as `department` or `team.id`. See Multi-team organization support| `OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES` (default: true) `vcs.repository.url.full`, `vcs.owner.name`, `vcs.repository.name`, `vcs.provider.name`| The session repository’s identity, derived from its `origin` remote. See Repository attributes| `OTEL_METRICS_INCLUDE_REPOSITORY` (default: false). Requires Claude Code v2.1.269 or later -When Claude Code is signed in to a [Claude apps gateway](</docs/en/claude-apps-gateway>), the CLI stamps exports with the authenticated identity from the gateway session: `user.id` is the IdP subject rather than an anonymous installation identifier, `user.email` is the signed-in email, and `user.groups` carries IdP group membership as a comma-separated string. Each export also carries `identity.source: gateway-oidc`. The gateway identity is applied last, so `user.*` and `identity.*` keys set through `OTEL_RESOURCE_ATTRIBUTES` are ignored on gateway sessions. Events additionally include the following attributes. These are never attached to metrics because they would cause unbounded cardinality: +In sessions signed in to a [Claude apps gateway](</docs/en/claude-apps-gateway>) through `/login`, the CLI stamps exports with the authenticated identity: `user.id` is the IdP subject, `user.email` is the signed-in email, and `user.groups` carries IdP group membership as a comma-separated string. Each export also carries `identity.source: gateway-oidc`. The gateway identity is applied last, so `user.*` and `identity.*` keys set through `OTEL_RESOURCE_ATTRIBUTES` are ignored on those sessions. For the identity attributes on Claude Desktop and Cowork sessions that connect through a gateway, see the [gateway `telemetry` reference](</docs/en/claude-apps-gateway-config#telemetry>). Events additionally include the following attributes. These are never attached to metrics because they would cause unbounded cardinality: * `prompt.id`: UUID correlating a user prompt with all subsequent events until the next prompt. See Event correlation attributes. * `workspace.host_paths`: host workspace directories selected in the desktop app, as a string array @@ -1396,7 +1396,7 @@ Attribute actions to users -The standard attributes on each event include the authenticated user’s identity: `user.email`, `user.account_uuid`, `user.account_id`, and `organization.id` when signed in with a Claude account or, in a [cloud session](</docs/en/claude-code-on-the-web>), when the session’s own credentials carry them, plus `user.id` and the per-session `session.id`. `user.id` is an installation-scoped identifier, except on [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where it is the IdP subject from the gateway-issued token. In a session a developer starts, MCP tool calls, Bash commands, and file edits are therefore attributed to that developer. Claude Code doesn’t act under a separate service account there; the identity recorded on each event is the developer’s own Claude account, or the developer’s IdP identity on a [Claude apps gateway](</docs/en/claude-apps-gateway>) session. In Claude Tag channel sessions, Claude works as your organization’s [shared identity](</docs/en/cloud-environments#set-the-environment-a-claude-tag-channel-uses>) instead. When Claude Code authenticates with a direct API key, or against Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, there is no Claude account in the session and only `user.id` and `session.id` are populated. In these deployments, attach user identity yourself with `OTEL_RESOURCE_ATTRIBUTES`, set per user through the managed settings file or a launch wrapper. Claude apps gateway sessions need none of this: the CLI stamps the IdP identity automatically, as described in Standard attributes. +The standard attributes on each event include the authenticated user’s identity: `user.email`, `user.account_uuid`, `user.account_id`, and `organization.id` when signed in with a Claude account or, in a [cloud session](</docs/en/claude-code-on-the-web>), when the session’s own credentials carry them, plus `user.id` and the per-session `session.id`. `user.id` is an installation-scoped identifier, except in sessions signed in to a [Claude apps gateway](</docs/en/claude-apps-gateway>) through `/login`, where it is the IdP subject from the gateway-issued token. In a session a developer starts, MCP tool calls, Bash commands, and file edits are therefore attributed to that developer. Claude Code doesn’t act under a separate service account there; the identity recorded on each event is the developer’s own Claude account, or the developer’s IdP identity on a [Claude apps gateway](</docs/en/claude-apps-gateway>) session. In Claude Tag channel sessions, Claude works as your organization’s [shared identity](</docs/en/cloud-environments#set-the-environment-a-claude-tag-channel-uses>) instead. When Claude Code authenticates with a direct API key, or against Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, there is no Claude account in the session and only `user.id` and `session.id` are populated. In these deployments, attach user identity yourself with `OTEL_RESOURCE_ATTRIBUTES`, set per user through the managed settings file or a launch wrapper. Claude apps gateway sessions need none of this: see Standard attributes for the identity their exports carry. export OTEL_RESOURCE_ATTRIBUTES="enduser.id=jdoe@example.com,enduser.directory_id=S-1-5-21-..."
modified Enterprise network configuration View current →
--- a/network-config.md +++ b/network-config.md @@ -168,11 +168,11 @@ Timer| Aborts when| Runs on| Default timeout ---|---|---|--- First-byte deadline| No response headers arrive after Claude Code sends the request| Direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), including through an HTTPS proxy, but not when `ANTHROPIC_BASE_URL` or `ANTHROPIC_AWS_BASE_URL` routes them through a [gateway](</docs/en/gateways>). Opt-in on Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry| 180 seconds on the direct Anthropic API, 300 seconds elsewhere, plus one second per 32KB of request body -Event-level watchdog| No response events parse. On connections where the byte-level watchdog runs, arriving bytes, including keep-alive pings, also reset this watchdog, for up to about five minutes without a parsed event| Every provider| 300 seconds +Event-level watchdog| No response events parse. Where the byte-level watchdog runs on a connection other than Amazon Bedrock, arriving bytes, including keep-alive pings, also reset this watchdog, for up to about five minutes without a parsed event| Every provider| 300 seconds Byte-level watchdog| No bytes arrive on the wire, including SSE keep-alive pings| Direct Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and [gateway](</docs/en/gateways>) connections, including a custom `ANTHROPIC_BASE_URL`. Opt-in on Amazon Bedrock `vnd.amazon.eventstream` responses with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry| 180 seconds on the direct Anthropic API, 300 seconds elsewhere -Body idle timeout| No bytes arrive for 5 minutes| Providers other than the direct Anthropic API and Claude Platform on AWS, unless [`API_FORCE_IDLE_TIMEOUT`](</docs/en/env-vars>) changes that| 5 minutes - -Configure the timers with these variables, each detailed in the [environment variables reference](</docs/en/env-vars>): +Body idle timeout| No bytes arrive for 5 minutes| Providers other than the direct Anthropic API, Claude Platform on AWS, and Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` set, unless [`API_FORCE_IDLE_TIMEOUT`](</docs/en/env-vars>) changes that| 5 minutes + +If you set `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`, the byte-level watchdog replaces the body idle timeout on Bedrock rather than running alongside it. `CLAUDE_STREAM_IDLE_TIMEOUT_MS` then also governs how long a Bedrock stream may stay silent before Claude Code treats the connection as dead, within the limits listed below. Arriving bytes still don’t reset the event-level watchdog on Bedrock. With debug logging on, each Bedrock stream then logs a debug message that starts with `wire-heartbeat: _chunkTimes absent`. Configure the timers with these variables, each detailed in the [environment variables reference](</docs/en/env-vars>): * `CLAUDE_ENABLE_STREAM_WATCHDOG` and `CLAUDE_ENABLE_BYTE_WATCHDOG` force the corresponding watchdog on with `1` or off with `0`, within the connections the table lists; neither variable extends a watchdog to a connection type it doesn’t cover. `CLAUDE_ENABLE_BYTE_WATCHDOG` set to `0` also turns off the first-byte deadline. * `CLAUDE_STREAM_IDLE_TIMEOUT_MS` sets both watchdogs’ timeout. Claude Code raises values below 5 minutes to 5 minutes, and caps the value at 30 minutes for the byte-level watchdog. @@ -227,7 +227,7 @@ GitHub allow lists and firewalls -[Cloud sessions](</docs/en/claude-code-on-the-web>) in Anthropic-hosted environments and [Code Review](</docs/en/code-review>) connect to your repositories from Anthropic-managed infrastructure; sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) connect from inside your network, unless the runner opts into the [Anthropic git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), which fetches from Anthropic’s side. If your GitHub Enterprise Cloud organization restricts access by IP address, enable [IP allow list inheritance for installed GitHub Apps](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#allowing-access-by-github-apps>) and also [add an allow list entry](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#adding-an-allowed-ip-address>) for Anthropic’s [outbound IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses#outbound-ip-addresses>). Inheritance covers only the requests the Claude GitHub App makes as an installation, not the requests it makes on your users’ behalf. For other firewalls, see the [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>). For self-hosted [GitHub Enterprise Server](</docs/en/github-enterprise-server>) instances behind a firewall, allowlist Anthropic’s [outbound IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses#outbound-ip-addresses>) so Anthropic infrastructure can reach your GHES host to clone repositories and post review comments. Sessions in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#configure-git>) reach your GHES host from inside your network instead, so that exposure applies only to Anthropic-hosted sessions, to hosted pre-session flows such as the repository picker, and to self-hosted runners that opt into the [Anthropic git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), which fetches from Anthropic’s side. For a GHES host that’s only routable inside your network, the [SCM connector](</docs/en/self-hosted-environments-reference#scm-connector-flags>) carries the hosted pre-session flows over an outbound connection instead, so the allowlist isn’t needed for them. +[Cloud sessions](</docs/en/claude-code-on-the-web>) in Anthropic-hosted environments and [Code Review](</docs/en/code-review>) connect to your repositories from Anthropic-managed infrastructure; sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) connect from inside your network, unless the runner opts into the [Anthropic git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), which fetches from Anthropic’s side. If your GitHub Enterprise Cloud organization restricts access by IP address, enable [IP allow list inheritance for installed GitHub Apps](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#allowing-access-by-github-apps>) and also [add an allow list entry](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#adding-an-allowed-ip-address>) for Anthropic’s [outbound IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses#outbound-ip-addresses>). Inheritance covers only the requests the Claude GitHub App makes as an installation, not the requests it makes on your users’ behalf. For other firewalls, see the [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>). For self-hosted [GitHub Enterprise Server](</docs/en/github-enterprise-server>) instances behind a firewall, allowlist Anthropic’s [outbound IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses#outbound-ip-addresses>) so Anthropic infrastructure can reach your GHES host to clone repositories and post review comments. Sessions in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#configure-git>) reach your GHES host from inside your network instead, so that exposure applies only to Anthropic-hosted sessions, to hosted pre-session flows such as the repository picker, and to self-hosted runners that opt into the [Anthropic git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), which fetches from Anthropic’s side. The [SCM connector](</docs/en/self-hosted-environments-reference#scm-connector-flags>) isn’t available, so the hosted pre-session flows can’t reach a GHES host that’s only routable inside your network. ###
modified Choose a permission mode View current →
Show diff (226 lines)
--- a/permission-modes.md +++ b/permission-modes.md @@ -167,7 +167,7 @@ * **[Cloud sessions](</docs/en/claude-code-on-the-web>)** : Accept edits, Plan, and Auto. Accept edits corresponds to `default` mode: cloud sessions pre-approve file edits regardless of mode, so the dropdown shows Accept edits instead of Manual. Cloud sessions still honor `defaultMode: "acceptEdits"` from settings. Auto mode appears only when your organization allows it and the selected model supports it. Bypass permissions isn’t available. * **[Remote Control](</docs/en/remote-control>) sessions** on your local machine: Manual, Accept edits, and Plan for a session you started yourself, and you can’t select Auto or Bypass permissions from the app. For a project thread running on your computer, see [Run a thread on your own computer](</docs/en/claude-projects#run-a-thread-on-your-own-computer>). - * Except for Bypass permissions, the dropdown shows the permission mode the local session is in, including one set from the terminal. It updates when the permission mode changes in the app or in the terminal. The session never reports Bypass permissions to claude.ai, so switching into it from the terminal doesn’t change what the dropdown shows. + * Except for Bypass permissions, the dropdown shows the permission mode the local session is in, including one set from the terminal. It updates when the permission mode changes in the app or in the terminal. * Sessions hosted by the [desktop app](</docs/en/desktop>) or the [VS Code extension](</docs/en/vs-code>) report permission mode changes to claude.ai as they happen, the same as sessions hosted in a terminal. * Before v2.1.202, sessions connected with `/remote-control` or `claude --remote-control` didn’t report their permission mode at all, so claude.ai and the mobile app could show a permission mode the session wasn’t in. The mismatch affected only the label. Claude Code generated permission prompts from the session’s actual permission mode, and they still appeared in the app for approval. @@ -292,9 +292,6 @@ * `git commit --amend` when the commit at HEAD was not created in this session * From v2.1.198, `git commit --amend` when the commit at HEAD has already been pushed. A message-only reword is not blocked: `--amend -m` with nothing newly staged, on a commit that Claude created during this session * `terraform destroy`, `pulumi destroy`, `cdk destroy`, or `terragrunt destroy`, and applying a plan that destroys resources - -Claude Code v2.1.195 and later block more categories by default. Several depend on [environment](</docs/en/auto-mode-config#define-trusted-infrastructure>) entries, such as sensitive remote targets and protected IaC scopes, that you can narrow to concrete names. - * Writing to a secret manager, or changing DNS records or TLS certificates * Merging a pull request no human has approved, approving Claude’s own pull request, or disabling CI checks * Posting a comment that is itself a command to automation, such as `atlantis apply` or a bot’s `/deploy` or `/merge` @@ -311,7 +308,7 @@ * Launching an autonomous agent loop that runs without human approval or a sandbox, such as one started with `--dangerously-skip-permissions` or `--no-sandbox`. As of v2.1.198 this also covers running a third-party agent or eval harness with isolation and per-action approval disabled, such as a runner started with `--yes-always` * [Claude in Chrome](</docs/en/chrome>) browser actions that could send page content, cookies, or credentials off-origin -Claude Code v2.1.198 and later also block these by default: +Several of these categories depend on [environment](</docs/en/auto-mode-config#define-trusted-infrastructure>) entries, such as sensitive remote targets and protected IaC scopes, that you can narrow to concrete names. Claude Code v2.1.198 and later also block these by default: * Deleting files in `/tmp`, `$TMPDIR`, or another shared scratch or cache directory by wildcard, glob, or age filter rather than by a specific named path * Including sensitive details in content sent, uploaded, published, or written to other people or shared systems, when your own message didn’t authorize those details for that recipient. PR and issue bodies, commit messages, and comments count as this kind of outbound content when the repository is outside the trust boundary or public, including your organization’s own public repositories; internal file paths, code names, live API response data such as emails or account identifiers, and infrastructure identifiers count as sensitive details. The PR, issue, and commit-message scoping requires Claude Code v2.1.200 or later. Live personal data from an API response in a PR or issue body, such as an email address, an account or organization identifier, or a usage metric, requires you to name those details and the recipient regardless of the repository’s visibility or trust boundary. That check requires Claude Code v2.1.203 or later @@ -353,9 +350,6 @@ * Reading `.env` and sending credentials to their matching API * Read-only HTTP requests * Pushing to any branch of the repository you’re working in, including the default branch. A non-default branch whose name marks it as a deploy or publication target, such as `production` or `gh-pages`, isn’t covered: the classifier judges a push there on its own terms. The push’s content is still checked against the other rules, [`permissions.deny` rules](</docs/en/permissions#manage-permissions>) can still block push commands [as written](</docs/en/permissions#bash-rule-limits>) in every mode, and the remote’s own branch protection still applies. Before v2.1.211, only pushes to the branch you started on, branches Claude created, and routine pushes to the default branch were allowed by default, and before v2.1.203 any direct push to the default branch was blocked - -Claude Code v2.1.195 and later also allow these by default: - * Deleting the exact jobs Claude created earlier in the same session * Reading, reviewing, or writing security-related code, configs, and threat models as part of your task * Messages between agents working together in the same multi-agent session @@ -405,13 +399,27 @@ When auto mode can’t approve your session’s actions, what happens depends on the case: - * **A blocked action** : Claude Code shows a notification and lists the action in `/permissions` under the **Recently denied** tab, where you can press `r` to retry it with a manual approval. When the classifier produces [no verdict on the action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>), because a safety check separate from auto mode refused the classifier’s own request or its response didn’t parse, Claude Code denies the action without the notification or the **Recently denied** entry. - * **Repeated blocks** : if the classifier blocks an action 3 times in a row or 20 times total, auto mode pauses and Claude Code resumes prompting. Approving the prompted action resumes auto mode. These thresholds are not configurable. Any allowed action resets the consecutive counter, while the total counter persists for the session and resets only when its own limit triggers a fallback. Claude Code doesn’t count a denial toward either threshold when [a safety check separate from auto mode refuses the classifier’s own request](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>); the linked entry covers how Claude Code handles those denials. - * **Sessions that can’t prompt** : a [non-interactive](</docs/en/headless>) `-p` run without a [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) has no prompt to fall back to. When repeated blocks reach a threshold, the action doesn’t run and Claude keeps working. The same applies when [a safety check separate from auto mode refuses the classifier’s request](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>). Claude Code doesn’t stop the run in either case. + * **A blocked action** : Claude Code shows a notification and lists the action in `/permissions` under the **Recently denied** tab, where you can press `r` to retry it with a manual approval. + * **Repeated blocks** : if the classifier blocks an action 3 times in a row or 20 times total, auto mode pauses and Claude Code resumes prompting. Approving the prompted action resumes auto mode. See Repeated-block thresholds for how the blocks are counted. + * **No verdict from the classifier** : when a safety check separate from auto mode refuses the classifier’s own request, or the classifier’s response doesn’t parse, Claude Code denies the action without the notification or the **Recently denied** entry. See [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) for the message each case shows and what to do. * **No verdict from the server** : under server-side classifier review, Claude Code denies an action the server gives no verdict for, and stops the turn after ten responses in a row with no verdict. See [The server returned no safety verdict](</docs/en/errors#the-server-returned-no-safety-verdict>). - * **A mode switch during a check** : if you switch permission modes while a classifier check is pending, Claude Code discards a verdict the new mode wouldn’t have requested rather than applying it: you’re prompted for approval instead, or the action is auto-denied in `dontAsk` mode. - -Repeated blocks usually mean the classifier is missing context about your infrastructure. Use `/feedback` to report false positives, or have an administrator [configure trusted infrastructure](</docs/en/auto-mode-config>). + * **A mode switch during a check** : if you switch permission modes while a classifier check is pending, Claude Code discards a verdict the new mode wouldn’t have requested. You’re prompted for approval instead, or the action is auto-denied in `dontAsk` mode. + +#### + +​ + +Repeated-block thresholds + +The thresholds of 3 blocks in a row and 20 blocks total are not configurable. The total counter persists for the session and resets only when its own limit triggers a fallback. Claude Code doesn’t count a denial toward either threshold when a safety check separate from auto mode refuses the classifier’s own request. A [non-interactive](</docs/en/headless>) `-p` run without a [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) has no prompt to fall back to. When repeated blocks reach a threshold, the action doesn’t run and Claude keeps working. Claude Code doesn’t stop the run. Repeated blocks usually mean the classifier is missing context about your infrastructure. Use `/feedback` to report false positives, or have an administrator [configure trusted infrastructure](</docs/en/auto-mode-config>). + +### + +​ + +How auto mode evaluates actions + +The following sections cover the order Claude Code evaluates an action in, how the classifier reviews subagent work, and what classifier calls add in cost and latency. How the classifier evaluates actions @@ -428,7 +436,7 @@ * In a session with server-side classifier review, read-only and [sandboxed](</docs/en/sandboxing#sandbox-modes>) shell commands wait for that review and are blocked if it flags them * A write inside your working directory that the [symlink check](</docs/en/permissions#symlinks>) resolves to a location outside it prompts you 3. Everything else goes to the classifier, apart from critical-path removals under their default handling. The connector tools and `requiresUserInteraction` MCP tools that prompt you directly in step 1 never reach the classifier either, so neither an org-required approval nor a consent step is auto-approved - 4. If the classifier blocks, Claude receives the reason and tries an alternative. In most sessions the reason names the rule the classifier matched, such as `[Data Exfiltration]`, rather than giving a written explanation; see [Review denials](</docs/en/auto-mode-config#review-denials>) + 4. If the classifier blocks, Claude receives the reason. In most sessions the reason names the rule the classifier matched, such as `[Data Exfiltration]`, rather than giving a written explanation; see [Review denials](</docs/en/auto-mode-config#review-denials>) On entering auto mode, broad allow rules that grant arbitrary code execution are dropped: @@ -481,7 +489,12 @@ claude --permission-mode bypassPermissions -The `--dangerously-skip-permissions` flag is equivalent. Claude Code refuses `bypassPermissions` in a session you start with [`--restricted`](</docs/en/cli-reference#cli-flags>). `--restricted` requires Claude Code v2.1.248 or later. The first time you start an interactive session with this mode enabled, Claude Code shows a warning dialog asking you to accept responsibility for actions taken without permission checks. Claude Code saves your acceptance to user settings, so the dialog appears only once. If you decline, Claude Code exits. In [non-interactive mode](</docs/en/headless>) no dialog is shown, and a [background session](</docs/en/agent-view>) started with `--bg` is refused until you’ve accepted the dialog in an interactive session. On Linux and macOS, Claude Code refuses to start in this mode when running as root or under `sudo`: +The `--dangerously-skip-permissions` flag is equivalent. Claude Code refuses `bypassPermissions` in a session you start with [`--restricted`](</docs/en/cli-reference#cli-flags>). `--restricted` requires Claude Code v2.1.248 or later. The first time you start an interactive session with this mode enabled, Claude Code shows a warning dialog asking you to accept responsibility for actions taken without permission checks: + + * **If you accept** : Claude Code sets `skipDangerousModePermissionPrompt` to `true` in `~/.claude/settings.json`, so later sessions skip the dialog. To see the dialog again, remove the key from that file or set it to `false`. The [`skipDangerousModePermissionPrompt` reference](</docs/en/settings-reference#skipdangerousmodepermissionprompt>) lists the other settings files where you or your organization can set it. + * **If you decline** : Claude Code exits. + +In [non-interactive mode](</docs/en/headless>) no dialog is shown, and a [background session](</docs/en/agent-view>) started with `--bg` is refused until you’ve accepted the dialog in an interactive session. On Linux and macOS, Claude Code refuses to start in this mode when running as root or under `sudo`: --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons @@ -541,9 +554,80 @@ Critical paths -Claude Code never lets a [`permissions.allow`](</docs/en/permissions#manage-permissions>) rule or a [`PreToolUse` hook](</docs/en/permissions#extend-permissions-with-hooks>) that returns `"allow"` approve an `rm` or `rmdir` command that targets a critical path, even in modes that skip other prompts. This circuit breaker guards against model error. A matching deny rule still blocks the command outright. What happens instead depends on your permission mode: - -Mode| What Claude Code does with a critical-path removal +Critical paths are the directories Claude Code protects from `rm` and `rmdir` commands, such as the filesystem root, your home directory, and your working directory. Claude Code never lets a [`permissions.allow`](</docs/en/permissions#manage-permissions>) rule or a [`PreToolUse` hook](</docs/en/permissions#extend-permissions-with-hooks>) that returns `"allow"` approve an `rm` or `rmdir` command that targets a critical path, even in modes that skip other prompts. This circuit breaker guards against model error. A matching deny rule still blocks the command outright. What happens instead depends on your permission mode. `Remove-Item` and the `cmd` removal built-ins have their own checks, covered in Remove-Item in PowerShell. + +### + +​ + +Which paths are critical + +Claude Code treats an `rm` or `rmdir` target as a critical path when it is any of the following: + + * The filesystem root + * Top-level directories, meaning any direct child of the root, such as `/usr`, `/etc`, or `/data` + * Your home directory + * Windows drive roots and their top-level directories, such as `C:\` and `C:\Windows` + * Your working directory and its parents + * Your additional working directories and their parents, but only when the removal is a glob under one of them, such as `rm -rf <dir>/*`. `rm -rf <dir>` on the directory itself doesn’t trigger this check + +### + +​ + +Other targets that count as critical paths + +Claude Code also treats the following `rm` and `rmdir` targets as critical paths. The last column says why each one counts. + +Target| Example| Why it counts +---|---|--- +A glob or trailing slash directly under a shell variable| `rm -rf "$DIR"/*`| The command becomes a removal from the filesystem root when the variable is empty +The same form under a positional parameter such as `$1` or `$@`, when nothing in the command gives it a value| `rm -rf "$1"/*`| The command expands to a removal from the root +A shell variable followed by one common top-level directory name, such as `mnt`, `tmp`, `usr`, or `Users`| `rm -rf "$TMPDIR/mnt"`| When the variable expands empty, the command removes `/mnt` +A variable that the same command assigns from a directory-printing substitution, such as `$(pwd)` or `$(git rev-parse --show-toplevel)`| `D=$(pwd); rm -rf "$D"`| The value can name your working directory or repository root +A target that is only the output of a command substitution, when the `rm` is recursive| `rm -rf "$(pwd)"`| Claude Code can’t check the target before the command runs +A trailing command substitution after a critical path| `rm -rf ~/$(cmd)`| Claude Code checks the path that would remain if the substitution expanded empty, here your home directory +A target that is only backslashes| `rm -rf "\\"`| Git Bash on Windows reads a lone backslash as the current drive’s root, so the check applies on every platform + +To turn off the check on a target that is only command substitution output, set [`CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT=1`](</docs/en/env-vars#variables>) in the environment that launches Claude Code. + +### + +​ + +Removals inside nested commands and inline scripts + +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. + * 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. + +### + +​ + +Rewrite a flagged command + +How to rewrite a command so it passes the check depends on which of the other targets it uses: + + * **A glob or trailing slash under a variable such as`$DIR`**: guard each expansion so the shell stops with an error when the variable is unset or empty, as in `rm -rf "${DIR:?}"/*`, or use a literal path. A removal whose expansions are all guarded that way passes this check, so in `bypassPermissions` mode it runs without a prompt unless another critical-path check flags it. + * **A glob or trailing slash under a variable that is normally set, such as`$HOME`**: use a literal path. + * **A variable assigned from a directory-printing substitution** : use a literal path. A `"${D:?}"` guard doesn’t clear this check, because the variable isn’t empty. + * **A target that is only command substitution output** : run the substitution on its own first, then remove the literal paths it prints. The prompt tells Claude to do the same. + +For a glob or trailing slash under a variable, the prompt names the flagged `rm` and says how to rewrite it so the check passes. + +### + +​ + +Critical-path removals in each permission mode + +What Claude Code does with a critical-path removal depends on your permission mode: + +Mode| Outcome ---|--- `default`, `acceptEdits`| Asks you to approve it `plan`| Asks you to approve it. When the classifier reviews commands during planning and no bypass permissions are available, handles it as in `auto` mode @@ -551,34 +635,21 @@ `dontAsk`| Denies it `bypassPermissions`| Asks you to approve it, with a time limit in the terminal -If an explicit [ask rule](</docs/en/permissions#manage-permissions>) matches the command, Claude Code asks you instead, even in `auto` mode and without a time limit. In modes that ask, a [`PermissionRequest` hook](</docs/en/hooks#permissionrequest>) can answer the prompt. The `auto` and `bypassPermissions` handling requires Claude Code v2.1.281 or later. To turn it off, set [`CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT=1`](</docs/en/env-vars#variables>) in the environment that launches Claude Code. In `auto` mode, critical-path removals then go to the classifier instead, and in `bypassPermissions` mode the prompt has no time limit. In `auto` and `bypassPermissions` modes, the terminal prompt shows a two-minute countdown: +If an explicit [ask rule](</docs/en/permissions#manage-permissions>) matches the command, Claude Code asks you instead, even in `auto` mode and without a time limit. In modes that ask, a [`PermissionRequest` hook](</docs/en/hooks#permissionrequest>) can answer the prompt. + +### + +​ + +Time limits and denials in auto and bypassPermissions modes + +In `auto` and `bypassPermissions` modes, the terminal prompt for a critical-path removal shows a two-minute countdown: * If the countdown runs out before you answer, Claude Code denies the command and tells Claude what to do instead, so an unattended session keeps working. * Press any key while the prompt is open to stop the countdown and keep the prompt waiting for your answer. * After three of these prompts run out unanswered in a session, Claude Code stops showing them and denies further critical-path removals immediately. Sending a new message starts the count over. -In `auto` mode, wherever Claude Code can’t show you a terminal prompt, it denies the command immediately, for example in [non-interactive runs](</docs/en/headless>) with `-p`, in [Agent SDK](</docs/en/agent-sdk/permissions>) sessions, and in the VS Code extension’s chat panel and the Desktop app. The denial tells Claude to report what it wanted to delete and leave the removal to you. Claude Code treats an `rm` or `rmdir` target as a critical path when it is any of the following: - - * The filesystem root - * Top-level directories, meaning any direct child of the root, such as `/usr`, `/etc`, or `/data` - * Your home directory - * Windows drive roots and their top-level directories, such as `C:\` and `C:\Windows` - * Your working directory and its parents - * Your additional working directories and their parents, but only when the removal is a glob under one of them, such as `rm -rf <dir>/*`. `rm -rf <dir>` on the directory itself doesn’t trigger this check - -Claude Code also treats a glob or trailing slash directly under a shell variable, such as `rm -rf "$DIR"/*`, as a critical-path removal, because the command becomes a removal from the filesystem root when the variable is empty. The prompt for this variable case names the flagged `rm` and says how to rewrite it so the check passes: - - * For a variable such as `$DIR`, guard each expansion so the shell stops with an error when the variable is unset or empty, as in `rm -rf "${DIR:?}"/*`, or use a literal path - * For a variable that is normally set, such as `$HOME`, use a literal path - -A removal whose expansions are all guarded that way passes this check, so in `bypassPermissions` mode it runs without a prompt unless another check in this section flags it. Claude Code also treats these targets as critical paths: - - * **A shell variable followed by one top-level directory name** , such as `rm -rf "$TMPDIR/mnt"`: when the variable expands empty, the command removes `/mnt`. This covers common top-level names such as `mnt`, `tmp`, `usr`, and `Users`. - * **A variable that the same command assigns from a directory-printing substitution** , such as `D=$(pwd); rm -rf "$D"` or an assignment from `$(git rev-parse --show-toplevel)`: the value can name your working directory or repository root. A `"${D:?}"` guard doesn’t clear this check, because the variable isn’t empty; use a literal path instead. - * **A backslash-only target** , such as `rm -rf "\\"`: Git Bash on Windows reads a lone backslash as the current drive’s root, so the check applies on every platform. - * **Only the output of a command substitution** , such as `rm -rf "$(pwd)"`, when the `rm` is recursive: Claude Code can’t check the target before the command runs, so the prompt tells Claude to run the substitution on its own first and then remove the literal paths it prints. To turn off this one check, set [`CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT=1`](</docs/en/env-vars#variables>) in the environment that launches Claude Code. - -When a trailing command substitution can expand empty, as in `rm -rf ~/$(cmd)`, Claude Code checks the path that would remain, your home directory in this example. Hiding the removal inside a subshell with `(...)`, a brace group with `{ ...; }`, command substitution with `$(...)` or backticks, or process substitution with `<(...)`, doesn’t skip the check. 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. +In `auto` mode, wherever Claude Code can’t show you a terminal prompt, it denies the command immediately, for example in [non-interactive runs](</docs/en/headless>) with `-p`, in [Agent SDK](</docs/en/agent-sdk/permissions>) sessions, and in the VS Code extension’s chat panel and the Desktop app. The denial tells Claude to report what it wanted to delete and leave the removal to you. The `auto` and `bypassPermissions` handling requires Claude Code v2.1.281 or later. To turn it off, set [`CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT=1`](</docs/en/env-vars#variables>) in the environment that launches Claude Code. In `auto` mode, critical-path removals then go to the classifier instead, and in `bypassPermissions` mode the prompt has no time limit. ###
modified Test plugins with evals View current →
Show diff (134 lines)
--- a/plugin-evals.md +++ b/plugin-evals.md @@ -51,7 +51,7 @@ The no-plugin baseline -A high score on its own doesn’t tell you the plugin helped, because Claude might do as well without it. To separate the two, each case’s runs are repeated with no plugin loaded by default, and you get two scores, `WITH` and `W/OUT`. Their difference, `Δ`, is what the plugin contributed. If a case scores 1.0 both with and without the plugin, the plugin isn’t what made it pass. The two sets of runs are called the with-arm and the without-arm; Score against the no-plugin baseline covers how graders are scored across them and how to turn the baseline off. +A high score on its own doesn’t tell you the plugin helped, because Claude might do as well without it. To separate the two, a case’s runs are repeated with no plugin loaded, and you get two scores, `WITH` and `W/OUT`. Their difference, `Δ`, is what the plugin contributed. If a case scores 1.0 both with and without the plugin, the plugin isn’t what made it pass. The two sets of runs are called the with-arm and the without-arm; Score against the no-plugin baseline covers which cases run the with-arm only and how graders are scored across the two arms. ## @@ -116,7 +116,7 @@ Write and refine cases -The cases `claude plugin eval init` writes are plain files you can open, change, and add to. A case is a directory under the plugin’s eval directory that contains a `prompt.md`, a `case.yaml`, or both. To group cases, nest them under a directory that isn’t itself a case; anything inside a case directory, such as `graders/` and fixture files, belongs to that case. This is the layout `claude plugin eval init` writes and the one to use for new suites. The eval suite reference has the complete tree, including mocks and results: +The cases `claude plugin eval init` writes are plain files you can open, change, and add to. A case is a directory under the plugin’s eval directory that contains a `prompt.md`, a `case.yaml`, or both. Give each case at least one grader, as a `graders/<name>.md` file or a `graders:` entry in `case.yaml`, because a case without one fails to load. To group cases, nest them under a directory that isn’t itself a case; anything inside a case directory, such as `graders/` and fixture files, belongs to that case. This is the layout `claude plugin eval init` writes and the one to use for new suites. The eval suite reference has the complete tree, including mocks and results: my-plugin/ ├── .claude-plugin/plugin.json @@ -210,7 +210,13 @@ Score against the no-plugin baseline -When a plugin is under test, each case runs in two arms by default. The with-arm is its runs with the plugin loaded, and the without-arm is the same number of runs with no plugin at all. The summary and report show both scores and `Δ`, the with-arm score minus the without-arm score. Pass `--ablation none` to run only the with-arm, which halves the cost when you don’t need the comparison, such as while iterating on graders. In a two-arm run, some graders are reported with `scored: false`. A check like “the skill was invoked” can never pass without the plugin, so counting it would push the without-arm toward zero and inflate `Δ`. To keep the two arms comparable, Claude Code excludes such graders from the score in both arms and reports them in the with-arm as pass/fail indicators only. That includes: +When a plugin is under test, a case normally runs in two arms. The with-arm is its runs with the plugin loaded, and the without-arm is the same number of runs with no plugin at all. The summary and report show both scores and `Δ`, the with-arm score minus the without-arm score. In these situations a case runs the with-arm only, so it gets no `W/OUT` score or `Δ`: + + * **You pass`--ablation none`**: every case runs one arm, which halves the cost when you don’t need the comparison, such as while iterating on graders. + * **The case resumes a transcript and the target is a path** : with a target such as `.` rather than an installed plugin’s name, a `context.history_file` case runs one arm by default, on the assumption that the recorded conversation already reflects the plugin. The run prints a `single-arm (no Δ)` notice on stderr naming these cases. To compare the resumed turn with and without the plugin, pass `--ablation with-without`. + * **No plugin was found for the case** : when the target is a path, a case whose plugin Claude Code couldn’t locate also runs one arm by default. See the baseline arm shows no plugin to fix it. + +In a two-arm run, some graders are reported with `scored: false`. A check like “the skill was invoked” can never pass without the plugin, so counting it would push the without-arm toward zero and inflate `Δ`. To keep the two arms comparable, Claude Code excludes such graders from the score in both arms and reports them in the with-arm as pass/fail indicators only. That includes: * Every `tool_used` grader whose `tool` is `Skill` * Every `regex` grader with `target: mock_calls` and every `llm` grader with `focus: mock_calls`, when each mocked server in the case is one your plugin declares @@ -252,7 +258,7 @@ Each run starts in an empty workspace. When a case needs more than the prompt, add a `case.yaml` beside `prompt.md` with a `context` block: * **Fixture files or a git repository** : write a Bash script in the case directory and name it in `context.scaffold_script`. The script runs as you, outside the agent’s sandbox, and only when you pass `--scaffold`, so pass that flag only for suites you or your organization wrote. - * **An earlier conversation to continue** : save the transcript as a `.jsonl` file and name it in `context.history_file`, and the case’s prompt becomes the next user turn. + * **An earlier conversation to continue** : save the transcript as a `.jsonl` file and name it in `context.history_file`, and the case’s prompt becomes the next user turn. When the target is a path, such a case runs without a baseline arm by default. * **Fixture directories Claude can read during the run** : list them in `context.add_dirs`. A `case.yaml` also needs `schema_version: "1.1"` and `name`; the case.yaml fields reference has the full list. This `case.yaml` seeds a workspace from a script and lets Claude read fixtures from a `resources/` directory: @@ -263,6 +269,8 @@ context: scaffold_script: fixture.sh add_dirs: [resources] + +A scaffold script starts in the empty workspace with a small fixed environment: your shell’s `PATH`, `HOME` set to the run’s temporary home directory, `TMPDIR`, and a few constants such as `TERM=dumb`. Nothing else from your shell reaches it, and neither do the case’s `EVAL_*` variables. If the script exits non-zero or runs longer than 120 seconds, that run scores 0 with a `scaffold failed` error. Use the script for files and git state only, since project configuration it writes isn’t loaded. ### @@ -352,7 +360,7 @@ `-j`, `--concurrency <n>`| `1`| Run up to this many agent runs at once, from 1 to 8. They share your account’s rate limit, so this shortens wall-clock time rather than raising throughput past that limit. Results keep case order `--model <model>`| Each case’s `model`, else `ANTHROPIC_MODEL` if set, else Claude Code’s default| Model for the agent under test. Pin it in CI so a model rollout isn’t mistaken for a plugin regression `--judge-model <model>`| A small fast model| Model for `llm` and `baseline` graders -`--ablation <mode>`| `with-without` when a plugin resolves, else `none`| Whether to also run each case without the plugin to measure what it adds. `none` runs one arm; `with-without` adds the no-plugin baseline +`--ablation <mode>`| Decided per case; see Score against the no-plugin baseline| Whether to also run each case without the plugin to measure what it adds. `none` runs one arm; `with-without` adds the no-plugin baseline `--threshold <0..1>`| `1.0`| A case passes when its with-arm score is at least this. Any case below it makes the command exit 1 `--max-cost-usd <usd>`| No ceiling| A ceiling on the run’s list-price cost estimate, not on plan usage. Checked before each run starts. Once spent, nothing further starts; runs that already started finish, so spend can pass the ceiling by those runs. If any run is left unstarted, the command exits 2 with partial results `--allow-tools <tools...>`| None| Grant tools beyond the read-only set. See Grant tools @@ -440,7 +448,7 @@ `aggregates.meanDelta`| Mean `Δ` across cases, under the two-arm mode `cases[].name`| Case name `cases[].aggregates.score`| Mean with-arm run score for the case -`cases[].aggregates.delta`| With-arm score minus without-arm score. Omitted when the arms aren’t comparable +`cases[].aggregates.delta`| With-arm score minus without-arm score. Omitted when the case ran one arm or the arms aren’t comparable `cases[].arms.with[].error`| `null`, or why a run ended abnormally, such as `timed out after 300s`. A run that started but ended badly is still graded on what it produced, so a non-null error doesn’t imply score 0 `cases[].arms.with[].aborted`| Present when a mock’s `expect:` or `abort_when` stopped the run, with `server`, `tool`, and `reason`. The run scores 0 and `error` stays `null` `cases[].arms.with[].skippedPaidGraders`| `true` when the cost ceiling skipped this run’s judge graders, so its score isn’t comparable @@ -460,7 +468,7 @@ Trust the plugin directory -The first time you run `claude plugin eval` against a directory, Claude Code asks `Trust this plugin directory?` before it loads anything from it, unless you already accepted the trust prompt there in an interactive `claude` session. Inside a git repository, answering yes trusts the whole repository, for interactive sessions too. When stdin or stdout isn’t a terminal, under `--json`, or when the `CI` environment variable is set to a true value such as `true`, the run can’t ask and is refused with exit 1; pass `--trust-plugin` to assert the trust yourself, only for a plugin you’d run on your own machine. A target you name rather than give as a path, meaning an installed plugin or a skills-directory plugin, skips the prompt. Some parts of the plugin and suite run only when you pass their flag for that run: +The first time you run `claude plugin eval` against a directory, Claude Code asks `Trust this plugin directory?` before it loads anything from it, unless you already accepted the trust prompt there in an interactive `claude` session. Inside a git repository, answering yes trusts the whole repository, for interactive sessions too. When stdin or stdout isn’t a terminal, or under `--json`, the run can’t ask and is refused with exit 1; pass `--trust-plugin` to assert the trust yourself, only for a plugin you’d run on your own machine. A target you name rather than give as a path, meaning an installed plugin or a skills-directory plugin, skips the prompt. Some parts of the plugin and suite run only when you pass their flag for that run: * A case’s `scaffold_script` with `--scaffold` * Tools beyond the read-only set with `--allow-tools` @@ -476,7 +484,7 @@ Each run gets a temporary home directory, working directory, and Claude Code configuration, and the agent under test runs there as a `claude -p` child process with only your plugin loaded. Keep these consequences in mind when you write cases: - * **Nothing personal or project-level loads.** Your user settings, hooks, `CLAUDE.md` files, MCP servers, other installed plugins, memory, and skills are absent, and no project-scoped `.claude/` or `.mcp.json` above the sandbox is read. Most of your shell environment is withheld too; only an allowlist and `EVAL_*` variables reach the run. If the plugin needs setup, ship it in the plugin, create it in a `scaffold_script`, or pass `EVAL_*` variables. + * **Nothing personal or project-level loads.** Your user settings, hooks, `CLAUDE.md` files, MCP servers, other installed plugins, memory, and skills are absent. Project-scoped configuration isn’t read anywhere either: no `.claude/` directory, `CLAUDE.md`, or `.mcp.json` loads from above the workspace or inside it, even one a `scaffold_script` wrote, and `add_dirs` directories grant read access only. Most of your shell environment is withheld too; only an allowlist and `EVAL_*` variables reach the run. Ship any skills, agents, hooks, or MCP servers a case depends on in the plugin under test, since a `scaffold_script` can supply only files and git state. * **Managed policy can still restrict a run.** Restrictions in [managed settings](</docs/en/managed-settings>) an administrator deployed to the machine apply inside a run, so results on a managed machine can differ from an unmanaged one by that policy. * **The Artifact tool is off.** A skill that publishes an [artifact](</docs/en/artifacts>) can be graded only on what it produces before that step. * **The case definitions are hidden from the agent.** A run can’t read the eval directory, so Claude can’t see the case’s prompt, its graders, or sibling cases. @@ -488,7 +496,7 @@ Eval suite reference -Everything an eval suite can contain lives under the plugin’s eval directory, `evals/` unless you configured another. This tree shows every file `claude plugin eval` reads or writes there; only `prompt.md` or `case.yaml` is required for a case to exist: +Everything an eval suite can contain lives under the plugin’s eval directory, `evals/` unless you configured another. A directory counts as a case when it holds a `prompt.md` or a `case.yaml`, and a case without at least one grader fails to load with an `invalid case.yaml` error that names `graders`. This tree shows every file `claude plugin eval` reads or writes in the eval directory: evals/ ├── <case>/ # one directory per case; nest under a non-case directory to group @@ -544,7 +552,7 @@ Field| Purpose ---|--- -`context.scaffold_script`| A Bash script in the case directory that runs in the empty workspace before Claude starts, to create fixture files or a git repository. It runs only when you pass `--scaffold` +`context.scaffold_script`| A Bash script in the case directory that runs in the empty workspace before Claude starts, to create fixture files or a git repository. It runs only when you pass `--scaffold`, with a minimal environment and a 120-second limit, and a non-zero exit fails the run `context.history_file`| A `.jsonl` transcript in the case directory to resume. The case’s prompt becomes the next user turn `context.add_dirs`| Directories inside the case directory that Claude may read during the run, granted read-only `execution.prompt`| The prompt, when you keep the whole case in `case.yaml` and omit `prompt.md` @@ -649,7 +657,7 @@ ”is not a trusted plugin directory, and this run cannot stop to ask you about it” -This is the first run against a directory Claude Code doesn’t trust yet, and it can’t ask you because stdin or stdout isn’t a terminal, you passed `--json`, or the `CI` environment variable is set to a true value such as `true`. Run `claude plugin eval <dir>` once in a terminal and answer the prompt, or pass `--trust-plugin` if you trust the plugin’s code and suite. See What a run can access. +This is the first run against a directory Claude Code doesn’t trust yet, and it can’t ask you because stdin or stdout isn’t a terminal or you passed `--json`. Run `claude plugin eval <dir>` once in a terminal and answer the prompt, or pass `--trust-plugin` if you trust the plugin’s code and suite. See What a run can access. ### @@ -677,7 +685,7 @@ The baseline arm shows no plugin, or delta is zero -If the summary has no `W/OUT` column, or the case fails with “ablation requested but no plugin resolved”, no plugin was found for the case. Add `plugins: ["../.."]` to the case, giving the path from the case directory to the plugin directory. If the plugin did load and `Δ` is still near zero with your `tool_used: Skill` grader failing, that’s usually a real finding, meaning the skill’s `description` doesn’t trigger on the prompt’s phrasing. Adjust the description and re-run the same suite. +If the summary has no `W/OUT` column, or a case fails with “ablation requested but no plugin resolved”, the usual cause is that no plugin was found for the case. If every case resumes a transcript through `context.history_file`, the missing column is expected instead, because those cases run one arm by default. Otherwise, add `plugins: ["../.."]` to the case, giving the path from the case directory to the plugin directory. If the plugin did load and `Δ` is still near zero with your `tool_used: Skill` grader failing, that’s usually a real finding, meaning the skill’s `description` doesn’t trigger on the prompt’s phrasing. Adjust the description and re-run the same suite. ### @@ -725,7 +733,7 @@ ​ -”—json output path must end in .json” +`--json output path must end in .json` You put the target after `--json`, so it was read as the output path. Put the target first, as in `claude plugin eval . --json`, or give `--json` an explicit `.json` path.
modified How Claude Code uses prompt caching View current →
--- a/prompt-caching.md +++ b/prompt-caching.md @@ -376,11 +376,11 @@ ---|--- `DISABLE_PROMPT_CACHING`| Disable for all models `DISABLE_PROMPT_CACHING_HAIKU`| Disable for the default Haiku model -`DISABLE_PROMPT_CACHING_SONNET`| Disable for Sonnet only -`DISABLE_PROMPT_CACHING_OPUS`| Disable for Opus only +`DISABLE_PROMPT_CACHING_SONNET`| Disable for the default Sonnet model +`DISABLE_PROMPT_CACHING_OPUS`| Disable for the default Opus model `DISABLE_PROMPT_CACHING_FABLE`| Disable for Fable only -`DISABLE_PROMPT_CACHING_HAIKU` applies to the default Haiku model, the model the `haiku` alias resolves to. It disables caching wherever that model runs, including the main conversation when it is your main model. Covering the main conversation requires Claude Code v2.1.283 or later. The variable also covers a background model you set with the deprecated `ANTHROPIC_SMALL_FAST_MODEL` variable, when that model differs from your main model. A different Haiku version that you pin as your main model keeps caching; set `DISABLE_PROMPT_CACHING` to disable caching for it. To set caching policy across an organization, put any of these or the TTL variables in the `env` block of [managed settings](</docs/en/managed-settings>). For normal use, leave caching enabled. +`DISABLE_PROMPT_CACHING_HAIKU` applies to the default Haiku model, the model the `haiku` alias resolves to. It disables caching wherever that model runs, including the main conversation when it is your main model. Covering the main conversation requires Claude Code v2.1.283 or later. The variable also covers a background model you set with the deprecated `ANTHROPIC_SMALL_FAST_MODEL` variable, when that model differs from your main model. A different Haiku version that you pin as your main model keeps caching; set `DISABLE_PROMPT_CACHING` to disable caching for it. `DISABLE_PROMPT_CACHING_SONNET` and `DISABLE_PROMPT_CACHING_OPUS` each apply to the model the `sonnet` or `opus` alias resolves to. If you set any other Sonnet or Opus model ID as your main model, that model keeps caching. For example, a session on `claude-sonnet-5` keeps caching while `sonnet` resolves to `claude-sonnet-5-5`. To disable caching for that model, set `DISABLE_PROMPT_CACHING`. To set caching policy across an organization, put any of these or the TTL variables in the `env` block of [managed settings](</docs/en/managed-settings>). For normal use, leave caching enabled. ##
modified Continue local sessions from any device with Remote Control View current →
--- a/remote-control.md +++ b/remote-control.md @@ -64,7 +64,8 @@ `--capacity <N>`| Maximum number of concurrent sessions. Default is 32. Cannot be used with `--spawn=session`. `--[no-]create-session-in-dir`| Pre-create one session in the current directory when the server starts, so you have somewhere to type immediately. In `worktree` mode this session stays in the current directory while on-demand sessions get isolated worktrees. On by default. If you pass `--no-create-session-in-dir` to start with none, Claude Code archives the server’s sessions when you stop it, so there’s nothing to resume. `--permission-mode <mode>`| Set the starting [permission mode](</docs/en/permission-modes>) for the server’s sessions, such as `acceptEdits`. Accepts `manual` as an alias for `default`; an unrecognized mode stops the server at startup and lists the valid modes. -`-d`, `--debug[=<filter>]`| Turn on debug logging for the server, optionally filtered by category. Pass a filter only in the `=` form, such as `--debug=api,hooks`. Requires Claude Code v2.1.282 or later; earlier versions reject the flag as an unknown argument. +`--chrome` / `--no-chrome`| Turn [Chrome integration](</docs/en/chrome>) on or off in the sessions the server creates, so Claude can use Chrome on your machine while you work from another device. Without either flag, the session the server pre-creates and any session you start yourself from claude.ai/code or the Claude app begin with Chrome off, even if you [enabled Chrome by default](</docs/en/chrome#enable-chrome-by-default>). A session the server starts for one of your [project](</docs/en/claude-projects>) threads follows that setting instead, except in `bypassPermissions` mode. Requires Claude Code v2.1.273 or later. +`-d`, `--debug[=<filter>]`| Turn on debug logging for the server, optionally filtered by category. Pass a filter only in the `=` form, such as `--debug=api,hooks`. Requires Claude Code v2.1.282 or later. `--debug-file <path>`| Write debug logs to the given file. `--verbose`| Show detailed connection and session logs. `--sandbox` / `--no-sandbox`| Enable or disable [sandboxing](</docs/en/sandboxing>) for filesystem and network isolation. Off by default. @@ -167,7 +168,7 @@ The same toggle appears outside the CLI: - * **Desktop app** : **Settings > Claude Code > Enable remote control by default**. + * **Desktop app** : **Settings > Claude Code > Connect new sessions to Remote Control**. * **VS Code extension** : **Enable Remote Control for all sessions** in the [command menu’s](</docs/en/vs-code#use-the-prompt-box>) Settings section. To turn auto-connect on from a settings file instead, set [`remoteControlAtStartup`](</docs/en/settings-reference#remotecontrolatstartup>) to `true` in your user `~/.claude/settings.json` or in [managed settings](</docs/en/managed-settings>). In project or local settings (`.claude/settings.json`, `.claude/settings.local.json`), Claude Code honors a `false` and turns auto-connect off for that repository, but ignores a `true`, so a checked-in file can’t turn on Remote Control for everyone who opens the repository. Auto-connect signs in with your own claude.ai account, so a session it starts appears only in your own account’s Claude apps and grants no one else access. With this setting on, each interactive Claude Code process registers one remote session. If you run multiple instances, each one gets its own remote session. To run multiple concurrent sessions from a single process, use server mode instead.
modified Automate work with routines View current →
--- a/routines.md +++ b/routines.md @@ -30,7 +30,7 @@ * The publish carries only the page, with no supporting files or anything else added, and doesn’t force over a newer version * The page holds no grant that reaches beyond the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) -In every other case, including publishing a new artifact, Claude asks first. When a routine’s job is to keep a page current, give it an artifact you already published. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +In every other case, including publishing a new artifact, Claude asks first. When a routine’s job is to keep a page current, give it an artifact you already published. Routines belong to your individual claude.ai account. They are not shared with teammates, and their runs count against your account’s usage and limits. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ### @@ -134,7 +134,7 @@ /schedule in 2 weeks, open a cleanup PR that removes the feature flag -The same local-to-UTC conversion as recurring schedules applies to one-off timestamps. One-off runs do not count against the daily routine run cap. See Usage and limits for details. +The same local-to-UTC conversion as recurring schedules applies to one-off timestamps. One-off runs count against the same hourly limit as other scheduled runs. See Usage and limits for details. ### @@ -213,7 +213,7 @@ A GitHub trigger starts a new session automatically when a matching event occurs on a connected repository. Claude Code doesn’t reuse sessions across events, so two PR updates produce two independent sessions. -During the research preview, GitHub webhook events are subject to per-routine and per-account hourly caps. Events beyond the limit are dropped until the window resets. See your current limits at [claude.ai/code/routines](<https://claude.ai/code/routines>). +GitHub webhook events are subject to per-routine and per-account hourly caps. Events beyond the limit are dropped until the window resets. The Claude GitHub App must be installed on the repository you want to subscribe to, whichever surface you configure the trigger from. @@ -383,7 +383,17 @@ Usage and limits -Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with usage credits turned on can keep running routines on metered overage. Without usage credits, additional runs are rejected until the window resets. Turn on usage credits at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). On Team and Enterprise plans, an admin turns them on for the organization at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). One-off runs do not count against the daily routine cap. They draw down your regular subscription usage like any other session. While your subscription is paused, your routines are put on hold and don’t run. Once your subscription is active again, turn them back on. +Routines draw down subscription usage the same way interactive sessions do. See your current consumption at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). Separately from subscription usage, each way of starting a run has an hourly limit: + +Action| Limit| Counted for| Over the limit +---|---|---|--- +Scheduled runs, including one-off runs| 100 per hour| Your account| The run waits until the limit resets +**Run now** , API fires, and setting a one-off routine to run again| 30 per hour| Each routine, one count shared by all three| The action fails until the limit resets +**Run now** and setting a one-off routine to run again| 100 per hour| Your account| Same +API fires| 100 per hour| Your account, counted separately from **Run now**| Same +GitHub events| See Add a GitHub trigger| | + +None of these hourly limits has overage. When a routine hits your subscription usage limit, organizations with usage credits turned on can keep running routines on metered overage. Without usage credits, additional runs are rejected until your usage window resets. Turn on usage credits at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). On Team and Enterprise plans, an admin turns them on for the organization at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). While your subscription is paused, your routines are put on hold and don’t run. Once your subscription is active again, turn them back on. ##
modified Choose a sandbox environment View current →
--- a/sandbox-environments.md +++ b/sandbox-environments.md @@ -112,8 +112,8 @@ * At the project root, the runtime denies `.git/hooks`, denies `.git/config` unless you set `filesystem.allowGitConfig: true`, and denies `.mcp.json`, `.claude/commands`, `.claude/agents`, and shell startup files. * On macOS, these denies are checked when a write happens, so they also cover nested files and repositories created during the session. * On Linux and WSL2, the runtime builds the deny list once at launch. It reliably covers the project root, makes a best-effort shallow scan for nested copies that exist at that point, and does not cover anything the session creates later, such as `git init`, `git clone`, or scaffolding. The README’s `mandatoryDenySearchDepth` section describes the scan’s exact semantics. - * Without a valid `~/.srt-settings.json`, the runtime starts anyway, blocks network access, and confines writes to built-in runtime paths such as `/tmp/claude`, `~/.npm/_logs`, and `~/.claude/debug`. Don’t take a clean start as proof your settings loaded. - * When you pass `--settings`, the runtime refuses to start if the file fails to load. + * If `~/.srt-settings.json` doesn’t exist and you don’t pass `--settings`, the runtime starts anyway. It blocks network access and confines writes to built-in runtime paths such as `/tmp/claude`, `~/.npm/_logs`, and `~/.claude/debug`. Don’t take a clean start as proof your settings loaded. + * If the settings file exists but is empty, unreadable, or invalid, the runtime refuses to start, whether it’s `~/.srt-settings.json` or a file you pass with `--settings`. It also refuses to start if the `--settings` file doesn’t exist. Your write grants still include other paths Claude Code loads configuration from, so deny those with `denyWrite`. A sandboxed session that can write them can persist hooks, permission rules, or MCP servers that run unsandboxed the next time you launch Claude Code.
modified Configure the sandboxed Bash tool View current →
--- a/sandboxing.md +++ b/sandboxing.md @@ -430,6 +430,7 @@ * **Default write behavior** : read and write access to the current working directory and its subdirectories, any directories you’ve added with `--add-dir`, `/add-dir`, or [`permissions.additionalDirectories`](</docs/en/settings-reference#permissions-additionaldirectories>), plus the per-user temp directory that `$TMPDIR` points to * **Default read behavior** : read access to the entire computer, except certain denied directories. Note that this default still allows reading credential files such as `~/.aws/credentials` and `~/.ssh/`. Use `sandbox.credentials` to block reads of these files and unset secret environment variables, or add the paths to `denyRead`. + * **Read block** : with [`permissions.blockReadsOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockreadsoutsideworkingdirectories>) on, sandboxed commands also lose read access to your home directory and the other directories that hold user files, apart from the paths that [Sandboxed commands under the block](</docs/en/settings-reference#sandboxed-commands-under-the-block>) lists. That section also says when this part of the block doesn’t apply. * **Blocked access** : cannot modify files outside the working directory, added directories, and the per-user temp directory without explicit permission, including shell configuration files such as `~/.bashrc` and system binaries in `/bin/` * **Git worktrees** : when the working directory is a [linked git worktree](</docs/en/worktrees>), the sandbox also allows writes to the main repository’s shared `.git` directory so commands such as `git commit` can update refs and the index. Writes to `hooks/` and `config` inside that directory remain denied. * **Configurable** : define custom allowed and denied paths through settings @@ -446,7 +447,7 @@ * **In your working directory and the directories above it** : the `.claude` settings files, the `.claude/skills`, `.claude/agents`, `.claude/commands`, and `.claude/hooks` directories, `.mcp.json`, and the files Claude Code runs on its own, such as `.claude/workflows` and `.claude/scheduled_tasks.json` * **In your working directory only** : shell startup files such as `.bashrc` and `.zshrc`, `.gitconfig`, the `.vscode` and `.idea` directories, and `hooks` and `config` inside `.git` - * **Files that would turn your working directory into a bare git repository** : `HEAD`, `objects`, and `refs` at the top level, plus `config` and `hooks` there when a `HEAD` sits beside them. A file named `config` is denied even with no `HEAD`. On Linux and WSL2, the sandbox deletes a top-level `HEAD` file or `objects` or `refs` directory that appears while a sandboxed command is running + * **Files that would turn your working directory into a bare git repository** : `HEAD`, `objects`, and `refs` at the top level, plus existing `config` and `hooks` entries there when a `HEAD` sits beside them. A file named `config` is denied even with no `HEAD`. On Linux and WSL2, the sandbox deletes a top-level `HEAD` file or `objects` or `refs` directory that appears while a sandboxed command is running * **In`~/.claude`, or the directory `CLAUDE_CONFIG_DIR` points to**: most of its contents, plus `~/.claude.json` and the `.credentials.json` credential store If a symlink appears at a protected settings file’s path during the session, the sandbox also denies writes to the file it points to, starting with the next command. There is no way to exempt one of these paths: an `allowWrite` entry or an `Edit` allow rule that covers the path doesn’t lift the protection. The only way to turn the protection off is `filesystem.disabled`, which turns off filesystem isolation for every path. To see most of these paths resolved for your machine, run `/sandbox` and open the **Config** tab, which lists them under **Denied within allowed** , mixed in with your own `denyWrite` entries. If `git merge` or `git checkout` fails with `unable to unlink old` on one of these paths, see Troubleshooting.
modified Self-hosted environments View current →
--- a/self-hosted-environments.md +++ b/self-hosted-environments.md @@ -30,7 +30,7 @@ * **Zero Data Retention** : unavailable for organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled. * **Model inference** : sessions use the Anthropic API, and inference can’t be routed through [Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry](</docs/en/third-party-integrations>), or an [LLM gateway](</docs/en/llm-gateway>). * **Surfaces** : sessions started from [claude.ai/code](<https://claude.ai/code>), the mobile and desktop apps, [scheduled routines](</docs/en/routines>), and the terminal, with [`claude --cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-cloud>) or an [`--environment` dispatch](</docs/en/self-hosted-environments-testing#run-the-test-loop>), can run in self-hosted environments. [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions can run in them too, but Claude can’t use [Access bundles](<https://claude.com/docs/claude-tag/concepts/glossary#access-bundle>) in those sessions yet. [Claude Security](</docs/en/claude-security>) and [Code Review](</docs/en/code-review>) sessions don’t route to them yet. Support for those two surfaces follows separately. - * **Repositories** : sessions check out repositories from GitHub; see [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>). + * **Repositories** : sessions check out repositories from GitHub; see [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>). For a GitHub Enterprise Server host, see its [network requirements](</docs/en/github-enterprise-server#network-requirements>). * **Billing** : sessions in a self-hosted environment consume your organization’s Claude Code usage the same way sessions in Anthropic-hosted environments do. ##
modified Deploy self-hosted environments to production View current →
Show diff (149 lines)
--- a/self-hosted-environments-deploy.md +++ b/self-hosted-environments-deploy.md @@ -162,7 +162,7 @@ * The runner sets `GCM_INTERACTIVE=never`, so Git Credential Manager doesn’t open a sign-in dialog. * The runner clears `core.askPass`, so if you use an askpass helper, set it through the `GIT_ASKPASS` environment variable instead. -If your git host rejects the credential, or you didn’t configure one, the runner retries a few times and then fails repository preparation when the repository is the one the session pushes results to. For a repository the session only reads from, Troubleshooting covers when the runner skips it instead. The runner doesn’t pass these settings into the session’s environment. If checkout directories are owned by a different uid than the runner process, git refuses to operate on them; add `safe.directory`: +If your git host rejects the credential, or you didn’t configure one, the runner retries a few times and then fails repository preparation when the repository is the one the session pushes results to. For a repository the session only reads from, Troubleshooting covers when the runner skips it instead. The runner doesn’t pass these settings into the session’s environment. Keep any program you name in `GIT_SSH_COMMAND` or `GIT_ASKPASS` where sessions can’t write to it, the way the hardening checklist asks for the hooks directory and the wrapper script. The same goes for any key or file on that program’s command line. The runner’s own git runs that program when it clones or fetches. If checkout directories are owned by a different uid than the runner process, git refuses to operate on them; add `safe.directory`: RUN git config --system --add safe.directory '*' @@ -172,7 +172,36 @@ Use the Anthropic git proxy -Start the runner with `--use-anthropic-git-proxy`, or set `CLAUDE_RUNNER_USE_GIT_PROXY=1`, to have it clone through Anthropic’s git proxy, authenticated with the session’s own short-lived token. For ordinary user sessions, the proxy uses the GitHub or GitHub Enterprise OAuth token stored for the session creator; for bot and agent sessions, it uses your organization’s GitHub App installation token. Either way, the runner image needs no git credentials at all: no SSH keys, no credential helper, no `.netrc`. This is the same auth path Anthropic-hosted environments use. The proxy requires `--capacity 1` because the proxy URL is per-session, and git 2.32 or later because older git ignores the configuration mechanism the proxy uses to isolate sessions from each other. The runner refuses to start if either requirement is unmet. Because the proxy fetches from Anthropic’s side, your git host must be reachable from Anthropic infrastructure, the same requirement Anthropic-hosted sessions have; for a git host that’s only routable inside your network, use a [`checkout` lifecycle hook](</docs/en/self-hosted-environments-configuration#checkout>) instead. Each runner process handles one session at a time, so run more replicas for parallelism. When the proxy is enabled, `--git-host-rewrite` and `--git-ssh-rewrite` have no effect: the proxy URL points at `api.anthropic.com`, not your git host. 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. +Start the runner with `--use-anthropic-git-proxy`, or set `CLAUDE_RUNNER_USE_GIT_PROXY=1`, to have it clone through Anthropic’s git proxy, authenticated with the session’s own short-lived token. For ordinary user sessions, the proxy uses the GitHub or GitHub Enterprise OAuth token stored for the session creator; for bot and agent sessions, it uses your organization’s GitHub App installation token. Either way, the runner image needs no git credentials at all: no SSH keys, no credential helper, no `.netrc`. This is the same auth path Anthropic-hosted environments use. The proxy requires `--capacity 1` because the proxy URL is per-session, and git 2.32 or later because older git ignores the configuration mechanism the proxy uses to isolate sessions from each other. The runner refuses to start if either requirement is unmet. Because the proxy fetches from Anthropic’s side, your git host must be reachable from Anthropic infrastructure, the same requirement Anthropic-hosted sessions have; for a git host that’s only routable inside your network, use a [`checkout` lifecycle hook](</docs/en/self-hosted-environments-configuration#checkout>) instead. Each runner process handles one session at a time, so run more replicas for parallelism. When the proxy is enabled, `--git-host-rewrite` and `--git-ssh-rewrite` have no effect: the proxy URL points at `api.anthropic.com`, not your git host. + +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. + +#### + +​ + +Trust a private certificate authority with Anthropic-managed git + +This section applies if you set `GIT_SSL_CAINFO` or `GIT_SSL_NO_VERIFY` in the environment of a runner whose sessions use Anthropic-managed git. The handling it describes requires the runner to run Claude Code v2.1.283 or later. When git on the runner must trust a private certificate authority (CA), such as the one a TLS-inspecting proxy signs with, the usual approaches work out as follows: + + * **System certificate store** : install your CA in the runner host’s system certificate store, and git trusts it without either variable. + * **`GIT_SSL_CAINFO`** : set it to a PEM file of your CAs, for example `GIT_SSL_CAINFO=/etc/ssl/corp-ca.pem`. + * **`GIT_SSL_NO_VERIFY`** : doesn’t help behind a re-signing proxy. The runner’s own clone through Anthropic-managed git checks certificates even when the variable is set, so that clone fails until git trusts your CA through one of the other two approaches. + +For git connections that carry a session’s token to Anthropic-managed git, the runner applies the two variables as follows. A [`command` hook](</docs/en/self-hosted-environments-configuration#command>) starts with the session’s environment, so it gets what git inside the session gets: + + * **`GIT_SSL_CAINFO`** : what git checks Anthropic-managed git against depends on where git runs: + * **Runner’s own clone and fetches** : run without the variable and check Anthropic-managed git against a per-session certificate file the runner writes. That file holds the runner host’s system CA bundle plus the certificates from your file. + * **Git inside the session** : gets `http.sslCAInfo` configuration naming your file in place of the variable, plus `http.<url>.sslCAInfo` entries that check Anthropic-managed git against the per-session file. + * **`checkout` and `post-session` hooks**: inherit the variable unchanged. + * **`GIT_SSL_NO_VERIFY`** : which certificate checks stay off depends on where git runs: + * **Runner’s own clone and fetches** : run without the variable and check the certificate they’re presented. + * **Git inside the session** : gets `http.sslVerify=false` configuration in place of the variable, so checks stay off for other hosts. It also gets `http.<url>.sslVerify=true` entries that keep checks on for Anthropic-managed git. + * **`checkout` and `post-session` hooks**: when the session has a repository on Anthropic-managed git, get `http.sslVerify=false` configuration in place of the variable. They also get `http.<url>.sslVerify=true` entries that keep checks on for Anthropic-managed git. + +The per-session certificate file needs a system CA bundle at `/etc/ssl/certs/ca-certificates.crt` or `/etc/pki/tls/certs/ca-bundle.crt` on the runner host. It also needs a `GIT_SSL_CAINFO` file that the runner’s user can read, that holds PEM `CERTIFICATE` blocks, and that is at most 1 MiB. When the runner can’t build the per-session file, it logs a `[runner:warn]` line containing `did not build the certificate file` and the reason. Git then uses your file as it is for Anthropic-managed git. Fix what the line names. For each session that uses Anthropic-managed git, the runner also logs a `[runner:warn]` line that begins `governed git: GIT_SSL_CAINFO is set` or `governed git: GIT_SSL_NO_VERIFY is set`. The line says what the runner did with that variable for its own git, for git inside the session, and for your lifecycle hooks. It ends with whether you need to change anything. ### @@ -193,7 +222,7 @@ Build the runner image -Anthropic doesn’t publish a pre-built runner image. Build your own around the `claude` binary, layering in whatever toolchain your repositories need: language runtimes, compilers, package managers, and [MCP](</docs/en/mcp>) sidecars. The recipes below use `--capacity 4`, so one container serves up to four concurrent sessions from the same locked owner. That doesn’t provide the per-session container isolation in the hardening section: before connecting an environment to production systems, either run the recipes at `--capacity 1` with one container per session, or use [on-demand runners](</docs/en/self-hosted-environments-configuration#on-demand-runners>), which also keep the environment secret off session-running hosts. This Dockerfile is a minimal starting point: +Anthropic doesn’t publish a pre-built runner image. Build your own around the `claude` binary, layering in whatever toolchain your repositories need: language runtimes, compilers, package managers, and [MCP](</docs/en/mcp>) sidecars. The recipes below use `--capacity 4`, so one container serves up to four concurrent sessions from the same locked owner. That doesn’t provide the per-session container isolation in the hardening section: before connecting an environment to production systems, either run the recipes at `--capacity 1` with one container per session, or use [on-demand runners](</docs/en/self-hosted-environments-configuration#on-demand-runners>), which also keep the environment secret off session-running hosts. If you add the Anthropic git proxy to one of these recipes, also change `--capacity` to `1`. This Dockerfile is a minimal starting point: FROM debian:bookworm-slim ARG CLAUDE_CODE_VERSION @@ -312,7 +341,7 @@ Docker Compose -The Compose service below restarts the runner whenever it exits, which covers both crashes and the normal exit after draining. A Docker restart policy restarts the same container with its writable layer intact, so the runner comes back on a reused filesystem rather than the fresh one the hardening posture recommends; use this recipe for evaluation, and for production either recreate the container per run or use an orchestrator that does. +The Compose service below restarts the runner whenever it exits, which covers both crashes and the normal exit after draining. A Docker restart policy restarts the same container with its writable layer intact, so the runner comes back on a reused filesystem rather than the fresh one the hardening posture recommends; use this recipe for evaluation, and for production either recreate the container per run or use an orchestrator that does. Docker waits longer before each restart of a container that keeps exiting, up to a ceiling, so a runner that can’t start doesn’t keep restarting in a tight loop under this recipe. When the runner exits describes what to check when that happens. services: claude-runner: @@ -423,7 +452,7 @@ Pin the version -Each session’s child Claude Code process runs the runner’s own binary, and the runner turns off auto-update inside the sessions it spawns, so every session runs the version you installed on the host or built into the image. A host-level update takes effect the next time the runner starts. +Each session’s child Claude Code process runs the runner’s own binary, and the runner turns off auto-update inside the sessions it spawns, so every session runs the version you installed on the host or built into the image. A host-level update takes effect the next time the runner starts. A model your sessions use can require a newer Claude Code version than the one they run. The server then rejects requests for that model with [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>). Before you pin a version, check [the Claude Code versions that models require](</docs/en/model-config#available-models>) for every model your sessions use. * **To hold a fleet on one version** : build the image with a pinned version, or on a bare host install a specific version and [disable auto-updates](</docs/en/setup#disable-auto-updates>) * **To upgrade** : install the newer version or rebuild the image, then restart the runners @@ -520,6 +549,72 @@ Once logging is initialized, the runner writes its lifecycle log, including `[runner:fatal]` lines, to stdout, and debug output to stderr, all as plain-text lines rather than JSON. The startup failures described in the troubleshooting entries above print to stderr before that point. Capture both streams with `--log-file`, which also lets `self-hosted-runner doctor` tail them, or with your platform’s log collection. Each session’s child process writes a separate debug log. On failure the runner surfaces the log’s tail alongside the session in claude.ai/code. Unless you started the runner with [`--remove-session-state`](</docs/en/self-hosted-environments-reference#runner-cli-flags>), it also keeps a failed session’s log on disk and prints its path in the runner log. +### + +​ + +When the runner exits + +Don’t restart an [on-demand runner](</docs/en/self-hosted-environments-configuration#on-demand-runners>), because its work order is single-use. A runner that exits right after it starts needs different handling from one that exits for any other reason. + + * **A normal exit** : the runner finished its sessions and drained, reached its retire time, or was told to stop. Restart it so the environment has capacity again. [Runner lifecycle](</docs/en/self-hosted-environments#runner-lifecycle>) describes these exits. + * **A failed start** : the runner can’t start with the configuration or host it was given, so it exits seconds after it starts, and it exits the same way every time you restart it. Restarting it faster doesn’t help. Someone needs to read its output and fix the cause. + +Configure your supervisor to restart the runner whenever it exits, to wait longer between restarts when the runner keeps exiting right after it starts, and to tell someone when that keeps happening. + +#### + +​ + +Recognize a failed start + +When the runner can’t start, it prints a line that says why, and then it exits. For most causes the line contains `[runner:fatal]`. For some causes the line begins with `error:` instead, including when the runner can’t parse its flags, can’t read the environment secret, or can’t create or write to the base directory. The next line then points to `--help`. Most log lines start with a timestamp and `[self-hosted-runner]`, which the sample below leaves out. For example, a runner started with the Anthropic git proxy and a capacity above one prints a line like this one: + + [runner:fatal] --use-anthropic-git-proxy requires --capacity 1 (the proxy URL is per-session and linked worktrees share origin). Omit --use-anthropic-git-proxy or set --capacity 1. + +Look for the line in the runner’s standard output and standard error, in your platform’s container logs, or in the file you set with [`--log-file`](</docs/en/self-hosted-environments-reference#runner-cli-flags>). The runner prints an `error:` line before it opens the log file, so look for it in the terminal or your container logs, as Troubleshooting notes. These also help when you read a failed start: + + * **No line at all** : a runner that the host kills prints neither. If the output ends with no `[runner:fatal]` line and no `error:` line, check whether the host or your orchestrator stopped the process, for example for exceeding a memory limit. + * **The exit code** : the runner doesn’t set aside an exit code for errors that repeat on every start. It exits with the same code for a configuration error, such as an unsupported combination of flags, and for a failure that can clear by itself, such as the API staying unreachable through the runner’s own retries. Base the decision to wait longer on how soon the runner exited, and read the runner’s output to learn why. + * **An environment that looks healthy** : some startup steps run after the runner registers with your environment, such as `--configure-git` and the Anthropic git proxy’s credential setup. If one of those steps fails, the environment can go on listing that runner for a few minutes after the process has exited, and the **Cloud environments** page can read **Healthy** while no runner is picking up work. If sessions stay queued in an environment that looks healthy, check whether your supervisor is restarting the runner. + +#### + +​ + +Restart with a wait that grows + +How you get a growing wait depends on your supervisor. + + * **Kubernetes** : the Deployment on this page needs no change. After a container exits, the kubelet by default waits before it restarts the container, and the wait grows on each restart up to a ceiling. The wait starts over once the container has run for a while without exiting. The kubelet applies the same wait after a normal exit when the container ran only briefly. A runner that drains often can therefore show the `CrashLoopBackOff` status too, so read the output before you conclude that the runner can’t start. The command below reads the last run’s output from one pod of the Deployment: + + kubectl logs --previous -n claude-runners deploy/claude-runner + +When the last run was a failed start, the `[runner:fatal]` or `error:` line is among the last lines of the output. To read another pod’s last run, name that pod in place of `deploy/claude-runner`. + * **Docker and Docker Compose** : the Compose recipe on this page needs no change. With `restart: always`, Docker waits longer before each restart of a container that keeps exiting, up to a ceiling. Replace `<container>` with the container’s name in the command below, which reads how many times Docker has restarted the container: + + docker inspect --format '{{.RestartCount}}' <container> + +The command prints a number. A number that keeps climbing means Docker keeps restarting the runner. + * **A systemd unit** : by default systemd waits the same `RestartSec` before every restart and doesn’t lengthen it, so a unit with `Restart=always` restarts a runner that can’t start at that same interval each time. When the starts come fast enough to reach the unit’s start rate limit, five starts in 10 seconds by default, systemd stops restarting the unit. The unit stays stopped until someone starts it again, which systemd allows once the rate limit’s interval has passed or after `systemctl reset-failed`. Because `RestartSec` applies to every restart, a longer value also delays the restart after a normal exit. Choose a value that balances the two, and alert on the unit’s restart count. + * **A shell loop or your own supervisor** : apply the same rule yourself. Start with a wait of five seconds. After each run that ended within a minute, double the wait for the next restart, up to five minutes. After a run that lasted a minute or more, go back to five seconds. + +#### + +​ + +Check why the runner keeps exiting + +When the runner has exited right after starting several times in a row, stop and check these before restarting it again. + + * **The last`[runner:fatal]` or `error:` line**: it says why the runner stopped. Troubleshooting lists the common causes. + * **The combination of flags** : the Anthropic git proxy requires `--capacity 1`. The recipes on this page use a higher capacity, so lower it when you add the proxy to one of them. + * **What the service’s environment can reach** : if the runner starts by hand and fails under your supervisor, compare the user, the home directory, the `PATH`, and the memory limit. `--configure-git` and the Anthropic git proxy need git on the `PATH` and a writable `~/.gitconfig`. + * **The environment secret** : if you revoked the secret or mistyped it, the runner prints a line that contains `RegisterRunner auth failed`. + * **The environment’s Activity tab** : open the environment and select **Activity**. If new runners keep appearing there and none picks up work, your supervisor is restarting the runner. + +For guided diagnosis on the runner host, run the doctor subcommand. + ## ​
modified Self-hosted environments quickstart View current →
--- a/self-hosted-environments-quickstart.md +++ b/self-hosted-environments-quickstart.md @@ -93,7 +93,7 @@ Start a session at claude.ai/code and select your environment from the environment picker, where self-hosted environments appear alongside Anthropic-hosted ones. The runner clones with whatever git credentials the host already has, so pick a repository this host can already clone, or a public one; credential options for private repositories in production are on [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>). The next available runner picks up the queued session and logs `Picked up session <session-id>` along with its active count and capacity, so you can confirm from the runner’s own output which host took the session. Watch the session work and read Claude’s replies at [claude.ai/code](<https://claude.ai/code>). If the session sits queued instead, see [Troubleshooting](</docs/en/self-hosted-environments-deploy#troubleshooting>). -The runner exits by design once its active sessions finish; see [Runner lifecycle](</docs/en/self-hosted-environments#runner-lifecycle>). For production, deploy it under an orchestrator that restarts it on exit. See [Deploy to production](</docs/en/self-hosted-environments-deploy>). +The runner exits by design once its active sessions finish; see [Runner lifecycle](</docs/en/self-hosted-environments#runner-lifecycle>). For production, deploy it under an orchestrator that restarts it on exit and waits longer between restarts when the runner keeps exiting right after it starts. See [Deploy to production](</docs/en/self-hosted-environments-deploy>) and [When the runner exits](</docs/en/self-hosted-environments-deploy#when-the-runner-exits>). ##
modified Self-hosted environments reference View current →
--- a/self-hosted-environments-reference.md +++ b/self-hosted-environments-reference.md @@ -74,17 +74,17 @@ SCM connector flags -The orchestrator can hold a standing WebSocket connection to Anthropic’s control plane so that hosted pre-session flows, such as the repository picker and the branch or ref resolver, can reach a GitHub Enterprise Server host that’s only routable from inside your network. The connector stays off unless you set `--scm-connector-host`. +The SCM connector isn’t available, so leave the flags in this section unset. If you set `--scm-connector-host`, the connection doesn’t open, and the orchestrator keeps retrying it. Runners still start as sessions queue. The connector is a standing WebSocket connection from the orchestrator to Anthropic’s control plane. It’s designed to let hosted pre-session flows, such as the repository picker and the branch or ref resolver, reach a GitHub Enterprise Server host that’s only routable from inside your network. See [Network requirements](</docs/en/github-enterprise-server#network-requirements>) on the GitHub Enterprise Server page for what those flows need. Flag| Default| Description ---|---|--- -`--scm-connector-host <host[:port]>`| unset| GitHub Enterprise Server hostname to forward requests to. Port defaults to `443`. Setting this flag enables the connector. -`--scm-connector-id <n>`| required with `--scm-connector-host`| The numeric ID of your organization’s GitHub Enterprise Server connection. Contact your Anthropic account team for the value when you enable the connector. +`--scm-connector-host <host[:port]>`| unset| GitHub Enterprise Server hostname to forward requests to. Port defaults to `443`. +`--scm-connector-id <n>`| required with `--scm-connector-host`| The numeric ID of your organization’s GitHub Enterprise Server connection. `--scm-connector-provider <slug>`| `ghe`| Path segment identifying the provider, matching `^[a-z0-9-]{1,32}$`. `--scm-connector-ca-file <path>`| unset| Extra CA bundle, in PEM format, for TLS connections to the GitHub Enterprise Server host. `--scm-connector-host-rewrite <from>=<to_host:to_port>`| unset| For end-to-end testing only: redirects the TCP connection while keeping the Host header and TLS SNI as `--scm-connector-host`. -The connector authenticates with the orchestrator’s existing environment secret and reconnects automatically: with exponential backoff on a dropped connection, or a fixed 30-second delay when the control plane closes the connection because another orchestrator replica already holds it. +On each connection attempt the orchestrator sends its existing environment secret, and it retries automatically with exponential backoff, capped at 30 seconds plus jitter. ##
modified Configure server-managed settings View current →
--- a/server-managed-settings.md +++ b/server-managed-settings.md @@ -268,7 +268,7 @@ * **An interactive session that can’t show the dialog** : Claude Code doesn’t apply the delivered settings and keeps the last-approved settings. The dialog appears in the next session that can show it. Requires Claude Code v2.1.211 or later. * **`claude install` or `claude update`**: Claude Code doesn’t show the dialog during either command. The command runs with the last-approved settings, and the dialog appears in your next interactive session. If Claude Code waits for the settings fetch at startup, such as with `forceRemoteSettingsRefresh` set or on a [Claude apps gateway](</docs/en/claude-apps-gateway>) deployment, it shows the dialog during the command instead, and an install run from a pipe fails; see [`Raw mode is not supported` during install](</docs/en/troubleshoot-install#raw-mode-is-not-supported-during-install>). Before v2.1.246, Claude Code tried to show the dialog during these commands too. * **An error closes the dialog before you answer** : Claude Code doesn’t apply the delivered settings and keeps the last-approved settings. It shows the dialog again in the next session that can show it. - * **A non-interactive run** , such as `claude -p` or an Agent SDK session: Claude Code can’t show the dialog, so when the delivered settings would require approval, it applies them for that run only. It doesn’t record them as approved or write them to the local cache, and the next interactive session shows the dialog. Until a user approves in an interactive session, each non-interactive run fetches the settings again at startup. Before v2.1.207, a non-interactive run saved the settings as approved, so later interactive sessions never showed the dialog for them. + * **A non-interactive run** , such as `claude -p`, an Agent SDK session, or a session in the VS Code extension’s chat panel or the desktop app’s Code tab: Claude Code can’t show the dialog, so when the delivered settings would require approval, it applies them for that run only. It doesn’t record them as approved or write them to the local cache, and the next interactive session shows the dialog. Until a user approves in an interactive session, each non-interactive run fetches the settings again at startup. Before v2.1.207, a non-interactive run saved the settings as approved, so later interactive sessions never showed the dialog for them. ####
modified All settings View current →
Show diff (174 lines)
--- a/settings-reference.md +++ b/settings-reference.md @@ -14,6 +14,7 @@ `agent`| Start every session as a named [subagent](</docs/en/sub-agents>) with its prompt, tools, and model| Agents, sessions, and worktrees| Any file `agentPushNotifEnabled`| Let Claude send a [push notification to your phone](</docs/en/remote-control#mobile-push-notifications>) when it decides to| Remote, desktop, and notifications| Any file `allowAllClaudeAiMcps`| Load the [claude.ai connectors](</docs/en/mcp>) Claude Code fetches itself alongside a deployed [`managed-mcp.json`](</docs/en/managed-mcp#exclusive-control-with-managed-mcp-json>)| MCP| Managed +`allowClaudeInChromeWithManagedMcp`| Let the built-in [Claude in Chrome](</docs/en/chrome>) server run alongside a deployed [`managed-mcp.json`](</docs/en/managed-mcp#exclusive-control-with-managed-mcp-json>)| MCP| Managed `allowedChannelPlugins`| Replace the default allowlist of [channel plugins](</docs/en/channels#restrict-which-channel-plugins-can-run>) that can push messages| Plugins and skills| Managed `allowedHttpHookUrls`| Limit which URLs [HTTP hooks](</docs/en/hooks>) can target| Hooks and automation| Any file `allowedMcpServers`| Allowlist which [MCP servers](</docs/en/mcp>) users can add| MCP| Any file @@ -1117,13 +1118,18 @@ `permissions.blockReadsOutsideWorkingDirectories` -Stop Claude from reading paths outside the session’s [working directories](</docs/en/permissions#working-directories>) with the Read, Grep, Glob, and LSP tools, in every permission mode including `bypassPermissions`. A Bash command that reads a matching path through a file command Claude Code recognizes, such as `cat`, prompts you even in auto mode and `bypassPermissions` mode. Requires Claude Code v2.1.257 or later. A Bash command the shell parser can’t trace, such as one that changes directory more than once or runs a subshell, prompts you even in auto mode and `bypassPermissions` mode. The prompt appears even when the command names no path outside the working directories. This prompt doesn’t apply when the command runs in the [sandbox](</docs/en/sandboxing>) and the sandbox enforces the block. Claude Code also writes `true` here when you choose to block such reads on [auto mode’s prompt before the first read outside the working directories](</docs/en/permission-modes#first-read-outside-the-working-directories>). - - * **Scope** : `Any file`. If any settings source sets `true`, the block applies, so a repository’s checked-in file can turn the block on for a project but can’t lift a block you set. - * **Type** : Boolean - * `true`: file reads outside the working directories are blocked - * `false`: the same as unset; a `true` in any other settings file still blocks - * **Default** : unset, so reads outside the working directories follow your permission mode and rules +Make Claude’s file tools refuse reads outside your [working directories](</docs/en/permissions#working-directories>) in every permission mode, including `bypassPermissions`. Claude Code denies `Read`, `Grep`, `Glob`, and `LSP` calls on those paths and tells Claude to ask you to add the directory with `/add-dir`. Files Claude Code itself needs stay readable, such as your skills, plugins, rules, agents, commands, and the `CLAUDE.md` memory file under `~/.claude/`. Requires Claude Code v2.1.257 or later. Claude Code doesn’t refuse shell commands the same way: + + * [Actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) covers when a shell command that reads such a path prompts you + * Sandboxed commands under the block covers what a sandboxed command can read + +A Bash command the shell parser can’t trace, such as one that changes directory more than once or runs a subshell, prompts you even in auto mode and `bypassPermissions` mode. The prompt appears even when the command names no path outside the working directories. This prompt doesn’t apply when the command runs in the [sandbox](</docs/en/sandboxing>) and the sandbox enforces the block. Claude Code also writes `true` here when you choose to block such reads on [auto mode’s prompt before the first read outside the working directories](</docs/en/permission-modes#first-read-outside-the-working-directories>). + + * **Scope** : `Any file`. A `true` in any file applies, so a repository can turn the block on for itself but can’t lift yours. + * **Type** : Boolean + * `true`: Claude’s file tools refuse reads outside the working directories + * `false`: the same as unset; the block still applies if another file sets `true` + * **Default** : unset, so reads outside the working directories follow your [permission mode](</docs/en/permission-modes>) settings.json @@ -1133,7 +1139,27 @@ } } -If only a repository’s checked-in settings file adds a directory, the block still applies to reads there. When `autoMemoryDirectory` comes from the project’s `.claude/settings.json`, or from a `.claude/settings.local.json` [treated as repository-supplied](</docs/en/permissions#when-your-local-settings-file-needs-trust>), Claude Code loads no [auto memory](</docs/en/memory#storage-location>) from that directory and saves none to it. Files Claude Code itself needs stay readable, such as your skills, plugins, rules, agents, commands, and the `CLAUDE.md` memory file under `~/.claude/`. When the [sandbox](</docs/en/sandboxing>) is on, the block also denies sandboxed commands read access to home directories and mounted-volume roots outside the working directories. A retry that needs approval to [run outside the sandbox](</docs/en/sandboxing#the-unsandboxed-retry-escape-hatch>) prompts you even in `bypassPermissions` mode. Files a tool reads from your home directory, such as `~/.gitconfig`, are denied with the rest; re-open a specific path with `sandbox.filesystem.allowRead` when a tool needs it. When the session’s working directory is a linked [git worktree](</docs/en/worktrees>), including one Claude Code entered mid-session, the repository’s common `.git` directory stays readable and writable to sandboxed commands, so git keeps working there. +Directories you add with `--add-dir`, `/add-dir`, or `additionalDirectories` in your user or managed settings count as working directories for the block. Directories added only in repository settings don’t count: those in `.claude/settings.json`, and those in `.claude/settings.local.json` unless git reports that file as untracked. In a directory that isn’t a git repository, or when git tracks the file, Claude Code treats `.claude/settings.local.json` as repository settings, so put directories you want to keep readable in your user settings instead. When `autoMemoryDirectory` comes from the project’s `.claude/settings.json`, or from a `.claude/settings.local.json` [treated as repository-supplied](</docs/en/permissions#when-your-local-settings-file-needs-trust>), Claude Code loads no [auto memory](</docs/en/memory#storage-location>) from that directory and saves none to it. To lift the block, remove the key from every settings file that sets it, then start a new session. + +#### + +​ + +Sandboxed commands under the block + +When [sandboxing](</docs/en/sandboxing>) is on, the block also covers sandboxed commands. Claude Code denies them read access to your home directory and to the other roots that hold user files: `/Users`, `/home`, `/root`, `/Volumes`, `/mnt`, `/media`, `/run/media`, and `/srv`. It then re-opens the working directories, [worktrees](</docs/en/worktrees>) Claude Code creates in the session, the session temp directory, and the parts of `~/.claude` that commands need, such as skills and plugins. While the block is in force, `allowRead` and `allowWrite` entries from repository settings don’t count. When the session’s working directory is a linked [git worktree](</docs/en/worktrees>), including one Claude Code entered mid-session, the repository’s common `.git` directory stays readable and writable to sandboxed commands, so git keeps working there. In these cases the block doesn’t reach sandboxed commands, while Claude’s file tools keep enforcing it: + + * Filesystem isolation is off through `sandbox.filesystem.disabled` + * `allowManagedReadPathsOnly` is set + * The path of the directory you started Claude Code in contains a glob character such as `*`, `?`, or `[` + +Under the block, Claude Code re-opens your global git configuration files to sandboxed commands so `git` keeps your identity and settings: + + * `~/.gitconfig` + * The `config`, `ignore`, and `attributes` files under `$XDG_CONFIG_HOME/git`, which defaults to `~/.config/git` + * Files your global git configuration names through `[include]`, `[includeIf]`, `core.excludesFile`, or `core.attributesFile` + +Claude Code judges each file separately. When a file lies where a sandboxed command can write, directly or through a symlink, Claude Code doesn’t re-open the files it names. On Linux and WSL2, a configuration file that is a symlink can stay unreadable at its own path, and `git` then runs without it. `~/.git-credentials` and `$XDG_CONFIG_HOME/git/credentials` stay blocked. If a re-opened file holds a secret, such as an `http.extraHeader` token, add its path to `sandbox.filesystem.denyRead`. A `denyRead` entry that covers a file always takes precedence over this re-open. ### @@ -1148,7 +1174,7 @@ * `"default"`: Claude Code runs only reads without asking * `"acceptEdits"`: Claude Code also runs file edits and common filesystem commands such as `mkdir` and `mv` without asking * `"plan"`: Claude Code reads and plans but blocks edits until you approve a plan - * `"auto"`: Claude Code runs everything, with background safety checks + * `"auto"`: Claude Code runs without routine prompts; before actions such as shell commands and network requests run, a background classifier checks that they align with your request * `"dontAsk"`: Claude Code auto-denies every call that would otherwise prompt; reads, other actions that need no approval, and pre-approved tools still run * `"bypassPermissions"`: Claude Code runs everything without asking * `"manual"`: an alias for `"default"`, in Claude Code v2.1.200 or later @@ -1474,7 +1500,7 @@ } } -Claude Code merges entries across every settings scope the session loads: user, project, local, and managed paths combine rather than replace each other, and Claude Code adds the paths from your `Edit(...)` allow permission rules. An `allowWrite` entry can’t lift a [protected path](</docs/en/sandboxing#protected-paths>). +Claude Code merges `allowWrite` entries and the paths from your `Edit(...)` allow permission rules across every settings scope the session loads, leaving out the ones from repository settings while `permissions.blockReadsOutsideWorkingDirectories` is on. An `allowWrite` entry can’t lift a [protected path](</docs/en/sandboxing#protected-paths>). ### @@ -1551,7 +1577,7 @@ } } -Claude Code resolves a `.` entry to the project root in project settings and to `~/.claude` in user settings. Claude Code merges entries across every settings file the session loads unless `allowManagedReadPathsOnly` is set. +Claude Code resolves a `.` entry to the project root in project settings and to `~/.claude` in user settings. Claude Code merges entries across every settings file the session loads unless `allowManagedReadPathsOnly` is set, and leaves out entries from repository settings while `permissions.blockReadsOutsideWorkingDirectories` is on. ### @@ -2534,6 +2560,7 @@ How `env` values interact with your shell * A value here overwrites the same variable exported in your shell, and when more than one settings file sets a variable, the [highest-precedence](</docs/en/settings#settings-precedence>) one applies. Variables Claude Code ignores in `env` lists the exceptions for project and local settings. + * When the Claude Desktop app or a [self-hosted environment](</docs/en/self-hosted-environments>) runner starts the session, the launch environment it builds takes precedence instead: Claude Code ignores an `env` value from any settings file for a variable the launch environment already sets. The [debug log](</docs/en/debug-your-config>) names each ignored variable. * To cancel a shell export, set the variable to `""`. Claude Code treats an empty value as unset for provider selection, and subprocesses inherit the empty value. * `NO_COLOR` and `FORCE_COLOR` set here reach only subprocesses. To change Claude Code’s own interface colors, set them in your shell before launching `claude`. * Values here are plain text in the settings file and reach every subprocess Claude Code starts. For an OTLP bearer token that rotates, use `otelHeadersHelper`; for API credentials, use `apiKeyHelper`. @@ -4470,7 +4497,7 @@ `strictPluginOnlyCustomization.skills` -Lock the `skills` surface. Claude Code stops loading skills from `~/.claude/skills/` and `.claude/skills/`, custom commands from `~/.claude/commands/` and `.claude/commands/`, skills under `--add-dir` directories, and skills synced from your claude.ai account, and keeps loading plugin skills, bundled skills, and skills in the managed policy directory. +Lock the `skills` surface. Claude Code stops loading skills from `~/.claude/skills/` and `.claude/skills/`, custom commands from `~/.claude/commands/` and `.claude/commands/`, skills and commands under `--add-dir` directories, and skills synced from your claude.ai account. It keeps loading plugin skills, bundled skills, and skills in the managed policy directory. * **Scope** : `Managed` * **Type** : the string `"skills"` in the `strictPluginOnlyCustomization` array @@ -4488,7 +4515,7 @@ `strictPluginOnlyCustomization.agents` -Lock the `agents` surface. Claude Code stops loading agents from `~/.claude/agents/` and `.claude/agents/`, and keeps loading plugin agents, built-in agents, and agents in the managed policy directory. +Lock the `agents` surface. Claude Code stops loading agents from `~/.claude/agents/`, `.claude/agents/`, and `--add-dir` directories. It keeps loading plugin agents, built-in agents, and agents in the managed policy directory. * **Scope** : `Managed` * **Type** : the string `"agents"` in the `strictPluginOnlyCustomization` array @@ -4729,9 +4756,31 @@ ​ +`allowClaudeInChromeWithManagedMcp` + +Let the built-in [Claude in Chrome](</docs/en/chrome>) server run alongside a deployed `managed-mcp.json`. Without this key, a deployed `managed-mcp.json` blocks Claude in Chrome in terminal sessions. Requires Claude Code v2.1.282 or later. + + * **Scope** : `Managed`, from the device’s own managed settings only: an MDM-deployed plist or HKLM registry key, or a system `managed-settings.json` file. Claude Code ignores it in server-managed settings, in the user-writable HKCU registry, and in user or project settings. + * **Type** : Boolean + * `true`: the built-in Claude in Chrome server can run alongside a deployed `managed-mcp.json` + * `false`: a deployed `managed-mcp.json` blocks Claude in Chrome in terminal sessions + * **Default** : `false`, so a deployed `managed-mcp.json` blocks Claude in Chrome in terminal sessions + +managed-settings.json + + { + "allowClaudeInChromeWithManagedMcp": true + } + +A `deniedMcpServers` entry for `claude-in-chrome` still blocks the server with this key on. See [Allow Claude in Chrome alongside the managed set](</docs/en/managed-mcp#allow-claude-in-chrome-alongside-the-managed-set>). + +### + +​ + `allowedMcpServers` -Allowlist the MCP servers people can add. Claude Code blocks any server that doesn’t match an entry wherever it’s defined, including plugin servers, servers passed with `--mcp-config`, and servers from claude.ai. Built-in servers such as Claude in Chrome, the `ide` server Claude Code connects to in a running [VS Code](</docs/en/vs-code#the-built-in-ide-mcp-server>) or [JetBrains](</docs/en/jetbrains#the-built-in-ide-mcp-server>) IDE, and servers the CLI itself configures are exempt from the allowlist, and the denylist still applies to them. In-process `type: "sdk"` servers are exempt from both lists; the [app that started the session](</docs/en/mcp#how-connectors-reach-claude-code>) registers them. Servers your organization delivers are also exempt from the allowlist, and the denylist still applies to them. The exemption covers every `managedMcpServers` entry, and any [`managed-mcp.json`](</docs/en/managed-mcp#exclusive-control-with-managed-mcp-json>) entry whose values use no `${VAR}` expansion. See [How a server is evaluated](</docs/en/managed-mcp#how-a-server-is-evaluated>) for the full check order. Before v2.1.259, servers from `managed-mcp.json` had to match too. +Allowlist the MCP servers people can add. Claude Code blocks any server that doesn’t match an entry wherever it’s defined, including plugin servers, servers a user passes with `--mcp-config`, and servers from claude.ai. Built-in servers such as Claude in Chrome, the `ide` server Claude Code connects to in a running [VS Code](</docs/en/vs-code#the-built-in-ide-mcp-server>) or [JetBrains](</docs/en/jetbrains#the-built-in-ide-mcp-server>) IDE, and servers the CLI itself configures are exempt from the allowlist, and the denylist still applies to them. On Claude Code v2.1.268 or later, a [Claude Tag](</docs/en/claude-tag>) session’s Slack tools are also exempt from the allowlist, and the denylist still applies to them. In-process `type: "sdk"` servers are exempt from both lists; the [app that started the session](</docs/en/mcp#how-connectors-reach-claude-code>) registers them. Servers your organization delivers are also exempt from the allowlist, and the denylist still applies to them. The exemption covers every `managedMcpServers` entry, and any [`managed-mcp.json`](</docs/en/managed-mcp#exclusive-control-with-managed-mcp-json>) entry whose values use no `${VAR}` expansion. See [How a server is evaluated](</docs/en/managed-mcp#how-a-server-is-evaluated>) for the full check order. Before v2.1.259, servers from `managed-mcp.json` had to match too. * **Scope** : `Any file`. Entries from every file merge into one allowlist unless `allowManagedMcpServersOnly` is set. Deploy it in managed settings to enforce it. * **Type** : array of objects, each with exactly one key: `serverName`, a string limited to letters, numbers, hyphens, and underscores; `serverCommand`, an array of the command and its arguments matched exactly; or `serverUrl`, a URL pattern with `*` wildcards @@ -5962,11 +6011,11 @@ `disableSideloadFlags` -Reject the `--plugin-dir`, `--plugin-url`, `--agents`, and `--mcp-config` CLI flags at startup, which users could otherwise pass to bypass `strictKnownMarketplaces` for a single run. Claude Code exits with an error naming the rejected flags, and applies the same check to surfaces that start the CLI with these flags internally, currently [Cowork](</docs/en/desktop>) local sessions in the desktop app. In [cloud sessions](</docs/en/claude-code-on-the-web>), Claude Code drops the MCP servers the server delivered through `--mcp-config`, other than in-process `type: "sdk"` entries, and starts the session. Requires Claude Code v2.1.193 or later. +Reject the `--plugin-dir`, `--plugin-url`, `--agents`, and `--mcp-config` CLI flags at startup, which users could otherwise pass to bypass `strictKnownMarketplaces` for a single run. Claude Code exits with an error naming the rejected flags, and applies the same check to surfaces that start the CLI with these flags internally, currently [Cowork](</docs/en/desktop>) local sessions in the desktop app. In [cloud sessions](</docs/en/claude-code-on-the-web>), Claude Code instead starts the session and drops every server-delivered `--mcp-config` entry except in-process `type: "sdk"` entries and a [Claude Tag](</docs/en/claude-tag>) session’s Slack tools. Requires Claude Code v2.1.193 or later. * **Scope** : `Managed` * **Type** : Boolean - * `true`: Claude Code rejects `--plugin-dir`, `--plugin-url`, `--agents`, and `--mcp-config` at startup and exits with an error naming them, except that in cloud sessions it drops the MCP servers the server delivered through `--mcp-config`, other than in-process `type: "sdk"` entries, and starts the session + * `true`: Claude Code rejects `--plugin-dir`, `--plugin-url`, `--agents`, and `--mcp-config` at startup and exits with an error naming them. In cloud sessions, it instead starts the session and drops every server-delivered `--mcp-config` entry except in-process `type: "sdk"` entries and a Claude Tag session’s Slack tools * `false`: Claude Code accepts those flags * **Default** : `false` @@ -5976,7 +6025,7 @@ "disableSideloadFlags": true } -Claude Code still accepts a `--mcp-config` whose servers are all in-process `type: "sdk"` entries, so the Agent SDK and VS Code extension keep working. Users can still add servers with `claude mcp add` or a `.mcp.json` file; for per-server control, set [`allowedMcpServers`](</docs/en/managed-mcp>) as well. Requires Claude Code v2.1.193 or later. The same check covers plugin folders named in the [`CLAUDE_CODE_PLUGIN_DIRS`](</docs/en/env-vars#variables>) environment variable, which requires Claude Code v2.1.280 or later. When the variable names a folder, Claude Code exits with the same error, and the error says to unset the variable. In cloud sessions, Claude Code also ignores server-delivered mid-session MCP updates, the path behind cloud session configuration and SDK `setMcpServers()` calls that reach those sessions. In-process `type: "sdk"` entries stay exempt there too. Before v2.1.239, a server-delivered `--mcp-config` blocked a cloud session from starting. +Claude Code still accepts a `--mcp-config` whose servers are all in-process `type: "sdk"` entries, so the Agent SDK and VS Code extension keep working. Users can still add servers with `claude mcp add` or a `.mcp.json` file; for per-server control, set [`allowedMcpServers`](</docs/en/managed-mcp>) as well. Requires Claude Code v2.1.193 or later. The same check covers plugin folders named in the [`CLAUDE_CODE_PLUGIN_DIRS`](</docs/en/env-vars#variables>) environment variable, which requires Claude Code v2.1.280 or later. When the variable names a folder, Claude Code exits with the same error, and the error says to unset the variable. In cloud sessions, Claude Code also ignores server-delivered mid-session MCP updates, the path behind cloud session configuration and SDK `setMcpServers()` calls that reach those sessions. In-process `type: "sdk"` entries and a Claude Tag session’s Slack tools stay exempt there too. Before v2.1.268, both this drop and the startup drop also removed a Claude Tag session’s Slack tools. Before v2.1.239, a server-delivered `--mcp-config` blocked a cloud session from starting. ###
modified Customize your status line View current →
--- a/statusline.md +++ b/statusline.md @@ -1102,7 +1102,7 @@ **Context percentage shows unexpected values** * Use `used_percentage` for the simplest accurate context state - * Context percentage may differ from `/context` output due to when each is calculated + * The status line reports the counts from the last API response, while `/context` adds an estimate for messages added since that response, so `/context` can read higher until the next response **OSC 8 links not clickable**
modified Create custom subagents View current →
--- a/sub-agents.md +++ b/sub-agents.md @@ -18,7 +18,7 @@ Built-in subagents -Claude Code includes built-in subagents that Claude automatically uses when appropriate. Each inherits the parent conversation’s permissions; most run with a restricted tool set. Explore and Plan skip your CLAUDE.md files and the git status snapshot to keep research fast and inexpensive. Every other built-in and custom subagent loads both, unless its definition sets the `omitClaudeMd` field to skip the user, project, and local CLAUDE.md files. For the full breakdown of what reaches a subagent, see what loads at startup. +Claude Code includes built-in subagents that Claude automatically uses when appropriate. Each inherits the parent conversation’s permission rules; most run with a restricted tool set. Explore and Plan skip your CLAUDE.md files and the git status snapshot to keep research fast and inexpensive. Every other built-in and custom subagent loads both, unless its definition sets the `omitClaudeMd` field to skip the user, project, and local CLAUDE.md files. For the full breakdown of what reaches a subagent, see what loads at startup. * Explore @@ -655,7 +655,7 @@ - matcher: "Bash" hooks: - type: command - command: "./scripts/validate-command.sh $TOOL_INPUT" + command: "./scripts/validate-command.sh" PostToolUse: - matcher: "Edit|Write" hooks: @@ -700,7 +700,7 @@ } } -A hyphenated matcher like `db-agent` matches exactly on Claude Code v2.1.195 or later. On earlier versions it is evaluated as an unanchored regular expression and also fires for any agent type that contains it, such as `prod-db-agent`; anchor it as `^db-agent$` on those versions. See [Hooks](</docs/en/hooks>) for the complete hook configuration format. +See [Hooks](</docs/en/hooks>) for the complete hook configuration format. ## @@ -726,7 +726,7 @@ * **Natural language** : name the subagent in your prompt; Claude decides whether to delegate * **@-mention** : guarantees the subagent runs for one task - * **Session-wide** : the whole session uses that subagent’s system prompt, tool restrictions, and model via the `--agent` flag or the `agent` setting + * **Session-wide** : the whole session runs as that subagent via the `--agent` flag or the `agent` setting For natural language, there’s no special syntax. Name the subagent and Claude typically delegates: @@ -737,11 +737,11 @@ @"code-reviewer (agent)" look at the auth changes -Your full message still goes to Claude, which writes the subagent’s task prompt based on what you asked. The @-mention controls which subagent Claude invokes, not what prompt it receives. Subagents provided by an enabled [plugin](</docs/en/plugins/overview>) appear in the typeahead under their scoped name, such as `my-plugin:code-reviewer` or `my-plugin:review:security` when the plugin organizes agents into subfolders. Named background subagents currently running in the session also appear in the typeahead, showing their status next to the name. You can also type the mention manually without using the picker: `@agent-<name>` for local subagents, or `@agent-` followed by the scoped name for plugin subagents, for example `@agent-my-plugin:code-reviewer`. While you type this form the typeahead shows file matches rather than agents. The agent mention still resolves when you submit. **Run the whole session as a subagent.** Pass [`--agent <name>`](</docs/en/cli-reference>) to start a session where the main thread itself takes on that subagent’s system prompt, tool restrictions, and model: +Your full message still goes to Claude, which writes the subagent’s task prompt based on what you asked. The @-mention controls which subagent Claude invokes, not what prompt it receives. Subagents provided by an enabled [plugin](</docs/en/plugins/overview>) appear in the typeahead under their scoped name, such as `my-plugin:code-reviewer` or `my-plugin:review:security` when the plugin organizes agents into subfolders. Named background subagents currently running in the session also appear in the typeahead, showing their status next to the name. You can also type the mention manually without using the picker: `@agent-<name>` for local subagents, or `@agent-` followed by the scoped name for plugin subagents, for example `@agent-my-plugin:code-reviewer`. While you type this form the typeahead shows file matches rather than agents. The agent mention still resolves when you submit. **Run the whole session as a subagent.** Pass [`--agent <name>`](</docs/en/cli-reference>) to start a session where the main thread itself takes on that subagent’s tool restrictions and model: claude --agent code-reviewer -Unless the agent’s prompt is empty, the subagent’s system prompt replaces the default Claude Code system prompt entirely, the same way [`--system-prompt`](</docs/en/cli-reference>) does. `CLAUDE.md` files and project memory still load through the normal message flow, even when the agent’s definition sets `omitClaudeMd`. The agent name appears as `@<name>` in the startup header so you can confirm it’s active. This works with built-in and custom subagents, and the choice persists when you resume the session: Claude Code restores the agent’s tool restrictions and model along with the conversation. If the agent no longer exists when you resume, the session continues with the default tools and shows a [warning naming the agent](</docs/en/errors#session-agent-no-longer-available>). For the system prompt in either case, see [System prompt flags in resumed conversations](</docs/en/cli-reference#system-prompt-flags-in-resumed-conversations>). For a plugin-provided subagent, you can pass only the agent name and Claude Code finds it: +Unless the agent’s prompt is empty, a custom subagent’s system prompt replaces the default Claude Code system prompt entirely, the same way [`--system-prompt`](</docs/en/cli-reference>) does. `CLAUDE.md` files and project memory still load through the normal message flow, even when the agent’s definition sets `omitClaudeMd`. The agent name appears as `@<name>` in the startup header so you can confirm it’s active. This works with built-in and custom subagents, and the choice persists when you resume the session: Claude Code restores the agent’s tool restrictions and model along with the conversation. If the agent no longer exists when you resume, the session continues with the default tools and shows a [warning naming the agent](</docs/en/errors#session-agent-no-longer-available>). For the system prompt in either case, see [System prompt flags in resumed conversations](</docs/en/cli-reference#system-prompt-flags-in-resumed-conversations>). For a plugin-provided subagent, you can pass only the agent name and Claude Code finds it: claude --agent security-reviewer
modified Enterprise deployment overview View current →
--- a/third-party-integrations.md +++ b/third-party-integrations.md @@ -9,7 +9,7 @@ For most organizations, Claude for Teams or Claude for Enterprise provides the best experience. Team members get access to both Claude Code and Claude on the web with a single subscription, centralized billing, and no infrastructure setup required. **Claude for Teams** is self-service and includes collaboration features, admin tools, SSO, billing management, and [server-managed settings](</docs/en/server-managed-settings>) for organization-wide Claude Code configuration. Best for smaller teams that need to get started quickly. **Claude for Enterprise** adds domain capture, role-based permissions, and compliance API access. Best for larger organizations with security and compliance requirements. Learn more about [Team plans](<https://support.claude.com/en/articles/9266767-what-is-the-team-plan>) and [Enterprise plans](<https://support.claude.com/en/articles/9797531-what-is-the-enterprise-plan>). The deployment options compared below cover where model inference runs. To run Claude Code [cloud sessions](</docs/en/claude-code-on-the-web>) on compute your organization operates, see [self-hosted environments](</docs/en/self-hosted-environments>). If your organization has specific infrastructure requirements, compare the options below: Feature| Claude for Teams/Enterprise| Anthropic Console| Amazon Bedrock| Claude Platform on AWS| Google Cloud’s Agent Platform, formerly Vertex AI| Microsoft Foundry ---|---|---|---|---|---|--- Best for| Most organizations (recommended)| Individual developers| AWS-native deployments| AWS Marketplace billing with Claude API features| GCP-native deployments| Azure-native deployments -Billing| **Teams:** $150/seat (Premium) with PAYG available +Billing| **Teams:** per-seat subscription with PAYG available, see [pricing](<https://claude.com/pricing?utm_source=claude_code&utm_medium=docs&utm_content=third_party_pricing#team-&-enterprise>) **Enterprise:** [Contact Sales](<https://claude.com/contact-sales?utm_source=claude_code&utm_medium=docs&utm_content=third_party_enterprise>)| PAYG| PAYG through AWS| PAYG through AWS Marketplace| PAYG through GCP| PAYG through Azure Regions| Supported [countries](<https://www.anthropic.com/supported-countries>)| Supported [countries](<https://www.anthropic.com/supported-countries>)| Multiple AWS [regions](<https://docs.aws.amazon.com/bedrock/latest/userguide/models-regions.html>)| Multiple AWS regions| Multiple GCP [regions](<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations>)| Multiple Azure [regions](<https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-region/>) Prompt caching| Enabled by default| Enabled by default| Enabled by default| Enabled by default| Enabled by default| Enabled by default
modified Tools reference View current →
--- a/tools-reference.md +++ b/tools-reference.md @@ -318,8 +318,6 @@ WebSocket source -The WebSocket source requires Claude Code v2.1.195 or later. - When a server already pushes events over a WebSocket, Claude can connect to it directly instead of writing a polling script. Each kind of socket activity either becomes an event or ends the watch: * **Text messages** : each one becomes one event, even when the message spans multiple lines. @@ -430,7 +428,7 @@ The Read tool takes a file path and returns the contents with line numbers. Claude is instructed to always pass absolute paths. By default, Read returns the file from the start. When a whole-file read exceeds the token limit, Read returns the first page with a `PARTIAL view` notice that tells Claude how much of the file it received and how to read more with `offset` and `limit`. A read that passes an explicit `offset` or `limit` and still exceeds the token limit returns an error. A read with an explicit `limit` stops as soon as the selected lines exceed what the token limit could ever fit and returns an error without loading the rest of the range. The error tells Claude to use a smaller `limit`, or to search for specific content with Grep instead when a single line is that large. Before v2.1.208, Claude Code loaded the whole range into memory before rejecting it, so reading a file with an extremely long single line could run it out of memory. Reading an empty file returns a notice that the file exists but its contents are empty, and an `offset` past the last line returns a notice giving the file’s line count. Before v2.1.208, reading an empty file returned the past-the-end notice instead. Read handles several file types beyond plain text: * **Images** : PNG, JPG, and other image formats are returned as visual content that Claude can see, not as raw bytes. Claude Code resizes and recompresses large images to fit the model’s image size limits before sending them, so Claude may see a downscaled version of a large screenshot. As of v2.1.196, an image that is still larger than 500KB after that resize is re-encoded as a JPEG at reduced quality with its pixel dimensions unchanged. If Claude misses fine pixel-level detail in a large image, ask it to crop the region of interest first, for example with ImageMagick via Bash. - * **PDFs** : Claude reads short `.pdf` files whole. For PDFs longer than 10 pages, it reads in ranges with a `pages` parameter, such as `"1-5"`, up to 20 pages at a time. + * **PDFs** : Claude reads short `.pdf` files whole. For PDFs longer than 10 pages, it reads in ranges with a `pages` parameter, such as `"1-5"`, up to 20 pages at a time. Page-range reads render pages with `pdftoppm` from poppler-utils, so install it with `brew install poppler` on macOS or `apt-get install poppler-utils` on Debian and Ubuntu. On Windows and other platforms, install a poppler build that puts `pdftoppm` on your `PATH`. Without it, a page-range read fails with `pdftoppm is not installed`. * **Jupyter notebooks** : `.ipynb` files return all cells with their outputs, including code, markdown, and visualizations. Claude Code refuses to read a notebook file over 100 MB; the error tells Claude how to read a portion of the notebook instead, such as a slice of cells, with a shell command. Read only reads files, not directories. Claude lists directory contents with a shell command such as `ls`.
modified Troubleshoot installation and login View current →
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -338,7 +338,14 @@ TLS or SSL connection errors -Errors like `curl: (35) TLS connect error`, `schannel: next InitializeSecurityContext failed`, or PowerShell’s `Could not establish trust relationship for the SSL/TLS secure channel` indicate TLS handshake failures. **Solutions:** +Errors such as these mean the TLS handshake failed: + + * `curl: (35) TLS connect error` + * `schannel: next InitializeSecurityContext failed` + * PowerShell’s `Could not create SSL/TLS secure channel` + * PowerShell’s `Could not establish trust relationship for the SSL/TLS secure channel` + +**Solutions:** 1. **Update your system CA certificates** : On Ubuntu/Debian: @@ -797,7 +804,7 @@ 403 Forbidden after login -If you see `API Error: 403 {"error":{"type":"forbidden","message":"Request not allowed"}}` after logging in: +If you see `API Error: 403 Request not allowed` after logging in: * **Claude Pro/Max users** : verify your subscription is active at [claude.ai/settings](<https://claude.ai/settings>) * **Anthropic Console users** : confirm your account has the “Claude Code” or “Developer” role. Admins assign this in the Anthropic Console under Settings → Members.
modified Use Claude Code in VS Code View current →
--- a/vs-code.md +++ b/vs-code.md @@ -133,7 +133,7 @@ Explain the logic in @auth (fuzzy matches auth.js, AuthService.ts, etc.) What's in @src/components/ (include a trailing slash for folders) -For large PDFs, you can ask Claude to read specific pages instead of the whole file: a single page, a range like pages 1-10, or an open-ended range like page 3 onward. When you select text in the editor, Claude can see your highlighted code automatically. The prompt box footer shows how many lines are selected. Press `Option+K` (Mac) / `Alt+K` (Windows/Linux) to insert an @-mention with the file path and line numbers (e.g., `@app.ts#5-10`). Click the **X** on the selection indicator to remove it so Claude doesn’t receive the selection. The indicator comes back when you select other text. The extension withholds selected text from some files. When the file is inside your workspace and matches your `files.exclude` or `search.exclude` settings, Claude receives at most the file’s path and not the text you selected. The same applies to a file git ignores, as long as VS Code’s `search.useIgnoreFiles` setting and the extension’s `respectGitIgnore` setting are both on, which is the default. This filter covers the chat panel only: when Claude Code runs in the integrated terminal, the CLI sends your selected text whatever the file, so add a `Read` deny rule to keep a file’s contents from Claude there. Claude also sees which file you have open in the editor, even when nothing is selected, and the prompt box shows its name. To add only your selected text, turn off the [Attach Open File setting](<vscode://settings/claudeCode.attachOpenFile>). The setting requires Claude Code v2.1.271 or later. You can also attach images and files to your message: +For large PDFs, you can ask Claude to read specific pages instead of the whole file: a single page, a range like pages 1-10, or an open-ended range like page 3 onward. Reading specific pages requires [poppler-utils](</docs/en/tools-reference#read-tool-behavior>) on the machine where Claude Code runs. When you select text in the editor, Claude can see your highlighted code automatically. The prompt box footer shows how many lines are selected. Press `Option+K` (Mac) / `Alt+K` (Windows/Linux) to insert an @-mention with the file path and line numbers (e.g., `@app.ts#5-10`). Click the **X** on the selection indicator to remove it so Claude doesn’t receive the selection. The indicator comes back when you select other text. The extension withholds selected text from some files. When the file is inside your workspace and matches your `files.exclude` or `search.exclude` settings, Claude receives at most the file’s path and not the text you selected. The same applies to a file git ignores, as long as VS Code’s `search.useIgnoreFiles` setting and the extension’s `respectGitIgnore` setting are both on, which is the default. This filter covers the chat panel only: when Claude Code runs in the integrated terminal, the CLI sends your selected text whatever the file, so add a `Read` deny rule to keep a file’s contents from Claude there. Claude also sees which file you have open in the editor, even when nothing is selected, and the prompt box shows its name. To add only your selected text, turn off the [Attach Open File setting](<vscode://settings/claudeCode.attachOpenFile>). The setting requires Claude Code v2.1.271 or later. You can also attach images and files to your message: * To attach an image, paste it from your clipboard into the prompt box. * To attach files, hold `Shift` while dragging them into the prompt box.
modified Get started with Claude Code in the cloud View current →
--- a/web-quickstart.md +++ b/web-quickstart.md @@ -235,9 +235,9 @@ ​ -”Not available for the selected organization” - -Enterprise organizations may need an Owner to enable cloud sessions. Contact your Anthropic account team. +”Claude Code isn’t available on your account” + +Your seat in the selected organization doesn’t include Claude Code. If you belong to another organization, click **Switch organization** on that page. Otherwise, ask an Owner of the organization to assign you a [seat that includes Claude Code](<https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan>). ###
modified Orchestrate subagents at scale with dynamic workflows View current →
--- a/workflows.md +++ b/workflows.md @@ -81,7 +81,7 @@ Watch the run -Workflows run in the background, so the session stays responsive while agents work. Run `/workflows` at any time to list running and completed workflows, then select one to open its progress view. The progress view shows each phase with its agent counts, token totals, and elapsed time. The footer lists the key for each action: +Workflows run in the background, so the session stays responsive while agents work. Run `/workflows` at any time to list running and completed workflows, then select one to open its progress view. To stop a running workflow without opening it, select it in the list and press `x`. The progress view shows each phase with its agent counts, token totals, and elapsed time. The footer lists the key for each action: Key| Action ---|---
modified Run parallel sessions with worktrees View current →
--- a/worktrees.md +++ b/worktrees.md @@ -45,7 +45,7 @@ Clean up worktrees -When you exit an interactive worktree session, Claude checks the worktree for work that removal would delete: changed or untracked files, uncommitted work inside checked-out submodules, and new commits. +When you exit an interactive worktree session, Claude checks the worktree for work that removal would delete: changed or untracked files, uncommitted work inside checked-out submodules, and new commits. These rules apply to worktrees Claude created with git. For a worktree your [WorktreeCreate hook](</docs/en/hooks#worktreecreate>) created, see [WorktreeRemove](</docs/en/hooks#worktreeremove>) instead. * **The worktree is clean** : for an unnamed session, Claude removes the worktree and its branch automatically. A [named](</docs/en/sessions#name-your-sessions>) session prompts you first so you can keep the worktree for later * **The worktree has work in it** : Claude prompts you to keep or remove the worktree. Keeping preserves the directory and branch. To return later, run the `claude --worktree <name> --resume` command that Claude Code prints on exit. Removing deletes the worktree directory and its branch, along with all the work in them