modified Set up Claude Code for your organization View current →
--- a/admin-setup.md +++ b/admin-setup.md @@ -34,7 +34,7 @@ Decide how settings reach devices -Managed settings define policy that takes precedence over local developer configuration. Claude Code looks for them in four places and uses the first one it finds on a given device. +Managed settings define policy that takes precedence over local developer configuration. Claude Code checks the four sources below in priority order and applies the first one that returns a non-empty configuration. Mechanism| Delivery| Priority| Platforms ---|---|---|---
added Escalate hard decisions with the advisor tool View current →
Show diff (182 lines)
--- a/advisor.md +++ b/advisor.md @@ -0,0 +1,179 @@ +The advisor tool is experimental and requires Claude Code v2.1.98 or later with the Anthropic API. It is not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. Behavior, pricing, and availability may change. + +The advisor tool lets Claude consult a second, typically stronger model at key moments during a task, such as before committing to an approach, when stuck on a recurring error, or before declaring a task complete. The advisor receives the full conversation, including every tool call and result, and returns guidance that Claude applies before continuing. The advisor runs server-side on Anthropic’s infrastructure as a [server tool](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool>), available to both subscription and API-billed accounts. You choose which model acts as the advisor, and Claude decides when to call it. This page covers how to enable the advisor, which model pairings are accepted, what Claude shows during a consultation, and how advisor usage is billed. + +## + +​ + +When to use the advisor + +The advisor fits long, multi-step tasks where most turns are routine but plan quality determines the outcome. Examples include large refactors, debugging sessions where an error keeps recurring, and tasks you want independently checked before Claude declares them done. It adds less value on short tasks where there is little to plan, or on work where every turn needs the strongest model. For those, [switch the main model](</docs/en/model-config#setting-your-model>) instead, or see how the advisor compares with opusplan and subagents for other ways to get a second opinion. + +## + +​ + +Enable the advisor + +You can set the advisor model in three ways: + + * **`/advisor` command**: set or change the advisor mid-session and save it as your default + * **`advisorModel` setting**: configure a persistent default in your [settings file](</docs/en/settings>) + * **`--advisor` flag**: set the advisor for a single session at launch + +If any of these sets an advisor model, the advisor is enabled for sessions whose main model supports it. To stop using it, see Turn the advisor off. + +To use Fable 5 as the advisor, you need Claude Code v2.1.170 or later and [Fable 5 access](</docs/en/model-config#work-with-fable-5>) for your organization. Fable does not appear in the picker that `/advisor` opens, so pass it directly as `/advisor fable`, `--advisor fable`, or `"advisorModel": "fable"`. + +### + +​ + +Use the `/advisor` command + +Run `/advisor` without arguments to open a picker listing the available advisor models, or pass the model directly: + + /advisor opus + +Your selection is saved to `advisorModel` in your user settings and persists across sessions. If your current main model does not support the advisor, the selection is still saved and activates when you switch to a compatible main model with [`/model`](</docs/en/model-config#setting-your-model>). + +### + +​ + +Set `advisorModel` in settings + +To configure the advisor as a default without opening a session, set it in your settings file: + + { + "advisorModel": "opus" + } + +### + +​ + +Use the `--advisor` flag + +To set the advisor for a single session without changing your saved setting, launch with the flag: + + claude --advisor opus + +The flag takes precedence over the `advisorModel` setting for that session. Unlike `/advisor`, which saves an inactive selection, the flag exits with an error if the session’s main model does not support the advisor. + +## + +​ + +Choose an advisor model + +The advisor must be at least as capable as the main model. The accepted advisors for each main model are: + +Main model| Accepted advisors| Notes +---|---|--- +Haiku 4.5| Fable, Opus, Sonnet| Haiku can call the advisor but cannot act as one +Sonnet 4.6| Fable, Opus, Sonnet| +Opus 4.6 or later| Fable, Opus at or above the main model’s version| An Opus 4.7 main with an Opus 4.6 advisor is rejected +Fable 5 (v2.1.170+)| Fable| An Opus or Sonnet advisor is rejected + +Fable 5 requires Claude Code v2.1.170 or later and Fable 5 access, whether it acts as the main model or the advisor. The `fable` option does not appear in the `/advisor` picker. Set the advisor as `opus`, `sonnet`, or `fable`. These aliases resolve to the latest version of each model. You can also pass a full model ID such as `claude-opus-4-8`. The API enforces the pairing, not Claude Code. Setting a rejected pairing succeeds, then surfaces as a `cannot be used as an advisor when the request model is` error on the next request. + +### + +​ + +Common model pairings + +Any accepted pairing works. These combinations balance cost against capability in different ways: + +Pairing| When to use +---|--- +Sonnet main + Opus advisor| Sonnet handles routine work and escalates planning, ambiguous failures, and completion checks to Opus +Sonnet main + Fable advisor| Fable 5 guidance at decision points without running Fable 5 throughout. Requires v2.1.170 or later and Fable 5 access +Haiku main + Opus advisor| Lowest-cost main model with strong planning. Expect higher cost than Haiku alone but lower than switching the main model to Sonnet or Opus +Opus main + Opus advisor| A second Opus reviews the first. Useful for high-stakes tasks where an independent check matters more than cost +Fable main + Fable advisor| Highest-capability pairing when Fable 5 is available (v2.1.170+). Fable is a higher tier than Opus and Sonnet, so it is the only accepted advisor for a Fable main model +Sonnet main + Sonnet advisor| A lower-cost second opinion for catching routine oversights + +## + +​ + +When Claude consults the advisor + +Claude decides when to call the advisor. It tends to consult before committing to an approach, when an error keeps recurring, and before declaring a task done, but the timing is model-driven rather than rule-based. You can ask for a consultation in your prompt the same way you would request any tool, for example `consult the advisor before you continue`. There is no setting to cap or force advisor calls; if you want Claude to consult more or less often during a task, say so in your instructions. + +## + +​ + +What you see during a session + +When Claude calls the advisor, the transcript shows an `Advising` line with the advisor model name while the call is in progress. When the result returns, the line confirms that the advisor has reviewed the conversation. Press `Ctrl+O` to expand it and read the advisor’s full guidance. Claude generally follows the advisor’s guidance, but adapts when its own evidence contradicts a specific claim: if a recommended step fails when tried, or the file contents contradict the advice, Claude surfaces the conflict rather than following the guidance unconditionally. The advisor always receives the full conversation, and Claude controls the timing. For more control or a different configuration, see how the advisor compares with subagents and opusplan. + +## + +​ + +Cost + +Each advisor call sends the conversation to the advisor model, so it consumes tokens at the advisor model’s rates in addition to your main model’s usage. With API billing, advisor tokens are charged at the advisor model’s input and output rates. On subscription plans, advisor usage counts toward your plan’s usage limits. Claude calls the advisor at decision points rather than on every turn, so pairing a faster main model with a stronger advisor typically costs less than running the stronger model throughout. Advisor usage counts toward the session totals shown by [`/usage`](</docs/en/costs#track-your-costs>). For how advisor tokens are reported in API responses, see [Usage and billing](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool#usage-and-billing>) in the Claude API documentation. + +## + +​ + +Impact on prompt caching + +Enabling or disabling the advisor mid-session does not invalidate your main model’s [prompt cache](</docs/en/prompt-caching>). Unlike [changing model or effort level](</docs/en/prompt-caching#actions-that-invalidate-the-cache>), toggling `/advisor` keeps the cached prefix intact, and the advisor’s returned guidance is cached as part of the transcript on later turns. The advisor model’s own read of the conversation is not cached. Each advisor call processes the full transcript anew, with no reuse between calls. + +## + +​ + +Requirements + +The advisor tool requires all of the following: + + * **Claude Code v2.1.98 or later** : run `claude update` to upgrade. + * **Anthropic API only** : the advisor is a server-executed tool. It is not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. Through an [LLM gateway](</docs/en/llm-gateway>) configured with `ANTHROPIC_BASE_URL`, availability depends on whether the gateway forwards the request intact to the Anthropic API. + * **Supported main model** : Opus 4.6 or later, Sonnet 4.6, or Haiku 4.5. Fable 5 also qualifies on Claude Code v2.1.170 or later. + +## + +​ + +Turn the advisor off + +To stop using the advisor and clear your saved `advisorModel`, run `/advisor off` or choose **No advisor** in the `/advisor` picker: + + /advisor off + +To disable the advisor tool entirely, including the `/advisor` command and the `--advisor` flag, set `CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1`. See [Environment variables](</docs/en/env-vars>). + +## + +​ + +Compare with related features + +The advisor is one of several ways to combine model strengths. Pick based on when you want a second model involved. + +Approach| When the stronger model runs| How it starts +---|---|--- +Advisor tool| At decision points mid-task| Claude calls it when it needs guidance +[`opusplan`](</docs/en/model-config#opusplan-model-setting>)| During plan mode, then switches to Sonnet for execution| You enter plan mode +[Subagents](</docs/en/sub-agents#choose-a-model>) with `model` set| For the entire delegated subtask| Claude delegates, or you invoke the subagent +[`/model`](</docs/en/model-config#setting-your-model>)| For all subsequent turns| You switch models + +## + +​ + +See also + + * [Model configuration](</docs/en/model-config>): switch models, set effort levels, and use `opusplan` + * [Manage costs effectively](</docs/en/costs>): track token usage across models + * [Advisor tool in the Claude API](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool>): understand the underlying server tool, or use it directly from the Messages API + * [The advisor strategy](<https://claude.com/blog/the-advisor-strategy>): why pairing a fast main model with a stronger advisor works
modified How the agent loop works View current →
--- a/agent-loop.md +++ b/agent-loop.md @@ -168,10 +168,10 @@ `"low"`| Minimal reasoning, fast responses| File lookups, listing directories `"medium"`| Balanced reasoning| Routine edits, standard tasks `"high"`| Thorough analysis| Refactors, debugging -`"xhigh"`| Extended reasoning depth| Coding and agentic tasks; recommended on Opus 4.7 +`"xhigh"`| Extended reasoning depth| Coding and agentic tasks; recommended on Opus 4.8 and Opus 4.7 `"max"`| Maximum reasoning depth| Multi-step problems requiring deep analysis -If you don’t set `effort`, the Python SDK leaves the parameter unset and defers to the model’s default behavior. The TypeScript SDK defaults to `"high"`. +If you don’t set `effort`, both SDKs leave the parameter unset and defer to the model’s default behavior. `effort` trades latency and token cost for reasoning depth within each response. [Extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>) is a separate feature that produces visible chain-of-thought blocks in the output. They are independent: you can set `effort: "low"` with extended thinking enabled, or `effort: "max"` without it. @@ -189,10 +189,10 @@ ---|--- `"default"`| Tools not covered by allow rules trigger your approval callback; no callback means deny `"acceptEdits"`| Auto-approves file edits and common filesystem commands (`mkdir`, `touch`, `mv`, `cp`, etc.); other Bash commands follow default rules -`"plan"`| Read-only tools run; Claude explores and produces a plan without editing your source files +`"plan"`| Claude explores and plans without editing your source files; file edits are never auto-approved and prompt through your `canUseTool` callback `"dontAsk"`| Never prompts. Tools pre-approved by [permission rules](</docs/en/settings#permission-settings>) run, everything else is denied `"auto"` (TypeScript only)| Uses a model classifier to approve or deny each tool call. See [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) for availability and behavior -`"bypassPermissions"`| Runs all allowed tools without asking. Cannot be used when running as root on Unix. Use only in isolated environments where the agent’s actions cannot affect systems you care about +`"bypassPermissions"`| Runs all allowed tools without asking, unless an explicit [`ask` rule](</docs/en/settings#permission-settings>) matches; see [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) for where ask rules sit in the precedence order. Cannot be used when running as root on Unix. Use only in isolated environments where the agent’s actions cannot affect systems you care about For interactive applications, use `"default"` with a tool approval callback to surface approval prompts. For autonomous agents on a dev machine, `"acceptEdits"` auto-approves file edits and common filesystem commands (`mkdir`, `touch`, `mv`, `cp`, etc.) while still gating other `Bash` commands behind allow rules. Reserve `"bypassPermissions"` for CI, containers, or other isolated environments. See [Permissions](</docs/en/agent-sdk/permissions>) for full details.
modified Orchestrate teams of Claude Code sessions View current →
--- a/agent-teams.md +++ b/agent-teams.md @@ -95,7 +95,7 @@ `tmux` has known limitations on certain operating systems and traditionally works best on macOS. Using `tmux -CC` in iTerm2 is the suggested entrypoint into `tmux`. -The default is `"auto"`, which uses split panes if you’re already running inside a tmux session, and in-process otherwise. The `"tmux"` setting enables split-pane mode and auto-detects whether to use tmux or iTerm2 based on your terminal. To override, set [`teammateMode`](</docs/en/settings#available-settings>) in `~/.claude/settings.json`: +The default is `"auto"`, which uses split panes if you’re already running inside a tmux session or your terminal is iTerm2, and in-process otherwise. The `"tmux"` setting enables split-pane mode and auto-detects whether to use tmux or iTerm2 based on your terminal. To override, set [`teammateMode`](</docs/en/settings#available-settings>) in `~/.claude/settings.json`: { "teammateMode": "in-process" @@ -166,7 +166,7 @@ Shut down teammates -To gracefully end a teammate’s session: +To gracefully end a teammate’s session, refer to it by name. For example, with a teammate named researcher: Ask the researcher teammate to shut down @@ -182,7 +182,7 @@ Clean up the team -This removes the shared team resources. When the lead runs cleanup, it checks for active teammates and fails if any are still running, so shut them down first. +This removes the shared team resources. When the lead runs cleanup, it checks for active teammates and fails if any are still running, so shut them down first. Claude often cleans up on its own when the team’s work is done, so a later cleanup request may report that there is nothing to clean up. Always use the lead to clean up. Teammates should not run cleanup because their team context may not resolve correctly, potentially leaving resources in an inconsistent state. @@ -239,7 +239,7 @@ * **Team config** : `~/.claude/teams/{team-name}/config.json` * **Task list** : `~/.claude/tasks/{team-name}/` -Claude Code generates both of these automatically when you create a team and updates them as teammates join, go idle, or leave. The team config holds runtime state such as session IDs and tmux pane IDs, so don’t edit it by hand or pre-author it: your changes are overwritten on the next state update. To define reusable teammate roles, use subagent definitions instead. The team config contains a `members` array with each teammate’s name, agent ID, and agent type. Teammates can read this file to discover other team members. There is no project-level equivalent of the team config. A file like `.claude/teams/teams.json` in your project directory is not recognized as configuration; Claude treats it as an ordinary file. +Claude Code generates both of these automatically when you create a team and updates them as teammates join, go idle, or leave. Both directories exist only while the team is active: they are removed when the team is cleaned up or when the session ends. The team config holds runtime state such as session IDs and tmux pane IDs, so don’t edit it by hand or pre-author it: your changes are overwritten on the next state update. To define reusable teammate roles, use subagent definitions instead. The team config contains a `members` array with each teammate’s name, agent ID, and agent type. Teammates can read this file to discover other team members. There is no project-level equivalent of the team config. A file like `.claude/teams/teams.json` in your project directory is not recognized as configuration; Claude treats it as an ordinary file. ###
modified Manage multiple agents with agent view View current →
--- a/agent-view.md +++ b/agent-view.md @@ -180,6 +180,7 @@ `a:<name>`| Sessions running the named agent `s:<state>`| Sessions in the given state, such as `s:working`. Also accepts `s:blocked` for everything waiting on you `#<number>` or a PR URL| The session working on that pull request +Any other URL| The session whose first prompt contained that URL ### @@ -397,7 +398,7 @@ ---|--- `claude agents`| Open agent view `claude agents --cwd <path>`| Open agent view scoped to sessions started under `<path>` -`claude agents --json`| Print live sessions as a JSON array and exit. Each entry has `pid`, `cwd`, `kind`, and `startedAt`, plus `sessionId`, `name`, and `status` when set. When `status` is `waiting`, `waitingFor` says what the session is blocked on, such as `permission prompt` or `input needed`. Combine with `--cwd <path>` to filter +`claude agents --json`| Print active sessions as a JSON array and exit: every live session, plus background sessions that are still working or blocked even when their process has exited. Add `--all` to also include completed background sessions. Each entry has `cwd`, `kind`, and `startedAt`. Background entries also have `id`, usable with `claude attach`/`logs`/`stop`, and `state`: one of `working`, `blocked`, `done`, `failed`, or `stopped`. `pid` and `status` are present only while the process is alive, plus `waitingFor` when status is `waiting`, which says what the session is blocked on, such as `permission prompt` or `input needed`; `sessionId` and `name` appear when set. Combine with `--cwd <path>` to filter `claude attach <id>`| Attach to a session in this terminal `claude logs <id>`| Print the session’s recent output `claude stop <id>`| Stop a session. Also accepts `claude kill` @@ -474,9 +475,9 @@ ​ -Cannot open agents because background tasks are running - -If pressing `←` to background the current session shows `Cannot open agents — N background task(s) running`, the session has in-flight work such as a subagent, a dynamic workflow, or a background shell command, and the shortcut won’t silently abandon it. Run `/tasks` to see what’s running, then `/bg` to confirm abandoning them. See From inside a session for what does and doesn’t transfer when you background. +Cannot open agents because work is running in the background + +If pressing `←` to background the current session shows `Cannot open agents — N still running in the background`, the session has in-flight work such as a subagent, a dynamic workflow, or a background shell command, and the shortcut won’t silently abandon it. Run `/tasks` to see what’s running, then `/bg` to confirm abandoning them. See From inside a session for what does and doesn’t transfer when you background. ###
modified Authentication View current →
--- a/authentication.md +++ b/authentication.md @@ -146,7 +146,7 @@ * **Refresh intervals** : by default, `apiKeyHelper` is called after 5 minutes or on HTTP 401 response. Set `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` environment variable for custom refresh intervals. * **Slow helper notice** : if `apiKeyHelper` takes longer than 10 seconds to return a key, Claude Code displays a warning notice in the prompt bar showing the elapsed time. If you see this notice regularly, check whether your credential script can be optimized. -`apiKeyHelper`, `ANTHROPIC_API_KEY`, and `ANTHROPIC_AUTH_TOKEN` apply to terminal CLI sessions only. Claude Desktop and remote sessions use OAuth exclusively and do not call `apiKeyHelper` or read API key environment variables. +`apiKeyHelper`, `ANTHROPIC_API_KEY`, and `ANTHROPIC_AUTH_TOKEN` apply to terminal CLI sessions only. Claude Desktop and cloud sessions use OAuth exclusively and do not call `apiKeyHelper` or read API key environment variables. ###
modified Configure auto mode View current →
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,4 +1,4 @@ -[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without permission prompts by routing each tool call through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. +[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and admin enablement on Team and Enterprise plans. @@ -21,7 +21,7 @@ Scope| File| Use for ---|---|--- One developer| `~/.claude/settings.json`| Personal trusted infrastructure -One project, one developer| `.claude/settings.local.json`| Per-project trusted buckets or services, gitignored +One project, one developer| `.claude/settings.local.json`| Per-project trusted buckets or services Organization-wide| [Managed settings](</docs/en/server-managed-settings>)| Trusted infrastructure distributed to all developers `--settings` flag or Agent SDK| Inline JSON| Per-invocation overrides for automation
modified Claude Code changelog View current →
--- a/changelog.md +++ b/changelog.md @@ -2,10 +2,20 @@ ​ +2.1.170 + +June 9, 2026 + + * Introducing Claude Fable 5: a Mythos-class model that we’ve made safe for general use. Fable’s capabilities exceed those of any model we’ve ever made generally available. Update to version 2.1.170 for access. <https://www.anthropic.com/news/claude-fable-5-mythos-5> + * Fixed sessions not saving transcripts (and not appearing in —resume) when launched from the VS Code integrated terminal or any shell that inherited Claude Code environment variables. + +​ + 2.1.169 June 8, 2026 + * Self-hosted runner: added a `post-session` lifecycle hook that runs after the session ends and before the workspace is deleted, so you can snapshot uncommitted work or export logs; also made the child-process SIGTERM→SIGKILL window configurable (default unchanged at 5s) * Added `--safe-mode` flag (and `CLAUDE_CODE_SAFE_MODE`) to start Claude Code with all customizations (CLAUDE.md, plugins, skills, hooks, MCP servers) disabled for troubleshooting * Added `/cd` command to move a session to a new working directory without breaking the prompt cache mid-session * Added a `disableBundledSkills` setting and `CLAUDE_CODE_DISABLE_BUNDLED_SKILLS` environment variable to hide bundled skills, workflows, and built-in slash commands from the model
modified Push events into a running session with channels View current →
--- a/channels.md +++ b/channels.md @@ -239,7 +239,7 @@ The message arrives in your Claude Code session as a `<channel source="fakechat">` event. Claude reads it, does the work, and calls fakechat’s `reply` tool. The answer shows up in the chat UI. -If Claude hits a permission prompt while you’re away from the terminal, the session pauses until you respond. Channel servers that declare the [permission relay capability](</docs/en/channels-reference#relay-permission-prompts>) can forward these prompts to you so you can approve or deny remotely. For unattended use, [`--dangerously-skip-permissions`](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) bypasses prompts entirely, but only use it in environments you trust. When you run channels in non-interactive mode with `-p`, tools that need terminal input, such as multiple-choice questions and plan mode approval, are disabled so the session never stalls waiting for input. +If Claude hits a permission prompt while you’re away from the terminal, the session pauses until you respond. Channel servers that declare the [permission relay capability](</docs/en/channels-reference#relay-permission-prompts>) can forward these prompts to you so you can approve or deny remotely. For unattended use, [`--dangerously-skip-permissions`](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) bypasses prompts other than explicit ask rules, but only use it in environments you trust. When you run channels in non-interactive mode with `-p`, tools that need terminal input, such as multiple-choice questions and plan mode approval, are disabled so the session never stalls waiting for input. ##
modified Channels reference View current →
--- a/channels-reference.md +++ b/channels-reference.md @@ -130,7 +130,7 @@ claude --dangerously-load-development-channels server:webhook -When Claude Code starts, it reads your MCP config, spawns your `webhook.ts` as a subprocess, and the HTTP listener starts automatically on the port you configured (8788 in this example). You don’t need to run the server yourself.If you see “blocked by org policy,” your organization admin needs to [enable channels](</docs/en/channels#enterprise-controls>) first.In a separate terminal, simulate a webhook by sending an HTTP POST with a message to your server. This example sends a CI failure alert to port 8788 (or whichever port you configured): +The first time you start a session in this project, Claude Code asks for consent before using the new server from `.mcp.json`. The dialog reports “New MCP server found in this project: webhook”. Select **Use this MCP server** to continue.When Claude Code starts, it reads your MCP config, spawns your `webhook.ts` as a subprocess, and the HTTP listener starts automatically on the port you configured (8788 in this example). You don’t need to run the server yourself.A dim notice below the startup banner confirms the channel is registered: `Channels (experimental) messages from server:webhook inject directly in this session · restart without --dangerously-load-development-channels to stop`.If you see “blocked by org policy,” your organization admin needs to [enable channels](</docs/en/channels#enterprise-controls>) first.In a separate terminal, simulate a webhook by sending an HTTP POST with a message to your server. This example sends a CI failure alert to port 8788 (or whichever port you configured): curl -X POST localhost:8788 -d "build failed on main: https://ci.example.com/run/1234" @@ -711,11 +711,11 @@ curl -d "list the files in this directory" -H "X-Sender: dev" localhost:8788 -The local permission dialog opens in your Claude Code terminal. A moment later the prompt appears in the `/events` stream, including the five-letter ID. Approve it from the remote side: +Listing files is read-only, so Claude runs it without approval. The permission dialog opens when Claude calls the `reply` tool to send its answer back. The local dialog opens in your Claude Code terminal, and a moment later the prompt for `mcp__webhook__reply` appears in the `/events` stream, including the five-letter ID. Approve it from the remote side: curl -d "yes <id>" -H "X-Sender: dev" localhost:8788 -The local dialog closes and the tool runs. Claude’s reply comes back through the `reply` tool and lands in the stream too. The three channel-specific pieces in this file: +The local dialog closes, the `reply` tool runs, and Claude’s reply lands in the stream. The three channel-specific pieces in this file: * **Capabilities** in the `Server` constructor: `claude/channel` registers the notification listener, `claude/channel/permission` opts in to permission relay, `tools` lets Claude discover the reply tool. * **Outbound paths** : the `reply` tool handler is what Claude calls for conversational responses; the `PermissionRequestSchema` notification handler is what Claude Code calls when a permission dialog opens. Both call `send()` to broadcast over `/events`, but they’re triggered by different parts of the system.
modified Use Claude Code on the web View current →
--- a/claude-code-on-the-web.md +++ b/claude-code-on-the-web.md @@ -60,6 +60,7 @@ Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone Plugins declared in `.claude/settings.json`| Yes| Installed at session start from the [marketplace](</docs/en/plugin-marketplaces>) you declared. Requires network access to reach the marketplace source Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo +Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Skills you enable on claude.ai are loaded into cloud sessions automatically Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json`. Declare them in the repo’s `.claude/settings.json` instead MCP servers you added with `claude mcp add`| No| Those write to your local user config, not the repo. Declare the server in [`.mcp.json`](</docs/en/mcp#project-scope>) instead Static API tokens and credentials| No| No dedicated secrets store exists yet. See below @@ -319,6 +320,7 @@ * Protection against malicious requests * Rate limiting and abuse prevention * Content filtering for enhanced security + * A DNS-level audit trail of requested hostnames ### @@ -838,7 +840,7 @@ * Run `/login` locally to refresh your credentials, then reconnect * Confirm you are signed in to the same account that owns the session - * If you see `Remote Control may not be available for this organization`, your admin has not enabled remote sessions for your plan + * If you see `Remote Control may not be available for this organization`, your admin has not enabled cloud sessions for your plan ###
modified Explore the .claude directory View current →
--- a/claude-directory.md +++ b/claude-directory.md @@ -68,7 +68,7 @@ `CLAUDE.md`| Project and global| ✓| Instructions loaded every session| [Memory](</docs/en/memory>) `rules/*.md`| Project and global| ✓| Topic-scoped instructions, optionally path-gated| [Rules](</docs/en/memory#organize-rules-with-claude/rules/>) `settings.json`| Project and global| ✓| Permissions, hooks, env vars, model defaults| [Settings](</docs/en/settings>) -`settings.local.json`| Project only| | Your personal overrides, auto-gitignored| [Settings scopes](</docs/en/settings#settings-files>) +`settings.local.json`| Project only| | Your personal overrides, gitignored when Claude Code creates it| [Settings scopes](</docs/en/settings#settings-files>) `.mcp.json`| Project only| ✓| Team-shared MCP servers| [MCP scopes](</docs/en/mcp#mcp-installation-scopes>) `.worktreeinclude`| Project only| ✓| Gitignored files to copy into new worktrees| [Worktrees](</docs/en/worktrees#copy-gitignored-files-into-worktrees>) `skills/<name>/SKILL.md`| Project and global| ✓| Reusable prompts invoked with `/name` or auto-invoked| [Skills](</docs/en/skills>)
modified Claude Code on Claude Platform on AWS View current →
--- a/claude-platform-on-aws.md +++ b/claude-platform-on-aws.md @@ -66,8 +66,9 @@ 3\. Pin model versions -Claude Platform on AWS uses the same model IDs as the direct Claude API. The default aliases `opus`, `sonnet`, and `haiku` resolve to Claude Code’s built-in defaults for Claude Platform on AWS, which can lag the newest release. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias resolves to Opus 4.7. If you deploy Claude Code to a team, pin the model IDs explicitly so a new release doesn’t move everyone at once: +Claude Platform on AWS uses the same model IDs as the direct Claude API. The default aliases `fable`, `opus`, `sonnet`, and `haiku` resolve to Claude Code’s built-in defaults for Claude Platform on AWS, which can lag the newest release. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias resolves to Opus 4.7. If you deploy Claude Code to a team, pin the model IDs explicitly so a new release doesn’t move everyone at once: + export ANTHROPIC_DEFAULT_FABLE_MODEL=claude-fable-5 export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-7 export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-6 export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5
modified CLI reference View current →
--- a/cli-reference.md +++ b/cli-reference.md @@ -20,7 +20,7 @@ `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` `claude auth status`| Show authentication status as JSON. Use `--text` for human-readable output. Exits with code 0 if logged in, 1 if not| `claude auth status` -`claude agents`| Open [agent view](</docs/en/agent-view>) to monitor and dispatch parallel background sessions. Use `--cwd <path>` to show only sessions started under that directory, or `--json` to print live sessions as a JSON array for scripting. Pass `--permission-mode`, `--model`, `--effort`, or `--agent` to set [defaults for dispatched sessions](</docs/en/agent-view#permission-mode-model-and-effort>). Accepts `--settings`, `--add-dir`, `--plugin-dir`, and `--mcp-config` like the top-level `claude` command. Opening agent view requires an interactive terminal| `claude agents --json` +`claude agents`| Open [agent view](</docs/en/agent-view>) to monitor and dispatch parallel background sessions. Use `--cwd <path>` to show only sessions started under that directory, or `--json` to print active sessions as a JSON array for scripting (`--json --all` also includes completed background sessions). Pass `--permission-mode`, `--model`, `--effort`, or `--agent` to set [defaults for dispatched sessions](</docs/en/agent-view#permission-mode-model-and-effort>). Accepts `--settings`, `--add-dir`, `--plugin-dir`, and `--mcp-config` like the top-level `claude` command. Opening agent view requires an interactive terminal| `claude agents --json` `claude attach <id>`| Attach to a [background session](</docs/en/agent-view#manage-sessions-from-the-shell>) in this terminal| `claude attach 7c5dcf5d` `claude auto-mode defaults`| Print the built-in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) classifier rules as JSON. Use `claude auto-mode config` to see your effective config with settings applied| `claude auto-mode defaults > rules.json` `claude daemon status`| Print the background-session [supervisor’s](</docs/en/agent-view#the-supervisor-process>) state, version, socket directory, and worker count for diagnostics. Exits 1 if the supervisor isn’t running| `claude daemon status` @@ -49,10 +49,11 @@ Flag| Description| Example ---|---|--- `--add-dir`| Add additional working directories for Claude to read and edit files. Grants file access; most `.claude/` configuration is [not discovered](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) from these directories. Validates each path exists as a directory. To persist these directories across sessions, set [`permissions.additionalDirectories`](</docs/en/settings#permission-settings>) in settings| `claude --add-dir ../apps ../lib` +`--advisor <model>`| Enable the server-side [advisor tool](</docs/en/advisor>) for this session with a model alias: `opus`, `sonnet`, or `fable` (v2.1.170+), or a full model ID. Takes precedence over the `advisorModel` setting for the session. Requires Claude Code v2.1.98 or later| `claude --advisor opus` `--agent`| Specify an agent for the current session (overrides the `agent` setting)| `claude --agent my-custom-agent` `--agents`| Define custom subagents dynamically via JSON. Uses the same field names as subagent [frontmatter](</docs/en/sub-agents#supported-frontmatter-fields>), plus a `prompt` field for the agent’s instructions| `claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'` `--allow-dangerously-skip-permissions`| Add `bypassPermissions` to the `Shift+Tab` mode cycle without starting in it. Lets you begin in a different mode like `plan` and switch to `bypassPermissions` later. See [permission modes](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>)| `claude --permission-mode plan --allow-dangerously-skip-permissions` -`--allowedTools`| Tools that execute without prompting for permission. See [permission rule syntax](</docs/en/settings#permission-rule-syntax>) for pattern matching. To restrict which tools are available, use `--tools` instead| `"Bash(git log *)" "Bash(git diff *)" "Read"` +`--allowedTools`, `--allowed-tools`| Tools that execute without prompting for permission. See [permission rule syntax](</docs/en/settings#permission-rule-syntax>) for pattern matching. To restrict which tools are available, use `--tools` instead| `"Bash(git log *)" "Bash(git diff *)" "Read"` `--append-system-prompt`| Append custom text to the end of the default system prompt| `claude --append-system-prompt "Always use TypeScript"` `--append-system-prompt-file`| Load additional system prompt text from a file and append to the default prompt| `claude --append-system-prompt-file ./extra-rules.txt` `--bare`| Minimal mode: skip auto-discovery of hooks, skills, plugins, MCP servers, auto memory, and CLAUDE.md so scripted calls start faster. Claude has access to Bash, file read, and file edit tools. Sets [`CLAUDE_CODE_SIMPLE`](</docs/en/env-vars>). See [bare mode](</docs/en/headless#start-faster-with-bare-mode>)| `claude --bare -p "query"` @@ -66,12 +67,12 @@ `--debug`| Enable debug mode with optional category filtering (for example, `"api,hooks"` or `"!statsig,!file"`)| `claude --debug "api,mcp"` `--debug-file <path>`| Write debug logs to a specific file path. Implicitly enables debug mode. Takes precedence over `CLAUDE_CODE_DEBUG_LOGS_DIR`| `claude --debug-file /tmp/claude-debug.log` `--disable-slash-commands`| Disable all skills and commands for this session| `claude --disable-slash-commands` -`--disallowedTools`| Deny rules. A bare tool name removes that tool from the model’s context. A scoped rule such as `Bash(rm *)` leaves the tool available and denies only matching calls| `"Bash(git log *)" "Bash(git diff *)" "Edit"` +`--disallowedTools`, `--disallowed-tools`| Deny rules. A bare tool name removes the matching tools from the model’s context: `"Edit"` removes Edit, `"*"` removes every tool, and `"mcp__*"` removes every MCP tool. A scoped rule such as `Bash(rm *)` leaves the tool available and denies only matching calls| `"Bash(git log *)" "Bash(git diff *)" "Edit"` `--effort`| Set the [effort level](</docs/en/model-config#adjust-effort-level>) for the current session. Options: `low`, `medium`, `high`, `xhigh`, `max`; available levels depend on the model. Overrides the [`effortLevel`](</docs/en/settings#available-settings>) setting for this session and does not persist| `claude --effort high` `--enable-auto-mode`| Removed in v2.1.111. Auto mode is now in the `Shift+Tab` cycle by default; use `--permission-mode auto` to start in it| `claude --permission-mode auto` `--exclude-dynamic-system-prompt-sections`| Move per-machine sections from the system prompt (working directory, environment info, memory paths, git-repo flag) into the first user message. Improves prompt-cache reuse across different users and machines running the same task. Only applies with the default system prompt; ignored when `--system-prompt` or `--system-prompt-file` is set. Use with `-p` for scripted, multi-user workloads| `claude -p --exclude-dynamic-system-prompt-sections "query"` `--exec`| Run a shell command as a PTY-backed background job instead of starting a Claude session. Use with `--bg` to launch from the shell| `claude --bg --exec 'pytest -x'` -`--fallback-model`| Enable automatic fallback to a specified model when the default model is overloaded or not available, for example a retired model. Takes effect in print mode (`-p`) and in [background sessions](</docs/en/agent-view>), which run non-interactively; ignored in an interactive session| `claude -p --fallback-model sonnet "query"` +`--fallback-model`| Enable automatic fallback to the specified model(s) when the primary model is overloaded or not available, for example a retired model. Accepts a comma-separated list tried in order. See [Fallback model chains](</docs/en/model-config#fallback-model-chains>). To persist a chain across sessions, use the [`fallbackModel` setting](</docs/en/settings#available-settings>), which this flag overrides| `claude --fallback-model sonnet,haiku` `--fork-session`| When resuming, create a new session ID instead of reusing the original (use with `--resume` or `--continue`)| `claude --resume abc123 --fork-session` `--from-pr`| Resume sessions linked to a specific pull request. Accepts a PR number, a GitHub or GitHub Enterprise PR URL, a GitLab merge request URL, or a Bitbucket pull request URL. Sessions are linked automatically when Claude creates the pull request| `claude --from-pr 123` `--ide`| Automatically connect to IDE on startup if exactly one valid IDE is available| `claude --ide` @@ -85,7 +86,7 @@ `--max-budget-usd`| Maximum dollar amount to spend on API calls before stopping (print mode only)| `claude -p --max-budget-usd 5.00 "query"` `--max-turns`| Limit the number of agentic turns (print mode only). Exits with an error when the limit is reached. No limit by default| `claude -p --max-turns 3 "query"` `--mcp-config`| Load MCP servers from JSON files or strings (space-separated)| `claude --mcp-config ./mcp.json` -`--model`| Sets the model for the current session with an alias for the latest model (`sonnet` or `opus`) or a model’s full name. Overrides the [`model`](</docs/en/settings#available-settings>) setting and [`ANTHROPIC_MODEL`](</docs/en/model-config#environment-variables>)| `claude --model claude-sonnet-4-6` +`--model`| Sets the model for the current session with an alias for the latest model (`sonnet`, `opus`, `haiku`, or `fable`) or a model’s full name. Overrides the [`model`](</docs/en/settings#available-settings>) setting and [`ANTHROPIC_MODEL`](</docs/en/model-config#environment-variables>)| `claude --model claude-sonnet-4-6` `--name`, `-n`| Set a display name for the session, shown in `/resume` and the terminal title. You can resume a named session with `claude --resume <name>`. [`/rename`](</docs/en/commands>) changes the name mid-session and also shows it on the prompt bar| `claude -n "my-feature-work"` @@ -103,6 +104,7 @@ `--remote-control-session-name-prefix <prefix>`| Prefix for auto-generated [Remote Control](</docs/en/remote-control>) session names when no explicit name is set. Defaults to your machine’s hostname, producing names like `myhost-graceful-unicorn`. Set `CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX` for the same effect| `claude remote-control --remote-control-session-name-prefix dev-box` `--replay-user-messages`| Re-emit user messages from stdin back on stdout for acknowledgment. Requires `--input-format stream-json` and `--output-format stream-json`| `claude -p --input-format stream-json --output-format stream-json --verbose --replay-user-messages` `--resume`, `-r`| Resume a specific session by ID or name, or show an interactive picker to choose a session. Includes sessions that added this directory with `/add-dir`. As of v2.1.144, [background sessions](</docs/en/agent-view>) appear in the picker marked with `bg`| `claude --resume auth-refactor` +`--safe-mode`| Start with all customizations disabled to troubleshoot a broken configuration: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, custom keybindings, status line and file-suggestion commands, LSP servers, and auto-memory do not load. Authentication, model selection, built-in tools, and permissions work normally, which differs from [`--bare`](</docs/en/headless#start-faster-with-bare-mode>). Managed settings policy still applies, including policy-configured hooks, status line, and file-suggestion commands; managed plugins, managed skills, managed CLAUDE.md, and policy-configured MCP servers do not. Useful for checking whether a customization is what triggers [automatic fallback from Fable 5](</docs/en/model-config#automatic-model-fallback>). Sets [`CLAUDE_CODE_SAFE_MODE`](</docs/en/env-vars>)| `claude --safe-mode` `--session-id`| Use a specific session ID for the conversation (must be a valid UUID)| `claude --session-id "550e8400-e29b-41d4-a716-446655440000"` `--setting-sources`| Comma-separated list of setting sources to load (`user`, `project`, `local`)| `claude --setting-sources user,project` `--settings`| Path to a settings JSON file or an inline JSON string. Values you set here override the same keys in your `settings.json` files for this session. Keys you omit keep their file-based values. See [settings precedence](</docs/en/settings#settings-precedence>)| `claude --settings ./settings.json` @@ -112,7 +114,7 @@ `--teleport`| Resume a [web session](</docs/en/claude-code-on-the-web>) in your local terminal| `claude --teleport` `--teammate-mode`| Set how [agent team](</docs/en/agent-teams>) teammates display: `auto` (default), `in-process`, or `tmux`. Overrides the [`teammateMode`](</docs/en/settings#available-settings>) setting for this session. See [Choose a display mode](</docs/en/agent-teams#choose-a-display-mode>)| `claude --teammate-mode in-process` `--tmux`| Create a tmux session for the worktree. Requires `--worktree`. Uses iTerm2 native panes when available; pass `--tmux=classic` for traditional tmux| `claude -w feature-auth --tmux` -`--tools`| Restrict which built-in tools Claude can use. Use `""` to disable all, `"default"` for all, or tool names like `"Bash,Edit,Read"`| `claude --tools "Bash,Edit,Read"` +`--tools`| Restrict which built-in tools Claude can use. Use `""` to disable all, `"default"` for all, or tool names like `"Bash,Edit,Read"`. MCP tools are not affected; to deny those too, use `--disallowedTools "mcp__*"`, or pass `--strict-mcp-config` without `--mcp-config` so no MCP servers load| `claude --tools "Bash,Edit,Read"` `--verbose`| Enable verbose logging, shows full turn-by-turn output. Overrides the [`viewMode`](</docs/en/settings#available-settings>) setting for this session| `claude --verbose` `--version`, `-v`| Output the version number| `claude -v` `--worktree`, `-w`| Start Claude in an isolated [git worktree](</docs/en/worktrees>) at `<repo>/.claude/worktrees/<name>`. If no name is given, one is auto-generated. Pass `#<number>` or a GitHub pull request URL to fetch that PR from `origin` and branch the worktree from it| `claude -w feature-auth`
modified Commands View current →
--- a/commands.md +++ b/commands.md @@ -26,12 +26,14 @@ Command| Purpose ---|--- `/add-dir <path>`| Add a working directory for file access during the current session. Most `.claude/` configuration is [not discovered](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) from the added directory. You can later resume the session from the added directory with `--continue` or `--resume` +`/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 `opus`, `sonnet`, `fable` (v2.1.170+), or a full model ID. Without an argument, opens a picker. Requires Claude Code v2.1.98 or later `/agents`| Manage [agent](</docs/en/sub-agents>) configurations -`/autofix-pr [prompt]`| Spawn a [Claude Code on the web](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>) session that watches the current branch’s PR and pushes fixes when CI fails or reviewers leave comments. Detects the open PR from your checked-out branch with `gh pr view`; to watch a different PR, check out its branch first. By default the remote session is told to fix every CI failure and review comment; pass a prompt to give it different instructions, for example `/autofix-pr only fix lint and type errors`. Requires the `gh` CLI and access to [Claude Code on the web](</docs/en/claude-code-on-the-web#who-can-use-claude-code-on-the-web>) +`/autofix-pr [prompt]`| Spawn a [Claude Code on the web](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>) session that watches the current branch’s PR and pushes fixes when CI fails or reviewers leave comments. Detects the open PR from your checked-out branch with `gh pr view`; to watch a different PR, check out its branch first. By default the cloud session is told to fix every CI failure and review comment; pass a prompt to give it different instructions, for example `/autofix-pr only fix lint and type errors`. Requires the `gh` CLI and access to [Claude Code on the web](</docs/en/claude-code-on-the-web>) `/background [prompt]`| Detach the current session to run as a [background agent](</docs/en/agent-view>) and free this terminal. Pass a prompt to send one more instruction before detaching. Monitor the session with `claude agents`. Alias: `/bg` `/batch <instruction>`| **[Skill](</docs/en/skills#bundled-skills>).** Orchestrate large-scale changes across a codebase in parallel. Researches the codebase, decomposes the work into 5 to 30 independent units, and presents a plan. Once approved, spawns one [background subagent](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) per unit in an isolated [git worktree](</docs/en/worktrees>). Each subagent implements its unit, runs tests, and opens a pull request. Requires a git repository. Example: `/batch migrate src/ from Solid to React` `/branch [name]`| Create a branch of the current conversation at this point, so you can try a different direction without losing the conversation as it stands. Switches you into the branch and preserves the original, which you can return to with `/resume`. To hand a side task to a background subagent instead of switching into a copy yourself, use `/fork` `/btw <question>`| Ask a quick [side question](</docs/en/interactive-mode#side-questions-with-%2Fbtw>) without adding to the conversation +`/cd <path>`| Move this session to a new working directory. The conversation’s prompt cache is preserved: the new directory’s [`CLAUDE.md`](</docs/en/memory>) is appended as a message instead of rebuilding the system prompt. The session is relocated to the new directory’s project storage, so `--resume` and `--continue` find it from there. Prompts you to trust the directory if you haven’t worked in it before. To grant access to an extra directory without moving the session, use `/add-dir`. Restrict or disable `/cd` targets with [`Cd` permission rules](</docs/en/permissions#cd>). Requires Claude Code v2.1.169 or later; earlier versions report `Unknown command: /cd` `/chrome`| Configure [Claude in Chrome](</docs/en/chrome>) settings `/claude-api [migrate|managed-agents-onboard]`| **[Skill](</docs/en/skills#bundled-skills>).** Load Claude API reference material for your project’s language (Python, TypeScript, Java, Go, Ruby, C#, PHP, or cURL) and Managed Agents reference. Covers tool use, streaming, batches, structured outputs, and common pitfalls. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk`. Run `/claude-api migrate` to upgrade existing Claude API code to a newer model: Claude asks which files to scan and which model to target, then updates model IDs, thinking configuration, and other parameters that changed between versions. Run `/claude-api managed-agents-onboard` for an interactive walkthrough that creates a new Managed Agent from scratch `/clear [name]`| Start a new conversation with empty context. The previous conversation stays available in `/resume`. Pass a name to label the previous conversation in the `/resume` picker. To free up context while continuing the same conversation, use `/compact` instead. Aliases: `/reset`, `/new` @@ -68,7 +70,7 @@ `/login`| Sign in to your Anthropic account `/logout`| Sign out from your Anthropic account `/loop [interval] [prompt]`| **[Skill](</docs/en/skills#bundled-skills>).** Run a prompt repeatedly while the session stays open. Omit the interval and Claude self-paces between iterations. Omit the prompt and, [where available](</docs/en/scheduled-tasks#run-the-built-in-maintenance-prompt>), Claude runs an autonomous maintenance check or the prompt in `.claude/loop.md`. Example: `/loop 5m check if the deploy finished`. See [Run prompts on a schedule](</docs/en/scheduled-tasks>). Alias: `/proactive` -`/mcp`| Manage MCP server connections and OAuth authentication +`/mcp [reconnect <server>|enable|disable [<server>|all]]`| Manage MCP server connections and OAuth authentication. Run with no argument to open the interactive list, pass `reconnect <server>` to reconnect one disconnected server, or pass `enable`/`disable` with a server name or `all` to change connection state without opening the dialog `/memory`| Edit `CLAUDE.md` memory files, enable or disable [auto-memory](</docs/en/memory#auto-memory>), and view auto-memory entries `/mobile`| Show QR code to download the Claude mobile app. Aliases: `/ios`, `/android` `/model [model]`| Switch the AI model and save it as your default for new sessions. For models that support it, use left/right arrows to [adjust effort level](</docs/en/model-config#adjust-effort-level>). With no argument, opens a picker; press `s` on a row to switch for the current session only. The picker asks for confirmation when the conversation has prior output, since the next response re-reads the full history without cached context. Once confirmed, the change applies without waiting for the current response to finish
modified Communications kit View current →
--- a/communications-kit.md +++ b/communications-kit.md @@ -214,7 +214,10 @@ mid-session. *Sonnet* is the workhorse default for everyday feature work, bugs, tests, and reviews. Reach for *Opus* on large refactors, gnarly debugging, or anything high-stakes. Drop to *Haiku* for quick questions, - formatting, and mechanical edits where speed wins. + formatting, and mechanical edits where speed wins. *Fable 5* is the most + capable model for your hardest, longest-running tasks; it is not the + default, so select it with `/model fable`, and note that cybersecurity and + biology content falls back to Opus automatically. *Try it now:* type `/model` and pick Sonnet if you haven't already. It is the right default for most tasks. @@ -223,6 +226,7 @@ Model| Best for ---|--- +Fable 5| The hardest, longest-running tasks. Opt-in only: select it with `/model fable`. Cybersecurity or biology content [falls back to Opus](</docs/en/model-config#automatic-model-fallback>) Opus| Large-scale refactors, complex debugging, architecture decisions, high-stakes changes Sonnet| Everyday feature work, bug fixes, tests, documentation, code review. Recommended default. Haiku| Quick questions, formatting, mechanical edits, rapid iteration
modified Explore the context window View current →
--- a/context-window.md +++ b/context-window.md @@ -45,7 +45,7 @@ * **Clear between tasks** : run `/clear` when switching to unrelated work. Old conversation crowds out the files you need next and costs tokens on every message. * **Delegate large reads** : send research to a [subagent](</docs/en/sub-agents>) so the file contents stay in its context window, not yours. -If you need a larger window rather than a smaller conversation, Opus 4.6 and later, and Sonnet 4.6, support a 1 million token context window. See [Extended context](</docs/en/model-config#extended-context>) for availability by plan and how to select a `[1m]` model variant. Compaction works the same way at the larger limit. +If you need a larger window rather than a smaller conversation, Fable 5, Opus 4.6 and later, and Sonnet 4.6 support a 1 million token context window. See [Extended context](</docs/en/model-config#extended-context>) for availability by plan and how to select a `[1m]` model variant. Compaction works the same way at the larger limit. ##
modified Track cost and usage View current →
--- a/cost-tracking.md +++ b/cost-tracking.md @@ -210,12 +210,21 @@ TypeScript - options = ClaudeAgentOptions( - env={ - "CLAUDE_CODE_USE_BEDROCK": "1", - "ENABLE_PROMPT_CACHING_1H": "1", - }, - ) + from claude_agent_sdk import ClaudeAgentOptions, query + import asyncio + + async def main(): + options = ClaudeAgentOptions( + env={ + "CLAUDE_CODE_USE_BEDROCK": "1", + "ENABLE_PROMPT_CACHING_1H": "1", + }, + ) + + async for message in query(prompt="Summarize this project", options=options): + print(message) + + asyncio.run(main()) Cache writes with a 1-hour TTL are billed at a higher rate than 5-minute writes, so enabling this trades higher write cost for more cache reads. See [prompt caching pricing](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching>) for details. Claude subscription users already receive 1-hour TTL automatically and do not need to set this variable.
modified Manage costs effectively View current →
--- a/costs.md +++ b/costs.md @@ -180,7 +180,7 @@ Adjust extended thinking -Extended thinking is enabled by default because it significantly improves performance on complex planning and reasoning tasks. Thinking tokens are billed as output tokens, and the default budget can be tens of thousands of tokens per request depending on the model. For simpler tasks where deep reasoning isn’t needed, you can reduce costs by lowering the [effort level](</docs/en/model-config#adjust-effort-level>) with `/effort` or in `/model`, disabling thinking in `/config`, or lowering the budget with `MAX_THINKING_TOKENS=8000`. +Extended thinking is enabled by default because it significantly improves performance on complex planning and reasoning tasks. Thinking tokens are billed as output tokens, and the default budget can be tens of thousands of tokens per request depending on the model. For simpler tasks where deep reasoning isn’t needed, you can reduce costs by lowering the [effort level](</docs/en/model-config#adjust-effort-level>) with `/effort` or in `/model`, disabling thinking in `/config`, or, on models with a [fixed thinking budget](</docs/en/model-config#adaptive-reasoning-and-fixed-thinking-budgets>), lowering the budget with `MAX_THINKING_TOKENS=8000`. Adaptive-reasoning models ignore nonzero budgets, so use effort levels there instead. Disabling thinking is not available on Fable 5, which always uses extended thinking. ###
modified Give Claude custom tools View current →
--- a/custom-tools.md +++ b/custom-tools.md @@ -30,7 +30,7 @@ * **Description:** what the tool does. Claude reads this to decide when to call it. * **Input schema:** the arguments Claude must provide. In TypeScript this is always a [Zod schema](<https://zod.dev/>), and the handler’s `args` are typed from it automatically. In Python this is a dict mapping names to types, like `{"latitude": float}`, which the SDK converts to JSON Schema for you. The Python decorator also accepts a full [JSON Schema](<https://json-schema.org/understanding-json-schema/about>) dict directly when you need enums, ranges, optional fields, or nested objects. * **Handler:** the async function that runs when Claude calls the tool. It receives the validated arguments and must return an object with: - * `content` (required): an array of result blocks, each with a `type` of `"text"`, `"image"`, or `"resource"`. See Return images and resources for non-text blocks. + * `content` (required): an array of result blocks, each with a `type` of `"text"`, `"image"`, `"audio"`, `"resource"`, or `"resource_link"`. See Return images and resources for non-text blocks. * `structuredContent` (optional): a JSON object holding the result as machine-readable data, returned alongside `content`. See Return structured data. * `isError` (optional): set to `true` to signal a tool failure so Claude can react to it. See Handle errors. @@ -309,7 +309,7 @@ Return images and resources -The `content` array in a tool result accepts `text`, `image`, and `resource` blocks. You can mix them in the same response. +The `content` array in a tool result accepts `text`, `image`, `audio`, `resource`, and `resource_link` blocks. You can mix them in the same response. Audio blocks are saved to disk and Claude receives a text block with the saved file path. Resource link blocks are converted to a text block containing the link’s name, URI, and description. ###
modified Data usage View current →
--- a/data-usage.md +++ b/data-usage.md @@ -108,7 +108,7 @@ Telemetry services -Claude Code connects from users’ machines to Anthropic to log operational metrics such as latency, reliability, and usage patterns. This logging does not include any code or file paths. Data is encrypted in transit and at rest. To opt out of telemetry, set the `DISABLE_TELEMETRY` environment variable. Claude Code connects from users’ machines to Sentry for operational error logging. The data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the [Sentry security documentation](<https://sentry.io/security/>). To opt out of error logging, set the `DISABLE_ERROR_REPORTING` environment variable. When you run the `/feedback` command, a copy of your conversation history including code is sent to Anthropic. Before submitting, you choose how much history to include: the current session only, which is the default, or also other sessions from the same project over the last 24 hours or 7 days. The data is encrypted in transit via TLS. Optionally, a GitHub issue is created in the public repository. To opt out, set the `DISABLE_FEEDBACK_COMMAND` environment variable to `1`. When you use a third-party provider such as Bedrock or Vertex, or have no Anthropic credentials configured, `/feedback` writes the report to a local archive under `~/.claude/feedback-bundles/` instead of sending it to Anthropic. Known API key and token patterns are redacted before the archive is written. Nothing leaves your machine until you send that file to your Anthropic account representative or attach it to a support request. +Claude Code connects from users’ machines to Anthropic to log operational metrics such as latency, reliability, and usage patterns. This logging does not include any code or file paths. Data is encrypted in transit and at rest. To opt out of telemetry, set the `DISABLE_TELEMETRY` environment variable. Claude Code connects from users’ machines to Sentry for operational error logging. The data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the [Sentry security documentation](<https://sentry.io/security/>). To opt out of error logging, set the `DISABLE_ERROR_REPORTING` environment variable. When you run the `/feedback` command, a copy of your conversation history including code is sent to Anthropic. Before submitting, you choose how much history to include: the current session only, which is the default, or also other sessions from the same project over the last 24 hours or 7 days. The data is encrypted in transit via TLS and stored in Google Cloud Storage, which encrypts stored data at rest by default. Optionally, a GitHub issue is created in the public repository. To opt out, set the `DISABLE_FEEDBACK_COMMAND` environment variable to `1`. When you use a third-party provider such as Bedrock or Vertex, or have no Anthropic credentials configured, `/feedback` writes the report to a local archive under `~/.claude/feedback-bundles/` instead of sending it to Anthropic. Known API key and token patterns are redacted before the archive is written. Nothing leaves your machine until you send that file to your Anthropic account representative or attach it to a support request. ##
modified Debug your configuration View current →
--- a/debug-your-config.md +++ b/debug-your-config.md @@ -60,7 +60,7 @@ Test against a clean configuration -If targeted checks don’t isolate the cause, or your configuration is in an unknown state, compare against a session that loads nothing from your usual setup. Point [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>) at an empty directory to bypass everything under `~/.claude`, and launch from a directory that has no `.claude` folder, `.mcp.json`, or `CLAUDE.md` so project configuration is also skipped. +Start with [`claude --safe-mode`](</docs/en/cli-reference#cli-flags>), which launches a session with all customizations disabled, including `CLAUDE.md`, skills, plugins, hooks, MCP servers, and custom commands and agents. Authentication, model selection, built-in tools, and permissions work normally. If the problem disappears in safe mode, one of those surfaces is the cause; use the targeted checks above to find which. Managed settings deployed by your organization still partially apply, so policy-configured hooks and status line run even in safe mode. If the problem persists in safe mode, or your settings themselves are suspect, compare against a session that loads nothing from your usual setup. Point [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>) at an empty directory to bypass everything under `~/.claude`, and launch from a directory that has no `.claude` folder, `.mcp.json`, or `CLAUDE.md` so project configuration is also skipped. cd /tmp && CLAUDE_CONFIG_DIR=/tmp/claude-clean claude
modified Desktop application View current →
Show diff (173 lines)
--- a/desktop.md +++ b/desktop.md @@ -29,7 +29,7 @@ Before you send your first message, configure four things in the prompt area: * **Environment** : choose where Claude runs. Select **Local** for your machine, **Remote** for Anthropic-hosted cloud sessions, or an **SSH connection** for a remote machine you manage. See environment configuration. - * **Project folder** : select the folder or repository Claude works in. For remote sessions, you can add multiple repositories. + * **Project folder** : select the folder or repository Claude works in. For cloud sessions, you can add multiple repositories. * **Model** : pick a [model](</docs/en/model-config#available-models>) from the dropdown next to the send button. You can change this during the session. * **Permission mode** : choose how much autonomy Claude has from the mode selector. You can change this during the session. @@ -59,7 +59,7 @@ The prompt box supports two ways to bring in external context: - * **@mention files** : type `@` followed by a filename to add a file to the conversation context. Claude can then read and reference that file. @mention is not available in remote sessions. + * **@mention files** : type `@` followed by a filename to add a file to the conversation context. Claude can then read and reference that file. @mention is not available in cloud sessions. * **Attach files** : attach images, PDFs, and other files to your prompt using the attachment button, or drag and drop files directly into the prompt. This is useful for sharing screenshots of bugs, design mockups, or reference documents. ### @@ -76,13 +76,13 @@ **Auto accept edits**| `acceptEdits`| Claude auto-accepts file edits and common filesystem commands like `mkdir`, `touch`, and `mv`, but still asks before running other terminal commands. Use this when you trust file changes and want faster iteration. **Plan mode**| `plan`| Claude reads files and runs commands to explore, then proposes a plan without editing your source code. Good for complex tasks where you want to review the approach first. **Auto**| `auto`| Claude executes all actions with background safety checks that verify alignment with your request. Reduces permission prompts while maintaining oversight. Enable in your Settings → Claude Code. See availability requirements below. -**Bypass permissions**| `bypassPermissions`| Claude runs without any permission prompts, equivalent to `--dangerously-skip-permissions` in the CLI. Enable in your Settings → Claude Code under “Allow bypass permissions mode”. Only use this in sandboxed containers or VMs. Enterprise admins can disable this option. +**Bypass permissions**| `bypassPermissions`| Claude runs without permission prompts, except those forced by explicit [ask rules](</docs/en/permissions#manage-permissions>); equivalent to `--dangerously-skip-permissions` in the CLI. Enable in your Settings → Claude Code under “Allow bypass permissions mode”. Only use this in sandboxed containers or VMs. Enterprise admins can disable this option. The `dontAsk` permission mode is available only in the [CLI](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>). Auto mode is a research preview available to all users on the Anthropic API and requires Claude Opus 4.6 or later, or Sonnet 4.6. In Enterprise deployments that route Desktop to Google Cloud Vertex AI, auto mode is off until you [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>), and only Claude Opus 4.7 and Opus 4.8 are supported there. Start complex tasks in Plan mode so Claude maps out an approach before making changes. Once you approve the plan, switch to Auto accept edits or Ask permissions to execute it. See [explore first, then plan, then code](</docs/en/best-practices#explore-first-then-plan-then-code>) for more on this workflow. -Remote sessions support Auto accept edits and Plan mode. Ask permissions is not available because remote sessions auto-accept file edits by default, and Bypass permissions is not available because the remote environment is already sandboxed. Enterprise admins can restrict which permission modes are available. See enterprise configuration for details. +Cloud sessions support Accept edits, Plan mode, and Auto mode. Accept edits corresponds to `default` mode: cloud sessions pre-approve file edits, so the selector shows Accept edits instead of Ask permissions. Bypass permissions is not available because the cloud environment is already sandboxed. Enterprise admins can restrict which permission modes are available. See enterprise configuration for details. ### @@ -160,7 +160,7 @@ Open and edit files -Click a file path in the chat or diff viewer to open it in the file pane. HTML, PDF, image, and video paths open in the preview pane instead. Make spot edits and click **Save** to write them back. If the file changed on disk since you opened it, the pane warns you and lets you override or discard. Click **Discard** to revert your edits, or click the path in the pane header to copy the absolute path. The file pane is available in local and SSH sessions. For remote sessions, ask Claude to make the change. +Click a file path in the chat or diff viewer to open it in the file pane. HTML, PDF, image, and video paths open in the preview pane instead. Make spot edits and click **Save** to write them back. If the file changed on disk since you opened it, the pane warns you and lets you override or discard. Click **Discard** to revert your edits, or click the path in the pane header to copy the absolute path. The file pane is available in local and SSH sessions. For cloud sessions, ask Claude to make the change. ### @@ -350,7 +350,7 @@ Run long-running tasks remotely -For large refactors, test suites, migrations, or other long-running tasks, select **Remote** instead of **Local** when starting a session. Remote sessions run on Anthropic’s cloud infrastructure and continue even if you close the app or shut down your computer. Check back anytime to see progress or steer Claude in a different direction. You can also monitor remote sessions from [claude.ai/code](<https://claude.ai/code>) or the Claude iOS app. Remote sessions also support multiple repositories. After selecting a cloud environment, click the **+** button next to the repo pill to add additional repositories to the session. Each repo gets its own branch selector. This is useful for tasks that span multiple codebases, such as updating a shared library and its consumers. See [Claude Code on the web](</docs/en/claude-code-on-the-web>) for more on how remote sessions work. +For large refactors, test suites, migrations, or other long-running tasks, select **Remote** instead of **Local** when starting a session. Cloud sessions run on Anthropic’s cloud infrastructure and continue even if you close the app or shut down your computer. Check back anytime to see progress or steer Claude in a different direction. You can also monitor cloud sessions from [claude.ai/code](<https://claude.ai/code>) or the Claude iOS app. Cloud sessions also support multiple repositories. After selecting a cloud environment, click the **+** button next to the repo pill to add additional repositories to the session. Each repo gets its own branch selector. This is useful for tasks that span multiple codebases, such as updating a shared library and its consumers. See [Claude Code on the web](</docs/en/claude-code-on-the-web>) for more on how cloud sessions work. ### @@ -360,7 +360,7 @@ The **Continue in** menu, accessible from the VS Code icon in the bottom right of the session toolbar, lets you move your session to another surface: - * **Claude Code on the Web** : sends your local session to continue running remotely. Desktop pushes your branch, generates a summary of the conversation, and creates a new remote session with the full context. You can then choose to archive the local session or keep it. This requires a clean working tree, and is not available for SSH sessions. + * **Claude Code on the Web** : sends your local session to continue running remotely. Desktop pushes your branch, generates a summary of the conversation, and creates a new cloud session with the full context. You can then choose to archive the local session or keep it. This requires a clean working tree, and is not available for SSH sessions. * **Your IDE** : opens your project in a supported IDE at the current working directory. ### @@ -385,7 +385,7 @@ Connect external tools -For local and SSH sessions, click the **+** button next to the prompt box and select **Connectors** to add integrations like Google Calendar, Slack, GitHub, Linear, Notion, and more. You can add connectors before or during a session. The **+** button is not available in remote sessions, but [routines](</docs/en/routines>) configure connectors at routine creation time. To manage or disconnect connectors, go to Settings → Connectors in the desktop app, or select **Manage connectors** from the Connectors menu in the prompt box. Once connected, Claude can read your calendar, send messages, create issues, and interact with your tools directly. You can ask Claude what connectors are configured in your session. Connectors are [MCP servers](</docs/en/mcp>) with a graphical setup flow. Use them for quick integration with supported services. For integrations not listed in Connectors, add MCP servers manually via [settings files](</docs/en/mcp#installing-mcp-servers>). You can also [create custom connectors](<https://support.claude.com/en/articles/11175166-getting-started-with-custom-connectors-using-remote-mcp>). +For local and SSH sessions, click the **+** button next to the prompt box and select **Connectors** to add integrations like Google Calendar, Slack, GitHub, Linear, Notion, and more. You can add connectors before or during a session. The **+** button is not available in cloud sessions, but [routines](</docs/en/routines>) configure connectors at routine creation time. To manage or disconnect connectors, go to Settings → Connectors in the desktop app, or select **Manage connectors** from the Connectors menu in the prompt box. Once connected, Claude can read your calendar, send messages, create issues, and interact with your tools directly. You can ask Claude what connectors are configured in your session. Connectors are [MCP servers](</docs/en/mcp>) with a graphical setup flow. Use them for quick integration with supported services. For integrations not listed in Connectors, add MCP servers manually via [settings files](</docs/en/mcp#installing-mcp-servers>). You can also [create custom connectors](<https://support.claude.com/en/articles/11175166-getting-started-with-custom-connectors-using-remote-mcp>). ### @@ -401,7 +401,7 @@ Install plugins -[Plugins](</docs/en/plugins>) are reusable packages that add skills, agents, hooks, MCP servers, and LSP configurations to Claude Code. You can install plugins from the desktop app without using the terminal. For local and SSH sessions, click the **+** button next to the prompt box and select **Plugins** to see your installed plugins and their skills. To add a plugin, select **Add plugin** from the submenu to open the plugin browser, which shows available plugins from your configured [marketplaces](</docs/en/plugin-marketplaces>) including the official Anthropic marketplace. Select **Manage plugins** to enable, disable, or uninstall plugins. Plugins can be scoped to your user account, a specific project, or local-only. If your organization manages plugins centrally, those plugins are available in desktop sessions the same way they are in the CLI. Plugins are not available for remote sessions. For the full plugin reference including creating your own plugins, see [plugins](</docs/en/plugins>). +[Plugins](</docs/en/plugins>) are reusable packages that add skills, agents, hooks, MCP servers, and LSP configurations to Claude Code. You can install plugins from the desktop app without using the terminal. For local and SSH sessions, click the **+** button next to the prompt box and select **Plugins** to see your installed plugins and their skills. To add a plugin, select **Add plugin** from the submenu to open the plugin browser, which shows available plugins from your configured [marketplaces](</docs/en/plugin-marketplaces>) including the official Anthropic marketplace. Select **Manage plugins** to enable, disable, or uninstall plugins. Plugins can be scoped to your user account, a specific project, or local-only. If your organization manages plugins centrally, those plugins are available in desktop sessions the same way they are in the CLI. Plugins are not available for cloud sessions. For the full plugin reference including creating your own plugins, see [plugins](</docs/en/plugins>). ### @@ -564,15 +564,15 @@ Local sessions -The desktop app does not always inherit your full shell environment. On macOS, when you launch the app from the Dock or Finder, it reads your shell profile, such as `~/.zshrc` or `~/.bashrc`, to extract `PATH` and a fixed set of Claude Code variables, but other variables you export there are not picked up. On Windows, the app inherits user and system environment variables but does not read PowerShell profiles. To set environment variables for local sessions and dev servers on any platform, open the environment dropdown in the prompt box, hover over **Local** , and click the gear icon to open the local environment editor. Variables you save here are stored encrypted on your machine and apply to every local session and preview server you start. You can also add variables to the `env` key in your `~/.claude/settings.json` file, though these reach Claude sessions only and not dev servers. See [environment variables](</docs/en/env-vars>) for the full list of supported variables. [Extended thinking](</docs/en/model-config#extended-thinking>) is enabled by default, which improves performance on complex reasoning tasks but uses additional tokens. To disable thinking entirely, set `MAX_THINKING_TOKENS` to `0` in the local environment editor. On models with [adaptive reasoning](</docs/en/model-config#adjust-effort-level>), any other `MAX_THINKING_TOKENS` value is ignored because adaptive reasoning controls thinking depth instead. On Opus 4.6 and Sonnet 4.6, set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` to `1` to use a fixed thinking budget; Opus 4.7 and later always use adaptive reasoning and have no fixed-budget mode. - -### - -​ - -Remote sessions - -Remote sessions continue in the background even if you close the app. Usage counts toward your [subscription plan limits](</docs/en/costs>) with no separate compute charges. You can create custom cloud environments with different network access levels and environment variables. Select the environment dropdown when starting a remote session and choose **Add environment**. See [the cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>) for details on configuring network access and environment variables. +The desktop app does not always inherit your full shell environment. On macOS, when you launch the app from the Dock or Finder, it reads your shell profile, such as `~/.zshrc` or `~/.bashrc`, to extract `PATH` and a fixed set of Claude Code variables, but other variables you export there are not picked up. On Windows, the app inherits user and system environment variables but does not read PowerShell profiles. To set environment variables for local sessions and dev servers on any platform, open the environment dropdown in the prompt box, hover over **Local** , and click the gear icon to open the local environment editor. Variables you save here are stored encrypted on your machine and apply to every local session and preview server you start. You can also add variables to the `env` key in your `~/.claude/settings.json` file, though these reach Claude sessions only and not dev servers. See [environment variables](</docs/en/env-vars>) for the full list of supported variables. [Extended thinking](</docs/en/model-config#extended-thinking>) is enabled by default, which improves performance on complex reasoning tasks but uses additional tokens. To disable thinking, set `MAX_THINKING_TOKENS` to `0` in the local environment editor; this has no effect on Fable 5, which always uses extended thinking. On [third-party providers](</docs/en/third-party-integrations>), `0` omits the `thinking` parameter instead, and adaptive-reasoning models may still think. On models with [adaptive reasoning](</docs/en/model-config#adjust-effort-level>), any other `MAX_THINKING_TOKENS` value is ignored because adaptive reasoning controls thinking depth instead. On Opus 4.6 and Sonnet 4.6, set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` to `1` to use a fixed thinking budget; Opus 4.7 and later always use adaptive reasoning and have no fixed-budget mode. + +### + +​ + +Cloud sessions + +Cloud sessions continue in the background even if you close the app. Usage counts toward your [subscription plan limits](</docs/en/costs>) with no separate compute charges. You can create custom cloud environments with different network access levels and environment variables. Select the environment dropdown when starting a cloud session and choose **Add environment**. See [the cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>) for details on configuring network access and environment variables. ### @@ -674,7 +674,7 @@ IT teams can manage the desktop app through MDM on macOS or group policy on Windows. Available policies include enabling or disabling the Claude Code feature, controlling auto-updates, and setting a custom deployment URL. - * **macOS** : configure via `com.anthropic.Claude` preference domain using tools like Jamf or Kandji + * **macOS** : configure via `com.anthropic.claudefordesktop` preference domain using tools like Jamf or Kandji * **Windows** : configure via registry at `SOFTWARE\Policies\Claude` ### @@ -691,7 +691,7 @@ Data handling -Claude Code processes your code locally in local sessions or on Anthropic’s cloud infrastructure in remote sessions. Conversations and code context are sent to Anthropic’s API for processing. See [data handling](</docs/en/data-usage>) for details on data retention, privacy, and compliance. +Claude Code processes your code locally in local sessions or on Anthropic’s cloud infrastructure in cloud sessions. Conversations and code context are sent to Anthropic’s API for processing. See [data handling](</docs/en/data-usage>) for details on data retention, privacy, and compliance. ### @@ -730,7 +730,7 @@ `--resume`, `--continue`| Click a session in the sidebar `--permission-mode`| Mode selector next to the send button `--dangerously-skip-permissions`| Bypass permissions mode. Enable in Settings → Claude Code → “Allow bypass permissions mode”. Enterprise admins can disable this setting. -`--add-dir`| Add multiple repos with the **+** button in remote sessions +`--add-dir`| Add multiple repos with the **+** button in cloud sessions `--allowedTools`, `--disallowedTools`| No per-session equivalent. Permission rules in [settings files](</docs/en/settings>) still apply. `--verbose`| Verbose view mode in the Transcript view dropdown `--print`, `--output-format`| Not available. Desktop is interactive only. @@ -749,7 +749,7 @@ * **[MCP servers](</docs/en/mcp>)** configured in `~/.claude.json` or `.mcp.json` work in both * **[Hooks](</docs/en/hooks>)** and **[skills](</docs/en/skills>)** defined in settings apply to both * **[Settings](</docs/en/settings>)** in `~/.claude.json` and `~/.claude/settings.json` are shared. Permission rules, allowed tools, and other settings in `settings.json` apply to Desktop sessions. - * **Models** : Sonnet, Opus, and Haiku are available in both. In Desktop, select the model from the dropdown next to the send button. You can change the model mid-session from the same dropdown. + * **Models** : the same [models](</docs/en/model-config#available-models>) are available in both. In Desktop, select the model from the dropdown next to the send button. You can change the model mid-session from the same dropdown. **MCP servers from the Claude Desktop chat app** : the Desktop app loads MCP servers from `claude_desktop_config.json` into Code tab sessions, alongside servers from `~/.claude.json` and `.mcp.json`. A server defined in `claude_desktop_config.json` is available in both the Desktop chat surface and the Code tab.The standalone CLI does not read `claude_desktop_config.json`. On macOS and WSL, run `claude mcp add-from-claude-desktop` to copy those servers into `~/.claude.json`. See [Import MCP servers from Claude Desktop](</docs/en/mcp#import-mcp-servers-from-claude-desktop>) for the import flow and scope options. @@ -765,7 +765,7 @@ ---|---|--- Permission modes| All modes including `dontAsk`| Ask permissions, Auto accept edits, Plan mode, Auto, and Bypass permissions via Settings `--dangerously-skip-permissions`| CLI flag| Bypass permissions mode. Enable in Settings → Claude Code → “Allow bypass permissions mode” -[Third-party providers](</docs/en/third-party-integrations>)| Bedrock, Vertex, Foundry| Anthropic’s API by default. Enterprise deployments can configure Vertex AI and gateway providers. See the [enterprise configuration guide](<https://support.claude.com/en/articles/12622667-enterprise-configuration>). +[Third-party providers](</docs/en/third-party-integrations>)| Bedrock, Vertex AI, Foundry| Anthropic’s API by default. Enterprise deployments can configure Vertex AI and gateway providers. See the [enterprise configuration guide](<https://support.claude.com/en/articles/12622667-enterprise-configuration>). To run the Code tab on Bedrock, Vertex AI, Foundry, or a self-hosted LLM gateway, see the [Cowork on 3P research preview](<https://claude.com/docs/cowork/3p/overview>). [MCP servers](</docs/en/mcp>)| Configure in settings files| Connectors UI for local and SSH sessions, or settings files [Plugins](</docs/en/plugins>)| `/plugin` command| Plugin manager UI @mention files| Text-based| With autocomplete; local and SSH sessions only @@ -783,9 +783,9 @@ What’s not available in Desktop -The following features are only available in the CLI or VS Code extension: - - * **Third-party providers** : Desktop connects to Anthropic’s API by default. Enterprise deployments can configure Vertex AI and gateway providers via [managed settings](<https://support.claude.com/en/articles/12622667-enterprise-configuration>). For Bedrock or Foundry, use the [CLI](</docs/en/quickstart>). +The following features are only available in the CLI or VS Code extension, except where noted: + + * **Third-party providers** : Desktop connects to Anthropic’s API by default. Enterprise deployments can configure Vertex AI and gateway providers via [managed settings](<https://support.claude.com/en/articles/12622667-enterprise-configuration>). For Bedrock or Foundry in the CLI, see the [quickstart](</docs/en/quickstart>). As an exception to the section above, the [Cowork on 3P research preview](<https://claude.com/docs/cowork/3p/overview>) runs the Code tab on Bedrock, Vertex AI, Foundry, or a self-hosted LLM gateway. * **Linux** : the desktop app is available on macOS and Windows only. On Linux, use the [CLI](</docs/en/quickstart>). * **Inline code suggestions** : Desktop does not provide autocomplete-style suggestions. It works through conversational prompts and explicit code changes. * **Agent teams** : parallel Claude Code sessions that message each other are available in the [CLI](</docs/en/agent-teams>), not in Desktop. For multi-agent work inside one session, use [dynamic workflows](</docs/en/workflows>), which run in Desktop. @@ -893,7 +893,7 @@ ”Branch doesn’t exist yet” when opening in CLI -Remote sessions can create branches that don’t exist on your local machine. Click the branch name in the session toolbar to copy it, then fetch it locally: +Cloud sessions can create branches that don’t exist on your local machine. Click the branch name in the session toolbar to copy it, then fetch it locally: git fetch origin <branch-name> git checkout <branch-name>
modified Get started with the desktop app View current →
--- a/desktop-quickstart.md +++ b/desktop-quickstart.md @@ -58,14 +58,14 @@ You can also select: - * **Remote** : Run sessions on Anthropic’s cloud infrastructure that continue even if you close the app. Remote sessions use the same infrastructure as [Claude Code on the web](</docs/en/claude-code-on-the-web>). + * **Remote** : Run sessions on Anthropic’s cloud infrastructure that continue even if you close the app. Cloud sessions use the same infrastructure as [Claude Code on the web](</docs/en/claude-code-on-the-web>). * **SSH** : Connect to a remote machine over SSH, such as your own servers, cloud VMs, or dev containers. Desktop installs Claude Code on the remote machine automatically the first time you connect. 2 Choose a model -Select a model from the dropdown next to the send button. See [models](</docs/en/model-config#available-models>) for a comparison of Opus, Sonnet, and Haiku. You can change the model later from the same dropdown. +Select a model from the dropdown next to the send button. See [models](</docs/en/model-config#available-models>) for a comparison of the available models. You can change the model later from the same dropdown. 3
modified Discover and install prebuilt plugins through marketplaces View current →
--- a/discover-plugins.md +++ b/discover-plugins.md @@ -169,7 +169,7 @@ * **Marketplaces** : add, remove, or update your added marketplaces * **Errors** : view any plugin loading errors -Go to the **Discover** tab to see plugins from the marketplace you just added. Plugins marked as relevant to your current working directory are pinned at the top with a **suggested for this directory** label. +Go to the **Discover** tab to see plugins from the marketplace you just added. When your administrator has allowlisted the marketplace via the [`pluginSuggestionMarketplaces`](</docs/en/settings#available-settings>) managed setting, plugins marked as relevant to your current working directory are pinned at the top with a **suggested for this directory** label. 3 @@ -306,7 +306,7 @@ * type to filter by plugin name or description * press Enter to open a plugin’s detail view and enable, disable, or uninstall it -When you install a plugin that declares dependencies, the install output lists which dependencies were auto-installed alongside it. You can also manage plugins with direct commands. List installed plugins without opening the menu: +The detail view shows the components the plugin contributes: commands, skills, agents, hooks, MCP servers, and LSP servers. The same inventory is available from the command line with `claude plugin details`. When you install a plugin that declares dependencies, the install output lists which dependencies were auto-installed alongside it. You can also manage plugins with direct commands. List installed plugins without opening the menu: /plugin list @@ -337,7 +337,7 @@ /reload-plugins -Claude Code reloads all active plugins and shows counts for plugins, skills, agents, hooks, plugin MCP servers, and plugin LSP servers. Reloading has a token cost on the next request: newly loaded components announce themselves in content appended to the conversation, while the existing history still reads from the prompt cache. A plugin that provides MCP servers costs more when its tools aren’t deferred by [tool search](</docs/en/mcp#scale-with-mcp-tool-search>): the change invalidates the cache and the next request re-reads the entire conversation. See [enabling or disabling a plugin](</docs/en/prompt-caching#enabling-or-disabling-a-plugin>) for details. +Claude Code reloads all active plugins and shows counts for plugins, skills, agents, hooks, plugin MCP servers, and plugin LSP servers. Reloading has a token cost on the next request: newly loaded components announce themselves in content appended to the conversation, while the existing history still reads from the prompt cache. A plugin that provides MCP servers costs more when its tools aren’t deferred by [tool search](</docs/en/mcp#scale-with-mcp-tool-search>): the change invalidates the cache and the next request re-reads the entire conversation. In that case `/reload-plugins` shows a warning and does not apply the reload; pass `--force` to apply anyway. See [enabling or disabling a plugin](</docs/en/prompt-caching#enabling-or-disabling-a-plugin>) for details. ##
modified Environment variables View current →
Show diff (146 lines)
--- a/env-vars.md +++ b/env-vars.md @@ -64,7 +64,7 @@ ---|--- `~/.claude/settings.json`| You, in every project `.claude/settings.json`| Everyone working in the project, checked into source control -`.claude/settings.local.json`| You, in this project only, not checked in +`.claude/settings.local.json`| You, in this project only (add it to your gitignore if you create it by hand) Managed settings| Everyone in your organization, deployed by an admin See [Settings files](</docs/en/settings#settings-files>) for where each file lives and [Settings precedence](</docs/en/settings#settings-precedence>) for how they combine when more than one sets the same variable. @@ -100,6 +100,10 @@ `ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION`| Display description for the custom model entry in the `/model` picker. Defaults to `Custom model (<model-id>)` when not set `ANTHROPIC_CUSTOM_MODEL_OPTION_NAME`| Display name for the custom model entry in the `/model` picker. Defaults to the model ID when not set `ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES`| See [Model configuration](</docs/en/model-config#customize-pinned-model-display-and-capabilities>) +`ANTHROPIC_DEFAULT_FABLE_MODEL`| See [Model configuration](</docs/en/model-config#environment-variables>) +`ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION`| See [Model configuration](</docs/en/model-config#customize-pinned-model-display-and-capabilities>) +`ANTHROPIC_DEFAULT_FABLE_MODEL_NAME`| See [Model configuration](</docs/en/model-config#customize-pinned-model-display-and-capabilities>) +`ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES`| See [Model configuration](</docs/en/model-config#customize-pinned-model-display-and-capabilities>) `ANTHROPIC_DEFAULT_HAIKU_MODEL`| See [Model configuration](</docs/en/model-config#environment-variables>) `ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION`| See [Model configuration](</docs/en/model-config#customize-pinned-model-display-and-capabilities>) `ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME`| See [Model configuration](</docs/en/model-config#customize-pinned-model-display-and-capabilities>) @@ -121,6 +125,7 @@ `ANTHROPIC_VERTEX_BASE_URL`| Override the Vertex AI endpoint URL. Use for custom Vertex endpoints or when routing through an [LLM gateway](</docs/en/llm-gateway>). See [Google Vertex AI](</docs/en/google-vertex-ai>) `ANTHROPIC_VERTEX_PROJECT_ID`| GCP project ID for Vertex AI requests. Overridden by `GCLOUD_PROJECT`, `GOOGLE_CLOUD_PROJECT`, or the project in your `GOOGLE_APPLICATION_CREDENTIALS` credential file. See [Google Vertex AI](</docs/en/google-vertex-ai>) `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 idle timeout that aborts a streaming model response when no bytes arrive. Set to `0` to disable the timeout, for example when a slow [gateway](</docs/en/llm-gateway>) or local model pauses longer than 5 minutes between chunks. Set to `1` to keep the timeout on every provider. When unset, the timeout is inactive on direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) connections, where Claude Code’s own byte-level stream watchdog runs, and active on every other provider, including [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), [Bedrock](</docs/en/amazon-bedrock>), and gateway connections, so a stalled stream aborts instead of hanging. As of v2.1.169 `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`| Bedrock API key for authentication (see [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) @@ -137,6 +142,7 @@ `CLAUDE_CODE_ACCESSIBILITY`| Set to `1` to keep the native terminal cursor visible and disable the inverted-text cursor indicator. Allows screen magnifiers like macOS Zoom to track cursor position `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD`| Set to `1` to load memory files from directories specified with `--add-dir`. Loads `CLAUDE.md`, `.claude/CLAUDE.md`, `.claude/rules/*.md`, and `CLAUDE.local.md`. By default, additional directories do not load memory files `CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT`| Set to `1` to repaint the entire screen on every frame in [fullscreen rendering](</docs/en/fullscreen>) instead of sending incremental updates. Use this if fullscreen mode shows stale or misplaced text fragments. Claude Code enables this automatically for background sessions and [agent view](</docs/en/agent-view>) on Windows +`CLAUDE_CODE_ALWAYS_ENABLE_EFFORT`| Set to `1` to send the [effort](</docs/en/model-config#adjust-effort-level>) parameter with every request, even when Claude Code does not recognize the model ID as effort-capable. Use this when routing through an [LLM gateway](</docs/en/llm-gateway>) or third-party provider that serves models under custom identifiers. Models that reject the effort parameter at the API, including Claude 3 models, Sonnet 4.0 and 4.5, Opus 4.0 and 4.1, and Haiku 4.5, are still excluded so requests do not fail `CLAUDE_CODE_API_KEY_HELPER_TTL_MS`| Interval in milliseconds at which credentials should be refreshed (when using [`apiKeyHelper`](</docs/en/settings#available-settings>)) `CLAUDE_CODE_ATTRIBUTION_HEADER`| Set to `0` to omit the attribution block (client version and prompt fingerprint) from the start of the system prompt. Disabling it improves prompt-cache hit rates when routing through an [LLM gateway](</docs/en/llm-gateway>). Anthropic API caching is unaffected `CLAUDE_CODE_AUTO_COMPACT_WINDOW`| Set the context capacity in tokens used for auto-compaction calculations. Defaults to the model’s context window: 200K for standard models or 1M for [extended context](</docs/en/model-config#extended-context>) models. Use a lower value like `500000` on a 1M model to treat the window as 500K for compaction purposes. The value is capped at the model’s actual context window. `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` is applied as a percentage of this value. Setting this variable decouples the compaction threshold from the status line’s `used_percentage`, which always uses the model’s full context window @@ -148,12 +154,14 @@ `CLAUDE_CODE_DEBUG_LOGS_DIR`| Override the debug log file path. Despite the name, this is a file path, not a directory. Requires debug mode to be enabled separately via `--debug`, `/debug`, or the `DEBUG` environment variable: setting this variable alone does not enable logging. The [`--debug-file`](</docs/en/cli-reference#cli-flags>) flag does both at once. Defaults to `~/.claude/debug/<session-id>.txt` `CLAUDE_CODE_DEBUG_LOG_LEVEL`| Minimum log level written to the debug log file. Values: `verbose`, `debug` (default), `info`, `warn`, `error`. Set to `verbose` to include high-volume diagnostics like full status line command output, or raise to `error` to reduce noise `CLAUDE_CODE_DISABLE_1M_CONTEXT`| Set to `1` to disable [1M context window](</docs/en/model-config#extended-context>) support. When set, 1M model variants are unavailable in the model picker. Useful for enterprise environments with compliance requirements -`CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING`| Set to `1` to disable [adaptive reasoning](</docs/en/model-config#adjust-effort-level>) on Opus 4.6 and Sonnet 4.6 and fall back to the fixed thinking budget controlled by `MAX_THINKING_TOKENS`. From v2.1.111, has no effect on Opus 4.7 and later, which always use adaptive reasoning +`CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING`| Set to `1` to disable [adaptive reasoning](</docs/en/model-config#adjust-effort-level>) on Opus 4.6 and Sonnet 4.6 and fall back to the fixed thinking budget controlled by `MAX_THINKING_TOKENS`. From v2.1.111, has no effect on Fable 5, or on Opus 4.7 and later, which always use adaptive reasoning +`CLAUDE_CODE_DISABLE_ADVISOR_TOOL`| Set to `1` to disable the [advisor tool](</docs/en/advisor>). The `/advisor` command and `--advisor` flag become unavailable and any configured `advisorModel` is ignored. Requires Claude Code v2.1.98 or later `CLAUDE_CODE_DISABLE_AGENT_VIEW`| Set to `1` to turn off [background agents and agent view](</docs/en/agent-view>): `claude agents`, `--bg`, `/background`, and the on-demand supervisor. Equivalent to the [`disableAgentView`](</docs/en/settings#available-settings>) setting `CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN`| Set to `1` to disable [fullscreen rendering](</docs/en/fullscreen>) and use the classic main-screen renderer. The conversation stays in your terminal’s native scrollback so `Cmd+f` and tmux copy mode work as usual. Takes precedence over `CLAUDE_CODE_NO_FLICKER` and the [`tui`](</docs/en/settings#available-settings>) setting. You can also switch with `/tui default`. Does not apply to background sessions opened from [agent view](</docs/en/agent-view>), which always use fullscreen rendering `CLAUDE_CODE_DISABLE_ATTACHMENTS`| Set to `1` to disable attachment processing. File mentions with `@` syntax are sent as plain text instead of being expanded into file content `CLAUDE_CODE_DISABLE_AUTO_MEMORY`| Set to `1` to disable [auto memory](</docs/en/memory#auto-memory>). Set to `0` to force auto memory on even when `--bare` mode or [`autoMemoryEnabled: false`](</docs/en/settings#available-settings>) would otherwise disable it. When disabled, Claude does not create or load auto memory files `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`| Set to `1` to disable all background task functionality, including the `run_in_background` parameter on Bash and subagent tools, auto-backgrounding, and the Ctrl+B shortcut +`CLAUDE_CODE_DISABLE_BUNDLED_SKILLS`| Set to `1` to disable the [skills](</docs/en/skills>) and workflows that ship with Claude Code: bundled skills and workflows are removed entirely, while built-in slash commands like `/init` stay typable but are hidden from the model. Skills from plugins, `.claude/skills/`, and `.claude/commands/` are unaffected. Equivalent to the [`disableBundledSkills`](</docs/en/settings#available-settings>) setting; `0` does not override it `CLAUDE_CODE_DISABLE_CLAUDE_MDS`| Set to `1` to prevent loading any CLAUDE.md memory files into context, including user, project, and auto-memory files `CLAUDE_CODE_DISABLE_CRON`| Set to `1` to disable [scheduled tasks](</docs/en/scheduled-tasks>). The `/loop` skill and cron tools become unavailable and any already-scheduled tasks stop firing, including tasks that are already running mid-session `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`| Set to `1` to strip Anthropic-specific `anthropic-beta` request headers and beta tool-schema fields (such as `defer_loading` and `eager_input_streaming`) from API requests. Use this when a proxy gateway rejects requests with errors like “Unexpected value(s) for the `anthropic-beta` header” or “Extra inputs are not permitted”. Standard fields (`name`, `description`, `input_schema`, `cache_control`) are preserved. @@ -168,7 +176,7 @@ `CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL`| Set to `1` to skip automatic addition of the official plugin marketplace on first run `CLAUDE_CODE_DISABLE_POLICY_SKILLS`| Set to `1` to skip loading skills from the system-wide managed skills directory. Useful for container or CI sessions that should not load operator-provisioned skills `CLAUDE_CODE_DISABLE_TERMINAL_TITLE`| Set to `1` to disable automatic terminal title updates based on conversation context. In Agent SDK and `claude -p` sessions, this also skips the background Haiku request that generates the session title -`CLAUDE_CODE_DISABLE_THINKING`| Set to `1` to force-disable [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>) regardless of model support or other settings. More direct than `MAX_THINKING_TOKENS=0` +`CLAUDE_CODE_DISABLE_THINKING`| Set to `1` to omit the `thinking` parameter from API requests entirely. This is a compatibility option for proxies and gateways that reject the parameter. The variable’s behavior is unchanged from earlier versions; on models that think by default, omitting the parameter means the model may still think. To explicitly disable [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>) on the Anthropic API, use `MAX_THINKING_TOKENS=0` instead, which is also ineffective on Fable 5 since it cannot have thinking turned off. On [third-party providers](</docs/en/third-party-integrations>), `0` likewise omits the parameter, so the two variables behave the same there `CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL`| Set to `1` to disable virtual scrolling in [fullscreen rendering](</docs/en/fullscreen>) and render every message in the transcript. Use this if scrolling in fullscreen mode shows blank regions where messages should appear `CLAUDE_CODE_DISABLE_WORKFLOWS`| Set to `1` to disable [workflows](</docs/en/workflows#turn-workflows-off>). Equivalent to the [`disableWorkflows`](</docs/en/settings#available-settings>) setting `CLAUDE_CODE_EFFORT_LEVEL`| Set the effort level for supported models. Values: `low`, `medium`, `high`, `xhigh`, `max`, or `auto` to use the model default. Available levels depend on the model. Takes precedence over `/effort` and the `effortLevel` setting. See [Adjust effort level](</docs/en/model-config#adjust-effort-level>) @@ -186,6 +194,7 @@ `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS`| Set to `1` to enable [agent teams](</docs/en/agent-teams>). Agent teams are experimental and disabled by default `CLAUDE_CODE_EXTRA_BODY`| JSON object to merge into the top level of every API request body. Useful for passing provider-specific parameters that Claude Code does not expose directly `CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS`| Override the default token limit for file reads. Useful when you need to read larger files in full +`CLAUDE_CODE_FORCE_SESSION_PERSISTENCE`| Removed in v2.1.170. This variable forced transcript persistence when an inherited `CLAUDECODE` value caused a top-level session to be misclassified as nested. The nested-session detection it overrode was removed in v2.1.170, so the variable no longer applies `CLAUDE_CODE_FORCE_SYNC_OUTPUT`| Set to `1` to force-enable DEC private mode 2026 [synchronized output](<https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036>) when your terminal supports it but is not auto-detected. Useful for emulators such as Emacs `eat` that implement BSU/ESU but do not reply to the capability probe. Has no effect under tmux `CLAUDE_CODE_FORK_SUBAGENT`| Set to `1` to make [forked subagents](</docs/en/sub-agents#fork-the-current-conversation>) the model’s default, or `0` to disable them, overriding any server-side rollout. When enabled, Claude spawns a fork, a subagent that inherits the full conversation context instead of starting fresh, whenever it would otherwise use the general-purpose subagent, and all subagent spawns run in the background. The explicit [`/fork`](</docs/en/commands>) command works without this variable. Works in interactive mode and via the SDK or `claude -p` `CLAUDE_CODE_GIT_BASH_PATH`| Windows only: path to the Git Bash executable (`bash.exe`). Use when Git Bash is installed but not in your PATH. See [Windows setup](</docs/en/setup#set-up-on-windows>) @@ -227,12 +236,13 @@ `CLAUDE_CODE_REMOTE_SESSION_ID`| Set automatically in [cloud sessions](</docs/en/claude-code-on-the-web>) to the current session’s ID. Read this to construct a link back to the session transcript. See [Link artifacts back to the session](</docs/en/claude-code-on-the-web#link-artifacts-back-to-the-session>) `CLAUDE_CODE_RESUME_INTERRUPTED_TURN`| Set to `1` to automatically resume if the previous session ended mid-turn. Used in SDK mode so the model continues without requiring the SDK to re-send the prompt `CLAUDE_CODE_RESUME_PROMPT`| Override the continuation message injected when resuming a session that ended mid-turn. Defaults to `Continue from where you left off.`. Spawn scripts for long-running agents can set this to a more directive boot message. An empty string uses the default +`CLAUDE_CODE_SAFE_MODE`| Set to `1` to start in safe mode: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, custom keybindings, status line and file-suggestion commands, LSP servers, and auto-memory do not load, for troubleshooting a broken configuration. Managed settings policy still applies, including policy-configured hooks, status line, and file-suggestion commands; managed plugins, managed skills, managed CLAUDE.md, and policy-configured MCP servers do not. Equivalent to passing [`--safe-mode`](</docs/en/cli-reference#cli-flags>). Directly spawned child processes inherit the variable `CLAUDE_CODE_SCRIPT_CAPS`| JSON object limiting how many times specific scripts may be invoked per session when `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` is set. Keys are substrings matched against the command text; values are integer call limits. For example, `{"deploy.sh": 2}` allows `deploy.sh` to be called at most twice. Matching is substring-based so shell-expansion tricks like `./scripts/deploy.sh $(evil)` still count against the cap. Runtime fan-out via `xargs` or `find -exec` is not detected; this is a defense-in-depth control `CLAUDE_CODE_SCROLL_SPEED`| Set the mouse wheel scroll multiplier in [fullscreen rendering](</docs/en/fullscreen#mouse-wheel-scrolling>). Accepts values from 1 to 20. Set to `3` to match `vim` if your terminal sends one wheel event per notch without amplification. Ignored in the JetBrains IDE terminal, where Claude Code uses its own scroll handling `CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS`| Override the time budget in milliseconds for [SessionEnd](</docs/en/hooks#sessionend>) hooks. Applies to session exit, `/clear`, and switching sessions via interactive `/resume`. By default the budget is 1.5 seconds, automatically raised to the highest per-hook `timeout` configured in settings files, up to 60 seconds. Timeouts on plugin-provided hooks do not raise the budget `CLAUDE_CODE_SESSION_ID`| Set automatically to the current session ID in Bash and PowerShell tool subprocesses, [hook command](</docs/en/hooks>) subprocesses, and stdio [MCP server](</docs/en/mcp>) subprocesses. For Bash, PowerShell, and hooks this matches the `session_id` field in the hook JSON input and is updated on `/clear`. An MCP server subprocess retains the ID it was spawned with. On `--resume <session-id>` it receives the resumed ID, matching hooks and Bash. On `--continue` or `--resume` without an explicit ID it may receive the initial startup ID instead. Use to correlate scripts and external tools with the Claude Code session that launched them `CLAUDE_CODE_SHELL`| Override automatic shell detection. Useful when your login shell differs from your preferred working shell (for example, `bash` vs `zsh`) -`CLAUDE_CODE_SHELL_PREFIX`| Command prefix that wraps shell commands Claude Code spawns: Bash tool calls, [hook](</docs/en/hooks>) commands, and stdio [MCP server](</docs/en/mcp>) startup commands. Useful for logging or auditing. Example: setting `/path/to/logger.sh` runs each command as `/path/to/logger.sh <command>` +`CLAUDE_CODE_SHELL_PREFIX`| Command prefix that wraps shell commands Claude Code spawns: Bash tool calls, [hook](</docs/en/hooks>) commands, [status line](</docs/en/statusline>) commands, and stdio [MCP server](</docs/en/mcp>) startup commands. PowerShell hooks and exec-form hooks run without the prefix. Useful for logging or auditing. Setting a bare executable path such as `/path/to/logger.sh` runs each command as `/path/to/logger.sh '<command>'`. The wrapper receives the command line as a single shell-quoted argument in `$1`, so the wrapper must re-evaluate `$1` with a shell, for example `exec bash -c "$1"`. Treating `$1` as a bare executable path breaks stdio MCP servers that pass arguments such as `npx -y <package>`. For Bash tool calls, `$1` contains the full shell invocation Claude Code assembles, including environment setup, not only the command Claude ran `CLAUDE_CODE_SIMPLE`| Set to `1` to run with a minimal system prompt and only the Bash, file read, and file edit tools. MCP tools from `--mcp-config` are still available. Disables auto-discovery of hooks, skills, plugins, MCP servers, auto memory, and CLAUDE.md. OAuth tokens and keychain credentials are not read, so Anthropic authentication must come from `ANTHROPIC_API_KEY` or an `apiKeyHelper` in `--settings`. Equivalent to passing [`--bare`](</docs/en/headless#start-faster-with-bare-mode>) `CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT`| Set to `1` to use a shorter system prompt and abbreviated tool descriptions on any model. Set to `0`, `false`, `no`, or `off` to opt out even on models where the experiment or server configuration would otherwise enable it. The full tool set, hooks, MCP servers, and CLAUDE.md discovery remain enabled `CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH`| Skip client-side authentication for [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), for gateways that sign requests themselves @@ -246,7 +256,7 @@ `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`| Set to `1` to strip Anthropic and cloud provider credentials from subprocess environments (Bash tool, hooks, MCP stdio servers). The parent Claude process keeps these credentials for API calls, but child processes cannot read them, reducing exposure to prompt injection attacks that attempt to exfiltrate secrets via shell expansion. On Linux, this also runs Bash subprocesses in an isolated PID namespace so they cannot read host process environments via `/proc`; as a side effect, `ps`, `pgrep`, and `kill` cannot see or signal host processes. `claude-code-action` sets this automatically when `allowed_non_write_users` is configured `CLAUDE_CODE_SYNC_PLUGIN_INSTALL`| Set to `1` in non-interactive mode (the `-p` flag) to wait for plugin installation to complete before the first query. Without this, plugins install in the background and may not be available on the first turn. Combine with `CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS` to bound the wait `CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS`| Timeout in milliseconds for synchronous plugin installation. When exceeded, Claude Code proceeds without plugins and logs an error. No default: without this variable, synchronous installation waits until complete -`CLAUDE_CODE_SYNC_SKILLS`| Set to `1` to download your enabled claude.ai skills into `~/.claude/skills/` before the first query and resync every 10 minutes. Applies only in non-interactive mode with the `-p` flag. Set automatically in [Claude Code on the web](</docs/en/claude-code-on-the-web>) sessions. Requires claude.ai authentication +`CLAUDE_CODE_SYNC_SKILLS`| Set to `1` to download your enabled claude.ai skills into `~/.claude/skills/` before the first query and resync every 10 minutes. Applies only in non-interactive mode with the `-p` flag. Requires claude.ai authentication. [Claude Code on the web](</docs/en/claude-code-on-the-web>) sessions receive your enabled claude.ai skills automatically; you don’t need to set this there `CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS`| Timeout in milliseconds for a mid-session skills resync when `CLAUDE_CODE_SYNC_SKILLS` is set (default: 30000). Bounds the download triggered when the host requests a skill reload during the session. When exceeded, the resync stops and remaining downloads continue in the background `CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS`| Timeout in milliseconds for the first query to wait on the initial skills sync when `CLAUDE_CODE_SYNC_SKILLS` is set (default: 5000). When exceeded, the query proceeds and remaining skill downloads continue in the background `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>) setting @@ -263,12 +273,12 @@ `CLAUDE_CODE_USE_VERTEX`| Use [Vertex](</docs/en/google-vertex-ai>) `CLAUDE_CONFIG_DIR`| Override the configuration directory (default: `~/.claude`). All settings, credentials, session history, and plugins are stored under this path. Useful for running multiple accounts side by side: for example, `alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'` `CLAUDE_EFFORT`| Set automatically in Bash tool subprocesses and hook commands to the active [effort level](</docs/en/model-config#adjust-effort-level>) for the turn: `low`, `medium`, `high`, `xhigh`, or `max`. Ultracode is not a distinct level and reports as `xhigh`. Matches the `effort.level` field passed to [hooks](</docs/en/hooks>). Only set when the current model supports the effort parameter -`CLAUDE_ENABLE_BYTE_WATCHDOG`| Set to `1` to force-enable the byte-level streaming idle watchdog, or set to `0` to force-disable it. When unset, the watchdog is enabled by default for Anthropic API connections. The byte watchdog aborts a connection when no bytes arrive on the wire for the duration set by `CLAUDE_STREAM_IDLE_TIMEOUT_MS`, with a minimum of 5 minutes, independent of the event-level watchdog +`CLAUDE_ENABLE_BYTE_WATCHDOG`| Set to `1` to force-enable the byte-level streaming idle watchdog, or set to `0` to force-disable it. When unset, the watchdog is enabled by default for direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) connections. The byte watchdog aborts a connection when no bytes arrive on the wire for 180 seconds by default on direct Anthropic API connections, 300 seconds on Claude Platform on AWS and when enabled on Bedrock, or for the value of `CLAUDE_STREAM_IDLE_TIMEOUT_MS` when that is set, which is clamped to a minimum of 5 minutes, independent of the event-level watchdog `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK`| Set to `1` to enable the byte-level streaming idle watchdog on Amazon Bedrock `vnd.amazon.eventstream` responses. Off by default. Configure the timeout with `CLAUDE_STREAM_IDLE_TIMEOUT_MS` -`CLAUDE_ENABLE_STREAM_WATCHDOG`| Set to `1` to enable the event-level streaming idle watchdog. Off by default. Applies to all providers, including Bedrock. For Vertex and Foundry, this is the only idle watchdog available. On Bedrock, you can also enable the independent byte-level watchdog with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK`; the two run together when both are set. Configure the timeout with `CLAUDE_STREAM_IDLE_TIMEOUT_MS` +`CLAUDE_ENABLE_STREAM_WATCHDOG`| Set to `1` to force-enable the event-level streaming idle watchdog, or set to `0` to force-disable it. When unset, the default is server-controlled on the direct Anthropic API and off on other providers. As of v2.1.169, providers other than the direct Anthropic API and Claude Platform on AWS also have a default-on 5-minute body idle timeout independent of this variable; see `API_FORCE_IDLE_TIMEOUT`. On Bedrock, you can also enable the independent byte-level watchdog with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK`; the two run together when both are set. Configure the timeout with `CLAUDE_STREAM_IDLE_TIMEOUT_MS` `CLAUDE_ENV_FILE`| Path to a shell script whose contents Claude Code runs before each Bash command in the same shell process, so exports in the file are visible to the command. Use to persist virtualenv or conda activation across commands. Also populated dynamically by [SessionStart](</docs/en/hooks#persist-environment-variables>), [Setup](</docs/en/hooks#setup>), [CwdChanged](</docs/en/hooks#cwdchanged>), and [FileChanged](</docs/en/hooks#filechanged>) hooks `CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX`| Prefix for auto-generated [Remote Control](</docs/en/remote-control>) session names when no explicit name is provided. Defaults to your machine’s hostname, producing names like `myhost-graceful-unicorn`. The `--remote-control-session-name-prefix` CLI flag sets the same value for a single invocation -`CLAUDE_STREAM_IDLE_TIMEOUT_MS`| Timeout in milliseconds before the streaming idle watchdog closes a stalled connection. Default and minimum `300000` (5 minutes) for both the byte-level and event-level watchdogs; lower values are silently clamped to absorb extended thinking pauses and proxy buffering. For third-party providers, requires `CLAUDE_ENABLE_STREAM_WATCHDOG=1`. On Bedrock, also applies when `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` +`CLAUDE_STREAM_IDLE_TIMEOUT_MS`| Timeout in milliseconds before the streaming idle watchdog closes a stalled connection. When you set this variable explicitly, the minimum is `300000` (5 minutes); lower values are silently clamped to absorb extended thinking pauses and proxy buffering. When unset, the event-level watchdog defaults to 300 seconds and the byte-level watchdog defaults to 180 seconds on direct Anthropic API connections (300 seconds on Claude Platform on AWS and other providers). The unset 180-second byte-watchdog default is a separate value and is not subject to the 5-minute clamp. For the event-level watchdog on third-party providers, requires `CLAUDE_ENABLE_STREAM_WATCHDOG=1`; the body idle timeout described under `API_FORCE_IDLE_TIMEOUT` applies independently. On Bedrock, also applies when `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` `DEBUG`| Set to `1` to enable debug mode, equivalent to launching with [`--debug`](</docs/en/cli-reference#cli-flags>). Debug logs are written to `~/.claude/debug/<session-id>.txt`, or to the path set by `CLAUDE_CODE_DEBUG_LOGS_DIR`. Only the truthy values `1`, `true`, `yes`, and `on` enable debug mode, so namespace patterns like `DEBUG=express:*` set for other tools do not trigger it `DISABLE_AUTOUPDATER`| Set to `1` to disable automatic background updates. Manual `claude update` still works. Use `DISABLE_UPDATES` to block both `DISABLE_AUTO_COMPACT`| Set to `1` to disable automatic compaction when approaching the context limit. The manual `/compact` command remains available. Use when you want explicit control over when compaction occurs @@ -285,6 +295,7 @@ `DISABLE_LOGIN_COMMAND`| Set to `1` to hide the `/login` command. Useful when authentication is handled externally via API keys or `apiKeyHelper` `DISABLE_LOGOUT_COMMAND`| Set to `1` to hide the `/logout` command `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 Haiku models `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 @@ -296,7 +307,7 @@ `ENABLE_PROMPT_CACHING_1H`| Set to `1` to request a 1-hour [prompt cache TTL](</docs/en/prompt-caching#cache-lifetime>) instead of the default 5 minutes. Intended for API key, [Bedrock](</docs/en/amazon-bedrock>), [Vertex](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) users. Subscription users within included usage receive 1-hour TTL automatically. 1-hour cache writes are billed at a higher rate `ENABLE_PROMPT_CACHING_1H_BEDROCK`| Deprecated. Use `ENABLE_PROMPT_CACHING_1H` instead `ENABLE_TOOL_SEARCH`| Controls [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>). Unset: all MCP tools deferred by default, but loaded upfront on Vertex AI or when `ANTHROPIC_BASE_URL` points to a non-first-party host. Values: `true` (always defer and send the beta header, requests fail on Vertex AI models earlier than Sonnet 4.5 or Opus 4.5, or on proxies that do not support `tool_reference`), `auto` (threshold mode: load upfront if tools fit within 10% of context), `auto:N` (custom threshold, e.g., `auto:5` for 5%), `false` (load all upfront) -`FALLBACK_FOR_ALL_PRIMARY_MODELS`| Set to any non-empty value to trigger fallback to [`--fallback-model`](</docs/en/cli-reference#cli-flags>) after repeated overload errors on any primary model. By default, only Opus models trigger the fallback +`FALLBACK_FOR_ALL_PRIMARY_MODELS`| Set to any non-empty value to make all models, not only Opus, stop retrying with a repeated-overload error when no fallback model is configured. As of v2.1.160, a configured [fallback model chain](</docs/en/model-config#fallback-model-chains>) triggers on repeated overload errors for any primary model, so this variable does not affect switching to a fallback model `FORCE_AUTOUPDATE_PLUGINS`| Set to `1` to force plugin auto-updates even when the main auto-updater is disabled via `DISABLE_AUTOUPDATER` `FORCE_PROMPT_CACHING_5M`| Set to `1` to force the 5-minute prompt cache TTL even when 1-hour TTL would otherwise apply. Overrides `ENABLE_PROMPT_CACHING_1H` `HTTP_PROXY`| Specify HTTP proxy server for network connections @@ -304,7 +315,7 @@ `IS_DEMO`| Set to `1` to enable demo mode: hides your email and organization name from the header and `/status` output, and skips onboarding. Useful when streaming or recording a session `MAX_MCP_OUTPUT_TOKENS`| Maximum number of tokens allowed in MCP tool responses. Claude Code displays a warning when output exceeds 10,000 tokens. Tools that declare [`anthropic/maxResultSizeChars`](</docs/en/mcp#raise-the-limit-for-a-specific-tool>) use that character limit for text content instead, but image content from those tools is still subject to this variable (default: 25000) `MAX_STRUCTURED_OUTPUT_RETRIES`| Number of times to retry when the model’s response fails validation against the [`--json-schema`](</docs/en/cli-reference#cli-flags>) in non-interactive mode (the `-p` flag). Defaults to 5 -`MAX_THINKING_TOKENS`| Override the [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>) token budget. The ceiling is the model’s [max output tokens](<https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison>) minus one. Set to `0` to disable thinking entirely. On models with [adaptive reasoning](</docs/en/model-config#adjust-effort-level>), the budget is ignored unless adaptive reasoning is disabled via `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` +`MAX_THINKING_TOKENS`| Override the [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>) token budget. The ceiling is the model’s [max output tokens](<https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison>) minus one. Set to `0` to disable thinking on the Anthropic API except on Fable 5, which cannot have thinking turned off. On [third-party providers](</docs/en/third-party-integrations>), `0` omits the `thinking` parameter instead, and models with [adaptive reasoning](</docs/en/model-config#adjust-effort-level>) may still think. For nonzero values on adaptive reasoning models, the budget is ignored unless adaptive reasoning is disabled via `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` `MCP_CLIENT_SECRET`| OAuth client secret for MCP servers that require [pre-configured credentials](</docs/en/mcp#use-pre-configured-oauth-credentials>). Avoids the interactive prompt when adding a server with `--client-secret` `MCP_CONNECTION_NONBLOCKING`| Controls whether startup waits for MCP servers to connect before the first query. As of Claude Code v2.1.142, MCP startup is non-blocking by default: servers connect in the background and their tools become available as they finish. Set to `0` to restore the blocking 5-second connection wait. Servers configured with [`alwaysLoad: true`](</docs/en/mcp#exempt-a-server-from-deferral>) still block startup regardless, since their tools must be present when the first prompt is built `MCP_CONNECT_TIMEOUT_MS`| How long blocking MCP startup waits, in milliseconds, for the connection batch before snapshotting the tool list (default: 5000). Applies when `MCP_CONNECTION_NONBLOCKING=0` or for servers marked [`alwaysLoad: true`](</docs/en/mcp#exempt-a-server-from-deferral>). Servers still pending at the deadline keep connecting in the background but won’t appear until the next query. Distinct from `MCP_TIMEOUT`, which bounds an individual server’s connect attempt @@ -337,6 +348,8 @@ `VERTEX_REGION_CLAUDE_4_6_OPUS`| Override region for Claude Opus 4.6 when using Vertex AI `VERTEX_REGION_CLAUDE_4_6_SONNET`| Override region for Claude Sonnet 4.6 when using Vertex AI `VERTEX_REGION_CLAUDE_4_7_OPUS`| Override region for Claude Opus 4.7 when using Vertex AI. Added in v2.1.111 +`VERTEX_REGION_CLAUDE_4_8_OPUS`| Override region for Claude Opus 4.8 when using Vertex AI. Added in v2.1.154 +`VERTEX_REGION_CLAUDE_FABLE_5`| Override region for Claude Fable 5 when using Vertex AI. Added in v2.1.170 `VERTEX_REGION_CLAUDE_HAIKU_4_5`| Override region for Claude Haiku 4.5 when using Vertex AI Standard OpenTelemetry exporter variables (`OTEL_METRICS_EXPORTER`, `OTEL_LOGS_EXPORTER`, `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_PROTOCOL`, `OTEL_EXPORTER_OTLP_HEADERS`, `OTEL_METRIC_EXPORT_INTERVAL`, `OTEL_RESOURCE_ATTRIBUTES`, and signal-specific variants) are also supported. See [Monitoring](</docs/en/monitoring-usage>) for configuration details.
modified Error reference View current →
--- a/errors.md +++ b/errors.md @@ -19,12 +19,14 @@ `Auto mode could not evaluate this action and is blocking it for safety`| Server errors `Auto mode classifier transcript exceeded context window`| Server errors `You've hit your session limit` / `You've hit your weekly limit`| Usage limits +`Usage credits required for 1M context`| Usage limits `Server is temporarily limiting requests`| Usage limits `Request rejected (429)`| Usage limits `Credit balance is too low`| Usage limits `Not logged in · Please run /login`| Authentication `Invalid API key`| Authentication `This organization has been disabled`| Authentication +`Your organization has disabled API key authentication`| Authentication `Your organization has disabled Claude subscription access`| Authentication `Routines are disabled by your organization's policy`| Authentication `OAuth token revoked` / `OAuth token has expired`| Authentication @@ -184,6 +186,23 @@ ​ +Usage credits required for 1M context + +The selected model uses the 1M-token extended context window, and your plan only includes it through usage credits. + + API Error: Usage credits required for 1M context · run /usage-credits to turn them on, or /model to switch to standard context + +This is an entitlement check, not a quota exhaustion. It fires even when your session and weekly allowances have capacity remaining. See [Extended context](</docs/en/model-config#extended-context>) for which plans include 1M context directly and which require usage credits. **What to do:** + + * Run `/model` and select the variant without the `[1m]` suffix to fall back to the standard context window + * Run `/usage-credits` to turn on metered billing for the 1M variant on Pro and Max, or to request it from your admin on Team and Enterprise + * If the error persists after `/model`, a 1M model ID may be set elsewhere. See There’s an issue with the selected model for the configuration locations to check in priority order. + * To remove 1M variants from the model picker entirely, set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/env-vars>) + +### + +​ + Server is temporarily limiting requests The API applied a short-lived throttle that is unrelated to your plan quota. @@ -289,6 +308,27 @@ * Unset `ANTHROPIC_API_KEY` in the current shell and remove it from your shell profile, then relaunch `claude` * Run `/status` afterward to confirm the active credential is your subscription * If no environment variable is set and the error persists, the disabled organization is the one tied to your `/login`. Contact support or sign in with a different account. + +### + +​ + +Your organization has disabled API key authentication + +Your Console organization’s admin has turned off API key authentication, so the API rejects the key Claude Code is sending. The recovery hint after the `·` varies by where the key came from: + + Your organization has disabled API key authentication · Run /login to sign in with your claude.ai account + Your organization has disabled API key authentication · Unset ANTHROPIC_API_KEY to use your claude.ai account instead + Your organization has disabled API key authentication · Unset ANTHROPIC_API_KEY and run /login to sign in with your claude.ai account + Your organization has disabled API key authentication · Unset the apiKeyHelper setting and run /login to sign in with your claude.ai account + +Environment variables and `apiKeyHelper` take precedence over `/login`, so running `/login` alone does not help while either is still supplying a key. See [Authentication precedence](</docs/en/authentication#authentication-precedence>). **What to do:** + + * If the message names `ANTHROPIC_API_KEY`, unset it in the current shell and remove it from your shell profile or `.env` file, then relaunch `claude` + * If the message names `apiKeyHelper`, remove the [`apiKeyHelper`](</docs/en/settings#available-settings>) setting from your `settings.json` + * Run `/login` to sign in with your claude.ai account + * Run `/status` afterward to confirm the active credential is your subscription rather than an API key + * If you need API key authentication for automation, ask your organization admin to re-enable it in the Console ### @@ -498,9 +538,8 @@ Image was too large. Double press esc to go back and try again with a smaller image. API Error: 400 ... image dimensions exceed max allowed size -The image stays in conversation history after the error, so every subsequent message fails with the same error until you remove it. **What to do:** - - * Press Esc twice and step back past the turn where the image was added +Claude Code replaces the unprocessable image with a text placeholder and retries, so subsequent messages succeed. On versions before 2.1.142, a pasted image could remain in the conversation and repeat the same error on every subsequent message. To recover on those versions, press Esc twice and step back past the turn where the image was added. **What to do:** + * Resize the image before pasting. The API accepts images up to 8000 pixels on the longest edge for a single image, or 2000 pixels when many images are in context. * Take a tighter screenshot of the relevant region instead of the full screen @@ -661,7 +700,13 @@ Responses seem lower quality than usual -If Claude’s answers seem less capable than you expect but no error is shown, the cause is usually conversation state rather than the model itself. Claude Code does not silently change model versions. It can switch to a fallback model in specific cases such as an Opus quota being reached or a Bedrock or Vertex AI region lacking your model; the Model selection check below catches both, and [Model configuration](</docs/en/model-config>) explains when fallback applies. Check these first: +If Claude’s answers seem less capable than you expect but no error is shown, the cause is usually conversation state rather than the model itself. Claude Code does not silently change model versions. It can switch to a fallback model in three specific cases: + + * A configured [`--fallback-model`](</docs/en/cli-reference#cli-flags>) takes over after an availability error, for that turn only, with a notice in the transcript + * A Bedrock or Vertex AI startup check finds your default model unavailable + * [Automatic model fallback](</docs/en/model-config#automatic-model-fallback>) on Fable 5 moves the session to the default Opus model and shows a notice in the transcript + +The Model selection check below catches the second and third cases; the first appears as a transcript notice rather than a `/model` change. [Model configuration](</docs/en/model-config>) explains when each fallback applies. Check these first: * **Model selection** : run `/model` to confirm you are on the model you expect. A previous `/model` choice or an `ANTHROPIC_MODEL` environment variable may have you on a smaller model than you intended. * **Effort level** : run `/effort` to check the current reasoning level and raise it for hard debugging or design work. Defaults vary by model, so check before assuming you are below the maximum. See [Adjust effort level](</docs/en/model-config#adjust-effort-level>) for per-model defaults and the `ultrathink` shortcut.
modified Claude Code GitHub Actions View current →
--- a/github-actions.md +++ b/github-actions.md @@ -1,8 +1,6 @@ Claude Code GitHub Actions brings AI-powered automation to your GitHub workflow. With a simple `@claude` mention in any PR or issue, Claude can analyze your code, create pull requests, implement features, and fix bugs - all while following your project’s standards. For automatic reviews posted on every PR without a trigger, see [GitHub Code Review](</docs/en/code-review>). Claude Code GitHub Actions is built on top of the [Claude Agent SDK](</docs/en/agent-sdk/overview>), which enables programmatic integration of Claude Code into your applications. You can use the SDK to build custom automation workflows beyond GitHub Actions. - -**Claude Opus 4.8 is now available.** Claude Code GitHub Actions default to Sonnet. To use Opus 4.8, configure the model parameter to use `claude-opus-4-8`. ##
modified Claude Code with GitHub Enterprise Server View current →
--- a/github-enterprise-server.md +++ b/github-enterprise-server.md @@ -110,7 +110,7 @@ claude --remote "Add retry logic to the payment webhook handler" -The session runs on Anthropic infrastructure, clones your repository from GHES, and pushes changes back to a branch. Monitor progress with `/tasks` or at [claude.ai/code](<https://claude.ai/code>). See [Claude Code on the web](</docs/en/claude-code-on-the-web>) for the full remote session workflow including diff review, auto-fix, and routines. +The session runs on Anthropic infrastructure, clones your repository from GHES, and pushes changes back to a branch. Monitor progress with `/tasks` or at [claude.ai/code](<https://claude.ai/code>). See [Claude Code on the web](</docs/en/claude-code-on-the-web>) for the full cloud session workflow including diff review, auto-fix, and routines. ###
modified Glossary View current →
--- a/glossary.md +++ b/glossary.md @@ -52,7 +52,7 @@ Auto mode -A permission mode where a separate classifier model reviews each action in the background instead of showing you approval prompts. The classifier blocks scope escalation, untrusted infrastructure, and prompt injection. It never sees tool results, so injected instructions cannot influence its decisions. Auto mode is a research preview. Learn more: [Eliminate prompts with auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) +A permission mode where a separate classifier model reviews actions in the background, so most run without approval prompts; explicit ask rules still prompt. The classifier blocks scope escalation, untrusted infrastructure, and prompt injection. It never sees tool results, so injected instructions cannot influence its decisions. Auto mode is a research preview. Learn more: [Eliminate prompts with auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) ## @@ -164,7 +164,7 @@ Effort level -A setting that controls how much of the adaptive-reasoning thinking budget Claude uses on each turn. Higher effort means more thinking tokens and deeper reasoning; lower effort is faster and cheaper. Effort is supported on Opus 4.6 and later, and on Sonnet 4.6. Learn more: [Adjust effort level](</docs/en/model-config#adjust-effort-level>) +A setting that controls how much of the adaptive-reasoning thinking budget Claude uses on each turn. Higher effort means more thinking tokens and deeper reasoning; lower effort is faster and cheaper. Effort is supported on Fable 5, on Opus 4.6 and later, and on Sonnet 4.6. Learn more: [Adjust effort level](</docs/en/model-config#adjust-effort-level>) ### @@ -172,7 +172,7 @@ Extended thinking -Visible step-by-step reasoning the model performs before responding. You can cap thinking tokens with `MAX_THINKING_TOKENS` or adjust the effort level. Thinking appears in gray italic text in the terminal. Learn more: [Use extended thinking](</docs/en/model-config#extended-thinking>) +Visible step-by-step reasoning the model performs before responding. You can adjust it with the effort level, or cap thinking tokens with `MAX_THINKING_TOKENS` on models with a fixed thinking budget. Thinking appears in gray italic text in the terminal. Learn more: [Use extended thinking](</docs/en/model-config#extended-thinking>) ## @@ -304,7 +304,7 @@ Prompt injection -Hostile instructions embedded in a file, web page, or tool result that attempt to redirect Claude toward actions you never asked for. Claude Code’s defenses include the permission system, command blocklists, and trust verification. Auto mode adds a server-side probe that scans tool results for suspicious content and a classifier that never sees tool results, so injected text cannot influence its approval decisions. Learn more: [Protect against prompt injection](</docs/en/security#protect-against-prompt-injection>) +Hostile instructions embedded in a file, web page, or tool result that attempt to redirect Claude toward actions you never asked for. Claude Code’s defenses include the permission system, command injection detection, and trust verification. Auto mode adds a server-side probe that scans tool results for suspicious content and a classifier that never sees tool results, so injected text cannot influence its approval decisions. Learn more: [Protect against prompt injection](</docs/en/security#protect-against-prompt-injection>) ##
modified Run Claude Code programmatically View current →
--- a/headless.md +++ b/headless.md @@ -52,7 +52,7 @@ Background tasks at exit -If Claude starts a [background Bash task](</docs/en/tools-reference#bash-tool-behavior>) during a `claude -p` run, for example a dev server or a watch build, that task is terminated about five seconds after Claude returns its final result and stdin closes. The grace period lets a task that finishes right after the result still deliver its output. Before v2.1.163, a never-exiting background process would hold the `claude -p` invocation open indefinitely. +If Claude starts a [background Bash task](</docs/en/tools-reference#bash-tool-behavior>) during a `claude -p` run, for example a dev server or a watch build, that task is terminated about five seconds after Claude has returned its final result and stdin has closed. The grace period lets a task that finishes right after the result still deliver its output. Before v2.1.163, a never-exiting background process would hold the `claude -p` invocation open indefinitely. ## @@ -201,7 +201,7 @@ The `--allowedTools` flag uses [permission rule syntax](</docs/en/settings#permission-rule-syntax>). The trailing ` *` enables prefix matching, so `Bash(git diff *)` allows any command starting with `git diff`. The space before `*` is important: without it, `Bash(git diff*)` would also match `git diff-index`. -User-invoked [skills](</docs/en/skills>) like `/code-review` and [built-in commands](</docs/en/commands>) are only available in interactive mode. In `-p` mode, describe the task you want to accomplish instead. +User-invoked [skills](</docs/en/skills>) and custom commands work in `-p` mode: include `/skill-name` in the prompt string and Claude Code expands it before running. Built-in commands that open an interactive dialog, such as `/config` and `/login`, are not available in `-p` mode. ###
modified Hooks reference View current →
--- a/hooks.md +++ b/hooks.md @@ -163,7 +163,7 @@ ---|---|--- `~/.claude/settings.json`| All your projects| No, local to your machine `.claude/settings.json`| Single project| Yes, can be committed to the repo -`.claude/settings.local.json`| Single project| No, gitignored +`.claude/settings.local.json`| Single project| No, gitignored when Claude Code creates it Managed policy settings| Organization-wide| Yes, admin-controlled [Plugin](</docs/en/plugins>) `hooks/hooks.json`| When plugin is enabled| Yes, bundled with the plugin [Skill](</docs/en/skills>) or [agent](</docs/en/sub-agents>) frontmatter| While the component is active| Yes, defined in the component file @@ -308,7 +308,7 @@ `Bash(git *)`| `npm test && git push`| yes| each subcommand is checked; `git push` matches `Bash(rm *)`| `echo $(rm -rf /)`| yes| commands inside `$()` and backticks are checked; `rm -rf /` matches `Bash(rm *)`| `echo $(date)`| no| no subcommand matches `rm *` -`Bash(git push *)`| `echo $(date)`| yes| patterns that constrain past the command name fail open on `$()`, backticks, or `$VAR` +`Bash(git push *)`| `echo $(date)`| yes| patterns that specify more than the command name run the hook anyway on `$()`, backticks, or `$VAR` The filter also fails open, running your hook regardless of pattern, when the Bash command cannot be parsed. Because the `if` filter is best-effort, use the [permission system](</docs/en/permissions>) rather than a hook to enforce a hard allow or deny. @@ -779,7 +779,14 @@ SessionStart, Setup, SubagentStart| Context only| `hookSpecificOutput.additionalContext` adds context for Claude. SessionStart also accepts `initialUserMessage`, `watchPaths`, `sessionTitle`, and `reloadSkills`. No blocking or decision control WorktreeRemove, Notification, SessionEnd, PostCompact, InstructionsLoaded, StopFailure, CwdChanged, FileChanged| None| No decision control. Used for side effects like logging or cleanup -Here are examples of each pattern in action: +A few events can also rewrite content rather than only allow or block it: + + * `PreToolUse` — `updatedInput` directly under `hookSpecificOutput` replaces a tool’s arguments before it runs (details) + * `PermissionRequest` — `updatedInput` inside the `decision` object (details) + * `PostToolUse` — `updatedToolOutput` replaces the tool’s result (details) + * `UserPromptSubmit` — cannot replace the prompt; only injects `additionalContext` alongside it + +For redaction or transformation use cases, intercept at `PreToolUse` for outbound tool inputs and `PostToolUse` for inbound tool results. Here are examples of each pattern in action: * Top-level decision
modified Automate actions with hooks View current →
--- a/hooks-guide.md +++ b/hooks-guide.md @@ -458,7 +458,7 @@ Combine results from multiple hooks -When multiple hooks match the same event, every hook’s command runs to completion before Claude Code merges the results. One hook returning `deny` does not stop sibling hooks from executing. Don’t rely on one hook’s `deny` to suppress side effects in another hook. After all matching hooks finish, Claude Code combines their outputs. For `PreToolUse` permission decisions, the most restrictive answer wins: `deny` overrides `ask`, which overrides `allow`. Text from `additionalContext` is kept from every hook and passed to Claude together. The example below registers two `PreToolUse` hooks on `Bash`. The first appends every command to a log file and exits 0. The second runs a script that exits 2 to deny when the command contains `rm -rf`: +When multiple hooks match the same event, every hook’s command runs to completion before Claude Code merges the results. One hook returning `deny` does not stop sibling hooks from executing. Don’t rely on one hook’s `deny` to suppress side effects in another hook. After all matching hooks finish, Claude Code combines their outputs. For `PreToolUse` permission decisions, the most restrictive answer wins, in the order `deny`, `defer`, `ask`, `allow`. Text from `additionalContext` is kept from every hook and passed to Claude together. The example below registers two `PreToolUse` hooks on `Bash`. The first appends every command to a log file and exits 0. The second runs a script that exits 2 to deny when the command contains `rm -rf`: { "hooks": { @@ -708,7 +708,7 @@ `Bash(git *)`| `npm test && git push`| yes| each subcommand is checked; `git push` matches `Bash(git *)`| `echo $(git log)`| yes| commands inside `$()` and backticks are checked; `git log` matches `Bash(git *)`| `echo $(date)`| no| no subcommand matches `git *` -`Bash(git push *)`| `echo $(date)`| yes| patterns that constrain past the command name fail open on `$()`, backticks, or `$VAR` +`Bash(git push *)`| `echo $(date)`| yes| patterns that specify more than the command name run the hook anyway on `$()`, backticks, or `$VAR` The filter also fails open, running your hook regardless of pattern, when the Bash command cannot be parsed. Because the filter is best-effort, use the [permission system](</docs/en/permissions>) rather than a hook to enforce a hard allow or deny. The `if` field accepts the same patterns as permission rules: `"Bash(git *)"`, `"Edit(*.ts)"`, and so on. To match multiple tool names, use separate handlers each with its own `if` value, or match at the `matcher` level where pipe alternation is supported. `if` only works on tool events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, and `PermissionDenied`. Adding it to any other event prevents the hook from running. @@ -724,12 +724,12 @@ ---|---|--- `~/.claude/settings.json`| All your projects| No, local to your machine `.claude/settings.json`| Single project| Yes, can be committed to the repo -`.claude/settings.local.json`| Single project| No, gitignored +`.claude/settings.local.json`| Single project| No, gitignored when Claude Code creates it Managed policy settings| Organization-wide| Yes, admin-controlled [Plugin](</docs/en/plugins>) `hooks/hooks.json`| When plugin is enabled| Yes, bundled with the plugin [Skill](</docs/en/skills>) or [agent](</docs/en/sub-agents>) frontmatter| While the skill or agent is active| Yes, defined in the component file -Run [`/hooks`](</docs/en/hooks#the-hooks-menu>) in Claude Code to browse all configured hooks grouped by event. To disable hooks, set `"disableAllHooks": true` in your settings file. Hooks configured in managed settings still run unless `disableAllHooks` is also set there. If you edit settings files directly while Claude Code is running, the file watcher normally picks up hook changes automatically. +Run [`/hooks`](</docs/en/hooks#the-%2Fhooks-menu>) in Claude Code to browse all configured hooks grouped by event. To disable hooks, set `"disableAllHooks": true` in your settings file. Hooks configured in managed settings still run unless `disableAllHooks` is also set there. If you edit settings files directly while Claude Code is running, the file watcher normally picks up hook changes automatically. ##
modified How Claude Code works View current →
--- a/how-claude-code-works.md +++ b/how-claude-code-works.md @@ -164,7 +164,7 @@ * **Default** : Claude asks before file edits and shell commands * **Auto-accept edits** : Claude edits files and runs common filesystem commands like `mkdir` and `mv` without asking, still asks for other commands - * **Plan mode** : Claude uses read-only tools only, creating a plan you can approve before execution + * **Plan mode** : Claude explores and proposes a plan without editing your source files; permission prompts still apply as in default mode * **Auto mode** : Claude evaluates all actions with background safety checks. Currently a research preview You can also allow specific commands in `.claude/settings.json` so Claude doesn’t ask each time. This is useful for trusted commands like `npm test` or `git status`. Settings can be scoped from organization-wide policies down to personal preferences. See [Permissions](</docs/en/permissions>) for details.
modified Interactive mode View current →
--- a/interactive-mode.md +++ b/interactive-mode.md @@ -31,12 +31,12 @@ `Ctrl+B`| Background running tasks| Backgrounds bash commands and agents. Tmux users press twice `Ctrl+T`| Toggle task list| Show or hide the task list in the terminal status area `Left/Right arrows`| Cycle through dialog tabs| Navigate between tabs in permission dialogs and menus -`Up/Down arrows` or `Ctrl+P`/`Ctrl+N`| Move cursor or navigate command history| In multiline input, first moves the cursor within the prompt. Once the cursor is already on the top or bottom edge, pressing again navigates command history +`Up/Down arrows` or `Ctrl+P`/`Ctrl+N`| Move cursor or navigate command history| When the input spans more than one visual row, whether wrapped or multiline, first moves the cursor within the prompt. Once the cursor is on the first or last visual row, pressing again navigates command history. As of v2.1.169, wrapped single-line input behaves the same as multiline `Esc`| Interrupt Claude| Stop the current response or tool call mid-turn so you can redirect. Claude keeps the work done so far `Esc` \+ `Esc`| Clear input draft, or rewind| When the prompt input contains text, double `Esc` clears it and saves the draft to history so `Up` recalls it. When the input is empty, double `Esc` opens the [rewind menu](</docs/en/checkpointing>) to restore or summarize code and conversation from a previous point `Shift+Tab` or `Alt+M` (some configurations)| Cycle permission modes| Cycle through `default`, `acceptEdits`, `plan`, and any modes you have enabled, such as `auto` or `bypassPermissions`. See [permission modes](</docs/en/permission-modes>). `Option+P` (macOS) or `Alt+P` (Windows/Linux)| Switch model| Switch models without clearing your prompt -`Option+T` (macOS) or `Alt+T` (Windows/Linux)| Toggle extended thinking| Enable or disable extended thinking mode. As of v2.1.132 this shortcut works on macOS without configuring Option as Meta +`Option+T` (macOS) or `Alt+T` (Windows/Linux)| Toggle extended thinking| Enable or disable extended thinking mode. Has no effect on Fable 5, which always uses extended thinking. As of v2.1.132 this shortcut works on macOS without configuring Option as Meta `Option+O` (macOS) or `Alt+O` (Windows/Linux)| Toggle fast mode| Enable or disable [fast mode](</docs/en/fast-mode>) ###
modified Customize keyboard shortcuts View current →
--- a/keybindings.md +++ b/keybindings.md @@ -216,7 +216,7 @@ Action| Default| Description ---|---|--- -`task:background`| Ctrl+B| Background current task +`task:background`| Ctrl+B, Ctrl+X Ctrl+B| Background current task. The Ctrl+X Ctrl+B chord requires v2.1.169 or later and avoids the tmux prefix conflict ###
modified Set up Claude Code in a monorepo or large codebase View current →
--- a/large-codebases.md +++ b/large-codebases.md @@ -134,7 +134,7 @@ Exclude irrelevant CLAUDE.md files -When you start Claude from the repository root, each subdirectory’s CLAUDE.md loads as soon as Claude reads a file in that directory. The `claudeMdExcludes` setting skips specific files by path or glob pattern so they never load. Use this for directories you never work in, such as other teams’ packages, legacy code, or vendored subtrees. The exclusion list is static, not a per-task switch. To focus on one package today and another tomorrow, start Claude from that package’s directory instead of editing exclusions. If you only want these exclusions for yourself, put the setting in `.claude/settings.local.json`, which is gitignored and not committed. Patterns use glob syntax matched against absolute file paths, so start relative-style patterns with `**/` to match anywhere in the tree. The example below excludes packages owned by other teams: +When you start Claude from the repository root, each subdirectory’s CLAUDE.md loads as soon as Claude reads a file in that directory. The `claudeMdExcludes` setting skips specific files by path or glob pattern so they never load. Use this for directories you never work in, such as other teams’ packages, legacy code, or vendored subtrees. The exclusion list is static, not a per-task switch. To focus on one package today and another tomorrow, start Claude from that package’s directory instead of editing exclusions. If you only want these exclusions for yourself, put the setting in `.claude/settings.local.json`. Claude Code gitignores that file when it creates it; since you’re creating it by hand here, add it to your gitignore. Patterns use glob syntax matched against absolute file paths, so start relative-style patterns with `**/` to match anywhere in the tree. The example below excludes packages owned by other teams: .claude/settings.local.json
modified LLM gateway configuration View current →
--- a/llm-gateway.md +++ b/llm-gateway.md @@ -5,6 +5,8 @@ * **Cost controls** \- Implement budgets and rate limits * **Audit logging** \- Track all model interactions for compliance * **Model routing** \- Switch between providers without code changes + +This page covers gateway requirements and configuration for the Claude Code CLI. Enterprise Desktop deployments can configure gateway providers via [managed settings](<https://support.claude.com/en/articles/12622667-enterprise-configuration>). The Claude Desktop app can also run against a self-hosted gateway through the [Cowork on 3P research preview](<https://claude.com/docs/cowork/3p/gateway>), which uses its own configuration keys. ##
modified Connect Claude Code to tools via MCP View current →
--- a/mcp.md +++ b/mcp.md @@ -904,7 +904,7 @@ Scale with MCP Tool Search -Tool search keeps MCP context usage low by deferring tool definitions until Claude needs them. Only tool names and server instructions load at session start, so adding more MCP servers has minimal impact on your context window. +Tool search keeps MCP context usage low by deferring tool definitions until Claude needs them. Only tool names and server instructions load at session start, so adding more MCP servers has minimal impact on your context window. Claude Code does not impose a fixed per-server tool cap; the practical limit is your context window budget. ### @@ -934,7 +934,7 @@ Configure tool search -Tool search is enabled by default: MCP tools are deferred and discovered on demand. Claude Code disables it by default on Vertex AI. It is also disabled when `ANTHROPIC_BASE_URL` points to a non-first-party host, since most proxies do not forward `tool_reference` blocks. Set `ENABLE_TOOL_SEARCH` explicitly to override either fallback. Tool search requires a model that supports `tool_reference` blocks: Sonnet 4 and later, or Opus 4 and later. Haiku models do not support it. On Vertex AI, tool search is supported for Claude Sonnet 4.5 and later and Claude Opus 4.5 and later. Control tool search behavior with the `ENABLE_TOOL_SEARCH` environment variable: +Tool search is enabled by default: MCP tools are deferred and discovered on demand. Claude Code disables it by default on Vertex AI. It is also disabled when `ANTHROPIC_BASE_URL` points to a non-first-party host, since most proxies do not forward `tool_reference` blocks. Set `ENABLE_TOOL_SEARCH` explicitly to override either fallback. Tool search requires a model that supports `tool_reference` blocks. Haiku models do not support it. On Vertex AI, tool search is supported for Claude Sonnet 4.5 and later and Claude Opus 4.5 and later. Control tool search behavior with the `ENABLE_TOOL_SEARCH` environment variable: Value| Behavior ---|---
modified Migrate to Claude Agent SDK View current →
--- a/migration-guide.md +++ b/migration-guide.md @@ -64,7 +64,7 @@ } } -That’s it! No other code changes are required. +**5\. Reviewbreaking changes** Make any code changes needed to complete the migration. ### @@ -142,12 +142,14 @@ Python + import { query } from "@anthropic-ai/claude-agent-sdk"; + // BEFORE (v0.0.x) - Used Claude Code's system prompt by default - const result = query({ prompt: "Hello" }); + const before = query({ prompt: "Hello" }); // AFTER (v0.1.0) - Uses minimal system prompt by default // To get the old behavior, explicitly request Claude Code's preset: - const result = query({ + const presetResult = query({ prompt: "Hello", options: { systemPrompt: { type: "preset", preset: "claude_code" } @@ -155,7 +157,7 @@ }); // Or use a custom system prompt: - const result = query({ + const customResult = query({ prompt: "Hello", options: { systemPrompt: "You are a helpful coding assistant" @@ -176,7 +178,9 @@ Python - const result = query({ + import { query } from "@anthropic-ai/claude-agent-sdk"; + + const isolatedResult = query({ prompt: "Hello", options: { settingSources: [] // No filesystem settings loaded @@ -184,7 +188,7 @@ }); // Or load only specific sources: - const result = query({ + const projectOnlyResult = query({ prompt: "Hello", options: { settingSources: ["project"] // Only project settings
modified Model configuration View current →
Show diff (248 lines)
--- a/model-config.md +++ b/model-config.md @@ -26,7 +26,8 @@ Model alias| Behavior ---|--- **`default`**| Special value that clears any model override and reverts to the recommended model for your account type. Not itself a model alias -**`best`**| Uses the most capable available model, currently equivalent to `opus` +**`best`**| Uses Fable 5 where your organization has access to it, otherwise the latest Opus model +**`fable`**| Uses Claude Fable 5 for your hardest and longest-running tasks **`sonnet`**| Uses the latest Sonnet model for daily coding tasks **`opus`**| Uses the latest Opus model for complex reasoning tasks **`haiku`**| Uses the fast and efficient Haiku model for simple tasks @@ -42,6 +43,21 @@ ​ +Work with Fable 5 + +[Claude Fable 5](<https://platform.claude.com/docs/en/about-claude/models/introducing-claude-fable-5>) is the most capable model in Claude Code, suited to tasks larger than a single sitting. It sustains long autonomous sessions, investigates before acting, and verifies its work more often than smaller models. Fable 5 is not the default model. Select it with `/model fable`. Requests that its safety classifiers flag, most often in cybersecurity and biology domains, trigger automatic model fallback. To get the most from Fable 5: + + * **Describe the outcome, not the steps** : hand it the result you want and let it plan the path. To keep it working until that outcome holds, [set a goal](</docs/en/goal>). + * **Hand it ambiguous problems** : root-cause investigations, outage debugging, and architecture decisions are where the extra investigation and verification pay off. + * **Skip the verification reminders** : it verifies its own work with less prompting, so reminders to test or check are usually unnecessary. + * **Size up larger tasks** : give it work you would normally break into pieces. It holds long sessions without losing the thread. + +Fable 5 requires Claude Code v2.1.170 or later. Older versions do not show Fable 5 in the model picker and cannot select it. Run `claude update` to upgrade. Fable 5 is not available under [zero data retention](</docs/en/zero-data-retention>), where the `/model` picker either omits it or shows it disabled. + +### + +​ + Setting your model You can configure your model in several ways, listed in order of priority: @@ -79,7 +95,7 @@ Restrict model selection -Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, or `ANTHROPIC_MODEL` environment variable. +Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, or `ANTHROPIC_MODEL` environment variable. Elements of a fallback model chain outside the list are dropped. { "availableModels": ["sonnet", "haiku"] @@ -103,7 +119,7 @@ * **`availableModels`** : restricts which named models users can switch to * **`model`** : sets the initial model selection when a session starts - * **`ANTHROPIC_DEFAULT_SONNET_MODEL`** / **`ANTHROPIC_DEFAULT_OPUS_MODEL`** / **`ANTHROPIC_DEFAULT_HAIKU_MODEL`** : control what the Default option and the `sonnet`, `opus`, and `haiku` aliases resolve to + * **`ANTHROPIC_DEFAULT_SONNET_MODEL`** / **`ANTHROPIC_DEFAULT_OPUS_MODEL`** / **`ANTHROPIC_DEFAULT_HAIKU_MODEL`** / **`ANTHROPIC_DEFAULT_FABLE_MODEL`** : control what the Default option and the `sonnet`, `opus`, `haiku`, and `fable` aliases resolve to This example starts users on Sonnet 4.5, limits the picker to Sonnet and Haiku, and pins Default to resolve to Sonnet 4.5 rather than the latest release: @@ -152,7 +168,7 @@ * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 4.6 * **Bedrock, Vertex, and Foundry** : defaults to Sonnet 4.5 -Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Claude Code may automatically fall back to Sonnet if you hit a usage threshold with Opus. +Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models. ### @@ -165,7 +181,77 @@ * **In plan mode** \- Uses `opus` for complex reasoning and architecture decisions * **In execution mode** \- Automatically switches to `sonnet` for code generation and implementation -This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase runs with the standard 200K context window. The automatic 1M upgrade described in Extended context applies to the `opus` model setting and does not extend to `opusplan`. +This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase runs with the standard 200K context window. The automatic 1M upgrade described in Extended context applies to the `opus` model setting and does not extend to `opusplan`. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). + +### + +​ + +Fallback model chains + +When the primary model is overloaded, unavailable, or returns another non-retryable server error, Claude Code can switch to a fallback model instead of failing the request. Authentication, billing, rate-limit, request-size, and transport errors never trigger a switch; those follow their normal retry and error handling. Configure one or more fallback models and Claude Code tries them in order, showing a notice when it switches. The switch lasts for the current turn only, so your next message tries the primary model first again. Chains are capped at three models after duplicate removal, and extra entries are ignored. Set a chain for one session with the `--fallback-model` flag, which accepts a comma-separated list: + + claude --fallback-model sonnet,haiku + +To persist a chain across sessions, set `fallbackModel` in [settings](</docs/en/settings>) as an array: + + { + "fallbackModel": ["claude-sonnet-4-6", "claude-haiku-4-5"] + } + +The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each element accepts a model name or alias, and `"default"` expands to the default model. Two cases cause an element to be skipped: + + * **Unavailable model** : a model that can’t be reached, such as a retired model pinned in settings, is skipped and Claude Code continues to the next element. + * **Outside the allowlist** : an element not permitted by `availableModels` is dropped when the chain is read and never tried. + +### + +​ + +Automatic model fallback + +This section covers content-based fallback from Fable 5. For availability-based fallback when a model is overloaded or unavailable, see Fallback model chains. Fable 5 runs with safety classifiers for cybersecurity and biology content. When a classifier flags a request, Claude Code re-runs that request on the default Opus model and shows a notice in the transcript: Opus 4.8 on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments, or Opus 4.7 on [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). The session then continues on that Opus model. To return to Fable 5, run `/model fable`. + +#### + +​ + +Check what triggered fallback + +Fallback can trigger on the first request of a session, before you send anything unusual, because the first request carries workspace context such as your CLAUDE.md content and git status. A repository that contains security or biology material can trip the classifier on that context alone. To check whether customizations are the trigger, start a session with `claude --safe-mode`, which disables customizations such as CLAUDE.md, skills, MCP servers, and hooks. Git status and directory names are not customizations and are still included. + +#### + +​ + +Ask before switching + +To decide what happens each time a request is flagged, rather than switching automatically, run `/config` and turn off “switch models when a message is flagged”. A flagged request then pauses the session with two options: switch to the Opus model, or edit the prompt and retry on Fable 5. Some cases behave differently: + + * If both models flag the same request, you can edit the prompt and retry, or start a new session. + * On mobile [Claude Code on the web](</docs/en/claude-code-on-the-web>) sessions, editing and retrying is not supported. Switch models, or continue the session from a desktop browser or the desktop app. + * In [non-interactive mode](</docs/en/cli-reference#cli-flags>) and SDK integrations that can’t show the prompt, a flagged request ends the turn with a refusal instead. + +#### + +​ + +Enable fallback on Bedrock, Vertex AI, and Foundry + +On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify both models involved: + + * Claude Code must recognize the current model as Fable 5: the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. + * The fallback target must resolve to an Opus model: the value of `ANTHROPIC_DEFAULT_OPUS_MODEL` if set, otherwise an Opus 4.8 entry in the provider’s model list. + +If either model can’t be identified, Claude Code does not switch automatically. The flagged request ends with a refusal message, and you can switch models with `/model` and retry. To enable automatic fallback on these providers, set `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable 5 model ID and `ANTHROPIC_DEFAULT_OPUS_MODEL` to your Opus 4.8 model ID. + +#### + +​ + +Security research and biology workloads + +Workloads in offensive security or biology, including penetration testing, Capture the Flag (CTF) exercises, and biology-adjacent codebases, trigger fallback frequently, often on the first request. For substantive biology work, expect nearly all requests to reroute. This is expected routing for these domains, not an account flag. If your organization needs Fable-class capability for this work, ask your Anthropic account team about trusted access programs. ### @@ -177,10 +263,11 @@ Model| Levels ---|--- +Fable 5| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.8 and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max` Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max` -If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. The default effort is `high` on Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Opus 4.8 or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Opus 4.8 and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. Set it through `/effort`, or pass `"ultracode": true` via `--settings` or an Agent SDK control request. It is not part of the `effortLevel` setting, the `--effort` flag, or `CLAUDE_CODE_EFFORT_LEVEL`. +If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. The default effort is `high` on Fable 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. Set it through `/effort`, or pass `"ultracode": true` via `--settings` or an Agent SDK control request. It is not part of the `effortLevel` setting, the `--effort` flag, or `CLAUDE_CODE_EFFORT_LEVEL`. #### @@ -194,7 +281,7 @@ ---|--- `low`| Reserve for short, scoped, latency-sensitive tasks that are not intelligence-sensitive `medium`| Reduces token usage for cost-sensitive work that can trade off some intelligence -`high`| Balances token usage and intelligence. Default on Opus 4.8, Opus 4.6, and Sonnet 4.6 +`high`| Balances token usage and intelligence. Default on Fable 5, Opus 4.8, Opus 4.6, and Sonnet 4.6 `xhigh`| Deeper reasoning at higher token spend. Default on Opus 4.7 `max`| Can improve performance on demanding tasks but may show diminishing returns and is prone to overthinking. Test before adopting broadly `ultracode`| A Claude Code setting that plans a [dynamic workflow](</docs/en/workflows>) for each substantive task with `xhigh` per-message reasoning. Session-only @@ -232,7 +319,7 @@ Adaptive reasoning and fixed thinking budgets -Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). +Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Opus 4.7 and later always use adaptive reasoning, as does Fable 5. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>). ### @@ -246,9 +333,9 @@ ---|--- Toggle for the current session| Press `Option+T` on macOS or `Alt+T` on Windows and Linux Set the global default| Run `/config` and toggle thinking mode. Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` -Disable regardless of effort| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>). Other values apply only with a fixed thinking budget - -Thinking output is collapsed by default. Press `Ctrl+O` to toggle verbose mode and see the reasoning as gray italic text. Interactive sessions on the Anthropic API receive redacted thinking blocks by default, so set `showThinkingSummaries: true` in [settings](</docs/en/settings>) if you want the full summaries available when you expand. You are charged for all thinking tokens generated, even when collapsed or redacted. +Disable regardless of effort| Set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>), which turns thinking off on the Anthropic API except on Fable 5. On [third-party providers](</docs/en/third-party-integrations>) this omits the `thinking` parameter instead, and adaptive-reasoning models may still think. Other values apply only with a fixed thinking budget + +Thinking cannot be turned off on Fable 5. The session toggle, `alwaysThinkingEnabled`, and `MAX_THINKING_TOKENS=0` have no effect there, and Fable 5 decides per step how much to think based on the effort level. Thinking output is collapsed 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. ### @@ -256,7 +343,7 @@ Extended context -Opus 4.6 and later, and Sonnet 4.6, support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. Sonnet with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. +Fable 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. On the Anthropic API, Fable 5, Opus 4.8, and Opus 4.7 always run with the 1M window. Sonnet with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max. Plan| Opus with 1M context| Sonnet with 1M context ---|---|--- @@ -308,6 +395,7 @@ Environment variable| Description ---|--- +`ANTHROPIC_DEFAULT_FABLE_MODEL`| The model to use for `fable`, and the model ID Claude Code recognizes as Fable 5 for automatic model fallback on third-party providers `ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active. `ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. `ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>) @@ -321,9 +409,9 @@ Pin models for third-party deployments -When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `sonnet`, `opus`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Bedrock and Vertex AI users see a notice and fall back to the previous version for that session, while Foundry users see errors because Foundry has no equivalent startup check. - -Set all three model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model. +When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Bedrock and Vertex AI users see a notice and fall back to the previous version for that session, while Foundry users see errors because Foundry has no equivalent startup check. + +Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model. Use the following environment variables with version-specific model IDs for your provider: @@ -333,7 +421,7 @@ Vertex AI| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` -Apply the same pattern for `ANTHROPIC_DEFAULT_SONNET_MODEL` and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: +Apply the same pattern for `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8[1m]' @@ -343,7 +431,7 @@ * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>). * The suffix is read per variable, not per model. On Bedrock, Vertex, and Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. -The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias (`opus`, `sonnet`, `haiku`), not the provider-specific model ID. +The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias (`fable`, `opus`, `sonnet`, `haiku`), not the provider-specific model ID. ### @@ -359,7 +447,7 @@ `ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION`| Display description for the pinned Opus model in the `/model` picker. Defaults to `Custom Opus model` when not set `ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`| Comma-separated list of capabilities the pinned Opus model supports -The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and extended thinking by matching the model ID against known patterns. Provider-specific IDs such as Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: +The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_FABLE_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and extended thinking by matching the model ID against known patterns. Provider-specific IDs such as Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: Capability value| Enables ---|--- @@ -409,5 +497,6 @@ `DISABLE_PROMPT_CACHING_HAIKU`| Set to `1` to disable prompt caching for Haiku models only `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_FABLE`| Set to `1` to disable prompt caching for Fable models only To change the cache TTL or learn what triggers a cache miss, see [How Claude Code uses prompt caching](</docs/en/prompt-caching>).
modified Monitoring View current →
--- a/monitoring-usage.md +++ b/monitoring-usage.md @@ -412,7 +412,7 @@ `organization.id`| Organization UUID (when authenticated)| Always included when available `user.account_uuid`| Account UUID (when authenticated)| `OTEL_METRICS_INCLUDE_ACCOUNT_UUID` (default: true) `user.account_id`| Account ID in tagged format matching Anthropic admin APIs (when authenticated), such as `user_01BWBeN28...`| `OTEL_METRICS_INCLUDE_ACCOUNT_UUID` (default: true) -`user.id`| Anonymous device/installation identifier, generated per Claude Code installation| Always included +`user.id`| Random anonymous identifier generated on first run and persisted in `~/.claude.json`. It contains no personal information and is not derived from your Claude account. Deleting the file produces a new unrelated value on next run.| Always included `user.email`| User email address (when authenticated via OAuth)| Always included when available `terminal.type`| Terminal type, such as `iTerm.app`, `vscode`, `cursor`, or `tmux`| Always included when detected 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) @@ -868,6 +868,7 @@ * `skill_path_count`: number of skill directories the plugin declares * `command_path_count`: number of command directories the plugin declares * `agent_path_count`: number of agent directories the plugin declares + * `safe_mode`: `"true"` when the session was started with [`--safe-mode`](</docs/en/cli-reference>), `"false"` otherwise. In safe mode this event reports configured inventory only; the plugin’s commands, skills, hooks, and MCP servers do not load. Requires Claude Code v2.1.169 or later #### @@ -937,6 +938,7 @@ * `hook_event`: hook event type, such as `"PreToolUse"` or `"PostToolUse"` * `hook_type`: hook implementation type: `"command"`, `"prompt"`, `"mcp_tool"`, `"http"`, or `"agent"` * `hook_source`: where the hook is defined: `"userSettings"`, `"projectSettings"`, `"localSettings"`, `"flagSettings"`, `"policySettings"`, or `"pluginHook"` + * `safe_mode`: `"true"` when the session was started with [`--safe-mode`](</docs/en/cli-reference>), `"false"` otherwise. Requires Claude Code v2.1.169 or later * `hook_matcher` (when `OTEL_LOG_TOOL_DETAILS=1`): the matcher string from the hook configuration, when one is set * `plugin.name` (when `hook_source` is `"pluginHook"`): name of the contributing plugin. For plugins outside the official marketplace and built-in bundle the value is `"third-party"` unless `OTEL_LOG_TOOL_DETAILS=1` * `plugin_id_hash` (when `hook_source` is `"pluginHook"`): deterministic hash of the plugin name and marketplace, sent only to your configured exporter. Lets you count distinct contributing plugins without recording their names @@ -958,6 +960,7 @@ * `num_hooks`: Number of matching hook commands * `managed_only`: `"true"` when only managed-policy hooks are permitted * `hook_source`: `"policySettings"` or `"merged"` + * `safe_mode`: `"true"` when the session was started with [`--safe-mode`](</docs/en/cli-reference>), `"false"` otherwise. Requires Claude Code v2.1.169 or later * `hook_definitions`: JSON-serialized hook configuration. Included only when both detailed beta tracing and `OTEL_LOG_TOOL_DETAILS=1` are enabled #### @@ -982,6 +985,7 @@ * `total_duration_ms`: Wall-clock duration of all matching hooks * `managed_only`: `"true"` when only managed-policy hooks are permitted * `hook_source`: `"policySettings"` or `"merged"` + * `safe_mode`: `"true"` when the session was started with [`--safe-mode`](</docs/en/cli-reference>), `"false"` otherwise. Requires Claude Code v2.1.169 or later * `hook_definitions`: JSON-serialized hook configuration. Included only when both detailed beta tracing and `OTEL_LOG_TOOL_DETAILS=1` are enabled #### @@ -1085,7 +1089,7 @@ * Unusual token consumption * High session volume from specific users -All metrics can be segmented by `user.account_uuid`, `user.account_id`, `organization.id`, `session.id`, `model`, and `app.version`. +All metrics can be segmented by the standard attributes. The `model` attribute is available on `claude_code.token.usage` and `claude_code.cost.usage` only; activity counters have never carried it. Per-model breakdowns of lines of code or commits can only be approximated by joining against the token or cost metrics on `session.id`, since one session can span multiple models. ###
modified Overview View current →
--- a/overview.md +++ b/overview.md @@ -147,7 +147,7 @@ * Step away from your desk and keep working from your phone or any browser with [Remote Control](</docs/en/remote-control>) * Message [Dispatch](</docs/en/desktop#sessions-from-dispatch>) a task from your phone and open the Desktop session it creates - * Kick off a long-running task on the [web](</docs/en/claude-code-on-the-web>) or [iOS app](<https://apps.apple.com/app/claude-by-anthropic/id6473753684>), then pull it into your terminal with `claude --teleport` + * Kick off a long-running task on the [web](</docs/en/claude-code-on-the-web>) or [iOS app](<https://apps.apple.com/app/claude-by-anthropic/id6473753684>), then pull it into your terminal with `claude --teleport`. Teleport requires a claude.ai subscription. * Hand off a terminal session to the [Desktop app](</docs/en/desktop>) with `/desktop` for visual diff review * Route tasks from team chat: mention `@Claude` in [Slack](</docs/en/slack>) with a bug report and get a pull request back
modified Choose a permission mode View current →
--- a/permission-modes.md +++ b/permission-modes.md @@ -17,7 +17,7 @@ `dontAsk`| Only pre-approved tools| Locked-down CI and scripts `bypassPermissions`| Everything| Isolated containers and VMs only -In every mode except `bypassPermissions`, writes to protected paths are never auto-approved, guarding repository state and Claude’s own configuration against accidental corruption. Modes set the baseline. Layer [permission rules](</docs/en/permissions#manage-permissions>) on top to pre-approve or block specific tools in any mode except `bypassPermissions`, which skips the permission layer entirely. +In every mode except `bypassPermissions`, writes to protected paths are never auto-approved, guarding repository state and Claude’s own configuration against accidental corruption. Modes set the baseline. Layer [permission rules](</docs/en/permissions#manage-permissions>) on top to pre-approve or block specific tools. Deny rules and explicit ask rules apply in every mode, including `bypassPermissions`. Allow rules have no effect in that mode because everything else is already approved. ## @@ -75,7 +75,7 @@ Use the mode dropdown next to the prompt box on [claude.ai/code](<https://claude.ai/code>) or in the mobile app. Permission prompts appear in claude.ai for approval. Which modes appear depends on where the session runs: - * **Cloud sessions** on [Claude Code on the web](</docs/en/claude-code-on-the-web>): Auto accept edits and Plan mode. Ask permissions, Auto, and Bypass permissions are not available. + * **Cloud sessions** on [Claude Code on the web](</docs/en/claude-code-on-the-web>): Accept edits, Plan mode, and Auto mode. Accept edits corresponds to `default` mode: the cloud environment pre-approves file edits regardless of mode, so the dropdown shows Accept edits instead of Ask permissions. `defaultMode: "acceptEdits"` from settings is still honored. Auto mode appears only when your organization allows it and the selected model supports it. Bypass permissions is not available. * **[Remote Control](</docs/en/remote-control>) sessions** on your local machine: Ask permissions, Auto accept edits, and Plan mode. Auto and Bypass permissions are not available. For Remote Control, you can also set the starting mode when launching the host: @@ -142,7 +142,7 @@ Auto mode requires Claude Code v2.1.83 or later. -Auto mode lets Claude execute without permission prompts. A separate classifier model reviews actions before they run, blocking anything that escalates beyond your request, targets unrecognized infrastructure, or appears driven by hostile content Claude read. Auto mode also nudges Claude to keep working without stopping for clarifying questions, though Claude still asks when your prompt or a skill explicitly relies on it. For stronger autonomous behavior while keeping permission prompts, set the [Proactive output style](</docs/en/output-styles>) instead. +Auto mode lets Claude execute without routine permission prompts. A separate classifier model reviews actions before they run, blocking anything that escalates beyond your request, targets unrecognized infrastructure, or appears driven by hostile content Claude read. Explicit [ask rules](</docs/en/permissions#manage-permissions>) still force a prompt. Auto mode also nudges Claude to keep working without stopping for clarifying questions, though Claude still asks when your prompt or a skill explicitly relies on it. For stronger autonomous behavior while keeping permission prompts, set the [Proactive output style](</docs/en/output-styles>) instead. Auto mode is a research preview. It reduces prompts but does not guarantee safety. Use it for tasks where you trust the general direction, not as a replacement for review on sensitive operations. @@ -250,7 +250,7 @@ Allow only pre-approved tools with dontAsk mode -`dontAsk` mode auto-denies every tool call that would otherwise prompt. Only actions matching your `permissions.allow` rules and [read-only Bash commands](</docs/en/permissions#read-only-commands>) can execute; explicit `ask` rules are denied rather than prompting. This makes the mode fully non-interactive for CI pipelines or restricted environments where you pre-define exactly what Claude may do. Set it at startup with the flag: +`dontAsk` mode auto-denies every tool call that would otherwise prompt. Only actions matching your `permissions.allow` rules and [read-only Bash commands](</docs/en/permissions#read-only-commands>) can execute; explicit [`ask` rules](</docs/en/permissions#manage-permissions>) are denied rather than prompting. This makes the mode fully non-interactive for CI pipelines or restricted environments where you pre-define exactly what Claude may do. Cloud sessions on [Claude Code on the web](</docs/en/claude-code-on-the-web>) ignore `defaultMode: "dontAsk"`; see bypassPermissions for details. Set it at startup with the flag: claude --permission-mode dontAsk @@ -260,7 +260,7 @@ Skip all checks with bypassPermissions mode -`bypassPermissions` mode disables permission prompts and safety checks so tool calls execute immediately. As of v2.1.126 this includes writes to protected paths, which earlier versions still prompted for. Removals targeting the filesystem root or home directory, such as `rm -rf /` and `rm -rf ~`, still prompt as a circuit breaker against model error. Only use this mode in isolated environments like containers, VMs, or dev containers without internet access, where Claude Code cannot damage your host system. You cannot enter `bypassPermissions` from a session that was started without one of the enabling flags; restart with one to enable it: +`bypassPermissions` mode disables permission prompts and safety checks so tool calls execute immediately. As of v2.1.126 this includes writes to protected paths, which earlier versions still prompted for. Explicit [ask rules](</docs/en/permissions#manage-permissions>) still force a prompt in this mode, and removals targeting the filesystem root or home directory, such as `rm -rf /` and `rm -rf ~`, still prompt as a circuit breaker against model error. Only use this mode in isolated environments like containers, VMs, or dev containers without internet access, where Claude Code cannot damage your host system. You cannot enter `bypassPermissions` from a session that was started without one of the enabling flags; restart with one to enable it: claude --permission-mode bypassPermissions @@ -268,9 +268,9 @@ --dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons -The check is skipped automatically inside a recognized sandbox. To run autonomously in a container, use the [dev container](</docs/en/devcontainer>) configuration, which runs Claude Code as a non-root user. - -`bypassPermissions` offers no protection against prompt injection or unintended actions. For background safety checks without prompts, use auto mode instead. Administrators can block this mode by setting `permissions.disableBypassPermissionsMode` to `"disable"` in [managed settings](</docs/en/permissions#managed-settings>). +The check is skipped automatically inside a recognized sandbox. To run autonomously in a container, use the [dev container](</docs/en/devcontainer>) configuration, which runs Claude Code as a non-root user. [Claude Code on the web](</docs/en/claude-code-on-the-web>) does not honor `defaultMode: "bypassPermissions"` or `"dontAsk"` from your settings files, so a repository’s checked-in settings cannot start a cloud session in bypass-permissions mode. The setting is ignored silently and the session starts in the mode shown in the mode dropdown instead. See Switch permission modes for which modes cloud sessions offer. + +`bypassPermissions` offers no protection against prompt injection or unintended actions. For background safety checks with far fewer prompts, use auto mode instead. Administrators can block this mode by setting `permissions.disableBypassPermissionsMode` to `"disable"` in [managed settings](</docs/en/permissions#managed-settings>). ## @@ -287,7 +287,7 @@ `dontAsk`| Denied `bypassPermissions`| Allowed -Protected directories: +[`permissions.allow`](</docs/en/permissions#manage-permissions>) rules in settings files do not pre-approve protected-path writes. The safety check runs before Claude Code evaluates allow rules from settings, so an entry such as `Edit(.claude/**)` in `~/.claude/settings.json` or `.claude/settings.json` does not change the per-mode outcome in the table above. In modes that prompt, the prompt for a `.claude/` write offers **Yes, and allow Claude to edit its own settings for this session** , which approves later `.claude/` writes in that session without prompting again. Protected directories: * `.git` * `.config/git`
modified Configure permissions View current →
--- a/permissions.md +++ b/permissions.md @@ -26,7 +26,7 @@ * **Ask** rules prompt for confirmation whenever Claude Code tries to use the specified tool. * **Deny** rules prevent Claude Code from using the specified tool. -Rules are evaluated in order: **deny - > ask -> allow**. The first matching rule wins, so deny rules always take precedence. Deny rules behave differently depending on whether they name a tool or scope a pattern within one. A bare tool name like `Bash` removes the tool from Claude’s context entirely, so Claude never sees it. A scoped rule like `Bash(rm *)` leaves the tool available and blocks matching calls when Claude attempts them. +Rules are evaluated in order: deny, then ask, then allow. The first match in that order determines the outcome, and rule specificity does not change the order. A matching ask rule prompts even when a more specific allow rule also matches the same call. Deny rules behave differently depending on whether they name a tool or scope a pattern within one. A bare tool name like `Bash` removes the tool from Claude’s context entirely, so Claude never sees it. A scoped rule like `Bash(rm *)` leaves the tool available and blocks matching calls when Claude attempts them. Permission rules are enforced by Claude Code, not by the model. Instructions in your prompt or `CLAUDE.md` shape what Claude tries to do, but they don’t change what Claude Code allows. To grant or revoke access, use `/permissions`, the rules described here, a [permission mode](</docs/en/permission-modes>), or a PreToolUse hook. @@ -45,9 +45,9 @@ `plan`| Plan Mode: Claude reads files and runs read-only shell commands to explore but does not edit your source files `auto`| Auto-approves tool calls with background safety checks that verify actions align with your request. Currently a research preview `dontAsk`| Auto-denies tools unless pre-approved via `/permissions` or `permissions.allow` rules -`bypassPermissions`| Skips all permission prompts. Root and home directory removals such as `rm -rf /` still prompt as a circuit breaker - -`bypassPermissions` mode skips all permission prompts, including writes to `.git`, `.config/git`, `.claude`, `.vscode`, `.idea`, `.husky`, `.cargo`, `.devcontainer`, `.yarn`, and `.mvn`. Removals targeting the filesystem root or home directory, such as `rm -rf /` and `rm -rf ~`, still prompt as a circuit breaker against model error. Only use this mode in isolated environments like containers or VMs where Claude Code cannot cause damage. Administrators can prevent this mode by setting `permissions.disableBypassPermissionsMode` to `"disable"` in managed settings. +`bypassPermissions`| Skips permission prompts, except those forced by explicit `ask` rules. Root and home directory removals such as `rm -rf /` also still prompt as a circuit breaker + +`bypassPermissions` mode skips permission prompts, including for writes to `.git`, `.config/git`, `.claude`, `.vscode`, `.idea`, `.husky`, `.cargo`, `.devcontainer`, `.yarn`, and `.mvn`. Explicit `ask` rules still force a prompt, and removals targeting the filesystem root or home directory, such as `rm -rf /` and `rm -rf ~`, still prompt as a circuit breaker against model error. Only use this mode in isolated environments like containers or VMs where Claude Code cannot cause damage. Administrators can prevent this mode by setting `permissions.disableBypassPermissionsMode` to `"disable"` in managed settings. To prevent `bypassPermissions` or `auto` mode from being used, set `permissions.disableBypassPermissionsMode` or `permissions.disableAutoMode` to `"disable"` in any [settings file](</docs/en/settings#settings-files>). These are most useful in managed settings where they cannot be overridden. @@ -114,6 +114,24 @@ The space before `*` matters: `Bash(ls *)` matches `ls -la` but not `lsof`, while `Bash(ls*)` matches both. The `:*` suffix is an equivalent way to write a trailing wildcard, so `Bash(ls:*)` matches the same commands as `Bash(ls *)`. The permission dialog writes the space-separated form when you select “Yes, don’t ask again” for a command prefix. The `:*` form is only recognized at the end of a pattern. In a pattern like `Bash(git:* push)`, the colon is treated as a literal character and won’t match git commands. +### + +​ + +Tool name wildcards + +Deny and ask rules also accept glob patterns in the tool-name position. The pattern must match the full tool name: `"*"` matches every tool, and `"mcp__*"` matches every MCP tool across all servers. A tool matched by a bare-name glob deny rule is removed from Claude’s context, the same as a bare tool name. This configuration denies every MCP tool: + + { + "permissions": { + "deny": [ + "mcp__*" + ] + } + } + +Allow rules accept tool-name globs only after a literal `mcp__<server>__` prefix. The server segment must be glob-free so the rule names a specific server you configured. `mcp__puppeteer__*` matches every tool from the `puppeteer` server, and `mcp__github__get_*` matches its `get_` tools. An unanchored allow glob such as `"*"`, `"B*"`, or `"mcp__*"` is skipped with a warning and does not auto-approve anything. A deny or ask rule whose tool name matches no known tool produces a startup warning to catch typos. Tool names containing `_` or `*` are exempt from the check. + ## ​ @@ -282,6 +300,20 @@ } } +### + +​ + +Cd + +`Cd` rules control which directories the [`/cd` command](</docs/en/commands>) can move the session to. `Cd` is not a model-invocable tool: Claude cannot call it, and the rules apply only when you run `/cd` yourself. A bare `Cd` deny rule disables `/cd` entirely. A `Cd(<path-pattern>)` deny rule blocks matching targets. Deny rules check every spelling of the target, including each symlink hop it resolves through, so a rule written for one path also blocks targets that resolve to it. Adding any `Cd` allow rule switches `/cd` to allowlist mode: the resolved target directory must match one of your allow rules, or `/cd` refuses. With no `Cd` rules configured, `/cd` keeps its default behavior and prompts you to trust an unfamiliar directory. Path patterns share the `//`, `~/`, and `/` anchors from Read and Edit rules, but matching is anchored to the whole directory path rather than gitignore-style. `*` matches exactly one path segment and `**` matches across segments. A trailing `/**` also matches its named root. + +Rule| Matches| Does not match +---|---|--- +`Cd(~/code/*)`| `~/code/app`| `~/code/app/src`, `~/code` +`Cd(~/code/**)`| `~/code` and any directory under it| directories outside `~/code` +`Cd(**/node_modules)`| any `node_modules` directory at any depth| `node_modules/pkg` + ## ​ @@ -302,7 +334,7 @@ * **During session** : use `/add-dir` command * **Persistent configuration** : add to `additionalDirectories` in [settings files](</docs/en/settings#settings-files>) -Files in additional directories follow the same permission rules as the original working directory: they become readable without prompts, and file editing permissions follow the current permission mode. +Files in additional directories follow the same permission rules as the original working directory: they become readable without prompts, and file editing permissions follow the current permission mode. To change the session’s primary working directory instead of adding another, use [`/cd`](</docs/en/commands>). The `/cd` command requires Claude Code v2.1.169 or later. Unlike `/add-dir`, it relocates the session: the new directory’s `CLAUDE.md` is loaded and `--resume` finds the session from there. ### @@ -342,7 +374,7 @@ * Filesystem restrictions in the sandbox combine the [`sandbox.filesystem`](</docs/en/sandboxing>) settings with Read and Edit deny rules; both are merged into the final sandbox boundary * Network restrictions combine WebFetch permission rules with the sandbox’s `allowedDomains` and `deniedDomains` lists -When sandboxing is enabled with `autoAllowBashIfSandboxed: true`, which is the default, sandboxed Bash commands run without prompting even if your permissions include `ask: Bash(*)`. The sandbox boundary substitutes for the per-command prompt. Explicit deny rules still apply, and `rm` or `rmdir` commands that target `/`, your home directory, or other critical system paths still trigger a prompt. See [sandbox modes](</docs/en/sandboxing#sandbox-modes>) to change this behavior. +When sandboxing is enabled with `autoAllowBashIfSandboxed: true`, which is the default, sandboxed Bash commands run without prompting even if your permissions include a bare `Bash` ask rule, or the equivalent `Bash(*)` form: the sandbox boundary substitutes for that whole-tool prompt. Content-scoped ask rules like `Bash(git push *)` still force a prompt, explicit deny rules still apply, and `rm` or `rmdir` commands that target `/`, your home directory, or other critical system paths still trigger a prompt. Commands that won’t run sandboxed, such as excluded commands, respect the bare `Bash` ask rule as usual. See [sandbox modes](</docs/en/sandboxing#sandbox-modes>) to change this behavior. ##
modified Platforms and integrations View current →
--- a/platforms.md +++ b/platforms.md @@ -17,7 +17,7 @@ [Web](</docs/en/claude-code-on-the-web>)| Long-running tasks that don’t need much steering, or work that should continue when you’re offline| Anthropic-managed cloud, continues after you disconnect Mobile| Starting and monitoring tasks while away from your computer| Cloud sessions from the Claude app for iOS and Android, [Remote Control](</docs/en/remote-control>) for local sessions, [Dispatch](</docs/en/desktop#sessions-from-dispatch>) to Desktop on Pro and Max -The CLI is the most complete surface for terminal-native work: scripting and the Agent SDK are CLI-only. Third-party providers also work in [VS Code](</docs/en/vs-code#use-third-party-providers>). Enterprise [Desktop](</docs/en/desktop>) deployments support Vertex AI and gateway providers; for Bedrock or Foundry, use the CLI or VS Code instead of Desktop. Desktop and the IDE extensions trade some CLI-only features for visual review and tighter editor integration. The web runs in Anthropic’s cloud, so tasks keep going after you disconnect. Mobile is a thin client into those same cloud sessions or into a local session via Remote Control, and can send tasks to Desktop with Dispatch. You can mix surfaces on the same project. Configuration, project memory, and MCP servers are shared across the local surfaces. +The CLI is the most complete surface for terminal-native work: scripting and the Agent SDK are CLI-only. Third-party providers also work in [VS Code](</docs/en/vs-code#use-third-party-providers>). Enterprise [Desktop](</docs/en/desktop>) deployments support Vertex AI and gateway providers; for Bedrock or Foundry, use the CLI or VS Code, or the [Cowork on 3P research preview](<https://claude.com/docs/cowork/3p/overview>), which runs the Code tab on those providers. Desktop and the IDE extensions trade some CLI-only features for visual review and tighter editor integration. The web runs in Anthropic’s cloud, so tasks keep going after you disconnect. Mobile is a thin client into those same cloud sessions or into a local session via Remote Control, and can send tasks to Desktop with Dispatch. You can mix surfaces on the same project. Configuration, project memory, and MCP servers are shared across the local surfaces. ##
modified Recommend your plugin from your CLI View current →
--- a/plugin-hints.md +++ b/plugin-hints.md @@ -63,7 +63,7 @@ When the hint passes all checks, Claude Code shows a prompt like the following: ───────────────────────────────────────────────────────────── - Plugin Recommendation + Plugin recommendation The example-cli command suggests installing a plugin.
modified Create and distribute a plugin marketplace View current →
--- a/plugin-marketplaces.md +++ b/plugin-marketplaces.md @@ -164,7 +164,7 @@ `owner`| object| Marketplace maintainer information (see fields below)| `plugins`| array| List of available plugins| See below -**Reserved names** : The following marketplace names are reserved for official Anthropic use and cannot be used by third-party marketplaces: `claude-code-marketplace`, `claude-code-plugins`, `claude-plugins-official`, `anthropic-marketplace`, `anthropic-plugins`, `agent-skills`, `anthropic-agent-skills`, `knowledge-work-plugins`, `life-sciences`, `claude-for-legal`, `claude-for-financial-services`, `financial-services-plugins`. Names that impersonate official marketplaces, such as `official-claude-plugins` or `anthropic-tools-v2`, are also blocked. +**Reserved names** : The following marketplace names are reserved for official Anthropic use and cannot be used by third-party marketplaces: `claude-code-marketplace`, `claude-code-plugins`, `claude-plugins-official`, `claude-plugins-community`, `claude-community`, `anthropic-marketplace`, `anthropic-plugins`, `agent-skills`, `anthropic-agent-skills`, `knowledge-work-plugins`, `life-sciences`, `claude-for-legal`, `claude-for-financial-services`, `financial-services-plugins`. Names that impersonate official marketplaces, such as `official-claude-plugins` or `anthropic-tools-v2`, are also blocked. ### @@ -268,6 +268,8 @@ * **Plugin source** — where to fetch an individual plugin listed in the marketplace. Set in the `source` field of each plugin entry inside `marketplace.json`. Supports both `ref` (branch/tag) and `sha` (exact commit). For example, a marketplace hosted at `acme-corp/plugin-catalog` (marketplace source) can list a plugin fetched from `acme-corp/code-formatter` (plugin source). The marketplace source and plugin source point to different repositories and are pinned independently. + +The git-based source types below are `github`, `url`, and `git-subdir`. When both `ref` and `sha` are set on any of them, the `sha` is the effective pin. Claude Code fetches and checks out the pinned commit directly, so installation succeeds even if the branch or tag named by `ref` has since been deleted upstream, as long as the commit is still reachable from the repository. ### @@ -1002,6 +1004,7 @@ * Check that plugin directories contain required files * For GitHub sources, ensure repositories are public or you have access * Test plugin sources manually by cloning/downloading + * If the source pins both `ref` and `sha`, a deleted upstream branch or tag does not block installation. If the install still fails, confirm the pinned commit still exists in the repository ###
modified Create plugins View current →
--- a/plugins.md +++ b/plugins.md @@ -192,6 +192,8 @@ `bin/`| Plugin root| Executables added to the Bash tool’s `PATH` while the plugin is enabled `settings.json`| Plugin root| Default [settings](</docs/en/settings>) applied when the plugin is enabled +A plugin that ships exactly one skill can place `SKILL.md` directly at the plugin root instead of creating a `skills/` directory. Claude Code loads it as a single skill and uses the frontmatter `name` field for the invocation name. Use the `skills/` layout for plugins that may grow to more than one skill. + **Next steps** : Ready to add more features? Jump to Develop more complex plugins to add agents, hooks, MCP servers, and LSP servers. For complete technical specifications of all plugin components, see [Plugins reference](</docs/en/plugins-reference>). ## @@ -471,7 +473,7 @@ Hooks in `settings.json`| Hooks in `hooks/hooks.json` Must manually copy to share| Install with `/plugin install` -After migrating, you can remove the original files from `.claude/` to avoid duplicates. The plugin version will take precedence when loaded. +After migrating, remove the original files from `.claude/` to avoid duplicates. Project and user `.claude/agents/` definitions override same-named plugin agents, so the plugin version only takes effect once the originals are removed. ##
modified Plugins reference View current →
--- a/plugins-reference.md +++ b/plugins-reference.md @@ -30,7 +30,7 @@ * Claude can invoke them automatically based on task context * Skills can include supporting files alongside SKILL.md -For complete details, see [Skills](</docs/en/skills>). +If a plugin has no `skills/` directory and no `skills` manifest field, a `SKILL.md` at the plugin root is loaded as a single skill. Set the frontmatter `name` field to control the skill’s invocation name. Without it, Claude Code falls back to the install directory name, which for marketplace-installed plugins is a version string that changes on every update. For plugins that ship more than one skill, use the `skills/` directory layout shown above. For complete details, see [Skills](</docs/en/skills>). ### @@ -219,6 +219,7 @@ `workspaceFolder`| Workspace folder path for the server `startupTimeout`| Max time to wait for server startup (milliseconds) `maxRestarts`| Maximum number of restart attempts before giving up +`diagnostics`| Whether to push diagnostics into Claude’s context after edits (default `true`). Set to `false` to keep code navigation but suppress automatic diagnostic injection. **You must install the language server binary separately.** LSP plugins configure how Claude Code connects to a language server, but they don’t include the server itself. If you see `Executable not found in $PATH` in the `/plugin` Errors tab, install the required binary for your language.
modified How Claude Code uses prompt caching View current →
--- a/prompt-caching.md +++ b/prompt-caching.md @@ -59,7 +59,7 @@ Switching models -Each model has its own cache. Switching with [`/model`](</docs/en/model-config#setting-your-model>) means the next request reads the entire conversation history with no cache hits, even though the content is identical. The [`opusplan` model setting](</docs/en/model-config#opusplan-model-setting>) resolves to Opus during plan mode and Sonnet during execution, so each plan-mode toggle is a model switch and starts a fresh cache. +Each model has its own cache. Switching with [`/model`](</docs/en/model-config#setting-your-model>) means the next request reads the entire conversation history with no cache hits, even though the content is identical. The [`opusplan` model setting](</docs/en/model-config#opusplan-model-setting>) resolves to Opus during plan mode and Sonnet during execution, so each plan-mode toggle is a model switch and starts a fresh cache. [Automatic model fallback](</docs/en/model-config#automatic-model-fallback>) on Fable 5 is also a model switch. When a safety classifier flags a request, Claude Code re-runs it on the default Opus model and the session continues there. ### @@ -85,7 +85,7 @@ Connecting or disconnecting an MCP server -Tool definitions sit in the system prompt layer, so the cache invalidates when the set of tool definitions in the request changes between turns. Whether an [MCP server](</docs/en/mcp>) change does this depends on whether its tools are deferred by [tool search](</docs/en/mcp#scale-with-mcp-tool-search>) or loaded into the prefix: +Tool definitions sit in the system prompt layer, so the cache invalidates when the set of tool definitions in the request changes between turns. Toggling the [advisor tool](</docs/en/advisor>) is an exception: its definition sits after the cache breakpoint, so enabling or disabling `/advisor` keeps the cached prefix intact. Whether an [MCP server](</docs/en/mcp>) change does this depends on whether its tools are deferred by [tool search](</docs/en/mcp#scale-with-mcp-tool-search>) or loaded into the prefix: * **Deferred tools** , the default on supported models: a server connecting, disconnecting, or changing its tool list only appends new content and doesn’t disturb anything already cached. * **Tools loaded into the prefix** : any change to them invalidates the cache. This happens when [tool search is unavailable or disabled](</docs/en/mcp#configure-tool-search>), such as on Haiku models, on Vertex AI, or with a custom `ANTHROPIC_BASE_URL` gateway. It also happens for a server or tool marked [`alwaysLoad`](</docs/en/mcp#exempt-a-server-from-deferral>), and for definitions kept upfront by [threshold-based loading](</docs/en/mcp#configure-tool-search>). @@ -98,7 +98,7 @@ Enabling or disabling a plugin -[Plugins](</docs/en/plugins>) bundle several component types, and the cost of a change depends on which components the plugin provides. Skills, commands, agents, hooks, LSP servers, monitors, and themes never invalidate the cache: anything they add to the request is appended after the existing conversation, so the next request pays for the new content but still reads everything before it from the cache. The exception is a plugin that provides [MCP servers](</docs/en/plugins-reference#mcp-servers>). Enabling or disabling one follows the same rules as connecting or disconnecting an MCP server: the cache survives when the server’s tools are deferred, and the next request re-reads the entire conversation when they load into the prefix. Plugin changes apply when you run [`/reload-plugins`](</docs/en/discover-plugins#apply-plugin-changes-without-restarting>) or start a new session. The cost, whether appended announcements or a full re-read, shows up on the first turn after the reload, not when you run `/plugin install`, `/plugin enable`, or `/plugin disable`. As of v2.1.163, when a reload would trigger the full re-read, `/reload-plugins` warns and holds instead of applying it. Pass `--force` to apply anyway. Disabling a plugin you enabled earlier in the session restores the previous request shape. If that prefix is still within its cache lifetime, the next request reads the older cache entry instead of rebuilding. +[Plugins](</docs/en/plugins>) bundle several component types, and the cost of a change depends on which components the plugin provides. Skills, commands, agents, hooks, LSP servers, monitors, and themes never invalidate the cache: anything they add to the request is appended after the existing conversation, so the next request pays for the new content but still reads everything before it from the cache. The exception is a plugin that provides [MCP servers](</docs/en/plugins-reference#mcp-servers>). Enabling or disabling one follows the same rules as connecting or disconnecting an MCP server: the cache survives when the server’s tools are deferred, and the next request re-reads the entire conversation when they load into the prefix. Plugin changes apply when you run [`/reload-plugins`](</docs/en/discover-plugins#apply-plugin-changes-without-restarting>) or start a new session. The cost, whether appended announcements or a full re-read, shows up on the first turn after the reload, not when you run `/plugin install`, `/plugin enable`, or `/plugin disable`. As of v2.1.163, when a reload would trigger the full re-read, `/reload-plugins` shows a warning and does not apply the reload. Pass `--force` to apply anyway. Disabling a plugin you enabled earlier in the session restores the previous request shape. If that prefix is still within its cache lifetime, the next request reads the older cache entry instead of rebuilding. ### @@ -106,7 +106,7 @@ Denying an entire tool -Adding a bare tool name like `Bash` or `WebFetch` as a [deny rule](</docs/en/permissions#manage-permissions>) removes that tool from Claude’s context entirely. Built-in tool definitions load into the system prompt layer, so adding or removing one of these rules mid-session invalidates the cache. The change takes effect on the next turn whether you add it through `/permissions` or by [editing a settings file directly](</docs/en/settings#when-edits-take-effect>). Only a bare tool name, or the equivalent `Bash(*)` form, has this effect. Scoped deny rules like `Bash(rm *)`, and all allow and ask rules, don’t change which tools Claude sees. Claude Code checks them when Claude attempts a call, leaving the prefix intact. +Adding a bare tool name like `Bash` or `WebFetch` as a [deny rule](</docs/en/permissions#manage-permissions>) removes that tool from Claude’s context entirely. Built-in tool definitions load into the system prompt layer, so adding or removing one of these rules mid-session invalidates the cache. The change takes effect on the next turn whether you add it through `/permissions` or by [editing a settings file directly](</docs/en/settings#when-edits-take-effect>). Only a deny rule that matches in the tool-name position has this effect: a bare tool name, the equivalent `Bash(*)` form, or a [tool-name glob](</docs/en/permissions#tool-name-wildcards>) like `"*"`. A glob that matches only MCP tools, such as `"mcp__*"`, removes those tools the same way but leaves the cache intact when the matched tools are deferred, the default, since deferred definitions were never in the cached prefix. Scoped deny rules like `Bash(rm *)`, and all allow and ask rules, don’t change which tools Claude sees. Claude Code checks them when Claude attempts a call, leaving the prefix intact. ### @@ -278,6 +278,7 @@ `DISABLE_PROMPT_CACHING_HAIKU`| Disable for Haiku only `DISABLE_PROMPT_CACHING_SONNET`| Disable for Sonnet only `DISABLE_PROMPT_CACHING_OPUS`| Disable for Opus only +`DISABLE_PROMPT_CACHING_FABLE`| Disable for Fable only To set caching policy across an organization, put any of these or the TTL variables in the `env` block of [managed settings](</docs/en/settings#settings-files>). For normal use, leave caching enabled.
modified Agent SDK reference - Python View current →
--- a/python.md +++ b/python.md @@ -921,7 +921,7 @@ `max_budget_usd`| `float | None`| `None`| Stop the query when the client-side cost estimate reaches this USD value. Compared against the same estimate as `total_cost_usd`; see [Track cost and usage](</docs/en/agent-sdk/cost-tracking>) for accuracy caveats `disallowed_tools`| `list[str]`| `[]`| Tools to deny. A bare name such as `"Bash"` removes the tool from Claude’s context. A scoped rule such as `"Bash(rm *)"` leaves the tool available and denies matching calls in every permission mode, including `bypassPermissions`. See [Permissions](</docs/en/agent-sdk/permissions#allow-and-deny-rules>) `enable_file_checkpointing`| `bool`| `False`| Enable file change tracking for rewinding. See [File checkpointing](</docs/en/agent-sdk/file-checkpointing>) -`model`| `str | None`| `None`| Claude model to use +`model`| `str | None`| `None`| Claude model alias or full model name. See [accepted values and provider-specific IDs](</docs/en/model-config#available-models>) `fallback_model`| `str | None`| `None`| Fallback model to use if the primary model fails `betas`| `list[SdkBeta]`| `[]`| Beta features to enable. See `SdkBeta` for available options `output_format`| `dict[str, Any] | None`| `None`| Output format for structured responses (e.g., `{"type": "json_schema", "schema": {...}}`). See [Structured outputs](</docs/en/agent-sdk/structured-outputs>) for details @@ -948,7 +948,7 @@ `skills`| `list[str] | Literal["all"] | None`| `None`| Skills available to the session. Pass `"all"` to enable every discovered skill, or a list of skill names. When set, the SDK adds the Skill tool to `allowed_tools` automatically. If you also pass `tools`, include `"Skill"` in that list. See [Skills](</docs/en/agent-sdk/skills>) `max_thinking_tokens`| `int | None`| `None`| _Deprecated_ \- Maximum tokens for thinking blocks. Use `thinking` instead `thinking`| `ThinkingConfig` ` | None`| `None`| Controls extended thinking behavior. Takes precedence over `max_thinking_tokens` -`effort`| `EffortLevel` ` | None`| `None`| Effort level for thinking depth +`effort`| `EffortLevel` ` | None`| `None`| Effort level for thinking depth. See [adjust the effort level](</docs/en/model-config#adjust-effort-level>) `session_store`| [`SessionStore`](</docs/en/agent-sdk/session-storage#the-sessionstore-interface>) ` | None`| `None`| Mirror session transcripts to an external backend so any host can resume them. See [Persist sessions to external storage](</docs/en/agent-sdk/session-storage>) `session_store_flush`| `Literal["batched", "eager"]`| `"batched"`| When to flush mirrored transcript entries to `session_store`. `"batched"` flushes once per turn or when the buffer fills; `"eager"` triggers a background flush after every frame. Ignored when `session_store` is `None` @@ -971,7 +971,7 @@ * `API_TIMEOUT_MS`: per-request timeout on the Anthropic client, in milliseconds. Default `600000`. Applies to the main loop and all subagents. * `CLAUDE_CODE_MAX_RETRIES`: maximum API retries. Default `10`. Each retry gets its own `API_TIMEOUT_MS` window, so worst-case wall time is roughly `API_TIMEOUT_MS × (CLAUDE_CODE_MAX_RETRIES + 1)` plus backoff. * `CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS`: stall watchdog for subagents launched with `run_in_background`. Default `600000`. Resets on each stream event; on stall it aborts the subagent, marks the task failed, and surfaces the error to the parent with any partial result. Does not apply to synchronous subagents. - * `CLAUDE_ENABLE_STREAM_WATCHDOG=1` with `CLAUDE_STREAM_IDLE_TIMEOUT_MS`: aborts the request when headers have arrived but the response body stops streaming. Off by default. `CLAUDE_STREAM_IDLE_TIMEOUT_MS` defaults to `300000` and is clamped to that minimum. The aborted request goes through the normal retry path. + * `CLAUDE_ENABLE_STREAM_WATCHDOG=1` with `CLAUDE_STREAM_IDLE_TIMEOUT_MS`: aborts the request when headers have arrived but the response body stops streaming. When `CLAUDE_ENABLE_STREAM_WATCHDOG` is unset, the default is server-controlled on the direct Anthropic API and off on other providers. `CLAUDE_STREAM_IDLE_TIMEOUT_MS` defaults to `300000` and is clamped to that minimum. The aborted request goes through the normal retry path. ### @@ -1027,7 +1027,7 @@ ---|---|--- `"user"`| Global user settings| `~/.claude/settings.json` `"project"`| Shared project settings (version controlled)| `.claude/settings.json` -`"local"`| Local project settings (gitignored)| `.claude/settings.local.json` +`"local"`| Local project settings (not version controlled)| `.claude/settings.local.json` #### @@ -1191,9 +1191,9 @@ PermissionMode = Literal[ "default", # Standard permission behavior "acceptEdits", # Auto-accept file edits - "plan", # Planning mode - read-only tools only + "plan", # Planning mode - explore without editing "dontAsk", # Deny anything not pre-approved instead of prompting - "bypassPermissions", # Bypass all permission checks (use with caution) + "bypassPermissions", # Bypass permission checks; explicit ask rules still prompt (use with caution) ] ### @@ -1208,7 +1208,7 @@ "low", # Minimal thinking, fastest responses "medium", # Moderate thinking "high", # Deep reasoning - "xhigh", # Extended reasoning (Opus 4.7 only; falls back to "high" on other models) + "xhigh", # Extended reasoning (Opus 4.8 and Opus 4.7; falls back to "high" on other models) "max", # Maximum effort ] @@ -1424,7 +1424,7 @@ Use with the `betas` field in `ClaudeAgentOptions` to enable beta features. -The `context-1m-2025-08-07` beta is retired as of April 30, 2026. Passing this header with Claude Sonnet 4.5 or Sonnet 4 has no effect, and requests that exceed the standard 200k-token context window return an error. To use a 1M-token context window, migrate to [Claude Sonnet 4.6, Claude Opus 4.6, or Claude Opus 4.7](<https://platform.claude.com/docs/en/about-claude/models/overview>), which include 1M context at standard pricing with no beta header required. +The `context-1m-2025-08-07` beta is retired as of April 30, 2026. Passing this header with Claude Sonnet 4.5 or Sonnet 4 has no effect, and requests that exceed the standard 200k-token context window return an error. To use a 1M-token context window, migrate to [Claude Sonnet 4.6, Claude Opus 4.6, Claude Opus 4.7, or Claude Opus 4.8](<https://platform.claude.com/docs/en/about-claude/models/overview>), which include 1M context at standard pricing with no beta header required. ### @@ -3640,7 +3640,7 @@ * **Implement allowlists** : Only permit specific commands to run unsandboxed * **Add approval workflows** : Require explicit authorization for privileged operations -Commands running with `dangerouslyDisableSandbox: True` have full system access. Ensure your `can_use_tool` handler validates these requests carefully.If `permission_mode` is set to `bypassPermissions` and `allow_unsandboxed_commands` is enabled, the model can autonomously execute commands outside the sandbox without any approval prompts. This combination effectively allows the model to escape sandbox isolation silently. +Commands running with `dangerouslyDisableSandbox: True` have full system access. Ensure your `can_use_tool` handler validates these requests carefully.If `permission_mode` is set to `bypassPermissions` and `allow_unsandboxed_commands` is enabled, the model can autonomously execute commands outside the sandbox without approval prompts (an explicit [`ask` rule](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) still forces one). This combination effectively allows the model to escape sandbox isolation silently. ##
modified Continue local sessions from any device with Remote Control View current →
--- a/remote-control.md +++ b/remote-control.md @@ -67,7 +67,7 @@ claude --remote-control "My Project" -This gives you a full interactive session in your terminal that you can also control from claude.ai or the Claude app. Unlike `claude remote-control` (server mode), you can type messages locally while the session is also available remotely. +This gives you a full interactive session in your terminal that you can also control from claude.ai or the Claude app. Unlike `claude remote-control` (server mode), you can type messages locally while the session is also available remotely.As of v2.1.162, a `Remote Control active` indicator stays in the footer below the input box while Remote Control is connected. The indicator text is a link to the session on claude.ai, so you can reopen it from the terminal at any time. Select the indicator with the down arrow key and press Enter to open a status panel with the session URL and a QR code. If you’re already in a Claude Code session and want to continue it remotely, use the `/remote-control` (or `/rc`) command: @@ -77,7 +77,7 @@ /remote-control My Project -This starts a Remote Control session that carries over your current conversation history and displays a session URL and QR code you can use to connect from another device. The `--verbose`, `--sandbox`, and `--no-sandbox` flags are not available with this command. +This starts a Remote Control session that carries over your current conversation history.As of v2.1.162, a `Remote Control active` indicator appears in the footer below the input box and stays visible while the connection is up. The indicator text is a link to the session on claude.ai. Select it with the down arrow key and press Enter, or run `/remote-control` again, to open a status panel with the session URL and a QR code you can use to connect from another device.The `--verbose`, `--sandbox`, and `--no-sandbox` flags are not available with this command. In the [Claude Code VS Code extension](</docs/en/vs-code>), type `/remote-control` or `/rc` in the prompt box, or open the command menu with `/` and select it. Requires Claude Code v2.1.79 or later. @@ -182,7 +182,7 @@ * **Local process must keep running** : Remote Control runs as a local process. If you close the terminal, quit VS Code, or otherwise stop the `claude` process, the session ends. * **Extended network outage** : if your machine is awake but unable to reach the network for more than roughly 10 minutes, the session times out and the process exits. Run `claude remote-control` again to start a new session. * **Ultraplan disconnects Remote Control** : starting an [ultraplan](</docs/en/ultraplan>) session disconnects any active Remote Control session because both features occupy the claude.ai/code interface and only one can be connected at a time. - * **Some commands are local-only** : commands that open an interactive picker in the terminal, such as `/mcp`, `/plugin`, or `/resume`, work only from the local CLI. Commands that produce text output, including `/compact`, `/clear`, `/context`, `/usage`, `/exit`, `/usage-credits`, `/recap`, and `/reload-plugins`, work from mobile and web. + * **Some commands are local-only** : commands that open an interactive picker in the terminal, such as `/plugin` or `/resume`, work only from the local CLI. Commands that produce text output, including `/compact`, `/clear`, `/context`, `/usage`, `/exit`, `/usage-credits`, `/recap`, and `/reload-plugins`, work from mobile and web. As of v2.1.166, `/mcp` also works from mobile and web: it returns a text summary of server status instead of opening the picker, and accepts the same `reconnect`, `enable`, and `disable` [subcommands](</docs/en/commands#all-commands>) as the local CLI, with one difference: from mobile and web, `/mcp reconnect` with no server name reconnects every server that has failed or needs authentication, while the local CLI requires a server name for `reconnect`. ##
modified Choose a sandbox environment View current →
--- a/sandbox-environments.md +++ b/sandbox-environments.md @@ -53,7 +53,7 @@ How isolation relates to permission modes -[Permission modes](</docs/en/permission-modes>) decide whether a tool call runs and whether you are prompted first. Isolation restricts what a command can access once it runs. The two work together: when a permission mode lets actions run without asking you, an isolation boundary limits what those actions can reach. `--dangerously-skip-permissions` removes per-action review entirely, so an isolation boundary is the only thing limiting what Claude can do. Always run it inside a container, a VM, or the sandbox runtime, so that file tools, MCP servers, and hooks are also inside the boundary. [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) replaces the prompt with a classifier that reviews actions and blocks ones that escalate beyond the request, target unrecognized infrastructure, or appear driven by hostile content Claude read. The classifier is a per-action control, not an isolation boundary, so an isolation boundary still adds defense in depth for unattended runs, and is not required the way it is for `--dangerously-skip-permissions`. The sandboxed Bash tool on its own constrains only Bash, so it is not sufficient for fully unattended runs in either mode. You can layer approaches: running the sandboxed Bash tool inside a container or VM gives you OS-level command restrictions on top of the outer environment boundary. For how the Bash sandbox itself interacts with permission rules and modes, see [How sandboxing relates to permissions and permission modes](</docs/en/sandboxing#how-sandboxing-relates-to-permissions-and-permission-modes>). +[Permission modes](</docs/en/permission-modes>) decide whether a tool call runs and whether you are prompted first. Isolation restricts what a command can access once it runs. The two work together: when a permission mode lets actions run without asking you, an isolation boundary limits what those actions can reach. `--dangerously-skip-permissions` removes per-action review other than explicit [ask rules](</docs/en/permissions#manage-permissions>), so an isolation boundary is the only thing limiting what Claude can do. Always run it inside a container, a VM, or the sandbox runtime, so that file tools, MCP servers, and hooks are also inside the boundary. [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) replaces the prompt with a classifier that reviews actions and blocks ones that escalate beyond the request, target unrecognized infrastructure, or appear driven by hostile content Claude read. The classifier is a per-action control, not an isolation boundary, so an isolation boundary still adds defense in depth for unattended runs, and is not required the way it is for `--dangerously-skip-permissions`. The sandboxed Bash tool on its own constrains only Bash, so it is not sufficient for fully unattended runs in either mode. You can layer approaches: running the sandboxed Bash tool inside a container or VM gives you OS-level command restrictions on top of the outer environment boundary. For how the Bash sandbox itself interacts with permission rules and modes, see [How sandboxing relates to permissions and permission modes](</docs/en/sandboxing#how-sandboxing-relates-to-permissions-and-permission-modes>). ##
modified Configure the sandboxed Bash tool View current →
--- a/sandboxing.md +++ b/sandboxing.md @@ -41,7 +41,7 @@ Run a Bash command -Ask Claude to run a command, such as a build or a test suite. By default, commands inside the sandbox can write only to the working directory. The first time a command needs a new network domain, Claude Code prompts for approval.Commands that cannot run sandboxed fall back to the regular permission flow. To widen or narrow these boundaries, see Configure sandboxing. +Ask Claude to run a command, such as a build or a test suite. By default, commands inside the sandbox can write only to the working directory and the session temp directory. The first time a command needs a new network domain, Claude Code prompts for approval.Commands that cannot run sandboxed fall back to the regular permission flow. To widen or narrow these boundaries, see Configure sandboxing. Selecting a mode in the panel writes to your project’s local settings at `.claude/settings.local.json`, which apply to the current project and are not checked into git. To enable the sandbox across all of your projects, set [`sandbox.enabled`](</docs/en/settings#sandbox-settings>) to `true` in your user settings at `~/.claude/settings.json`. To enforce sandboxing for every developer in an organization, use managed settings. @@ -102,9 +102,10 @@ * Explicit [deny rules](</docs/en/permissions>) are always respected * `rm` or `rmdir` commands that target `/`, your home directory, or other critical system paths still trigger a permission prompt - * [Ask rules](</docs/en/permissions>) apply to commands that fall back to the regular permission flow - -**Regular permissions mode** : All Bash commands go through the regular permission flow, even when sandboxed. This provides more control but requires more approvals. In both modes, the sandbox enforces the same filesystem and network restrictions. The difference is only in whether sandboxed commands are auto-approved or require explicit permission. Some commands cannot run inside the sandbox at all, such as tools that are incompatible with it or that need a host you have not allowed. Rather than failing the task or requiring you to turn sandboxing off, Claude Code includes an escape hatch: when a command fails because of sandbox restrictions, Claude analyzes the failure and may retry the command with the `dangerouslyDisableSandbox` parameter. The retried command runs outside the sandbox, so it goes through the regular permission flow and requires your approval. You can disable this escape hatch by setting `"allowUnsandboxedCommands": false` in your [sandbox settings](</docs/en/settings#sandbox-settings>). When disabled, which the `/sandbox` Overrides tab shows as **Strict sandbox mode** , the `dangerouslyDisableSandbox` parameter is completely ignored and all commands must run sandboxed or be explicitly listed in `excludedCommands`. + * Content-scoped [ask rules](</docs/en/permissions>) like `Bash(git push *)` still force a prompt even for sandboxed commands + * A bare `Bash` ask rule, or the equivalent `Bash(*)` form, is skipped for commands that run sandboxed; it still applies to commands that fall back to the regular permission flow + +**Regular permissions mode** : All Bash commands go through the regular permission flow, even when sandboxed. This provides more control but requires more approvals. In both modes, the sandbox enforces the same filesystem and network restrictions. The difference is only in whether sandboxed commands are auto-approved or require explicit permission. The session temp directory is writable inside the sandbox by default, alongside the working directory. Claude Code sets `$TMPDIR` to this directory for sandboxed commands, so tools that write temporary files work without extra configuration. Unsandboxed commands inherit your shell’s `$TMPDIR` unchanged, which means sandboxed and unsandboxed commands resolve `$TMPDIR` to different directories. To pass temporary files between the two, write them under the working directory instead. Some commands cannot run inside the sandbox at all, such as tools that are incompatible with it or that need a host you have not allowed. Rather than failing the task or requiring you to turn sandboxing off, Claude Code includes an escape hatch: when a command fails because of sandbox restrictions, Claude analyzes the failure and may retry the command with the `dangerouslyDisableSandbox` parameter. The retried command runs outside the sandbox, so it goes through the regular permission flow and requires your approval. You can disable this escape hatch by setting `"allowUnsandboxedCommands": false` in your [sandbox settings](</docs/en/settings#sandbox-settings>). When disabled, which the `/sandbox` Overrides tab shows as **Strict sandbox mode** , the `dangerouslyDisableSandbox` parameter is completely ignored and all commands must run sandboxed or be explicitly listed in `excludedCommands`. Auto-allow mode works independently of your permission mode setting. Even if you’re not in “accept edits” mode, sandboxed Bash commands will run automatically when auto-allow is enabled. This means Bash commands that modify files within the sandbox boundaries will execute without prompting, even when file edit tools would normally require approval. @@ -114,7 +115,7 @@ Configure sandboxing -Customize sandbox behavior through your `settings.json` file. See [Settings](</docs/en/settings#sandbox-settings>) for the complete configuration reference. By default, sandboxed commands can only write to the current working directory. If subprocess commands like `kubectl`, `terraform`, or `npm` need to write outside the project directory, use `sandbox.filesystem.allowWrite` to grant access to specific paths: +Customize sandbox behavior through your `settings.json` file. See [Settings](</docs/en/settings#sandbox-settings>) for the complete configuration reference. By default, sandboxed commands can write only to the current working directory and the session temp directory. If subprocess commands like `kubectl`, `terraform`, or `npm` need to write outside those directories, use `sandbox.filesystem.allowWrite` to grant access to specific paths: { "sandbox": { @@ -161,9 +162,9 @@ The sandboxed Bash tool restricts file system access to specific directories: - * **Default write behavior** : read and write access to the current working directory and its subdirectories + * **Default write behavior** : read and write access to the current working directory and its subdirectories, plus the session temp directory that `$TMPDIR` points to * **Default read behavior** : read access to the entire computer, except certain denied directories. Note that this default still allows reading credential files such as `~/.aws/credentials` and `~/.ssh/`. Add them to `denyRead` to block them. - * **Blocked access** : cannot modify files outside the current working directory without explicit permission, including shell configuration files such as `~/.bashrc` and system binaries in `/bin/` + * **Blocked access** : cannot modify files outside the current working directory and session temp directory without explicit permission, including shell configuration files such as `~/.bashrc` and system binaries in `/bin/` * **Git worktrees** : when the working directory is a [linked git worktree](</docs/en/worktrees>), the sandbox also allows writes to the main repository’s shared `.git` directory so commands such as `git commit` can update refs and the index. Writes to `hooks/` and `config` inside that directory remain denied. * **Configurable** : define custom allowed and denied paths through settings @@ -244,7 +245,7 @@ ---|---|--- `/sandbox`| What a Bash command can access once it runs| The sandbox boundary itself, in auto-allow mode [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)| Whether each tool call runs| A classifier that reviews actions -`--dangerously-skip-permissions`| Whether each tool call runs| Nothing. [Protected path](</docs/en/permission-modes#protected-paths>) checks are also skipped; only removing `/` or your home directory still prompts +`--dangerously-skip-permissions`| Whether each tool call runs| Nothing. [Protected path](</docs/en/permission-modes#protected-paths>) checks are also skipped; only explicit [ask rules](</docs/en/permissions#manage-permissions>) and removing `/` or your home directory still prompt The sandbox’s auto-allow mode is separate from [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>): auto-allow approves Bash commands because the sandbox boundary contains them, while auto mode uses a classifier to review actions. The two work independently and can be combined. To choose an isolation boundary for unattended runs, see [Sandbox environments](</docs/en/sandbox-environments#how-isolation-relates-to-permission-modes>).
modified Security View current →
--- a/security.md +++ b/security.md @@ -18,7 +18,7 @@ Permission-based architecture -Claude Code uses strict read-only permissions by default. When additional actions are needed (editing files, running tests, executing commands), Claude Code requests explicit permission. Users control whether to approve actions once or allow them automatically. We designed Claude Code to be transparent and secure. For example, we require approval for bash commands before executing them, giving you direct control. This approach enables users and organizations to configure permissions directly. For detailed permission configuration, see [Permissions](</docs/en/permissions>). +Claude Code uses strict read-only permissions by default. When additional actions are needed (editing files, running tests, executing commands), Claude Code requests explicit permission. Users control whether to approve actions once or allow them automatically. Claude Code requires approval before running Bash commands that can modify your system. A built-in set of read-only commands such as `ls`, `cat`, and `git status` runs without a prompt. This approach lets users and organizations configure permissions directly. For detailed permission configuration, see [Permissions](</docs/en/permissions>). ### @@ -58,7 +58,7 @@ * **Permission system** : Sensitive operations require explicit approval * **Context-aware analysis** : Detects potentially harmful instructions by analyzing the full request * **Input sanitization** : Prevents command injection by processing user inputs - * **Command blocklist** : Blocks risky commands that fetch arbitrary content from the web like `curl` and `wget` by default. When explicitly allowed, be aware of [permission pattern limitations](</docs/en/permissions#tool-specific-permission-rules>) + * **Network command approval** : Commands that fetch content from the web such as `curl` and `wget` are not auto-approved by default. They prompt like any other non-read-only Bash command, so you can still approve once or add an explicit allow rule like `Bash(curl *)`. To block them entirely, add them to [`permissions.deny`](</docs/en/permissions#tool-specific-permission-rules>) ### @@ -83,12 +83,12 @@ * **Network request approval** : Tools that make network requests require user approval by default * **Isolated context windows** : Web fetch uses a separate context window to avoid injecting potentially malicious prompts * **Trust verification** : First-time codebase runs and new MCP servers require trust verification - * Note: Trust verification is disabled when running non-interactively with the `-p` flag. The exception is [`--worktree`](</docs/en/worktrees>), which still requires that trust has been accepted for the directory + * Note: Trust verification is disabled when running non-interactively with the `-p` flag * Note: When you start Claude Code directly in your home directory, trust acceptance is held for the current session only and is not written to disk, so the prompt reappears on each launch. There is no setting to persist it. Start Claude Code from a project subdirectory instead, where trust acceptance is saved per directory * **Command injection detection** : Suspicious bash commands require manual approval even if previously allowlisted * **Fail-closed matching** : Unmatched commands default to requiring manual approval * **Natural language descriptions** : Complex bash commands include explanations for user understanding - * **Secure credential storage** : API keys and tokens are encrypted. See [Credential Management](</docs/en/authentication#credential-management>) + * **Secure credential storage** : API keys and tokens are stored in the macOS Keychain when available, and protected by file permissions on Windows and Linux. See [Credential Management](</docs/en/authentication#credential-management>) **Windows WebDAV security risk** : When running Claude Code on Windows, we recommend against enabling WebDAV or allowing Claude Code to access paths such as `\\*` that may contain WebDAV subdirectories. [WebDAV has been deprecated by Microsoft](<https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features#:~:text=The%20Webclient%20\(WebDAV\)%20service%20is%20deprecated>) due to security risks. Enabling WebDAV may allow Claude Code to trigger network requests to remote hosts, bypassing the permission system.
modified Configure server-managed settings View current →
--- a/server-managed-settings.md +++ b/server-managed-settings.md @@ -174,6 +174,20 @@ ​ +Invalid entries in delivered settings + +Delivered payloads parse tolerantly with the same rules as the other managed sources. When a payload contains an entry that fails schema validation, Claude Code strips that entry, surfaces a validation error, and applies every remaining valid setting. See [Invalid entries in managed settings](</docs/en/settings#invalid-entries-in-managed-settings>) for the field-level behavior, including how security-enforcement fields are handled. Requires Claude Code v2.1.169 or later. Server-managed delivery adds these behaviors: + + * The cache at `~/.claude/remote-settings.json` stores the salvaged payload with invalid entries removed. The raw invalid payload is never persisted. + * When no field in the payload can be salvaged, Claude Code keeps the last-accepted cached settings and records a fatal error. + * The security approval dialog evaluates the salvaged payload, so a stripped invalid entry is never presented for approval and never executes. + +To debug delivery issues, run `claude --debug-file <path>` and search the log for `Remote settings`. Validate a payload change with `claude doctor` on a test machine before rolling it out to the organization. + +### + +​ + Enforce fail-closed startup By default, if the remote settings fetch fails at startup, the CLI continues without managed settings. For environments where this brief unenforced window is unacceptable, set `forceRemoteSettingsRefresh: true` in your managed settings. When this setting is active, the CLI blocks at startup until remote settings are freshly fetched. If the fetch fails, the CLI exits rather than proceeding without the policy. This setting self-perpetuates: once delivered from the server, it is also cached locally so that subsequent startups enforce the same behavior even before the first successful fetch of a new session. To enable this, add the key to your managed settings configuration:
modified Persist sessions to external storage View current →
--- a/session-storage.md +++ b/session-storage.md @@ -86,6 +86,8 @@ console.log(message.result); } } + +The second query prints a summary of the files from the first query, which shows the agent resumed with full context from the store. ##
modified Manage sessions View current →
--- a/sessions.md +++ b/sessions.md @@ -30,7 +30,7 @@ Where the session picker looks -Sessions are stored per project directory. By default the session picker shows interactive sessions from the current worktree, plus sessions started elsewhere that added the current directory with `/add-dir`. Use `Ctrl+W` to widen to all worktrees of the repository or `Ctrl+A` to widen to every project on this machine. Selecting a session from another worktree of the same repository resumes it in place. Selecting a session from an unrelated project copies a `cd` and resume command to your clipboard instead. Resuming by name resolves across the current repository and its worktrees. Both forms look for an exact match and resume it directly even if it lives in a different worktree: +Sessions are stored per project directory. By default the session picker shows interactive sessions from the current worktree, plus sessions started elsewhere that added the current directory with `/add-dir`. From v2.1.169, moving a session with [`/cd`](</docs/en/commands>) relocates it to the new directory’s project storage, so it appears in that directory’s picker afterward. Use `Ctrl+W` to widen to all worktrees of the repository or `Ctrl+A` to widen to every project on this machine. Selecting a session from another worktree of the same repository resumes it in place. Selecting a session from an unrelated project copies a `cd` and resume command to your clipboard instead. Resuming by name resolves across the current repository and its worktrees. Both forms look for an exact match and resume it directly even if it lives in a different worktree: Command| Exact match| Ambiguous name ---|---|---
modified Claude Code settings View current →
Show diff (165 lines)
--- a/settings.md +++ b/settings.md @@ -19,7 +19,7 @@ **Managed**| Server-managed settings, plist / registry, or system-level `managed-settings.json`| All users on the machine| Yes (deployed by IT) **User**| `~/.claude/` directory| You, across all projects| No **Project**| `.claude/` in repository| All collaborators on this repository| Yes (committed to git) -**Local**| `.claude/settings.local.json`| You, in this repository only| No (gitignored) +**Local**| `.claude/settings.local.json`| You, in this repository only| No (gitignored when Claude Code creates it) ### @@ -98,7 +98,7 @@ * **User settings** are defined in `~/.claude/settings.json` and apply to all projects. * **Project settings** are saved in your project directory: * `.claude/settings.json` for settings that are checked into source control and shared with your team - * `.claude/settings.local.json` for settings that are not checked in, useful for personal preferences and experimentation. Claude Code will configure git to ignore `.claude/settings.local.json` when it is created. + * `.claude/settings.local.json` for settings that are not checked in, useful for personal preferences and experimentation. When Claude Code creates `.claude/settings.local.json`, it configures git to ignore the file. If you create the file yourself, add it to your gitignore manually. * **Managed settings** : For organizations that need centralized control, Claude Code supports multiple delivery mechanisms for managed settings. All use the same JSON format and cannot be overridden by user or project settings: * **Server-managed settings** : delivered from Anthropic’s servers via the Claude.ai admin console. See [server-managed settings](</docs/en/server-managed-settings>). * **MDM/OS-level policies** : delivered through native device management on macOS and Windows: @@ -166,12 +166,36 @@ ​ +Invalid entries in managed settings + +Managed settings parse tolerantly. When a managed configuration contains an entry that fails schema validation, Claude Code strips that entry, records a warning, and enforces every remaining valid policy. A single typo cannot disable the rest of your organization’s policy. This behavior is consistent across all three delivery mechanisms: [server-managed settings](</docs/en/server-managed-settings>), plist and registry policies deployed through MDM, and `managed-settings.json` files. Requires Claude Code v2.1.169 or later. Security-enforcement fields are handled per field instead of being stripped wholesale when they are present but invalid: + +Field| Behavior when present but invalid +---|--- +`allowedMcpServers`| Enforced as an empty allowlist, so no MCP servers are admitted until the value is fixed. An individual invalid entry is stripped and the valid subset is enforced. +`allowManagedMcpServersOnly`| Treated as `true`. +`forceLoginOrgUUID`| No organization is permitted to log in until the value is fixed. +`deniedMcpServers`| An individual invalid entry is stripped and the valid subset is enforced. A wholly invalid value is dropped with a warning, since denying every server would block servers the policy never named. + +`requiredMinimumVersion` and `requiredMaximumVersion` fail open by design: an invalid value is stripped rather than enforced, so a bad policy push cannot prevent Claude Code from starting. Validation errors surface in three places: + + * Interactive sessions show a dialog at startup listing the invalid entries. + * Headless runs with `-p` print a summary to stderr. + * [`claude doctor`](</docs/en/debug-your-config>) lists each invalid entry with its source and field. + +Validate policy changes by running `claude doctor` on a test machine before deploying them fleet-wide. This tolerance applies only to managed settings. User, project, and local settings files remain strict: a file that fails validation is rejected as a whole and reported. + +### + +​ + Available settings `settings.json` supports a number of options: Key| Description| Example ---|---|--- +`advisorModel`| Model for the server-side [advisor tool](</docs/en/advisor>). Accepts a model alias such as `"opus"`, `"sonnet"`, or `"fable"` (v2.1.170+), or a full model ID. Written automatically when you run `/advisor`. Unset to disable the advisor. Requires Claude Code v2.1.98 or later| `"opus"` `agent`| Run the main thread as a named subagent, and set the default agent for sessions dispatched from `claude agents`. Applies that subagent’s system prompt, tool restrictions, and model. See [Invoke subagents explicitly](</docs/en/sub-agents#invoke-subagents-explicitly>)| `"code-reviewer"` `allowAllClaudeAiMcps`| (Managed settings only) Load claude.ai connectors alongside a deployed `managed-mcp.json`, which otherwise takes exclusive control and suppresses them. See [Managed MCP configuration](</docs/en/managed-mcp>)| `true` `allowedChannelPlugins`| (Managed settings only) Allowlist of channel plugins that may push messages. Replaces the default Anthropic allowlist when set. Undefined = fall back to the default, empty array = block all channel plugins. Requires `channelsEnabled: true`. See [Restrict which channel plugins can run](</docs/en/channels#restrict-which-channel-plugins-can-run>)| `[{ "marketplace": "claude-plugins-official", "plugin": "telegram" }]` @@ -180,7 +204,7 @@ `allowManagedHooksOnly`| (Managed settings only) Only managed hooks, SDK hooks, and hooks from plugins force-enabled in managed settings `enabledPlugins` are loaded. User, project, and all other plugin hooks are blocked. See Hook configuration| `true` `allowManagedMcpServersOnly`| (Managed settings only) Only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. Users can still add MCP servers, but only the admin-defined allowlist applies. See [Managed MCP configuration](</docs/en/managed-mcp>)| `true` `allowManagedPermissionRulesOnly`| (Managed settings only) Prevent user and project settings from defining `allow`, `ask`, or `deny` permission rules. Only rules in managed settings apply. See [Managed-only settings](</docs/en/permissions#managed-only-settings>)| `true` -`alwaysThinkingEnabled`| Enable [extended thinking](</docs/en/model-config#extended-thinking>) by default for all sessions. Typically configured via the `/config` command rather than editing directly. To force thinking off regardless of this setting, set [`CLAUDE_CODE_DISABLE_THINKING`](</docs/en/env-vars>) in `env`| `true` +`alwaysThinkingEnabled`| Enable [extended thinking](</docs/en/model-config#extended-thinking>) by default for all sessions. Typically configured via the `/config` command rather than editing directly. To force thinking off regardless of this setting, set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>) in `env`, which disables thinking on the Anthropic API except on Fable 5, which cannot have thinking turned off. On [third-party providers](</docs/en/third-party-integrations>) this omits the `thinking` parameter instead, and adaptive-reasoning models may still think| `true` `apiKeyHelper`| Custom script, to be executed in `/bin/sh`, to generate an auth value. This value will be sent as `X-Api-Key` and `Authorization: Bearer` headers for model requests. Set the refresh interval with [`CLAUDE_CODE_API_KEY_HELPER_TTL_MS`](</docs/en/env-vars>)| `/bin/generate_temp_api_key.sh` `attribution`| Customize attribution for git commits and pull requests. See Attribution settings| `{"commit": "🤖 Generated with Claude Code", "pr": ""}` `autoMemoryDirectory`| Custom directory for [auto memory](</docs/en/memory#storage-location>) storage. Accepts an absolute path or a `~/`-prefixed path. From project or local settings, this is honored only after you accept the workspace trust dialog, since a cloned repository can supply this file| `"~/my-memory-dir"` @@ -203,6 +227,7 @@ `disableAgentView`| Set to `true` to turn off [background agents and agent view](</docs/en/agent-view>): `claude agents`, `--bg`, `/background`, and the on-demand supervisor. Typically set in [managed settings](</docs/en/permissions#managed-settings>). Equivalent to setting `CLAUDE_CODE_DISABLE_AGENT_VIEW` to `1`| `true` `disableAllHooks`| Disable all [hooks](</docs/en/hooks>) and any custom [status line](</docs/en/statusline>)| `true` `disableAutoMode`| Set to `"disable"` to prevent [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) from being activated. Removes `auto` from the `Shift+Tab` cycle and rejects `--permission-mode auto` at startup. Most useful in [managed settings](</docs/en/permissions#managed-settings>) where users cannot override it| `"disable"` +`disableBundledSkills`| Set to `true` to disable the [skills](</docs/en/skills>) and workflows that ship with Claude Code: bundled skills and workflows are removed entirely, while built-in slash commands like `/init` stay typable but are hidden from the model. Skills from plugins, `.claude/skills/`, and `.claude/commands/` are unaffected. Equivalent to setting `CLAUDE_CODE_DISABLE_BUNDLED_SKILLS` to `1`| `true` `disableDeepLinkRegistration`| Set to `"disable"` to prevent Claude Code from registering the `claude-cli://` protocol handler with the operating system on startup. [Deep links](</docs/en/deep-links>) let external tools open a Claude Code session with a pre-filled prompt. Useful in environments where protocol handler registration is restricted or managed separately| `"disable"` `disabledMcpjsonServers`| List of specific MCP servers from `.mcp.json` files to reject| `["filesystem"]` `disableRemoteControl`| Disable [Remote Control](</docs/en/remote-control>): blocks `claude remote-control`, the `--remote-control` flag, auto-start, and the in-session toggle. Typically placed in [managed settings](</docs/en/permissions#managed-settings>) for per-device MDM enforcement, but works from any scope. Requires Claude Code v2.1.128 or later| `true` @@ -213,6 +238,7 @@ `enableAllProjectMcpServers`| Automatically approve all MCP servers defined in project `.mcp.json` files| `true` `enabledMcpjsonServers`| List of specific MCP servers from `.mcp.json` files to approve| `["memory", "github"]` `env`| Environment variables applied to every session and to subprocesses Claude Code spawns from it. As of v2.1.143, `NO_COLOR` and `FORCE_COLOR` set here are passed to subprocesses but do not change Claude Code’s own interface colors. Set those in your shell before launching `claude` to change interface colors| `{"FOO": "bar"}` +`fallbackModel`| Fallback model(s) to try in order when the primary model is overloaded or unavailable. Claude Code switches to the next available model in the chain for the rest of the turn and shows a notice. `"default"` expands to the default model. Chains are capped at three models; extra entries are ignored. Unlike most array settings, this key does not merge across settings files: the highest-precedence file that defines it supplies the entire chain. The [`--fallback-model`](</docs/en/cli-reference#cli-flags>) flag overrides this for one session. See [Fallback model chains](</docs/en/model-config#fallback-model-chains>)| `["claude-sonnet-4-6", "claude-haiku-4-5"]` `fastModePerSessionOptIn`| When `true`, fast mode does not persist across sessions. Each session starts with fast mode off, requiring users to enable it with `/fast`. The user’s fast mode preference is still saved. See [Require per-session opt-in](</docs/en/fast-mode#require-per-session-opt-in>)| `true` `feedbackSurveyRate`| Probability (0–1) that the [session quality survey](</docs/en/data-usage#session-quality-surveys>) appears when eligible. Set to `0` to suppress entirely, or set [`CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY`](</docs/en/env-vars>) in `env`. Useful when using Bedrock, Vertex, or Foundry where the default sample rate does not apply| `0.05` `fileSuggestion`| Configure a custom script for `@` file autocomplete. See File suggestion settings| `{"type": "command", "command": "~/.claude/file-suggestion.sh"}` @@ -234,7 +260,7 @@ `parentSettingsBehavior`| (Managed settings only) Controls whether managed settings supplied programmatically by an embedding host process, such as the Agent SDK or an IDE extension, apply when an admin-deployed managed tier is also present. `"first-wins"`: the parent-supplied settings are dropped and only the admin tier applies. `"merge"`: the parent-supplied settings apply under the admin tier, filtered so they can tighten policy but not loosen it. Has no effect when no admin tier is deployed. Default: `"first-wins"`. Requires Claude Code v2.1.133 or later| `"merge"` `permissions`| See table below for structure of permissions.| `plansDirectory`| Customize where plan files are stored. Path is relative to project root. Default: `~/.claude/plans`| `"./plans"` -`pluginSuggestionMarketplaces`| (Managed settings only) Marketplace names whose plugins can appear as contextual install suggestions, in addition to the official marketplace. Suggestions come from each plugin’s `relevance` declaration in its marketplace entry. A name only takes effect when the marketplace is registered on the machine and its registered source is also declared in managed settings, either as the `extraKnownMarketplaces` entry for that name or as an entry of `strictKnownMarketplaces`. A marketplace registered from a different source under an allowlisted name is ignored.| `["acme-corp-plugins"]` +`pluginSuggestionMarketplaces`| (Managed settings only) Marketplace names whose plugins can appear as contextual install suggestions. No marketplace-declared suggestions surface without this allowlist; the built-in first-party frontend-design tip is unaffected. Suggestions come from each plugin’s `relevance` declaration in its marketplace entry. A name only takes effect when the marketplace is registered on the machine and its registered source is also declared in managed settings, either as the `extraKnownMarketplaces` entry for that name or as an entry of `strictKnownMarketplaces`. A marketplace registered from a different source under an allowlisted name is ignored. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source.| `["acme-corp-plugins"]` `pluginTrustMessage`| (Managed settings only) Custom message appended to the plugin trust warning shown before installation. Use this to add organization-specific context, for example to confirm that plugins from your internal marketplace are vetted.| `"All plugins from our marketplace are approved by IT"` `policyHelper`| Admin-deployed executable that computes managed settings dynamically at startup. Only honored from MDM or a system `managed-settings.json` file. See Compute managed settings with a policy helper. Requires Claude Code v2.1.136 or later| `{"path": "/usr/local/bin/claude-policy"}` `preferredNotifChannel`| Method for task-complete and permission-prompt notifications: `"auto"`, `"terminal_bell"`, `"iterm2"`, `"iterm2_with_bell"`, `"kitty"`, `"ghostty"`, or `"notifications_disabled"`. Default: `"auto"`, which sends a desktop notification in iTerm2, Ghostty, and Kitty and does nothing in other terminals. Set `"terminal_bell"` to ring the bell character in any terminal. Appears in `/config` as **Notifications**. See [Get a terminal bell or notification](</docs/en/terminal-config#get-a-terminal-bell-or-notification>)| `"terminal_bell"` @@ -257,7 +283,7 @@ `strictKnownMarketplaces`| (Managed settings only) Allowlist of plugin marketplace sources. Undefined = no restrictions, empty array = lockdown. Enforced on marketplace add and on plugin install, update, refresh, and auto-update, so a marketplace added before the policy was set cannot be used to fetch plugins. See [Managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>)| `[{ "source": "github", "repo": "acme-corp/plugins" }]` `strictPluginOnlyCustomization`| (Managed settings only) Block skills, agents, hooks, and MCP servers from user and project sources, so they can only come from plugins or managed settings. `true` locks all four surfaces; an array locks only the named ones. See `strictPluginOnlyCustomization`| `["skills", "hooks"]` `syntaxHighlightingDisabled`| Disable syntax highlighting in diffs, code blocks, and file previews| `true` -`teammateMode`| How [agent team](</docs/en/agent-teams>) teammates display: `auto` (picks split panes in tmux or iTerm2, in-process otherwise), `in-process`, or `tmux`. `--teammate-mode` overrides this for one session. See [choose a display mode](</docs/en/agent-teams#choose-a-display-mode>)| `"in-process"` +`teammateMode`| How [agent team](</docs/en/agent-teams>) teammates display: `auto` (split panes when running inside tmux or iTerm2, in-process otherwise), `in-process`, or `tmux` (split panes using tmux or iTerm2, detected from your terminal). `--teammate-mode` overrides this for one session. See [choose a display mode](</docs/en/agent-teams#choose-a-display-mode>)| `"in-process"` `terminalProgressBarEnabled`| Show the terminal progress bar in supported terminals: ConEmu, Ghostty 1.2.0+, and iTerm2 3.6.6+. Default: `true`. Appears in `/config` as **Terminal progress bar**| `false` `tui`| Terminal UI renderer. Use `"fullscreen"` for the flicker-free [alt-screen renderer](</docs/en/fullscreen>) with virtualized scrollback. Use `"default"` for the classic main-screen renderer. Set via `/tui`. You can also set the [`CLAUDE_CODE_NO_FLICKER`](</docs/en/env-vars>) environment variable. Background sessions opened from [agent view](</docs/en/agent-view>) always use the fullscreen renderer regardless of this setting| `"fullscreen"` `ultracode`| Turn on [ultracode](</docs/en/workflows#let-claude-decide-with-ultracode>) for the session. Session-only and not read from `settings.json`. Set through `/effort ultracode`, `--settings`, or an Agent SDK control request| `true` @@ -310,9 +336,9 @@ Keys| Description| Example ---|---|--- -`allow`| Array of permission rules to allow tool use. See Permission rule syntax below for pattern matching details| `[ "Bash(git diff *)" ]` +`allow`| Array of permission rules to allow tool use. Tool-name globs are supported only in the tool position after a literal `mcp__<server>__` prefix, such as `mcp__github__get_*`; the server segment must be glob-free. See Permission rule syntax below for pattern matching details| `[ "Bash(git diff *)" ]` `ask`| Array of permission rules to ask for confirmation upon tool use. See Permission rule syntax below| `[ "Bash(git push *)" ]` -`deny`| Array of permission rules to deny tool use. Use this to exclude sensitive files from Claude Code access. See Permission rule syntax and [Bash permission limitations](</docs/en/permissions#tool-specific-permission-rules>)| `[ "WebFetch", "Bash(curl *)", "Read(./.env)", "Read(./secrets/**)" ]` +`deny`| Array of permission rules to deny tool use. Use this to exclude sensitive files from Claude Code access. Tool names accept glob patterns: `"*"` denies every tool and `"mcp__*"` denies all MCP tools. See Permission rule syntax and [Bash permission limitations](</docs/en/permissions#tool-specific-permission-rules>)| `[ "WebFetch", "Bash(curl *)", "Read(./.env)", "Read(./secrets/**)" ]` `additionalDirectories`| Additional [working directories](</docs/en/permissions#working-directories>) for file access. Most `.claude/` configuration is [not discovered](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) from these directories| `[ "../docs/" ]` `defaultMode`| Default [permission mode](</docs/en/permission-modes>) when opening Claude Code. Valid values: `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, `bypassPermissions`. As of Claude Code v2.1.142, `auto` is ignored when set in project or local settings (`.claude/settings.json`, `.claude/settings.local.json`) so a repository cannot grant itself auto mode. Set it in `~/.claude/settings.json` instead. The `--permission-mode` CLI flag overrides this setting for a single session| `"acceptEdits"` `disableBypassPermissionsMode`| Set to `"disable"` to prevent `bypassPermissions` mode from being activated. This disables the `--dangerously-skip-permissions` command-line flag. Typically placed in [managed settings](</docs/en/permissions#managed-settings>) to enforce organizational policy, but works from any scope| `"disable"` @@ -324,7 +350,7 @@ Permission rule syntax -Permission rules follow the format `Tool` or `Tool(specifier)`. Rules are evaluated in order: deny rules first, then ask, then allow. The first matching rule wins. Quick examples: +Permission rules follow the format `Tool` or `Tool(specifier)`. Rules are evaluated in order: deny rules first, then ask, then allow. The first match determines the outcome regardless of rule specificity. See the [permission rule evaluation order](</docs/en/permissions#manage-permissions>) for details. Quick examples: Rule| Effect ---|--- @@ -474,6 +500,7 @@ #!/bin/bash query=$(cat | jq -r '.query') + # Replace your-repo-file-index with your own file search command your-repo-file-index --query "$query" | head -20 ### @@ -550,7 +577,7 @@ This hierarchy ensures that organizational policies are always enforced while still allowing teams and individuals to customize their experience. The same precedence applies whether you run Claude Code from the CLI, the [VS Code extension](</docs/en/vs-code>), or a [JetBrains IDE](</docs/en/jetbrains>). For example, if your user settings set `permissions.defaultMode` to `acceptEdits` and a project’s shared settings set it to `default`, the project value applies. The example below covers how array-valued settings such as permission rules combine instead. -**Array settings merge across scopes.** When the same array-valued setting (such as `sandbox.filesystem.allowWrite` or `permissions.allow`) appears in multiple scopes, the arrays are **concatenated and deduplicated** , not replaced. This means lower-priority scopes can add entries without overriding those set by higher-priority scopes, and vice versa. For example, if managed settings set `allowWrite` to `["/opt/company-tools"]` and a user adds `["~/.kube"]`, both paths are included in the final configuration. +**Array settings merge across scopes.** When the same array-valued setting (such as `sandbox.filesystem.allowWrite` or `permissions.allow`) appears in multiple scopes, the arrays are **concatenated and deduplicated** , not replaced. This means lower-priority scopes can add entries without overriding those set by higher-priority scopes, and vice versa. For example, if managed settings set `allowWrite` to `["/opt/company-tools"]` and a user adds `["~/.kube"]`, both paths are included in the final configuration. The one exception is `fallbackModel`, an ordered chain where position carries meaning: the highest-precedence file that defines it supplies the entire value. ### @@ -558,7 +585,7 @@ Verify active settings -Run `/status` inside Claude Code to see which settings sources are active. The Status tab includes a `Setting sources` line that lists each layer Claude Code loaded for the current session, such as `User settings` or `Project local settings`. When [managed settings](</docs/en/admin-setup#decide-how-settings-reach-devices>) are in effect, the entry shows the delivery channel in parentheses, for example `Enterprise managed settings (remote)`, `(plist)`, `(HKLM)`, `(HKCU)`, or `(file)`. A layer appears in the list only when that source is loaded with at least one key, so an empty list means no settings sources were found. The `Setting sources` line confirms which sources are being read. It does not show which layer supplied each individual key. The Config tab in the same dialog is an editor for a fixed set of toggles such as theme and verbose output, not a view of your `settings.json` contents. If a settings file contains errors, such as invalid JSON or a value that fails validation, `/status` reports the issue so you can fix it. +Run `/status` inside Claude Code to see which settings sources are active. The Status tab includes a `Setting sources` line that lists each layer Claude Code loaded for the current session, such as `User settings` or `Project local settings`. When [managed settings](</docs/en/admin-setup#decide-how-settings-reach-devices>) are in effect, the entry shows the delivery channel in parentheses, for example `Enterprise managed settings (remote)`, `(plist)`, `(HKLM)`, `(HKCU)`, or `(file)`. A layer appears in the list only when that source is loaded with at least one key, so an empty list means no settings sources were found. The `Setting sources` line confirms which sources are being read. It does not show which layer supplied each individual key. The Config tab in the same dialog is an editor for a fixed set of toggles such as theme and verbose output, not a view of your `settings.json` contents. If a settings file contains errors, such as invalid JSON or a value that fails validation, Claude Code shows a setup issues notice at startup and `/status` lists the affected files. Run `/doctor` to see the details for each error. ### @@ -571,7 +598,7 @@ * **Skills** : Custom prompts that can be invoked with `/skill-name` or loaded by Claude automatically * **MCP servers** : Extend Claude Code with additional tools and integrations * **Precedence** : Higher-level configurations (Managed) override lower-level ones (User/Project) - * **Inheritance** : Settings merge across scopes; scalar values from higher-priority scopes override, and arrays concatenate + * **Inheritance** : Settings merge across scopes; scalar values from higher-priority scopes override, and arrays concatenate (`fallbackModel` is the exception: the highest-precedence scope supplies the whole chain) ### @@ -658,7 +685,7 @@ * **User settings** (`~/.claude/settings.json`): Personal plugin preferences * **Project settings** (`.claude/settings.json`): Project-specific plugins shared with team - * **Local settings** (`.claude/settings.local.json`): Per-machine overrides (not committed) + * **Local settings** (`.claude/settings.local.json`): Per-machine overrides, gitignored when Claude Code creates it * **Managed settings** (`managed-settings.json`): Organization-wide policy overrides that block installation at all scopes and hide the plugin from the marketplace Project settings take precedence over user settings, so setting a plugin to `false` in `~/.claude/settings.json` does not disable a plugin that the project’s `.claude/settings.json` enables. To opt out of a project-enabled plugin on your machine, set it to `false` in `.claude/settings.local.json` instead.Plugins force-enabled by managed settings cannot be disabled this way, since managed settings override local settings.
modified Advanced setup View current →
--- a/setup.md +++ b/setup.md @@ -282,7 +282,7 @@ Install with Linux package managers -Claude Code publishes signed apt, dnf, and apk repositories. Replace `stable` with `latest` for the rolling channel. Package manager installations do not auto-update through Claude Code; updates arrive through your normal system upgrade workflow. All repositories are signed with the Claude Code release signing key. Before trusting the key, verify it as described in each tab. +Claude Code publishes signed apt, dnf, and apk repositories. Each repository offers two channels: `stable` serves a version that is typically about one week old, skipping releases with major regressions, and `latest` serves every release as soon as it ships. The commands below configure the `stable` channel, which fits most users; each tab also shows the `latest` repository URL. Package manager installations do not auto-update through Claude Code; updates arrive through your normal system upgrade workflow. All repositories are signed with the Claude Code release signing key. Before trusting the key, verify it as described in each tab. * apt @@ -290,7 +290,7 @@ * apk -For Debian and Ubuntu. To use the rolling channel, change both `stable` occurrences in the `deb` line: the URL path and the suite name. +For Debian and Ubuntu. The following commands configure the `stable` channel: sudo install -d -m 0755 /etc/apt/keyrings sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc \ @@ -300,9 +300,14 @@ sudo apt update sudo apt install claude-code +To use the `latest` channel instead, both the URL path and the suite name change. Use this `deb` line: + + echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/latest latest main" \ + | sudo tee /etc/apt/sources.list.d/claude-code.list + Verify the GPG key fingerprint before trusting it: `gpg --show-keys /etc/apt/keyrings/claude-code.asc` should report `31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE`.To upgrade later, run `sudo apt update && sudo apt upgrade claude-code`. -For Fedora and RHEL: +For Fedora and RHEL. The following commands configure the `stable` channel: sudo tee /etc/yum.repos.d/claude-code.repo <<'EOF' [claude-code] @@ -314,15 +319,24 @@ EOF sudo dnf install claude-code +To use the `latest` channel instead, set `baseurl` to the `latest` repository: + + baseurl=https://downloads.claude.ai/claude-code/rpm/latest + dnf downloads the key on first install and prompts you to confirm the fingerprint. Verify it matches `31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE` before accepting.To upgrade later, run `sudo dnf upgrade claude-code`. -For Alpine Linux: +For Alpine Linux. The following commands configure the `stable` channel: wget -O /etc/apk/keys/claude-code.rsa.pub \ https://downloads.claude.ai/keys/claude-code.rsa.pub echo "https://downloads.claude.ai/claude-code/apk/stable" >> /etc/apk/repositories apk add claude-code +To switch to the `latest` channel, remove the `stable` repository line and add the `latest` repository: + + sed -i '\|downloads.claude.ai/claude-code/apk/stable|d' /etc/apk/repositories + echo "https://downloads.claude.ai/claude-code/apk/latest" >> /etc/apk/repositories + Verify the downloaded key with `sha256sum /etc/apk/keys/claude-code.rsa.pub`, which should report `395759c1f7449ef4cdef305a42e820f3c766d6090d142634ebdb049f113168b6`.To upgrade later, run `apk update && apk upgrade claude-code`. ###
modified Extend Claude with skills View current →
--- a/skills.md +++ b/skills.md @@ -10,7 +10,7 @@ Bundled skills -Claude Code includes a set of bundled skills that are available in every session, including `/code-review`, `/batch`, `/debug`, `/loop`, and `/claude-api`. Unlike most built-in commands, which execute fixed logic directly, bundled skills are prompt-based: they give Claude detailed instructions and let it orchestrate the work using its tools. You invoke them the same way as any other skill, by typing `/` followed by the skill name. Bundled skills are listed alongside built-in commands in the [commands reference](</docs/en/commands>), marked **Skill** in the Purpose column. +Claude Code includes a set of bundled skills that are available in every session unless disabled with the [`disableBundledSkills`](</docs/en/settings#available-settings>) setting, including `/code-review`, `/batch`, `/debug`, `/loop`, and `/claude-api`. Unlike most built-in commands, which execute fixed logic directly, bundled skills are prompt-based: they give Claude detailed instructions and let it orchestrate the work using its tools. You invoke them the same way as any other skill, by typing `/` followed by the skill name. Bundled skills are listed alongside built-in commands in the [commands reference](</docs/en/commands>), marked **Skill** in the Purpose column. ### @@ -258,7 +258,7 @@ `${CLAUDE_EFFORT}`| The current effort level: `low`, `medium`, `high`, `xhigh`, or `max`. Ultracode is not a distinct level and reports as `xhigh`. Use this to adapt skill instructions to the active effort setting. `${CLAUDE_SKILL_DIR}`| The directory containing the skill’s `SKILL.md` file. For plugin skills, this is the skill’s subdirectory within the plugin, not the plugin root. Use this in bash injection commands to reference scripts or files bundled with the skill, regardless of the current working directory. -Indexed arguments use shell-style quoting, so wrap multi-word values in quotes to pass them as a single argument. For example, `/my-skill "hello world" second` makes `$0` expand to `hello world` and `$1` to `second`. The `$ARGUMENTS` placeholder always expands to the full argument string as typed. To include a literal `$` before a digit, `ARGUMENTS`, or a declared argument name, such as `$1.00` in prose, escape it with a backslash: `\$1.00`. A backslash before any other `$` is left unchanged. Only a single backslash directly before the token escapes it; a doubled backslash such as `\\$1` keeps both backslashes and substitutes as before. **Example using substitutions:** +Indexed arguments use shell-style quoting, so wrap multi-word values in quotes to pass them as a single argument. For example, `/my-skill "hello world" second` makes `$0` expand to `hello world` and `$1` to `second`. The `$ARGUMENTS` placeholder always expands to the full argument string as typed. To include a literal `$` before a digit, `ARGUMENTS`, or a declared argument name, such as `$1.00` in prose, escape it with a backslash: `\$1.00`. A backslash before any other `$` is left unchanged. Only a single backslash directly before the token escapes it. A doubled backslash such as `\\$1` leaves both backslashes in place, and `$1` still expands to the argument value. **Example using substitutions:** --- name: session-logger
modified Streaming Input View current →
--- a/streaming-vs-single-mode.md +++ b/streaming-vs-single-mode.md @@ -115,6 +115,8 @@ } } +In the TypeScript SDK, if your message generator throws, for example when a file it reads is missing, the stream ends with an error that reads `Claude Code process aborted by user` instead of the original error, so check the code inside your generator first when you see that message. The error may also be preceded by a long minified line of bundled SDK source, so read to the end of the output for the error text.In the Python SDK, a generator exception is logged at debug level and the session stalls without raising, so if a streaming session hangs with no output, enable debug logging and check your generator. + ## ​ @@ -147,6 +149,8 @@ * Dynamic message queueing * Real-time interruption * Natural multi-turn conversations + +If a query ends with an error result, such as `error_max_turns`, a single message `query()` call raises an error that includes the failure text after yielding the final result message, so wrap the loop in a try block if your code needs to continue. See [Handle the result](</docs/en/agent-sdk/agent-loop#handle-the-result>) for the result subtypes. ###
modified Create custom subagents View current →
--- a/sub-agents.md +++ b/sub-agents.md @@ -66,7 +66,7 @@ statusline-setup| Sonnet| When you run `/statusline` to configure your status line claude-code-guide| Haiku| When you ask questions about Claude Code features -Beyond these built-in subagents, you can create your own with custom prompts, tool restrictions, permission modes, hooks, and skills. The following sections show how to get started and customize subagents. +Built-in subagents are always registered in interactive sessions. To block a specific built-in type, add it to `permissions.deny` as shown in Disable specific subagents. To prevent Claude from delegating to any subagent, deny the `Agent` tool itself with [`permissions.deny`](</docs/en/permissions#tool-specific-permission-rules>). In [non-interactive mode](</docs/en/headless>) and the [Agent SDK](</docs/en/agent-sdk/overview>), set [`CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS=1`](</docs/en/env-vars>) to remove all built-in types and supply only your own. Beyond these built-in subagents, you can create your own with custom prompts, tool restrictions, permission modes, hooks, and skills. The following sections show how to get started and customize subagents. ## @@ -252,7 +252,7 @@ `description`| Yes| When Claude should delegate to this subagent `tools`| No| Tools the subagent can use. Inherits all tools if omitted. To preload Skills into context, use the `skills` field rather than listing `Skill` here `disallowedTools`| No| Tools to deny, removed from inherited or specified list -`model`| No| Model to use: `sonnet`, `opus`, `haiku`, a full model ID (for example, `claude-opus-4-8`), or `inherit`. Defaults to `inherit` +`model`| No| Model to use: `sonnet`, `opus`, `haiku`, `fable`, a full model ID (for example, `claude-opus-4-8`), or `inherit`. Defaults to `inherit` `permissionMode`| No| Permission mode: `default`, `acceptEdits`, `auto`, `dontAsk`, `bypassPermissions`, or `plan`. Ignored for plugin subagents `maxTurns`| No| Maximum number of agentic turns before the subagent stops `skills`| No| [Skills](</docs/en/skills>) to preload into the subagent’s context at startup. The full skill content is injected, not just the description. Subagents can still invoke unlisted project, user, and plugin skills through the Skill tool @@ -273,7 +273,7 @@ The `model` field controls which [AI model](</docs/en/model-config>) the subagent uses: - * **Model alias** : Use one of the available aliases: `sonnet`, `opus`, or `haiku` + * **Model alias** : Use one of the available aliases: `sonnet`, `opus`, `haiku`, or `fable` * **Full model ID** : Use a full model ID such as `claude-opus-4-8` or `claude-sonnet-4-6`. Accepts the same values as the `--model` flag * **inherit** : Use the same model as the main conversation * **Omitted** : If not specified, defaults to `inherit` (uses the same model as the main conversation) @@ -405,7 +405,7 @@ `bypassPermissions`| Skip permission prompts `plan`| Plan mode (read-only exploration) -Use `bypassPermissions` with caution. It skips all permission prompts, allowing the subagent to execute operations without approval, including writes to `.git`, `.config/git`, `.claude`, `.vscode`, `.idea`, `.husky`, `.cargo`, `.devcontainer`, `.yarn`, and `.mvn`. Root and home directory removals such as `rm -rf /` still prompt as a circuit breaker. See [permission modes](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) for details. +Use `bypassPermissions` with caution. It skips permission prompts, allowing the subagent to execute operations without approval, including writes to `.git`, `.config/git`, `.claude`, `.vscode`, `.idea`, `.husky`, `.cargo`, `.devcontainer`, `.yarn`, and `.mvn`. Explicit [`ask` rules](</docs/en/permissions#manage-permissions>) and root and home directory removals such as `rm -rf /` still prompt. See [permission modes](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) for details. If the parent uses `bypassPermissions` or `acceptEdits`, this takes precedence and cannot be overridden. If the parent uses [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), the subagent inherits auto mode and any `permissionMode` in its frontmatter is ignored: the classifier evaluates the subagent’s tool calls with the same block and allow rules as the parent session. @@ -784,7 +784,7 @@ Resume subagents -Each subagent invocation creates a new instance with fresh context. To continue an existing subagent’s work instead of starting over, ask Claude to resume it. Resumed subagents retain their full conversation history, including all previous tool calls, results, and reasoning. The subagent picks up exactly where it stopped rather than starting fresh. When a subagent completes, Claude receives its agent ID. Claude uses the `SendMessage` tool with the agent’s ID as the `to` field to resume it. The `SendMessage` tool is only available when [agent teams](</docs/en/agent-teams>) are enabled via `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`. To resume a subagent, ask Claude to continue the previous work: +Each subagent invocation creates a new instance with fresh context. To continue an existing subagent’s work instead of starting over, ask Claude to resume it. Resumed subagents retain their full conversation history, including all previous tool calls, results, and reasoning. The subagent picks up exactly where it stopped rather than starting fresh. When a subagent completes, Claude receives its agent ID. The built-in Explore and Plan agents are one-shot and return no agent ID, so they can’t be resumed; use `general-purpose` or a custom subagent when you need to continue the work. Claude uses the `SendMessage` tool with the agent’s ID as the `to` field to resume it. The `SendMessage` tool is only available when [agent teams](</docs/en/agent-teams>) are enabled via `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`. To resume a subagent, ask Claude to continue the previous work: Use the code-reviewer subagent to review the authentication module [Agent completes] @@ -823,9 +823,9 @@ Fork the current conversation -Forked subagents require Claude Code v2.1.117 or later. From v2.1.161 the `/fork` command is enabled by default; on earlier versions it requires setting the [`CLAUDE_CODE_FORK_SUBAGENT`](</docs/en/env-vars>) environment variable to `1`. Making forks the model’s _default_ spawn behavior is experimental and may change in future releases; it may also be enabled by default in interactive sessions as part of a staged rollout. Set the same variable to `1` to enable it explicitly, or to `0` to disable it, overriding the rollout. The variable is honored in interactive mode and via the SDK or `claude -p`. - -A fork is a subagent that inherits the entire conversation so far instead of starting fresh. This drops the input isolation that subagents otherwise provide: a fork sees the same system prompt, tools, model, and message history as the main session, so you can hand it a side task without re-explaining the situation. The fork’s own tool calls still stay out of your conversation and only its final result comes back, so your main context window stays clean. Use a fork when a named subagent would need too much background to be useful, or when you want to try several approaches in parallel from the same starting point. Enabling fork mode changes Claude Code in two ways: +Forked subagents require Claude Code v2.1.117 or later. From v2.1.161 the `/fork` command is enabled by default; on earlier versions it requires setting the [`CLAUDE_CODE_FORK_SUBAGENT`](</docs/en/env-vars>) environment variable to `1`. Making forks the model’s _default_ spawn behavior is experimental and may change in future releases. This default may also be enabled in interactive sessions as part of a staged rollout. + +A fork is a subagent that inherits the entire conversation so far instead of starting fresh. This drops the input isolation that subagents otherwise provide: a fork sees the same system prompt, tools, model, and message history as the main session, so you can hand it a side task without re-explaining the situation. The fork’s own tool calls still stay out of your conversation and only its final result comes back, so your main context window stays clean. Use a fork when a named subagent would need too much background to be useful, or when you want to try several approaches in parallel from the same starting point. To control fork mode regardless of the staged rollout, set [`CLAUDE_CODE_FORK_SUBAGENT`](</docs/en/env-vars>) to `1` to enable it explicitly or to `0` to disable it. The variable is honored in interactive mode and via the SDK or `claude -p`. Enabling fork mode changes Claude Code in two ways: * Claude spawns a fork whenever it would otherwise use the general-purpose subagent. Named subagents such as Explore still spawn as before. * Every subagent spawn runs in the background, whether it is a fork or a named subagent. Set `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` to `1` to keep spawns synchronous.
modified Subagents in the SDK View current →
--- a/subagents.md +++ b/subagents.md @@ -130,11 +130,11 @@ `prompt`| `string`| Yes| The agent’s system prompt defining its role and behavior `tools`| `string[]`| No| Array of allowed tool names. If omitted, inherits all tools `disallowedTools`| `string[]`| No| Array of tool names to remove from the agent’s tool set -`model`| `string`| No| Model override for this agent. Accepts an alias such as `'sonnet'`, `'opus'`, `'haiku'`, `'inherit'`, or a full model ID. Defaults to main model if omitted +`model`| `string`| No| Model override for this agent. Accepts an alias such as `'fable'`, `'opus'`, `'sonnet'`, `'haiku'`, `'inherit'`, or a full model ID. Defaults to main model if omitted `skills`| `string[]`| No| List of skill names to preload into the agent’s context at startup. Unlisted skills remain invocable through the Skill tool `memory`| `'user' | 'project' | 'local'`| No| Memory source for this agent `mcpServers`| `(string | object)[]`| No| MCP servers available to this agent, by name or inline config -`initialPrompt`| `string`| No| Auto-submitted as the first user turn when this agent runs as the main thread agent +`initialPrompt`| `string`| No| Auto-submitted as the first user turn when this agent runs as the main thread agent. Ignored when the agent is invoked as a subagent `maxTurns`| `number`| No| Maximum number of agentic turns before the agent stops `background`| `boolean`| No| Run this agent as a non-blocking background task when invoked `effort`| `'low' | 'medium' | 'high' | 'xhigh' | 'max' | number`| No| Reasoning effort level for this agent @@ -299,7 +299,7 @@ Resuming subagents -Subagents can be resumed to continue where they left off. Resumed subagents retain their full conversation history, including all previous tool calls, results, and reasoning. The subagent picks up exactly where it stopped rather than starting fresh. When a subagent completes, the Agent tool result includes a text block containing `agentId: <id>`. The built-in [`Explore` and `Plan` agents](</docs/en/sub-agents#built-in-subagents>) are one-shot and omit this trailer, so use a custom agent or `general-purpose` when you need to resume. To resume a subagent programmatically: +Subagents can be resumed to continue where they left off. Resumed subagents retain their full conversation history, including all previous tool calls, results, and reasoning. The subagent picks up exactly where it stopped rather than starting fresh. When a subagent completes, the Agent tool result includes a text block containing `agentId: <id>`. The built-in [`Explore` and `Plan` agents](</docs/en/sub-agents#built-in-subagents>) are one-shot and do not return an `agentId`, so use a custom agent or `general-purpose` when you need to resume. To resume a subagent programmatically: 1. **Capture the session ID** : Extract `session_id` from messages during the first query 2. **Extract the agent ID** : Parse `agentId` from the Agent tool result text
modified Enterprise deployment overview View current →
--- a/third-party-integrations.md +++ b/third-party-integrations.md @@ -168,7 +168,7 @@ Pin model versions for cloud providers -If you deploy through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin specific model versions using `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. Without pinning, model aliases resolve to Claude Code’s built-in default for that provider, which can lag the newest release and may not yet be enabled in your account. Pinning lets you control when your users move to a new model. See [Model configuration](</docs/en/model-config#pin-models-for-third-party-deployments>) for what each provider does when the default is unavailable. +If you deploy through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin specific model versions using `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. Without pinning, model aliases resolve to Claude Code’s built-in default for that provider, which can lag the newest release and may not yet be enabled in your account. Pinning lets you control when your users move to a new model. See [Model configuration](</docs/en/model-config#pin-models-for-third-party-deployments>) for what each provider does when the default is unavailable. ###
modified Scale to many tools with tool search View current →
--- a/tool-search.md +++ b/tool-search.md @@ -13,7 +13,7 @@ When tool search is active, tool definitions are withheld from the context window. The agent receives a summary of available tools and searches for relevant ones when the task requires a capability not already loaded. The 3-5 most relevant tools are loaded into context, where they stay available for subsequent turns. If the conversation is long enough that the SDK compacts earlier messages to free space, previously discovered tools may be removed, and the agent searches again as needed. Tool search adds one extra round-trip the first time Claude discovers a tool (the search step), but for large tool sets this is offset by smaller context on every turn. With fewer than ~10 tools, loading everything upfront is typically faster. For details on the underlying API mechanism, see [Tool search in the API](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool>). -Tool search requires Claude Sonnet 4 or later, or Claude Opus 4 or later. Haiku models do not support tool search. +Tool search is supported on every Claude model except Haiku. ## @@ -80,7 +80,7 @@ * **Maximum tools:** 10,000 tools in your catalog * **Search results:** Returns 3-5 most relevant tools per search - * **Model support:** Claude Sonnet 4 and later, Claude Opus 4 and later (no Haiku) + * **Model support:** every Claude model except Haiku ##
modified Tools reference View current →
--- a/tools-reference.md +++ b/tools-reference.md @@ -314,6 +314,8 @@ Claude gives a conversational summary. For exact MCP tool names, run `/mcp`. +The [advisor tool](</docs/en/advisor>) is a [server tool](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool>) that the API runs, rather than a tool that Claude Code implements. It has no name you can reference in permission rules or hook matchers. + ## ​
modified Troubleshoot installation and login View current →
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -142,6 +142,8 @@ ls -la ~/.local/bin/claude +If either `ls` command prints `No such file or directory`, that’s not an error. It means nothing is installed at that location, so move on to the next check. + ls -la ~/.claude/local/ npm -g ls @anthropic-ai/claude-code 2>/dev/null @@ -449,7 +451,7 @@ } } -If your Git is installed somewhere else, find the path by running `where.exe git` in PowerShell and use the `bin\bash.exe` path from that directory. +If your Git is installed somewhere else, find the path by running `where.exe git` in PowerShell and use the `bin\bash.exe` path from that directory. **If the path is correct and the file exists** but Claude Code still reports it as not found, endpoint security software such as AppLocker, Group Policy software restriction policies, or EDR agents may be interfering. On versions before v2.1.116, Claude Code spawned a child process (`cmd.exe`) to verify the path, which these policies can block — a common signal is that `cmd.exe /c dir "C:\Program Files\Git\bin\bash.exe"` works when you run it directly in PowerShell but fails silently when launched by `claude.exe`. Claude Code v2.1.116 and later check the filesystem directly, so update first. If the error persists on a current version, ask your IT team to allowlist `claude.exe` and the processes it spawns, including `cmd.exe` and `bash.exe`, in your endpoint protection policy. ###
modified Troubleshooting View current →
--- a/troubleshooting.md +++ b/troubleshooting.md @@ -32,6 +32,7 @@ 1. Use `/compact` regularly to reduce context size 2. Close and restart Claude Code between major tasks 3. Consider adding large build directories to your `.gitignore` file + 4. Restart with [`claude --safe-mode`](</docs/en/cli-reference#cli-flags>) to check whether a plugin, MCP server, or hook is the source. It disables all customizations for the session; if usage drops, see [Debug your configuration](</docs/en/debug-your-config#test-against-a-clean-configuration>) to find which one If memory usage stays high after these steps, run `/heapdump` to write a JavaScript heap snapshot and a memory breakdown to `~/Desktop`. On Linux without a Desktop folder, the files are written to your home directory. The breakdown shows resident set size, JS heap, array buffers, and unaccounted native memory, which helps identify whether the growth is in JavaScript objects or in native code. To inspect retainers, open the `.heapsnapshot` file in Chrome DevTools under Memory → Load. Attach both files when reporting a memory issue on [GitHub](<https://github.com/anthropics/claude-code/issues>).
modified Agent SDK reference - TypeScript View current →
Show diff (129 lines)
--- a/typescript.md +++ b/typescript.md @@ -497,7 +497,7 @@ `debug`| `boolean`| `false`| Enable debug mode for the Claude Code process `debugFile`| `string`| `undefined`| Write debug logs to a specific file path. Implicitly enables debug mode `disallowedTools`| `string[]`| `[]`| Tools to deny. A bare name such as `"Bash"` removes the tool from Claude’s context. A scoped rule such as `"Bash(rm *)"` leaves the tool available and denies matching calls in every permission mode, including `bypassPermissions`. See [Permissions](</docs/en/agent-sdk/permissions#allow-and-deny-rules>) -`effort`| `'low' | 'medium' | 'high' | 'xhigh' | 'max'`| `'high'`| Controls how much effort Claude puts into its response. Works with adaptive thinking to guide thinking depth +`effort`| `'low' | 'medium' | 'high' | 'xhigh' | 'max'`| Model default| Controls how much effort Claude puts into its response. Works with adaptive thinking to guide thinking depth. See [adjust the effort level](</docs/en/model-config#adjust-effort-level>) `enableFileCheckpointing`| `boolean`| `false`| Enable file change tracking for rewinding. See [File checkpointing](</docs/en/agent-sdk/file-checkpointing>) `env`| `Record<string, string | undefined>`| `process.env`| Environment variables. When set, this replaces the subprocess environment instead of merging with `process.env`, so pass `{ ...process.env, YOUR_VAR: 'value' }` to keep inherited variables like `PATH`. See Handle slow or stalled API responses for an example of this pattern, and [Environment variables](</docs/en/env-vars>) for variables the underlying CLI reads. Set `CLAUDE_AGENT_SDK_CLIENT_APP` to identify your app in the User-Agent header `executable`| `'bun' | 'deno' | 'node'`| Auto-detected| JavaScript runtime to use @@ -515,7 +515,7 @@ `maxThinkingTokens`| `number`| `undefined`| _Deprecated:_ Use `thinking` instead. Maximum tokens for thinking process `maxTurns`| `number`| `undefined`| Maximum agentic turns (tool-use round trips) `mcpServers`| `Record<string, [`McpServerConfig`](#mcpserverconfig)>`| `{}`| MCP server configurations -`model`| `string`| Default from CLI| Claude model to use +`model`| `string`| Default from CLI| Claude model alias or full model name. See [accepted values and provider-specific IDs](</docs/en/model-config#available-models>) `onElicitation`| `(request: ElicitationRequest, options: { signal: AbortSignal }) => Promise<ElicitationResult>`| `undefined`| Callback for handling MCP elicitation requests. Called when an MCP server requests user input and no hook handles it first. When not provided, unhandled elicitation requests are declined automatically `outputFormat`| `{ type: 'json_schema', schema: JSONSchema }`| `undefined`| Define output format for agent results. See [Structured outputs](</docs/en/agent-sdk/structured-outputs>) for details `outputStyle`| `string`| `undefined`| Not an `Options` field. Set `outputStyle` in the inline [`settings`](</docs/en/settings>) object or a settings file instead. See [Activate an output style](</docs/en/agent-sdk/modifying-system-prompts#activate-an-output-style>) @@ -569,7 +569,7 @@ * `API_TIMEOUT_MS`: per-request timeout on the Anthropic client, in milliseconds. Default `600000`. Applies to the main loop and all subagents. * `CLAUDE_CODE_MAX_RETRIES`: maximum API retries. Default `10`. Each retry gets its own `API_TIMEOUT_MS` window, so worst-case wall time is roughly `API_TIMEOUT_MS × (CLAUDE_CODE_MAX_RETRIES + 1)` plus backoff. * `CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS`: stall watchdog for subagents launched with `run_in_background`. Default `600000`. Resets on each stream event; on stall it aborts the subagent, marks the task failed, and surfaces the error to the parent with any partial result. Does not apply to synchronous subagents. - * `CLAUDE_ENABLE_STREAM_WATCHDOG=1` with `CLAUDE_STREAM_IDLE_TIMEOUT_MS`: aborts the request when headers have arrived but the response body stops streaming. Off by default. `CLAUDE_STREAM_IDLE_TIMEOUT_MS` defaults to `300000` and is clamped to that minimum. The aborted request goes through the normal retry path. + * `CLAUDE_ENABLE_STREAM_WATCHDOG=1` with `CLAUDE_STREAM_IDLE_TIMEOUT_MS`: aborts the request when headers have arrived but the response body stops streaming. When `CLAUDE_ENABLE_STREAM_WATCHDOG` is unset, the default is server-controlled on the direct Anthropic API and off on other providers. `CLAUDE_STREAM_IDLE_TIMEOUT_MS` defaults to `300000` and is clamped to that minimum. The aborted request goes through the normal retry path. ### @@ -730,7 +730,7 @@ `tools`| No| Array of allowed tool names. If omitted, inherits all tools from parent. To preload Skills into the agent’s context, use the `skills` field rather than listing `'Skill'` here `disallowedTools`| No| Array of tool names to explicitly disallow for this agent `prompt`| Yes| The agent’s system prompt -`model`| No| Model override for this agent. Accepts an alias such as `'sonnet'`, `'opus'`, `'haiku'`, `'inherit'`, or a full model ID. If omitted or `'inherit'`, uses the main model +`model`| No| Model override for this agent. Accepts an alias such as `'fable'`, `'opus'`, `'sonnet'`, `'haiku'`, `'inherit'`, or a full model ID. If omitted or `'inherit'`, uses the main model `mcpServers`| No| MCP server specifications for this agent `skills`| No| Array of skill names to preload into the agent context `initialPrompt`| No| Auto-submitted as the first user turn when this agent runs as the main thread agent @@ -767,7 +767,7 @@ ---|---|--- `'user'`| Global user settings| `~/.claude/settings.json` `'project'`| Shared project settings (version controlled)| `.claude/settings.json` -`'local'`| Local project settings (gitignored)| `.claude/settings.local.json` +`'local'`| Local project settings (not version controlled)| `.claude/settings.local.json` #### @@ -877,8 +877,8 @@ type PermissionMode = | "default" // Standard permission behavior | "acceptEdits" // Auto-accept file edits - | "bypassPermissions" // Bypass all permission checks - | "plan" // Planning mode - read-only tools only + | "bypassPermissions" // Bypass permission checks; explicit ask rules still prompt + | "plan" // Planning mode - explore without editing | "dontAsk" // Don't prompt for permissions, deny if not pre-approved | "auto"; // Use a model classifier to approve or deny each tool call @@ -1184,6 +1184,7 @@ result: string; stop_reason: string | null; ttft_ms?: number; + ttft_stream_ms?: number; total_cost_usd: number; usage: NonNullableUsage; modelUsage: { [modelName: string]: ModelUsage }; @@ -1221,7 +1222,8 @@ Several fields on the result carry diagnostic detail beyond `subtype`: * `api_error_status`: the HTTP status code of the API error that terminated the conversation. Absent or `null` when the turn ended without an API error. - * `ttft_ms`: time to first token in milliseconds. Present on the success arm only. + * `ttft_ms`: time to first token in milliseconds, measured when the first complete assistant message arrives. Present on the success arm only. + * `ttft_stream_ms`: time in milliseconds until the first `message_start` stream event, when the response stream opens. Lower than `ttft_ms`; the gap between the two is time spent streaming the first message. Present on the success arm only. * `terminal_reason`: why the loop ended. One of `"completed"`, `"max_turns"`, `"tool_deferred"`, `"aborted_streaming"`, `"aborted_tools"`, `"hook_stopped"`, `"stop_hook_prevented"`, `"blocking_limit"`, `"rapid_refill_breaker"`, `"prompt_too_long"`, `"image_error"`, or `"model_error"`. * `fast_mode_state`: one of `"on"`, `"off"`, or `"cooldown"`. @@ -1272,6 +1274,7 @@ parent_tool_use_id: string | null; uuid: UUID; session_id: string; + ttft_ms?: number; // Time to first token in ms, present only on message_start events }; ### @@ -1935,7 +1938,7 @@ description: string; prompt: string; subagent_type: string; - model?: "sonnet" | "opus" | "haiku"; + model?: "sonnet" | "opus" | "haiku" | "fable"; resume?: string; run_in_background?: boolean; max_turns?: number; @@ -3011,7 +3014,7 @@ type PermissionUpdateDestination = | "userSettings" // Global user settings | "projectSettings" // Per-directory project settings - | "localSettings" // Gitignored local settings + | "localSettings" // Local project settings | "session" // Current session only | "cliArg"; // CLI argument @@ -3050,7 +3053,7 @@ type SdkBeta = "context-1m-2025-08-07"; -The `context-1m-2025-08-07` beta is retired as of April 30, 2026. Passing this value with Claude Sonnet 4.5 or Sonnet 4 has no effect, and requests that exceed the standard 200k-token context window return an error. To use a 1M-token context window, migrate to [Claude Sonnet 4.6, Claude Opus 4.6, or Claude Opus 4.7](<https://platform.claude.com/docs/en/about-claude/models/overview>), which include 1M context at standard pricing with no beta header required. +The `context-1m-2025-08-07` beta is retired as of April 30, 2026. Passing this value with Claude Sonnet 4.5 or Sonnet 4 has no effect, and requests that exceed the standard 200k-token context window return an error. To use a 1M-token context window, migrate to [Claude Sonnet 4.6, Claude Opus 4.6, Claude Opus 4.7, or Claude Opus 4.8](<https://platform.claude.com/docs/en/about-claude/models/overview>), which include 1M context at standard pricing with no beta header required. ### @@ -3242,7 +3245,7 @@ type CallToolResult = { content: Array<{ - type: "text" | "image" | "resource"; + type: "text" | "image" | "audio" | "resource" | "resource_link"; // Additional fields vary by type }>; structuredContent?: Record<string, unknown>; @@ -3833,7 +3836,7 @@ * **Implement allowlists:** Only permit specific commands to run unsandboxed * **Add approval workflows:** Require explicit authorization for privileged operations -Commands running with `dangerouslyDisableSandbox: true` have full system access. Ensure your `canUseTool` handler validates these requests carefully.If `permissionMode` is set to `bypassPermissions` and `allowUnsandboxedCommands` is enabled, the model can autonomously execute commands outside the sandbox without any approval prompts. This combination effectively allows the model to escape sandbox isolation silently. +Commands running with `dangerouslyDisableSandbox: true` have full system access. Ensure your `canUseTool` handler validates these requests carefully.If `permissionMode` is set to `bypassPermissions` and `allowUnsandboxedCommands` is enabled, the model can autonomously execute commands outside the sandbox without approval prompts (an explicit [`ask` rule](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) still forces one). This combination effectively allows the model to escape sandbox isolation silently. ##
modified Plan in the cloud with ultraplan View current →
--- a/ultraplan.md +++ b/ultraplan.md @@ -24,7 +24,7 @@ /ultraplan migrate the auth service from sessions to JWTs -The command and keyword paths open a confirmation dialog before launching. The local plan path skips this dialog because that selection already serves as confirmation. If [Remote Control](</docs/en/remote-control>) is active, it disconnects when ultraplan starts because both features occupy the claude.ai/code interface and only one can be connected at a time. After the cloud session launches, your CLI’s prompt input shows a status indicator while the remote session works: +The command and keyword paths open a confirmation dialog before launching. The local plan path skips this dialog because that selection already serves as confirmation. If [Remote Control](</docs/en/remote-control>) is active, it disconnects when ultraplan starts because both features occupy the claude.ai/code interface and only one can be connected at a time. After the cloud session launches, your CLI’s prompt input shows a status indicator while the cloud session works: Status| Meaning ---|---
modified Find bugs with ultrareview View current →
--- a/ultrareview.md +++ b/ultrareview.md @@ -42,7 +42,7 @@ Max| 3 free runs| billed as [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) Team and Enterprise| none| billed as [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) -Pro and Max subscribers receive three free ultrareview runs to try the feature. These three runs are a one-time allotment per account and do not refresh. After you use all three, or after the free run period ends, each review is billed to usage credits and typically costs $5 to $20 depending on the size of the change. A run counts once the remote session starts, so a review that you stop early or that fails to complete still uses a free run. For a paid review, usage credits are billed only for the portion that ran. Because ultrareview always bills as usage credits outside the free runs, your account or organization must have usage credits turned on before you can launch a paid review. If usage credits are not turned on, Claude Code blocks the launch and links you to the billing settings where you can turn them on. You can also run `/usage-credits` to check or change your current setting. +Pro and Max subscribers receive three free ultrareview runs to try the feature. These three runs are a one-time allotment per account and do not refresh. After you use all three, or after the free run period ends, each review is billed to usage credits and typically costs $5 to $20 depending on the size of the change. A run counts once the cloud session starts, so a review that you stop early or that fails to complete still uses a free run. For a paid review, usage credits are billed only for the portion that ran. Because ultrareview always bills as usage credits outside the free runs, your account or organization must have usage credits turned on before you can launch a paid review. If usage credits are not turned on, Claude Code blocks the launch and links you to the billing settings where you can turn them on. You can also run `/usage-credits` to check or change your current setting. ## @@ -71,7 +71,7 @@ `--json`| Print the raw `bugs.json` payload instead of the formatted findings `--timeout <minutes>`| Maximum minutes to wait for the review to finish. Defaults to 30 -Running `claude ultrareview` requires the same authentication and usage credit configuration as `/code-review ultra`. The subcommand exits with code 0 when the review completes with or without findings, code 1 when the review fails to launch, the remote session errors, or the timeout elapses, and code 130 when interrupted with Ctrl-C. The remote review keeps running if you interrupt the subcommand; follow the session URL printed to stderr to watch it in the browser. For automatic reviews on GitHub pull requests, [Code Review](</docs/en/code-review>) integrates with your repository directly and posts findings as inline PR comments without a CLI step. +Running `claude ultrareview` requires the same authentication and usage credit configuration as `/code-review ultra`. The subcommand exits with code 0 when the review completes with or without findings, code 1 when the review fails to launch, the cloud session errors, or the timeout elapses, and code 130 when interrupted with Ctrl-C. The remote review keeps running if you interrupt the subcommand; follow the session URL printed to stderr to watch it in the browser. For automatic reviews on GitHub pull requests, [Code Review](</docs/en/code-review>) integrates with your repository directly and posts findings as inline PR comments without a CLI step. ## @@ -97,6 +97,6 @@ Related resources - * [Claude Code on the web](</docs/en/claude-code-on-the-web>): learn how remote sessions and cloud sandboxes work + * [Claude Code on the web](</docs/en/claude-code-on-the-web>): learn how cloud sessions and cloud sandboxes work * [Plan complex changes with ultraplan](</docs/en/ultraplan>): the planning counterpart to ultrareview for upfront design work * [Manage costs effectively](</docs/en/costs>): track usage and set spending limits
modified Use Claude Code in VS Code View current →
--- a/vs-code.md +++ b/vs-code.md @@ -113,9 +113,9 @@ ​ -Resume remote sessions from Claude.ai - -If you use [Claude Code on the web](</docs/en/claude-code-on-the-web>), you can resume those remote sessions directly in VS Code. This requires signing in with **Claude.ai Subscription** , not Anthropic Console. +Resume cloud sessions from Claude.ai + +If you use [Claude Code on the web](</docs/en/claude-code-on-the-web>), you can resume those cloud sessions directly in VS Code. This requires signing in with **Claude.ai Subscription** , not Anthropic Console. 1 @@ -133,7 +133,7 @@ Select a session to resume -Browse or search your remote sessions. Click any session to download it and continue the conversation locally. +Browse or search your cloud sessions. Click any session to download it and continue the conversation locally. Only web sessions started with a GitHub repository appear in the Remote tab. Resuming loads the conversation history locally; changes are not synced back to claude.ai.
modified Get started with Claude Code on the web View current →
--- a/web-quickstart.md +++ b/web-quickstart.md @@ -39,7 +39,7 @@ **Uses your local config**| No, repo only| Yes| Yes| Yes for local, no for cloud **Requires GitHub**| Yes, or [bundle a local repo](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) via `--remote`| No| No| Only for cloud sessions **Keeps running if you disconnect**| Yes| While terminal stays open| No| Depends on session type -**[Permission modes](</docs/en/permission-modes>)**| Auto accept edits, Plan| Ask, Auto accept edits, Plan| All modes| Depends on session type +**[Permission modes](</docs/en/permission-modes>)**| Accept edits, Plan, Auto| Ask, Auto accept edits, Plan| All modes| Depends on session type **Network access**| Configurable per environment| Your machine’s network| Your machine’s network| Depends on session type See the [terminal quickstart](</docs/en/quickstart>), [Desktop app](</docs/en/desktop>), or [Remote Control](</docs/en/remote-control>) docs to set those up. @@ -129,7 +129,7 @@ Choose a permission mode -The mode dropdown next to the input defaults to **Auto accept edits** , where Claude makes changes and pushes a branch without stopping for approval. Switch to **Plan mode** if you want Claude to propose an approach and wait for your go-ahead before editing files. Cloud sessions don’t offer Ask permissions, Auto mode, or Bypass permissions. See [Permission modes](</docs/en/permission-modes>) for the full list. +The mode dropdown next to the input defaults to **Accept edits** , where Claude makes changes and pushes a branch without stopping for approval. Switch to **Plan mode** if you want Claude to propose an approach and wait for your go-ahead before editing files. Cloud sessions don’t offer Ask permissions or Bypass permissions. See [Permission modes](</docs/en/permission-modes>) for the full list. 3
modified Run parallel sessions with worktrees View current →
--- a/worktrees.md +++ b/worktrees.md @@ -18,7 +18,7 @@ claude --worktree -You can also ask Claude to “work in a worktree” during a session, and it will create one with the [`EnterWorktree`](</docs/en/tools-reference>) tool. Once in a worktree, Claude can switch directly to another one under `.claude/worktrees/` by calling `EnterWorktree` with the target path. The previous worktree stays on disk untouched. Before using `--worktree` in a directory for the first time, accept the workspace trust dialog by running `claude` once in that directory. If trust has not yet been accepted, `--worktree` exits with an error and prompts you to run `claude` in the directory first, including when combined with `-p`. +You can also ask Claude to “work in a worktree” during a session, and it will create one with the [`EnterWorktree`](</docs/en/tools-reference>) tool. Once in a worktree, Claude can switch directly to another one under `.claude/worktrees/` by calling `EnterWorktree` with the target path. The previous worktree stays on disk untouched. Before using `--worktree` interactively in a directory for the first time, accept the workspace trust dialog by running `claude` once in that directory. If trust has not yet been accepted, `--worktree` exits with an error and prompts you to run `claude` in the directory first. Non-interactive runs with `-p` skip the [trust check](</docs/en/security>), so `claude -p --worktree` proceeds without it. Add `.claude/worktrees/` to your `.gitignore` so worktree contents don’t appear as untracked files in your main checkout. @@ -78,7 +78,7 @@ * **Uncommitted changes, untracked files, or new commits exist** : Claude prompts you to keep or remove the worktree. Keeping preserves the directory and branch so you can return later. Removing deletes the worktree directory and its branch, discarding any uncommitted changes, untracked files, and commits * **Non-interactive runs** : worktrees created with `--worktree` alongside `-p` are not cleaned up automatically since there is no exit prompt. Remove them with `git worktree remove` -Worktrees that Claude created for subagents and [background sessions](</docs/en/agent-view#how-file-edits-are-isolated>) are removed automatically once they are older than your [`cleanupPeriodDays`](</docs/en/settings#available-settings>) setting, provided they have no uncommitted changes, no untracked files, and no unpushed commits. Worktrees you create with `--worktree` are never removed by this sweep. +Worktrees that Claude created for subagents and [background sessions](</docs/en/agent-view#how-file-edits-are-isolated>) are removed automatically once they are older than your [`cleanupPeriodDays`](</docs/en/settings#available-settings>) setting, provided they have no uncommitted changes, no untracked files, and no unpushed commits. Worktrees you create with `--worktree` are never removed by this sweep. While an agent is running, Claude runs `git worktree lock` on its worktree so that concurrent cleanup cannot remove it. The lock is released when the agent finishes. To clean up a worktree that the sweep keeps, run `git worktree remove`, adding `--force` if the worktree has uncommitted changes or untracked files. ##
modified Zero data retention View current →
--- a/zero-data-retention.md +++ b/zero-data-retention.md @@ -27,7 +27,7 @@ What ZDR covers -ZDR covers model inference calls made through Claude Code on Claude for Enterprise. When you use Claude Code in your terminal, the prompts you send and the responses Claude generates are not retained by Anthropic. This applies regardless of which Claude model is used. +ZDR covers model inference calls made through Claude Code on Claude for Enterprise. When you use Claude Code in your terminal, the prompts you send and the responses Claude generates are not retained by Anthropic. This applies to every model available to ZDR organizations. Some models require data retention and are not available under ZDR; see Model availability under ZDR. ### @@ -56,10 +56,18 @@ Feature| Reason ---|--- [Claude Code on the Web](</docs/en/claude-code-on-the-web>)| Requires server-side storage of conversation history. -[Remote sessions](</docs/en/desktop#remote-sessions>) from the Desktop app| Requires persistent session data that includes prompts and completions. +[Cloud sessions](</docs/en/desktop#cloud-sessions>) from the Desktop app| Requires persistent session data that includes prompts and completions. Feedback submission (`/feedback`)| Submitting feedback sends conversation data to Anthropic. These features are blocked in the backend regardless of client-side display. If you see a disabled feature in the Claude Code terminal during startup, attempting to use it returns an error indicating the organization’s policies do not allow that action. Future features may also be disabled if they require storing prompts or completions. + +### + +​ + +Model availability under ZDR + +Claude Fable 5 is not available for organizations with zero data retention enabled. This model class [requires data retention](<https://platform.claude.com/docs/en/manage-claude/api-and-data-retention#model-specific-data-retention-requirements>), so requests from ZDR organizations cannot be served by it. The model is either absent from the `/model` picker for ZDR organizations or shown as disabled with a notice that disabling ZDR is required, and the server rejects requests for it regardless of client configuration. Other models remain available under ZDR. Fable 5 is not the default model, and the `best` alias, which resolves to Fable 5 where it is available, resolves to Opus for organizations where it is not, including ZDR organizations. ##