modified Use Claude Code with a screen reader View current →
Show diff (161 lines)
--- a/accessibility.md +++ b/accessibility.md @@ -1,6 +1,4 @@ -Claude Code has a screen reader mode that replaces its visual terminal interface with plain, linear text. Instead of boxes, progress animations, and in-place redraws, the mode prints labeled lines that a screen reader such as VoiceOver or NVDA reads in order, so you can hold a full conversation, approve tool permissions, and review output end to end. Screen reader mode is opt-in. If you use a screen magnifier, reduced motion, or a colorblind-friendly theme instead of a screen reader, see Accessibility settings beyond screen reader mode. - -Screen reader mode requires Claude Code v2.1.181 or later. Earlier versions reject the `--ax-screen-reader` flag with `error: unknown option '--ax-screen-reader'`. +Claude Code has a screen reader mode that replaces its visual terminal interface with plain, linear text. Instead of boxes, progress animations, and in-place redraws, Claude Code prints labeled lines that a screen reader such as VoiceOver or NVDA reads in order. You can hold a full conversation, approve tool permissions, and review output end to end. Screen reader mode is opt-in. If you use a screen magnifier, reduced motion, or a colorblind-friendly theme instead of a screen reader, set `CLAUDE_CODE_ACCESSIBILITY`, `prefersReducedMotion`, or `theme` from the Accessibility settings table. Screen reader mode requires Claude Code v2.1.181 or later. Earlier versions reject the `--ax-screen-reader` flag with `error: unknown option '--ax-screen-reader'`. ## @@ -11,12 +9,10 @@ Pick the method that matches how often you use a screen reader: * For one session: run `claude --ax-screen-reader`. - * For sessions started from one shell: set the `CLAUDE_AX_SCREEN_READER` environment variable to `1`. In Bash or Zsh, run `export CLAUDE_AX_SCREEN_READER=1`; in PowerShell, run `$env:CLAUDE_AX_SCREEN_READER = "1"`. Add the line to your shell profile to cover every shell. - * For every session on the machine: add `"axScreenReader": true` to your user [settings file](</docs/en/settings>). This covers any terminal, including the VS Code integrated terminal. + * For sessions started from one shell: set the `CLAUDE_AX_SCREEN_READER` environment variable to `1`. In Bash or Zsh, run `export CLAUDE_AX_SCREEN_READER=1`. In PowerShell, run `$env:CLAUDE_AX_SCREEN_READER = "1"`. Add that line to your shell profile to keep it for future shells. + * For every session on the machine: add `"axScreenReader": true` to your user [settings file](</docs/en/settings>). The setting applies in any terminal, including the VS Code integrated terminal. -The methods are listed in precedence order: the [`--ax-screen-reader`](</docs/en/cli-reference#cli-flags>) flag overrides the [`CLAUDE_AX_SCREEN_READER`](</docs/en/env-vars>) environment variable, which overrides the [`axScreenReader`](</docs/en/settings#available-settings>) setting. - -If you use Claude Code over SSH, set the environment variable or setting on the remote machine where Claude Code runs. When the mode is on, the first thing Claude Code prints is a confirmation line naming the method that turned it on: `[Screen Reader Mode: on via flag]`, `[Screen Reader Mode: on via env]`, or `[Screen Reader Mode: on via settings]`. The method-naming format requires Claude Code v2.1.206 or later. When Claude Code relaunches itself, for example to finish installing an update, the new process inherits the mode through the `CLAUDE_AX_SCREEN_READER` environment variable, so its confirmation line reads `[Screen Reader Mode: on via env]` regardless of which method you used. Earlier versions print `[Accessible screen reader mode: on]`. After printing the confirmation line, Claude Code holds the rest of the interface back for three seconds so your screen reader can finish speaking the line, then renders the first prompt. Press any key to end the hold early. To change the hold’s length, set the `CLAUDE_AX_STARTUP_QUIET_MS` environment variable to a number of milliseconds. The default is `3000`; set it to `0` to skip the hold. Claude Code caps the hold at `600000` milliseconds, 10 minutes. Requires Claude Code v2.1.217 or later. +If you combine methods, Claude Code applies the [`--ax-screen-reader`](</docs/en/cli-reference#cli-flags>) flag over the [`CLAUDE_AX_SCREEN_READER`](</docs/en/env-vars#variables>) environment variable, and the variable over the [`axScreenReader`](</docs/en/settings#available-settings>) setting. If you use Claude Code over SSH, set the environment variable or setting on the remote machine where Claude Code runs. The first line Claude Code prints confirms the mode: `[Screen Reader Mode: on via flag]`, `[Screen Reader Mode: on via env]`, or `[Screen Reader Mode: on via settings]`. ## @@ -24,7 +20,27 @@ Turn off screen reader mode -Reverse whichever method turned the mode on: start without the flag, unset the environment variable, or set `axScreenReader` to `false`. Setting `CLAUDE_AX_SCREEN_READER=0` keeps the mode off even when the setting is `true`. +Reverse whichever method turned the mode on: start without the flag, unset the environment variable, or set `axScreenReader` to `false`. If you set `CLAUDE_AX_SCREEN_READER` to `0`, Claude Code keeps the mode off even when the setting is `true`. + +## + +​ + +Accessibility settings + +The table lists each accessibility option, whether you set it as a flag, an environment variable, or a setting, and what it changes. + +Option| Type| What it changes +---|---|--- +[`--ax-screen-reader`](</docs/en/cli-reference#cli-flags>)| Flag| Screen reader mode for one session. +[`CLAUDE_AX_SCREEN_READER`](</docs/en/env-vars#variables>)| Environment variable| Screen reader mode for sessions started from the shell where you set it. +[`axScreenReader`](</docs/en/settings#available-settings>)| Setting| Screen reader mode for every session when `true`. +[`CLAUDE_AX_STARTUP_QUIET_MS`](</docs/en/env-vars#variables>)| Environment variable| How long Claude Code waits after the confirmation line before it draws the first prompt in screen reader mode. Requires Claude Code v2.1.217 or later. +[`CLAUDE_AX_PREPARK_MS`](</docs/en/env-vars#variables>)| Environment variable| How long Claude Code waits, with the cursor at the start of the line, before it writes a new or changed line in screen reader mode. Requires Claude Code v2.1.233 or later. +[`CLAUDE_CODE_ACCESSIBILITY`](</docs/en/env-vars#variables>)| Environment variable| A terminal cursor that stays visible for screen magnifiers such as macOS Zoom when you set it to `1`. The cursor follows the input caret and, on Claude Code v2.1.218 or later, the highlighted row in menus and panels such as `/config` and `/plugin`. +[`prefersReducedMotion`](</docs/en/settings#available-settings>)| Setting| Reduced or no spinners, shimmer, and other animations when `true`. +[`theme`](</docs/en/settings#available-settings>)| Setting| The interface colors, including the colorblind-friendly `dark-daltonized` and `light-daltonized` themes. You can also pick one with [`/theme`](</docs/en/commands#all-commands>). +[`preferredNotifChannel`](</docs/en/settings#available-settings>)| Setting| With the value `"terminal_bell"`, a terminal bell outside screen reader mode when Claude is waiting on you. ## @@ -34,30 +50,37 @@ In screen reader mode, Claude Code writes flat text: - * no box-drawing characters for the interface chrome - * no color-only cues - * no redraws of content that hasn’t changed; progress spinners render as static text - * tables in Claude’s replies read as `Header: value` sentences instead of a box-character grid. Requires Claude Code v2.1.198 or later; earlier versions draw tables as grids even in screen reader mode. + * No box-drawing characters for the interface chrome + * No color-only cues + * No redraws of content that hasn’t changed. Progress spinners render as static text + * Tables in Claude’s replies read as `Header: value` sentences instead of a box-character grid -Output accumulates in your terminal’s scrollback, so you can re-read earlier turns with your screen reader’s review commands or your terminal’s search. Screen reader mode renders as plain scrolling text, even if you’ve turned on [fullscreen rendering](</docs/en/fullscreen>) with the [`tui` setting](</docs/en/settings#available-settings>); the setting has no effect while the mode is active. Attached background sessions still render fullscreen; see Known limitations. Each message in the transcript starts with a label your screen reader announces, naming what it is: your messages, Claude’s replies, tool activity, errors, and prompts. The labels are also searchable, so you can jump between sections of the transcript by searching your terminal’s scrollback: +Claude Code leaves everything it prints in your terminal’s scrollback, so you can re-read earlier turns with your screen reader’s review commands or your terminal’s search. Claude Code ignores the [`tui` setting](</docs/en/settings#available-settings>) in screen reader mode. Apart from the attached background sessions listed under Known limitations, it prints scrolling text instead of [fullscreen rendering](</docs/en/fullscreen>). Claude Code also waits at two points so your screen reader can keep up: + + * After Claude Code prints the confirmation line, it waits 3 seconds before it draws the prompt, so your screen reader can finish the line. Press any key to end the wait. To change the length of the wait, set [`CLAUDE_AX_STARTUP_QUIET_MS`](</docs/en/env-vars#variables>). + * Before Claude Code writes a new or changed line, such as a hint or more of Claude’s reply, it moves the cursor to the start of the line and waits 50 milliseconds. Your screen reader then reads the line from its first character. Characters you type or delete at the end of the input line appear immediately. To change the length of the wait, set [`CLAUDE_AX_PREPARK_MS`](</docs/en/env-vars#variables>). + +Each message in the transcript starts with a label your screen reader announces, naming what it is: your messages, Claude’s replies and thinking, tool activity, errors and warnings, and prompts. The labels are also searchable, so you can jump between sections of the transcript by searching your terminal’s scrollback: Label| Meaning ---|--- `you:`| Your messages `claude:`| Claude’s replies +`thinking:`| Claude’s thinking `tool:`| Tool activity, such as a file edit or a command run `tool error:`| A tool that failed `error:`| An error in the conversation, such as a failed API request +`warning:`| A warning from Claude Code, such as a switch to a fallback model `Permission Required:`| A permission prompt waiting for your answer `Cost:`| The session cost summary when Claude Code exits, if your account [shows costs](</docs/en/costs>) -The terminal cursor follows the input caret, so a screen reader’s read-current-line command answers “where am I” with the prompt you’re editing. As you type or press `Backspace` at the end of the input line, Claude Code writes only the characters that change, so your screen reader echoes just those characters. Deletions require Claude Code v2.1.222 or later and typing requires v2.1.219 or later; before those versions, each keystroke rewrote the line, so the screen reader re-read it. When you delete a word or a line in the input, Claude Code announces the deleted text. Requires Claude Code v2.1.218 or later. The announcement covers: +Claude Code keeps the terminal cursor on the input caret, so your screen reader’s read-current-line command reads the prompt you’re editing. As you type at the end of the input line, or press `Backspace` there, Claude Code writes only the characters that change. Your screen reader echoes only those characters. When you delete a word or a line with one of the [text editing shortcuts](</docs/en/interactive-mode#text-editing>), Claude Code announces the deleted text: * Deleting a word with `Ctrl+W`, `Option+Delete` on macOS, or `Ctrl+Backspace` on Windows * Deleting to the start of the line with `Ctrl+U` or `Cmd+Backspace` * Deleting to the end of the line with `Ctrl+K` -See the [text editing shortcuts](</docs/en/interactive-mode#text-editing>) for what each key does. Cycling [permission modes](</docs/en/permission-modes>) with `Shift+Tab` announces the mode you land on, such as `[plan mode on]` or `[accept edits on]`. Claude Code prints the announcement once and doesn’t repeat it on later redraws. Requires Claude Code v2.1.210 or later. +When you cycle [permission modes](</docs/en/permission-modes>) with `Shift+Tab`, Claude Code announces the permission mode you land on, such as `[plan mode on]` or `[accept edits on]`. Claude Code prints the announcement once and doesn’t repeat it on later redraws. ### @@ -80,12 +103,12 @@ Answer menus and prompts -In screen reader mode, menus you’d normally navigate with the arrow keys, including permission prompts, become numbered lists. Each option is announced as a numbered line, followed by an `Enter selection` prompt that names the valid range. Type the number of the option you want and press Enter. +In screen reader mode, menus you’d normally navigate with the arrow keys, including permission prompts, become numbered lists. Claude Code announces each option as a numbered line, then an `Enter selection` prompt that names the valid range. Type the number of the option you want and press Enter. - * To cancel a dismissible menu: press Escape. Its prompt ends with `or Escape to cancel`. - * If you type a number that isn’t on the list: Claude Code announces the valid range and lets you try again. + * Press Escape to cancel a menu whose prompt ends with `or Escape to cancel`. + * If you type a number that isn’t on the list, Claude Code announces the valid range and lets you try again. -Yes-or-no prompts ask for a typed answer instead of a two-option menu. Answer `y` or `n` and press Enter. `yes` and `no` also work. +The [`/effort`](</docs/en/model-config#adjust-effort-level>) selector, which is a slider outside screen reader mode, becomes the same kind of numbered list. Yes-or-no prompts ask for a typed answer instead of a two-option menu. Answer `y` or `n` and press Enter. `yes` and `no` also work. ## @@ -96,22 +119,10 @@ In screen reader mode, Claude Code rings the terminal bell when it needs your attention, so you don’t have to keep checking the transcript. The bell rings when: * Claude finishes a reply - * a permission prompt appears - * a tool that ran longer than 5 seconds finishes + * A prompt or dialog needs your answer, such as a permission prompt + * A tool that ran longer than 5 seconds finishes -The bell is your terminal’s standard alert. To silence it, change the bell setting in your terminal application. The bell doesn’t require screen reader mode: outside the mode, set [`preferredNotifChannel`](</docs/en/settings#available-settings>) to `"terminal_bell"` for similar alerts when Claude is waiting on you. See [Get a terminal bell or notification](</docs/en/terminal-config#get-a-terminal-bell-or-notification>). - -## - -​ - -Accessibility settings beyond screen reader mode - -These options address accessibility needs outside of screen reader mode. All of them work alongside it. - - * The `CLAUDE_CODE_ACCESSIBILITY` [environment variable](</docs/en/env-vars>) is for screen magnifiers. Set `CLAUDE_CODE_ACCESSIBILITY=1` to keep the native terminal cursor visible so that magnifiers, such as macOS Zoom, can track the cursor position. The cursor follows keyboard focus: the input caret while you type, and the highlighted row as you move through menus and panels, such as `/config` and `/plugin`, with the arrow keys. Row tracking in menus and panels requires Claude Code v2.1.218 or later. - * The `prefersReducedMotion` [setting](</docs/en/settings#available-settings>) reduces or disables spinners, shimmer, and other animations without changing the rest of the interface. - * The `theme` [setting](</docs/en/settings#available-settings>) selects the interface colors, including the colorblind-friendly `dark-daltonized` and `light-daltonized` themes. +The bell is your terminal’s standard alert. To silence it, change the bell setting in your terminal application. Outside screen reader mode, set [`preferredNotifChannel`](</docs/en/settings#available-settings>) to `"terminal_bell"` to get a [similar bell](</docs/en/terminal-config#get-a-terminal-bell-or-notification>) when Claude is waiting on you. ## @@ -134,17 +145,3 @@ Report an issue If something doesn’t work with your screen reader, magnifier, or terminal, open an issue on the [Claude Code issue tracker](<https://github.com/anthropics/claude-code/issues>) and mention your assistive technology in the title. Include your operating system, terminal application, and assistive technology name and version in the report. - -## - -​ - -Related resources - -These pages hold the full reference entries and related setup for what this page covers: - - * [Settings](</docs/en/settings#available-settings>): the `axScreenReader`, `prefersReducedMotion`, `theme`, and `preferredNotifChannel` entries - * [Environment variables](</docs/en/env-vars>): the `CLAUDE_AX_SCREEN_READER` and `CLAUDE_CODE_ACCESSIBILITY` entries - * [CLI reference](</docs/en/cli-reference#cli-flags>): the `--ax-screen-reader` flag - * [Terminal configuration](</docs/en/terminal-config>): bells, notifications, and themes outside screen reader mode - * [Non-interactive mode](</docs/en/headless>): scripted `claude -p` runs, which write plain text without screen reader mode
modified Set up Claude Code for your organization View current →
--- a/admin-setup.md +++ b/admin-setup.md @@ -78,6 +78,7 @@ ---|---|--- [Permission rules](</docs/en/permissions>)| Allow, ask, or deny specific tools and commands| `permissions.allow`, `permissions.deny` [Permission lockdown](</docs/en/permissions#managed-only-settings>)| Only managed permission rules apply; disable `--dangerously-skip-permissions`| `allowManagedPermissionRulesOnly`, `permissions.disableBypassPermissionsMode` +[Starting permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>)| Choose the permission mode your developers’ terminal sessions start in instead of the built-in starting permission mode, or remove auto mode. The VS Code extension reads a `defaultMode` you set only on Pro, Max, and Team plans; [Switch permission modes](</docs/en/permission-modes#switch-permission-modes>) lists what the extension reads| `permissions.defaultMode`, `permissions.disableAutoMode` [Sandboxing](</docs/en/sandboxing>)| OS-level filesystem and network isolation with domain allowlists| `sandbox.enabled`, `sandbox.network.allowedDomains` [Managed policy CLAUDE.md](</docs/en/memory#deploy-organization-wide-claude-md>)| Org-wide instructions loaded in every session, can’t be excluded| File at the managed policy path [MCP server control](</docs/en/managed-mcp>)| Restrict which MCP servers users can add or connect to, or deploy a fixed set| `allowedMcpServers`, `deniedMcpServers`, `allowManagedMcpServersOnly`, or a deployed `managed-mcp.json` file
modified Escalate hard decisions with the advisor tool View current →
--- a/advisor.md +++ b/advisor.md @@ -22,7 +22,7 @@ * **`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, and an `Advisor Tool (experimental) is on and may use more tokens · /advisor` notification appears after the session starts. To stop using it, see Turn the advisor off. +Each of these enables the advisor for sessions whose main model supports it. After the session starts, Claude Code shows an `Advisor Tool (experimental) is on and may use more tokens · /advisor` notification. To stop using the advisor, see Turn the advisor off. On some plans, Fable as the advisor also needs your one-time [consent to bill Fable 5 usage to usage credits](</docs/en/model-config#fable-5-and-usage-credits>). For what happens before you have given that consent, see Fable advisor and usage credits. ### @@ -34,7 +34,7 @@ /advisor opus -The command confirms with `Advisor set to` followed by the advisor model name. Your selection is saved to `advisorModel` in your user settings and persists across sessions. If your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist excludes the saved advisor model, the advisor is not invoked until you pick an allowed model with `/advisor`. 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>). +The command confirms with `Advisor set to` followed by the advisor model name. Your selection is saved to `advisorModel` in your user settings and persists across sessions. Claude Code doesn’t invoke a saved advisor that your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist excludes. To use the advisor, pick an allowed model with `/advisor`. Claude Code still saves an advisor that your current main model doesn’t support. That advisor activates after you switch to a compatible main model with [`/model`](</docs/en/model-config#setting-your-model>). On some plans, Fable as the advisor also needs your one-time [consent to bill Fable 5 usage to usage credits](</docs/en/model-config#fable-5-and-usage-credits>). For what `/advisor fable` does before you have given that consent, see Fable advisor and usage credits. ### @@ -58,7 +58,14 @@ claude --advisor opus -The flag takes precedence over the `advisorModel` setting for that session, and isn’t listed in `claude --help`. It exits with an error if the session’s main model does not support the advisor, or if the requested advisor model is excluded by your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist. +Claude Code uses the flag instead of the `advisorModel` setting for that session. It doesn’t list `--advisor` in `claude --help`. Claude Code exits with an error at launch if: + + * The session’s main model doesn’t support the advisor + * The requested model, such as Haiku, can’t act as an advisor + * Your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist excludes the requested model + * You requested Fable and your account still requires the usage-credits consent + +If you start a [background session](</docs/en/agent-view>) with `--advisor` and one of these applies, Claude Code starts the session without the advisor instead of exiting. ## @@ -86,6 +93,14 @@ ​ +Fable advisor and usage credits + +On some plans, Fable 5 usage bills to usage credits, and Claude Code asks for your [one-time consent to bill Fable 5 usage to usage credits](</docs/en/model-config#fable-5-and-usage-credits>) when you select Fable 5 with `/model`. Fable as the advisor bills the same way, so on those plans Claude Code doesn’t apply Fable as the advisor until you have accepted that consent. Before you have accepted it, Claude Code doesn’t save Fable as the advisor when you type `/advisor fable` or pick Fable in the `/advisor` picker. It points you to `/model fable` instead. With `claude --advisor fable`, Claude Code exits at launch with a message that points to `/model fable`. In a background session, it starts the session without the advisor instead of exiting. With Fable already saved as your `advisorModel`, Claude Code sends requests without the advisor. In an interactive session whose main model supports the advisor, it also shows a notification that points to `/model fable`. To accept the consent, run `/model fable` and choose to continue on Fable 5. Claude Code records the consent and [saves Fable 5 as your selected model](</docs/en/model-config#default-model-setting>). Then select Fable as the advisor. + +### + +​ + Common model pairings Any accepted pairing works. These combinations balance cost against capability in different ways: @@ -113,7 +128,12 @@ 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. +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 reports whether the advisor gave guidance: + + * **Reviewed** : the line confirms that the advisor has reviewed the conversation. Press `Ctrl+O` to expand it and read the advisor’s full guidance. + * **Declined** : the line reads `Advisor declined to advise on this request`. If the advisor gave a reason, press `Ctrl+O` to read it. + +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. ## @@ -121,7 +141,7 @@ 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. +When Claude calls the advisor, the advisor model reads the conversation, so each call consumes tokens at the advisor model’s rates in addition to your main model’s usage. With API billing, you pay the advisor model’s input and output rates for advisor tokens. On subscription plans, advisor usage counts toward your plan’s usage limits, except that a Fable 5 advisor bills to [usage credits](</docs/en/model-config#fable-5-and-usage-credits>) on plans where Fable 5 usage does. If your account requires the usage-credits consent, a Fable advisor bills nothing before you give it, because Claude Code doesn’t apply the selection until then. 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. ##
modified Orchestrate teams of Claude Code sessions View current →
--- a/agent-teams.md +++ b/agent-teams.md @@ -124,10 +124,14 @@ Spawn 4 teammates to refactor these modules in parallel. Use Sonnet for each teammate. -Teammates don’t inherit the lead’s `/model` selection by default. To change the model used when the prompt doesn’t specify one, set **Default teammate model** in `/config`. Pick **Default (leader’s model)** to have teammates follow the lead’s current model. Claude Code checks each teammate’s model, whether requested in your prompt or set through **Default teammate model** , against your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist. When the allowlist blocks a value, Claude Code substitutes another model: +When your prompt doesn’t name a model for a teammate, Claude Code runs the teammate on the lead’s current model, unless [`CLAUDE_CODE_SUBAGENT_MODEL`](</docs/en/model-config#environment-variables>) is set. + +`teammateDefaultModel` was removed in v2.1.234; Claude Code ignores a leftover value. Name the model in your prompt or set `CLAUDE_CODE_SUBAGENT_MODEL` instead. + +Claude Code checks the model your prompt requests for a teammate, or the one `CLAUDE_CODE_SUBAGENT_MODEL` supplies, against your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist. When the allowlist blocks a value, Claude Code substitutes another model: * **Family alias such as`opus`**: On the Anthropic API and Claude Platform on AWS, Claude Code runs the teammate on the newest version of that family the allowlist permits. On providers with provider-specific model IDs, where the [substitution doesn’t operate](</docs/en/model-config#restrict-model-selection>), a blocked alias falls back like any other blocked value per the next bullet - * **Any other blocked value, including a family alias on providers where the substitution doesn’t operate or whose family has no permitted version** : Claude Code uses the default teammate model. When the blocked value is the **Default teammate model** setting itself, Claude Code uses your provider’s default Opus model, or the lead’s model when the allowlist blocks that too + * **Any other blocked value, including a family alias on providers where the substitution doesn’t operate or whose family has no permitted version** : Claude Code runs the teammate on the lead’s model Teammates inherit the lead’s [effort level](</docs/en/model-config#adjust-effort-level>). In split-pane mode this applies from v2.1.186; earlier versions did not pass the lead’s session effort to split-pane teammates.
modified Manage multiple agents with agent view View current →
--- a/agent-view.md +++ b/agent-view.md @@ -24,7 +24,7 @@ Dispatch a session -Type a prompt describing a task and press `Enter`. A new background session starts on that task and appears as a row showing whether it’s working, waiting on you, or done. The new session uses the model shown in the agent view header and the same permission mode you’d get running `claude` in that directory.Every prompt you enter here starts its own new session. Typing another prompt and pressing `Enter` launches a second session alongside the first rather than sending a follow-up to it. You can run several in parallel this way.Each session uses your subscription quota independently, so see Limitations before dispatching many at once. +Type a prompt describing a task and press `Enter`. A new background session starts on that task and appears as a row showing whether it’s working, waiting on you, or done. The new session uses the model shown in the agent view header. Which permission mode it starts in depends on how you opened agent view.Every prompt you enter here starts its own new session. Typing another prompt and pressing `Enter` launches a second session alongside the first rather than sending a follow-up to it. You can run several in parallel this way.Each session uses your subscription quota independently, so see Limitations before dispatching many at once. 3 @@ -455,11 +455,47 @@ Permission mode, model, and effort -A background session reads its [settings](</docs/en/settings>) from the directory it runs in, the same as if you had started `claude` there. This includes [`env` values](</docs/en/settings#available-settings>) in project settings, so an `ANTHROPIC_MODEL` or provider variable set there applies to background sessions in that directory. Cloud provider selection, such as `CLAUDE_CODE_USE_BEDROCK` or `CLAUDE_CODE_USE_VERTEX`, and `ANTHROPIC_DEFAULT_*_MODEL` aliases follow the shell that dispatched the session. If you export a [`CLAUDE_CODE_EXTRA_BODY`](</docs/en/env-vars>) request-body override in that shell, it reaches the session the same way. A gateway `ANTHROPIC_BASE_URL` exported in that shell can reach the session too; see the supervisor process for the conditions and for how background sessions source provider settings and credentials. The [permission mode](</docs/en/permissions>) depends on how you started the session. Backgrounding an existing session with `/bg` or `←` keeps the current permission mode, so a session you switched to `acceptEdits` or `auto` stays in that mode after detaching. Dispatching from the agent view input or running `claude --bg` from your shell uses the `defaultMode` from that directory’s settings, or the `permissionMode` from the dispatched [subagent’s frontmatter](</docs/en/sub-agents#supported-frontmatter-fields>). The permission mode, model, and effort you chose for a background session, along with the configuration flags it carries, all persist when the supervisor later stops and restarts its process. A session you launched with `claude --bg --dangerously-skip-permissions` or `claude --bg --permission-mode bypassPermissions` stays in `bypassPermissions` after that restart instead of falling back to the directory’s `defaultMode`, and a model or effort you changed mid-session with `/model` or `/effort` is kept. An effort the session took from the [`effortLevel` setting](</docs/en/settings#available-settings>) rather than from `--effort` or `/effort` isn’t fixed at dispatch: each process started for the session reads the setting again, so editing `effortLevel` in `settings.json` reaches sessions you background with `←` or `/bg` and their later restarts. A name you set with [`/rename`](</docs/en/commands>) or `Ctrl+R` also persists across that restart, so [`claude --resume <name>`](</docs/en/sessions#name-your-sessions>) still resolves the session. To set defaults for every session you dispatch from agent view, pass any of `--permission-mode`, `--model`, `--effort`, or `--agent` when opening it: +A background session takes its settings, provider, permission mode, model, and effort from where and how you dispatched it. The subsections below cover each source, and what persists when the supervisor restarts the session. + +#### + +​ + +Settings and provider + +A background session reads its [settings](</docs/en/settings>) from the directory it runs in, the same as if you had started `claude` there. This includes [`env` values](</docs/en/settings#available-settings>) in project settings, so an `ANTHROPIC_MODEL` or provider variable set there applies to background sessions in that directory. Cloud provider selection, such as `CLAUDE_CODE_USE_BEDROCK` or `CLAUDE_CODE_USE_VERTEX`, and `ANTHROPIC_DEFAULT_*_MODEL` aliases follow the shell that dispatched the session. If you export a [`CLAUDE_CODE_EXTRA_BODY`](</docs/en/env-vars>) request-body override in that shell, it reaches the session the same way. A gateway `ANTHROPIC_BASE_URL` exported in that shell can reach the session too; see the supervisor process for the conditions and for how background sessions source provider settings and credentials. + +#### + +​ + +Permission mode + +The [permission mode](</docs/en/permissions>) depends on how you started the session: + + * **Backgrounded with`/bg` or `←`**: Claude Code keeps the permission mode the session was in, so one you switched to `acceptEdits` or `auto` stays there after detaching + * **Dispatched from an agent view you opened with`←`**: the new session starts in the permission mode of the session you came from + * **Dispatched from`claude agents` started in a shell, or with `claude --bg`**: the new session starts the way a new `claude` session in that directory would, unless you dispatched it from an agent view you opened with dispatch defaults. [Which permission mode a session starts in](</docs/en/permission-modes#which-mode-a-session-starts-in>) lists the order + +#### + +​ + +Dispatch defaults + +To set defaults for every session you dispatch from agent view, pass any of `--permission-mode`, `--model`, `--effort`, or `--agent` when opening it: claude agents --permission-mode plan --model opus --effort high `--effort` here accepts the same values as the [top-level `--effort` flag](</docs/en/cli-reference#cli-flags>), including `ultracode`. `--agent` sets the [subagent](</docs/en/sub-agents>) used when a dispatch prompt doesn’t name one, either with `@name` or as the first word. It defaults to the [`agent` setting](</docs/en/settings#available-settings>) if one is set, otherwise the built-in catch-all `claude` agent. Naming a subagent in the dispatch input overrides both. `claude agents` also accepts `--dangerously-skip-permissions` as shorthand for `--permission-mode bypassPermissions`, and `--allow-dangerously-skip-permissions` to make `bypassPermissions` available in each dispatched session’s `Shift+Tab` cycle without starting in that mode. Both match the [top-level CLI flags](</docs/en/cli-reference>). The active defaults appear in the footer below the dispatch input. Claude Code refuses `claude --bg --permission-mode bypassPermissions` until you’ve accepted the bypass disclaimer by running `claude --dangerously-skip-permissions` once interactively, since that mode lets a session you aren’t watching act without approval. Passing `--dangerously-skip-permissions` or `--permission-mode bypassPermissions` to `claude agents` shows the same disclaimer when you haven’t accepted it before, and accepting applies `bypassPermissions` to the sessions you launch from the view. Passing `--allow-dangerously-skip-permissions` shows the same disclaimer too, and accepting makes `bypassPermissions` available in the `Shift+Tab` cycle of those sessions without starting them in it. + +#### + +​ + +What persists across restarts + +The permission mode, model, and effort you chose for a background session, along with the configuration flags it carries, all persist when the supervisor later stops and restarts its process. A session you launched with `claude --bg --dangerously-skip-permissions` or `claude --bg --permission-mode bypassPermissions` stays in `bypassPermissions` after that restart. A model or effort you changed mid-session with `/model` or `/effort` is kept too. If the session took its effort from the [`effortLevel` setting](</docs/en/settings#available-settings>) rather than from `--effort` or `/effort`, Claude Code reads the setting again each time it starts a process for the session. So when you edit `effortLevel` in `settings.json`, the change reaches sessions you background with `←` or `/bg`, and their later restarts. Claude Code also keeps a name you set with [`/rename`](</docs/en/commands>) or `Ctrl+R` across that restart, so you can still run [`claude --resume <name>`](</docs/en/sessions#name-your-sessions>) to reach the session. ###
modified Run agents in parallel View current →
--- a/agents.md +++ b/agents.md @@ -16,7 +16,7 @@ A few other features run Claude without you driving each step, but they solve a different problem than splitting work across agents: * A [background bash command](</docs/en/interactive-mode#background-bash-commands>) runs one shell command without blocking the conversation. It doesn’t spawn an agent. - * A [forked subagent](</docs/en/sub-agents#fork-the-current-conversation>), started with `/subtask`, is a subagent that inherits your full conversation context instead of starting fresh. It’s a way to spawn a subagent, not a separate surface. To copy the whole session into a new [background session](</docs/en/agent-view#from-inside-a-session>) that runs alongside it, use `/fork`. With [agent view turned off](</docs/en/agent-view#turn-off-agent-view>), the forked-subagent command is `/fork` instead and `/subtask` isn’t available. + * A [forked subagent](</docs/en/sub-agents#fork-the-current-conversation>) is a subagent that inherits your full conversation context instead of starting fresh. It’s a way to spawn a subagent, not a separate surface. Start one with `/subtask`. Claude also spawns one itself where [fork mode](</docs/en/sub-agents#turn-fork-mode-on-or-off>) is on. To copy the whole session into a new [background session](</docs/en/agent-view#from-inside-a-session>) that runs alongside it, use `/fork`. With [agent view turned off](</docs/en/agent-view#turn-off-agent-view>), the forked-subagent command is `/fork` instead and `/subtask` isn’t available. * A [routine](</docs/en/routines>) runs a session on a schedule in the cloud, not in parallel on your machine. Running several sessions or subagents at once multiplies token usage. See [Costs](</docs/en/costs>) for usage and rate-limit details.
modified Claude Code on Amazon Bedrock View current →
--- a/amazon-bedrock.md +++ b/amazon-bedrock.md @@ -166,7 +166,7 @@ * `AWS_DEFAULT_REGION` * the `region` set on your active AWS profile, read from the AWS shared credentials file first and then the shared config file, matching AWS SDK precedence * `us-east-1` -The active profile is `AWS_PROFILE` if set, otherwise `default`. Set `AWS_SHARED_CREDENTIALS_FILE` or `AWS_CONFIG_FILE` to point at non-default file paths. Run `/status` to see the resolved region. When the region came from your AWS config files or the default fallback, `/status` also notes the source. On v2.1.171 and earlier, Claude Code does not read the AWS config files, so set `AWS_REGION` explicitly. +If a value from any of these sources isn’t shaped like a region name, Claude Code treats it as unset and continues down the order. For example, Claude Code treats a value containing a slash, dot, or space as unset. The active profile is `AWS_PROFILE` if set, otherwise `default`. Set `AWS_SHARED_CREDENTIALS_FILE` or `AWS_CONFIG_FILE` to point at non-default file paths. Run `/status` to see the resolved region. When the region came from your AWS config files or the default fallback, Claude Code also notes the source in the `/status` output. On v2.1.171 and earlier, Claude Code doesn’t read the AWS config files, so set `AWS_REGION` explicitly. * When using Amazon Bedrock, the `/logout` command is unavailable since authentication is handled through AWS credentials. * The WebSearch tool is not available on Amazon Bedrock. See [WebSearch tool behavior](</docs/en/tools-reference#websearch-tool-behavior>). * You can use settings files for environment variables like `AWS_PROFILE` that you don’t want to leak to other processes. See [Settings](</docs/en/settings>) for more information.
modified Best practices for Claude Code View current →
--- a/best-practices.md +++ b/best-practices.md @@ -73,7 +73,7 @@ Switch out of plan mode by approving the plan or pressing `Shift+Tab`, then let Claude code, verifying against its plan. -claude (default mode) +claude implement the OAuth flow from your plan. write tests for the callback handler, run the test suite and fix any failures. @@ -84,7 +84,7 @@ Ask Claude to commit with a descriptive message and create a PR. -claude (default mode) +claude commit with a descriptive message and open a PR @@ -177,11 +177,10 @@ Configure permissions -Use [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to let a classifier handle approvals, `/permissions` to allowlist specific commands, or `/sandbox` for OS-level isolation. Each reduces interruptions while keeping you in control. - -By default, Claude Code requests permission for actions that might modify your system: file writes, Bash commands, MCP tools, etc. This is safe but tedious. After the tenth approval you’re not really reviewing anymore, you’re just clicking through. There are three ways to reduce these interruptions: - - * **Auto mode** : a separate classifier model reviews commands and blocks only what looks risky: scope escalation, unknown infrastructure, or hostile-content-driven actions. Best when you trust the general direction of a task but don’t want to click through every step +To get fewer prompts without giving up control, pre-approve the tools you trust with `/permissions` and let sandboxed commands run without asking with `/sandbox`. Switch to Manual mode when you want to approve edits and commands yourself. + +On Pro, Max, and Team plans, auto mode is the [built-in starting permission mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) for interactive terminal and VS Code sessions: a separate classifier model reviews most actions instead of you and blocks only what looks risky, such as scope escalation, unknown infrastructure, or hostile-content-driven actions. In Manual mode, the built-in starting permission mode on other plans, Claude Code asks before actions that might modify your system: file writes, Bash commands, MCP tools. That’s safe but tedious. After the tenth approval you’re clicking through rather than reviewing. Two tools cut those interruptions in Manual mode and apply in auto mode as well: + * **Permission allowlists** : permit specific tools you know are safe, like `npm run lint` or `git commit` * **Sandboxing** : enable OS-level isolation that restricts filesystem and network access, allowing Claude to work more freely within defined boundaries
modified Claude Code changelog View current →
--- a/changelog.md +++ b/changelog.md @@ -1,4 +1,62 @@ This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Run `claude --version` to check your installed version. + +​ + +2.1.234 + +August 17, 2026 + + * Added the optional `CLAUDE_CODE_PROJECT_DIR_NAME` environment variable: hosts that give each session its own config directory can choose a short name for the per-project transcript directory + * Added the `selection:clear` keybinding action, so a key can be bound to clear an in-app text selection; also works in the agents view + * Added a GitLab merge request badge to the footer and statusline: repos with a GitLab remote and an authenticated glab CLI show MR !N with draft/pending/green states + * Claude Code now continues your session automatically when a claude.ai usage limit resets; turn it off in `/config` (“Continue automatically at usage limit”) + * Claude is now told to use your account email only to identify you, and not to send it to unrelated services unless you ask + * Security: remote file reads, session restore, CLAUDE.md includes, workflow scripts and file uploads now reject Windows NT-namespace (`\??\`) paths, hardening the remaining pre-approval file accesses against the NTLM credential-leak vector + * Fixed auto mode in very long sessions repeatedly re-checking and denying sandboxed commands’ network access after the conversation had been compacted + * Fixed session-scoped permission answers (including denies) being dropped when answering background subagent tool permission prompts + * Fixed a crash when an API response on the non-streaming fallback path (typically via third-party gateways) contained a thinking block missing its thinking field or a text block missing its text field + * Fixed markdown rendering becoming extremely slow for some messages containing unusual Unicode sequences + * Fixed `SendMessage` rejecting a recipient copied from `ListAgents` when the session name is at the 200-character cap or emoji-heavy + * Fixed repository detection mis-reading the host of git remotes with unusual userinfo, producing links and repo-specific behavior for the wrong host + * Fixed MCP diagnostics printing resolved secrets: scope-conflict warnings now show the configured `${VAR}` form, and connection-failure details show only the server origin + * Fixed `strictKnownMarketplaces` allowlists accepting SCP-style git marketplace sources whose host differs from the one git would actually connect to + * Fixed modal text such as the `/login` OAuth URL losing characters when copied in fullscreen + * Fixed a `---` horizontal rule in rendered markdown running into the line after it + * Fixed consecutive shell commands splitting into multiple “Ran 1 shell command” rows when todo/task updates were interleaved between them + * Fixed dialogs like `/permissions` opened while a `!` shell command was running being dismissed when the command finished + * Fixed a queued `!` shell command being sent to the model as plain text after pressing up-arrow to edit the queued input + * Fixed queued messages reappearing in the prompt history while still queued, Esc while selecting a queued message no longer interrupts the turn, and `!` mode no longer sticks after a mid-turn submit + * Fixed accepting the “Try the new fullscreen renderer?” prompt restarting the session without its permission mode (e.g. `--dangerously-skip-permissions`), tool allow/deny rules, model or effort flags + * Fixed `/tui` dropping launch `--allowed-tools`/`--disallowed-tools` rules when it restarts; it now declines to switch, with the reason, when the session has restrictions a restart can’t carry over + * Fixed trust prompts omitting the repository-wide scope warning when the directory was first seen before the repository existed there + * Fixed a case where an IDE diff tab closing during a permission re-prompt could answer the new prompt with the previous input + * Fixed: files sent to the user during Remote Control sessions hosted by Claude Code Desktop or VS Code now upload, so they open on phone and web instead of showing an empty card + * Fixed: after `/login` while `CLAUDE_CODE_OAUTH_TOKEN` is set, the stale-token reminder no longer leaks into Claude’s automatically resumed turn — it now appears only to you + * Fixed: permission previews now relay only to channel servers admitted by the inbound trust gate, and a server’s explicit permission-capability opt-out is honored + * Fixed: credential masking on relayed permission previews can no longer hide commands, paths, or destinations from the approver; oversized private-key blocks now redact under full-strength redaction + * Fixed: provider API tokens that mask on permission previews now mask even when directly followed by shell delimiters + * Fixed Claude Desktop inter-session messages being silently dropped by the recipient session when cross-session messaging read as disabled, which left the sender’s query “thinking” for many minutes + * Remote Control: signing this computer in to a different claude.ai account or organization now stops the running session within seconds and says why, instead of a misleading HTTP 404 hours later + * Remote Control sessions started from Claude Code Desktop or VS Code now keep phones and claude.ai/code updated on the session’s permission mode (and claude.ai/code on the model) as they change + * Remote Control: effort picks made on a phone or on claude.ai/code now apply to terminal- and Desktop/VS Code-hosted sessions, and the session publishes its effort level to connected clients + * `SendMessage` and `ListAgents` now say when your account’s session list was too long to check completely, instead of treating unseen sessions as absent + * Expired Anthropic profile credential now points you at `/login` when a claude.ai login would take precedence + * Improved the transcript: your own prompts now render markdown (highlighted code blocks, inline code, lists) the same way replies do + * Improved the “API returned an empty or malformed response” error to say what came back (content type, body kind, size, request ID) and why the original streaming request failed + * Improved auto-generated session titles to read as short, specific names (e.g. “Login button bug”) rather than sentences restating your request (e.g. “Fix the login button on mobile”) + * Reduced the context cost of loading the built-in `claude-api` skill from ~200k+ tokens to ~25k by loading reference docs on demand + * `/permissions` can now be opened while Claude is working — rule changes apply to the rest of the current turn + * `/add-dir <path>` can now be used while Claude is working; `/add-dir`, `/autocompact`, `/theme`, `/help`, `/config` and `/advisor` dialogs open mid-turn in the fullscreen TUI + * `/goal` now clears itself with a notice when a turn dies on an unrecoverable error (e.g. revoked auth, an exhausted credit balance, or a context overflow) instead of staying armed + * `/goal`: when background tasks keep a goal waiting for 30+ minutes, Claude now checks in on them instead of waiting indefinitely (set `CLAUDE_CODE_GOAL_CHECKIN_MINUTES=0` to opt out) + * `claude setup-token` now rejects unexpected extra arguments instead of silently ignoring them + * Changed Esc in fullscreen mode to no longer clear a mouse text selection: it interrupts or dismisses as usual and the selection stays highlighted + * Removed the redundant “Allowed by auto mode classifier” line that auto mode showed under every Agent tool call + * Removed the “Default teammate model” setting from `/config`; agent-team teammates now use the leader’s model unless the spawn names one + * Dimmed the elapsed-time counter on the running tool header so it no longer competes with the bold counts + * Background task notifications delivered between turns are now sent to the model inside `<system-reminder>` tags, matching mid-turn delivery + * Mantle: skip the admin-pin availability probe at startup when a main-loop model is already picked + * Windows: startup no longer stalls on repeated rename retries when `~/.claude.json` is read-only ​
modified Push events into a running session with channels View current →
--- a/channels.md +++ b/channels.md @@ -249,15 +249,7 @@ The message arrives in your Claude Code session. The terminal shows it as an inbound channel line like `← fakechat · web: what's in my working directory?`, while the model receives it as a `<channel source="plugin:fakechat:fakechat">` event, using the plugin’s scoped server name. Claude reads it, does the work, and calls fakechat’s `reply` tool. If Claude Code asks for permission for the first reply, approve it. 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 most prompts, but only use it in environments you trust. Even then, these checks still prompt: - - * Explicit ask rules - * Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) - * MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) - * Removals targeting `/` or your home directory - * The [cross-session messaging safeguards](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) - -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 most prompts, but only use it in environments you trust. Even then, the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) still apply. 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 @@ -174,7 +174,7 @@ Field| Type| Description ---|---|--- `capabilities.experimental['claude/channel']`| `object`| Required. Always `{}`. Presence registers the notification listener. -`capabilities.experimental['claude/channel/permission']`| `object`| Optional. Always `{}`. Declares that this channel can receive permission relay requests. When declared, Claude Code forwards tool approval prompts to your channel so you can approve or deny them remotely. See Relay permission prompts. +`capabilities.experimental['claude/channel/permission']`| `object` or `false`| Optional. Set it to `{}` to declare that this channel can receive permission relay requests. When declared, Claude Code forwards tool approval prompts to your channel so you can approve or deny them remotely. To opt out, omit the key or set it to `false`. Before v2.1.234, Claude Code treated `false` as declared. See Relay permission prompts. `capabilities.tools`| `object`| Two-way only. Always `{}`. Standard MCP tool capability. See Expose a reply tool. `instructions`| `string`| Recommended. Added to Claude’s system prompt. Tell Claude what events to expect, what the `<channel>` tag attributes mean, whether to reply, and if so which tool to use and which attribute to pass back (like `chat_id`). @@ -415,7 +415,7 @@ Relay permission prompts -When Claude calls a tool that needs approval, the local terminal dialog opens and the session waits. A two-way channel can opt in to receive the same prompt in parallel and relay it to you on another device. Both stay live: you can answer in the terminal or on your phone, and Claude Code applies whichever answer arrives first and closes the other. Relay covers tool-use approvals like `Bash`, `Write`, and `Edit`. Project trust and MCP server consent dialogs don’t relay; those only appear in the local terminal. +When Claude calls a tool that needs approval, the local terminal dialog opens and the session waits. A two-way channel can opt in to receive the same prompt in parallel and relay it to you on another device. Both stay live: you can answer in the terminal or on your phone, and Claude Code applies whichever answer arrives first and closes the other. Relay covers tool-use approvals like `Bash`, `Write`, and `Edit`. Project trust and MCP server consent dialogs don’t relay; those only appear in the local terminal. Claude Code v2.1.234 and later sends permission requests only to servers it registered as channels for the session, so relay sits behind the same [session opt-in and organization controls](</docs/en/channels#security>) as message delivery. Relay also requires you to opt the server in with `--channels` or the development flag, and requires the server to declare the permission capability. ### @@ -447,7 +447,19 @@ `description`| Human-readable summary of what this specific tool call does, never the command itself. For a Bash call this is Claude’s description of the command; when the model gives no description, the field is the constant `Run shell command` and carries zero command detail. Render `input_preview` when you have room. `input_preview`| The tool’s arguments as JSON-shaped display text, keyed per top-level field. For Bash this is the command; for Write, the file path and the content. Omit it from your prompt if you only have room for a one-line message. Your server decides what to show. -Clients on Claude Code v2.1.211 or later sanitize both fields before relaying them: they neutralize direction-override and invisible characters and quote and angle-bracket lookalikes, fold whitespace runs to a single space, and relay text whole up to 3,500 code points, applied per top-level field for `input_preview`, which also keeps the JSON’s own structural quotes. A longer value keeps its start and end visible around a counted `⋯ N code points elided ⋯` marker, so the end of a long command still reaches the approver. Earlier clients relay `description` raw and cut `input_preview` to 200 UTF-16 units with a trailing ellipsis. Treat both fields as untrusted unless you control the client fleet. The verdict your server sends back is `notifications/claude/channel/permission` with two fields: `request_id` echoing the ID above, and `behavior` set to `'allow'` or `'deny'`. Allow lets the tool call proceed; deny rejects it, the same as answering No in the local dialog. Neither verdict affects future calls. +Clients on Claude Code v2.1.211 or later sanitize `description` and `input_preview` before relaying them. Expect three changes in the text you receive: + + * Claude Code neutralizes direction-override characters, invisible characters, and quote and angle-bracket lookalikes. + * Claude Code folds each run of whitespace to a single space. + * Claude Code relays text whole up to 3,500 code points. For a longer value, you receive its start and its end around a counted `⋯ N code points elided ⋯` marker. The end of a long command still reaches the approver. + +For `input_preview`, Claude Code applies the 3,500 limit to each top-level field of the arguments separately and keeps the JSON’s own structural quotes. Clients before v2.1.211 relay `description` raw and cut `input_preview` to 200 UTF-16 units with a trailing ellipsis. Clients on Claude Code v2.1.234 or later also mask credentials in `description` and `input_preview`. You receive `[REDACTED]` in place of a recognizable provider credential token, such as an API key or a personal access token. Expect three effects of the masking when you render the fields: + + * Claude Code masks key names inside `input_preview` as well as their values. A key name you display may not match the key name in the input. + * Claude Code never masks a span that contains shell syntax, path characters, or URL characters. A mask can’t hide the command, file path, or destination being approved. + * Claude Code doesn’t mask a secret that lacks a recognizable prefix, or a secret that spans whitespace, such as a private-key block. Both reach your server unmasked. + +Masking doesn’t change who receives the fields. Whatever stays unmasked goes only to servers you opted in with `--channels` or the development flag. Treat both fields as untrusted unless you control the client fleet. The verdict your server sends back is `notifications/claude/channel/permission` with two fields: `request_id` echoing the ID above, and `behavior` set to `'allow'` or `'deny'`. Allow lets the tool call proceed; deny rejects it, the same as answering No in the local dialog. Neither verdict affects future calls. ###
modified Claude apps gateway configuration View current →
--- a/claude-apps-gateway-config.md +++ b/claude-apps-gateway-config.md @@ -166,6 +166,27 @@ identity_token_file: /var/run/secrets/anthropic/id-token # workspace_id: wrkspc_... # required if the rule covers >1 workspace # service_account_id: svac_... # optional expected-target check + +##### Per-user identity headers for a proxy you run + +You can point a `provider: anthropic` upstream’s `base_url` at a proxy you run instead of at the Anthropic API. To tell that proxy which developer sent each request, set `forward_user_identity: true` on that upstream. The proxy can then attribute spend per developer. Requires a gateway running Claude Code v2.1.233 or later. For example, for a proxy at `upstream-gateway.internal.example.com`: + + upstreams: + - provider: anthropic + base_url: https://upstream-gateway.internal.example.com + auth: + api_key: ${PROXY_KEY} + forward_user_identity: true # default false + +The gateway adds these headers to every request it forwards to that upstream. + +Header| Value +---|--- +`x-litellm-end-user-id`| The developer’s email, when the IdP supplied one. +`x-claude-gateway-user-id`| The developer’s IdP subject, from the token’s `sub` claim. +`x-claude-gateway-user-email`| The developer’s email, when the IdP supplied one. + +When the IdP token carries no email, the gateway sends only `x-claude-gateway-user-id` and omits the two email headers. If your IdP puts the email in a different claim, set `oidc.email_claim` to that claim. Set `forward_user_identity` only on an upstream whose `base_url` is a proxy you operate. The gateway sends developer emails to whatever server that `base_url` names. If the `base_url` is the Anthropic API, which is the default, the gateway refuses to start. #### @@ -374,7 +395,7 @@ ---|---|--- `write_keys`| No| Array of `{id, key}`. An `x-api-key` matching one of these can list, set, and delete spend limits. Key values must be at least 32 characters; `id`s must be unique across `read_keys` and `write_keys`. `read_keys`| No| Array of `{id, key}`. Read-only: every `GET` endpoint, including listing caps, fetching one by ID, and reading [`/effective`](</docs/en/claude-apps-gateway-spend-limits#%2Feffective>) and [`/audit`](</docs/en/claude-apps-gateway-spend-limits#%2Faudit>). -`admin_groups`| No| IdP group names. A gateway JWT whose `groups` claim includes one of these has full admin access, read and write, and audits as `oidc:<sub>`. Use this for human admins; use API keys for machines. +`admin_groups`| No| IdP group names. A gateway JWT whose `groups` claim includes one of these has full admin access, read and write, and audits as `oidc:<sub>`. Use this for human admins; use API keys for machines. An empty entry in this list stops the gateway at boot. See Matcher values that stop the gateway at boot. `blocked_message`| No| Appended verbatim to the `429 billing_error` a blocked developer sees. Write the whole instruction, such as a URL or a Slack channel. When unset, the gateway sends only the default message. See [How enforcement works](</docs/en/claude-apps-gateway-spend-limits#how-enforcement-works>). `audit_retention_days`| No| Default `365`. Older `admin_audit` rows are swept. `spend_retention_months`| No| Default `13`. `spend` counter rows older than this are swept. The default keeps a full year plus the current partial month for year-over-year reporting. @@ -498,6 +519,26 @@ ​ +Matcher values that stop the gateway at boot + +At boot, the gateway checks the `match` block of every policy and the `admin_groups` list. Any of these values stops the gateway with an error that names the field: + + * An empty `groups` list + * An empty entry in `groups` or in `admin_groups` + * An empty `email_domain` + * An `email_domain` that contains `@`, whitespace, or a comma. The gateway trims the value and strips one leading `@` before this check. Write one bare domain, such as `example.com`. + +Before v2.1.232, the gateway started with these values. Each value had this effect: + + * An empty `email_domain`: the gateway skipped the domain check, so a policy with an empty `email_domain` and no `groups` list matched every authenticated user + * An empty `groups` list: the policy matched no one + * An `email_domain` containing `@`, whitespace, or a comma: the policy matched no one + * An empty entry in `groups` or in `admin_groups`: the entry matched a user only when that user’s IdP `groups` claim also contained an empty entry. In `admin_groups`, that match granted admin access. If your `admin_groups` list never contained an empty entry, no one gained admin access this way. + +#### + +​ + What goes in `cli` Each `cli` value is a complete Claude Code `managed-settings.json` document, the same schema you would deploy via MDM or `/etc/claude-code/managed-settings.json`, expressed here as YAML. The CLI applies the delivered document at the managed tier, above user and project settings. The gateway validates each document against the CLI’s settings schema at boot, so an unrecognized top-level key or a recognized key with a malformed value fails boot with an error naming every offending key. Deliberately open parts of the schema still accept arbitrary values, because newer clients may recognize entries the gateway’s schema doesn’t. These open keys are `env`, `pluginConfigs`, and keys nested under `permissions`. Because validation uses the schema bundled with the gateway’s installed version, putting a top-level settings key introduced by a newer Claude Code release into managed config requires upgrading the gateway first. Smoke-test a new policy on one client before rolling it out. The full key reference is in [Claude Code settings](</docs/en/settings#available-settings>). The keys most operators reach for first: @@ -546,6 +587,7 @@ * `hooks` * `env` variables that require the developer’s approval, such as proxy and base-URL variables * shell-execution settings such as `apiKeyHelper` and `statusLine` + * the sandbox binary settings `sandbox.bwrapPath`, `sandbox.socatPath`, and `sandbox.ripgrep` * managed CLAUDE.md content [Approval memory](</docs/en/server-managed-settings#approval-memory>) covers how long an approval lasts and when the dialog appears again. Claude Code applies some delivered `env` variables without showing the developer the approval dialog, such as model selection settings and numeric limits. Other delivered variables can require the developer’s approval before they take effect; a non-empty proxy, base-URL, or `OTEL_EXPORTER_OTLP_ENDPOINT` value always does. When a delivered variable needs approval, the dialog names it. [Environment variables and the approval dialog](</docs/en/server-managed-settings#environment-variables-and-the-approval-dialog>) has the details, including four privacy toggles whose delivered value decides whether they need approval. Before v2.1.218, Claude Code applied fewer variables without asking the developer, so more delivered variables triggered the dialog. The gateway’s telemetry configuration pushes `OTEL_EXPORTER_OTLP_ENDPOINT`, so setting `telemetry.forward_to` triggers the dialog on each interactive client. The dialog protects the developer’s machine from a compromised or hostile gateway, not the organization from the developer. A non-interactive run with the `-p` flag can’t show the dialog. It applies the pushed settings for that run only and doesn’t record them as approved, so the developer’s next interactive session still shows the dialog. Before v2.1.207, a non-interactive run saved the settings as approved and no later interactive session showed the dialog for them. If a developer declines, Claude Code exits rather than applying the policy. Pushing a new hook, or any env var that triggers the dialog, to a broad policy therefore means an approval prompt on every matching developer’s next startup. The `cli` key was named `settings` in earlier releases. That spelling is still accepted as an alias, but new deployments should use `cli`. @@ -623,6 +665,7 @@ * `sandbox.network.allowManagedDomainsOnly` and `sandbox.filesystem.allowManagedReadPathsOnly`: when locked, the corresponding allowlists are unioned across sources * [`allowAllClaudeAiMcps`](</docs/en/settings#available-settings>): allow-only override for the claude.ai MCP server allowlist * `sandbox.bwrapPath` and `sandbox.socatPath`: filesystem paths to the [sandbox](</docs/en/sandboxing>) helper binaries + * [`sandbox.ripgrep`](</docs/en/settings#sandbox-settings>): the `ripgrep` binary the sandbox uses * [`forceRemoteSettingsRefresh`](</docs/en/server-managed-settings>): blocks startup until remote managed settings are freshly fetched, so an MDM or file policy that sets it is honored even when a cached remote payload that lacks the key is the highest-priority source * `env`: each variable comes from the highest-priority admin source that defines it, and lower admin sources fill in variables the higher sources leave unset. The telemetry unit and credential-paired routing variables follow their own rules; see [Per-key exceptions across managed sources](</docs/en/server-managed-settings#per-key-exceptions-across-managed-sources>). Requires Claude Code v2.1.223 or later
modified Claude apps gateway deployment and operations View current →
--- a/claude-apps-gateway-deploy.md +++ b/claude-apps-gateway-deploy.md @@ -209,7 +209,7 @@ ---|---|--- Inference (prompts, completions)| CLI → gateway → your upstream| Only if the Anthropic API is a configured upstream Telemetry (OTLP metrics, plus [opt-in logs and traces](</docs/en/claude-apps-gateway-config#telemetry>))| CLI → gateway → your collector| Never -Identity (email, groups, sub)| IdP → gateway → JWT → CLI; the CLI stamps it on OTLP exports| Never +Identity (email, groups, sub)| IdP → gateway → JWT → CLI; the CLI stamps it on OTLP exports. If you turn on [`forward_user_identity`](</docs/en/claude-apps-gateway-config#per-user-identity-headers-for-a-proxy-you-run>), the gateway also sends the developer’s email and IdP subject as headers to your proxy| Never Managed settings| Your gateway YAML → CLI| Never Audit log| Gateway stderr → your aggregator| Never @@ -292,6 +292,9 @@ Login works locally but fails behind an ALB| `public_url` still names the local or inner `http://` origin, so the IdP gets the wrong `redirect_uri`| Set `listen.public_url` to the external `https://` origin and register `<public_url>/oauth/callback` with the IdP Developer sees the trust prompt repeatedly| TLS cert is rotating per replica or per request| Use a stable cert at the ingress, or terminate TLS once and run replicas over plain HTTP internally CLI `/login`: “Could not verify the gateway’s TLS certificate” or `SELF_SIGNED_CERT_IN_CHAIN`| Gateway’s TLS chain is signed by a private CA not in the CLI host’s trust store| Claude Code reads the OS trust store by default on the native binary and on Node 22.15 or later; [`CLAUDE_CODE_CERT_STORE`](</docs/en/network-config#ca-certificate-store>) controls this behavior. If the CA is installed in the OS trust store, ensure developers are on a current runtime. Otherwise set `NODE_EXTRA_CA_CERTS` to the CA certificate PEM before launching. The first-connect fingerprint prompt still applies. +CLI `/login` completes the browser sign-in, then the session ends with `Cloud gateway sign-in was not completed` and a TLS certificate mismatch| On the first request after sign-in, the gateway presented a certificate that doesn’t match the fingerprint Claude Code pinned, so Claude Code kept no gateway credential. The usual causes are replicas behind one address that serve different certificates, or something on the network path that intercepts TLS.| Serve one certificate for the hostname, for example by terminating TLS once at the ingress, then have the developer run `/login` again. If that certificate differs from the pinned one, Claude Code shows the [trust prompt](</docs/en/claude-apps-gateway#connect-developers>) again with a warning that the certificate changed. + +The mismatch message includes the gateway hostname and the first 16 characters of each fingerprint, the pinned one and the presented one. If Claude Code reports `couldn't load your organization's managed settings` after a gateway sign-in, Claude Code names the reason, restarts in place, and resumes the conversation. If Claude Code can’t restart, for example in a background session, Claude Code ends the session and keeps the sign-in. ##
modified Use Claude Code on the web View current →
--- a/claude-code-on-the-web.md +++ b/claude-code-on-the-web.md @@ -37,7 +37,7 @@ With either method, a cloud session can access any repository the connecting GitHub account can see, not just the repositories the Claude GitHub App is installed on. App installation enables PR webhooks for Auto-fix; it is not a session-level access control. To restrict which repositories your team can reach from cloud sessions, restrict access on GitHub itself, for example by limiting team or repository membership for the connected GitHub accounts. -Either method works. [`/schedule`](</docs/en/routines>) checks for either form of access and prompts you to run `/web-setup` if neither is configured. See [Connect from your terminal](</docs/en/web-quickstart#connect-from-your-terminal>) for the `/web-setup` walkthrough. The GitHub App is required for Auto-fix, which uses the App to receive PR webhooks. If you connect with `/web-setup` and later want Auto-fix, install the App on those repositories. Team and Enterprise Owners can disable `/web-setup` with the Quick web setup toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). +Either method works. [`/schedule`](</docs/en/routines>) checks for either form of access and prompts you to run `/web-setup` if neither is configured. See [Connect from your terminal](</docs/en/web-quickstart#connect-from-your-terminal>) for the `/web-setup` walkthrough. Team and Enterprise Owners can disable `/web-setup` with the Quick web setup toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). Organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled can’t use `/web-setup` or other cloud session features. @@ -81,7 +81,7 @@ claude --cloud "Execute the migration plan in docs/migration-plan.md" -This pattern gives you control over the strategy while letting Claude execute autonomously in the cloud. **Run tasks in parallel** : each `--cloud` command creates its own cloud session that runs independently. You can start multiple tasks and they’ll all run simultaneously in separate sessions: +**Run tasks in parallel** : each `--cloud` command creates its own cloud session that runs independently. You can start multiple tasks and they’ll all run simultaneously in separate sessions: claude --cloud "Fix the flaky test in auth.spec.ts" claude --cloud "Update the API documentation"
modified Claude Code on Claude Platform on AWS View current →
--- a/claude-platform-on-aws.md +++ b/claude-platform-on-aws.md @@ -58,7 +58,7 @@ export ANTHROPIC_AWS_WORKSPACE_ID=wrkspc_01ABCDEFGHIJKLMN export AWS_REGION=us-east-1 -`ANTHROPIC_AWS_WORKSPACE_ID` is required and is sent on every request as the `anthropic-workspace-id` header. Replace the example `wrkspc_01ABCDEFGHIJKLMN` value with your own workspace ID from your Claude Platform on AWS setup. The base URL is computed from `AWS_REGION` as `https://aws-external-anthropic.{region}.api.aws`. To override the URL directly, set `ANTHROPIC_AWS_BASE_URL`. Claude Platform on AWS is opt-in even when AWS credentials are present in your environment. Amazon Bedrock and Microsoft Foundry take precedence in provider routing, so unset `CLAUDE_CODE_USE_BEDROCK` and `CLAUDE_CODE_USE_FOUNDRY` if they’re set. +`ANTHROPIC_AWS_WORKSPACE_ID` is required. Claude Code sends it on every request as the `anthropic-workspace-id` header. Replace the example `wrkspc_01ABCDEFGHIJKLMN` value with your own workspace ID from your Claude Platform on AWS setup. Claude Code computes the base URL as `https://aws-external-anthropic.{region}.api.aws` from the AWS region, which it resolves with the [same precedence as Amazon Bedrock](</docs/en/amazon-bedrock#3-configure-claude-code>). To override the URL directly, set `ANTHROPIC_AWS_BASE_URL`. Claude Platform on AWS is opt-in even when AWS credentials are present in your environment. Amazon Bedrock and Microsoft Foundry take precedence in provider routing, so unset `CLAUDE_CODE_USE_BEDROCK` and `CLAUDE_CODE_USE_FOUNDRY` if they’re set. ###
modified CLI reference View current →
--- a/cli-reference.md +++ b/cli-reference.md @@ -106,7 +106,7 @@ `--no-chrome`| Disable [Chrome browser integration](</docs/en/chrome>) for this session| `claude --no-chrome` `--no-session-persistence`| Disable session persistence so sessions are not saved to disk and cannot be resumed. Print mode only. The [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](</docs/en/env-vars>) environment variable does the same in any mode| `claude -p --no-session-persistence "query"` `--output-format`| Specify output format for print mode (options: `text`, `json`, `stream-json`)| `claude -p "query" --output-format json` -`--permission-mode`| Begin in a specified [permission mode](</docs/en/permission-modes>). Accepts `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, `bypassPermissions`, or `manual` as an alias for `default`. The `manual` alias selects the mode the UI labels Manual and requires Claude Code v2.1.200 or later; `claude --help` lists it in place of `default`, and both values work. Overrides `defaultMode` from settings files| `claude --permission-mode plan` +`--permission-mode`| Begin in a specified [permission mode](</docs/en/permission-modes>). Accepts `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, `bypassPermissions`, or `manual` as an alias for `default`. The `manual` alias selects the permission mode the UI labels Manual and requires Claude Code v2.1.200 or later; `claude --help` lists it in place of `default`, and both values work. Overrides `defaultMode` from settings files. Without this flag or `--dangerously-skip-permissions`, a new session starts in the permission mode described in [which permission mode a session starts in](</docs/en/permission-modes#which-mode-a-session-starts-in>). For `-p`, that’s `default` when nothing is configured| `claude --permission-mode plan` `--permission-prompt-tool`| Specify an MCP tool to handle permission prompts in non-interactive mode. Claude Code waits for that tool’s MCP server to connect before running the first turn, up to the [`MCP_TIMEOUT`](</docs/en/env-vars>) startup timeout, 30 seconds by default. The prompt tool can’t approve an MCP tool marked as [requiring user interaction](</docs/en/mcp#require-approval-for-a-specific-tool>): Claude Code converts an `allow` result for one to a deny. This restriction requires Claude Code v2.1.199 or later| `claude -p --permission-prompt-tool mcp_auth_tool "query"`
modified Configure cloud environments View current →
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -86,8 +86,6 @@ * Set a shared environment as the organization’s default environment at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). * [Pin one to a channel](<https://claude.com/docs/claude-tag/admins/troubleshooting#channel-sessions-use-the-wrong-environment-or-can%E2%80%99t-find-one>) in the Claude Tag admin settings. - -Shared environments add to members’ selectors rather than replacing them. ## @@ -128,7 +126,7 @@ *.internal.example.com registry.example.com -Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network; GitHub traffic and MCP connector traffic don’t go through this allowlist. A leading `*.` matches every subdomain. To keep the Trusted domains too, check **Also include default list of common package managers** ; leave it unchecked to allow only what you list. Each environment has its own allowed-domains list; there’s no organization-level allowlist that admins can push to every member’s environments. [Server-managed settings](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. +Sessions in this environment can now reach `api.example.com`, any subdomain of `internal.example.com`, and `registry.example.com`, and no other domains through the session’s network; GitHub traffic and MCP connector traffic don’t go through this allowlist. A leading `*.` matches every subdomain. To keep the Trusted domains too, check **Also include default list of common package managers** ; leave it unchecked to allow only what you list. If sessions in the environment work with [artifacts](</docs/en/artifacts>), include `*.frame.claudeusercontent.com` in your list. Claude Code fetches artifact content from that host. If you leave it out, Claude can’t read artifacts in sessions that run in the environment. Each environment has its own allowed-domains list; there’s no organization-level allowlist that admins can push to every member’s environments. [Server-managed settings](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. ### @@ -408,7 +406,7 @@ * **Proxy compatibility** : in Anthropic-hosted environments, all outbound traffic passes through a security proxy, and some package managers don’t work correctly with it; Bun is a known example. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic goes through your own network boundary instead. * **Adds startup latency** : hooks run each time a session starts or resumes, unlike setup scripts which benefit from environment caching. Keep install scripts fast by checking whether dependencies are already present before reinstalling. -To persist environment variables for subsequent Bash commands, write to the file at `$CLAUDE_ENV_FILE`. See [SessionStart hooks](</docs/en/hooks#sessionstart>) for details. To customize the base image, use a setup script to install what you need on top of the provided image, or run your own image as a container alongside Claude with `docker compose`. Replacing the base image entirely isn’t supported yet. +To customize the base image, use a setup script to install what you need on top of the provided image, or run your own image as a container alongside Claude with `docker compose`. Replacing the base image entirely isn’t supported yet. ##
modified Commands View current →
--- a/commands.md +++ b/commands.md @@ -1,4 +1,4 @@ -Commands control Claude Code from inside a session. They provide a quick way to switch models, manage permissions, clear context, run a workflow, and more. Type `/` to see the commands available to you, or type `/` followed by letters to filter. A command is only recognized at the start of your message. Text that follows the command name becomes its arguments. As of v2.1.199, [skills](</docs/en/skills#pass-arguments-to-skills>) are the exception: a skill invocation followed by more skills, such as `/skill-a /skill-b do XYZ`, loads every skill named at the start and passes the trailing text to each as arguments. Up to six skills can be chained. If you send a command while Claude is responding, it queues and runs after the current turn finishes. Some commands, such as `/status`, `/tasks`, and `/usage`, run immediately without interrupting the response. +Commands control Claude Code from inside a session. They provide a quick way to switch models, manage permissions, clear context, run a workflow, and more. Type `/` to see the commands available to you, or type `/` followed by letters to filter. A command is only recognized at the start of your message. Text that follows the command name becomes its arguments. As of v2.1.199, [skills](</docs/en/skills#pass-arguments-to-skills>) are the exception: a skill invocation followed by more skills, such as `/skill-a /skill-b do XYZ`, loads every skill named at the start and passes the trailing text to each as arguments. Up to six skills can be chained. If you send a command while Claude is responding, Claude Code queues it and runs it after the current turn finishes. Claude Code runs some commands immediately without interrupting the response, such as `/status`, `/tasks`, and `/usage`. In [fullscreen rendering](</docs/en/fullscreen>), Claude Code also opens dialog commands such as `/theme` and `/help` immediately. Before v2.1.234, Claude Code queued those dialogs until the turn finished. ## @@ -27,7 +27,7 @@ Command| Purpose ---|--- -`/add-dir <path>`| Add a working directory for file access during the current session. Type a partial path to see matching directory suggestions; press `Tab` to accept one. Most `.claude/` configuration is [not discovered](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) from the added directory. A successful add runs your [`DirectoryAdded` hooks](</docs/en/hooks#directoryadded>) +`/add-dir <path>`| Add a working directory for file access during the current session. Type a partial path to see matching directory suggestions; press `Tab` to accept one. Most `.claude/` configuration is [not discovered](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) from the added directory. A successful add runs your [`DirectoryAdded` hooks](</docs/en/hooks#directoryadded>). When you run it while Claude is responding, Claude Code asks you to confirm the directory right away, and once you confirm, Claude’s next tool call in the same turn can access it. Before v2.1.234, Claude Code queued the command until the turn finished `/advisor [model|off]`| Enable or disable the [advisor tool](</docs/en/advisor>), which consults a second model for guidance at key moments during a task. Accepts `fable`, `opus`, `sonnet`, or a full model ID. `fable` requires [Fable 5 access](</docs/en/advisor#choose-an-advisor-model>). Without an argument, opens a picker `/agents`| As of v2.1.198, running `/agents` prints a reminder to ask Claude to create or manage [subagents](</docs/en/sub-agents>), or to edit `.claude/agents/` or `~/.claude/agents/` directly. On v2.1.197 and earlier, opens an interactive interface for creating and managing subagent configurations `/autocompact [auto|<tokens>]`| Set the auto-compact window: how full the context window gets before Claude Code compacts automatically. Pass a size such as `500k`, or `auto` to return to the window tuned for your model. Claude Code saves the value to user settings and applies it to the current session. See [Set the auto-compact window](</docs/en/model-config#set-the-auto-compact-window>) for accepted values and what overrides it. Without an argument, opens a dialog that shows the current window. Requires Claude Code v2.1.221 or later @@ -36,7 +36,7 @@ `/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 run a copy as a separate [background session](</docs/en/agent-view>) instead of switching into it, use `/fork`; to hand a side task to a [subagent](</docs/en/sub-agents>) that reports back into this conversation, use `/subtask` `/btw [question]`| Ask a [side question](</docs/en/interactive-mode#side-questions-with-%2Fbtw>) about the current session without adding to the conversation. If you run `/btw` without a question, Claude Code shows your most recent side question so you can browse earlier answers; if you haven’t asked one yet, Claude Code prints a usage line. Before v2.1.212, `/btw` required a question -`/bug [report]`| Report a bug or share your conversation. You choose how much session history to include and confirm on a consent screen before anything is sent. When you’re signed in to Anthropic on a first-party connection, the report goes to Anthropic; on a third-party provider, or without Anthropic credentials, Claude Code writes the report to a [local archive under `~/.claude/feedback-bundles/`](</docs/en/data-usage#telemetry-services>) that you forward yourself. In the [VS Code extension](</docs/en/vs-code#use-the-prompt-box>), `/bug` opens the extension’s own feedback dialog instead; requires Claude Code v2.1.229 or later. Alias: `/share`. Before v2.1.212, `/bug` and `/share` were aliases of `/feedback` +`/bug [report]`| Report a bug or share your conversation. You choose how much session history to include and confirm on a consent screen before anything is sent. When you’re signed in to Anthropic on a first-party connection, the report goes to Anthropic; on a third-party provider, or without Anthropic credentials, Claude Code writes the report to a [local archive under `~/.claude/feedback-bundles/`](</docs/en/data-usage#telemetry-services>) that you forward yourself. In the [VS Code extension](</docs/en/vs-code#use-the-prompt-box>), `/bug` opens the extension’s own feedback dialog instead; requires Claude Code v2.1.229 or later. When you run it while Claude is responding, Claude Code opens the dialog immediately. Before v2.1.232, Claude Code queued the command until the turn finished. Alias: `/share`. Before v2.1.212, `/bug` and `/share` were aliases of `/feedback` `/cd <path>`| Move this session to a new working directory, keeping the conversation and its prompt cache. Type a partial path to see matching directory suggestions; press `Tab` to accept one. Claude Code prompts you to [trust the workspace](</docs/en/permissions#project-allow-rules-and-workspace-trust>) if you haven’t worked in it before, and `--resume` [finds the moved session](</docs/en/sessions#resume-a-session>) afterward. 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 `/chrome`| Configure [Claude in Chrome](</docs/en/chrome>) settings `/claude-api [migrate|managed-agents-onboard|prompt-audit]`| **[Skill](</docs/en/skills#bundled-skills>).** Load [Claude API](<https://platform.claude.com/docs/en/api/overview>) and Managed Agents reference material for your project’s language. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk`. Run `migrate` to upgrade existing Claude API code to a newer model, `managed-agents-onboard` for a walkthrough that creates a new Managed Agent, or `prompt-audit` to flag instructions written for older models in your prompts, skills, and tool descriptions and propose fixes as a diff. The `prompt-audit` subcommand requires Claude Code v2.1.221 or later @@ -60,7 +60,7 @@ `/exit`| Exit the CLI. In an attached [background session](</docs/en/agent-view#attach-to-a-session>), this detaches and the session keeps running. Alias: `/quit` `/export [filename]`| Export the current conversation as plain text. With a filename, writes directly to that file. Without, opens a dialog to copy to clipboard or save to a file `/fast [on|off]`| Toggle [fast mode](</docs/en/fast-mode>) on or off. Availability in non-interactive mode with `-p` is limited; see [Toggle fast mode](</docs/en/fast-mode#toggle-fast-mode>). Requires Claude Code v2.1.205 or later -`/feedback [report]`| Send product feedback about Claude Code. Opens the same dialog as `/bug` with the same consent step and sending rules +`/feedback [report]`| Send product feedback about Claude Code. Opens the same dialog as `/bug`, with the same consent step, sending rules, and mid-turn behavior `/fewer-permission-prompts`| **[Skill](</docs/en/skills#bundled-skills>).** Scan your transcripts for common read-only Bash and MCP tool calls, then add a prioritized allowlist to project `.claude/settings.json` to reduce permission prompts `/focus`| Toggle the focus view, which shows only your last prompt, a one-line tool-call summary with edit diffstats, and the final response. The tool-call summary also counts the subagents launched in the turn and collapses completed background-task notifications into a single count. The selection persists across sessions; set [`viewMode`](</docs/en/settings#available-settings>) in settings to override it. Only available in [fullscreen rendering](</docs/en/fullscreen>). The [VS Code extension](</docs/en/vs-code#use-the-prompt-box>) offers its own Focus view as a command-menu toggle, stored as an extension setting, independent of `viewMode` `/fork [prompt]`| [Copy the current conversation](</docs/en/agent-view#copy-the-session-with-%2Ffork>) into a new background session and keep working here. Pass a prompt and the copy starts working on it immediately; without one it waits in agent view for its first prompt. Except when the copy [edits in place](</docs/en/agent-view#how-file-edits-are-isolated>), Claude Code instructs it to create a worktree of its own before making code changes; the isolation instruction requires Claude Code v2.1.221 or later. To hand a side task to a subagent whose result comes back into this conversation, use `/subtask`; to switch into a copy yourself, use `/branch`. Requires Claude Code v2.1.212 or later; on v2.1.161 through v2.1.211, and whenever [agent view is turned off](</docs/en/agent-view#turn-off-agent-view>), `/fork` starts a [forked subagent](</docs/en/sub-agents#fork-the-current-conversation>) instead @@ -84,7 +84,7 @@ `/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. Also available in non-interactive mode (`-p`) with a model argument instead of the picker, where it applies to the current session only and isn’t saved as your default; requires Claude Code v2.1.205 or later `/passes`| Share a free week of Claude Code with friends. Only visible if your account is eligible -`/permissions`| Manage allow, ask, and deny rules for tool permissions. Opens an interactive dialog where you can view rules by scope, add or remove rules, manage working directories, and review [recent auto mode denials](</docs/en/auto-mode-config#review-denials>). Alias: `/allowed-tools` +`/permissions`| Manage allow, ask, and deny rules for tool permissions. Opens an interactive dialog where you can view rules by scope, add or remove rules, manage working directories, and review [recent auto mode denials](</docs/en/auto-mode-config#review-denials>). When you run it while Claude is responding, Claude Code opens the dialog immediately and applies your changes starting with Claude’s next tool call in the same turn. Before v2.1.234, Claude Code queued the command until the turn finished. Alias: `/allowed-tools` `/plan [description]`| Enter plan mode directly from the prompt. Pass an optional description to enter plan mode and immediately start with that task, for example `/plan fix the auth bug` `/plugin [subcommand]`| Manage Claude Code [plugins](</docs/en/plugins>). Run with no argument to open the plugin menu, or pass a subcommand such as `list`, `install`, `enable`, or `disable` to act directly. Claude Code can activate a plugin during the install; the [install summary](</docs/en/discover-plugins#install-plugins>) tells you whether it did or whether to run `/reload-plugins` `/powerup`| Discover Claude Code features through quick interactive lessons with animated demos
modified Desktop application View current →
--- a/desktop.md +++ b/desktop.md @@ -82,7 +82,7 @@ **Accept edits**| `acceptEdits`| Claude auto-accepts file edits and common filesystem commands like `mkdir`, `touch`, and `mv`, but still asks before running other terminal commands. Use this when you trust file changes and want faster iteration. **Plan**| `plan`| Claude reads files and runs commands to explore, then proposes a plan without editing your source code. Good for complex tasks where you want to review the approach first. **Auto**| `auto`| Claude executes all actions with background safety checks that verify alignment with your request. Reduces permission prompts while maintaining oversight. Appears when your account meets the availability requirements below; there is no separate Settings toggle for it. -**Bypass permissions**| `bypassPermissions`| Claude runs without permission prompts, except those forced by explicit [ask rules](</docs/en/permissions#manage-permissions>), connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), removals targeting `/` or your home directory, safety classifiers when Claude acts on external sites, or desktop actions where Claude always asks first, such as archiving a session; the CLI’s [cross-session messaging safeguards](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) also still apply. Equivalent to `--dangerously-skip-permissions` in the CLI. On Pro and Max plans, enable it in your Settings → Claude Code under “Allow bypass permissions mode”; on Team and Enterprise plans there is no Settings toggle, and organization policy controls it instead. Only use this in sandboxed containers or VMs. +**Bypass permissions**| `bypassPermissions`| Claude runs without permission prompts, except for the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>), safety classifiers when Claude acts on external sites, or desktop actions where Claude always asks first, such as archiving a session. Equivalent to `--dangerously-skip-permissions` in the CLI. On Pro and Max plans, enable it in your Settings → Claude Code under “Allow bypass permissions mode”; on Team and Enterprise plans there is no Settings toggle, and organization policy controls it instead. Only use this in sandboxed containers or VMs. Earlier versions of the Code tab labeled these modes Ask permissions, Auto accept edits, and Plan mode. The `dontAsk` permission mode is available only in the [CLI](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>). Auto mode is available to all users on the Anthropic API and requires Claude Opus 4.6 or later, Sonnet 4.6 or later, or Fable 5. Organization administrators can turn auto mode off with the `disableAutoMode` key in managed settings. In Enterprise deployments that route Desktop to Google Cloud’s Agent Platform, auto mode is also available by default; see [Auto mode on Bedrock, Agent Platform, or Foundry](</docs/en/permission-modes#enable-auto-mode-on-bedrock-agent-platform-or-foundry>) for the supported models. @@ -392,10 +392,11 @@ Work across sessions -Claude can list your other Code tab sessions, read what each has been doing, and send messages between them. Ask in plain language: “which session touched the auth refactor?”, “what did the API session conclude?”, or “tell the payments session the schema changed”. You can also ask Claude to rename or archive a session. Claude archives a session the same way the sidebar’s archive icon does, so ask it to clean up sessions whose PRs have merged. Through this surface, Claude sees only the sessions the desktop app runs itself: local, SSH, and [WSL](</docs/en/desktop-wsl>) sessions in the Code tab. Claude doesn’t see cloud sessions, or sessions you started from the terminal CLI or the VS Code extension, even in worktrees of the same project, so with nine terminal worktrees open and two desktop sessions, Claude answering in one of them reports the one other desktop session. Claude never lists the session you’re asking from. By default it sees the 20 most recently active sessions and skips archived sessions unless you ask for them. [Cross-session messaging](</docs/en/cross-session-messaging>) separately lets Claude message [your other Claude Code sessions](</docs/en/cross-session-messaging#see-which-sessions-claude-can-reach>), including terminal sessions. When Claude messages another session through this surface, Claude Code shows it there as a card labeled with the sending session’s title and a link back, so you can always tell where a message came from. If the receiving session is mid-task, Claude Code holds the message and Claude reads it once the current work finishes. Claude can’t deliver to an archived session, and tells you when a message doesn’t go through. Claude Code applies three safety behaviors across sessions: +Claude can list your other Code tab sessions, read what each has been doing, and send messages between them. Ask in plain language: “which session touched the auth refactor?”, “what did the API session conclude?”, or “tell the payments session the schema changed”. You can also ask Claude to rename or archive a session. Claude archives a session the same way the sidebar’s archive icon does, so ask it to clean up sessions whose PRs have merged. Through this surface, Claude sees only the sessions the desktop app runs itself: local, SSH, and [WSL](</docs/en/desktop-wsl>) sessions in the Code tab. Claude doesn’t see cloud sessions, or sessions you started from the terminal CLI or the VS Code extension, even in worktrees of the same project, so with nine terminal worktrees open and two desktop sessions, Claude answering in one of them reports the one other desktop session. Claude never lists the session you’re asking from. By default it sees the 20 most recently active sessions and skips archived sessions unless you ask for them. [Cross-session messaging](</docs/en/cross-session-messaging>) separately lets Claude message [your other Claude Code sessions](</docs/en/cross-session-messaging#see-which-sessions-claude-can-reach>), including terminal sessions. When Claude messages another session through this surface, Claude Code shows it there as a card labeled with the sending session’s title and a link back, so you can always tell where a message came from. If the receiving session is mid-task, Claude Code holds the message and Claude reads it once the current work finishes. Claude can’t deliver to an archived session, and tells you when a message doesn’t go through. Claude Code applies four safety behaviors across sessions: * Before archiving any session, Claude asks you first. You see the approval card in every permission mode, including Auto and Bypass permissions. * Through this surface, Claude can’t send cross-session messages from a session nobody is watching, such as a scheduled-task run, and can’t deliver messages into one. + * Claude Code checks each message from this surface against the receiving session’s [inbound controls](</docs/en/cross-session-messaging#control-inbound-messages>). If you set [`crossSessionInbound`](</docs/en/settings#available-settings>) to `refuse` in the receiving session, Claude Code drops messages from this surface. The check runs even when the receiving session doesn’t have [cross-session messaging](</docs/en/cross-session-messaging#availability>) itself. Before v2.1.234, Claude Code dropped every message from this surface to a receiving session without cross-session messaging. * Claude Code quotes each incoming message and attributes it to the session that sent it, and Claude still follows the receiving session’s own permission settings when acting on one. Claude can also suggest new sessions. When it notices something worth fixing that’s out of scope for the current task, it offers the work as a task chip in the chat. Click the chip to start that work in a new session with its own worktree; Claude continues your current session uninterrupted. @@ -769,7 +770,7 @@ * **Cloud sessions** : receive [server-managed settings](</docs/en/server-managed-settings>); device-deployed files don’t reach them, because they run on Anthropic-managed VMs. Sessions routed to a [self-hosted environment](</docs/en/self-hosted-environments>) fall back to the managed settings file in the runner image when server-managed settings deliver no keys, per [settings precedence](</docs/en/server-managed-settings#settings-precedence>). * **SSH sessions** : the session reads the managed settings file from the remote host. Desktop itself reads `sshConfigs` and `sshHostAllowlist` from the local machine’s managed settings when creating the connection. -`permissions.disableBypassPermissionsMode` and `disableAutoMode` also work in user and project settings, but placing them in managed settings prevents users from overriding them. Claude Code reads `autoMode` from user settings, the `--settings` flag, and managed settings, but not from `.claude/settings.json` or `.claude/settings.local.json`: both files live in the repo directory, so a cloned repo or build step can’t inject its own classifier rules. Before v2.1.207, Claude Code also read `.claude/settings.local.json`. For the complete list of managed-only settings including `allowManagedPermissionRulesOnly` and `allowManagedHooksOnly`, see [managed-only settings](</docs/en/permissions#managed-only-settings>). +`permissions.disableBypassPermissionsMode` and `disableAutoMode` also work in user and project settings, but placing them in managed settings prevents users from overriding them. For the complete list of managed-only settings including `allowManagedPermissionRulesOnly` and `allowManagedHooksOnly`, see [managed-only settings](</docs/en/permissions#managed-only-settings>). ### @@ -918,7 +919,6 @@ Feature| CLI| Desktop ---|---|--- Permission modes| All modes including `dontAsk`| Manual, Accept edits, Plan, and Auto. Bypass permissions appears in the mode selector once enabled: through the Settings toggle on Pro and Max plans, or through organization policy on Team and Enterprise plans -`--dangerously-skip-permissions`| CLI flag| Bypass permissions mode. On Pro and Max plans, enable it in Settings → Claude Code → “Allow bypass permissions mode”; on Team and Enterprise plans, organization policy controls it [Third-party providers](</docs/en/third-party-integrations>)| Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry| Anthropic’s API by default. For gateway routing, see [connect the desktop app to a gateway](</docs/en/llm-gateway-connect#desktop-app>). To run the Code tab on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or a self-hosted LLM gateway, see [Claude Desktop on 3P](<https://claude.com/docs/third-party/claude-desktop/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 @@ -940,7 +940,7 @@ 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. To route Desktop through a gateway, see [connect the desktop app to a gateway](</docs/en/llm-gateway-connect#desktop-app>). Enterprise deployments can configure Google Cloud’s Agent Platform and gateway providers via [managed settings](<https://claude.com/docs/third-party/claude-desktop/configuration>). For Amazon Bedrock or Microsoft Foundry in the CLI, see the [quickstart](</docs/en/quickstart>). As an exception to the section above, [Claude Desktop on 3P](<https://claude.com/docs/third-party/claude-desktop/overview>) runs the Code tab on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or a self-hosted LLM gateway. + * **Third-party providers** : Desktop connects to Anthropic’s API by default. To route Desktop through a gateway, or to run the Code tab on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or a self-hosted LLM gateway, follow the links in the Third-party providers row. * **Linux (beta)** : Computer Use isn’t yet available in the Linux desktop app. See [Claude Desktop on Linux](</docs/en/desktop-linux>). * **Inline code suggestions** : Desktop does not provide autocomplete-style suggestions. It works through conversational prompts and explicit code changes. * **Agent teams** : coordinated teams, where Claude as the team lead assigns tasks to teammates from a shared task list, are available in the [CLI](</docs/en/agent-teams>), not in Desktop. For multi-agent work inside one session, use [dynamic workflows](</docs/en/workflows>), which run in Desktop; Claude can also message and manage your other sessions directly.
modified Discover and install prebuilt plugins through marketplaces View current →
--- a/discover-plugins.md +++ b/discover-plugins.md @@ -235,7 +235,13 @@ Add from other Git hosts -Add any git repository by providing the full URL. This works with any Git host, including GitLab, Bitbucket, and self-hosted servers. Include the `.git` suffix so Claude Code clones the repository rather than treating the URL as a direct link to a hosted `marketplace.json` file. Include the `https://` prefix as well. Claude Code v2.1.196 and later reject a host typed without it, such as `gitlab.com/company/plugins.git`, as an invalid GitHub `owner/repo` shorthand, and the error tells you to add the prefix. Earlier versions misread it as a GitHub repository path and fail at clone time. Using HTTPS: +Add a git marketplace repository by providing its full URL. For an `https://` URL, whether to include the `.git` suffix depends on the host: + + * **`github.com` and `gitlab.com`**: Claude Code recognizes a repository URL with or without the `.git` suffix and clones it. Adding a `gitlab.com` URL without the suffix requires Claude Code v2.1.232 or later. Before v2.1.232, Claude Code treated it as a direct link to a hosted `marketplace.json` file. + * **Azure DevOps** : omit the suffix. Claude Code clones any URL whose path contains `/_git/`. If you append `.git` to a `/_git/` path, the clone fails. + * **Every other host, including self-managed GitLab servers** : include the `.git` suffix so Claude Code clones the repository rather than treating the URL as a direct link to a hosted `marketplace.json` file. For a host whose clone URLs don’t carry the suffix, such as AWS CodeCommit, add the marketplace as a git entry in [`extraKnownMarketplaces`](</docs/en/settings#extraknownmarketplaces>) instead. Claude Code clones a git entry whether or not its URL ends in `.git`. + +Claude Code also clones a `gitlab.com` URL with nested subgroups, such as `https://gitlab.com/group/subgroup/project`. Include the `https://` prefix. Claude Code v2.1.196 and later reject a host typed without it, such as `gitlab.com/company/plugins.git`, as an invalid GitHub `owner/repo` shorthand, and the error tells you to add the prefix. Earlier versions misread it as a GitHub repository path and fail at clone time. Using HTTPS: /plugin marketplace add https://gitlab.com/company/plugins.git @@ -243,7 +249,7 @@ /plugin marketplace add git@gitlab.com:company/plugins.git -To add a specific branch or tag, append `#` followed by the ref: +Claude Code clones an SSH address whether or not it ends in `.git`. To add a specific branch or tag, append `#` followed by the ref: /plugin marketplace add https://gitlab.com/company/plugins.git#v1.0.0 @@ -291,12 +297,13 @@ To install without an interactive step, use the [`claude plugin install`](</docs/en/plugins-reference#plugin-install>) shell command, which installs to user scope unless you pass `--scope`. For a plugin with a [`command` source](</docs/en/plugin-marketplaces#how-users-accept-the-command>), pass `--yes` to accept the command it displays. You may also see plugins with **managed** scope. These are installed by administrators via [managed settings](</docs/en/settings#settings-files>) and can’t be modified. Claude Code looks the plugin up in its local copy of the marketplace catalog. How you name the plugin controls whether Claude Code refreshes that copy first: - * **With a marketplace name** : when you install `plugin-name@marketplace-name`, in a session or with `claude plugin install`, Claude Code refreshes that marketplace before the lookup, whether or not you turned on auto-update for it and even if you set `DISABLE_AUTOUPDATER`. Before v2.1.232, Claude Code didn’t refresh the marketplace before the lookup. Claude Code skips this refresh in four cases: + * **With a marketplace name** : when you install `plugin-name@marketplace-name`, in a session or with `claude plugin install`, Claude Code refreshes that marketplace before the lookup. Claude Code runs the refresh even if you turned off auto-update for the marketplace or set `DISABLE_AUTOUPDATER`. Before v2.1.232, Claude Code didn’t refresh the marketplace before the lookup. Claude Code skips this refresh when: * The marketplace wasn’t added from GitHub, another Git host, or a remote URL. * A [seed directory](</docs/en/plugin-marketplaces#pre-populate-plugins-for-containers>) supplies the marketplace. * Claude Code refreshed the marketplace within the last 30 seconds. * You set [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>). - * **Plugin name only** : when you run `/plugin install plugin-name` in a session, Claude Code refreshes only the marketplaces it also updates in the background, and only after the lookup misses. `claude plugin install plugin-name` reads the cached catalogs without refreshing. To install a plugin that was published after your last refresh, run `/plugin marketplace update <marketplace-name>` in a session or [`claude plugin marketplace update <marketplace-name>`](</docs/en/plugin-marketplaces#plugin-marketplace-update>) in your shell, then retry the install. + * [Managed settings](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) block the marketplace, in which case Claude Code also refuses the install. + * **Plugin name only** : when you run `/plugin install plugin-name` in a session, Claude Code refreshes only the marketplaces it also updates in the background, and only after the lookup misses. When you run `claude plugin install plugin-name`, Claude Code reads the cached catalogs without refreshing. To install a plugin that was published after your last refresh, run `/plugin marketplace update <marketplace-name>` in a session or [`claude plugin marketplace update <marketplace-name>`](</docs/en/plugin-marketplaces#plugin-marketplace-update>) in your shell, then retry the install. If the refresh before a named install fails, for example because you’re offline, Claude Code looks the plugin up in the cached catalog anyway. `claude plugin install` reports `marketplace not refreshed` in its success message, and `/plugin install` shows the failure above the plugin’s details or in its not-found message. When you install from the `/plugin` interface, the install summary tells you whether the plugin is active in your current session:
modified Environment variables View current →
--- a/env-vars.md +++ b/env-vars.md @@ -116,7 +116,7 @@ `ANTHROPIC_API_KEY`| API key sent as `X-Api-Key` header. When set, this key is used instead of your Claude Pro, Max, Team, or Enterprise subscription even if you are logged in. In non-interactive mode (`-p`), the key is always used when present. In interactive mode, you are prompted to approve the key once before it overrides your subscription. To use your subscription instead, run `unset ANTHROPIC_API_KEY` `ANTHROPIC_AUTH_TOKEN`| Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) `ANTHROPIC_AWS_API_KEY`| Workspace API key for [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), generated in the AWS Console. Sent as `x-api-key` and takes precedence over AWS SigV4 -`ANTHROPIC_AWS_BASE_URL`| Override the [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) endpoint URL. Use for custom regions or when routing through an [LLM gateway](</docs/en/llm-gateway>). Defaults to `https://aws-external-anthropic.{AWS_REGION}.api.aws` +`ANTHROPIC_AWS_BASE_URL`| Override the [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) endpoint URL. Use for custom regions or when routing through an [LLM gateway](</docs/en/llm-gateway>). Defaults to `https://aws-external-anthropic.{region}.api.aws`. Claude Code resolves the region with the [same precedence as on Amazon Bedrock](</docs/en/amazon-bedrock#3-configure-claude-code>) `ANTHROPIC_AWS_WORKSPACE_ID`| Required for [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). Sent on every request as the `anthropic-workspace-id` header `ANTHROPIC_BASE_URL`| Override the API endpoint to route requests through a proxy or gateway. When set to a non-first-party host, [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>) is disabled by default. Set `ENABLE_TOOL_SEARCH=true` if your proxy forwards `tool_reference` blocks. As of v2.1.196, [Remote Control](</docs/en/remote-control#requirements>) is disabled when this points at a host other than `api.anthropic.com`, matching its behavior on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry `ANTHROPIC_BEDROCK_BASE_URL`| Override the Amazon Bedrock endpoint URL. Use for custom Amazon Bedrock endpoints or when routing through an [LLM gateway](</docs/en/llm-gateway>). See [Amazon Bedrock](</docs/en/amazon-bedrock>) @@ -173,6 +173,7 @@ `CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS`| Stall timeout in milliseconds for background subagents. Default `600000` (10 minutes). The timer resets on each streaming progress event; if no progress arrives within the window, the subagent is aborted and the task is marked failed, surfacing any partial result to the parent `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`| Set the percentage (1-100) of the auto-compact window at which auto-compaction triggers. Use lower values like `50` to compact earlier; the variable can’t raise the threshold, so values above the default percentage are ignored. It applies only in sessions that [compact before the model’s context limit](</docs/en/model-config#context-window-and-auto-compaction>). Applies to both main conversations and subagents `CLAUDE_AUTO_BACKGROUND_TASKS`| Set to `1` to force-enable automatic backgrounding of long-running agent tasks. When enabled, subagents are moved to the background after running for approximately two minutes. Also enables [automatic backgrounding of long MCP tool calls](</docs/en/mcp#automatic-backgrounding-of-long-tool-calls>) in non-interactive mode on Claude Code v2.1.212 or later +`CLAUDE_AX_PREPARK_MS`| In [screen reader mode](</docs/en/accessibility#what-your-screen-reader-hears>), how many milliseconds Claude Code waits, with the cursor at the start of the line, before it writes a new or changed line. Default `50`. Set `0` to write immediately. Claude Code caps the wait at `5000`. Requires Claude Code v2.1.233 or later `CLAUDE_AX_SCREEN_READER`| Set to `1` to render screen-reader friendly output: flat text without decorative borders or animations. Set to `0` to force screen-reader mode off even when [`axScreenReader`](</docs/en/settings#available-settings>) is `true`. The [`--ax-screen-reader`](</docs/en/cli-reference#cli-flags>) flag takes precedence. Requires Claude Code v2.1.181 or later `CLAUDE_AX_STARTUP_QUIET_MS`| In [screen reader mode](</docs/en/accessibility>), how many milliseconds Claude Code holds the first interface render after the startup confirmation line, so your screen reader can speak the line in full before new output interrupts it. Default `3000`. Set `0` to render immediately. Claude Code caps the hold at `600000` (10 minutes). Your first keystroke ends the hold early. Requires Claude Code v2.1.217 or later `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR`| Return to the original working directory after each Bash or PowerShell command in the main session @@ -254,7 +255,7 @@ `CLAUDE_CODE_FORCE_SESSION_PERSISTENCE`| Set to `1` to force transcript persistence, prompt history, and `claude agents` registration even when this `claude` was launched from inside another Claude Code session. Use when an inherited `CLAUDE_CODE_CHILD_SESSION` value, for example from a `screen` session or a background launcher first started by Claude Code’s Bash tool, causes a genuine top-level session to be misclassified as nested. As of v2.1.178, Claude Code detects the tmux case automatically and ignores the inherited marker, so tmux no longer needs this variable. Also honored on v2.1.169 and earlier; has no effect on v2.1.170 and v2.1.171, where the nested-session detection it overrides was removed `CLAUDE_CODE_FORCE_STRIKETHROUGH`| Set to `1` to force strikethrough rendering for `~~text~~` in Claude’s responses when your terminal supports it but is not auto-detected, such as over SSH without `TERM_PROGRAM` forwarded. Without this, undetected terminals show the literal `~~` markers instead of rendering the text as strikethrough. Requires Claude Code v2.1.186 or later `CLAUDE_CODE_FORCE_SYNC_OUTPUT`| Set to `1` to force-enable DEC private mode 2026 [synchronized output](<https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036>) when your terminal supports it but is not auto-detected. Useful for emulators such as Emacs `eat` that implement BSU/ESU but do not reply to the capability probe. Has no effect under tmux. Unlike `CLAUDE_CODE_NO_FLICKER`, which switches to [fullscreen rendering](</docs/en/fullscreen>), this doesn’t change the renderer -`CLAUDE_CODE_FORK_SUBAGENT`| Controls [fork mode](</docs/en/sub-agents#turn-fork-mode-on-or-off>), which lets Claude spawn [forked subagents](</docs/en/sub-agents#fork-the-current-conversation>) itself and is on by default in interactive sessions only. Set to `1` to turn it on in `claude -p` and the Agent SDK as well, or `0` to turn it off in every kind of session. The `/subtask` command works whether or not fork mode is on. The interactive default requires Claude Code v2.1.232 or later +`CLAUDE_CODE_FORK_SUBAGENT`| Controls [fork mode](</docs/en/sub-agents#turn-fork-mode-on-or-off>), which lets Claude spawn [forked subagents](</docs/en/sub-agents#fork-the-current-conversation>) itself and is on by default in interactive sessions only. Set to `1` to turn it on in `claude -p` and the Agent SDK as well, or `0` to turn it off in every kind of session. You can run `/subtask` whether or not fork mode is on. The interactive default requires Claude Code v2.1.232 or later; on earlier versions, set the variable to `1` to turn fork mode on `CLAUDE_CODE_FORWARD_SUBAGENT_TEXT`| Set to `1` to emit [subagent](</docs/en/sub-agents>) text and thinking blocks in `claude -p --output-format stream-json` output, the same behavior as the [`--forward-subagent-text`](</docs/en/cli-reference#cli-flags>) flag. Use the variable when a harness invokes `claude` and can’t pass the flag itself. Unlike the flag, which exits with an error outside non-interactive mode with stream-json output, the variable is ignored there so that nested invocations keep working when it’s set process-wide. Requires Claude Code v2.1.211 or later `CLAUDE_CODE_GIT_BASH_PATH`| Windows only: path to the Git Bash executable (`bash.exe`). Use when Git Bash is installed but not in your PATH. If the path doesn’t exist or the file isn’t named `bash.exe`, `sh.exe`, `bash`, or `sh`, Claude Code ignores the variable and auto-detects Git Bash as if it were unset, logging a warning visible with `--debug`. Before v2.1.219, Claude Code exited at startup when the path didn’t exist, and used any existing file as the shell without checking that it was bash or sh. See [Windows setup](</docs/en/setup#set-up-on-windows>) `CLAUDE_CODE_GLOB_HIDDEN`| Set to `false` to exclude dotfiles from results when Claude invokes the [Glob tool](</docs/en/tools-reference#glob-tool-behavior>). Included by default. Does not affect `@` file autocomplete, `ls`, Grep, or Read @@ -392,7 +393,7 @@ `ENABLE_TOOL_SEARCH`| Controls [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>). Unset, Claude Code defers all MCP tools by default. It still loads them upfront on Google Cloud’s Agent Platform models earlier than the Claude 4.5 generation, on a Microsoft Foundry deployment hosted on Azure, and when `ANTHROPIC_BASE_URL` points to a non-first-party host. `true` always defers and sends the beta header, except on those same Agent Platform models and Microsoft Foundry deployments; requests fail on proxies that don’t support `tool_reference`. `auto` loads upfront when tool definitions fit within 10% of context. `auto:N` sets a custom threshold, such as `auto:5` for 5%. `false` loads all tools upfront. A value you set yourself is ignored when `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` is set. Before v2.1.221, Claude Code disabled tool search for all models on Google Cloud’s Agent Platform unless you set this variable to `true` `FALLBACK_FOR_ALL_PRIMARY_MODELS`| Set to any non-empty value, such as `1`, to make every model stop retrying with a repeated-overload error when no fallback model is configured. **Setting it to`0` or `false` still enables this**, unlike most on/off variables; unset the variable to restore the default retry behavior. Without it, models Claude Code recognizes as Opus, Fable 5, or Mythos models stop retrying this way when you authenticate with an API key or a [third-party provider](</docs/en/third-party-integrations>) rather than a Claude subscription. 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_HYPERLINK`| Set to `1` to enable clickable OSC 8 hyperlinks when your terminal supports them but isn’t auto-detected, or `0` to disable them. When unset, Claude Code enables hyperlinks only when it detects terminal support. Claude Code parses this value as a number, not a Boolean, so a value such as `false`, `no`, or `off` enables hyperlinks rather than disabling them. Claude Code renders the footer PR badge as a hyperlink even when it can’t detect terminal support, such as over SSH. Set `0` to render the badge as plain text +`FORCE_HYPERLINK`| Set to `1` to enable clickable OSC 8 hyperlinks when your terminal supports them but isn’t auto-detected, or `0` to disable them. When unset, Claude Code enables hyperlinks only when it detects terminal support. Claude Code parses this value as a number, not a Boolean, so a value such as `false`, `no`, or `off` enables hyperlinks rather than disabling them. Claude Code renders the footer [PR or merge request badge](</docs/en/interactive-mode#pr-review-status>) as a hyperlink even when it can’t detect terminal support, such as over SSH. Set `0` to render the badge as plain text `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 `HTTPS_PROXY`| Specify HTTPS proxy server for network connections @@ -461,6 +462,7 @@ * Use [the advisor tool](</docs/en/advisor#requirements>) * Let [Claude choose the `/loop` interval](</docs/en/scheduled-tasks#let-claude-choose-the-interval>); Claude Code runs a `/loop` prompt with no interval on the fixed 10-minute schedule instead * Run [the built-in `/loop` maintenance prompt](</docs/en/scheduled-tasks#run-the-built-in-maintenance-prompt>); Claude Code shows the usage message instead when you run `/loop` with no prompt + * Have Claude Code refresh the [PR review status badge](</docs/en/interactive-mode#pr-review-status>) less often while you’re idle; Claude Code refreshes it every 60 seconds instead With fetching off, you can still type `/code-review` yourself, but [Claude can’t start the review on its own, and a scheduled `/code-review` reaches Claude as plain text](</docs/en/code-review#let-claude-start-the-review>) instead of running the review.
modified Error reference View current →
Show diff (177 lines)
--- a/errors.md +++ b/errors.md @@ -50,11 +50,13 @@ `Claude.ai login expired`| Authentication `Claude.ai login was rejected — run /login, then /remote-control`| Authentication `OAuth token unavailable — run /login to restore Remote Control`| Authentication +`signed-in claude.ai account or organization changed on this machine`| Authentication `OAuth token revoked` / `OAuth token has expired`| Authentication `API Error: 401 Invalid authentication credentials`| Authentication `Login expired · Please run /login`| Authentication `Failed to authenticate: OAuth session expired and could not be refreshed`| Authentication `Anthropic profile login expired · Re-authenticate your Anthropic profile`| Authentication +`Anthropic profile login expired · Run /login to use your claude.ai account instead, or re-authenticate the profile`| Authentication `does not meet scope requirement user:profile`| Authentication `claude.ai rejected the session token` / `session token rejected`| Authentication `AWS credentials expired or invalid`| Authentication @@ -72,6 +74,7 @@ `403` with `x-deny-reason: host_not_allowed` in a cloud or routine session| Network `403` with `This GraphQL query is not enabled for this session` in a cloud session| [GitHub proxy](</docs/en/cloud-environments#github-proxy>) `Couldn't reconnect to your Remote Control session`| Network +`N sessions ended while this machine was offline — the environment was cleaned up on the server and can't be resumed.`| Network `Couldn't share the transcript.`| Network `Prompt is too long` / `Input is too long for requested model`| Request errors `Prompt is too long · automatic compaction failed:`| Request errors @@ -116,6 +119,8 @@ `Your checkout has no branches (detached HEAD only)`| Command-line errors `Failed to resume the conversation`| Command-line errors `No conversation found with session ID: <session-id>`| Command-line errors +`Cannot switch renderers in this session`| Command-line errors +`Cannot switch renderers while work is running in the background`| Command-line errors `Marketplace "<name>" is registered from an untrusted source`| Plugin errors `references ${user_config.*} in a shell-form command`| Plugin errors `Monitor "<name>" from plugin <plugin> references ${user_config.*} in its command`| Plugin errors @@ -379,6 +384,7 @@ Claude Code blocks further requests until the reset time shown in the message. The session and weekly limits are shared across all models, so switching models doesn’t restore access. The Opus limit applies only to Opus requests, so switching to another model with `/model` keeps you working. Usage counts against the session and weekly allowances at the same time. A single burst of heavy activity, such as a large workflow fanout, can exhaust the weekly allowance before the session window resets. **What to do:** * Wait for the reset time shown in the error + * In the Code tab of the [Desktop app](</docs/en/desktop>), the session-limit card shows an **Auto-continue when limits reset** checkbox. The weekly-limit card doesn’t offer it. When it’s checked, the Desktop app retries the interrupted turn after the reset and shows the retry time on the card. Uncheck it to turn this off for your account. * For the Opus limit, run `/model` and switch to another model to keep working * Run `/usage` to see your plan limits and when they reset * Run `/usage-credits` to buy additional usage on Pro and Max, or to request it from your admin on Team and Enterprise. See [usage credits for paid plans](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) for how this is billed. @@ -458,14 +464,14 @@ Credit balance is too low -Your Console organization has run out of prepaid credits. +Your Console organization has run out of prepaid credits, or Claude Code is sending your requests with a Console API key when you meant to use your subscription. Credit balance is too low **What to do:** + * If you have a Pro, Max, Team, or Enterprise plan and see this, run `/status` and check the `API key` row. An approved `ANTHROPIC_API_KEY` in your environment routes requests through that key instead of your subscription. Unset it in the current shell and remove it from your shell profile, then relaunch `claude`. Run `/login` if you haven’t signed in with your subscription yet. * Add credits at [platform.claude.com/settings/billing](<https://platform.claude.com/settings/billing>), and consider enabling auto-reload there so the balance refills before it hits zero - * Switch to subscription authentication with `/login` if you have a Pro, Max, Team, or Enterprise plan * Set per-workspace spend caps in the Console to prevent a single project from draining the org balance. See [Manage costs effectively](</docs/en/costs>). ### @@ -721,6 +727,23 @@ ​ +Remote Control stopped because the signed-in account changed + +Claude Code shows this line during a [Remote Control](</docs/en/remote-control>) session when you sign in to a different claude.ai account or organization on this machine. You made the switch outside the Claude Code session, for example by running `/login` in another terminal. A Remote Control session that you started while signed in through `/login` belongs to the claude.ai account and organization that were signed in at the time. + + Remote Control disconnected — signed-in claude.ai account or organization changed on this machine — run /remote-control to start a session for the current account, or /login to switch back, then /remote-control + +Claude Code stops the Remote Control session as soon as claude.ai confirms that the account or organization changed. Your local session keeps running without Remote Control. **What to do:** + + * Run `/remote-control` to start a new Remote Control session under the current account or organization + * To switch back, run `/login` and sign in to the previous account or organization again. Then run `/remote-control`. + +Before v2.1.234, Claude Code didn’t notice when you switched to a different account or organization outside the Claude Code session. Claude Code kept the Remote Control session connected until a later request to the Remote Control server failed with `Remote Control server rejected the request (HTTP 404)`. That failure could come hours after the switch. + +### + +​ + OAuth token revoked or expired Your saved login is no longer valid. A revoked token means you signed out everywhere or an admin removed access; an expired token means the automatic refresh failed mid-session. Both messages report a rejection the API returned for a request Claude Code sent. When the saved login has already been cleared after a failed refresh, you see Login expired instead. If you authenticate with a long-lived token in [`CLAUDE_CODE_OAUTH_TOKEN`](</docs/en/env-vars>), you see the same messages when that token expires or is revoked. @@ -780,14 +803,15 @@ Anthropic profile login expired -Claude Code is authenticating through an Anthropic credential profile whose saved login credential has expired, and the profile holds no refresh credential Claude Code can use to renew it. Claude Code stops each request locally without retrying, because only re-authenticating the profile produces a working credential. +Claude Code is authenticating through an Anthropic credential profile whose saved login credential has expired, and the profile holds no refresh credential Claude Code can use to renew it. Claude Code stops each request locally without retrying, because a retry would read the same expired credential. Anthropic profile login expired · Re-authenticate your Anthropic profile - -This appears only when the active credential comes from an Anthropic credential profile, one you select with the `ANTHROPIC_PROFILE` environment variable or that Claude Code discovers as the active profile in your Anthropic configuration directory. Sessions that authenticate with `/login`, an API key, a bearer token such as `ANTHROPIC_AUTH_TOKEN`, or a third-party provider never see this message. Running `/login` doesn’t renew the profile credential. Whether a working login can take over instead depends on how the profile was selected: - - * When you set `ANTHROPIC_PROFILE` explicitly, the profile keeps precedence over a saved login, so signing in doesn’t stop the error. - * When Claude Code discovered the profile from your configuration directory, a working `/login` takes precedence over it, and Claude Code authenticates with your claude.ai or Console account instead. + Anthropic profile login expired · Run /login to use your claude.ai account instead, or re-authenticate the profile + +This appears only when the active credential comes from an Anthropic credential profile, one you select with the `ANTHROPIC_PROFILE` environment variable or that Claude Code discovers as the active profile in your Anthropic configuration directory. Sessions that authenticate with `/login`, an API key, a bearer token such as `ANTHROPIC_AUTH_TOKEN`, or a third-party provider never see this message. Running `/login` doesn’t renew the profile credential. Which form you see depends on whether you selected the profile or Claude Code discovered it, and tells you whether a working login can take over instead: + + * When you set `ANTHROPIC_PROFILE` explicitly, the message ends with `Re-authenticate your Anthropic profile`. Claude Code gives the profile precedence over a saved login, so signing in doesn’t stop the error. + * When Claude Code discovered the profile from your configuration directory, the message offers `/login`, because Claude Code gives a working `/login` precedence over the discovered profile and then authenticates with your claude.ai or Console account instead. Before v2.1.234, Claude Code showed the `Re-authenticate your Anthropic profile` form in this case too. **What to do:** @@ -1019,6 +1043,21 @@ ​ +Sessions ended while this machine was offline + +Claude Code shows this message in the terminal running [`claude remote-control`](</docs/en/remote-control#start-a-remote-control-session>) after your machine was offline long enough that the server cleaned up the Remote Control environment your machine was serving. The sessions in that environment ended, and you can’t resume them. The count is the number of sessions that ended. + + 2 sessions ended while this machine was offline — the environment was cleaned up on the server and can't be resumed. + +**What to do:** + + * When Claude Code lists kept worktrees under this message, pick up any uncommitted work from them + * Run `claude remote-control` to start a fresh environment + +### + +​ + Couldn’t share the transcript After you agree to share your session transcript from a survey prompt, such as the [session quality survey](</docs/en/data-usage#session-quality-surveys>), Claude Code uploads it to Anthropic, or saves a local archive instead on third-party providers, on [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, and when no Anthropic credentials are available. This message means the share didn’t complete. @@ -1394,7 +1433,7 @@ Command-line errors -These errors come from the `claude` command line, its subcommands, and commands such as `/security-review` that gather context by running shell commands before their prompt runs. +These errors come from the `claude` command line, its subcommands, and commands such as `/security-review` that gather context by running shell commands before their prompt runs. So do errors from `/tui`, which relaunches the CLI. ### @@ -1668,6 +1707,32 @@ * For an interactive session, open the [session picker](</docs/en/sessions#use-the-session-picker>) with `claude --resume` and press `Ctrl+A` to widen it to every project on this machine, then select the session * Sessions created with `claude -p` or the [Agent SDK](</docs/en/agent-sdk/overview>) don’t appear in the picker, so re-check the ID against the `session_id` your original run printed + +### + +​ + +Cannot switch renderers in this session + +When you switch renderers, Claude Code restarts its process. You ran [`/tui`](</docs/en/fullscreen#enable-fullscreen-rendering>) in a session Claude Code declines to restart, so it doesn’t switch and saves nothing. Which message you see tells you the cause: + + * `Cannot switch renderers while work is running in the background`: you have background work running that a restart would abandon, such as a background shell or a subagent. Wait for the work to finish or stop it with [`/tasks`](</docs/en/commands>), then run `/tui fullscreen` or `/tui default` again + * `Cannot switch renderers in this session`: the session has restrictions Claude Code can’t pass to the restarted process. Before v2.1.234, Claude Code restarted anyway and the relaunched session ran without them + +In the restrictions message, the part in parentheses names the restrictions Claude Code found: + + Cannot switch renderers in this session — it has restrictions a restart can't carry over (permission rules set for this session only). Nothing was changed. Running /tui fullscreen in a session started without them switches every later session too. + +Each reason the message can show in parentheses: + + * `launch flags: a custom system prompt, a tool allowlist, or restricted settings`: you started the session with a flag Claude Code doesn’t pass back to the restarted process. These flags include [`--system-prompt`](</docs/en/cli-reference#cli-flags>), `--system-prompt-file`, `--append-system-prompt-file`, a [`--tools`](</docs/en/cli-reference#cli-flags>) allowlist, [`--setting-sources`](</docs/en/cli-reference#cli-flags>), and [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) + * `permission rules set for this session only`: a [permission update](</docs/en/hooks#permission-update-entries>) from a hook or SDK caller added deny or ask rules with the `session` destination. Session-scoped allow rules don’t trigger the refusal. A restart drops them, and Claude Code prompts again instead + * `ask-before-running rules with no command-line form`: a permission update from a hook or SDK caller added ask rules alongside the rules Claude Code passes back as `--allowed-tools` and `--disallowed-tools`. No flag exists for ask rules + * `permission rules a command line cannot carry intact` and `added directories a command line cannot carry intact`: a permission update added a rule or directory path mid-session. The restarted process’s command line can’t carry its text as the same value + +**What to do:** + + * In a session started without those restrictions, run `/tui fullscreen`, or `/tui default` to switch back. Claude Code saves the [`tui` setting](</docs/en/settings#available-settings>) there and uses it for every later session ## @@ -2102,7 +2167,7 @@ **What to do:** - * Run `claude` in the directory and accept the trust dialog. The dialog appears even when a parent directory is already trusted, lists the rules being held back, and lets you decline and keep working without them. Before v2.1.200, no dialog appeared in that situation, so this step couldn’t be completed there. + * Run `claude` in the directory and accept the trust dialog. [Project allow rules and workspace trust](</docs/en/permissions#project-allow-rules-and-workspace-trust>) says which folder that acceptance covers. * In [non-interactive mode](</docs/en/headless>) with `-p` no dialog is shown. Set the `hasTrustDialogAccepted` entry in `~/.claude.json` using the exact `projects` key the message prints. * If the message names `.claude/settings.local.json` and you started Claude Code outside a git repository or in your home directory, update to v2.1.200 or later. Versions 2.1.196 through 2.1.199 treated your own `.claude/settings.local.json` as repository-supplied in those workspaces. On v2.1.207 and later, updating isn’t enough outside a git repository if you haven’t trusted the folder: determining that a folder isn’t inside a repository runs git, and Claude Code runs that check only after you accept the trust dialog, so use the first step. Your home directory and any other [configuration home](</docs/en/permissions#project-allow-rules-and-workspace-trust>) are exempt and don’t wait for the dialog. See [Project allow rules and workspace trust](</docs/en/permissions#project-allow-rules-and-workspace-trust>).
modified Feature availability View current →
--- a/feature-availability.md +++ b/feature-availability.md @@ -87,7 +87,7 @@ [Server-managed settings](</docs/en/server-managed-settings>)| ✓ (Team and Enterprise)| ✓ (Team and Enterprise)| ✗| ✗| ✗| ✗ [Zero Data Retention](</docs/en/zero-data-retention>)| ✓ (qualified Enterprise accounts)| ✓ (qualified accounts)| See note 4| ✓ (qualified accounts)| See note 4| See note 4 1 On Google Cloud’s Agent Platform, web search is available for Claude 4 models and later. -2 On these providers, auto mode supports only Claude Sonnet 5, Opus 4.7 or later, and Fable 5. See [Auto mode configuration](</docs/en/auto-mode-config>). In v2.1.158 through v2.1.206, auto mode on these providers also required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. +2 On these providers, auto mode supports only Claude Sonnet 5, Opus 4.7 or later, and Fable 5. See [Auto mode configuration](</docs/en/auto-mode-config>). The built-in starting permission mode on these providers is Manual. See [which mode a session starts in](</docs/en/permission-modes#which-mode-a-session-starts-in>). In v2.1.158 through v2.1.206, auto mode on these providers also required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. 3 Explicit intervals such as `/loop every 2 hours` work on every provider. On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, `/loop` cannot pick its own interval or supply the default maintenance prompt, so a prompt with no interval runs every 10 minutes, and `/loop` with no arguments shows the usage message. See [Scheduled tasks](</docs/en/scheduled-tasks>). 4 Subject to your agreement with the cloud provider. 5 Dashboard and API only. [Contribution metrics](</docs/en/analytics#enable-contribution-metrics>) requires a claude.ai Team or Enterprise organization.
modified Extend Claude Code View current →
--- a/features-overview.md +++ b/features-overview.md @@ -209,10 +209,10 @@ **Skills**| Session start + when used| Descriptions at start, full content when used| Low (descriptions every request)* **MCP servers**| Session start| Tool names; full schemas on demand| Low until a tool is used **Code intelligence**| After file edits and on demand| Diagnostics after edits; symbol locations on lookup| Low; reduces file reads elsewhere -**Subagents**| When spawned| Fresh context with specified skills| Isolated from main session +**Subagents**| When spawned| Fresh context with specified skills, or the parent conversation for a [fork](</docs/en/sub-agents#fork-the-current-conversation>)| Isolated from main session **Hooks**| On trigger| Nothing (runs externally)| Zero, unless hook returns additional context -*By default, skill descriptions load at session start so Claude can decide when to use them. Set `disable-model-invocation: true` in a skill’s frontmatter to hide it from Claude entirely until you invoke it manually. This reduces context cost to zero for skills you only trigger yourself. For a skill you didn’t write, set [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) in settings to do the same without editing its file. +*By default, skill descriptions load at session start so Claude can decide when to use them. Set `disable-model-invocation: true` in a skill’s frontmatter to hide it from Claude entirely until you invoke it manually. For a skill you didn’t write, set [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) in settings to do the same without editing its file. ### @@ -257,7 +257,7 @@ * CLAUDE.md and git status, except the built-in Explore and Plan agents [omit both](</docs/en/sub-agents#what-loads-at-startup>) * Whatever context the lead agent passes in the prompt -**Context cost:** Isolated from main session. Subagents don’t inherit your conversation history or invoked skills. +For a [fork](</docs/en/sub-agents#fork-the-current-conversation>), Claude Code loads the parent’s conversation so far, system prompt, and tools instead.**Context cost:** Isolated from main session. Use subagents for work that doesn’t need your full conversation context. Their isolation prevents bloating your main session.
modified Fullscreen rendering View current →
--- a/fullscreen.md +++ b/fullscreen.md @@ -10,7 +10,25 @@ Enable fullscreen rendering -Run `/tui fullscreen` inside any Claude Code conversation. The CLI saves the [`tui` setting](</docs/en/settings#available-settings>) and relaunches into fullscreen with your conversation intact, so you can switch mid-session without losing context. Run `/tui default` to switch back to the classic renderer, or `/tui` with no argument to print which renderer is active. In [screen reader mode](</docs/en/accessibility>), Claude Code always uses the classic renderer except in attached [background sessions](</docs/en/agent-view>), which still render fullscreen. If you run `/tui fullscreen` in any other session, Claude Code prints an explanation instead of switching and doesn’t change the saved `tui` setting. The relaunched session keeps the conversation as it appears on screen. Claude Code also carries over the model you last picked with [`/model`](</docs/en/model-config#setting-your-model>). If you ran [`/rewind`](</docs/en/checkpointing#rewind-and-summarize>) earlier in the session, the relaunch resumes from the rewound point rather than the longer transcript saved on disk. If you rewound to before your first message, the relaunched session starts empty. You can also set the `CLAUDE_CODE_NO_FLICKER` environment variable before starting Claude Code: +Run `/tui fullscreen` inside any Claude Code conversation. The CLI saves the [`tui` setting](</docs/en/settings#available-settings>) and relaunches into fullscreen with your conversation intact, so you can switch mid-session without losing context. Run `/tui default` to switch back to the classic renderer, or `/tui` with no argument to print which renderer is active. In [screen reader mode](</docs/en/accessibility>), Claude Code always uses the classic renderer except in attached [background sessions](</docs/en/agent-view>), which still render fullscreen. If you run `/tui fullscreen` in any other session, Claude Code prints an explanation instead of switching and doesn’t change the saved `tui` setting. Claude Code carries these into the relaunched session: + + * The conversation as it appears on screen. After a [`/rewind`](</docs/en/checkpointing#rewind-and-summarize>), that means: + * If you rewound earlier in the session, Claude Code relaunches from the rewound point, not from the longer transcript saved on disk. For example, if you rewound past your last three messages, the relaunched session opens without them + * If you rewound to before your first message, Claude Code relaunches with an empty conversation + * Your [permission mode](</docs/en/permission-modes>) and [effort level](</docs/en/model-config#adjust-effort-level>) + * The model you last picked with [`/model`](</docs/en/model-config#setting-your-model>) + * Rules you passed with [`--allowed-tools` or `--disallowed-tools`](</docs/en/cli-reference#cli-flags>) + +Claude Code declines to relaunch if the session has a restriction it can’t pass to the restarted process. Restrictions it can’t pass include: + + * Launch flags such as a [`--system-prompt`](</docs/en/cli-reference#cli-flags>) replacement, a [`--tools`](</docs/en/cli-reference#cli-flags>) allowlist, or [`--setting-sources`](</docs/en/cli-reference#cli-flags>) + * Deny or ask rules that a [hook or SDK permission update](</docs/en/hooks#permission-update-entries>) added for this session only + +In that case Claude Code prints [`Cannot switch renderers in this session`](</docs/en/errors#cannot-switch-renderers-in-this-session>) with the reasons. It doesn’t switch or save anything. + +If you first used Claude Code before May 6, 2026 and haven’t saved a `tui` setting, Claude Code may open a dialog at startup offering the switch. If you accept, Claude Code saves the setting and relaunches the same way `/tui fullscreen` does, carrying the same session state. + +You can also set the `CLAUDE_CODE_NO_FLICKER` environment variable before starting Claude Code: CLAUDE_CODE_NO_FLICKER=1 claude
modified Glossary View current →
--- a/glossary.md +++ b/glossary.md @@ -60,7 +60,7 @@ 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. 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 instead of you, so Claude Code runs most of them without asking you. Claude Code still asks you before actions your explicit ask rules match. On Pro, Max, and Team plans, auto mode is the [built-in starting permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>) for interactive terminal and VS Code sessions. The classifier blocks scope escalation, untrusted infrastructure, and prompt injection. It never sees tool results, so injected instructions can’t influence its decisions. Learn more: [Eliminate prompts with auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) ##
modified Claude Code on Google Cloud's Agent Platform View current →
--- a/google-vertex-ai.md +++ b/google-vertex-ai.md @@ -134,7 +134,12 @@ export VERTEX_REGION_CLAUDE_HAIKU_4_5=us-east5 export VERTEX_REGION_CLAUDE_4_6_SONNET=europe-west1 -Most model versions have a corresponding `VERTEX_REGION_CLAUDE_*` variable. See the [Environment variables reference](</docs/en/env-vars>) for the full list. Check [Google Cloud’s Agent Platform Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>) to determine which models support global endpoints versus regional only. [Prompt caching](</docs/en/prompt-caching>) is enabled automatically. To disable it, set `DISABLE_PROMPT_CACHING=1`. To request a 1-hour cache TTL instead of the 5-minute default, set `ENABLE_PROMPT_CACHING_1H=1`; cache writes with a 1-hour TTL are billed at a higher rate. For heightened rate limits, contact Google Cloud support. When using Google Cloud’s Agent Platform, the `/logout` command is unavailable since authentication is handled through Google Cloud credentials. Claude Code decides between [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>) and upfront loading by model generation: +Most model versions have a corresponding `VERTEX_REGION_CLAUDE_*` variable. See the [Environment variables reference](</docs/en/env-vars>) for the full list. Check [Google Cloud’s Agent Platform Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>) to determine which models support global endpoints versus regional only. If a region value isn’t shaped like a region or location name, Claude Code treats it as unset. For example, Claude Code treats a value containing a slash, dot, or space as unset. Claude Code falls back to a different source for each variable: + + * `VERTEX_REGION_CLAUDE_*`: Claude Code falls back to `CLOUD_ML_REGION`. + * `CLOUD_ML_REGION`: Claude Code falls back to `us-east5`. + +[Prompt caching](</docs/en/prompt-caching>) is enabled automatically. To disable it, set `DISABLE_PROMPT_CACHING=1`. To request a 1-hour cache TTL instead of the 5-minute default, set `ENABLE_PROMPT_CACHING_1H=1`; cache writes with a 1-hour TTL are billed at a higher rate. For heightened rate limits, contact Google Cloud support. When using Google Cloud’s Agent Platform, the `/logout` command is unavailable since authentication is handled through Google Cloud credentials. Claude Code decides between [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>) and upfront loading by model generation: * **Claude Opus 4.5, Sonnet 4.5, Haiku 4.5, and later** : Claude Code enables tool search by default. * **Earlier models, including all Claude 3.x models** : Claude Code loads MCP tool definitions upfront, because their Agent Platform serving stacks reject the required beta header. Setting `ENABLE_TOOL_SEARCH=true` doesn’t override this.
modified Run Claude Code programmatically View current →
--- a/headless.md +++ b/headless.md @@ -236,7 +236,13 @@ claude -p "Run the test suite and fix any failures" \ --allowedTools "Bash,Read,Edit" -To set a baseline for the whole session instead of listing individual tools, pass a [permission mode](</docs/en/permission-modes>). `dontAsk` denies anything not in your `permissions.allow` rules or the [read-only command set](</docs/en/permissions#read-only-commands>), which is useful for locked-down CI runs. `AskUserQuestion`, connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), and MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) are denied even when an allow rule matches. `acceptEdits` lets Claude write files without prompting and also auto-approves common filesystem commands such as `mkdir`, `touch`, `mv`, and `cp`. Apart from the [read-only command set](</docs/en/permissions#read-only-commands>), other shell commands and network requests still need an `--allowedTools` entry or a `permissions.allow` rule. See [what `acceptEdits` auto-approves](</docs/en/permission-modes#auto-approve-file-edits-with-acceptedits-mode>) for the full list. This example applies lint fixes with `acceptEdits` as the baseline: +To set a baseline for the whole session instead of listing individual tools, pass a [permission mode](</docs/en/permission-modes>). For `-p`, the [built-in starting permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>) is Manual on every plan, so pass the permission mode you want: + + * **`auto`** : pass `--permission-mode auto` to have a classifier review most actions instead of you + * **`dontAsk`** : Claude Code denies anything not in your `permissions.allow` rules or the [read-only command set](</docs/en/permissions#read-only-commands>), which is useful for locked-down CI runs. `AskUserQuestion`, connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), and MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) are denied even when an allow rule matches + * **`acceptEdits`** : Claude writes files without prompting, and Claude Code auto-approves common filesystem commands such as `mkdir`, `touch`, `mv`, and `cp`. The [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) still apply. Apart from the read-only command set, other shell commands and network requests still need an `--allowedTools` entry or a `permissions.allow` rule. See [what `acceptEdits` auto-approves](</docs/en/permission-modes#auto-approve-file-edits-with-acceptedits-mode>) for the full list + +This example applies lint fixes with `acceptEdits` as the baseline: claude -p "Apply the lint fixes" --permission-mode acceptEdits
modified Automate actions with hooks View current →
--- a/hooks-guide.md +++ b/hooks-guide.md @@ -630,7 +630,7 @@ `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, `PermissionDenied`| tool name| `Bash`, `Edit|Write`, `mcp__.*` `SessionStart`| how the session started| `startup`, `resume`, `clear`, `compact`, `fork` `Setup`| which CLI flag triggered setup| `init`, `maintenance` -`SessionEnd`| why the session ended| `clear`, `resume`, `logout`, `prompt_input_exit`, `bypass_permissions_disabled`, `other` +`SessionEnd`| why the session ended| `clear`, `resume`, `logout`, `prompt_input_exit`, `other` `Notification`| notification type| `permission_prompt`, `idle_prompt`, `auth_success`, `elicitation_dialog`, `elicitation_url_dialog`, `elicitation_complete`, `elicitation_response`, `agent_needs_input`, `agent_completed` `SubagentStart`| agent type| `general-purpose`, `Explore`, `Plan`, or custom agent names `PreCompact`, `PostCompact`| what triggered compaction| `manual`, `auto`
modified How Claude Code works View current →
--- a/how-claude-code-works.md +++ b/how-claude-code-works.md @@ -136,7 +136,7 @@ Manage context with skills and subagents -Beyond compaction, you can use other features to control what loads into context. [Skills](</docs/en/skills>) load on demand. Claude sees skill descriptions at session start, but the full content only loads when a skill is used. For skills you invoke manually, set `disable-model-invocation: true` to keep descriptions out of context until you need them. For skills you didn’t write, use [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) to do the same from settings. [Subagents](</docs/en/sub-agents>) get their own fresh context, completely separate from your main conversation. Their work doesn’t bloat your context. When done, they return a summary. This isolation is why subagents help with long sessions. See [context costs](</docs/en/features-overview#understand-context-costs>) for what each feature costs, and [reduce token usage](</docs/en/costs#reduce-token-usage>) for tips on managing context. +Beyond compaction, you can use other features to control what loads into context. [Skills](</docs/en/skills>) load on demand. Claude sees skill descriptions at session start, but the full content only loads when a skill is used. For skills you invoke manually, set `disable-model-invocation: true` to keep descriptions out of context until you need them. For skills you didn’t write, use [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) to do the same from settings. [Subagents](</docs/en/sub-agents>) work in their own context window. A subagent starts fresh unless it’s a [fork](</docs/en/sub-agents#fork-the-current-conversation>), which starts with a copy of your conversation so far. Either way, the subagent’s tool calls stay out of your context, and Claude gets back a summary when the subagent finishes. See [context costs](</docs/en/features-overview#understand-context-costs>) for what each feature costs, and [reduce token usage](</docs/en/costs#reduce-token-usage>) for tips on managing context. ## @@ -152,7 +152,7 @@ Undo changes with checkpoints -**File edits are reversible.** Before Claude edits a file, it snapshots the current contents. If something goes wrong, press `Esc` twice to rewind to a previous state, or ask Claude to undo. Checkpoints are separate from git and remain available when you resume a conversation. They only cover file changes, and a restore [skips symlinked and hard-linked files](</docs/en/checkpointing#symlinked-and-hard-linked-paths-not-restored>). Actions that affect remote systems (databases, APIs, deployments) can’t be checkpointed, which is why Claude asks before running commands with external side effects. +**File edits are reversible.** Before Claude edits a file, it snapshots the current contents. If something goes wrong, press `Esc` twice to rewind to a previous state, or ask Claude to undo. Checkpoints are separate from git and remain available when you resume a conversation. They only cover file changes, and a restore [skips symlinked and hard-linked files](</docs/en/checkpointing#symlinked-and-hard-linked-paths-not-restored>). Actions that affect remote systems (databases, APIs, deployments) can’t be checkpointed. You control those with your permission mode and permission rules. ### @@ -160,12 +160,12 @@ Control what Claude can do -Press `Shift+Tab` to cycle through permission modes: - +Choose a permission mode to set what Claude can do without asking you. Press `Shift+Tab` to cycle through the permission modes: + + * **Auto** : a classifier reviews most actions in the background and blocks the risky ones instead of asking you. On Pro, Max, and Team plans, it’s the [built-in starting permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>) for interactive terminal and VS Code sessions * **Manual** : Claude asks before file edits and shell commands * **Accept edits** : Claude edits files and runs common filesystem commands like `mkdir` and `mv` without asking, still asks for other commands * **Plan** : Claude explores and proposes a plan without editing your source files - * **Auto** : Claude evaluates all actions with background safety checks 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. @@ -214,7 +214,7 @@ You can redirect Claude at any point without waiting for the turn to finish or starting over: - * **Press`Esc`** to stop Claude immediately. The running tool call is canceled and Claude waits for your next instruction. + * **Press`Esc`** to stop Claude immediately. The running tool call is canceled and Claude waits for your next instruction. If you have messages queued, Claude Code [sends them next](</docs/en/interactive-mode#queue-messages-while-claude-works>). * **Type a correction and press`Enter`** to send it without stopping the running tool. Claude reads it as soon as the current action completes and adjusts before deciding its next step. ### @@ -250,7 +250,7 @@ Explore before implementing -For complex problems, separate research from coding. Use plan mode (`Shift+Tab` twice) to analyze the codebase first: +For complex problems, separate research from coding. Press `Shift+Tab` until the status bar shows `⏸ plan mode on`, then ask Claude to analyze the codebase first: Read src/auth/ and understand how we handle sessions. Then create a plan for adding OAuth support.
modified Interactive mode View current →
--- a/interactive-mode.md +++ b/interactive-mode.md @@ -27,8 +27,8 @@ `Ctrl+S`| Stash or restore prompt| With text in the input, stashes it and clears the prompt. Pressed again on an empty prompt, restores the stashed text, cursor position, and pasted content `Ctrl+Z`| Suspend Claude Code| Unix only. Suspends the process to your shell; run `fg` to resume `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| 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 -`Esc`| Interrupt Claude, or close a dialog| Stop the current response or tool call mid-turn so you can redirect. Claude keeps the work done so far. When a dialog such as a permission prompt is open, `Esc` closes the dialog rather than interrupting Claude +`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. While you have messages queued, `Up` from the first row instead takes them back +`Esc`| Interrupt Claude, or close a dialog| Stop the current response or tool call mid-turn so you can redirect. Claude keeps the work done so far. If you have messages queued, Claude Code sends them next. When a dialog such as a permission prompt is open, `Esc` closes the dialog rather than interrupting Claude `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` on Windows when the Node or Bun runtime doesn’t enable VT input mode| Cycle permission modes| Cycle through `default` (labeled Manual in the mode indicator), `acceptEdits`, `plan`, and, when available, `bypassPermissions` and then `auto`. From `auto`, the first press switches to `default`. See [permission modes](</docs/en/permission-modes>). `Option+P` (macOS) or `Alt+P` (Windows/Linux)| Switch model| Switch models without clearing your prompt @@ -364,6 +364,35 @@ ​ +Queue messages while Claude works + +Type a message and press `Enter` while Claude is working. Claude Code queues the message instead of interrupting the turn, and lists the queued entries above the input box until it sends them. You can queue `!` shell commands and most [commands](</docs/en/commands>) the same way, apart from the commands, such as `/status`, that Claude Code runs as soon as you send them. + +### + +​ + +When Claude Code sends what you queued + +When a queued entry reaches Claude depends on what you queued. + + * Messages: if you queue a message while Claude is running tool calls, Claude Code passes it to Claude as soon as those tool calls finish, within the same turn. When the turn ends, Claude Code sends the messages that are still queued as the next turn, each as a separate message + * Commands and shell commands: Claude Code holds them until the turn ends, then runs them one at a time + +Press `Esc` to interrupt the turn instead. Claude Code keeps what you queued and sends it right away. + +### + +​ + +Take back what you queued + +Press `Up` from the first line of the input box to take back the queued messages and commands. Claude Code removes them from the queue and puts them in the input box, one per line, ahead of any text you had typed. Edit the text and press `Enter` to queue it again as one entry, or clear the input box to drop it. Claude Code takes back queued shell commands only when the input box is empty and you have nothing else queued, and it switches the input box to shell mode when it does. Otherwise it leaves them in the queue, listed with their `!` prefix, and runs them after the turn ends. + +## + +​ + Prompt suggestions When you first open a session, Claude Code shows a grayed-out example command in the prompt input to help you get started. It picks this from your project’s git history, so the example reflects files you’ve been working on recently. After Claude responds, Claude Code can suggest your next prompt based on your conversation history, such as a follow-up step from a multi-part request or a natural continuation of your workflow. @@ -488,9 +517,34 @@ * Red: changes requested * Gray: draft -The badge disappears once the pull request merges or closes. `Cmd+click` (macOS) or `Ctrl+click` (Windows/Linux) the link to open the pull request in your browser. The status refreshes every 60 seconds, and immediately after a `gh pr` or `git push` command runs in the session. Claude Code renders the badge as a hyperlink even when it can’t detect hyperlink support in your terminal, which commonly happens over SSH or in tmux. Set [`FORCE_HYPERLINK=0`](</docs/en/env-vars>) to render the badge as plain text. - -PR status requires the `gh` CLI to be installed and authenticated (`gh auth login`). +The badge disappears once the pull request merges or closes. `Cmd+click` (macOS) or `Ctrl+click` (Windows/Linux) the link to open the pull request in your browser. How often Claude Code refreshes the status depends on your provider: + + * **Anthropic API with[feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) on**: about every 90 seconds while you’re active in the session, and less often while you’re idle, while your terminal is unfocused, or while Claude Code keeps finding no pull request for the branch + * **Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, Claude Platform on AWS, or feature-flag fetching off** : every 60 seconds + +On either schedule, Claude Code also refreshes as soon as a `git push`, or a `gh pr` command that changes the pull request such as `gh pr create` or `gh pr merge`, succeeds in the session. After an hour without input from you, Claude Code stops refreshing, and your next prompt starts it again. Claude Code renders the badge as a hyperlink even when it can’t detect hyperlink support in your terminal, which commonly happens over SSH or in tmux. Set [`FORCE_HYPERLINK=0`](</docs/en/env-vars>) to render the badge as plain text. + +PR status for GitHub repositories requires the `gh` CLI to be installed and authenticated with `gh auth login`. + +### + +​ + +GitLab merge requests + +When you work on a branch with an open GitLab merge request, Claude Code shows a clickable `MR !N` badge in the footer slot that otherwise holds the GitHub PR link. `!N` is GitLab’s own reference syntax for merge request number N. The colored underline shows the merge request’s state: + + * Green: GitLab reports the merge request as mergeable + * Yellow: any other open state + * Gray: draft + +The badge disappears once the merge request merges or closes. Claude Code checks merge request status on the same schedule as the GitHub badge, and refreshes as soon as a `glab mr create` or `git push` succeeds in the session. To get the badge, you need: + + * Claude Code v2.1.234 or later + * A repository remote that points at your GitLab host, either gitlab.com or a self-managed instance + * The [`glab` CLI](<https://gitlab.com/gitlab-org/cli>) on your `PATH`, authenticated with `glab auth login` + +Claude Code ignores `glab`’s token environment variables, such as `GITLAB_TOKEN`, when it checks status, so you get no badge from an exported token alone. Claude Code also looks for `glab` and for its login once per session, so restart Claude Code after you install `glab` or run `glab auth login`. ##
modified Model configuration View current →
--- a/model-config.md +++ b/model-config.md @@ -133,7 +133,7 @@ * **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, and the model restored when resuming a session * **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list * **Fast mode** : `/fast` refuses to toggle when it would implicitly switch to an Opus model outside the list, with the message “is not in your organization’s allowed models” - * **Subagent and teammate models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammate models including the `teammateDefaultModel` setting, `CLAUDE_CODE_SUBAGENT_MODEL`, and, on v2.1.197 and earlier, the model picker in the `/agents` wizard + * **Subagent and teammate models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammate models, `CLAUDE_CODE_SUBAGENT_MODEL`, and, on v2.1.197 and earlier, the model picker in the `/agents` wizard * **Skill and command models** : the `model` frontmatter in [skills and commands](</docs/en/skills>) * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting and the `--advisor` flag * **Background agent model** : the model selected in the [dispatch picker](</docs/en/agent-view>) @@ -142,10 +142,10 @@ * **`/model`** : Claude Code rejects the switch with an error * **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: Claude Code replaces the value at startup with a warning naming both the requested and substituted models, and the session starts on the default model - * **Subagent or teammate override** : Claude Code falls back to the [subagent’s inherited model](</docs/en/sub-agents#choose-a-model>) or the [default teammate model](</docs/en/agent-teams#specify-teammates-and-models>) rather than failing the request. In interactive sessions, Claude Code warns you when it substitutes a subagent’s model, by this fallback or by the newest-permitted-version substitution above, naming the requested and substituted models; it doesn’t report a teammate’s fallback. When the blocked value is the **Default teammate model** setting itself, Claude Code runs the teammate on your provider’s default Opus model, or on the lead’s model when the allowlist blocks that too. Where the newest-permitted-version substitution above operates, a blocked family alias follows it instead; before v2.1.222, an alias fell back like any other blocked value on every provider + * **Subagent or teammate override** : Claude Code falls back to the [subagent’s inherited model](</docs/en/sub-agents#choose-a-model>) or the [lead’s model for a teammate](</docs/en/agent-teams#specify-teammates-and-models>) rather than failing the request. In interactive sessions, Claude Code warns you when it substitutes a subagent’s model, by this fallback or by the newest-permitted-version substitution above, naming the requested and substituted models; it doesn’t report a teammate’s fallback. Where the newest-permitted-version substitution above operates, a blocked family alias follows it instead; before v2.1.222, an alias fell back like any other blocked value on every provider * **Skill or command override** : Claude Code ignores the override, including a blocked family alias, and the skill or command runs on the session model. A skill or command that [runs in a subagent](</docs/en/skills#run-skills-in-a-subagent>) follows the subagent behavior above instead * **`advisorModel` setting**: the advisor is disabled for the session - * **`--advisor` flag**: Claude Code exits with an error at launch + * **`--advisor` flag**: Claude Code exits with an error at launch. In a [background session](</docs/en/agent-view>), it starts the session without the advisor instead of exiting Claude Code hides excluded models from the `/model` picker. A full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. Model changes that Claude Code makes on your behalf are checked the same way:
modified Enterprise network configuration View current →
--- a/network-config.md +++ b/network-config.md @@ -200,6 +200,7 @@ `storage.googleapis.com`| Native installer and native auto-updater on versions prior to 2.1.116 `registry.npmjs.org`| Plugin installs (fetching npm-source plugin packages and installing plugins’ Node.js package dependencies), `npx`-launched MCP servers, and the package registry for npm and bun installs of Claude Code itself `bridge.claudeusercontent.com`| [Claude in Chrome](</docs/en/chrome>) extension WebSocket bridge +`*.frame.claudeusercontent.com`| [Artifact](</docs/en/artifacts>) content reads. The CLI fetches an artifact’s files from this host when Claude opens one, and only when the Artifact tool is [available](</docs/en/artifacts#availability>) for your account. To disable the tool and drop this requirement, set [`CLAUDE_CODE_DISABLE_ARTIFACT=1`](</docs/en/env-vars>) or the [`disableArtifact`](</docs/en/settings#available-settings>) setting `raw.githubusercontent.com`| Changelog feed for [`/release-notes`](</docs/en/commands>) and the release notes shown after updating `http-intake.logs.us5.datadoghq.com`| Operational telemetry events, sent only when the CLI uses the Anthropic API directly, never for Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. Optional: disable with [`DISABLE_TELEMETRY`](</docs/en/data-usage#telemetry-services>) or `DO_NOT_TRACK` `browser-intake-us5-datadoghq.com`| Operational error reports, sent when the CLI uses the Anthropic API directly and a server-side rollout gate enables them. Optional: disable with `DISABLE_ERROR_REPORTING` or `DISABLE_TELEMETRY`; see [Telemetry services](</docs/en/data-usage#telemetry-services>) @@ -214,7 +215,7 @@ Desktop and claude.ai -The preceding table covers the standalone CLI. The Claude Desktop app and claude.ai in a browser load their application code and user content from additional Anthropic CDN hosts, including `assets-proxy.anthropic.com` and the `*.claudeusercontent.com` origins that serve [artifacts](</docs/en/artifacts>). Allowing `claude.ai` while blocking those hosts produces a blank page rather than an error. See [network access requirements](</docs/en/desktop#network-access-requirements>) on the Desktop page. An [artifact](</docs/en/artifacts>) that loads a typeface from [Google Fonts](</docs/en/artifacts#improve-the-visual-design>) also requests `fonts.googleapis.com` and `fonts.gstatic.com`. Both hosts are optional. If you block them, artifacts render in fallback typefaces. Block with a fast rejection rather than a silent drop so the font request fails immediately instead of delaying the page’s first render. +The preceding table covers the standalone CLI. The Claude Desktop app and claude.ai in a browser load their application code and user content from additional Anthropic CDN hosts, including `assets-proxy.anthropic.com` and the other `*.claudeusercontent.com` origins that serve [artifacts](</docs/en/artifacts>) in those apps. Allowing `claude.ai` while blocking those hosts produces a blank page rather than an error. See [network access requirements](</docs/en/desktop#network-access-requirements>) on the Desktop page. An [artifact](</docs/en/artifacts>) that loads a typeface from [Google Fonts](</docs/en/artifacts#improve-the-visual-design>) also requests `fonts.googleapis.com` and `fonts.gstatic.com`. Both hosts are optional. If you block them, artifacts render in fallback typefaces. Block with a fast rejection rather than a silent drop so the font request fails immediately instead of delaying the page’s first render. ##
modified Choose a permission mode View current →
Show diff (250 lines)
--- a/permission-modes.md +++ b/permission-modes.md @@ -1,4 +1,4 @@ -A permission mode sets which actions Claude can take in a session without asking you first. In Manual mode, Claude Code stops and asks you before most actions that edit files, run shell commands, or reach the network. In auto mode, a second model, the classifier, reviews actions instead of you; how the classifier evaluates actions lists which ones it sees. On Pro, Max, and Team plans, the built-in starting mode is auto mode. Which mode a session starts in covers the surfaces and settings that change the starting mode. You can also change a running session’s permission mode at any time. +A permission mode sets which actions Claude can take in a session without asking you first. In Manual mode, Claude Code stops and asks you before most actions that edit files, run shell commands, or reach the network. In auto mode, a second model, the classifier, reviews actions instead of you; how the classifier evaluates actions lists which actions it reviews and which skip it. On Pro, Max, and Team plans, the built-in starting mode is auto mode. Which mode a session starts in covers the surfaces and settings that change the starting mode. You can also change a running session’s permission mode at any time. ## @@ -17,13 +17,40 @@ `dontAsk`| Only pre-approved tools| Locked-down CI and scripts `bypassPermissions`| Everything| Isolated containers and VMs only -The mode that reviews every action is named **Manual** in the CLI, in `claude --help`, in the VS Code and JetBrains extensions, and in the desktop app. Its config value is `default`, which is what hooks and SDK integrations use. The CLI accepts `manual` as an alias wherever you type the value, for example `claude --permission-mode manual` or `"defaultMode": "manual"`. The Manual label and the `manual` alias require Claude Code v2.1.200 or later. The desktop app’s label doesn’t depend on your CLI version. Writes to protected paths are never auto-approved except in `bypassPermissions` mode and in planning sessions with bypass permissions available. Modes set the baseline. Layer [permission rules](</docs/en/permissions#manage-permissions>) on top to pre-approve or block specific tools. These controls apply in every mode, including `bypassPermissions`: - - * deny rules and explicit ask rules, which apply to every tool but can’t block [`EndConversation`](</docs/en/tools-reference#endconversation-tool-behavior>) while any other tool remains - * the [org `ask` setting on connector tools](</docs/en/mcp#organization-controls-on-connector-tools>) - * the [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) marker - -Allow rules have no effect in `bypassPermissions` because everything else is already approved. +The mode that reviews every action is named **Manual** in the CLI, in `claude --help`, in the VS Code and JetBrains extensions, and in the desktop app. Its config value is `default`, which is what hooks and SDK integrations use. The CLI accepts `manual` as an alias wherever you type the value, for example `claude --permission-mode manual` or `"defaultMode": "manual"`. The Manual label and the `manual` alias require Claude Code v2.1.200 or later. The desktop app’s label doesn’t depend on your CLI version. Writes to protected paths are never auto-approved except in `bypassPermissions` mode and in plan-mode sessions where bypass permissions are available, meaning sessions started in a way that puts `bypassPermissions` in the mode cycle. Modes set the baseline. Layer [permission rules](</docs/en/permissions#manage-permissions>) on top to pre-approve or block specific tools. Deny rules block in every mode, including `bypassPermissions`. Deny and ask rules don’t apply to [`EndConversation`](</docs/en/tools-reference#endconversation-tool-behavior>) as long as Claude still has at least one other tool it can call. Allow rules have no effect in `bypassPermissions`. + +### + +​ + +Actions no mode auto-approves + +Claude Code doesn’t auto-approve the following in any mode, including `bypassPermissions`. Each bullet links to the section that says what happens instead in each mode: + + * Tools matched by an explicit [ask rule](</docs/en/permissions#manage-permissions>) + * Connector tools your organization [set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) + * Tools that require user interaction: the built-in `AskUserQuestion` tool and MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) + * `rm` and `rmdir` removals targeting a critical path, which no allow rule or `PreToolUse` hook `"allow"` approves + * The cross-session messaging safeguards + +## + +​ + +Common setups + +Permission modes decide whether Claude asks before an action, and the [Bash sandbox](</docs/en/sandboxing>) and outer [isolation boundaries](</docs/en/sandbox-environments>) decide what an action can reach once it runs. Each row below pairs a goal with the flags or settings that get you there and the isolation it needs, as a starting point. Available modes lists what runs without a prompt in each mode, and the per-mode section each row links carries the full behavior. + +You want to| Start with| Isolation needed| Notes +---|---|---|--- +Review every action yourself| Manual mode: `claude --permission-mode default`| None| Sensitive work, unfamiliar code +Iterate locally with fewer prompts, without a classifier| Manual mode plus the Bash sandbox in [auto-allow mode](</docs/en/sandboxing#sandbox-modes>): `claude --permission-mode default`, then run `/sandbox` and select auto-allow| The built-in Bash sandbox, on macOS, Linux, and WSL2| Deny rules still apply, and ask rules that name a command, such as `Bash(git push *)`, still prompt. To turn the sandbox on from a settings file instead, set [`sandbox.enabled`](</docs/en/settings#sandbox-settings>) to `true` +Explore before changing anything| `claude --permission-mode plan`| None| Claude Code blocks edits until you approve a plan +Work hands-off with a classifier reviewing each action| `claude --permission-mode auto`, the built-in starting mode on Pro, Max, and Team| None; a sandbox or container adds defense in depth| Requires a supported model, and your organization can turn auto mode off +Run in CI with an exact allowlist| `claude -p "run the test suite" --permission-mode dontAsk --allowedTools "Bash(npm test)" "Read"`| None beyond what your CI runner provides| [Claude Code on the web](</docs/en/claude-code-on-the-web>) ignores `dontAsk` from settings files +Run fully unattended inside a container| `claude -p "<prompt>" --dangerously-skip-permissions`| Required: a container, VM, or the [sandbox runtime](</docs/en/sandbox-environments#sandbox-runtime>); on Linux and macOS, run it as a non-root user| Claude Code on the web ignores this mode from settings files. In this `-p` run, the few calls that would still prompt are denied instead + +The Bash sandbox and auto mode work independently and combine, except in plan mode, where [auto-allow doesn’t widen approvals](</docs/en/sandboxing#sandbox-modes>). For the full interaction, see [How sandboxing relates to permissions and permission modes](</docs/en/sandboxing#how-sandboxing-relates-to-permissions-and-permission-modes>) and [How isolation relates to permission modes](</docs/en/sandbox-environments#how-isolation-relates-to-permission-modes>). ## @@ -48,12 +75,12 @@ A Pro, Max, or Team plan, in a terminal or through the [VS Code extension](</docs/en/vs-code>)| `auto` An Enterprise plan or a Claude Console API key| `default` -When feature-flag fetching is off, or in that first session after an install or upgrade, the VS Code extension also reads no settings file for the starting mode. When any of the three steps selects `auto` but auto mode isn’t available to the session, Claude Code starts the session in Manual instead. Auto mode is unavailable when a settings file turns it off or the model doesn’t support it. The first time the built-in default starts one of your sessions in auto mode, Claude Code shows a notice that links to this page: +In those same two cases, feature-flag fetching off or the first session after an install or upgrade, the VS Code extension ignores every settings file when choosing the starting mode and uses `default`. When the flag, a settings file, or the built-in default selects `auto` but auto mode isn’t available to the session, Claude Code starts the session in Manual instead. Auto mode is unavailable when a settings file turns it off or the model doesn’t support it. The first time the built-in default starts one of your sessions in auto mode, Claude Code shows a notice that links to this page: * In a terminal, once, at the top of the session * In the VS Code extension, as a card on the new-conversation screen that stays until you dismiss it -On Pro, Max, and Team plans, if your `~/.claude/settings.json` sets a different `defaultMode` and no other settings file sets one, your terminal sessions keep starting in that mode, and Claude Code asks once, in the terminal or in the extension, whether to change the setting to auto mode. If you decline, your setting stays as it is. +On Pro, Max, and Team plans, if your `~/.claude/settings.json` sets a `defaultMode` other than `auto` and no other settings file sets one, your sessions keep starting in that mode. Claude Code asks once, in the terminal or in the VS Code extension, whether to change the setting to auto mode. If you decline, your setting stays as it is. ### @@ -98,7 +125,7 @@ * Web and mobile -**During a session** : press `Shift+Tab` to cycle modes. From `auto`, the first press switches to `default`, and the cycle then runs `default` → `acceptEdits` → `plan`. The status bar shows the active mode as a gray `⏸ manual mode on` for `default`, or as `⏵⏵ accept edits on`, `⏸ plan mode on`, `⏵⏵ auto mode on`, `⏵⏵ don't ask on`, or `⏵⏵ bypass permissions on`.Not every mode is in the default cycle: +**During a session** : press `Shift+Tab` to cycle modes. From `auto`, the first press switches to `default`, and the cycle then runs `default` → `acceptEdits` → `plan` → back to `default`. Optional modes, described below, slot in after `plan`. The status bar shows the active mode as a gray `⏸ manual mode on` for `default`, or as `⏵⏵ accept edits on`, `⏸ plan mode on`, `⏵⏵ auto mode on`, `⏵⏵ don't ask on`, or `⏵⏵ bypass permissions on`.Not every mode is in the default cycle: * `auto`: appears when your account meets the auto mode requirements; cycling to it switches modes without a confirmation prompt * `bypassPermissions`: appears after you start with `--permission-mode bypassPermissions`, `--dangerously-skip-permissions`, `--allow-dangerously-skip-permissions`, or `permissions.defaultMode: "bypassPermissions"` in [settings](</docs/en/settings#permission-settings>); the `--allow-` variant adds the permission mode to the cycle without activating it @@ -120,14 +147,14 @@ Auto| `auto` Bypass permissions| `bypassPermissions` -**As a default** : to pin the permission mode conversations start in, set `claudeCode.initialPermissionMode` in your VS Code user settings to `default`, `manual`, `acceptEdits`, `plan`, or `bypassPermissions`, or, for Auto, leave `claudeCode.initialPermissionMode` unset and pick Auto from the mode indicator once. The extension starts each new conversation in the first of these that applies: +**As a default** : to pin the permission mode conversations start in, set `claudeCode.initialPermissionMode` in your VS Code user settings to `default`, `manual`, `acceptEdits`, `plan`, or `bypassPermissions`. The setting doesn’t accept `auto`; to start in Auto, leave it unset and pick **Auto** from the mode indicator once, as item 2 below describes. The extension starts each new conversation in the first of these that applies: 1. `claudeCode.initialPermissionMode` 2. The mode you last picked from the mode indicator, if it was Manual, Edit automatically, or Auto. Picking Plan or Bypass permissions applies to that conversation only 3. `permissions.defaultMode` from [managed settings](</docs/en/permissions#managed-settings>) or `~/.claude/settings.json`, on Pro, Max, and Team plans with feature-flag fetching available 4. The built-in default for your plan, provider, and organization settings -The extension never reads a project’s `.claude/settings.json` or `.claude/settings.local.json` for the starting mode, and in conversations that don’t meet item 3’s conditions it reads no settings file at all. When `claudeCode.claudeProcessWrapper` is set, items 3 and 4 don’t apply either: those conversations start in Manual unless item 1 or item 2 sets a mode.Auto mode appears in the mode indicator when your account meets every requirement listed in the auto mode section. The `claudeCode.initialPermissionMode` setting doesn’t accept `auto`. To start conversations in auto mode where it isn’t the built-in default, leave `claudeCode.initialPermissionMode` unset and select **Auto** from the mode indicator.Bypass permissions requires the **Allow dangerously skip permissions** toggle in the extension settings. Without it, the permission mode doesn’t appear in the indicator, and a `bypassPermissions` value from item 1 or item 3 starts the conversation in Manual instead. Auto from any item likewise starts the conversation in Manual when auto mode isn’t available.See the [VS Code guide](</docs/en/vs-code>) for extension-specific details. +The extension never reads a project’s `.claude/settings.json` or `.claude/settings.local.json` for the starting mode, and in conversations that don’t meet item 3’s conditions it reads no settings file at all. When `claudeCode.claudeProcessWrapper` is set, items 3 and 4 don’t apply either: those conversations start in Manual unless item 1 or item 2 sets a mode.Auto mode appears in the mode indicator when your account meets every requirement listed in the auto mode section.Bypass permissions requires the **Allow dangerously skip permissions** toggle in the extension settings. Without it, the permission mode doesn’t appear in the indicator, and a `bypassPermissions` value from item 1 or item 3 starts the conversation in Manual instead. Auto from any item likewise starts the conversation in Manual when auto mode isn’t available.See the [VS Code guide](</docs/en/vs-code>) for extension-specific details. The JetBrains plugin runs Claude Code in the IDE terminal, so switching modes works the same as in the CLI: press `Shift+Tab` to cycle, or pass `--permission-mode` when launching. @@ -149,7 +176,7 @@ * **Cloud sessions** on [Claude Code on the web](</docs/en/claude-code-on-the-web>): Accept edits, Plan, and Auto. Accept edits corresponds to `default` mode: cloud sessions pre-approve file edits regardless of mode, so the dropdown shows Accept edits instead of Manual. Cloud sessions still honor `defaultMode: "acceptEdits"` from settings. Auto mode appears only when your organization allows it and the selected model supports it. Bypass permissions isn’t available. * **[Remote Control](</docs/en/remote-control>) sessions** on your local machine: Manual, Accept edits, and Plan. You can’t select Auto or Bypass permissions from the app. The dropdown shows the permission mode the local session is in, including a mode set from the terminal, and updates when the permission mode changes in the app or in the terminal. The one exception is Bypass permissions: the session never reports that mode to claude.ai, so switching into it from the terminal doesn’t change what the dropdown shows. Before v2.1.202, sessions connected with `/remote-control` or `claude --remote-control` didn’t report their mode at all, so claude.ai and the mobile app could show a mode the session wasn’t in. The mismatch affected only the label: Claude Code generated permission prompts from the session’s actual mode, and they still appeared in the app for approval. -For Remote Control, the host must be signed in with your claude.ai account; API keys are not supported. You can also set the starting mode when launching the host: +For Remote Control, the local machine running the session must be signed in with your claude.ai account; API keys aren’t supported. You can also set the starting mode when launching that local session: claude remote-control --permission-mode acceptEdits @@ -159,7 +186,7 @@ Auto-approve file edits with acceptEdits mode -`acceptEdits` mode lets Claude create and edit files in your working directory without prompting. The status bar shows `⏵⏵ accept edits on` while this mode is active. In addition to file edits, `acceptEdits` mode auto-approves common filesystem Bash commands: `mkdir`, `touch`, `rm`, `rmdir`, `mv`, `cp`, and `sed`. These commands are also auto-approved when prefixed with safe environment variables such as `LANG=C` or `NO_COLOR=1`, or process wrappers such as `timeout`, `nice`, or `nohup`. Like file edits, auto-approval applies only to paths inside your working directory or `additionalDirectories`. Paths outside that scope, writes to protected paths, and all other Bash commands except the [built-in read-only set](</docs/en/permissions#read-only-commands>) still prompt. When the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) is enabled, `acceptEdits` mode also auto-approves `Set-Content`, `Add-Content`, `Clear-Content`, and `Remove-Item` on in-scope paths, along with their common aliases. The same scope and protected-path rules apply. A positional argument that contains a quote character, such as the apostrophe in `Set-Content .\notes.txt "It's done"`, still prompts even on in-scope paths, because Claude Code can’t statically validate an argument whose quoted and unquoted readings differ. Pass the content through a named parameter such as `-Value` to avoid the prompt. Use `acceptEdits` when you want to review changes in your editor or via `git diff` after the fact rather than approving each edit inline. Press `Shift+Tab` once from Manual mode to enter it, or start with it directly: +`acceptEdits` mode lets Claude create and edit files in your working directory without prompting. The status bar shows `⏵⏵ accept edits on` while this mode is active. In addition to file edits, `acceptEdits` mode auto-approves common filesystem Bash commands: `mkdir`, `touch`, `rm`, `rmdir`, `mv`, `cp`, and `sed`. These commands are also auto-approved when prefixed with safe environment variables such as `LANG=C` or `NO_COLOR=1`, or process wrappers such as `timeout`, `nice`, or `nohup`. Like file edits, auto-approval applies only to paths inside your working directory or `additionalDirectories`. Paths outside that scope, writes to protected paths, `rm` and `rmdir` removals targeting a critical path, and all other Bash commands except the [built-in read-only set](</docs/en/permissions#read-only-commands>) still prompt. When the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) is enabled, `acceptEdits` mode also auto-approves `Set-Content`, `Add-Content`, `Clear-Content`, and `Remove-Item` on in-scope paths, along with their common aliases. The same scope and protected-path rules apply, and `Remove-Item` gets its own check. A positional argument that contains a quote character, such as the apostrophe in `Set-Content .\notes.txt "It's done"`, still prompts even on in-scope paths, because Claude Code can’t statically validate an argument whose quoted and unquoted readings differ. Pass the content through a named parameter such as `-Value` to avoid the prompt. Use `acceptEdits` when you want to review changes in your editor or via `git diff` after the fact rather than approving each edit inline. Press `Shift+Tab` once from Manual mode to enter it, or start with it directly: claude --permission-mode acceptEdits @@ -169,7 +196,7 @@ Analyze before you edit with plan mode -Plan mode tells Claude to research and propose changes without making them. Claude reads files, runs shell commands to explore, and writes a plan, but does not edit your source. Except in sessions with bypass permissions available, edits stay blocked until you approve the plan. When [auto mode](</docs/en/auto-mode-config>) is available and the `useAutoModeDuringPlan` setting is on, which it is by default, the classifier reviews shell commands during planning instead of prompting you. Approved commands run, and rejected ones are blocked. Otherwise, commands outside the [built-in read-only set](</docs/en/permissions#read-only-commands>) prompt for approval, including when the sandbox’s [auto-allow mode](</docs/en/sandboxing#sandbox-modes>) is enabled. Sessions with bypass permissions available skip both paths; that section covers what still prompts there. In sessions without them, commands outside the read-only set prompted either way in v2.1.212 through v2.1.217. Enter plan mode by pressing `Shift+Tab` or prefixing a single prompt with `/plan`. You can also start in plan mode from the CLI: +Plan mode tells Claude to research and propose changes without making them. Claude reads files, runs shell commands to explore, and writes a plan, but does not edit your source. Except in sessions with bypass permissions available, edits stay blocked until you approve the plan. When [auto mode](</docs/en/auto-mode-config>) is available and the `useAutoModeDuringPlan` setting is on, which it is by default, the classifier reviews shell commands during planning instead of prompting you. Approved commands run, and rejected ones are blocked. Otherwise, commands outside the [built-in read-only set](</docs/en/permissions#read-only-commands>) prompt for approval, including when the sandbox’s [auto-allow mode](</docs/en/sandboxing#sandbox-modes>) is enabled. In sessions with bypass permissions available, neither the classifier nor a prompt applies to planning commands; Skip all checks with bypassPermissions mode covers the few things that still prompt there. In v2.1.212 through v2.1.217, sessions without bypass permissions prompted for every command outside the read-only set, whether or not auto mode was available. Enter plan mode by pressing `Shift+Tab` or prefixing a single prompt with `/plan`. You can also start in plan mode from the CLI: claude --permission-mode plan @@ -209,7 +236,7 @@ Eliminate permission prompts with auto mode -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. On Pro, Max, and Team plans, auto mode is the built-in starting mode. The classifier also reviews each message Claude sends to another agent with [`SendMessage`](</docs/en/tools-reference>), plain or structured, before Claude Code delivers it, both in auto mode and in plan mode while the classifier reviews commands; the send review requires Claude Code v2.1.222 or later. The classifier also decides removals targeting the filesystem root or home directory, such as `rm -rf /` and `rm -rf ~`, including when the removal sits inside command or process substitution. Before v2.1.218, the plain forms prompted for approval instead, and the substitution forms prompted in v2.1.208 through v2.1.217. 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 in a mode that still prompts you, 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. On Pro, Max, and Team plans, auto mode is the built-in starting mode. The classifier also reviews each message Claude sends to another agent with [`SendMessage`](</docs/en/tools-reference>), whether plain text or a structured [agent team](</docs/en/agent-teams>) message, before Claude Code delivers it, both in auto mode and in plan mode while the classifier reviews commands; the send review requires Claude Code v2.1.222 or later. The classifier also reviews and approves or blocks `rm` and `rmdir` removals targeting a critical path, such as `rm -rf /` and `rm -rf ~`, including when the removal sits inside command or process substitution. 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 in a mode that still prompts you, set the [Proactive output style](</docs/en/output-styles>) instead. Auto mode reduces permission 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. @@ -291,8 +318,8 @@ Claude Code v2.1.205 and later also block these by default: - * Writing to Claude Code session transcripts, the `.jsonl` history files under `~/.claude/projects/` or your configured config directory, whether directly or through a shell command. The rule also covers the metadata lines Claude Code appends to each transcript entry for its own checks. A transcript is session state that Claude Code writes, not a working file, and a tampered entry reaches every later check once you resume the session, so auto mode blocks these writes as defense in depth. Reading a transcript isn’t blocked - * A recursive forced delete such as `rm -rf "$VAR"` or `Remove-Item -Recurse -Force $dir` whose target is a shell variable, or a glob rooted at one, that isn’t assigned anywhere in the conversation the classifier sees. The value came only from earlier command output, which the classifier never receives, so the classifier can’t verify the deletion target against the other deletion rules. The classifier reads the conversation rather than command output by design, so it blocks the call instead of guessing at the target. The block clears when you name the exact path being deleted, or when Claude re-runs the delete with the resolved literal path written into the command. Deletes whose target the classifier can resolve aren’t affected + * Writing to Claude Code session transcripts, the `.jsonl` history files under `~/.claude/projects/` or your configured config directory, whether directly or through a shell command. The rule also covers the metadata lines Claude Code appends to each transcript entry for its own checks. Reading a transcript isn’t blocked + * A recursive forced delete such as `rm -rf "$VAR"` or `Remove-Item -Recurse -Force $dir` whose target is a shell variable, or a glob rooted at one, that isn’t assigned anywhere in the conversation the classifier sees. The value came only from earlier command output, which the classifier never receives, so the classifier can’t verify the deletion target against the other deletion rules. The block clears when you name the exact path being deleted, or when Claude re-runs the delete with the resolved literal path written into the command. Deletes whose target the classifier can resolve aren’t affected. `Remove-Item` targets that are a bare `*` or end in `/*` or `\*` never reach the classifier: Claude Code denies them outright **Allowed by default** : @@ -313,11 +340,11 @@ Sandbox network access requests are routed through the classifier rather than allowed by default. As of v2.1.198, the classifier reuses its verdict for a network host and port instead of re-running on every connection: * An allow is reused until new content enters the conversation, at which point that host is checked again - * In the interactive CLI, a deny is dropped when the turn ends - * In [non-interactive mode](</docs/en/headless>) and Agent SDK sessions there is no turn boundary, so a deny is reused for the rest of the run + * Claude Code v2.1.234 and later reuse a deny caused by the conversation outgrowing the classifier’s context window until new content enters the conversation, or until [compaction](</docs/en/costs#reduce-token-usage>) shrinks what the classifier reads. Claude Code then checks the host again + * A deny that the classifier reached by evaluating the request lasts for the turn in the interactive CLI. In [non-interactive mode](</docs/en/headless>) and Agent SDK sessions, Claude Code reuses that deny for the rest of the run, because those sessions have no turn boundary * Changing your permission mode or rules drops all cached verdicts -Run `claude auto-mode defaults` to print the full rule lists as JSON. If routine actions get blocked, an administrator can add trusted repos, buckets, and services via the `autoMode.environment` setting: see [Configure auto mode](</docs/en/auto-mode-config>). Pushing to any branch of the repository you’re working in and creating a pull request that matches your request run without a prompt, with the two exceptions the lists above cover. To require a human checkpoint before these actions while staying in auto mode, add `permissions.ask` rules: see [Common boundaries](</docs/en/auto-mode-config#common-boundaries>). +Run `claude auto-mode defaults` to print the full rule lists as JSON. If routine actions get blocked, an administrator can add trusted repos, buckets, and services via the `autoMode.environment` setting: see [Configure auto mode](</docs/en/auto-mode-config>). Pushing to any branch of the repository you’re working in and creating a pull request that matches your request run without a prompt, unless the change would send secrets or sensitive data outside the repository or the pull request targets a different repository or organization, the cases the blocked list covers. To require a human checkpoint before these actions while staying in auto mode, add `permissions.ask` rules: see [Common boundaries](</docs/en/auto-mode-config#common-boundaries>). ### @@ -346,9 +373,9 @@ Each action goes through a fixed decision order. The first matching step wins: - 1. Actions matching your [allow, ask, or deny rules](</docs/en/permissions#manage-permissions>) resolve immediately. Writes to protected paths route to the classifier even when an allow rule matches. Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) and MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) prompt you directly even when an allow rule matches. Content-scoped ask rules fall back to a permission prompt + 1. Actions matching your [allow, ask, or deny rules](</docs/en/permissions#manage-permissions>) resolve immediately. Writes to protected paths route to the classifier even when an allow rule matches, and so do `rm` and `rmdir` removals targeting a critical path in Claude Code v2.1.218 and later. Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) and MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) prompt you directly even when an allow rule matches. Ask rules that match on a command’s content, such as `Bash(git push *)`, fall back to a permission prompt 2. Read-only actions and file edits in your working directory are auto-approved, except writes to protected paths - 3. Everything else goes to the classifier. A connector tool [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) skips the classifier and prompts you directly, so an org-required approval is never auto-approved. As of v2.1.199, an MCP tool marked with [`_meta["anthropic/requiresUserInteraction"]`](</docs/en/mcp#require-approval-for-a-specific-tool>) also skips the classifier and prompts you directly, so a consent step is never auto-approved on the tool author’s behalf + 3. Everything else goes to the classifier, except the org-set-to-`ask` connector tools and `requiresUserInteraction` MCP tools from step 1, which always prompt you directly, so neither an org-required approval nor a consent step is auto-approved 4. If the classifier blocks, Claude receives the reason and tries an alternative. In most sessions the reason is the fixed text `Blocked by classifier` rather than a written explanation, in Claude Code v2.1.208 and later; see [Review denials](</docs/en/auto-mode-config#review-denials>) On entering auto mode, broad allow rules that grant arbitrary code execution are dropped: @@ -380,7 +407,7 @@ Allow only pre-approved tools with dontAsk mode -If you set `dontAsk` mode, Claude Code auto-denies every tool call that would otherwise prompt you. Claude runs only actions matching your `permissions.allow` rules, [read-only Bash commands](</docs/en/permissions#read-only-commands>), and calls approved by a [PreToolUse hook](</docs/en/permissions#extend-permissions-with-hooks>). Use this mode for CI pipelines or restricted environments where you pre-define exactly what Claude may do; the session never waits for input. The status bar shows `⏵⏵ don't ask on` while this mode is active. Claude Code denies calls matching your explicit [`ask` rules](</docs/en/permissions#manage-permissions>) rather than prompting. It also denies the built-in `AskUserQuestion` tool and connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), even if your allow rules match them. It denies MCP tools marked [`_meta["anthropic/requiresUserInteraction"]`](</docs/en/mcp#require-approval-for-a-specific-tool>) the same way, because their approval card needs an answer this mode never collects; this requires Claude Code v2.1.199 or later. 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: +If you set `dontAsk` mode, Claude Code auto-denies every tool call that would otherwise prompt you. Claude runs only actions matching your `permissions.allow` rules, [read-only Bash commands](</docs/en/permissions#read-only-commands>), and calls approved by a [PreToolUse hook](</docs/en/permissions#extend-permissions-with-hooks>). Use this mode for CI pipelines or restricted environments where you pre-define exactly what Claude may do; the session never waits for input. The status bar shows `⏵⏵ don't ask on` while this mode is active. Claude Code denies calls matching your explicit [`ask` rules](</docs/en/permissions#manage-permissions>) rather than prompting. It also denies the built-in `AskUserQuestion` tool and connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), even if your allow rules match them. It denies MCP tools marked [`_meta["anthropic/requiresUserInteraction"]`](</docs/en/mcp#require-approval-for-a-specific-tool>) the same way, because their approval card needs an answer this mode never collects; this requires Claude Code v2.1.199 or later. `rm` and `rmdir` removals targeting a critical path, such as `rm -rf /` and `rm -rf ~`, are denied even when an allow rule matches them or a `PreToolUse` hook allows them. 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 @@ -390,12 +417,12 @@ Skip all checks with bypassPermissions mode -`bypassPermissions` mode disables permission prompts and safety checks so tool calls execute immediately, including writes to protected paths. Explicit [ask rules](</docs/en/permissions#manage-permissions>) and connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) still force a prompt in this mode. MCP tools marked with [`_meta["anthropic/requiresUserInteraction"]`](</docs/en/mcp#require-approval-for-a-specific-tool>) also still prompt; this requires Claude Code v2.1.199 or later. Removals targeting the filesystem root or home directory, such as `rm -rf /` and `rm -rf ~`, still prompt as a circuit breaker against model error. The circuit breaker also fires when the command contains command substitution with `$(...)` or backticks, or process substitution with `<(...)`, whether the removal sits inside the substitution, as in `echo "$(rm -rf ~)"`, or elsewhere in the same command. The plain form, typed as its own command, has prompted in this mode since the circuit breaker was introduced; before v2.1.208, commands containing those forms didn’t prompt. Two [cross-session messaging](</docs/en/cross-session-messaging>) safeguards still apply in this mode, and in plan-mode sessions where bypass permissions are available: +`bypassPermissions` mode disables permission prompts and safety checks so tool calls execute immediately, including writes to protected paths. The actions no mode auto-approves still prompt in this mode. Two [cross-session messaging](</docs/en/cross-session-messaging>) safeguards still apply in this mode, and in plan-mode sessions where bypass permissions are available: * The [`isolatePeerMachines`](</docs/en/settings#available-settings>) approval prompt for messages to your sessions beyond this machine still appears. * When no [`crossSessionInbound`](</docs/en/cross-session-messaging#control-inbound-messages>) value applies, Claude Code holds an inbound message from another of your sessions for your approval, and delivers without asking only when the sending session identifies itself as also bypassing permission prompts. If you leave the permission mode while messages are held, Claude Code re-applies the inbound rules and delivers any held message they now accept. -In sessions with bypass permissions available, Claude Code also doesn’t enforce plan mode’s blocks. Claude is still instructed to plan without editing, but a file edit or shell command it attempts during planning runs without prompting. Explicit [ask rules](</docs/en/permissions#manage-permissions>) and the removal circuit breaker above still prompt. +In sessions with bypass permissions available, Claude Code also doesn’t enforce plan mode’s blocks. Claude is still instructed to plan without editing, but a file edit or shell command it attempts during planning runs without prompting. Explicit [ask rules](</docs/en/permissions#manage-permissions>) and `rm` and `rmdir` removals targeting a critical path still prompt. Only use this mode in isolated environments like containers, VMs, or dev containers without internet access, where Claude Code cannot damage your host system. @@ -422,7 +449,7 @@ Mode| Protected-path writes ---|--- `default`, `acceptEdits`| Prompted -`plan`| Prompted. In sessions with bypass permissions available, allowed. Otherwise, with auto mode available during planning, routed to the classifier +`plan`| Allowed in sessions with bypass permissions available. Otherwise, routed to the classifier when auto mode is available during planning, and prompted when it isn’t `auto`| Routed to the classifier `dontAsk`| Denied `bypassPermissions`| Allowed @@ -456,6 +483,45 @@ ​ +Critical paths + +Claude Code never lets a [`permissions.allow`](</docs/en/permissions#manage-permissions>) rule or a [`PreToolUse` hook](</docs/en/permissions#extend-permissions-with-hooks>) that returns `"allow"` approve an `rm` or `rmdir` command that targets a critical path, even in modes that skip other prompts. This circuit breaker guards against model error. A matching deny rule still blocks the command outright. What happens instead depends on your permission mode: + +Mode| What Claude Code does with a critical-path removal +---|--- +`default`, `acceptEdits`| Asks you to approve it +`plan`| Asks you to approve it. With auto mode available during planning and no bypass permissions available, sends it to the classifier instead +`auto`| Sends it to the classifier +`dontAsk`| Denies it +`bypassPermissions`| Asks you to approve it + +If an explicit [ask rule](</docs/en/permissions#manage-permissions>) matches the command, Claude Code asks you even in `auto` mode. In modes that ask, a [`PermissionRequest` hook](</docs/en/hooks#permissionrequest>) can answer the prompt the way it answers any other. Claude Code treats an `rm` or `rmdir` target as a critical path when it is any of the following: + + * The filesystem root + * Top-level directories, meaning any direct child of the root, such as `/usr`, `/etc`, or `/data` + * Your home directory + * Windows drive roots and their top-level directories, such as `C:\` and `C:\Windows` + * Your working directory and its parents + * Your additional working directories and their parents, but only when the removal is a glob under one of them, such as `rm -rf <dir>/*`. `rm -rf <dir>` on the directory itself doesn’t trigger this check + +Claude Code also treats a glob or trailing slash directly under a shell variable, such as `rm -rf "$DIR"/*`, as a critical-path removal, because the command becomes a removal from the filesystem root when the variable is empty. Hiding the removal inside command substitution with `$(...)` or backticks, or process substitution with `<(...)`, doesn’t skip the check. Claude Code finds a critical-path removal whether it sits inside the substitution, as in `echo "$(rm -rf ~)"`, or elsewhere in the same command. + +### + +​ + +Remove-Item in PowerShell + +When you enable the [PowerShell tool](</docs/en/tools-reference#powershell-tool>), Claude Code gives `Remove-Item` its own check, separate from the `rm` critical-path list. The outcome depends on the target, and the first matching case applies: + + * **System paths** : the filesystem root and its top-level directories, drive roots and their top-level directories, and your home directory. Claude Code denies the command in every mode, without asking you. + * **Wildcards** : a bare `*`, or any target ending in `/*` or `\*`, including a glob under a shell variable such as `$dir/*`. Claude Code denies the command in every mode, without asking you, before the classifier sees it. + * **Your working directory or one of its parents, with`-Recurse`**: Claude Code treats the command like any other that needs approval in your permission mode, so it asks you in modes that ask, sends it to the classifier in `auto` mode, and denies it in `dontAsk` mode. `bypassPermissions` mode skips this check. + +## + +​ + See also * [Permissions](</docs/en/permissions>): allow, ask, and deny rules; managed policies
modified Configure permissions View current →
--- a/permissions.md +++ b/permissions.md @@ -12,7 +12,7 @@ Hooks -Run [hooks](</docs/en/agent-sdk/hooks>) first. A hook can deny the call outright or pass it on. A hook that returns `allow` does not skip the deny and ask rules below; those are evaluated regardless of the hook result. +Run [hooks](</docs/en/agent-sdk/hooks>) first. A hook can deny the call outright or pass it on. A hook that returns `allow` does not skip the deny and ask rules below; those are evaluated regardless of the hook result. A `PreToolUse` hook allow also can’t approve an `rm` or `rmdir` removal targeting a [critical path](</docs/en/permission-modes#critical-paths>). 2 @@ -30,13 +30,13 @@ Permission mode -Apply the active permission mode. `bypassPermissions` approves everything that reaches this step. `acceptEdits` approves file operations. `plan` routes file-edit and shell-write tools to your `canUseTool` callback regardless of allow rules, so write operations cannot be auto-approved while planning. Other modes fall through. +Apply the active permission mode. `bypassPermissions` approves everything that reaches this step except `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>), which fall through instead. `acceptEdits` approves the file operations listed under Accept edits mode. `plan` routes file-edit and shell-write tools to your `canUseTool` callback regardless of allow rules, so write operations cannot be auto-approved while planning. Other modes fall through. 5 Allow rules -Check `allow` rules (from `allowed_tools` and settings.json). If a rule matches, the tool is approved. +Check `allow` rules (from `allowed_tools` and settings.json). If a rule matches, the tool is approved. `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>) are never approved by an allow rule: they reach your callback in the modes that prompt, go to the [classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) in `auto` mode on Claude Code v2.1.218 or later, and are denied in `dontAsk` mode. 6 @@ -44,10 +44,10 @@ If not resolved by any of the above, call your [`canUseTool` callback](</docs/en/agent-sdk/user-input>) for a decision. In `dontAsk` mode, this step is skipped and the tool is denied. -If you pass a `canUseTool` callback that this evaluation order can never reach, the TypeScript SDK emits a Node.js process warning once when the query is constructed. The warning’s code is `CLAUDE_SDK_CAN_USE_TOOL_SHADOWED`. Two configurations trigger it: - - * `permissionMode: 'bypassPermissions'`, which auto-approves every call that reaches the permission mode step - * Each bare `allowedTools` entry such as `"Read"`, which auto-approves that whole tool before the callback is consulted +If you pass a `canUseTool` callback in a configuration where the TypeScript SDK expects the evaluation order to auto-approve calls before the callback is consulted, the SDK emits a Node.js process warning once when the query is constructed. The warning’s code is `CLAUDE_SDK_CAN_USE_TOOL_SHADOWED`. Two configurations trigger it: + + * `permissionMode: 'bypassPermissions'`, which auto-approves every call that reaches the permission mode step apart from the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) + * Each bare `allowedTools` entry such as `"Read"`, which auto-approves that whole tool before the callback is consulted, apart from the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) Entries with a specifier such as `Bash(ls *)` and the `acceptEdits` mode don’t trigger it, and allow rules coming from settings files aren’t visible to the check. Listen with `process.on('warning', ...)` and match the code to log or suppress it. To gate every tool call regardless of mode and rules, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>) instead. This page focuses on **allow and deny rules** and **permission modes**. For the other steps: @@ -71,7 +71,7 @@ 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 entry like `allowed_tools=["*"]` or `allowed_tools=["mcp__*"]` is ignored with a startup warning and does not auto-approve anything. Scoped rules for `Read` and `Edit` take a path pattern. `Edit(path)` rules govern all built-in tools that write files, including `Write` and `NotebookEdit`; a `Write(path)` rule is never matched by the file permission checks. Use `//path` for an absolute filesystem path: a deny rule of `Edit(//secrets/**)` blocks writes anywhere under `/secrets` on disk. With a single leading slash, `Edit(/secrets/**)` anchors at the rule’s source instead. For rules passed through `allowed_tools` or `disallowed_tools`, that means the session’s working directory, so the rule doesn’t block `/secrets` on disk. See [Read and Edit rules](</docs/en/permissions#read-and-edit>) for the four anchor forms and how rules from settings files resolve. -**Auto-approved tools never reach`canUseTool`.** A tool call approved at any earlier step, by `acceptEdits` or `bypassPermissions`, or by an allow rule, skips your `canUseTool` callback, so permission checks you put there are silently bypassed for that tool. `AskUserQuestion`, MCP tools marked [`_meta["anthropic/requiresUserInteraction"]`](</docs/en/mcp#require-approval-for-a-specific-tool>), and connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) still reach the callback, even when an allow rule matches.Coverage depends on the entry’s form: a bare name like `Read` or `mcp__github__get_issue` auto-approves every call to that tool, while a scoped rule like `Bash(ls *)` auto-approves only matching calls and other `Bash` calls still fall through to the callback. For checks that must run on every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>): hooks run before every other step, and a hook deny applies even in `bypassPermissions` mode. +**Auto-approved tools never reach`canUseTool`.** A tool call approved at any earlier step, by `acceptEdits` or `bypassPermissions`, or by an allow rule, skips your `canUseTool` callback, so permission checks you put there are silently bypassed for that tool. `AskUserQuestion`, MCP tools marked [`_meta["anthropic/requiresUserInteraction"]`](</docs/en/mcp#require-approval-for-a-specific-tool>), connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), and `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>) still reach the callback, even when an allow rule matches. In `auto` mode, critical-path removals go to the [classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) instead of the callback, while the other calls listed here still reach it; the classifier routing requires Claude Code v2.1.218 or later. In `dontAsk` mode these calls are denied instead, without invoking the callback.Coverage depends on the entry’s form: a bare name like `Read` or `mcp__github__get_issue` auto-approves every call to that tool apart from the exceptions above, while a scoped rule like `Bash(ls *)` auto-approves only matching calls and other `Bash` calls still fall through to the callback. For checks that must run on every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>): hooks run before every other step, and a hook deny applies even in `bypassPermissions` mode. For a locked-down agent, pair `allowedTools` with `permissionMode: "dontAsk"`. Listed tools are approved, apart from the always-prompt tools in the Warning above; anything else is denied outright instead of prompting: @@ -103,13 +103,13 @@ Mode| Description| Tool behavior ---|---|--- `default`| Standard permission behavior| No auto-approvals; unmatched tools trigger your `canUseTool` callback -`dontAsk`| Deny instead of prompting| Anything not pre-approved by `allowed_tools` or rules is denied; connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) and tools that require user interaction are denied even if you’ve pre-approved them. `canUseTool` is never called +`dontAsk`| Deny instead of prompting| Anything not pre-approved by `allowed_tools` or rules is denied; connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) and tools that require user interaction are denied even if you’ve pre-approved them, as are `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>). `canUseTool` is never called `acceptEdits`| Auto-accept file edits| File edits and filesystem operations (`mkdir`, `rm`, `mv`, etc.) are automatically approved -`bypassPermissions`| Bypass permission checks| Tools run without permission prompts, except tools matched by an explicit `ask` rule, connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), and tools that require user interaction. The [cross-session messaging safeguards](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) still apply. Use with caution +`bypassPermissions`| Bypass permission checks| Tools run without permission prompts, except for the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). Use with caution `plan`| Planning mode| Claude explores and plans without editing your source files; file edits are never auto-approved and prompt through your `canUseTool` callback `auto`| Model-classified approvals| A model classifier approves or denies permission prompts. See [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) for availability -**Subagent inheritance:** Subagents inherit the parent session’s permission mode. An [`AgentDefinition`’s `permissionMode`](</docs/en/agent-sdk/typescript#agentdefinition>) can override it, except when the parent uses `bypassPermissions`, `acceptEdits`, or `auto`: those modes apply to every subagent and can’t be overridden per subagent. Claude Code also ignores a definition’s `permissionMode: "bypassPermissions"` when bypass mode is disabled by [`permissions.disableBypassPermissionsMode`](</docs/en/permissions#managed-settings>), so that subagent runs with the parent session’s mode.Subagents may have different system prompts and less constrained behavior than your main agent, so inheriting `bypassPermissions` grants them full, autonomous system access. Explicit `ask` rules, connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), and tools that require user interaction still force a prompt, as does the [`isolatePeerMachines`](</docs/en/settings#available-settings>) approval for cross-machine messages. +**Subagent inheritance:** Subagents inherit the parent session’s permission mode. An [`AgentDefinition`’s `permissionMode`](</docs/en/agent-sdk/typescript#agentdefinition>) can override it, except when the parent uses `bypassPermissions`, `acceptEdits`, or `auto`: those modes apply to every subagent and can’t be overridden per subagent. Claude Code also ignores a definition’s `permissionMode: "bypassPermissions"` when bypass mode is disabled by [`permissions.disableBypassPermissionsMode`](</docs/en/permissions#managed-settings>), so that subagent runs with the parent session’s mode.Subagents may have different system prompts and less constrained behavior than your main agent, so inheriting `bypassPermissions` grants them full, autonomous system access. The [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) still apply. ### @@ -228,7 +228,7 @@ * File edits (Edit, Write tools) * Filesystem commands: `mkdir`, `touch`, `rm`, `rmdir`, `mv`, `cp`, `sed` -Both apply only to paths inside the working directory or `additionalDirectories`. Paths outside that scope and writes to protected paths still prompt. **Use when:** you trust Claude’s edits and want faster iteration, such as during prototyping or when working in an isolated directory. +Both apply only to paths inside the working directory or `additionalDirectories`. Paths outside that scope, writes to protected paths, and `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>) still prompt. **Use when:** you trust Claude’s edits and want faster iteration, such as during prototyping or when working in an isolated directory. #### @@ -236,7 +236,7 @@ Don’t ask mode (`dontAsk`) -Converts any permission prompt into a denial. Tools pre-approved by `allowed_tools`, `settings.json` allow rules, or a hook run as normal. Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) and tools that require user interaction are denied even when an allow rule matches. Everything else is denied without calling `canUseTool`. **Use when:** you want a fixed, explicit tool surface for a headless agent and prefer a hard deny over silent reliance on `canUseTool` being absent. +Converts any permission prompt into a denial. Tools pre-approved by `allowed_tools`, `settings.json` allow rules, or a hook run as normal. Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), tools that require user interaction, and `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>) are denied even when an allow rule matches. A `PreToolUse` hook allow doesn’t clear a critical-path removal either. Everything else is denied without calling `canUseTool`. **Use when:** you want a fixed, explicit tool surface for a headless agent and prefer a hard deny over silent reliance on `canUseTool` being absent. #### @@ -249,7 +249,7 @@ Use with extreme caution. Claude has full system access in this mode. Only use in controlled environments where you trust all possible operations.`allowed_tools` does not constrain this mode. Every tool is approved, not just the ones you listed. These controls still apply: * Deny rules, explicit `ask` rules, and hooks are evaluated before the mode check and can still block a tool. - * Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) and tools that require user interaction still fall through to your `canUseTool` callback. + * Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), tools that require user interaction, and `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>) still fall through to your `canUseTool` callback. * The [cross-session messaging safeguards](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) still apply. ####
modified Constrain plugin dependency versions View current →
--- a/plugin-dependencies.md +++ b/plugin-dependencies.md @@ -141,7 +141,7 @@ Enable or disable a plugin with dependencies -Enabling a plugin also enables the plugins it depends on, and disabling a plugin is blocked if another enabled plugin still needs it. Both behaviors require Claude Code v2.1.143 or later. Earlier versions enable or disable only the named plugin and surface a `dependency-unsatisfied` error on the next load. When you enable a plugin, Claude Code also enables its dependencies at the same scope. If a dependency has its own dependencies, Claude Code enables those too. The success message lists what else was enabled along with the plugin you named. If a dependency can’t be enabled, the command refuses and tells you what’s blocking and how to fix it: +Enabling a plugin also enables the plugins it depends on, and disabling a plugin is blocked if another enabled plugin still needs it. When you enable a plugin, Claude Code also enables its dependencies at the same scope. If a dependency has its own dependencies, Claude Code enables those too. The success message lists what else was enabled along with the plugin you named. If a dependency can’t be enabled, the command refuses and tells you what’s blocking and how to fix it: Condition| Result ---|---
modified Create and distribute a plugin marketplace View current →
--- a/plugin-marketplaces.md +++ b/plugin-marketplaces.md @@ -226,7 +226,7 @@ Field| Type| Description ---|---|--- -`displayName`| string| Human-readable name shown in UI surfaces. Falls back to `name` when omitted. May contain spaces and any casing. Not used for namespacing or lookup. Requires Claude Code v2.1.143 or later. +`displayName`| string| Human-readable name shown in UI surfaces. Falls back to `name` when omitted. May contain spaces and any casing. Not used for namespacing or lookup. `description`| string| Brief plugin description `version`| string| Plugin version. If set (here or in `plugin.json`), the plugin is pinned to this string and users only receive updates when it changes. A plugin with a `command` source isn’t pinned by either field. If set in neither place, the version comes from the next source in [version management](</docs/en/plugins-reference#version-management>). `author`| object| Plugin author information (`name` required; `email` and `url` optional) @@ -888,14 +888,14 @@ How restrictions work -Restrictions are checked before any network or filesystem operation. The check runs on marketplace add and on plugin install, update, refresh, and auto-update. If a marketplace was added before the policy was configured and its source no longer matches the allowlist, Claude Code refuses to install or update plugins from it. The same enforcement applies to `blockedMarketplaces`. To block every marketplace repository under a GitHub owner, use the owner-wildcard form in a `blockedMarketplaces` entry: `{ "source": "github", "repo": "untrusted-org/*" }`. Requires Claude Code v2.1.223 or later. For the matching rules, which differ between the blocklist and the allowlist, see [Owner wildcards](</docs/en/settings#owner-wildcards>). The allowlist uses exact matching for most source types, apart from owner-wildcard `github` entries. For a marketplace to be allowed, all specified fields must match: +Restrictions are checked before any network or filesystem operation. The check runs on marketplace add and on plugin install, update, refresh, and auto-update. If a marketplace was added before the policy was configured and its source no longer matches the allowlist, Claude Code refuses to install or update plugins from it. The same enforcement applies to `blockedMarketplaces`. To block every marketplace repository under a GitHub owner, use the owner-wildcard form in a `blockedMarketplaces` entry: `{ "source": "github", "repo": "untrusted-org/*" }`. Requires Claude Code v2.1.223 or later. For the matching rules, which differ between the blocklist and the allowlist, see [Owner wildcards](</docs/en/settings#owner-wildcards>). When a user adds an `https://` repository URL that Claude Code [clones rather than fetches](</docs/en/discover-plugins#add-from-other-git-hosts>), such as a bare `github.com` or `gitlab.com` repository URL, Claude Code also checks it against the `url` entries in `blockedMarketplaces`. Claude Code blocks the addition if an entry names the same URL. In that comparison, Claude Code ignores the `.git` suffix and any ref the user appends after `#`. Requires Claude Code v2.1.232 or later. Before v2.1.232, Claude Code matched a `url` entry only against a URL it fetched as a hosted `marketplace.json` file. The allowlist uses exact matching for most source types, apart from owner-wildcard `github` entries. For a marketplace to be allowed, all specified fields must match: * For GitHub sources: `repo` is required, either naming one repository or using the owner-wildcard form `owner/*` to cover every repository under that owner. For how wildcard entries match, including the case rules, see [Owner wildcards](</docs/en/settings#owner-wildcards>). For single-repository entries, `ref` must match exactly or be absent from both the marketplace source and the allowlist entry, and the same rule applies to `path` * For URL sources: the full URL must match exactly * For `hostPattern` sources: the marketplace host is matched against the regex pattern * For `pathPattern` sources: the marketplace’s filesystem path is matched against the regex pattern -Exact matching doesn’t normalize URLs: a trailing slash, `.git` suffix, or `ssh://` versus `https://` form are treated as different values. If your organization’s marketplace can be cloned by more than one URL form, prefer a `hostPattern` entry over a literal URL so all forms match. Because `strictKnownMarketplaces` is set in [managed settings](</docs/en/settings#settings-files>), individual users and project configurations can’t override these restrictions. For complete configuration details including all supported source types and comparison with `extraKnownMarketplaces`, see the [strictKnownMarketplaces reference](</docs/en/settings#strictknownmarketplaces>). +The allowlist’s exact matching doesn’t normalize URLs: a trailing slash, `.git` suffix, or `ssh://` versus `https://` form are treated as different values. If your organization’s marketplace can be cloned by more than one URL form, prefer a `hostPattern` entry over a literal URL so all forms match. Because `strictKnownMarketplaces` is set in [managed settings](</docs/en/settings#settings-files>), individual users and project configurations can’t override these restrictions. For complete configuration details including all supported source types and comparison with `extraKnownMarketplaces`, see the [strictKnownMarketplaces reference](</docs/en/settings#strictknownmarketplaces>). ###
modified Plugins reference View current →
--- a/plugins-reference.md +++ b/plugins-reference.md @@ -430,7 +430,7 @@ Field| Type| Description| Example ---|---|---|--- `$schema`| string| JSON Schema URL for editor autocomplete and validation. Claude Code ignores this field at load time.| `"https://json.schemastore.org/claude-code-plugin-manifest.json"` -`displayName`| string| Human-readable name shown in the `/plugin` picker and other UI surfaces. Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing. Not used for namespacing or lookup. Requires Claude Code v2.1.143 or later.| `"Deployment Tools"` +`displayName`| string| Human-readable name shown in the `/plugin` picker and other UI surfaces. Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing. Not used for namespacing or lookup.| `"Deployment Tools"` `version`| string| Optional. Semantic version. Setting this pins the plugin to that version string, so users only receive updates when you bump it, except for a [`command` source](</docs/en/plugin-marketplaces#command-sources>); see Version management. If also set in the marketplace entry, `plugin.json` wins. If omitted, the version comes from the next source in Version management.| `"2.1.0"` `description`| string| Brief explanation of plugin purpose| `"Deployment automation tools"` `author`| object| Author information| `{"name": "Dev Team", "email": "dev@company.com"}`
modified How Claude Code uses prompt caching View current →
--- a/prompt-caching.md +++ b/prompt-caching.md @@ -104,7 +104,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 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. +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. Claude Code applies the change on the next request, even one in the middle of a turn, whether you add the rule 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. ###
modified Agent SDK reference - Python View current →
--- a/python.md +++ b/python.md @@ -916,7 +916,7 @@ `max_buffer_size`| `int | None`| `None`| Maximum bytes when buffering CLI stdout `debug_stderr`| `Any`| `sys.stderr`| _Deprecated_ \- File-like object for debug output. Use `stderr` callback instead `stderr`| `Callable[[str], None] | None`| `None`| Callback function for stderr output from CLI -`can_use_tool`| `CanUseTool` ` | None`| `None`| Tool permission callback, invoked only when the [permission flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) falls through to a prompt. Not invoked for calls auto-approved by `allowed_tools`, allow rules, or `permission_mode`. `AskUserQuestion`, connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), and MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) reach it even if you’ve allowed them; in `dontAsk` mode these are denied instead. See `CanUseTool` for details +`can_use_tool`| `CanUseTool` ` | None`| `None`| Tool permission callback, invoked only when the [permission flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) falls through to a prompt. Not invoked for calls auto-approved by `allowed_tools`, allow rules, or `permission_mode`. An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). See `CanUseTool` for details `hooks`| `dict[HookEvent, list[HookMatcher]] | None`| `None`| Hook configurations for intercepting events `user`| `str | None`| `None`| User identifier `include_partial_messages`| `bool`| `False`| Include partial message streaming events. When enabled, `StreamEvent` messages are yielded @@ -1217,7 +1217,7 @@ * `input_data`: The tool’s input parameters * `context`: A `ToolPermissionContext` with additional information -Returns a `PermissionResult` (either `PermissionResultAllow` or `PermissionResultDeny`). The callback is the SDK replacement for the interactive permission prompt: it’s invoked only when the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) resolves to a prompt. Tool calls already approved by an `allowed_tools` entry, a settings allow rule, or the permission mode, such as `acceptEdits` or `bypassPermissions`, never invoke it. To gate every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>) instead. `AskUserQuestion`, MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), and connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) reach the callback even when an allow rule matches. In `dontAsk` mode these calls are denied instead, without invoking the callback. +Returns a `PermissionResult` (either `PermissionResultAllow` or `PermissionResultDeny`). The callback is the SDK replacement for the interactive permission prompt: it’s invoked only when the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) resolves to a prompt. Tool calls already approved by an `allowed_tools` entry, a settings allow rule, or the permission mode, such as `acceptEdits` or `bypassPermissions`, never invoke it. To gate every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>) instead. An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>); see [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) for which of them reach the callback and what happens in `dontAsk` and `auto` mode. ### @@ -3781,7 +3781,7 @@ asyncio.run(main()) -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. +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, apart from the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). 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 @@ -133,7 +133,7 @@ 3. The last meaningful message in existing conversation history 4. An auto-generated name like `myhost-graceful-unicorn`, where `myhost` is your machine’s hostname or the prefix you set with `--remote-control-session-name-prefix` -If you didn’t set an explicit name, Claude Code updates the title to reflect your prompt once you send one. Claude Code matches auto-generated titles to the language of your conversation, or to the [`language`](</docs/en/settings#available-settings>) setting if one is configured; the language matching requires Claude Code v2.1.176 or later. When you rename a session from claude.ai or the Claude app, Claude Code also updates the local title shown in `claude --resume`. Claude Code applies the same rename to the session name shown on the prompt bar, and in the `claude agents` listing when the session [runs in the background](</docs/en/agent-view>). Before v2.1.221, renaming from the session list at claude.ai or in the Claude app updated only the title, and the CLI kept its previous session name; `/rename`, which runs in the CLI itself, set the name on any version. If the environment already has an active session, you’ll be asked whether to continue it or start a new one. If you don’t have the Claude app yet, use the `/mobile` command inside Claude Code to display a download QR code for [iOS](<https://apps.apple.com/us/app/claude-by-anthropic/id6473753684>) or [Android](<https://play.google.com/store/apps/details?id=com.anthropic.claude>). +If you didn’t set an explicit name, Claude Code updates the title to reflect your prompt once you send one. Claude Code matches auto-generated titles to the language of your conversation, or to the [`language`](</docs/en/settings#available-settings>) setting if one is configured; the language matching requires Claude Code v2.1.176 or later. When you rename a session from claude.ai or the Claude app, Claude Code also updates the local title shown in `claude --resume`. Claude Code applies the same rename to the session name shown on the prompt bar, and in the `claude agents` listing when the session [runs in the background](</docs/en/agent-view>). Before v2.1.221, renaming from the session list at claude.ai or in the Claude app updated only the title, and the CLI kept its previous session name; `/rename`, which runs in the CLI itself, set the name on any version. If you don’t have the Claude app yet, use the `/mobile` command inside Claude Code to display a download QR code for [iOS](<https://apps.apple.com/us/app/claude-by-anthropic/id6473753684>) or [Android](<https://play.google.com/store/apps/details?id=com.anthropic.claude>). ###
modified Choose a sandbox environment View current →
--- a/sandbox-environments.md +++ b/sandbox-environments.md @@ -48,15 +48,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. When you pass `--dangerously-skip-permissions`, Claude acts without asking you first. Claude Code still prompts you only for: - - * Explicit [ask rules](</docs/en/permissions#manage-permissions>) - * Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) - * MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) - * Removals targeting `/` or your home directory - * The [cross-session messaging safeguards](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) - -With no prompts to catch mistakes, the isolation boundary you choose is what protects your system. Always run `--dangerously-skip-permissions` sessions inside a container, a VM, or the sandbox runtime, so that file tools, MCP servers, and hooks are also inside the boundary. On Linux and macOS, Claude Code refuses to start with this flag when running as root, so run the container, VM, or sandbox runtime as a non-root user. [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) replaces the prompt with a classifier that reviews actions. 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. When you pass `--dangerously-skip-permissions`, Claude acts without asking you first. The [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) still apply. With no prompts to catch mistakes, the isolation boundary you choose is what protects your system. Always run `--dangerously-skip-permissions` sessions inside a container, a VM, or the sandbox runtime, so that file tools, MCP servers, and hooks are also inside the boundary. On Linux and macOS, Claude Code refuses to start with this flag when running as root, so run the container, VM, or sandbox runtime as a non-root user. [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) replaces the prompt with a classifier that reviews actions. 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 @@ -104,7 +104,7 @@ When a command can be sandboxed, Claude Code runs it inside the sandbox and approves it automatically, without asking your permission. Commands that cannot be sandboxed, such as those needing network access to non-allowed hosts, fall back to the regular permission flow, where Claude Code checks your [permission rules](</docs/en/permissions>) and gates any command those rules do not already allow, with a prompt in Manual mode or the classifier in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). Even in auto-allow mode, the following still apply: * Explicit [deny rules](</docs/en/permissions>) are always respected - * `rm` or `rmdir` commands that target `/`, your home directory, or other critical system paths still go through the regular permission flow + * `rm` or `rmdir` commands that target a [critical path](</docs/en/permission-modes#critical-paths>) still go through the regular permission flow * 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. In [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>), the rule isn’t skipped: it prompts for sandboxed commands too, including read-only ones. Before v2.1.212, the skip applied in plan mode as well @@ -449,6 +449,7 @@ * **Domain restrictions** : no domains are pre-allowed by default. The first time a command needs a new domain, Claude Code prompts for approval, or in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) sends the request to the classifier. When you’re prompted, choosing Yes allows the host for the rest of the current session, so later connections to the same host do not prompt again. Pre-allow domains with [`allowedDomains`](</docs/en/settings#sandbox-settings>) to avoid the prompt entirely. `WebFetch` allow rules also pre-allow domains, as described in Permission rules. * **Strict allowlist** : if you set [`strictAllowlist`](</docs/en/settings#sandbox-settings>) to `true` in user, managed, or CLI `--settings` settings, Claude Code denies sandboxed commands access to any host outside the allowlist instead of prompting. The allowlist is the same one the sandbox otherwise prompts against: `allowedDomains` plus domains from `WebFetch(domain:...)` allow rules, or only the managed settings entries when `allowManagedDomainsOnly` is set. Claude Code enforces this for sandboxed commands only; in-process tools such as `WebFetch` still follow their permission rules. Setting it in a repository’s `.claude/settings.json` or `.claude/settings.local.json` has no effect. Requires Claude Code v2.1.219 or later. * **Managed lockdown** : if [`allowManagedDomainsOnly`](</docs/en/settings#sandbox-settings>) is set in managed settings, non-allowed domains are blocked automatically instead of prompting, and only `allowedDomains` and `WebFetch(domain:...)` allow rules from managed settings are honored. + * **Corporate proxy** : when your network requires outbound traffic to go through a corporate proxy, set `HTTPS_PROXY`, `HTTP_PROXY`, and `NO_PROXY` as [proxy configuration](</docs/en/network-config#proxy-configuration>) describes, in the `env` block of your settings so that [background agents](</docs/en/network-config#set-network-variables-in-settings-not-the-shell>) get them too, or in the environment you launch Claude Code from. Claude Code enforces the domain allowlist and then tunnels allowed connections through that upstream proxy. * **Custom proxy support** : advanced users can implement custom rules on outgoing traffic * **Comprehensive coverage** : restrictions apply to all scripts, programs, and subprocesses spawned by commands @@ -528,9 +529,9 @@ ---|---|--- `/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 explicit [ask rules](</docs/en/permissions#manage-permissions>), connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), removing `/` or your home directory, and the [cross-session messaging safeguards](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) 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>). +`--dangerously-skip-permissions`| Whether each tool call runs| Nothing. [Protected path](</docs/en/permission-modes#protected-paths>) checks are also skipped; the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) still apply + +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>). For a table of common permission mode and sandbox pairings with the flags that start each one, see [Common setups](</docs/en/permission-modes#common-setups>). ##
modified Securely deploying AI agents View current →
--- a/secure-deployment.md +++ b/secure-deployment.md @@ -17,7 +17,7 @@ Claude Code includes several security features that address common concerns. See the [security documentation](</docs/en/security>) for full details. * **Permissions system** : Every tool and bash command can be configured to allow, block, or prompt the user for approval. Use glob patterns to create rules like “allow all npm commands” or “block any command with sudo”. Organizations can set policies that apply across all users. See [permissions](</docs/en/permissions>). - * **Command parsing for permissions** : Before executing bash commands, Claude Code parses them into an AST and matches the result against your permission rules. Commands that cannot be parsed cleanly, or that do not match an allow rule, require explicit approval. A small set of constructs such as `eval` always require approval regardless of allow rules. This is a permission gate, not a sandbox; it does not infer whether a command is dangerous from its target path or effects. + * **Command parsing for permissions** : Before executing bash commands, Claude Code parses them into an AST and matches the result against your permission rules. Commands that cannot be parsed cleanly, or that do not match an allow rule, require explicit approval. A small set of constructs such as `eval` always require approval regardless of allow rules. This is a permission gate, not a sandbox; apart from built-in safety checks such as the [critical-path check](</docs/en/permission-modes#critical-paths>) on `rm` and `rmdir` and the [protected paths](</docs/en/permission-modes#protected-paths>) list, it does not infer whether a command is dangerous from its target path or effects. * **Web search summarization** : Search results are summarized rather than passing raw content directly into the context, reducing the risk of prompt injection from malicious web content. * **Sandbox mode** : Bash commands can run in a sandboxed environment that restricts filesystem and network access. See the [sandboxing documentation](</docs/en/sandboxing>) for details.
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. Claude Code requires approval before running Bash commands that can modify your system. A built-in set of [read-only commands](</docs/en/permissions#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>). +In Manual mode, Claude Code starts with read-only permissions. When Claude Code needs to edit files, run tests, or execute commands, it asks you first, and you choose whether to approve the action once or allow it from then on. In Manual mode, Claude Code also asks before running Bash commands that can modify your system. It runs a built-in set of [read-only commands](</docs/en/permissions#read-only-commands>) such as `ls`, `cat`, and `git status` without asking. You and your organization configure these permissions directly. In [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), a separate classifier model reviews actions instead of you and blocks the ones it judges unsafe. [How the classifier evaluates actions](</docs/en/permission-modes#how-the-classifier-evaluates-actions>) lists which actions Claude Code approves outright, which it sends to the classifier, and which Claude Code still asks you about. Your explicit ask and deny rules still apply, and your organization can [turn auto mode off](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). Which permission mode a session starts in depends on your plan, the surface you start it from, and your settings and your organization’s; see [Permission modes](</docs/en/permission-modes#which-mode-a-session-starts-in>). For detailed permission configuration, see [Permissions](</docs/en/permissions>). ### @@ -29,7 +29,7 @@ To mitigate risks in agentic systems: * **Sandboxed bash tool** : [Sandbox](</docs/en/sandboxing>) bash commands with filesystem and network isolation, reducing permission prompts while maintaining security. Configure with `/sandbox` to define boundaries where Claude Code can work autonomously - * **Working directory boundary** : Claude Code can only write to the folder where it was started and its subfolders, and cannot modify files in parent directories without explicit permission. Reading paths outside this boundary with the Read, Grep, and Glob tools is possible after an approval prompt. Extend the boundary with [additional directories](</docs/en/permissions#working-directories>) to skip the prompt, or restrict the broader read access available to read-only Bash commands with [sandbox `denyRead` rules](</docs/en/sandboxing#filesystem-isolation>), which apply only when sandboxing is enabled + * **Working directory boundary** : In Manual mode, Claude Code can only write to the folder where it was started and its subfolders, and can’t modify files in parent directories without explicit permission. In Manual mode, Claude Code also asks you before reading paths outside this boundary with the Read, Grep, and Glob tools. In auto mode it reads them without asking. Extend the boundary with [additional directories](</docs/en/permissions#working-directories>) to skip the prompt, or restrict the broader read access available to read-only Bash commands with [sandbox `denyRead` rules](</docs/en/sandboxing#filesystem-isolation>), which apply only when sandboxing is enabled * **Prompt fatigue mitigation** : Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization * **Accept Edits mode** : Auto-approves file edits and a fixed set of filesystem Bash commands like `mkdir`, `touch`, `rm`, `mv`, `cp`, and `sed` for paths in the working directory. Other Bash commands and out-of-scope paths still prompt @@ -55,10 +55,10 @@ Core protections - * **Permission system** : Sensitive operations require explicit approval + * **Permission system** : In Manual mode, 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 - * **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>) + * **Network command approval** : Commands that fetch content from the web such as `curl` and `wget` are not auto-approved by default. In Manual mode 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>) ### @@ -80,13 +80,13 @@ Additional safeguards - * **Network request approval** : Tools that make network requests require user approval by default + * **Network request approval** : In Manual mode, most 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 * 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 + * **Command injection detection** : In Manual mode, suspicious bash commands require manual approval even if previously allowlisted + * **Fail-closed matching** : In Manual mode, unmatched commands require approval by default * **Natural language descriptions** : Complex bash commands include explanations for user understanding * **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>)
modified Configure server-managed settings View current →
--- a/server-managed-settings.md +++ b/server-managed-settings.md @@ -216,6 +216,7 @@ Certain settings that could pose security risks require explicit user approval before Claude Code applies them: * **Shell command settings** : settings that execute shell commands + * **Sandbox binary settings** : `sandbox.bwrapPath`, `sandbox.socatPath`, and `sandbox.ripgrep`. Each of these settings points at an executable, and Claude Code runs that executable * **Custom environment variables** : delivered `env` variables that require the user’s approval, such as proxy and base-URL variables; see Environment variables and the approval dialog * **Hook configurations** : any hook definition * **Managed CLAUDE.md content** : a `claudeMd` value delivered through managed settings
modified Claude Code settings View current →
--- a/settings.md +++ b/settings.md @@ -79,7 +79,7 @@ ---|---|---|--- **Settings**| `~/.claude/settings.json`| `.claude/settings.json`| `.claude/settings.local.json` **Subagents**| `~/.claude/agents/`| `.claude/agents/`| None -**MCP servers**| `~/.claude.json`| `.mcp.json`| `~/.claude.json` (per-project) +**MCP servers**| `~/.claude.json`| `.mcp.json`| `~/.claude.json`, under the [project’s entry](</docs/en/mcp#local-scope>) **Plugins**| `~/.claude/settings.json`| `.claude/settings.json`| `.claude/settings.local.json` **CLAUDE.md**| `~/.claude/CLAUDE.md`| `CLAUDE.md` or `.claude/CLAUDE.md`| `CLAUDE.local.md` @@ -212,7 +212,7 @@ Key| Description| Example ---|---|--- -`advisorModel`| Model for the server-side [advisor tool](</docs/en/advisor>). Accepts the model aliases `"fable"`, `"opus"`, and `"sonnet"`, or a full model ID. `"fable"` requires [Fable 5 access](</docs/en/advisor#choose-an-advisor-model>). Written automatically when you run `/advisor`. Unset to disable the advisor.| `"opus"` +`advisorModel`| Model for the server-side [advisor tool](</docs/en/advisor>). Accepts the model aliases `"fable"`, `"opus"`, and `"sonnet"`, or a full model ID. `"fable"` requires [Fable 5 access](</docs/en/advisor#choose-an-advisor-model>). Written automatically when you run `/advisor`, except when you pick Fable while the [usage-credits consent](</docs/en/advisor#fable-advisor-and-usage-credits>) is pending. Unset to disable the advisor.| `"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"` `agentPushNotifEnabled`| **Default** : `false`. When [Remote Control](</docs/en/remote-control>) is connected, allow Claude to send proactive push notifications to your phone, for example when a long task finishes. Appears in `/config` as **Push when Claude decides**. See [Mobile push notifications](</docs/en/remote-control#mobile-push-notifications>)| `true` `allowAllClaudeAiMcps`| (Managed settings only) Load the claude.ai connectors Claude Code fetches itself alongside a deployed `managed-mcp.json`, which otherwise takes exclusive control and suppresses them. Connectors delivered to cloud sessions stay suppressed. See [Managed MCP configuration](</docs/en/managed-mcp#allow-claude-ai-connectors-alongside-the-managed-set>)| `true` @@ -306,7 +306,7 @@ `prefersReducedMotion`| Reduce or disable UI animations (spinners, shimmer, flash effects) for accessibility| `true` `processWrapper`| Corporate launcher command placed in front of the [background processes Claude Code starts](</docs/en/corporate-launcher#what-the-launcher-covers>). Honored from managed settings, a `--settings` file, and user settings only; the [`CLAUDE_CODE_PROCESS_WRAPPER`](</docs/en/env-vars>) environment variable takes precedence when both are set. See [Run Claude Code behind a corporate launcher](</docs/en/corporate-launcher>) for the launcher contract. Requires Claude Code v2.1.210 or later| `"/opt/corp/launcher --profile claude"` `promptSuggestionEnabled`| **Default** : `true`. Show [prompt suggestions](</docs/en/interactive-mode#prompt-suggestions>), the grayed-out predictions that appear in your prompt input. Set to `false` or turn off **Prompt suggestions** in `/config` to disable. [`CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION`](</docs/en/env-vars>) takes precedence when both are set| `false` -`prUrlTemplate`| URL template for the PR badge shown in the footer and in tool-result summaries. Substitutes `{host}`, `{owner}`, `{repo}`, `{number}`, and `{url}` from the `gh`-reported PR URL. Use to point PR links at an internal code-review tool instead of `github.com`. Does not affect `#123` autolinks in Claude’s prose| `"https://reviews.example.com/{owner}/{repo}/pull/{number}"` +`prUrlTemplate`| URL template for the PR badge shown in the footer and in tool-result summaries. Substitutes `{host}`, `{owner}`, `{repo}`, `{number}`, and `{url}` from the `gh`-reported PR URL. Use to point PR links at an internal code-review tool instead of `github.com`. Does not affect `#123` autolinks in Claude’s prose, or the [GitLab merge request badge](</docs/en/interactive-mode#gitlab-merge-requests>), which keeps its GitLab URL| `"https://reviews.example.com/{owner}/{repo}/pull/{number}"` `remote.defaultEnvironmentId`| Default [cloud environment](</docs/en/cloud-environments>) for cloud sessions you create from the CLI, such as with `claude --cloud`. Written to user settings when you pick an environment with [`/remote-env`](</docs/en/cloud-environments#select-an-environment-from-the-cli>). For Anthropic-hosted environment IDs (`env_...`), follows the standard settings precedence, so a value in a repo’s project settings overrides the user-level pick. A [self-hosted environment](</docs/en/self-hosted-environments>) ID (`ccpool_...`) is honored only from user settings, managed settings, and the `--settings` CLI flag; Claude Code ignores one in a repo’s project or local settings with a warning, so a checked-in file can’t steer sessions onto a self-hosted environment you didn’t choose| `"env_0123abcd"` `remoteControlAtStartup`| Connect [Remote Control](</docs/en/remote-control>) automatically when each interactive session starts, instead of waiting for `/remote-control`. Set to `true` to turn auto-connect on, `false` to turn it off, or leave unset to follow your organization’s admin default if one is set, and otherwise Claude Code’s current default. Appears in `/config` as **Enable Remote Control for all sessions**. Claude Code ignores a `true` from project or local settings; for the full per-scope behavior, see [Enable Remote Control for all sessions](</docs/en/remote-control#enable-remote-control-for-all-sessions>) and the exceptions to managed settings precedence| `false` `requiredMaximumVersion`| Managed settings only. Maximum Claude Code version allowed to start. If the running version is newer, Claude Code exits at startup and instructs the user to install an approved version through the organization’s approved method; `claude install <version>` may also work. Background auto-updates and `claude update` skip versions above the ceiling, so an in-range installation stays in range. `claude update`, `claude install`, and `claude doctor` keep working above the ceiling so users can recover. Versions that predate this setting ignore it| `"2.1.150"` @@ -361,7 +361,7 @@ `diffTool`| **Default** : `auto`. Where to display file diffs when an IDE is connected: `auto` opens diffs in the IDE’s diff viewer, `terminal` keeps them in the terminal. Appears in `/config` as **Diff tool** only when Claude Code is connected to a VS Code or JetBrains IDE| `"terminal"` `externalEditorContext`| **Default** : `false`. Prepend Claude’s previous response as `#`-commented context when you open the external editor with `Ctrl+G`. Appears in `/config` as **Show last response in external editor**| `true` `permissionExplainerEnabled`| **Default** : `true`. Show a model-generated [explanation of the command](</docs/en/permissions#permission-system>) when you press `Ctrl+E` on a Bash or PowerShell permission prompt. Set to `false` to turn the shortcut off| `false` -`teammateDefaultModel`| Default model for [agent team](</docs/en/agent-teams>) teammates when the spawn prompt doesn’t specify one. Set to a model alias such as `"sonnet"`, or `null` to inherit the lead’s current `/model` selection. Appears in `/config` as **Default teammate model**| `"sonnet"` +`teammateDefaultModel`| Removed in v2.1.234; Claude Code ignores a leftover value. See [Specify teammates and models](</docs/en/agent-teams#specify-teammates-and-models>)| ### @@ -465,6 +465,7 @@ `enableWeakerNestedSandbox`| Enable weaker sandbox for unprivileged Docker environments (Linux and WSL2 only). **Reduces security.** Default: false| `true` `enableWeakerNetworkIsolation`| (macOS only) Allow access to the system TLS trust service (`com.apple.trustd.agent`) in the sandbox. Required for Go-based tools like `gh`, `gcloud`, and `terraform` to verify TLS certificates when using `httpProxyPort` with a MITM proxy and custom CA. **Reduces security** by opening a potential data exfiltration path. Default: false| `true` `allowAppleEvents`| (macOS only) Allow sandboxed commands to send Apple Events. Required for `open`, `osascript`, and tools that open URLs in a browser, which otherwise fail with error `-600`. **Removes code-execution isolation.** Sandboxed commands can launch other applications unsandboxed with no user prompt; they can also send AppleScript commands to running applications such as Terminal, subject to the per-app macOS automation-consent prompt (TCC). Only honored from user, managed, or CLI settings, not from project settings. Default: false| `true` +`ripgrep`| Custom `ripgrep` binary for the sandbox. Set `command` to the binary’s path. To pass arguments to that binary, also set `args`. If you don’t set `ripgrep`, the sandbox uses the same `ripgrep` binary as Claude Code. That is the bundled binary unless you set [`USE_BUILTIN_RIPGREP`](</docs/en/env-vars>) to `0`. Only honored from user, managed, or CLI settings.| `{ "command": "/usr/local/bin/rg", "args": ["--no-config"] }` `bwrapPath`| (Managed settings only, Linux/WSL2) Absolute path to the bubblewrap (`bwrap`) binary. Overrides automatic detection via `PATH`. Only honored from [managed settings](</docs/en/settings#settings-precedence>), not from user or project settings. Useful when `bwrap` is installed at a non-standard location in managed environments.| `/opt/admin/bwrap` `socatPath`| (Managed settings only, Linux/WSL2) Absolute path to the `socat` binary used for the sandbox network proxy. Overrides automatic detection via `PATH`. Only honored from managed settings.| `/opt/admin/socat` @@ -731,6 +732,7 @@ * The sandbox lock keys `sandbox.network.allowManagedDomainsOnly` and `sandbox.filesystem.allowManagedReadPathsOnly`, with their associated allowlists * `allowAllClaudeAiMcps` * The sandbox binary paths `sandbox.bwrapPath` and `sandbox.socatPath` + * The sandbox `ripgrep` binary, `sandbox.ripgrep` * [`forceRemoteSettingsRefresh`](</docs/en/server-managed-settings>) * `env`, which Claude Code merges per variable across the admin-controlled sources: each variable comes from the highest-priority source that defines it, so lower sources fill in variables the higher ones leave unset, or whose cached server value Claude Code is [withholding pending server confirmation](</docs/en/server-managed-settings#fetch-and-caching-behavior>). The telemetry unit and credential-paired routing variables follow their own rules; see [Per-key exceptions across managed sources](</docs/en/server-managed-settings#per-key-exceptions-across-managed-sources>). Requires Claude Code v2.1.223 or later. Before v2.1.223, Claude Code applied the selected source’s whole `env` block only
modified Claude Code in Slack View current →
--- a/slack.md +++ b/slack.md @@ -132,14 +132,6 @@ ​ -App Home - -The App Home tab shows your connection status and allows you to connect or disconnect your Claude account from Slack. - -### - -​ - Message actions * **View Session** : Opens the full Claude Code session in your browser where you can see all work performed, continue the session, or make additional requests.
modified Customize your status line View current →
--- a/statusline.md +++ b/statusline.md @@ -181,8 +181,9 @@ `output_style.name`| Name of the current output style `vim.mode`| Current vim mode (`NORMAL`, `INSERT`, `VISUAL`, or `VISUAL LINE`) when [vim mode](</docs/en/interactive-mode#vim-editor-mode>) is enabled `agent.name`| Agent name when running with the `--agent` flag or agent settings configured -`pr.number`, `pr.url`| Open pull request for the current branch. Mirrors the PR badge in the bottom status bar. Absent until a PR is found, when not in a git repository, or once the PR merges or closes +`pr.number`, `pr.url`| Open pull request for the current branch. Mirrors the PR badge in the footer. In a repository with a GitLab remote, Claude Code fills these fields from the branch’s open [merge request](</docs/en/interactive-mode#gitlab-merge-requests>) instead, so `pr.number` is the merge request number. Merge request data requires Claude Code v2.1.234 or later. Absent when not in a git repository, until a pull request or merge request is found, or once it merges or closes `pr.review_state`| Review status of the open PR: `approved`, `pending`, `changes_requested`, or `draft`. May be independently absent even when `pr` is present +`pr.kind`| `mr` when `pr` describes a [GitLab merge request](</docs/en/interactive-mode#gitlab-merge-requests>). Absent for GitHub pull requests, so scripts written before this field keep working. For a merge request, Claude Code sets `review_state` to `approved` when GitLab reports it mergeable, `pending` for any other open state, and `draft` for a draft. Requires Claude Code v2.1.234 or later `worktree.name`| Name of the active worktree. Present only during `--worktree` sessions `worktree.path`| Absolute path to the worktree directory `worktree.branch`| Git branch name for the worktree (for example, `"worktree-my-feature"`). Absent for hook-based worktrees @@ -285,7 +286,7 @@ * `effort`: appears only when the current model supports the reasoning effort parameter * `vim`: appears only when vim mode is enabled * `agent`: appears only when running with the `--agent` flag or agent settings configured - * `pr`: appears only while an open PR is found for the current branch, and is removed once the PR merges or closes. `pr.review_state` may be independently absent + * `pr`: appears only while an open PR or GitLab merge request is found for the current branch, and is removed once it merges or closes. `pr.review_state` and `pr.kind` may be independently absent * `worktree`: appears only during `--worktree` sessions. When present, `branch` and `original_branch` may also be absent for hook-based worktrees * `rate_limits`: appears only for Claude.ai subscribers (Pro/Max) after the first API response in the session. Each window (`five_hour`, `seven_day`) may be independently absent. Use `jq -r '.rate_limits.five_hour.used_percentage // empty'` to handle absence gracefully. @@ -1056,7 +1057,7 @@ **Workspace trust required** - * Because `statusLine` executes a shell command, Claude Code runs it under the same [workspace trust rule as hooks in settings files](</docs/en/permissions#what-runs-before-you-trust-a-folder>). Accepting the dialog for the folder or one of its parent directories is enough. + * Because `statusLine` executes a shell command, Claude Code runs it under the same [workspace trust rule as hooks in settings files](</docs/en/permissions#what-runs-before-you-trust-a-folder>). Accepting the dialog for the folder, or for a parent directory whose trust extends to it, is enough. * Until then, the status line stays blank, and `claude --debug` logs `Status line command skipped: workspace trust not accepted`. Restart Claude Code and accept the trust dialog to enable it. **Script errors or hangs**
modified Create custom subagents View current →
--- a/sub-agents.md +++ b/sub-agents.md @@ -146,7 +146,7 @@ `~/.claude/agents/`| All your projects| 4| Ask Claude, or create the file manually Plugin’s `agents/` directory| Where plugin is enabled| 5 (lowest)| Installed with [plugins](</docs/en/plugins>) -**Project subagents** (`.claude/agents/`) are ideal for subagents specific to a codebase. Check them into version control so your team can use and improve them collaboratively. Project subagents are discovered by walking up from the current working directory, so every `.claude/agents/` between there and the repository root is scanned. As of v2.1.178, when more than one of these nested directories defines the same `name`, Claude Code uses the definition closest to the working directory. Directories added with `--add-dir` are also scanned: a `.claude/agents/` folder inside an added directory loads alongside project subagents. See [Additional directories](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) for which other configuration types load from `--add-dir`. To share subagents across projects without `--add-dir`, use `~/.claude/agents/` or a [plugin](</docs/en/plugins>). **User subagents** (`~/.claude/agents/`) are personal subagents available in all your projects. Claude Code scans `.claude/agents/` and `~/.claude/agents/` recursively, so you can organize definitions into subfolders such as `agents/review/` or `agents/research/`. The subdirectory path doesn’t affect how a subagent is identified or invoked, because identity comes only from the `name` frontmatter field. Keep `name` values unique across the whole tree: if two files under the same `.claude/agents/` directory, including its subfolders, declare the same name, Claude Code loads only one of them, chosen by filesystem read order rather than a documented precedence. Across nested project directories, the definition closest to the working directory wins, as described above. The [`/doctor`](</docs/en/commands#all-commands>) setup checkup reports files in the same directory that share a name and proposes renaming or removing all but one. Before v2.1.205, `/doctor` opened a diagnostics screen that listed duplicates and showed which definition was active. Plugin `agents/` directories are also scanned recursively. Unlike project and user scopes, a subfolder inside a plugin’s `agents/` directory becomes part of the scoped identifier: a file at `agents/review/security.md` in plugin `my-plugin` registers as `my-plugin:review:security`. **CLI-defined subagents** are passed as JSON when launching Claude Code. They exist only for that session and aren’t saved to disk, making them useful for quick testing or automation scripts. You can define multiple subagents in a single `--agents` call: +**Project subagents** (`.claude/agents/`) are ideal for subagents specific to a codebase. Check them into version control so your team can use and improve them collaboratively. Project subagents are discovered by walking up from the current working directory, so every `.claude/agents/` between there and the repository root is scanned. As of v2.1.178, when more than one of these nested directories defines the same `name`, Claude Code uses the definition closest to the working directory. When you add a directory with `--add-dir` or `/add-dir`, Claude Code also loads its `.claude/agents/` folder, alongside your project subagents. See [Additional directories](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) for which other configuration types load from `--add-dir`. To share subagents across projects without `--add-dir`, use `~/.claude/agents/` or a [plugin](</docs/en/plugins>). **User subagents** (`~/.claude/agents/`) are personal subagents available in all your projects. Claude Code scans `.claude/agents/` and `~/.claude/agents/` recursively, so you can organize definitions into subfolders such as `agents/review/` or `agents/research/`. The subdirectory path doesn’t affect how a subagent is identified or invoked, because identity comes only from the `name` frontmatter field. Keep `name` values unique across the whole tree: if two files under the same `.claude/agents/` directory, including its subfolders, declare the same name, Claude Code loads only one of them, chosen by filesystem read order rather than a documented precedence. Across nested project directories, the definition closest to the working directory wins, as described above. The [`/doctor`](</docs/en/commands#all-commands>) setup checkup reports files in the same directory that share a name and proposes renaming or removing all but one. Before v2.1.205, `/doctor` opened a diagnostics screen that listed duplicates and showed which definition was active. Plugin `agents/` directories are also scanned recursively. Unlike project and user scopes, a subfolder inside a plugin’s `agents/` directory becomes part of the scoped identifier: a file at `agents/review/security.md` in plugin `my-plugin` registers as `my-plugin:review:security`. **CLI-defined subagents** are passed as JSON when launching Claude Code. They exist only for that session and aren’t saved to disk, making them useful for quick testing or automation scripts. You can define multiple subagents in a single `--agents` call: * macOS, Linux, WSL @@ -194,9 +194,10 @@ Subagent files use YAML frontmatter for configuration, followed by the system prompt in Markdown: -Claude Code watches `~/.claude/agents/` and `.claude/agents/`. When you add or edit a subagent file on disk, or ask Claude to write one for you, Claude Code detects the change within a few seconds and the next delegation uses the updated definition, with no restart needed.Two cases still need a restart: +Claude Code watches `~/.claude/agents/` and `.claude/agents/`. When you add or edit a subagent file on disk, or ask Claude to write one for you, Claude Code detects the change within a few seconds and the next delegation uses the updated definition, with no restart needed.Three cases still need a restart: * The watcher covers only directories that existed when the session started, so after creating a scope’s first agent file in a new `agents` directory, restart to load it. + * Claude Code doesn’t watch `.claude/agents/` inside directories added with `--add-dir` or `/add-dir`, so after adding or editing a subagent there, restart to load the change. * Sessions started with `--disable-slash-commands` don’t watch these directories at all. .claude/agents/code-reviewer.md @@ -401,15 +402,7 @@ `bypassPermissions`| Skip permission prompts `plan`| Plan mode (read-only exploration) -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`.Even in this mode, some operations still prompt: - - * Explicit [`ask` rules](</docs/en/permissions#manage-permissions>) - * Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) - * MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) - * Root and home directory removals such as `rm -rf /` - * The [`isolatePeerMachines`](</docs/en/settings#available-settings>) approval for messages beyond this machine - -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`.Even in this mode, the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) still apply. 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 can’t 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. If bypass mode is disabled by [`permissions.disableBypassPermissionsMode`](</docs/en/permissions#managed-settings>), Claude Code ignores `permissionMode: bypassPermissions` in the frontmatter and the subagent runs with the parent session’s mode. Before v2.1.223, Claude Code applied the frontmatter mode even with bypass disabled. @@ -692,16 +685,16 @@ Subagents can run in the foreground or the background: * **Foreground subagents** block the main conversation until complete. Permission prompts are passed through to you as they come up. - * **Background subagents** run concurrently while you continue working. As of v2.1.186, when a background subagent reaches a tool call that needs permission, the prompt surfaces in your main session and names the subagent that is asking. Approve to let the subagent continue, or press Esc to deny that one tool call without stopping the subagent. Before v2.1.186, background subagents auto-denied any tool call that would have prompted. - -For each subagent Claude spawns, Claude Code picks the mode from the first of these cases that applies: - + * **Background subagents** run concurrently while you continue working. When a background subagent reaches a tool call that needs permission, Claude Code surfaces the prompt in your main session and names the subagent that is asking. Approve to let the subagent continue, or press Esc to deny that one tool call without stopping the subagent. Before v2.1.186, background subagents auto-denied any tool call that would have prompted. + +For each subagent Claude spawns with the Agent tool, Claude Code picks foreground or background from the first of these cases that applies: + + * If an in-process [agent team](</docs/en/agent-teams#limitations>) teammate spawned the subagent, Claude Code runs it in the foreground, and refuses with an error to spawn a subagent whose definition sets `background: true`. * If you set [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](</docs/en/env-vars>) to `1`, Claude Code runs the subagent in the foreground, in every kind of session and whether or not fork mode is on. - * If an in-process [agent team](</docs/en/agent-teams#limitations>) teammate spawned the subagent, Claude Code runs it in the foreground. * Where fork mode is on, as it is by default in an interactive session, Claude Code runs the subagent in the background, forks and non-fork subagents alike, and Claude can’t ask for the foreground. * Where fork mode is off, Claude runs the subagent in the background by default and in the foreground when it needs the result before continuing. Fork mode is off in [non-interactive mode](</docs/en/headless>) with `-p` and in the Agent SDK unless you turn it on. To keep a particular subagent in the background even when Claude wants the result, set its frontmatter `background` field to `true`. -Background subagents run with a smaller built-in tool set than foreground subagents, except for conversation forks, and they surface every permission prompt in your main session. A background subagent’s results reach Claude as a completion notification in a later turn. Claude waits for that notification before reporting the subagent’s results, and if you ask about progress first, it reports that the subagent is still running. Before v2.1.211, Claude sometimes reported results for a background subagent that hadn’t finished. You can also steer this yourself: +For a skill with `context: fork`, Claude Code follows the rules in [Run skills in a subagent](</docs/en/skills#run-skills-in-a-subagent>) instead, whether or not fork mode is on. Background subagents run with a smaller built-in tool set than foreground subagents, except for conversation forks, and they surface every permission prompt in your main session. When you answer one of those prompts with a choice that lasts beyond that one tool call, such as “Yes, allow all edits during this session”, Claude Code applies your answer to the whole session, including your main conversation. A background subagent’s results reach Claude as a completion notification in a later turn. Claude waits for that notification before reporting the subagent’s results, and if you ask about progress first, it reports that the subagent is still running. Before v2.1.211, Claude sometimes reported results for a background subagent that hadn’t finished. You can also steer this yourself: * Where fork mode is off, ask Claude to run a task in the background or in the foreground * Press **Ctrl+B** to background a running task @@ -977,7 +970,7 @@ * `1` turns fork mode on in non-interactive mode and the Agent SDK as well * `0` turns fork mode off in every kind of session -To keep fork mode on but stop Claude from spawning forks, deny the `fork` subagent type with an `Agent(fork)` rule. Subagents still run in the background. +To keep fork mode on but stop Claude from spawning forks, deny the `fork` subagent type with an `Agent(fork)` rule. Claude Code still runs the subagents Claude spawns in the background, apart from the same cases that stay in the foreground. ##
modified Subagents in the SDK View current →
--- a/subagents.md +++ b/subagents.md @@ -754,6 +754,7 @@ * **New`agents` directory**: the watcher covers only directories that existed when the session started, so the first file in a new directory needs a session restart. This is the most common cause. * **Invalid frontmatter or a duplicate`name`**: check the file’s YAML, and whether an existing agent already uses the `name`. * **`--disable-slash-commands`** : sessions started with this flag don’t watch these directories and always need a restart to load new files. + * **A file under an added directory** : Claude Code loads `.claude/agents/` from directories added with the `add_dirs` (Python) or `additionalDirectories` (TypeScript) option, or the CLI’s `--add-dir` or `/add-dir`, but doesn’t watch them, so a new or edited file there needs a session restart. * **A programmatic agent with the same name** : `agents` passed to `query()` override a filesystem agent with the same name. For the file format, see [how to write subagent files](</docs/en/sub-agents#write-subagent-files>).
modified Tools reference View current →
--- a/tools-reference.md +++ b/tools-reference.md @@ -92,12 +92,12 @@ * **`disallowedTools` only**: the subagent gets every parent tool except the listed ones. * **Both set** : `disallowedTools` takes precedence. A tool listed in both is removed. -In every case, the resolved set is limited to the [tools available to subagents](</docs/en/sub-agents#available-tools>): a tool that isn’t available to subagents is never granted, even when listed in `tools`. If every entry in a subagent’s `tools` list fails to match a usable tool, the Agent tool usually returns an error naming the entries instead of launching the subagent; see [Agent would be spawned with zero tools](</docs/en/errors#agent-would-be-spawned-with-zero-tools>) for the message and how to fix each entry. Launching the subagent doesn’t itself prompt for permission. Claude Code checks the subagent’s own tool calls against your permission rules as it runs. Where a subagent’s permission prompts appear depends on whether it runs in the foreground or the background. Claude Code runs subagents in the background by default. For the cases where one runs in the foreground, see [Run subagents in foreground or background](</docs/en/sub-agents#run-subagents-in-foreground-or-background>). +In every case, the resolved set is limited to the [tools available to subagents](</docs/en/sub-agents#available-tools>): a tool that isn’t available to subagents is never granted, even when listed in `tools`. If every entry in a subagent’s `tools` list fails to match a usable tool, the Agent tool usually returns an error naming the entries instead of launching the subagent; see [Agent would be spawned with zero tools](</docs/en/errors#agent-would-be-spawned-with-zero-tools>) for the message and how to fix each entry. Launching the subagent doesn’t itself prompt for permission. Claude Code checks the subagent’s own tool calls against your permission rules as it runs. Where you see a subagent’s permission prompts depends on whether it runs in the foreground or the background. Claude Code runs subagents in the background by default, apart from the [cases that run in the foreground](</docs/en/sub-agents#run-subagents-in-foreground-or-background>). * **Foreground subagents** show the same permission prompts you would see in the main conversation, at the moment each tool call happens. * **Background subagents** surface permission prompts in your main session as of v2.1.186. The prompt names which subagent is asking, and pressing Esc denies that one tool call without stopping the subagent. Before v2.1.186, background subagents auto-denied any tool call that would otherwise prompt and continued without that tool. -To limit what a subagent can reach in the first place, narrow its `tools` field, leave Bash off the list, or set deny rules in your settings, as described in [Control subagent capabilities](</docs/en/sub-agents#control-subagent-capabilities>). +To [limit what a subagent can reach](</docs/en/sub-agents#control-subagent-capabilities>) in the first place, narrow its `tools` field, for example by leaving Bash off the list, or set deny rules in your settings. ##
modified Agent SDK reference - TypeScript View current →
--- a/typescript.md +++ b/typescript.md @@ -496,7 +496,7 @@ `allowDangerouslySkipPermissions`| `boolean`| `false`| Enable bypassing permissions. Required when using `permissionMode: 'bypassPermissions'` `allowedTools`| `string[]`| `[]`| Tools to auto-approve without prompting. This does not restrict Claude to only these tools. If you name one of the [task-tracking tools](</docs/en/agent-sdk/todo-tracking#model-availability>) here, Claude Code also opts the session in. Other unlisted tools fall through to `permissionMode` and `canUseTool`. Use `disallowedTools` to block tools. See [Permissions](</docs/en/agent-sdk/permissions#allow-and-deny-rules>) `betas`| `SdkBeta``[]`| `[]`| Enable beta features -`canUseTool`| `CanUseTool`| `undefined`| Custom permission function, invoked only when the [permission flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) falls through to a prompt. Not invoked for calls auto-approved by `allowedTools`, allow rules, or `permissionMode`. `AskUserQuestion`, connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), and MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) reach it even if you’ve allowed them; in `dontAsk` mode these are denied instead. See `CanUseTool` for details +`canUseTool`| `CanUseTool`| `undefined`| Custom permission function, invoked only when the [permission flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) falls through to a prompt. Not invoked for calls auto-approved by `allowedTools`, allow rules, or `permissionMode`. An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). See `CanUseTool` for details `continue`| `boolean`| `false`| Continue the most recent conversation `cwd`| `string`| `process.cwd()`| Current working directory `debug`| `boolean`| `false`| Enable debug mode for the Claude Code process @@ -1024,7 +1024,7 @@ `CanUseTool` -Custom permission function type for controlling tool usage. The function is the SDK replacement for the interactive permission prompt: it’s invoked only when the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) resolves to a prompt. Tool calls already approved by an `allowedTools` entry, a settings allow rule, or the permission mode, such as `acceptEdits` or `bypassPermissions`, never invoke it. To gate every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>) instead. `AskUserQuestion`, MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), and connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) reach the function even when an allow rule matches. In `dontAsk` mode these calls are denied instead, without invoking it. +Custom permission function type for controlling tool usage. The function is the SDK replacement for the interactive permission prompt: it’s invoked only when the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) resolves to a prompt. Tool calls already approved by an `allowedTools` entry, a settings allow rule, or the permission mode, such as `acceptEdits` or `bypassPermissions`, never invoke it. To gate every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>) instead. An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>); see [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) for which of them reach the callback and what happens in `dontAsk` and `auto` mode. type CanUseTool = ( toolName: string, @@ -5352,7 +5352,7 @@ if ("result" in message) console.log(message.result); } -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. +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, apart from the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). This combination effectively allows the model to escape sandbox isolation silently. ##
modified Handle approvals and user input View current →
--- a/user-input.md +++ b/user-input.md @@ -32,7 +32,7 @@ 1. **Tool needs approval** : Claude wants to use a tool that isn’t auto-approved by a [permission rule](</docs/en/agent-sdk/permissions>) or permission mode. Check `tool_name` for the tool (e.g., `"Bash"`, `"Write"`). 2. **Claude asks a question** : Claude calls the `AskUserQuestion` tool. Check if `tool_name == "AskUserQuestion"` to handle it differently. If you specify a `tools` array, include `AskUserQuestion` for this to work. See Handle clarifying questions for details. -**The callback never fires for auto-approved tools.** Any approval earlier in the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>), an allow rule or a mode like `acceptEdits` or `bypassPermissions`, resolves the call before `canUseTool` is consulted. If you list a tool bare in `allowed_tools`, a `canUseTool` check for that tool never runs unless an ask rule or `plan` mode routes the call back to a prompt. For logic that must apply to every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>), which executes before the rest of the flow and can allow, deny, or modify requests.`AskUserQuestion`, MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), and connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) reach the callback even when an allow rule matches. In `dontAsk` mode these calls are denied instead, without invoking the callback. +**The callback never fires for auto-approved tools.** Any approval earlier in the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>), an allow rule or a mode like `acceptEdits` or `bypassPermissions`, resolves the call before `canUseTool` is consulted. If you list a tool bare in `allowed_tools`, a `canUseTool` check for that tool runs only when the [evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) routes the call back to a prompt, such as an ask rule or `plan` mode. For logic that must apply to every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>), which executes before the rest of the flow and can allow, deny, or modify requests.An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>); see [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) for which of them reach the callback and what happens in `dontAsk` and `auto` mode. You can also use the [`PermissionRequest` hook](</docs/en/agent-sdk/hooks#available-hooks>) to send external notifications (Slack, email, push) when Claude is waiting for approval.
modified Use Claude Code in VS Code View current →
--- a/vs-code.md +++ b/vs-code.md @@ -68,7 +68,10 @@ Review changes -When Claude wants to edit a file, it shows a side-by-side comparison of the original and proposed changes, then asks for permission. You can accept, reject, or tell Claude what to do instead. If you edit the proposed content directly in the diff view before accepting, Claude is told that you modified it so it does not assume the file matches its original proposal. +What you see depends on the [permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>) shown at the bottom of the prompt box: + + * In Auto or Edit automatically mode, Claude edits most files in your workspace without asking. + * In Manual mode, when Claude wants to edit a file, it shows a side-by-side comparison of the original and proposed changes, then asks for permission. You can accept, reject, or tell Claude what to do instead. If you edit the proposed content directly in the diff view before accepting, Claude is told that you modified it so it doesn’t assume the file matches its original proposal. For more ideas on what you can do with Claude Code, see [Common workflows](</docs/en/common-workflows>). @@ -82,7 +85,8 @@ The prompt box supports several features: - * **Permission modes** : click the mode indicator at the bottom of the prompt box to switch modes, or set the default in your VS Code user settings under `claudeCode.initialPermissionMode`. See [permission modes](</docs/en/permission-modes#switch-permission-modes>) for every mode the indicator offers. + * **Permission modes** : click the mode indicator at the bottom of the prompt box to switch permission modes. On Pro, Max, and Team plans, Auto is the built-in starting permission mode. See [how the extension chooses the starting permission mode](</docs/en/permission-modes#switch-permission-modes>) for what changes that, and every permission mode the indicator offers. + * **Auto** : a classifier reviews most actions instead of asking you. See [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) for what it reviews and blocks. * **Manual** : Claude asks permission before file edits and most shell commands. * **Plan** : Claude describes what it will do and waits for approval before making changes. VS Code automatically opens the plan as a full Markdown document where you can add inline comments to give feedback before Claude begins. * **Edit automatically** : Claude makes edits without asking. @@ -335,7 +339,7 @@ The extension has two types of settings: * **Extension settings** in VS Code: control the extension’s behavior within VS Code. Open with `Cmd+,` (Mac) or `Ctrl+,` (Windows/Linux), then go to Extensions → Claude Code. You can also type `/` and select **General Config** to open settings. - * **Claude Code settings** in `~/.claude/settings.json`: shared between the extension and CLI. Use for allowed commands, environment variables, hooks, and MCP servers. See [Settings](</docs/en/settings>) for details. + * **Claude Code settings** in `~/.claude/settings.json`: shared between the extension and CLI. Use it for allowed commands, environment variables, hooks, and MCP servers. On Pro, Max, and Team plans, it’s also one input to the permission mode conversations start in. [Switch permission modes](</docs/en/permission-modes#switch-permission-modes>) lists the order. See [Settings](</docs/en/settings>) for details. Add `"$schema": "https://json.schemastore.org/claude-code-settings.json"` to your `settings.json` to get autocomplete and inline validation for all available settings directly in VS Code. @@ -350,7 +354,7 @@ Setting| Default| Description ---|---|--- `useTerminal`| `false`| Launch Claude in terminal mode instead of graphical panel -`initialPermissionMode`| -| Controls approval prompts for new conversations: `default`, `plan`, `acceptEdits`, or `bypassPermissions`. `manual` is an alias for `default` and selects the mode labeled **Manual** in the mode indicator. When you leave it unset, Claude Code resolves the session’s starting mode itself. See [how to switch permission modes and set the session default](</docs/en/permission-modes#switch-permission-modes>). +`initialPermissionMode`| -| Controls approval prompts for new conversations: `default`, `plan`, `acceptEdits`, or `bypassPermissions`. `manual` is an alias for `default` and selects the mode labeled **Manual** in the mode indicator. When you leave it unset, the extension chooses the starting permission mode as described in [Switch permission modes](</docs/en/permission-modes#switch-permission-modes>). `preferredLocation`| `panel`| Where Claude opens: `sidebar` (right) or `panel` (new tab) `autosave`| `true`| Auto-save files before Claude reads or writes them `useCtrlEnterToSend`| `false`| Use Ctrl/Cmd+Enter instead of Enter to send prompts @@ -363,7 +367,7 @@ `environmentVariables`| `[]`| Set environment variables for the Claude process. Use Claude Code settings instead for shared config. `disableLoginPrompt`| `false`| Skip authentication prompts (for third-party provider setups) `allowDangerouslySkipPermissions`| `false`| Adds Bypass permissions to the mode selector. Use it only in sandboxes with no internet access. -`claudeProcessWrapper`| -| Executable used to launch the Claude process. The bundled binary path is passed as an argument when present. Set this to a separately installed `claude` binary if the extension build doesn’t include one for your platform. An “Unsupported platform” error at activation means no binary is bundled for your platform; see [which platforms have prebuilt binaries](</docs/en/troubleshoot-install#native-binary-not-found-after-npm-install>). +`claudeProcessWrapper`| -| Executable used to launch the Claude process. The bundled binary path is passed as an argument when present. Set this to a separately installed `claude` binary if the extension build doesn’t include one for your platform. In a wrapped setup, conversations start in Manual mode unless you set `initialPermissionMode` or picked Manual, Edit automatically, or Auto in an earlier conversation, because the extension skips the settings and built-in-default steps there; see [Switch permission modes](</docs/en/permission-modes#switch-permission-modes>). An “Unsupported platform” error at activation means no binary is bundled for your platform; see [which platforms have prebuilt binaries](</docs/en/troubleshoot-install#native-binary-not-found-after-npm-install>). ## @@ -509,7 +513,7 @@ Your code stays private. Claude Code processes your code to provide assistance but does not use it to train models. For details on data handling and how to opt out of logging, see [Data and privacy](</docs/en/data-usage>). With auto-edit permissions enabled, Claude Code can modify VS Code configuration files (like `settings.json` or `tasks.json`) that VS Code may execute automatically. To reduce risk when working with untrusted code: * Enable [VS Code Restricted Mode](<https://code.visualstudio.com/docs/editor/workspace-trust#_restricted-mode>) for untrusted workspaces - * Use manual approval mode instead of auto-accept for edits + * Use Manual mode instead of Edit automatically or Auto for edits * Review changes carefully before accepting them ###
modified Run parallel sessions with worktrees View current →
--- a/worktrees.md +++ b/worktrees.md @@ -205,7 +205,7 @@ * **The repository’s`.git` directory**: git commands in a worktree write to the main repository’s shared `.git` directory, and [sandboxing](</docs/en/sandboxing#filesystem-isolation>) allows those writes, so commands such as `git commit` work from inside a worktree with the sandbox enabled. * **Plugins** : plugins installed at [project scope](</docs/en/plugins-reference#plugin-installation-scopes>) from the main checkout also load in worktrees of the same repository, so you don’t need to reinstall them per worktree. Requires Claude Code v2.1.200 or later. - * **Permission approvals** : choosing “Yes, don’t ask again” for a Bash command in a worktree session saves the rule to the main checkout’s `.claude/settings.local.json`, so it applies in the main checkout and in every other worktree of the repository, and it survives the worktree’s removal. Before v2.1.211, an approval granted in a worktree was saved inside that worktree, didn’t apply elsewhere, and was lost when the worktree was removed. See [where approvals are saved](</docs/en/permissions#permission-system>). + * **Permission approvals** : choosing “Yes, and don’t ask again” for a Bash command in a worktree session saves the rule to the main checkout’s `.claude/settings.local.json`, so it applies in the main checkout and in every other worktree of the repository, and it survives the worktree’s removal. Before v2.1.211, an approval granted in a worktree was saved inside that worktree, didn’t apply elsewhere, and was lost when the worktree was removed. See [where approvals are saved](</docs/en/permissions#permission-system>). All three apply whether you create the worktree with `--worktree`, with `git worktree add`, or through the [desktop app](</docs/en/desktop#work-in-parallel-with-sessions>).