modified Set up Claude Code for your organization View current →
--- a/admin-setup.md +++ b/admin-setup.md @@ -62,9 +62,7 @@ Desktop reads the policy each time a WSL session starts, so you don’t need to restart the app after deploying it. If a device still refuses WSL sessions, open **Help > Troubleshooting > Show Logs in Explorer** in Claude Desktop on that device, which saves a copy of its log folder to Downloads. Search `main.log` in that copy for `[wslPolicyGate] denying WSL session`. The reason for the denial follows in parentheses, such as `(cli-file-present)`. If Claude Desktop was installed with the `.exe` installer, you can also read the live file at `%APPDATA%\Claude\logs\main.log`. After WSL sessions are enabled, extend your managed settings to them: * Deploy `wslInheritsWindowsSettings: true` through the HKLM registry or the `C:\Program Files\ClaudeCode` file so WSL sessions inherit the same policy as host sessions. - * Verify by running `/status` inside a WSL session and reading the `Setting sources` line. Claude Code names only the [managed source it selected](</docs/en/server-managed-settings#settings-precedence>), so what the line tells you depends on the session: - * **In a session that[fetches server-managed settings](</docs/en/server-managed-settings#platform-availability>) and receives any keys**: `Enterprise managed settings (remote)`, because Claude Code selects them ahead of the Windows sources, so the line doesn’t show whether the flag arrived. - * **In any other session** : `Enterprise managed settings (HKLM)` confirms a registry deployment. `(file)` names the Windows file or the distribution’s own `/etc/claude-code/managed-settings.json`, so it confirms a Windows file deployment only when the distribution has no managed file of its own. + * Verify by running `/status` inside a WSL session and reading the `Setting sources` line. To interpret what it lists, see [Read the source in /status](</docs/en/managed-settings#read-the-source-in-/status>). Processes inside the WSL 2 utility VM aren’t visible to Windows-side endpoint detection sensors. To observe in-distro process and file activity, check your endpoint detection vendor’s WSL guidance for a Linux sensor you can run inside the distribution and the exclusions it needs. Claude Code’s [OpenTelemetry tool-execution telemetry](</docs/en/monitoring-usage>) is emitted identically for WSL and native sessions.
modified Escalate hard decisions with the advisor tool View current →
--- a/advisor.md +++ b/advisor.md @@ -88,7 +88,7 @@ Sonnet 5| Fable, Opus, Sonnet 5| A Sonnet 4.6 advisor is rejected Opus 4.6| Fable, Opus, Sonnet 5| Sonnet 5 and Opus 4.6 are ranked as equally capable, so an Opus 4.6 main accepts a Sonnet 5 advisor Opus 4.7 or later| Fable, and Opus 4.7 or later| Opus 4.7 and later Opus models are ranked as equally capable, so any of them accepts another as an advisor. An Opus 4.7 main with an Opus 4.6 or Sonnet 5 advisor is rejected -Fable 5.1 or Fable 5| Fable 5.1, or the same Fable version| An Opus or Sonnet advisor is rejected, and so is a Fable 5 advisor for a Fable 5.1 main model +Fable 5.1 or Fable 5| Fable 5.1 or Fable 5| An Opus or Sonnet advisor is rejected Fable 5.1 requires Claude Code v2.1.257 or later. Both Fable models require [Fable access](</docs/en/model-config#work-with-fable>). Set the advisor as `fable`, `opus`, or `sonnet`. These aliases resolve to Claude Code’s built-in default version for each model family, which advances with new Claude Code releases. You can also pass a full model ID such as `claude-opus-5`. Subagents inherit the configured advisor and apply the same pairing check against their own model. Claude Code validates the pairing before sending a request:
modified How the agent loop works View current →
--- a/agent-loop.md +++ b/agent-loop.md @@ -169,7 +169,7 @@ Claude determines which tools to call based on the task, but you control whether those calls are allowed to execute. You can auto-approve specific tools, block others entirely, or require approval for everything. Three options work together to determine what runs: - * **`allowed_tools` / `allowedTools`** auto-approves listed tools. A read-only agent with `["Read", "Glob", "Grep"]` in its allowed tools list runs those tools without prompting. Tools not listed are still available but require permission. + * **`allowed_tools` / `allowedTools`** auto-approves listed tools. A read-only agent with `["Read", "Glob", "Grep"]` in its allowed tools list runs those tools without prompting. Tools not listed are still available, and calls to them that need approval fall through to the permission mode and `canUseTool`. * **`disallowed_tools` / `disallowedTools`** blocks listed tools, regardless of other settings. See [Permissions](</docs/en/agent-sdk/permissions>) for the order that rules are checked before a tool runs. * **`permission_mode` / `permissionMode`** controls how much human oversight you want. The SDK evaluates the active mode together with your allow and deny rules in a fixed order, described in [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>). See Permission mode for available modes. @@ -236,10 +236,10 @@ Mode| Behavior| Use case ---|---|--- -`"default"`| Tools not covered by allow rules trigger your `canUseTool` callback; no callback means deny| Interactive applications with a custom approval callback +`"default"`| Tool calls that need approval and aren’t covered by allow rules trigger your `canUseTool` callback; no callback means deny| Interactive applications with a custom approval callback `"acceptEdits"`| Auto-approves file edits and common filesystem commands (`mkdir`, `touch`, `mv`, `cp`, etc.); other Bash commands follow default rules| You trust Claude’s edits and want faster iteration, such as during prototyping or when working in an isolated directory `"plan"`| Claude explores and plans without editing your source files; file edits are never auto-approved and prompt through your `canUseTool` callback| You want Claude to propose changes without executing them, such as during code review or when you need to approve changes before they’re made -`"dontAsk"`| Never prompts. Tools pre-approved by [permission rules](</docs/en/settings-reference#permission-settings>) run; everything else is denied. `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 if you’ve allowed them| You want a fixed, explicit tool surface for a headless agent and prefer a hard deny over silent reliance on `canUseTool` being absent +`"dontAsk"`| Never prompts. Tools pre-approved by [permission rules](</docs/en/settings-reference#permission-settings>) run, and so do calls that need no approval in `default` mode, such as file reads inside your working directories; every call that would otherwise prompt is denied. `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 if you’ve allowed them| You want a fixed, explicit tool surface for a headless agent and prefer a hard deny over silent reliance on `canUseTool` being absent `"auto"`| Uses a model classifier to approve or deny permission prompts. See [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) for availability and behavior| Autonomous agents that still want safety guardrails on tool use `"bypassPermissions"`| Runs all allowed tools without asking, except tools matched by an explicit [`ask` rule](</docs/en/settings-reference#permission-settings>), 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. See [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) for the precedence order. In the TypeScript SDK, also requires `allowDangerouslySkipPermissions: true` in `options`. Can’t be used when running as root on Unix. Use only in isolated environments where the agent’s actions can’t affect systems you care about| CI, containers, or other isolated environments
modified Manage multiple agents with agent view View current →
--- a/agent-view.md +++ b/agent-view.md @@ -533,7 +533,7 @@ 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 your settings rather than from `--effort` or `/effort`, Claude Code reads your settings again each time it starts a process for the session. So when you edit the saved effort in `settings.json`, the change reaches sessions you background with `←` or `/bg`, and their later restarts. The saved effort is the [`effortLevel`](</docs/en/settings-reference#effortlevel>) key or a [`modelSettings`](</docs/en/settings-reference#modelsettings>) entry. 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. A prompt you stashed with [`Ctrl+S`](</docs/en/interactive-mode#general-controls>) while attached is kept with the session too. Reopen the session after its process was stopped or restarted, and `Ctrl+S` restores the stashed text. Pasted content in the stash doesn’t survive the restart. +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 your settings rather than from `--effort` or `/effort`, Claude Code reads your settings again each time it starts a process for the session. After you edit the saved effort in `settings.json`, the change reaches sessions you background with `←` or `/bg`, and their later restarts. The saved effort is the [`effortLevel`](</docs/en/settings-reference#effortlevel>) key or a [`modelSettings`](</docs/en/settings-reference#modelsettings>) entry. 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. A prompt you stashed with [`Ctrl+S`](</docs/en/interactive-mode#general-controls>) while attached is kept with the session too. Reopen the session after its process was stopped or restarted, and `Ctrl+S` restores the stashed text. Pasted content in the stash doesn’t survive the restart. ###
modified Share session output as artifacts View current →
--- a/artifacts.md +++ b/artifacts.md @@ -333,7 +333,7 @@ [Environment variable](</docs/en/env-vars>)| Set `CLAUDE_CODE_DISABLE_ARTIFACT=1` [Permission rule](</docs/en/permissions>)| Add `Artifact` to `permissions.deny` -Once you turn artifacts off in a [`--settings`](</docs/en/cli-reference#cli-flags>) file or with `CLAUDE_CODE_DISABLE_ARTIFACT`, or your administrator turns them off in [managed settings](</docs/en/server-managed-settings>), no settings file turns them back on. Before v2.1.242, a file higher in the [precedence stack](</docs/en/settings#settings-precedence>) could turn artifacts back on even when a lower-precedence file set `"enableArtifact": false`. You can also set `"enableArtifact": false` in a project’s `.claude/settings.json` or `.claude/settings.local.json` to turn artifacts off for sessions in that project. An `"enableArtifact": true` in either file doesn’t turn them back on. Honoring the key in project and local settings requires Claude Code v2.1.242 or later. +Once you turn artifacts off in a [`--settings`](</docs/en/cli-reference#cli-flags>) file or with `CLAUDE_CODE_DISABLE_ARTIFACT`, or your administrator turns them off in [managed settings](</docs/en/server-managed-settings>), no settings file turns them back on. Before v2.1.242, a file higher in the [precedence stack](</docs/en/settings#settings-precedence>) could turn artifacts back on even when a lower-precedence file set `"enableArtifact": false`. You can also set `"enableArtifact": false` in a project’s `.claude/settings.json` or `.claude/settings.local.json` to turn artifacts off for sessions in that project. An `"enableArtifact": true` in either file doesn’t turn them back on. Honoring the key in project and local settings requires Claude Code v2.1.242 or later. If you add a `WebFetch` deny or ask rule with no `domain:` part, it doesn’t turn artifacts off or block artifact reads. A [`WebFetch(domain:claude.ai)` rule in `deny` or `ask` does apply to artifact reads](</docs/en/permissions#allow-or-deny-every-fetch>). ##
modified Authentication View current →
--- a/authentication.md +++ b/authentication.md @@ -166,12 +166,7 @@ * **`claude setup-token` and `/install-github-app`**: enforce only `forceLoginMethod`, so they can mint a token in a different organization * **[Gateway](</docs/en/claude-apps-gateway>) sign-in**: selected by `forceLoginMethod: "gateway"` rather than restricted by it, and doesn’t authenticate against an Anthropic organization, so `forceLoginOrgUUID` doesn’t apply; use your gateway identity provider to restrict access -Deploy the keys through your device management tooling. [Server-managed settings](</docs/en/server-managed-settings>) reach only accounts that are already authenticated into your organization, so they can’t redirect a developer’s first login. If your organization distributes server-managed settings as well, set the keys in both places: managed-settings sources [don’t merge](</docs/en/server-managed-settings#settings-precedence>), and cached server-managed settings replace the device-managed file, apart from two kinds of keys that still fill in from a losing source: - - * **The`env` block**: [merges per key](</docs/en/server-managed-settings#per-key-exceptions-across-managed-sources>) in Claude Code v2.1.223 or later - * **The[cross-source lock keys](</docs/en/server-managed-settings#per-key-exceptions-across-managed-sources>)**: honored from any admin source - -`forceLoginMethod` and `forceLoginOrgUUID` are neither, so keep them in both places. The keys also decide whether a session that doesn’t use a login credential can start. See [`forceLoginOrgUUID`](</docs/en/settings-reference#forceloginorguuid>) in the settings reference for the full behavior. +Deploy the keys through your device management tooling. [Server-managed settings](</docs/en/server-managed-settings>) reach only accounts that are already authenticated into your organization, so they can’t redirect a developer’s first login. If your organization distributes server-managed settings as well, set the keys in both places: managed-settings sources [don’t merge](</docs/en/server-managed-settings#settings-precedence>), and cached server-managed settings replace the device-managed file apart from a few [per-key exceptions](</docs/en/server-managed-settings#per-key-exceptions-across-managed-sources>). `forceLoginOrgUUID` and the `"claudeai"` and `"console"` values of `forceLoginMethod` aren’t among those exceptions, so keep them in both places. The keys also decide whether a session that doesn’t use a login credential can start. See [`forceLoginOrgUUID`](</docs/en/settings-reference#forceloginorguuid>) in the settings reference for the full behavior. * **`ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper`**: blocked at startup, since organization membership can’t be verified for an environment credential * **Cloud provider sessions such as Amazon Bedrock** : not blocked, because they authenticate against your cloud provider. Restrict those through your cloud IAM policies
modified Best practices for Claude Code View current →
--- a/best-practices.md +++ b/best-practices.md @@ -409,7 +409,7 @@ Rewind with checkpoints -Every prompt you send creates a checkpoint. You can restore conversation, code, or both to any previous checkpoint. +Every prompt you send that starts a turn creates a checkpoint. You can restore conversation, code, or both to any previous checkpoint. Claude automatically snapshots files before each change so a checkpoint can restore them. Double-tap `Escape` or run `/rewind` to open the rewind menu. You can restore conversation only, restore code only, restore both, or summarize from a selected message. See [Checkpointing](</docs/en/checkpointing>) for details. Instead of carefully planning every move, you can tell Claude to try something risky. If it doesn’t work, rewind and try a different approach. Checkpoints are saved with the conversation, so you can close your terminal, resume the session later, and still rewind. @@ -468,7 +468,7 @@ * [Worktrees](</docs/en/worktrees>): run separate CLI sessions in isolated git checkouts so edits don’t collide * [Cross-session messaging](</docs/en/cross-session-messaging>): let the sessions you run yourself pass findings to each other - * [Desktop app](</docs/en/desktop#work-in-parallel-with-sessions>): manage multiple local sessions visually, each in its own worktree + * [Desktop app](</docs/en/desktop#work-in-parallel-with-sessions>): manage multiple local sessions visually, optionally each in its own worktree * [Claude Code on the web](</docs/en/claude-code-on-the-web>): run sessions in the cloud, on Anthropic-managed infrastructure by default * [Agent view](</docs/en/agent-view>): research preview. Run `claude agents` to dispatch sessions that keep running in the background and watch them from one screen * [Agent teams](</docs/en/agent-teams>): experimental and disabled by default. Automated coordination of multiple sessions with shared tasks, messaging, and a team lead
modified Claude Code changelog View current →
Show diff (112 lines)
--- a/changelog.md +++ b/changelog.md @@ -1,4 +1,109 @@ 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.269 + +September 11, 2026 + + * Added `claude plugin eval`: run a plugin’s eval suite against Claude Code and get scored, reproducible results (JSON + HTML report); see `claude plugin eval --help` + * Added `/output-style [name]` to list and switch output styles, including over Remote Control and in cloud and other headless sessions + * Added a diff of the files a Bash command changed to the Bash tool result when the Bash tool handles file edits (setting `bashEditDiffEnabled`) + * Added `OTEL_METRICS_INCLUDE_REPOSITORY` to tag OpenTelemetry metrics and events with `vcs.*` repository attributes; commit events get `vcs.ref.head.*` with `OTEL_LOG_TOOL_DETAILS` + * Added `CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS` to extend the LLM gateway `/v1/models` discovery timeout (default 3s) + * Added a spinner tip suggesting `/focus` for a view with just your prompt, a one-line work summary, and the response + * Added `CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS` (1–256) to raise the Workflow tool’s per-run concurrent agent limit for inference-bound fan-outs + * Fixed the prompt cache being partially invalidated on the turn after a response was cut off at the output-token limit and automatically resumed + * Fixed a case where resuming a session after interrupting Claude mid-thought could change how earlier context was re-sent, hurting prompt-cache reuse + * Fixed F1/F2/F4 not working in kitty-protocol terminals and Delete in st, Alt+arrows acting as Escape in rxvt-unicode, and Shift+punctuation typing the unshifted key in WezTerm (regression in 2.1.247) + * Fixed remote and headless sessions reporting “waiting for your input” while background agents were still running (set `CLAUDE_CODE_BG_TASKS_REPORT_RUNNING=0` to restore the old behavior) + * Fixed the terminal’s replies to capability queries (`^[[?1;2c`) appearing as stray text at startup in some terminals + * Fixed rows at the top or bottom of the transcript going blank in fullscreen after resizing the terminal + * Fixed a deny or ask permission rule starting with `!` applying beyond the settings source that wrote it; such a rule now applies only within its own source, and a bare `!` negation is ignored + * Fixed the git status Claude is told after a compaction: it is now the current status, not the one from the start of the session + * Fixed synced plugin MCP servers not connecting when a remote session resumes + * Fixed resumed headless sessions losing a turn’s replies when the model was switched or a request was retried mid-turn + * Fixed terminal escape codes, line breaks and oversized text from a background task’s on-disk record reaching the task list and task notifications when work is resumed + * Fixed CMYK JPEG images failing to attach with “cannot decode”; they are now converted and resized like other JPEGs + * Fixed the managed settings approval dialog not naming the collector for a gRPC telemetry endpoint set without a scheme + * Fixed plugin `headersHelper` consent prompts showing a URL path that could be misread as a different host + * Fixed plugin errors showing `[redacted URL]` in place of a relative Windows path with a folder name that starts with `@` + * Fixed missing cursor in the permission-rule, auto-mode-rule, add-directory, session-rename and feedback-review text fields when the terminal’s native cursor is enabled + * Fixed repeated clicks on a `/fork` receipt, each under a second apart, never backgrounding the session right away while it waited for the current tool to finish + * Fixed plugin LSP servers that reject `shutdown` params (e.g. rust-analyzer) being left running at session end; `exit` is now sent even if `shutdown` fails + * Fixed the attribution reminder overriding a CLAUDE.md or memory rule against commit and pull request attribution; lines set by managed settings still apply + * Fixed prompt suggestions being dropped for text in Japanese, Chinese, Thai and other languages written without spaces between words + * Fixed synchronized output being assumed from the terminal’s name in GNOME Terminal and Konsole versions that do not support it + * Fixed `permission_denials` in `--output-format stream-json` results omitting Read, Edit and Write calls blocked by a path-scoped deny rule + * Fixed sessions run through the SDK or the desktop app showing an unknown status in other sessions’ agent list + * Fixed `/insights` failing on Bedrock, Vertex, Foundry, and gateway deployments whose account can’t reach the default Opus model by using the session model there instead + * Fixed organization policy limits not loading for the session when another Claude Code process refreshed the login at the same moment + * Fixed Claude Desktop sessions using Bedrock, Vertex, or a gateway not getting the contextual “what Claude needs” turn-end notification text + * Fixed MCP servers reconnecting when an updated config only changed the order of the server URL’s query parameters + * Fixed the prompt box’s top border splitting into extra lines when viewing a background agent whose name or description has line breaks or is wider than the terminal + * Fixed sessions getting permanently stuck on “Prompt is too long” when auto-compaction had no complete earlier exchange to summarize (mostly Agent SDK sessions with very large prompts) + * Fixed `/goal` runs silently stalling after API errors, network drops, or token limits: the goal now retries with backoff, or pauses and says why, including until a usage limit resets + * Fixed prompt cache misses in cloud sessions by waiting briefly for server configuration before the first request + * Fixed `/btw` answers that contained made-up tool calls and output: the side question is now told not to write them, and any that appear are flagged as not executed + * Fixed `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` re-running a turn that had failed with an API error over 6 hours earlier, or longer ago than `CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS` when set + * Fixed organization plugins enabled through managed settings not loading in headless sessions and on Claude Desktop (once Desktop bundles this CLI version); they load from the next session + * Fixed plugin archives extracted for a session being readable by other local users, extracted files keeping world-writable bits from the archive, and stale files surviving re-extraction + * Fixed `Edit()` deny rules and the write-path check not applying to the file a Bash `tee` command writes; a `Bash(tee:*)` allow rule no longer covers destinations outside the working directories + * Fixed stray characters like `22c`, or a terminal’s color or version reply, being typed into the prompt at startup over slow connections (ssh, browser terminals) + * Fixed the terminal’s block cursor showing under the interface in rxvt-unicode after leaving or re-entering fullscreen + * Fixed the cursor block staying visible after returning from an external editor in fullscreen mode on rxvt-unicode + * Fixed the interface being drawn twice after returning from an external editor (Ctrl+G) outside fullscreen mode + * Fixed the interface being drawn twice in Konsole after returning from an external editor + * Windows: Fixed PowerShell tool commands sent to the background stopping when Claude Code exits + * Improved the `/diff` panel to open fully rendered in one step instead of showing a loading state first + * Improved prompt suggestion filtering for Japanese, Chinese and Korean text: mixed-script and single-word suggestions are kept, and meta or evaluative text is dropped as it is for English + * Improved the Skill tool’s “Unknown skill” error to name the plugin skill’s full name when a bare name matches exactly one plugin skill + * Improved keyboard support over SSH and in unrecognized terminals: terminals that answer the kitty keyboard query (such as foot and Alacritty 0.16+) now get Shift+Enter and Ctrl+Shift shortcuts + * Improved responsiveness in long sessions: transcript updates no longer re-process the whole conversation to build the collapsed tool-use summaries + * Improved first-party sessions with telemetry disabled: an `alwaysLoad` MCP server that finishes connecting mid-conversation is usable on the next turn without a tool-search round trip + * Changed `/ultrareview --post` to post the PR comment directly when the findings arrive and print the comment link, instead of starting a second cloud session to post it + * Changed artifact database reads that save into the session scratchpad so they no longer stop for working-folder approval + * Changed skills synced from claude.ai in cloud sessions to be named `anthropic-skills:<name>`, matching Claude Desktop; the bare name still works when nothing else uses it + * [VSCode] Added an agent map: an “N agents” footer pill opens a map of the session’s sub-agents with per-agent cards, Stop agent, and read-only transcripts + * [VSCode] Added a Hooks dialog to the command menu for viewing hooks and adding, editing, or removing them in user, project, and local settings; managed, plugin, and session hooks stay read-only + * [VSCode] Added live progress rows for running subagents under the tool-call groups in Focus view + * [VSCode] Added a Permission rules dialog that lists permission rules and adds or removes them in user, project, and local settings; startup-option, session-only, and managed rules stay read-only + * [VSCode] Added a Cancel button to the Switch account screen that returns to your session as the current account + * [VSCode] Fixed Focus view showing a turn started by a delivered plain-text prompt, such as a scheduled task’s, as part of the previous turn + * [VSCode] Fixed the footer’s prompt cache clock hiding its minutes when the panel is narrow + * [VSCode] Fixed the session list keeping sessions from the default folder when `CLAUDE_CONFIG_DIR` is set in a settings file or the `environmentVariables` setting + * [VSCode] Fixed a plan preview that finished loading late sometimes hiding its comment box or showing an older plan + * [VSCode] Fixed a plan preview accepting comments that went nowhere after its Claude tab closed + * [VSCode] Fixed the prompt cache clock and reopen notice for a session compacted after its last reply and then closed, which now reads as cold when reopened + * [VSCode] Fixed a session renamed in the extension while Remote Control is on keeping its old name on claude.ai/code + * [VSCode] Fixed the “Enable Remote Control for all sessions” toggle keeping its last position after the setting was reset to default from a terminal + * [VSCode] Fixed restored Claude tabs not counting as open in the session list after a window reload until clicked, and their row opening a second tab + * [VSCode] Fixed Switch account making a tab forget its dismissed usage-limit warnings when you sign back in as the same account + * [VSCode] Fixed a session rename being replaced by the generated name after a window reload when the session was renamed during a long turn + * [VSCode] Fixed the sidebar usage meter keeping a stale per-model weekly limit row after the account loses that limit + * [VSCode] Fixed a rare case where an @-mention sent with the keyboard shortcut while a new chat view was still starting could be inserted into the input long after the keystroke + * [VSCode] Fixed the session list jumping down when the Account & usage header appeared a moment after opening the Claude side bar + * [VSCode] Improved documents and messages written for someone other than the user: Claude now writes them for that audience and names it at the top of its reply + * [VSCode] Improved screen reader and keyboard accessibility in the slash-command menu, @-mention menu, output-style picker, Send/Stop button, permission and question cards, and onboarding checklist + * [VSCode] Changed the current-file chip in the message box: an X now removes it, replacing the Hide toggle + * [VSCode] Removed the Claude Code items from a session tab’s right-click menu and the editor title bar’s ”…” menu; they could not act on the tab the menu was opened on + * [Claude Code on the web] Added taking back a queued message in a cloud session before Claude reads it: remove it from the queue, or press Esc or Up, and the text returns to the message box + * [Claude Code on the web] Fixed `/model default` in a cloud session leaving every later message failing in organizations that restrict which models Claude Code can use + * [Claude Code on the web] Fixed one-off scheduled routines occasionally running a second time after a transient server error + * [Claude Code on the web] Fixed routine runs that use subagents sometimes being treated as finished too early, which could skip the retry after a real failure or start a duplicate run + * [Claude Code on the web] Fixed file links in cloud session transcripts opening a GitHub 404 when Claude was working from a subfolder of the repository + * [Claude Code on the web] Changed the Cloud environments admin page to list every environment instead of capping each table at five rows behind a Show more control that could be unreachable + * [Claude Code on the web] Changed claude.ai/code for Free-plan users to open the plans page with a path to upgrade, instead of a “Disabled by org admin” page with no way forward + * [Claude Tag] Added a confirmation dialog before Connect all or Disconnect on a GitHub installation in admin settings, to guard against accidental organization-wide changes + * [Claude Tag] Fixed threads occasionally going silent after a failed turn because the failure notice was dropped when Slack briefly rate-limited it; the notice is now retried + * [Claude Tag] Fixed Claude accepting a switch to a model your organization hasn’t enabled and then quietly answering with a fallback model; it now declines and says an admin can enable it + * [Claude Tag] Fixed a table posting as raw pipe text when Claude attached files to the same message; the table now posts as a normal reply and the files follow with a plain caption + * [Claude Tag] Fixed `@Claude !restart` at the top level of a channel where Claude isn’t active starting an unrelated conversation; it now privately says there is nothing to restart + * [Claude Tag] Fixed plugin rows in Slack access settings showing an unlabeled raw ID with no way to turn the plugin off; they now show its name and link to the bundle that manages it + * [Claude Tag] Fixed the shared-session banner and Share dialog on sessions started from Slack claiming the whole organization could open the link; they now name the Slack channel’s audience + * [Claude Tag] Improved load time of the admin settings page and its Slack channel picker, most noticeably for organizations with many channels or several connected workspaces + * [Claude Tag] Improved scheduled routines in Slack channels: a routine run can now reply in an existing thread instead of always posting a new top-level channel message + * [Claude Tag] Improved the timestamp on Claude’s live progress checklists to show each reader’s local time and how long ago it was updated, instead of a fixed UTC time ​
modified Checkpointing View current →
--- a/checkpointing.md +++ b/checkpointing.md @@ -6,7 +6,7 @@ How checkpoints work -As you work with Claude, checkpointing automatically captures the state of your code before each user prompt. +As you work with Claude, checkpointing automatically captures the state of your code before each prompt you send that starts a turn. ### @@ -16,7 +16,7 @@ Claude Code tracks all changes made by its file editing tools: - * Every user prompt creates a new checkpoint + * Every prompt you send that starts a turn creates a new checkpoint * Claude Code keeps file snapshots for the 100 most recent checkpoints in a session. Discarding an older checkpoint deletes the snapshot files that no remaining checkpoint references, except each file’s first snapshot, which the VS Code extension uses as the baseline for its session diffs. * Claude Code saves checkpoints with the conversation, so you can still run `/rewind` after you resume a session * Claude Code deletes a session’s file snapshots in the [retention sweep](</docs/en/claude-directory#cleaned-up-automatically>), by default about 30 days after the session last saved one. Rewinding to a checkpoint whose snapshots are gone can fail with [`No files were restored`](</docs/en/errors#no-files-were-restored>). To keep snapshots longer, set [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>). @@ -31,7 +31,7 @@ If the prompt input contains text, double `Esc` clears it instead of opening the menu. The cleared text is saved to your input history, so press `Up` to recall it after you finish in the rewind menu. -The rewind menu lists each prompt you sent during the session. Select the point you want to act on, then choose an action: +The rewind menu lists each prompt you sent during the session, except messages that joined a running turn. Select the point you want to act on, then choose an action: * **Restore code and conversation** : revert both code and conversation to that point * **Restore conversation** : rewind to that message while keeping current code @@ -116,6 +116,14 @@ ​ +Messages sent mid-turn not checkpointed + +When a message you [queue while Claude works](</docs/en/interactive-mode#queue-messages-while-claude-works>) reaches Claude within the running turn, it joins that turn instead of starting a new one. The message appears in the conversation, but Claude Code doesn’t create a checkpoint for it, and the rewind menu doesn’t list it. A queued message that Claude Code sends as its own turn gets a checkpoint as usual. To remove such a message, or undo the edits Claude made after it, rewind to the prompt that started the turn. That rewinds the whole turn, including the work Claude did before your message arrived. + +### + +​ + Symlinked and hard-linked paths not restored Checkpointing doesn’t rewind symlinked or hard-linked files. When you pick **Restore code** or **Restore code and conversation** from the `/rewind` menu, Claude Code skips any tracked path that is a symlink or hard link and shows a `Restored the code, but skipped N files` warning. The skipped files keep their current contents. To undo the session’s changes to one of them, ask Claude to reverse the edit or edit the file yourself. Config files a dotfile manager symlinks into your project and files pnpm hard-links into place both fall into this category. To see which paths a restore skips, turn on debug logging with `/debug` before you restore: the debug log at `~/.claude/debug/<session-id>.txt` names each skipped path. For every skip reason and the recovery steps, see [the skipped-files entry in the error reference](</docs/en/errors#restored-the-code-but-skipped-files>).
modified Claude apps gateway for Amazon Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry View current →
--- a/claude-apps-gateway.md +++ b/claude-apps-gateway.md @@ -415,7 +415,9 @@ Per-user and per-group spend limits| Available| See [Spend limits](</docs/en/claude-apps-gateway-spend-limits>) Server-side web search| Not available| The CLI can’t see which upstream provider the gateway routes to, so it can’t verify web search support and disables WebSearch on gateway sessions [Remote Control](</docs/en/remote-control>)| Not available| The CLI shows [an error naming the gateway](</docs/en/errors#remote-control-requires-the-anthropic-api>) -Standard prompt caching| Available| The gateway forwards `cache_control` breakpoints to every upstream, and the CLI marks the [system context it appends mid-conversation](</docs/en/prompt-caching#where-the-cache-lives>) for caching on gateway sessions, as it does on every other provider and connection. +[`/design-sync`](</docs/en/commands#all-commands>) and `/design-login`| Not available| Both need claude.ai, which the CLI doesn’t contact on gateway sessions, so neither command appears there +Features that need feature-flag fetching, such as `/import` and `claude import`| Not available| The CLI skips the flag fetch on gateway sessions. [Features that need feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) lists what that turns off +Standard prompt caching| Available| The gateway forwards `cache_control` breakpoints to every upstream. [Where the cache lives](</docs/en/prompt-caching#where-the-cache-lives>) covers which blocks the CLI marks, including the system context it appends mid-conversation 1-hour cache TTL| Not available| The CLI omits the extended-cache-ttl beta on gateway sessions, because not every upstream the gateway can route to supports the 1-hour TTL, so prompt caching through the gateway uses the 5-minute TTL; see the beta-header note above Auto mode| Available| Follows the [third-party provider rules](</docs/en/permission-modes#enable-auto-mode-on-bedrock-agent-platform-or-foundry>): only the models eligible on third-party providers can use it. Before v2.1.207, auto mode on gateway sessions required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`, deliverable through the managed policy `env` block First-party-only optimizations such as global cache scope and token-efficient tools| Not available| The CLI doesn’t enable them on gateway sessions; see the beta-header note above
modified Claude apps gateway configuration View current →
--- a/claude-apps-gateway-config.md +++ b/claude-apps-gateway-config.md @@ -573,7 +573,7 @@ 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, in place of server-managed settings. It therefore ignores the settings [restricted to OS-level policy sources](</docs/en/server-managed-settings#current-limitations>), such as `policyHelper` and `wslInheritsWindowsSettings`. The gateway validates each document against the CLI’s settings schema at boot, so an unrecognized top-level key 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-reference#all-settings>). The keys most operators reach for first: +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, in place of server-managed settings. It therefore ignores the settings [restricted to OS-level policy sources](</docs/en/server-managed-settings#current-limitations>), such as `policyHelper` and `wslInheritsWindowsSettings`. The gateway validates each document against the CLI’s settings schema at boot, so an unrecognized top-level key 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 include `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-reference#all-settings>). The keys most operators reach for first: managed: policies:
modified Use Claude Code on the web View current →
--- a/claude-code-on-the-web.md +++ b/claude-code-on-the-web.md @@ -30,14 +30,12 @@ Cloud sessions need access to your GitHub repositories to clone code and push branches. You can grant access in two ways: -Method| How it works| Best for ----|---|--- -**GitHub App**| Authorize the Claude GitHub App during [web onboarding](</docs/en/web-quickstart>).| Browser onboarding; teams that want Auto-fix -**`/web-setup`**| Run `/web-setup` in your terminal to sync your local `gh` CLI token to your Claude account.| Individual developers who already use `gh` - -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. For how `/schedule` checks that access before creating a routine, see [Repositories and branch permissions](</docs/en/routines#repositories-and-branch-permissions>). See [Connect from your terminal](</docs/en/web-quickstart#connect-from-your-terminal>) for the `/web-setup` walkthrough. Quick web setup is an organization setting that lets members connect GitHub with `/web-setup`, skips the Claude GitHub App install prompt during browser onboarding, and has browser onboarding create the [**Default** environment](</docs/en/cloud-environments#the-default-environment>) for them instead of showing the environment form. On Team and Enterprise plans it’s off by default, which hides `/web-setup`. An [Owner](</docs/en/server-managed-settings#access-control>) turns it on with the **Quick web setup** toggle at [**Admin settings > Claude Code**](<https://claude.ai/admin-settings/claude-code>). +Method| How you connect| Repositories sessions can reach| Best for +---|---|---|--- +**GitHub App**| Authorize the Claude GitHub App during [web onboarding](</docs/en/web-quickstart>)| Any public repository, and private repositories that the Claude GitHub App is installed on| Browser onboarding; teams that want Auto-fix +**`/web-setup`**| Run `/web-setup` in your terminal to send your local `gh` CLI token to your Claude account| Any repository your `gh` token can access, whether or not the App is installed| Individual developers who already use `gh` + +Installing the Claude GitHub App on a repository also enables Auto-fix for pull requests in it. For how `/schedule` checks repository access before creating a routine, see [Repositories and branch permissions](</docs/en/routines#repositories-and-branch-permissions>). See [Connect from your terminal](</docs/en/web-quickstart#connect-from-your-terminal>) for the `/web-setup` walkthrough, including what `/web-setup` stores and how to remove it. Quick web setup is an organization setting that lets members connect GitHub with `/web-setup`, skips the Claude GitHub App install prompt during browser onboarding, and has browser onboarding create the [**Default** environment](</docs/en/cloud-environments#the-default-environment>) for them instead of showing the environment form. On Team and Enterprise plans it’s off by default, which hides `/web-setup`. An [Owner](</docs/en/server-managed-settings#access-control>) turns it on with the **Quick web setup** toggle at [**Admin settings > Claude Code**](<https://claude.ai/admin-settings/claude-code>). Organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled can’t use `/web-setup` or other cloud session features. @@ -61,7 +59,7 @@ claude --cloud "Fix the authentication bug in src/auth/login.ts" -This creates a new cloud session on claude.ai. The cloud VM clones your current directory’s GitHub remote at your current branch, not your local checkout, so push first if you have local commits. `--cloud` works with a single repository at a time. The task runs in the cloud while you continue working locally. The older `--remote` spelling still works as a deprecated alias for `--cloud`. While the cloud container starts, the CLI shows a live checklist of setup steps, such as cloning the repository and running your [setup script](</docs/en/cloud-environments#setup-scripts>). It queues messages you type during provisioning and sends them once the session is ready. +This creates a new cloud session on claude.ai. The cloud VM clones your current directory’s GitHub remote at your current branch, not your local checkout, so push first if you have local commits. See Send local repositories without GitHub for the cases where Claude Code uploads your local repository instead of cloning. `--cloud` works with a single repository at a time. The task runs in the cloud while you continue working locally. The older `--remote` spelling still works as a deprecated alias for `--cloud`. While the cloud container starts, the CLI shows a live checklist of setup steps, such as cloning the repository and running your [setup script](</docs/en/cloud-environments#setup-scripts>). It queues messages you type during provisioning and sends them once the session is ready. `--cloud` creates cloud sessions. `--remote-control` is unrelated: it exposes a local CLI session for monitoring from the web. See [Remote Control](</docs/en/remote-control>). @@ -95,7 +93,7 @@ Send local repositories without GitHub -When you run `claude --cloud` from a repository that isn’t connected to GitHub, Claude Code bundles your local repository and uploads it directly to the cloud session. The bundle includes your full repository history across all branches, plus uncommitted changes to tracked files. On macOS, Linux, and WSL, Claude Code leaves uncommitted changes to files named like credentials or keys out of the upload and names the files it left out. This covers `.env` files, Terraform `*.tfvars` files, and key files such as `id_rsa` and `*.pem`. The session starts with the committed version of each, or without the file if none is committed. In a linked worktree, submodule, or similar layout, Claude Code uploads these changes with the rest and names the files it uploads. This fallback activates automatically when GitHub access isn’t available. To force it even when GitHub is connected, set `CCR_FORCE_BUNDLE=1`: +When you run `claude --cloud` from a repository that has no git remote, or from a github.com repository that the Claude GitHub App isn’t installed on, Claude Code bundles your local repository and uploads it directly to the cloud session. This applies even if you connected GitHub with `/web-setup`. The bundle includes your full repository history across all branches, plus uncommitted changes to tracked files. On macOS, Linux, and WSL, Claude Code leaves uncommitted changes to files named like credentials or keys out of the upload and names the files it left out. This covers `.env` files, Terraform `*.tfvars` files, and key files such as `id_rsa` and `*.pem`. The session starts with the committed version of each, or without the file if none is committed. In a linked worktree, submodule, or similar layout, Claude Code uploads these changes with the rest and names the files it uploads. To upload a bundle even when Claude Code would otherwise clone from the remote, set `CCR_FORCE_BUNDLE=1`: CCR_FORCE_BUNDLE=1 claude --cloud "Run the test suite and fix any failures" @@ -104,7 +102,7 @@ * The directory must be a git repository with at least one commit * The bundled repository must be under 100 MB. Larger repositories fall back to bundling only the current branch, then to a single squashed snapshot of the working tree, and fail only if the snapshot is still too large * Untracked files are not included; run `git add` on files you want the cloud session to see - * Sessions created from a bundle can’t push back to a remote unless you also have GitHub authentication configured + * Sessions created from a bundle can push back to a GitHub remote only when your GitHub connection has push access to that repository ### @@ -339,7 +337,7 @@ * Check [status.claude.com](<https://status.claude.com>) for cloud session incidents * Retry after a minute, as capacity is provisioned on demand - * Confirm your repository is reachable. The connecting GitHub account must have access to the repository on GitHub, either through the Claude GitHub App authorization or a `gh` token synced via `/web-setup`. Installing the App on the repository isn’t required. See GitHub authentication options. + * Confirm your GitHub connection can reach the repository by following [No repositories appear after connecting GitHub](</docs/en/web-quickstart#no-repositories-appear-after-connecting-github>) ### @@ -379,7 +377,7 @@ * **Rate limits** : Claude Code on the web shares rate limits with all other Claude and Claude Code usage within your account. Running multiple tasks in parallel consumes more rate limits proportionately. There is no separate compute charge for the cloud VM. * **Repository authentication** : you can only move sessions from web to local when you are authenticated to the same account - * **Platform restrictions** : repository cloning and pull request creation require GitHub. Self-hosted [GitHub Enterprise Server](</docs/en/github-enterprise-server>) instances are supported for Team and Enterprise plans. GitLab, Bitbucket, and other non-GitHub repositories can be sent to cloud sessions as a local bundle, but the session can’t push results back to the remote + * **Platform restrictions** : repository cloning and pull request creation require GitHub. Self-hosted [GitHub Enterprise Server](</docs/en/github-enterprise-server>) instances are supported for Team and Enterprise plans. You can send a GitLab, Bitbucket, or other non-GitHub repository to a cloud session as a local bundle by setting `CCR_FORCE_BUNDLE=1`, but the session can’t push results back to that remote * **Organization IP allowlist** : cloud sessions call the Anthropic API from Anthropic-managed infrastructure, not your network, while sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) call it from your own network. If your organization has [IP allowlisting](<https://support.claude.com/en/articles/13200993-restrict-access-to-claude-with-ip-allowlisting>) enabled, every Anthropic-hosted cloud session fails with an authentication error. The same applies to [Code Review](</docs/en/code-review>) and to [routines](</docs/en/routines>) that run on Anthropic-hosted environments; a routine routed to a self-hosted environment calls the API from your own network. Contact [Anthropic support](<https://support.claude.com/>) to exempt Anthropic-hosted services from your organization’s IP allowlist. ##
modified CLI reference View current →
--- a/cli-reference.md +++ b/cli-reference.md @@ -134,7 +134,7 @@ `--teleport`| Resume a [web session](</docs/en/claude-code-on-the-web>) in your local terminal| `claude --teleport` `--teammate-mode`| Set how [agent team](</docs/en/agent-teams>) teammates display: `in-process` (default), `auto`, `tmux`, or `iterm2` (added in v2.1.186). Overrides the [`teammateMode`](</docs/en/settings-reference#teammatemode>) setting for this session. See [Choose a display mode](</docs/en/agent-teams#choose-a-display-mode>)| `claude --teammate-mode auto` `--tmux`| Create a tmux session for the worktree. Requires `--worktree`. Uses iTerm2 native panes when available; pass `--tmux=classic` for traditional tmux| `claude -w feature-auth --tmux` -`--tools`| Restrict which built-in tools Claude can use. Use `""` to disable all, `"default"` for all, or tool names like `"Bash,Edit,Read"`. If you name one of the [task-tracking tools](</docs/en/tools-reference#task-tool-availability>) here, Claude Code also opts the session in. The flag doesn’t affect MCP tools; to deny those too, use `--disallowedTools "mcp__*"`. A list that omits [`EndConversation`](</docs/en/tools-reference#endconversation-tool-behavior>) doesn’t remove it; `""` removes it only when no MCP tools remain| `claude --tools "Bash,Edit,Read"` +`--tools`| Restrict which built-in tools Claude can use. Use `""` to disable all, `"default"` for the default set, or tool names like `"Bash,Edit,Read"`. On macOS, Linux, and WSL, the default set leaves out `Glob` and `Grep`, as described under [Glob tool behavior](</docs/en/tools-reference#glob-tool-behavior>). If you name one of the [task-tracking tools](</docs/en/tools-reference#task-tool-availability>) here, Claude Code also opts the session in. The flag doesn’t affect MCP tools; to deny those too, use `--disallowedTools "mcp__*"`. A list that omits [`EndConversation`](</docs/en/tools-reference#endconversation-tool-behavior>) doesn’t remove it; `""` removes it only when no MCP tools remain| `claude --tools "Bash,Edit,Read"` `--verbose`| Enable verbose logging, shows full turn-by-turn output. Overrides the [`viewMode`](</docs/en/settings-reference#viewmode>) setting for this session| `claude --verbose` `--version`, `-v`| Output the version number| `claude -v` `--worktree`, `-w`| Start Claude in an isolated [git worktree](</docs/en/worktrees>) at `<repo>/.claude/worktrees/<name>`. If you don’t give a name, Claude Code generates one. Pass `#<number>`, a GitHub pull request URL, or a GitLab merge request URL to [fetch that PR or MR from `origin` and branch the worktree from it](</docs/en/worktrees#branch-from-a-pull-request>). Branching from a GitLab merge request requires Claude Code v2.1.233 or later| `claude -w feature-auth`
modified Commands View current →
--- a/commands.md +++ b/commands.md @@ -55,7 +55,7 @@ `/deep-research <question>`| **[Workflow](</docs/en/workflows#bundled-workflows>).** Fan out web searches on a question, fetch and cross-check sources, and synthesize a cited report `/design [brief]`| **[Skill](</docs/en/skills#bundled-skills>).** Draft UI mockups, screen flows, landing pages, or posters as artboards on one canvas, published as an [artifact](</docs/en/artifacts#draft-a-design-canvas>) that runs a research preview of Claude Design’s editor, for example `/design a settings screen for a mobile banking app`. Where saving is enabled for your account, you edit the artboards on the canvas and save to publish a new version; otherwise you view the draft and export it as PNG or PDF. Requires a session where [artifacts are available](</docs/en/artifacts#availability>) and Claude Code v2.1.234 or later. Available on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS, artifacts aren’t available, so the command is unavailable there `/design-login`| Authorize design-system access for `/design-sync` with your claude.ai account -`/design-sync [hint]`| **[Skill](</docs/en/skills#bundled-skills>).** Convert your repo’s React design system and upload it to [Claude Design](<https://claude.ai/design>), so designs it produces use your real components. Optionally name the design system, for example `/design-sync Acme DS`. A first-time sync verifies every component and can take a few hours on a large repo. Available on the Anthropic API; on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS the underlying tool can’t reach claude.ai, so the command is unavailable +`/design-sync [hint]`| **[Skill](</docs/en/skills#bundled-skills>).** Convert your repo’s React design system and upload it to [Claude Design](<https://claude.ai/design>), so designs it produces use your real components. Optionally name the design system, for example `/design-sync Acme DS`. A first-time sync verifies every component and can take a few hours on a large repo. Available on the Anthropic API. It needs claude.ai, which the CLI doesn’t contact on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS, or through a [Claude apps gateway](</docs/en/claude-apps-gateway#availability-and-limitations>), so the command is unavailable there `/desktop`| Continue the current session in the Claude Code Desktop app. Requires macOS or x64 Windows and a Claude subscription. Alias: `/app` `/diff`| Review the changes in your working tree, including the edits Claude has made so far. See [Review changes with /diff](</docs/en/interactive-mode#review-changes-with-%2Fdiff>) `/doctor`| **[Skill](</docs/en/skills#bundled-skills>).** Run a setup checkup that diagnoses issues and can fix them. Checks installation health, including duplicate or leftover installs, `PATH` problems, and unparseable settings files. Finds unused skills, MCP servers, and plugins versus their context cost, flags slow [hooks](</docs/en/hooks>), and checks for a newer version on your [release channel](</docs/en/setup#configure-release-channel>). Deduplicates local `CLAUDE.md` files against checked-in ones, trims checked-in [`CLAUDE.md`](</docs/en/memory#my-claude-md-is-too-large>) files by cutting content Claude could derive from the codebase, and migrates the always-loaded guidance that remains into [skills](</docs/en/skills>) and nested `CLAUDE.md` files that load on demand. Also offers to make [auto mode](</docs/en/permissions#permission-modes>) your default and to [pre-approve](</docs/en/permissions>) frequently denied read-only commands. Reports findings first and asks for confirmation before changing anything. From the terminal, `claude doctor` prints read-only installation diagnostics without starting a session. Alias: `/checkup`. The `CLAUDE.md` trim check requires Claude Code v2.1.206 or later. Before v2.1.205, `/doctor` opened a read-only diagnostics screen and pressing `f` sent the report to Claude @@ -72,7 +72,7 @@ `/help`| Show help and available commands `/hooks`| View [hook](</docs/en/hooks>) configurations for tool events `/ide`| Manage IDE integrations and show status -`/import [codex|gemini|cursor] [--dry-run] [--yes]`| Bring configuration from OpenAI Codex, Google Gemini CLI, or Cursor on your machine into Claude Code, including instruction files, MCP servers, commands, subagents, and skills. In [non-interactive mode](</docs/en/headless>) with `-p`, `/import` lists what it found and gives you the command that confirms the import. Add `--dry-run` to preview without writing anything, or `--yes` to skip the interactive picker. Not available on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS. Also unavailable when you turn off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>). Requires Claude Code v2.1.213 or later. Importing from Cursor requires v2.1.265 or later +`/import [codex|gemini|cursor] [--dry-run] [--yes]`| Bring configuration from OpenAI Codex, Google Gemini CLI, or Cursor on your machine into Claude Code, including instruction files, MCP servers, commands, subagents, and skills. In [non-interactive mode](</docs/en/headless>) with `-p`, `/import` lists what it found and gives you the command that confirms the import. Add `--dry-run` to preview without writing anything, or `--yes` to skip the interactive picker. Not available on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS, or through a [Claude apps gateway](</docs/en/claude-apps-gateway#availability-and-limitations>). Also unavailable when you turn off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>). Requires Claude Code v2.1.213 or later. Importing from Cursor requires v2.1.265 or later `/init`| Initialize project with a `CLAUDE.md` guide. Set `CLAUDE_CODE_NEW_INIT=1` for an interactive flow that also walks through skills, hooks, and personal memory files. If `/init` finds OpenAI Codex or Google Gemini CLI configuration, it offers to carry it over with `/import` `/insights`| Generate an HTML report analyzing your recent sessions on this machine: which projects you work in, how you use Claude Code, where things go wrong, and features to try. Not available in [cloud sessions](</docs/en/claude-code-on-the-web>). See [Analyze your usage patterns](</docs/en/costs#analyze-your-usage-patterns>) for the report location, retention, and cost `/install-github-app`| Install the Claude GitHub App for a repository, with an optional step to set up [GitHub Actions](</docs/en/github-actions>) workflows and secrets. Walks you through selecting a repo and configuring the integration. Works only with github.com repositories. When your repository’s git remote is on gitlab.com or bitbucket.org, the command prints a notice and exits instead of starting setup. To run Claude Code from GitLab pipelines, see [GitLab CI/CD](</docs/en/gitlab-ci-cd>)
modified Run Claude Code behind a corporate launcher View current →
--- a/corporate-launcher.md +++ b/corporate-launcher.md @@ -39,7 +39,7 @@ Helper process names in process monitors -With a launcher configured, `ps` and Activity Monitor show the versioned binary name for the background helper processes instead of Claude Code’s `claude bg-pty-host` and `claude bg-spare` labels, because the launcher’s `exec` rebuilds the argument list. The renaming is a side effect, not concealment: the processes are otherwise unchanged, and Claude Code identifies its own processes by binary path, never by display name. +With a launcher configured, `ps` and Activity Monitor no longer show Claude Code’s `claude bg-pty-host` and `claude bg-spare` labels for the background helper processes, because the launcher’s `exec` rebuilds the argument list. Losing the labels is a side effect, not concealment: the processes are otherwise unchanged, and Claude Code identifies its own processes by binary path, never by display name. ##
modified Manage costs effectively View current →
--- a/costs.md +++ b/costs.md @@ -212,11 +212,12 @@ When a developer asks about a limit -Developers usually bring limit questions to their admin, so it helps to know which ceiling they hit. The four situations mean different things: +Developers usually bring limit questions to their admin, so it helps to know which ceiling they hit. These situations mean different things: * **“You’ve hit your session limit” or “You’ve hit your weekly limit”** : a seat-based usage window on a subscription plan, shared across all models, so the developer can’t restore access by switching models with `/model`. The message shows when the window resets. After the model-specific “You’ve hit your Opus limit” or “You’ve hit your Sonnet limit” message, switching to a model outside that family with `/model` does keep the developer working. See [usage limit errors](</docs/en/errors#youve-hit-your-session-limit>). What the developer can do in the meantime: * Run `/usage-credits` to request usage beyond the allowance, if you have [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) turned on. * On Claude Code v2.1.234 or later, [wait and continue the interrupted task automatically after the reset](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>); that section lists when Claude Code starts the wait on its own and when the developer picks it from `/rate-limit-options`. To control for your fleet whether Claude Code starts that wait on its own, set [`autoContinueAtUsageLimit`](</docs/en/settings-reference#autocontinueatusagelimit>) in [managed settings](</docs/en/settings#settings-precedence>). + * **“You’ve hit your individual spend limit”, “org’s monthly spend limit”, or “team’s shared budget”** : the developer’s request would be billed to usage credits, and those credits have reached a spend limit you set. To let the developer continue, go to [**Admin settings > Usage**](<https://claude.ai/admin-settings/usage>) and increase the limit the message names. When the message also names a plan reset time, the developer can instead wait until then. See [the error reference](</docs/en/errors#youve-hit-your-monthly-spend-limit>) for each variant. * **A spend limit message from a[Claude apps gateway](</docs/en/claude-apps-gateway>)**: the developer passed a spend cap you set on your self-hosted gateway, and the gateway blocks their requests until the period resets or you raise the cap. See [gateway spend limits](</docs/en/claude-apps-gateway-spend-limits>) for caps, reset schedules, and the message the developer sees. * **A context or auto-compact warning** : not a usage limit. The conversation has grown close to the session’s [auto-compact window](</docs/en/model-config#set-the-auto-compact-window>), the threshold where Claude Code summarizes older history to free space. Point the developer at reduce token usage. * **Unexpectedly high spend on an API or cloud-provider plan** : usually traces back to long sessions that were never cleared or to Opus left as the default model. The highest-impact habits to share are clearing between unrelated tasks and matching the model to the job, both covered in reduce token usage.
modified Desktop application View current →
--- a/desktop.md +++ b/desktop.md @@ -12,7 +12,7 @@ apt or .deb for Ubuntu and Debian -For Windows ARM64, download the [ARM64 installer](<https://claude.ai/api/desktop/win32/arm64/setup/latest/redirect?utm_source=claude_code&utm_medium=docs>). On Linux, install with apt; see [Claude Desktop on Linux](</docs/en/desktop-linux>). After installing, launch Claude, sign in, and click the **Code** tab. The first time you open it on Windows, you need [Git for Windows](<https://git-scm.com/downloads/win>) installed; restart the app after installing it. For a walkthrough of your first session, see the [Get started guide](</docs/en/desktop-quickstart>). In the Code tab, each conversation is a **session** : it has its own chat history, project folder, and code changes, independent of any other session. The sidebar lists your sessions and lets you run several in parallel. Within a session you can: +For Windows ARM64, download the [ARM64 installer](<https://claude.ai/api/desktop/win32/arm64/setup/latest/redirect?utm_source=claude_code&utm_medium=docs>). On Linux, install with apt; see [Claude Desktop on Linux](</docs/en/desktop-linux>). After installing, launch Claude, sign in, and click the **Code** tab. For a walkthrough of your first session, see the [Get started guide](</docs/en/desktop-quickstart>). In the Code tab, each conversation is a **session** : it has its own chat history and project folder, independent of any other session. The sidebar lists your sessions and lets you run several in parallel. Within a session you can: * Review and comment on diffs, then watch the resulting PR through CI * Preview your running app in the Browser pane while Claude verifies its own changes, and open external sites alongside it @@ -364,9 +364,9 @@ Work in parallel with sessions -Click **\+ New session** in the sidebar, or press **Cmd+N** on macOS or **Ctrl+N** on Windows, to work on multiple tasks in parallel. Press **Ctrl+Tab** and **Ctrl+Shift+Tab** to cycle through sessions in the sidebar. For Git repositories, each session gets its own isolated copy of your project using [Git worktrees](</docs/en/worktrees>), so changes in one session don’t affect other sessions until you commit them. To view two sessions at once, hold **Cmd** on macOS or **Ctrl** on Windows and click a session in the sidebar. The session opens in a second pane alongside the one you already have open. While the split is active, clicking another sidebar session replaces whichever pane has focus. Press **Cmd+\** on macOS or **Ctrl+\** on Windows to close the focused pane and return to a single session. Worktrees are stored in `<project-root>/.claude/worktrees/` by default. You can change this to a custom directory in Settings → Claude Code under “Worktree location”. You can also set a branch prefix that gets prepended to every worktree branch name, which is useful for keeping Claude-created branches organized. To remove a worktree when you’re done, hover over the session in the sidebar and click the archive icon. To have sessions archive themselves when their pull request merges or closes, turn on **Auto-archive after PR merge or close** in Settings → Claude Code. Auto-archive only applies to local sessions that have finished running. To include gitignored files like `.env` in new worktrees, create a [`.worktreeinclude` file](</docs/en/worktrees#copy-gitignored-files-into-worktrees>) in your project root. - -Session isolation requires [Git](<https://git-scm.com/downloads>). Most Macs include Git by default. Run `git --version` in Terminal to check; if it prints a version number, Git is installed. On Windows, Git is required for the Code tab to work: [download Git for Windows](<https://git-scm.com/downloads/win>), install it, and restart the app. If you run into Git errors, ask Claude in the [Cowork tab](<https://claude.com/product/cowork>) to help troubleshoot your setup. +Click **\+ New session** in the sidebar, or press **Cmd+N** on macOS or **Ctrl+N** on Windows, to work on multiple tasks in parallel. Press **Ctrl+Tab** and **Ctrl+Shift+Tab** to cycle through sessions in the sidebar. For Git repositories, select the **worktree** option next to the branch name to give the session its own isolated copy of your project using [Git worktrees](</docs/en/worktrees>), so changes in one session don’t affect other sessions until you commit them. To view two sessions at once, hold **Cmd** on macOS or **Ctrl** on Windows and click a session in the sidebar. The session opens in a second pane alongside the one you already have open. While the split is active, clicking another sidebar session replaces whichever pane has focus. Press **Cmd+\** on macOS or **Ctrl+\** on Windows to close the focused pane and return to a single session. Worktrees are stored in `<project-root>/.claude/worktrees/` by default. You can change this to a custom directory in Settings → Claude Code under “Worktree location”. You can also set a branch prefix that gets prepended to every worktree branch name, which is useful for keeping Claude-created branches organized. To remove a worktree when you’re done, hover over the session in the sidebar and click the archive icon. To have sessions archive themselves when their pull request merges or closes, turn on **Auto-archive after PR merge or close** in Settings → Claude Code. Auto-archive only applies to local sessions that have finished running. To include gitignored files like `.env` in new worktrees, create a [`.worktreeinclude` file](</docs/en/worktrees#copy-gitignored-files-into-worktrees>) in your project root. + +Session isolation requires [Git](<https://git-scm.com/downloads>). Most Macs include Git by default. Run `git --version` in Terminal to check; if it prints a version number, Git is installed. If you run into Git errors, ask Claude in the [Cowork tab](<https://claude.com/product/cowork>) to help troubleshoot your setup. Use the controls at the top of the sidebar to filter sessions by status, project, or environment, and to group sessions by project. To rename a session, click the session title in the toolbar at the top of the active session. To check context usage, see Check usage. When context fills up, Claude automatically summarizes the conversation and continues working. You can also type `/compact` to trigger summarization earlier and free up context space. See [the context window](</docs/en/how-claude-code-works#the-context-window>) for details on how compaction works. The desktop app sends an OS notification when a Code session finishes a task and you aren’t currently viewing that session. @@ -938,7 +938,7 @@ [Plugins](</docs/en/plugins>)| `/plugin` command| Plugin manager UI @mention files| Text-based| With autocomplete; local and SSH sessions only File attachments| Not available| Images, PDFs -Session isolation| [`--worktree`](</docs/en/cli-reference>) flag| Automatic worktrees +Session isolation| [`--worktree`](</docs/en/cli-reference>) flag| **worktree** option when starting a session Multiple sessions| Separate terminals| Sidebar tabs Recurring tasks| Cron jobs, CI pipelines| [Scheduled tasks](</docs/en/desktop-scheduled-tasks>) Computer use| [Enable via `/mcp`](</docs/en/computer-use>) on macOS| App and screen control on macOS and Windows @@ -1031,7 +1031,7 @@ Git and Git LFS errors -On Windows, Git is required for the Code tab to start local sessions. If you see “Git is required,” install [Git for Windows](<https://git-scm.com/downloads/win>) and restart the app. If you see “Git LFS is required by this repository but is not installed,” install Git LFS from [git-lfs.com](<https://git-lfs.com/>), run `git lfs install`, and restart the app. +Sessions that run in their own worktree need Git. If you see “Git is required,” install [Git](<https://git-scm.com/downloads>), or [Git for Windows](<https://git-scm.com/downloads/win>) on Windows, and try again. On Windows, Claude Desktop versions before 1.49585.0 asked for Git before starting any local session; if you see that prompt and aren’t using worktrees, update the app. If you see “Git LFS is required by this repository but is not installed,” install Git LFS from [git-lfs.com](<https://git-lfs.com/>), run `git lfs install`, and restart the app. ###
modified Get started with the desktop app View current →
--- a/desktop-quickstart.md +++ b/desktop-quickstart.md @@ -58,7 +58,7 @@ Select **Local** to run Claude on your machine using your files directly. Click **Select folder** and choose your project directory. -Start with a small project you know well. It’s the fastest way to see what Claude Code can do. On Windows, [Git](<https://git-scm.com/downloads/win>) must be installed for local sessions to work. Most Macs include Git by default. +Start with a small project you know well. It’s the fastest way to see what Claude Code can do. You can also select: @@ -82,7 +82,7 @@ * `Add tests for the main function` * `Create a CLAUDE.md with instructions for this codebase` -A [session](</docs/en/desktop#work-in-parallel-with-sessions>) is a conversation with Claude about your code. Each session tracks its own context and changes, so you can work on multiple tasks without them interfering with each other. +A [session](</docs/en/desktop#work-in-parallel-with-sessions>) is a conversation with Claude about your code. Each session tracks its own context and changes. 4 @@ -112,7 +112,7 @@ * **Accept edits** : Claude auto-accepts file edits for faster iteration. * **Plan** : Claude proposes an approach without editing any files, which is useful before a large refactor. -**Add plugins for more capabilities.** Click the **+** button next to the prompt box and select **Plugins** to browse and install [plugins](</docs/en/desktop#install-plugins>) that add skills, agents, MCP servers, and more. **Arrange your workspace.** Drag the chat, diff, terminal, file, and browser panes into whatever layout you want. Open the terminal with **Ctrl+`** to run commands alongside your session, or click a file path to open it in the file pane. See [Arrange your workspace](</docs/en/desktop#arrange-your-workspace>). **Preview your app.** When you run your dev server in the desktop, your app opens in the Browser pane, which can also [open external sites](</docs/en/desktop#browse-external-sites>). Claude can view the running app, test endpoints, inspect logs, and iterate on what it sees. See [Preview your app](</docs/en/desktop#preview-your-app>). **Track your pull request.** After opening a PR, Claude Code monitors CI check results and can automatically fix failures or merge the PR once all checks pass. See [Monitor pull request status](</docs/en/desktop#monitor-pull-request-status>). **Put Claude on a schedule.** Set up [scheduled tasks](</docs/en/desktop-scheduled-tasks>) to run Claude automatically on a recurring basis: a daily code review every morning, a weekly dependency audit, or a briefing that pulls from your connected tools. **Scale up when you’re ready.** Open [parallel sessions](</docs/en/desktop#work-in-parallel-with-sessions>) from the sidebar to work on multiple tasks at once, each in its own Git worktree, and open the [tasks pane](</docs/en/desktop#watch-background-tasks>) to watch the subagents and background commands a session has running. Open a [side chat](</docs/en/desktop#ask-a-side-question-without-derailing-the-session>) to ask a question without derailing the main thread. Send [long-running work to the cloud](</docs/en/desktop#run-long-running-tasks-remotely>) so it continues even if you close the app, or [continue a session on the web or in your IDE](</docs/en/desktop#continue-in-another-surface>) if a task takes longer than expected. [Connect external tools](</docs/en/desktop#extend-claude-code>) like GitHub, Slack, and Linear to bring your workflow together. +**Add plugins for more capabilities.** Click the **+** button next to the prompt box and select **Plugins** to browse and install [plugins](</docs/en/desktop#install-plugins>) that add skills, agents, MCP servers, and more. **Arrange your workspace.** Drag the chat, diff, terminal, file, and browser panes into whatever layout you want. Open the terminal with **Ctrl+`** to run commands alongside your session, or click a file path to open it in the file pane. See [Arrange your workspace](</docs/en/desktop#arrange-your-workspace>). **Preview your app.** When you run your dev server in the desktop, your app opens in the Browser pane, which can also [open external sites](</docs/en/desktop#browse-external-sites>). Claude can view the running app, test endpoints, inspect logs, and iterate on what it sees. See [Preview your app](</docs/en/desktop#preview-your-app>). **Track your pull request.** After opening a PR, Claude Code monitors CI check results and can automatically fix failures or merge the PR once all checks pass. See [Monitor pull request status](</docs/en/desktop#monitor-pull-request-status>). **Put Claude on a schedule.** Set up [scheduled tasks](</docs/en/desktop-scheduled-tasks>) to run Claude automatically on a recurring basis: a daily code review every morning, a weekly dependency audit, or a briefing that pulls from your connected tools. **Scale up when you’re ready.** Open [parallel sessions](</docs/en/desktop#work-in-parallel-with-sessions>) from the sidebar to work on multiple tasks at once, optionally each in its own Git worktree, and open the [tasks pane](</docs/en/desktop#watch-background-tasks>) to watch the subagents and background commands a session has running. Open a [side chat](</docs/en/desktop#ask-a-side-question-without-derailing-the-session>) to ask a question without derailing the main thread. Send [long-running work to the cloud](</docs/en/desktop#run-long-running-tasks-remotely>) so it continues even if you close the app, or [continue a session on the web or in your IDE](</docs/en/desktop#continue-in-another-surface>) if a task takes longer than expected. [Connect external tools](</docs/en/desktop#extend-claude-code>) like GitHub, Slack, and Linear to bring your workflow together. ##
modified Environment variables View current →
--- a/env-vars.md +++ b/env-vars.md @@ -166,7 +166,7 @@ `BASH_MAX_OUTPUT_LENGTH`| Maximum number of characters of bash output that Claude Code reads back into a command’s result (default: 30000; maximum: 150000). If you set the [`bashOutputMaxChars`](</docs/en/settings-reference#bashoutputmaxchars>) setting, Claude Code ignores this variable. See [Output limits](</docs/en/tools-reference#output-limits>) `BASH_MAX_TIMEOUT_MS`| Maximum timeout the model can set for long-running bash commands (default: 600000, or 10 minutes). The effective ceiling is the larger of this and `BASH_DEFAULT_TIMEOUT_MS` `BETA_TRACING_ENDPOINT`| OTLP endpoint for [detailed beta tracing](</docs/en/monitoring-usage#traces-beta>): with `ENABLE_BETA_TRACING_DETAILED=1`, logs and traces go there instead of to the configured exporters. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>) -`CCR_FORCE_BUNDLE`| Set to `1` to force [`claude --cloud`](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) to bundle and upload your local repository even when GitHub access is available +`CCR_FORCE_BUNDLE`| Set to `1` to force [`claude --cloud`](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) to bundle and upload your local repository instead of cloning from its remote `CLAUDECODE`| Set to `1` in subprocesses Claude Code spawns (Bash and PowerShell tools, tmux sessions, [hook](</docs/en/hooks>) commands, [status line](</docs/en/statusline>) commands, stdio [MCP server](</docs/en/mcp>) subprocesses). IDE extensions also set this in their integrated terminals. Use to detect when a script is running inside a subprocess spawned by Claude Code. To check whether the current process was spawned directly by a tool call or hook, rather than inside a stdio MCP server that Claude Code started, use `CLAUDE_CODE_CHILD_SESSION` instead `CLAUDE_AFK_COUNTDOWN_MS`| How many milliseconds before auto-continue the on-screen countdown appears on an unanswered [`AskUserQuestion`](</docs/en/tools-reference>) dialog. Default `20000` (20 seconds), capped at the auto-continue timeout. Has no effect unless auto-continue is on; see the [`askUserQuestionTimeout`](</docs/en/settings-reference#askuserquestiontimeout>) setting and `CLAUDE_AFK_TIMEOUT_MS`. Requires Claude Code v2.1.198 or later `CLAUDE_AFK_TIMEOUT_MS`| How many milliseconds of idle time before an unanswered [`AskUserQuestion`](</docs/en/tools-reference>) dialog auto-continues without you. Auto-continue is off by default; opt in with the [`askUserQuestionTimeout`](</docs/en/settings-reference#askuserquestiontimeout>) setting. This variable is an override for demos and automated tests: when set, it takes precedence over that setting and turns auto-continue on even when the setting is unset or `never`. Setting `0` doesn’t turn the timeout off; it closes the dialog immediately. In v2.1.198 and v2.1.199, auto-continue was on by default with a `60000` (60 seconds) timeout. Requires Claude Code v2.1.198 or later @@ -445,6 +445,7 @@ `OTEL_LOG_USER_PROMPTS`| Set to `1` to include user prompt text in OpenTelemetry traces and logs. Disabled by default (prompts are redacted). See [Monitoring](</docs/en/monitoring-usage>) `OTEL_METRICS_INCLUDE_ACCOUNT_UUID`| Set to `false` to exclude account UUID from metrics attributes (default: included). See [Monitoring](</docs/en/monitoring-usage>) `OTEL_METRICS_INCLUDE_ENTRYPOINT`| Set to `true` to include the session entrypoint in metrics attributes (default: excluded). Added in v2.1.152. See [Monitoring](</docs/en/monitoring-usage>) +`OTEL_METRICS_INCLUDE_REPOSITORY`| Set to `true` to tag OpenTelemetry metrics and events with `vcs.*` attributes identifying the session’s repository (default: excluded). Requires Claude Code v2.1.269 or later. See [Repository attributes](</docs/en/monitoring-usage#repository-attributes>) `OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES`| As of v2.1.161, Claude Code attaches `OTEL_RESOURCE_ATTRIBUTES` keys to metric datapoint labels. Set to `false` to exclude them (default: included). See [Monitoring](</docs/en/monitoring-usage#multi-team-organization-support>) `OTEL_METRICS_INCLUDE_SESSION_ID`| Set to `false` to exclude session ID from metrics attributes (default: included). See [Monitoring](</docs/en/monitoring-usage>) `OTEL_METRICS_INCLUDE_VERSION`| Set to `true` to include Claude Code version in metrics attributes (default: excluded). See [Monitoring](</docs/en/monitoring-usage>)
modified Error reference View current →
Show diff (120 lines)
--- a/errors.md +++ b/errors.md @@ -33,6 +33,7 @@ `Server is temporarily limiting requests`| Usage limits `Request rejected (429)`| Usage limits `Credit balance is too low`| Usage limits +`You've hit your monthly spend limit` / `You've hit your individual spend limit` / `You've hit your org's monthly spend limit` / `You've hit your channel's monthly spend limit` / `You've hit your team's shared budget` / `You've hit your individual usage limit`| Usage limits `Could not update your spend limit`| Usage limits `spend limit reached` / `spend limit unavailable`| Usage limits `Not logged in · Please run /login`| Authentication @@ -177,6 +178,7 @@ `Couldn't read your Zed keymap` / `Couldn't back up your Zed keymap` / `Couldn't update your Zed keymap`| Command-line errors `Your Zed keymap isn't a readable list of keybindings`| Command-line errors `Skill usage reports are not available on this connection.`| Command-line errors +``plugin eval` is currently in early access` / ``plugin eval` is currently unavailable`| Plugin 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 @@ -532,7 +534,7 @@ * 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. * To upgrade your plan for higher base limits, see [claude.com/pricing](<https://claude.com/pricing>) -To watch your remaining allowance before you hit the limit, add the `rate_limits` fields to a [custom status line](</docs/en/statusline#rate-limit-usage>), or in the Desktop app click the [usage ring](</docs/en/desktop#check-usage>) next to the model picker. +Before a window runs out, Claude Code can warn you that you’ve used most of it, with a message such as `You've used 85% of your session limit · resets 3:45pm`. To watch your remaining allowance continuously, add the `rate_limits` fields to a [custom status line](</docs/en/statusline#rate-limit-usage>), or in the Desktop app click the [usage ring](</docs/en/desktop#check-usage>) next to the model picker. ### @@ -601,6 +603,28 @@ * Check your provider console for the active limits and request a higher tier if needed * For Anthropic API keys, see the [rate limits reference](<https://platform.claude.com/docs/en/api/rate-limits>) for how tiers work and how to set per-workspace caps * Reduce concurrency: lower [`CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY`](</docs/en/env-vars>), avoid running many parallel subagents, or switch to a smaller model with `/model` for high-volume scripted runs + +### + +​ + +You’ve hit your monthly spend limit + +Your plan’s included usage can’t cover this request, and the [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) that would otherwise pay for it have reached a spend limit. That happens when one of your plan’s usage windows has run out, or when the request is one that only usage credits pay for, such as a request to a model that [bills to usage credits](</docs/en/model-config#fable-and-usage-credits>). The message names whose limit blocked you. The text after the `·` says how to get that limit increased, and varies with your plan and whether you manage billing: + + You've hit your monthly spend limit · raise it at claude.ai/settings/usage + You've hit your individual spend limit · ask your admin for a higher limit + You've hit your org's monthly spend limit · visit claude.ai/admin-settings/usage to raise it + You've hit your team's shared budget · ask your admin to raise it at claude.ai/admin-settings/usage + You've hit your channel's monthly spend limit · an org owner or channel manager can raise it in the channel's Claude settings + +`team's shared budget` is a pooled budget an admin assigned to a group you belong to; the message doesn’t name the group. `channel's monthly spend limit` is the budget of the one Slack channel the session runs in, so your organization may still have budget outside it. When one of your plan’s windows is what ran out, the message also says when that window resets, for example `· your session limit resets 3:45pm`, and access returns then without anyone raising the limit. On organizations with usage-based billing, the message says `usage limit` in place of `spend limit`, as in `You've hit your individual usage limit`. Before v2.1.239, the message didn’t name the plan window’s reset time. Before v2.1.268, a group’s pooled budget produced the `individual spend limit` message instead of `team's shared budget`. If you connect through a Claude apps gateway and see lowercase `spend limit reached`, that is your gateway operator’s cap instead; see Spend limit reached. **What to do:** + + * On Pro and Max, increase your monthly spend limit in [**Settings > Usage**](<https://claude.ai/settings/usage>) on claude.ai, or run `/usage-credits` + * On Team and Enterprise, increase the limit in [**Admin settings > Usage**](<https://claude.ai/admin-settings/usage>) if you manage billing, or ask an admin to. `/usage-credits` sends that request to your admin for you + * For a channel’s limit, ask an org owner or the channel’s manager to raise it on claude.ai. See [Per-channel limits](<https://claude.com/docs/claude-tag/admins/set-spend-limit#per-channel-limits>) in the Claude Tag documentation + * If the message names a reset time for your plan’s window, you can wait for it instead + * Run `/usage` to see your plan’s windows and when each resets ### @@ -1951,7 +1975,7 @@ Command-line errors -These errors come from the `claude` command line and its subcommands, from a command name you submit at the prompt, and from 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. +These errors come from the `claude` command line and its subcommands, from a command name you submit at the prompt, and from commands such as `/security-review` that gather context by running shell commands before their prompt runs. They also come from `/tui`, which relaunches the CLI. ### @@ -2047,10 +2071,11 @@ The current directory no longer exists (it was deleted or moved). Start Claude Code from an existing directory. error: The current working directory was deleted, so that command didn't work. Please cd into a different directory and try again. -The cause and the fix are the same for both forms. When Claude Code can’t read the working directory for a different reason, such as a permissions change, the message names the error code instead: `Can't read the current directory (EACCES). Start Claude Code from a different directory.` **What to do:** +The cause and the fix are the same for both forms. When Claude Code can’t read the working directory for a different reason, such as a permissions change, the message names the error code instead: `Can't read the current directory (EACCES). Start Claude Code from a different directory.` On macOS, `EPERM` for a directory in `~/Desktop`, `~/Documents`, `~/Downloads`, or iCloud Drive usually means macOS is blocking your terminal app from that folder. Other commands that read that folder fail the same way: `ls` there reports `Operation not permitted`, even with `sudo`. **What to do:** * Change to a directory that exists, such as your home or project directory, then run `claude` again * If the directory was recreated at the same path, your shell still holds the deleted one. Run `cd "$PWD"` or leave and re-enter the directory, then run `claude` again + * For `EPERM` on macOS, quit your terminal app with Cmd+Q, open it again, return to that folder, and run `claude`. If `ls` in that folder still fails, open **System Settings > Privacy & Security > Files and Folders**, turn on the folder for your terminal app, then reopen the terminal ### @@ -2118,7 +2143,7 @@ Claude Code turns `claude import` on through a feature flag it fetches from Anthropic and caches on disk. This message means the cached value is off. The cause is usually one of the following: * You haven’t started a session since installing, so Claude Code hasn’t fetched the flag yet. The first `claude import` can print this even when the feature is available to you. - * You use Claude Code through Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS. Claude Code doesn’t fetch feature flags on these providers, so `claude import` stays unavailable. + * You use Claude Code through Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS, or through a [Claude apps gateway](</docs/en/claude-apps-gateway#availability-and-limitations>). Claude Code doesn’t fetch feature flags in these sessions, so `claude import` stays unavailable. * You set `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `DISABLE_GROWTHBOOK`, or [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>), which turn off feature-flag fetching, so `claude import` stays unavailable. **What to do:** @@ -2556,6 +2581,23 @@ ​ +plugin eval is currently in early access + +You ran [`claude plugin eval`](</docs/en/plugin-evals>) or `claude plugin eval init` and it exited 1 with one of these messages before doing anything: + + `plugin eval` is currently in early access + + `plugin eval` is currently unavailable + +The first message means your build is older than v2.1.269, the first version where the command is generally available. The second means Anthropic has switched the command off server-side; nothing on your machine turns it back on. **What to do:** + + * Run `claude --version`, then `claude update`, and run the command again in a fresh session. See the [requirements for plugin evals](</docs/en/plugin-evals#requirements>) + * If you see the second message on a current build, try again later after another `claude update` + +### + +​ + Marketplace is registered from an untrusted source The marketplace is registered under a name that is [reserved for official Anthropic marketplaces](</docs/en/plugin-marketplaces#marketplace-schema>), but its registered source isn’t an `anthropics` GitHub repository. Claude Code re-checks reserved names every time it loads or refreshes a marketplace, so the marketplace and the plugins installed from it stop loading. Before v2.1.205, the name was checked only when the marketplace was added, so an entry registered before its name became reserved kept loading. @@ -2681,7 +2723,7 @@ `claude plugin install` reports the refusal like this: - Cannot install my-plugin@my-marketplace: its marketplace entry path does not stay inside the marketplace directory (an absolute, climbing, network-shaped or link-traversing entry, an entry of a fetched marketplace that resolves outside its tree — or a relative entry in a url-catalog marketplace, which has no local directory) + Cannot install my-plugin@my-marketplace: its marketplace entry path does not stay inside the marketplace directory (an absolute, climbing, network-shaped, backslash-containing or link-traversing entry, an entry of a fetched marketplace that resolves or opens outside its tree — or a relative entry in a url-catalog marketplace, which has no local directory) When an already-installed plugin’s entry fails the same check, `claude plugin list` shows the plugin as `failed to load` with:
modified Speed up responses with fast mode View current →
--- a/fast-mode.md +++ b/fast-mode.md @@ -109,7 +109,7 @@ Fast mode requires all of the following: * **Anthropic API or subscription only** : fast mode is available through the Anthropic Console API and for Claude subscription plans using usage credits. It is not available on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS. Console organizations must also have fast mode access provisioned. - * **Usage credits turned on for subscription plans** : on a Pro, Max, Team, or Enterprise plan, your account must have [usage credits](</docs/en/costs#add-usage-credits-to-your-subscription>) turned on, which allows billing beyond your plan’s included usage. Until they’re on, `/fast` shows “Fast mode requires usage credits · /usage-credits to turn them on”. How you turn them on depends on your plan: + * **Usage credits turned on for subscription plans** : on a Pro, Max, Team, or Enterprise plan, your account must have [usage credits](</docs/en/costs#add-usage-credits-to-your-subscription>) turned on, which allows billing beyond your plan’s included usage. Until they’re on, `/fast` reports “Fast mode requires usage credits”. How you turn them on depends on your plan: * On Pro and Max, turn them on in the **Usage credits** section of [**Settings > Usage**](<https://claude.ai/settings/usage>) on claude.ai, or run `/usage-credits` to open that page. * On Team and Enterprise, a member with billing access turns them on for the organization at [**Admin settings > Usage**](<https://claude.ai/admin-settings/usage>), and a member without it runs `/usage-credits` to send the organization’s admins a request.
modified Feature availability View current →
--- a/feature-availability.md +++ b/feature-availability.md @@ -35,7 +35,7 @@ * **MCP servers** : [connectors from claude.ai](</docs/en/mcp#use-mcp-servers-from-claude-ai>) load only when your claude.ai subscription is the active authentication method. [Tool search](</docs/en/mcp#configure-tool-search>) is off by default when `ANTHROPIC_BASE_URL` points to a non-first-party host, and isn’t supported on Google Cloud’s Agent Platform models earlier than the Claude 4.5 generation or on Microsoft Foundry [deployments hosted on Azure](<https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry#hosting-options>) * **Subagents** : the built-in [Explore subagent](</docs/en/sub-agents#built-in-subagents>) caps its inherited model at Opus on the Claude API, and inherits the main conversation’s model directly on any other provider, including Claude Platform on AWS * **[Commands](</docs/en/commands#all-commands>)** : - * `/design-sync` and `/import` with its `claude import` subcommand form are unavailable on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS + * `/design-sync` and `/import` with its `claude import` subcommand form are unavailable on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS, and through a [Claude apps gateway](</docs/en/claude-apps-gateway#availability-and-limitations>) * `/voice` requires a claude.ai account * `/list-agents` and its alias `/peers` are available only in sessions where [cross-session messaging is enabled](</docs/en/cross-session-messaging#availability>)
modified Fullscreen rendering View current →
--- a/fullscreen.md +++ b/fullscreen.md @@ -17,7 +17,7 @@ * 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>), and your `--agent`, `--agents`, and `--append-system-prompt` flags + * Rules you passed with [`--allowed-tools` or `--disallowed-tools`](</docs/en/cli-reference#cli-flags>), and your `--agent`, `--agents`, `--append-system-prompt`, and `--system-prompt-snapshot` 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:
modified Glossary View current →
--- a/glossary.md +++ b/glossary.md @@ -104,7 +104,7 @@ Checkpoint -A restore point created at each prompt you send. Claude Code snapshots files before every edit so a checkpoint can revert them. Press `Esc` twice or run `/rewind` to restore code, conversation, or both to an earlier point, or to summarize part of the conversation from a selected message. Checkpoints are saved with the conversation, so a resumed session can still `/rewind` to them. They’re separate from git and don’t track changes made through the Bash tool. Learn more: [Checkpointing](</docs/en/checkpointing>) +A restore point created at each prompt you send that starts a turn. Claude Code snapshots files before every edit so a checkpoint can revert them. Press `Esc` twice or run `/rewind` to restore code, conversation, or both to an earlier point, or to summarize part of the conversation from a selected message. Checkpoints are saved with the conversation, so a resumed session can still `/rewind` to them. They’re separate from git and don’t track changes made through the Bash tool. Learn more: [Checkpointing](</docs/en/checkpointing>) ###
modified Claude Code on Google Cloud's Agent Platform View current →
--- a/google-vertex-ai.md +++ b/google-vertex-ai.md @@ -38,7 +38,7 @@ Follow the wizard prompts -Choose how you authenticate to Google Cloud: Application Default Credentials from `gcloud`, a service account key file, or credentials already in your environment. The wizard detects your project and region, verifies which Claude models your project can invoke, and lets you pin them. It saves the result to the `env` block of your [user settings file](</docs/en/settings>), so you don’t need to export environment variables yourself. +Choose how you authenticate to Google Cloud: Application Default Credentials from `gcloud`, a service account key file, or credentials already in your environment. The wizard asks for your project and region, verifies which Claude models your project can invoke, and lets you pin them. It saves the result to the `env` block of your [user settings file](</docs/en/settings>), so you don’t need to export environment variables yourself. After you’ve signed in, run `/setup-vertex` any time to reopen the wizard and change your credentials, project, region, or model pins. The model pin step starts from your currently pinned models. The wizard writes to `~/.claude/settings.json`, or to `$CLAUDE_CONFIG_DIR/settings.json` when [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars#variables>) is set.
modified Run Claude Code programmatically View current →
--- a/headless.md +++ b/headless.md @@ -258,7 +258,7 @@ 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 + * **`dontAsk`** : Claude Code denies every call that would otherwise prompt, which is useful for locked-down CI runs. Actions that need no approval in Manual mode still run, such as file reads in your working directories and the [read-only command set](</docs/en/permissions#read-only-commands>), and so do actions your `--allowedTools` entries or `permissions.allow` rules cover. `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:
modified Automate actions with hooks View current →
--- a/hooks-guide.md +++ b/hooks-guide.md @@ -963,7 +963,12 @@ Hook JSON has no effect -Your hook prints valid JSON, but the decision doesn’t take effect and no error appears in the transcript. When Claude Code runs a shell-form command hook, one without `args`, it spawns `sh -c` on macOS and Linux, Git Bash on Windows, or PowerShell when Git Bash isn’t installed by default. This shell is non-interactive, but Git Bash and some configurations, such as `BASH_ENV` pointing at `~/.bashrc`, still source your profile. If that profile contains unconditional `echo` statements, the output gets prepended to your hook’s JSON: +Your hook prints valid JSON, but the decision doesn’t take effect and no error appears in the transcript. Check which cause applies: + + * **Extra output before the JSON** : something else writes to stdout first, usually an unconditional `echo` in your shell profile, so the output no longer starts with `{` and Claude Code doesn’t parse it as JSON. The cause and fix follow this list. + * **A field at the wrong level** : compare each field’s placement against the [JSON output](</docs/en/hooks#json-output>) format. For example, `permissionDecision` belongs inside `hookSpecificOutput`, not at the top level. + +When Claude Code runs a shell-form command hook, one without `args`, it spawns `sh -c` on macOS and Linux, Git Bash on Windows, or PowerShell when Git Bash isn’t installed by default. This shell is non-interactive, but Git Bash and some configurations, such as `BASH_ENV` pointing at `~/.bashrc`, still source your profile. If that profile contains unconditional `echo` statements, the output gets prepended to your hook’s JSON: Shell ready on arm64 {"decision": "block", "reason": "Not allowed"} @@ -975,7 +980,7 @@ echo "Shell ready" fi -The `$-` variable contains shell flags, and `i` means interactive. Hooks run in non-interactive shells, so the echo is skipped. +The `$-` variable contains shell flags, and `i` means interactive. Hooks run in non-interactive shells, so the echo is skipped. When your hook returns `permissionDecision` or `additionalContext` at the top level instead of inside `hookSpecificOutput`, the JSON still parses, and Claude Code ignores the misplaced fields without reporting an error. To see which fields it ignored, start Claude Code with `claude --debug` and search the [debug log](</docs/en/hooks#debug-hooks>) for `Hook JSON output had unrecognized keys`. ###
modified Deploy managed settings View current →
--- a/managed-settings.md +++ b/managed-settings.md @@ -125,7 +125,7 @@ When your organization delivers more than one managed source to the same machine, the [`managedSourcesBehavior`](</docs/en/settings-reference#managedsourcesbehavior>) key decides what Claude Code does with the others: - * **`"first-wins"`, the default**: Claude Code uses the highest-ranked source that delivers at least one policy key and ignores the rest rather than merging them, apart from the few keys in Keys read from every admin source. Claude Code shows no warning for the sources it skips; `/status` names the source it used and the ones it skipped. + * **`"first-wins"`, the default**: Claude Code uses the highest-ranked source that delivers at least one policy key and ignores the rest rather than merging them, apart from the keys in Keys read from every admin source. Claude Code shows no warning for the sources it skips; `/status` names the source it used and the ones it skipped. * **`"merge"`** : Claude Code applies every admin source that delivers a policy key and combines them by kind of key: on most keys the higher-ranked source’s value applies, lists union, and locks take the strictest value. Compose every managed source says where to set the key and how each kind of key combines. Requires Claude Code v2.1.242 or later. Both settings rank the sources the same way. Two terms recur in this section: @@ -161,6 +161,8 @@ * A commit-trailer opt-out in `attribution`, or in the deprecated `includeCoAuthoredBy`, from any tier * [`forceRemoteSettingsRefresh`](</docs/en/server-managed-settings>) * `env`, merged per variable across the admin sources: each variable comes from the highest-priority source that defines it, so lower sources fill in variables the higher ones leave unset. A few variables follow their own rules; [Per-key exceptions across managed sources](</docs/en/server-managed-settings#per-key-exceptions-across-managed-sources>) names each one. Requires Claude Code v2.1.223 or later. Before v2.1.223, Claude Code applied the selected source’s whole `env` block only + +The gateway login keys, [`forceLoginGatewayUrl`](</docs/en/settings-reference#forcelogingatewayurl>) and the `"gateway"` value of [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>), follow a separate rule. Claude Code never reads them from server-managed settings, so while server-managed settings are the selected source, the highest-ranked admin source on the machine that carries a policy key still supplies them. A value in an admin source ranked below that one, or in the HKCU registry, is ignored. ###
modified Model configuration View current →
--- a/model-config.md +++ b/model-config.md @@ -108,9 +108,9 @@ `/model` saves your choice as the default for new sessions by writing the `model` field in your user settings. In the picker: * `Enter`: switch model and save as your default - * `s`: switch model for this session only - -Typing `/model <name>` directly behaves like `Enter`. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or from a device connected through [Remote Control](</docs/en/remote-control>), or an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI switches for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. Checking a Remote Control pick requires Claude Code v2.1.260 or later on your machine. On the Anthropic API, Claude Code recognizes: + * `s`: switch model for this session only and leave your default unchanged. To use a different key, rebind [`modelPicker:thisSessionOnly`](</docs/en/keybindings#model-picker-actions>) + +Typing `/model <name>` directly behaves like `Enter`. To switch for this session only, open the picker with `/model` and press `s` on the model’s row. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default; `/model` in that mode requires Claude Code v2.1.205 or later. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. When Claude Code can’t tell which PreModelSwitch hooks your organization’s [managed plugins](</docs/en/settings-reference#enabledplugins>) deliver, for example because a managed plugin failed to load, it refuses the switch rather than apply it unchecked, and it checks again on each new attempt. See [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>) for the message and recovery. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or from a device connected through [Remote Control](</docs/en/remote-control>), or an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI switches for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. Checking a Remote Control pick requires Claude Code v2.1.260 or later on your machine. On the Anthropic API, Claude Code recognizes: * a model alias * an entry from the `/model` picker
modified Monitoring View current →
Show diff (115 lines)
--- a/monitoring-usage.md +++ b/monitoring-usage.md @@ -144,6 +144,7 @@ `OTEL_METRICS_INCLUDE_ACCOUNT_UUID`| Include user.account_uuid and user.account_id attributes in metrics| `true`| `false` `OTEL_METRICS_INCLUDE_ENTRYPOINT`| Include app.entrypoint attribute in metrics| `false`| `true` `OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES`| Include keys from `OTEL_RESOURCE_ATTRIBUTES` as attributes on metric datapoints| `true`| `false` +`OTEL_METRICS_INCLUDE_REPOSITORY`| Include `vcs.*` repository identity attributes on metrics and events. Requires Claude Code v2.1.269 or later| `false`| `true` Lower cardinality generally means better performance and lower storage costs but less granular data for analysis. @@ -197,6 +198,7 @@ `user_prompt`| Prompt text. Value is `<REDACTED>` unless the gate is set| `OTEL_LOG_USER_PROMPTS` `user_prompt_length`| Prompt length in characters| `interaction.sequence`| 1-based counter of interactions in this session| +`parent.source`| How the span got its trace parent: `env` when it parented under an inbound `TRACEPARENT`, `none` when it started its own trace. Requires Claude Code v2.1.268 or later| `interaction.duration_ms`| Wall-clock duration of the turn| **`claude_code.llm_request`** @@ -206,7 +208,8 @@ `model`| Model identifier| `gen_ai.system`| Always `anthropic`. OpenTelemetry GenAI semantic convention| `gen_ai.request.model`| Same value as `model`. OpenTelemetry GenAI semantic convention| -`query_source`| Subsystem that issued the request, such as `repl_main_thread` or a subagent name| +`query_source`| Subsystem that issued the request, such as `repl_main_thread` or a subagent name| `ENABLE_BETA_TRACING_DETAILED` +`query_source_safe`| Bounded form of `query_source`, emitted whether or not detailed beta tracing is active, with values such as `repl_main_thread` or `agent.builtin.general-purpose`. `:` becomes `.` and user-named agents appear as `agent.custom`. Requires Claude Code v2.1.268 or later| `agent_id`| Identifier of the subagent or teammate that issued the request. Absent on the main session| `parent_agent_id`| Identifier of the agent that spawned this one. Absent for the main session and for agents spawned directly from it| `workflow.run_id`| Run identifier of the [Workflow](</docs/en/workflows>) tool run that spawned this agent, prefixed `wf_`. Absent for agents not spawned by a workflow| @@ -215,6 +218,7 @@ `llm_request.context`| `interaction`, `tool`, or `standalone` depending on the parent span| `duration_ms`| Wall-clock duration including retries| `ttft_ms`| Time to first token in milliseconds| +`first_content_ms`| Time from request start to the first content block of the successful attempt, in milliseconds. Absent on requests that fell back to the non-streaming path. Requires Claude Code v2.1.268 or later| `input_tokens`| Input token count from the API usage block| `output_tokens`| Output token count| `cache_read_tokens`| Tokens read from prompt cache| @@ -226,6 +230,7 @@ `success`| `true` or `false`| `status_code`| HTTP status code when the request failed| `error`| Error message when the request failed| +`error_class`| Short error class token when the request failed, such as `api_timeout` or `server_overload`. Requires Claude Code v2.1.268 or later| `response.has_tool_call`| `true` when the response contained tool-use blocks| `stop_reason`| API response `stop_reason`, such as `end_turn`, `tool_use`, `max_tokens`, `stop_sequence`, `pause_turn`, or `refusal`| `gen_ai.response.finish_reasons`| Same value as `stop_reason`, wrapped in a string array. OpenTelemetry GenAI semantic convention| @@ -235,6 +240,9 @@ Attribute| Description| Gated by ---|---|--- `tool_name`| Tool name| +`tool_name_safe`| Form of `tool_name` that carries no user-chosen names. Built-in tool names pass verbatim. MCP tool names appear as `mcp_other`, except tool names matching a few fixed shapes, such as `playwright` tools named `browser_*`, which pass verbatim. Requires Claude Code v2.1.268 or later| +`bash_command_class`| For the Bash tool: category of the command’s first program from a fixed list, such as `vcs` or `package_manager`. `other` for a program outside the list, `unparsed` when the line can’t be parsed. Requires Claude Code v2.1.268 or later| +`bash_argv0`| For the Bash tool: the command’s first program when it’s on the same fixed list, such as `git` or `npm`. `other` for any program outside the list. Requires Claude Code v2.1.268 or later| `duration_ms`| Wall-clock duration including permission wait and execution| `result_tokens`| Approximate token size of the tool result| `agent_id`| Identifier of the subagent or teammate that ran the tool. Absent on the main session| @@ -265,6 +273,7 @@ `gen_ai.tool.call.id`| Same value as `tool_use_id`. OpenTelemetry GenAI semantic convention| `success`| `true` or `false`| `error`| Error category string when execution failed, such as `Error:ENOENT` or `ShellError`. Contains the full error message instead when the gate is set| `OTEL_LOG_TOOL_DETAILS` +`error_class`| The error category in identifier form, with characters outside letters, digits, and underscores replaced by `_`, such as `Error_ENOENT` or `ShellError`. Carries the category even when `error` carries the full message. Requires Claude Code v2.1.268 or later| **`claude_code.hook`** This span appears only when detailed beta tracing is active, which requires `ENABLE_BETA_TRACING_DETAILED=1` and `BETA_TRACING_ENDPOINT`, a pair that also [changes where your logs and traces go](</docs/en/env-vars#variables>). Set the pair in your shell, user settings, or managed settings; both variables are ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). `CLAUDE_CODE_ENHANCED_TELEMETRY_BETA` alone doesn’t produce it. In interactive CLI sessions, detailed beta tracing also requires your organization to be allowlisted for the feature. Agent SDK and non-interactive `-p` sessions don’t require allowlisting. @@ -348,7 +357,7 @@ * Create team-specific dashboards * Set up alerts for specific teams -Claude Code attaches these values as attributes on every metric datapoint and event record, in addition to sending them in the OTLP resource block. Because most metrics backends expose datapoint attributes as queryable labels, you can group and filter metrics by your custom keys directly. Custom keys never override the standard attributes such as `user.id` or `session.id`: when a key collides, Claude Code keeps the built-in value. Each custom key becomes a label on every metric series, so high-cardinality values increase storage cost in your metrics backend. To send custom attributes in the resource block only and omit them from datapoint labels, set `OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES=false`. See Metrics cardinality control. +Claude Code attaches these values as attributes on every metric datapoint and event record, in addition to sending them in the OTLP resource block. Because most metrics backends expose datapoint attributes as queryable labels, you can group and filter metrics by your custom keys directly. Except for the `vcs.*` repository attributes, custom keys never override the standard attributes such as `user.id` or `session.id`: when a key collides, Claude Code keeps the built-in value. Each custom key becomes a label on every metric series, so high-cardinality values increase storage cost in your metrics backend. To send custom attributes in the resource block only and omit them from datapoint labels, set `OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES=false`. See Metrics cardinality control. The `OTEL_RESOURCE_ATTRIBUTES` environment variable uses comma-separated key=value pairs with strict formatting requirements: @@ -448,6 +457,7 @@ `user.email`| User email address, from your sign-in or, in a [cloud session](</docs/en/claude-code-on-the-web>), from the session’s own credentials| Always included when available `terminal.type`| Terminal type, such as `iTerm.app`, `vscode`, `cursor`, or `tmux`| Always included when detected Keys from `OTEL_RESOURCE_ATTRIBUTES`| Custom attributes you set, such as `department` or `team.id`. See Multi-team organization support| `OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES` (default: true) +`vcs.repository.url.full`, `vcs.owner.name`, `vcs.repository.name`, `vcs.provider.name`| The session repository’s identity, derived from its `origin` remote. See Repository attributes| `OTEL_METRICS_INCLUDE_REPOSITORY` (default: false). Requires Claude Code v2.1.269 or later When Claude Code is signed in to a [Claude apps gateway](</docs/en/claude-apps-gateway>), the CLI stamps exports with the authenticated identity from the gateway session: `user.id` is the IdP subject rather than an anonymous installation identifier, `user.email` is the signed-in email, and `user.groups` carries IdP group membership as a comma-separated string. Each export also carries `identity.source: gateway-oidc`. The gateway identity is applied last, so `user.*` and `identity.*` keys set through `OTEL_RESOURCE_ATTRIBUTES` are ignored on gateway sessions. Events additionally include the following attributes. These are never attached to metrics because they would cause unbounded cardinality: @@ -455,6 +465,23 @@ * `workspace.host_paths`: host workspace directories selected in the desktop app, as a string array * `workflow.run_id`: run identifier, prefixed `wf_`, on the API and tool events emitted by agents that belong to a [Workflow](</docs/en/workflows>) tool run. Filtering events by one `workflow.run_id` reconstructs that run’s API requests and tool results. The identifier covers the agents the workflow script spawns and any agents those spawn in turn, such as skill invocations. It matches the run identifier reported in the Workflow tool result. Absent on all other events. Requires Claude Code v2.1.202 or later * `workflow.name`: name of the workflow, its script’s `meta.name`, emitted alongside `workflow.run_id`. Built-in workflow names appear verbatim when the run executes the unmodified built-in script. User-authored names, including edited copies of built-in scripts, are replaced with `custom` unless `OTEL_LOG_TOOL_DETAILS=1` is set. Requires Claude Code v2.1.202 or later + +#### + +​ + +Repository attributes + +Set `OTEL_METRICS_INCLUDE_REPOSITORY=true` to tag metrics and events with the identity of the session’s repository, so a shared collector can attribute usage per repository. Requires Claude Code v2.1.269 or later. Claude Code derives these attributes once per session from the repository’s `origin` remote. The HTTPS and SSH remotes of one repository produce identical values: + +Attribute| Value +---|--- +`vcs.repository.url.full`| The repository’s browser URL without `.git`, such as `https://github.com/example-org/example-repo` +`vcs.owner.name`| The owner or group path, such as `example-org`; omitted when the remote path has a single segment +`vcs.repository.name`| The bare repository name, such as `example-repo` +`vcs.provider.name`| `github`, `gitlab`, `bitbucket`, or `gitea` when Claude Code recognizes the remote’s host or URL shape as one of those providers; omitted otherwise + +Values are lowercased, and credentials, query strings, and fragments from the remote URL never appear in them. The attributes are omitted when the session has no `origin` remote, when the remote isn’t URL-shaped, or when the only enclosing repository is your home directory. A `vcs.*` key you declare in `OTEL_RESOURCE_ATTRIBUTES` replaces the derived value for that key. If you declare `vcs.repository.url.full`, Claude Code never reads the remote and reports only the keys you declare. The attributes flow only to your own exporters; Anthropic’s telemetry drops every `vcs.*` key. ### @@ -677,8 +704,10 @@ * `tool_input_size_bytes`: Size of the JSON-serialized tool input in bytes * `tool_result_size_bytes`: Size of the tool result in bytes * `mcp_server_scope`: MCP server scope identifier (for MCP tools) + * `vcs.ref.head.revision`, `vcs.ref.head.name`, `vcs.ref.head.type` (when `OTEL_LOG_TOOL_DETAILS=1`): the commit identity of a successful `git commit` run by the Bash or PowerShell tool. `vcs.ref.head.revision` is the commit SHA, `vcs.ref.head.name` is the branch it was committed on, and `vcs.ref.head.type` is `branch`. The name and type are omitted when the commit was made on a detached HEAD. Requires Claude Code v2.1.269 or later * `tool_parameters` (when `OTEL_LOG_TOOL_DETAILS=1`): JSON string containing tool-specific parameters. For Claude Desktop’s built-in servers, in sessions Claude Desktop owns, the `mcp_server_name`/`mcp_tool_name` pair is included even with the flag off, the same host-authored exception as the Tool decision event, requiring Claude Code v2.1.214 or later. The parameters vary by tool: - * For Bash tool: includes `bash_command`, `full_command`, `timeout`, `description`, `dangerouslyDisableSandbox`, and `git_commit_id` (the commit SHA, when a `git commit` command succeeds). The desktop app’s workspace bash tool also reports `tool_name` as `Bash`, but includes only `bash_command`, `full_command`, and `timeout` + * For Bash tool: includes `bash_command`, `full_command`, `timeout`, `description`, and `dangerouslyDisableSandbox`, plus `git_commit_id` and `git_branch` when a `git commit` command succeeds. `git_commit_id` is the full commit SHA when the commit is the HEAD of the session’s working directory, and git’s abbreviated SHA otherwise. `git_branch` is the branch it was committed on, omitted on a detached HEAD + * For the desktop app’s workspace Bash tool, which also reports `tool_name` as `Bash`: includes only `bash_command`, `full_command`, and `timeout` * For MCP tools: includes `mcp_server_name`, `mcp_tool_name` * For Skill tool: includes `skill_name` * For Agent tool or legacy Task tool: includes `subagent_type`
modified Choose a permission mode View current →
--- a/permission-modes.md +++ b/permission-modes.md @@ -14,7 +14,7 @@ `acceptEdits`| Reads, file edits, and common filesystem commands (`mkdir`, `touch`, `mv`, `cp`, etc.)| Iterating on code you’re reviewing `plan`| Reads, plus classifier-approved commands when auto mode is available| Exploring a codebase before changing it `auto`| Everything, with background safety checks| Long tasks, reducing prompt fatigue -`dontAsk`| Only pre-approved tools| Locked-down CI and scripts +`dontAsk`| Reads and pre-approved tools; anything that would prompt is denied| 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 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`. @@ -424,7 +424,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 even if your allow rules match it, and does the same to connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code. 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: +If you set `dontAsk` mode, Claude Code auto-denies every tool call that would otherwise prompt you. Claude still runs actions that need no approval in Manual mode, such as file reads inside your working directories and [read-only Bash commands](</docs/en/permissions#read-only-commands>), plus actions matching your `permissions.allow` rules 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 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 even if your allow rules match it, and does the same to connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code. 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
modified Configure permissions View current →
--- a/permissions.md +++ b/permissions.md @@ -41,7 +41,7 @@ Allow rules -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. +Check `allow` rules (from `allowed_tools` and settings.json). If a rule matches, the tool is approved. A call the tool approves on its own is resolved at this step too, with no rule needed: for example a file read inside your working directories or a [read-only Bash command](</docs/en/permissions#read-only-commands>). `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 @@ -65,26 +65,28 @@ Allow and deny rules -`allowed_tools` and `disallowed_tools` (TypeScript: `allowedTools` / `disallowedTools`) add entries to the allow and deny rule lists in the evaluation flow above. If you name one of the [task-tracking tools](</docs/en/agent-sdk/todo-tracking#model-availability>) in `allowed_tools`, Claude Code also opts the session in. Any other tool not listed in `allowed_tools` is still available to Claude and falls through to the permission mode. Deny rules behave differently depending on whether they name a tool or scope a pattern within one. +`allowed_tools` and `disallowed_tools` (TypeScript: `allowedTools` / `disallowedTools`) add entries to the allow and deny rule lists in the evaluation flow above. If you name one of the [task-tracking tools](</docs/en/agent-sdk/todo-tracking#model-availability>) in `allowed_tools`, Claude Code also opts the session in. Any other tool not listed in `allowed_tools` is still available to Claude, and a call to it that needs approval falls through to the permission mode. Deny rules behave differently depending on whether they name a tool or scope a pattern within one. Option| Effect ---|--- -`allowed_tools=["Read", "Grep"]`| `Read` and `Grep` are auto-approved. Other tools not listed here still exist and fall through to the permission mode and `canUseTool`. +`allowed_tools=["Read", "Grep"]`| `Read` and `Grep` are auto-approved. Other tools not listed here still exist, and calls to them that need approval fall through to the permission mode and `canUseTool`. `disallowed_tools=["Bash"]`| The `Bash` tool definition is removed from the request. Claude does not see the tool and cannot attempt it. `disallowed_tools=["Bash(rm *)"]`| `Bash` stays available. Calls matching `rm *` [as written](</docs/en/permissions#bash-rule-limits>) are denied in every permission mode, including `bypassPermissions`. Other `Bash` calls, including `/bin/rm`, fall through to the permission mode. `disallowed_tools=["*"]`| Every tool definition is removed from the request. Tool-name globs are supported in deny rules: `"*"` matches every tool and `"mcp__*"` matches every MCP tool across all servers. 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>), 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: +**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(npm test *)` auto-approves only matching calls, and other `Bash` calls that need approval 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"`: const options = { allowedTools: ["Read", "Glob", "Grep"], permissionMode: "dontAsk" }; +Listed tools are approved, apart from the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>), and every other call that would prompt is denied instead. Calls that need no approval in `default` mode run whether or not you list them, such as [read-only Bash commands](</docs/en/permissions#read-only-commands>), tools like `Agent` that don’t ask before running, and file reads inside your working directories. To put a tool out of Claude’s reach entirely, add its bare name to `disallowedTools`. + **`allowed_tools` does not constrain `bypassPermissions`.** `allowed_tools` pre-approves the tools you list. Other unlisted tools are not matched by any allow rule and fall through to the permission mode, where `bypassPermissions` approves them. Setting `allowed_tools=["Read"]` alongside `permission_mode="bypassPermissions"` still approves every tool, including `Bash`, `Write`, and `Edit`. If you need `bypassPermissions` but want specific tools blocked, use `disallowed_tools`. You can also configure allow, deny, and ask rules declaratively in `.claude/settings.json`. These rules are read when the `project` setting source is enabled, which it is for default `query()` options. If you set `setting_sources` (TypeScript: `settingSources`) explicitly, include `"project"` for them to apply. See [Permission settings](</docs/en/settings-reference#permission-settings>) for the rule syntax. @@ -107,8 +109,8 @@ 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, as are `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>). `canUseTool` is never called +`default`| Standard permission behavior| No mode-based auto-approvals; calls that need approval and match no allow rule trigger your `canUseTool` callback +`dontAsk`| Deny instead of prompting| Any call that would otherwise prompt is denied. Calls approved by `allowed_tools` or rules run, and so do calls that need no approval in `default` mode; 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 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 @@ -247,7 +249,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>), 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. +Converts any permission prompt into a denial, without calling `canUseTool`. Tools pre-approved by `allowed_tools`, `settings.json` allow rules, or a hook run as normal, and so do calls that need no approval in `default` mode, such as file reads inside your working directories and calls to `Agent`. 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. **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. ####
added Test plugins with evals View current →
Show diff (710 lines)
--- a/plugin-evals.md +++ b/plugin-evals.md @@ -0,0 +1,707 @@ +`claude plugin eval` runs your [plugin](</docs/en/plugins>) against a suite of test cases and scores the results. Each case is a realistic prompt plus one or more graders. A grader is a pass/fail check on what Claude produced, such as a regex over the reply, whether a particular tool was called, or a rubric that a second model judges the reply against. You don’t have to write the suite manually. `claude plugin eval init` asks you about your plugin, proposes the cases and graders, tries them, and writes the files. You can also ask Claude to do the same from a session you already have open. Use evals to measure how reliably your plugin steers Claude to the right outcome, to catch regressions when you change the plugin or a new model ships, and to see what the plugin contributes compared with no plugin at all. This page is for plugin and skill authors who have a working plugin and want to test its behavior, and for teams that gate plugin changes in CI. Its case format is separate from the `evals/evals.json` file the [skill-creator plugin](</docs/en/skills#run-evals-with-skill-creator>) uses. To create a plugin, see [Create plugins](</docs/en/plugins>); to check a plugin’s files for syntax and schema errors rather than its behavior, use [`claude plugin validate`](</docs/en/plugins-reference#plugin-validate>). + +Every eval run and every judge grader is a real model call on your account, counted against your plan’s usage or your API bill, so check the requirements first. Then create your first eval suite, or go to Run evals in CI if you already have one. + +## + +​ + +Requirements + +To run plugin evals you need: + + * Claude Code v2.1.269 or later. Run `claude --version` to check and `claude update` to upgrade. + * A plugin directory with a `plugin.json` or `.claude-plugin/plugin.json` manifest, or a [skills-directory plugin](</docs/en/plugins-reference#skills-directory-plugins>). + * The same authentication and model provider your normal Claude Code sessions use. Eval runs, judge-scored graders, and `claude plugin eval init` call the model with your credentials, so they count against your plan’s usage limits or your API bill. When the command reports a cost, the figure is a [list-price estimate](</docs/en/costs>) of those calls. + +## + +​ + +How an eval run works + +An eval suite lives in a directory called `evals/` inside your plugin, laid out as Write and refine cases shows. Each case is its own subdirectory with a prompt and one or more graders. The prompt is something a person using your plugin might type, such as a request one of its skills should handle. + +### + +​ + +What happens in a run + +For each run of a case, Claude Code starts a fresh, isolated [non-interactive session](</docs/en/headless>) with only your plugin loaded, sends the prompt, and lets Claude work until it finishes or hits the case’s turn or time limit. Each grader then checks the final reply, the transcript, or a file Claude created, and passes or fails. + +### + +​ + +How a case is scored + +One run of a non-deterministic agent tells you little, so each case runs three times by default. A run’s score is the fraction of its graders that passed, weighted if you set weights, and the case’s score is the mean across its runs. A case passes when its score meets the `--threshold`, `1.0` by default. In model calls, a suite makes roughly cases × runs agent runs with the plugin and as many again for the no-plugin baseline, plus three short judge calls per `llm` or `baseline` grader per run. + +### + +​ + +The no-plugin baseline + +A high score on its own doesn’t tell you the plugin helped, because Claude might do as well without it. To separate the two, each case’s runs are repeated with no plugin loaded by default, and you get two scores, `WITH` and `W/OUT`. Their difference, `Δ`, is what the plugin contributed. If a case scores 1.0 both with and without the plugin, the plugin isn’t what made it pass. The two sets of runs are called the with-arm and the without-arm; Compare against a no-plugin baseline covers how graders are scored across them and how to turn the baseline off. + +## + +​ + +Create your first eval suite + +This walkthrough writes one case for your own plugin, runs it, and reads the result. Before you start, make sure you have: + + * Claude Code v2.1.269 or later and the other requirements + * A terminal open at your plugin’s root directory, the one containing `plugin.json` or `.claude-plugin/plugin.json` + * One skill in the plugin you want to test, and a request a user would type that should trigger it + +1 + +Create the cases + +From the plugin root, run: + + claude plugin eval init + +If Claude Code doesn’t already trust this directory it first asks `Trust this plugin directory?`; answer `y`. An interactive Claude Code session then opens. Claude reads your plugin and asks you what a good result looks like, proposes prompts that should and shouldn’t trigger the plugin, designs graders for each, pilots them once to check they behave, and writes one case directory per prompt under `evals/`, each named after its prompt. When Claude tells you the suite is ready, exit that session with `/exit` or Ctrl+D to return to your shell.If you already have a Claude Code session open at the plugin root, you can instead ask Claude there to run `claude plugin eval init`. Claude runs the command and then asks you the same questions in that conversation.If you’d rather write a case yourself to see exactly what the files contain, follow Write a case manually and come back here to run it. + +2 + +Run the suite + +Back at your shell in the plugin root, run every case under `evals/`: + + claude plugin eval . + +You already trusted this directory during step 1, so the run starts immediately. If you wrote the case manually instead, the run first asks `Trust this plugin directory? [y/N]`; answer `y`. What a run can access explains what you’re agreeing to.Each case runs three times with your plugin and three times without it, so one case is six runs. A progress line prints as each run finishes, with that run’s score and each grader’s verdict. + +3 + +Read the summary + +When the suite finishes you see a summary table, followed by where the report went: + + CASE WITH W/OUT Δ RUNS COST NOTES + first-case 1.00 0.33 +0.67 6 $0.41 + + 1 case(s) · mean Δ +0.67 · 74s · $0.41 + Report: /Users/you/my-plugin/evals/results/2026-09-10T17-02-11-482Z/report.html + Published: https://claude.ai/... · keep local next time with --no-publish + +`WITH` is the case’s score with your plugin loaded, `W/OUT` is the score without it, and a positive `Δ` means the plugin raised the score. `COST` is a list-price estimate of the model calls, and `NOTES` shows the highest-weight failing grader’s explanation, or the run’s error, from the with-arm. + +4 + +Open the report and iterate + +Open the `Published:` URL, or the `Report:` path when no `Published:` line appears, to see each grader’s verdict and explanation for every run, and for `llm` graders the judge’s votes and the excerpt it judged. The `Published:` line appears only when your account can publish reports.The most common first finding is a `Δ` near zero with the case’s `tool_used: Skill` grader failing, which means Claude isn’t choosing your skill on natural phrasing. Adjust the skill’s [`description`](</docs/en/skills#frontmatter-reference>), run `claude plugin eval .` again, and compare.To iterate on one case cheaply, run a single arm once. A single run is noisy, so confirm any change at the default three runs before you trust it. With one arm the table shows `SCORE` and `PASS%` columns instead of `WITH`, `W/OUT`, and `Δ`: + + claude plugin eval . --case <case-name> --runs 1 --ablation none + +Replace `<case-name>` with one of the directory names under `evals/`. + +## + +​ + +Write and refine cases + +The cases `claude plugin eval init` writes are plain files you can open, change, and add to. A case is a directory under the plugin’s eval directory that contains a `prompt.md`, a `case.yaml`, or both. To group cases, nest them under a directory that isn’t itself a case; anything inside a case directory, such as `graders/` and fixture files, belongs to that case. This is the layout `claude plugin eval init` writes and the one to use for new suites. The eval suite reference has the complete tree, including mocks and results: + + my-plugin/ + ├── .claude-plugin/plugin.json + ├── skills/... + └── evals/ + ├── first-case/ + │ ├── prompt.md # frontmatter: case fields; body: the prompt + │ ├── graders/ + │ │ ├── criteria.md # frontmatter: type + options; body: rubric or pattern + │ │ └── skill-fired.md + │ └── case.yaml # optional: only for context.* fields + ├── ignores-unrelated-request/ + │ └── ... + └── results/ # written by each run; add to .gitignore + +### + +​ + +Write a case manually + +Having Claude write the cases with `claude plugin eval init` is the recommended path. To write one yourself instead, start from a blank template. The following command writes a case named `first-case` with a placeholder `prompt.md` and one placeholder grader, and runs nothing: + + claude plugin eval init --bare first-case + + evals/first-case/ + ├── prompt.md # the prompt sent to Claude, plus run limits + └── graders/ + └── criteria.md # one grader: how to score the result + +In `prompt.md` you write the message Claude receives in each run, and set the run’s limits and the tools the case may use in its frontmatter. Open `evals/first-case/prompt.md` and replace the placeholder body with a request one of your skills should handle, phrased the way a user would type it rather than naming the skill. This example is for a skill that drafts commit messages; use your own request: + + --- + max_turns: 10 + allowed_tools: [Read, Glob, Grep, Skill] + --- + + Write me a commit message for this change: I renamed getUser to fetchUser and updated the three call sites. + +Each run starts in an empty working directory, so put whatever the task needs in the prompt itself, or set up the workspace first. The full list of frontmatter fields covers the model, timeout, tags, and environment variables. Each file under `graders/` is one check applied after the run. Open `evals/first-case/graders/criteria.md` and replace the placeholder with a rubric for the judge model, written as concrete PASS and FAIL conditions: + + --- + type: llm + --- + + PASS if <what a correct response contains>. + FAIL if <what a wrong or missing response looks like>. + +Then add a second grader that checks whether your skill is what produced the answer. Create `evals/first-case/graders/skill-fired.md`, replacing `your-skill-name` with the `name` from your skill’s `SKILL.md`: + + --- + type: tool_used + tool: Skill + input_match: '"skill"\s*:\s*"(?:[\w-]+:)?your-skill-name"' + --- + +This passes when Claude invoked that skill at least once during the run, including by its namespaced `plugin-name:skill-name` form. Grader types lists the other checks available, such as matching a regex or confirming a file was created. With both files saved, run the case the way the quickstart does, with `claude plugin eval .` from the plugin root. + +### + +​ + +Set run limits and tools in prompt.md + +Set a case’s `max_turns`, `timeout_seconds`, `model`, `tags`, and the `allowed_tools` it may use in `prompt.md` frontmatter; the prompt.md frontmatter reference lists every field and its default. Claude receives the body exactly as you wrote it. `@path` mentions in it aren’t expanded into file attachments, so if Claude needs to read a file, grant a tool for it in `allowed_tools`. + +### + +​ + +Choose and weight graders + +A grader’s frontmatter sets its `type`, and optionally a `weight` that makes it count for more of the run’s score and an `arm` that controls how it’s scored against the baseline. Of the six types, `regex`, `tool_used`, `tool_order`, and `file_exists` are computed from the transcript and files and cost nothing, while `llm` and `baseline` call a judge model and add to the run’s cost. There are no custom-code graders. Grader types lists each type’s options and pass condition, and what a grader can look at lists the values `target` and `focus` accept. The judge for `llm` and `baseline` graders is a small fast model by default. Pass `--judge-model sonnet` or a full model ID to use a stronger one for nuanced rubrics. + +#### + +​ + +Choose graders that give a stable signal + +An `llm` grader asks a model for a verdict, so its answer can differ between runs, and it differs more the longer the text it has to read. These habits keep a suite’s scores steady enough to trust: + + * For long output such as a generated file, grade it with a `regex` grader over the file’s contents, which checks the whole file the same way every time. Keep `llm` graders for short outputs, with rubrics written as concrete PASS and FAIL conditions. + * Give each case one grader on the result, such as the final message or a produced file, and one on how Claude got there, such as `tool_used` or `tool_order`. Together they tell you both whether the answer was right and whether your plugin produced it. + * If a case’s `tool_used: Skill` grader passes but `Δ` is negative, suspect the judge before the plugin. A small judge model can mark a correct answer wrong because it’s formatted differently from what the rubric describes. Re-run with `--judge-model sonnet`, and tighten the rubric so formatting doesn’t decide the verdict. + * To check that a build or test passed inside the run, have the prompt ask Claude to run it and write the outcome to a file, grade that file, and assert the command ran with a `tool_used` grader whose `input_match` names the command. + +### + +​ + +Score against the no-plugin baseline + +When a plugin is under test, each case runs in two arms by default. The with-arm is its runs with the plugin loaded, and the without-arm is the same number of runs with no plugin at all. The summary and report show both scores and `Δ`, the with-arm score minus the without-arm score. Pass `--ablation none` to run only the with-arm, which halves the cost when you don’t need the comparison, such as while iterating on graders. In a two-arm run, some graders are reported with `scored: false`. A check like “the skill was invoked” can never pass without the plugin, so counting it would push the without-arm toward zero and inflate `Δ`. To keep the two arms comparable, Claude Code excludes such graders from the score in both arms and reports them in the with-arm as pass/fail indicators only. That includes: + + * Every `tool_used` grader whose `tool` is `Skill` + * Any grader you mark `arm: with-only` + +If every grader in a case is one of these, they’re scored normally instead, since there would be nothing left to score. Set `arm: both` on a grader to score it in both arms regardless, which is what you want for a “must not invoke the skill” check with `min: 0` and `max: 0`. Under `--ablation none` nothing is excluded, so the same suite can produce a different absolute score in the two modes. + +### + +​ + +Use a different eval directory + +If `evals/` is already taken by another tool, keep the suite in a different directory. You can record that directory in the plugin’s `plugin.json` so every run and every collaborator uses it, or pass it on the command line for a single run: + + * **In`plugin.json`**: add `"experimental": { "evals": "quality/evals" }`. + * **On the command line** : pass `--eval-dir quality/evals` to both `claude plugin eval` and `claude plugin eval init`. + +If you set both, the flag’s directory is used. Give a relative path of plain directory names such as `qa` or `quality/evals`. An absolute path or one containing `..` isn’t accepted: as a flag value it’s an error, while an unusable manifest value prints a `Warning:` line and the run uses `evals/` instead. Cases, results, and `init` output all move to that directory. + +## + +​ + +Set up fixtures and mocks + +A case can need more than a prompt: files or a git repository in the workspace, an earlier conversation to continue, or answers from the MCP servers your plugin talks to. Each of those is set up beside the case so runs stay repeatable. + +### + +​ + +Seed the workspace or conversation + +Each run starts in an empty workspace. When a case needs more than the prompt, add a `case.yaml` beside `prompt.md` with a `context` block. To create fixture files or a git repository first, write a Bash script in the case directory and name it in `context.scaffold_script`. The script runs as you, outside the agent’s sandbox, and only when you pass `--scaffold`, so pass that flag only for suites you or your organization wrote. To continue an earlier conversation, save the transcript as a `.jsonl` file and name it in `context.history_file`, and the case’s prompt becomes the next user turn. To let Claude read fixture directories in the case during the run, list them in `context.add_dirs`. A `case.yaml` also needs `schema_version: "1.1"` and `name`; the case.yaml fields reference has the full list. This `case.yaml` seeds a workspace from a script and lets Claude read fixtures from a `resources/` directory: + + schema_version: "1.1" + name: changelog-from-diff + tags: [smoke] + context: + scaffold_script: fixture.sh + add_dirs: [resources] + +### + +​ + +Mock MCP servers + +You can evaluate a plugin whose skills call MCP tools without the real service behind them. Put one Markdown file per tool under `evals/mocks/<server>/<tool>.md` for the whole suite, or under a case’s own `mocks/` directory for one case, where `<server>` is the server’s name in your plugin’s [MCP configuration](</docs/en/plugins-reference#mcp-servers>). A run never starts your plugin’s real MCP servers unless you ask. Claude Code registers a stand-in under each server’s own name. Tools with a mock file answer from it and are allowed without an `--allow-tools` grant, and a tool with no mock file isn’t available to Claude. A server with no mocks at all appears in the case’s `mocked:` progress line as `plugin_<plugin>_<server>[not started: no mock]`. The file’s body is what the tool returns to Claude. This mock stands in for a `create_issue` tool on a server named `tracker`, checks the input Claude sends, and echoes the title back. Save it as `evals/mocks/tracker/create_issue.md`: + + --- + expect: + title: string + priority: [low, medium, high] + --- + + Created issue #4821: {{input.title}} + +Insert fields from the call’s input with `{{input.<field>}}`, and the contents of a fixture file beside the mock with `{{file:fixtures/{input.<field>}.json}}`. The `expect:` block guards the input. If a call violates it, the run aborts with score 0 and records why, so a case can assert what your plugin asked the server to do. Set `error: true` to return the body as a tool error instead, or `type: agent` to have a small model answer as the server from instructions in the body. The mock file reference lists every key and the `_server.md` and `_tools.json` files. To grade the calls themselves, point a grader at `target: mock_calls`. To run against the plugin’s real MCP servers instead, pass one of these flags. Either way those processes run as you, outside the run’s sandbox, and their tools need an `--allow-tools` grant: + + * **`--allow-real-servers`** : start the real process for each server you haven’t mocked, and keep answering mocked tools from their files + * **`--mocks off`** : ignore `mocks/` entirely and start every server the plugin declares + +#### + +​ + +Replay agent mock answers + +A `type: agent` mock answers with a call to the `--judge-model`, so its output varies between runs and changes if you change the judge. When a run completes without an error or abort, Claude Code saves each answer an agent mock gave under the results directory in `mock-recordings/`. Open `ADOPT.txt` there to see each recording and the `.replay/<server>/` directory to copy it into, beside the mock that produced it. After you copy a recording there, later runs answer the identical call from it with no model call. Commit `mocks/.replay/` with the rest of `mocks/` so CI runs are repeatable. + +## + +​ + +Run evals + +Once a suite exists, `claude plugin eval` runs it. You choose which plugin and cases run with the target argument, grant any tools the cases need beyond the read-only set with `--allow-tools`, and control run count, models, cost, and output with the other options. + +### + +​ + +Choose what to evaluate + +Most of the time you run `claude plugin eval .` from the plugin root, which runs every case in the suite with the plugin you’re standing in loaded. To run a single case file, or to evaluate a plugin you installed rather than one you’re developing, pass a different target: + +Target| What runs +---|--- +A plugin’s root directory, such as `.`| Every case under its eval directory, with that plugin loaded +A single `prompt.md` or `case.yaml` file| That case, with its enclosing plugin loaded +An installed plugin by name, `name` or `name@marketplace`| The cases in the installed copy’s eval directory, with the installed copy loaded. Results are written under `./evals/results/` in your current directory, or `./<dir>/results/` with `--eval-dir` +`name@skills-dir`| The same, for a [skills-directory plugin](</docs/en/plugins-reference#skills-directory-plugins>) +Omitted| The current directory as a path + +Add `--case <glob>` to filter by case name and `--tag <tag>` to keep cases with any of the given tags. Put the target before `--tag`, `--allow-tools`, and `--json`. The first two take a list and `--json` takes an optional path, so each of them reads a target that follows as its own value. + +### + +​ + +Grant tools + +Runs never stop to ask for permission. Built-in tools that need a grant you didn’t give, such as `Bash`, `Write`, `Edit`, `WebFetch`, and `WebSearch`, are removed from the session, so Claude can’t call them at all. The allowlist is the read-only tools the case lists in `allowed_tools`, from `Read`, `Glob`, `Grep`, `NotebookRead`, `Skill`, `Agent`, `TodoWrite`, and the task tools `TaskCreate`, `TaskGet`, `TaskList`, `TaskUpdate`, `TaskStop`, and `TaskOutput`, plus whatever you grant with `--allow-tools`, which applies to every case in the run. To let cases use `Bash`, `Write`, `Edit`, `WebFetch`, or `WebSearch`, grant them yourself: + + claude plugin eval . --allow-tools Write Edit "Bash(npm test *)" + +When a case asked for a tool you didn’t grant, the run lists it on stderr as `not granted`. Tools on a mocked MCP server need no grant. Tools on a real plugin MCP server need both the server started, with `--allow-real-servers` or `--mocks off`, and a grant by name, such as `--allow-tools "mcp__plugin_my-plugin_github__*"`; a plugin’s MCP tools are named `mcp__plugin_<plugin>_<server>__<tool>`. When you grant `Bash` in any form, every command runs under Claude Code’s [OS-level sandbox](</docs/en/sandboxing>). Writes are confined to the run’s workspace, your home directory and Claude Code configuration are unreadable, and network access is limited to domains you grant with `--allow-tools "WebFetch(domain:example.com)"`. If you grant Bash or PowerShell on a machine with no sandbox backend, Claude Code refuses each run rather than running it unconfined, and the case shows a run error and usually scores 0. Native Windows has no backend, so run shell-granting suites under WSL2; on Linux, install `bubblewrap` and `socat` first. See the [sandboxing prerequisites](</docs/en/sandboxing>). + +### + +​ + +Command options + +This table covers the options for run count, models, scoring, cost, tool grants, mocks, and output. Run `claude plugin eval --help` for the complete list, which also includes `--case`, `--tag`, `--eval-dir`, `--no-scaffold`, `--report`, and `--verbose`. + +Option| Default| Effect +---|---|--- +`--runs <n>`| Each case’s `runs`, else 3| Runs per case per arm +`-j`, `--concurrency <n>`| `1`| Run up to this many agent runs at once, from 1 to 8. They share your account’s rate limit, so this shortens wall-clock time rather than raising throughput past that limit. Results keep case order +`--model <model>`| Each case’s `model`, else `ANTHROPIC_MODEL` if set, else Claude Code’s default| Model for the agent under test. Pin it in CI so a model rollout isn’t mistaken for a plugin regression +`--judge-model <model>`| A small fast model| Model for `llm` and `baseline` graders +`--ablation <mode>`| `with-without` when a plugin resolves, else `none`| Whether to also run each case without the plugin to measure what it adds. `none` runs one arm; `with-without` adds the no-plugin baseline +`--threshold <0..1>`| `1.0`| A case passes when its with-arm score is at least this. Any case below it makes the command exit 1 +`--max-cost-usd <usd>`| No ceiling| A ceiling on the run’s list-price cost estimate, not on plan usage. Checked before each run starts. Once spent, nothing further starts; runs already in flight finish, so spend can pass the ceiling by those runs. If any run is left unstarted, the command exits 2 with partial results +`--allow-tools <tools...>`| None| Grant tools beyond the read-only set. See Grant tools +`--scaffold`| Off| Run each case’s `scaffold_script` +`--trust-plugin`| Off| Skip the first-run trust prompt for a plugin whose code and suite you’d run yourself. Pass it in CI so the job is never refused by or left waiting at the prompt. See What a run can access +`--mocks <mode>`| `record`| `record` answers MCP tool calls from mocks, doesn’t start the plugin’s real servers, and saves agent-mock answers for replay. `off` ignores mocks and starts the plugin’s real MCP servers +`--allow-real-servers`| Off| With `--mocks record`, also start the plugin’s real MCP servers for servers that have no mock +`--json [path]`| Off| Print the result document to stdout, or write it to a path ending in `.json`. The run is quiet: no progress lines or summary table +`--output-dir <dir>`| `<eval dir>/results/<timestamp>/`| Where `aggregate-result.json` and `report.html` go +`--no-publish`| | Keep the HTML report local. See HTML report +`--publish-report`| | Publish the report even where it would stay local by default, such as a run a Claude Code session started +`--keep-temp`| Off| Keep every run’s sandbox directory and print its path, for debugging what Claude produced + +### + +​ + +Run evals in CI + +In your CI job, run the suite with `--json` to write the result for archiving, and fail the build on the exit code. Pass `--trust-plugin` so the job never waits at the first-run trust prompt, pin both models so scores are comparable over time, keep the report local, and set a cost ceiling as an upper limit: + + claude plugin eval . \ + --trust-plugin \ + --json results.json \ + --threshold 0.8 \ + --model claude-sonnet-5 \ + --judge-model claude-haiku-4-5 \ + --no-publish \ + --max-cost-usd 20 + +The job’s exit code tells you what happened: + +Exit code| Meaning +---|--- +0| Every case scored at or above `--threshold` and every case file loaded +1| A case scored below the threshold, a case file failed to load, no cases were found, a run couldn’t be started, the plugin directory isn’t trusted and `--trust-plugin` wasn’t passed, or an option was invalid +2| Partial run: the `--max-cost-usd` ceiling was hit, or your credential was rejected before or at the first run. `results.json` is still written with `partial: true` and the reason +130| Interrupted. Partial results are written +143| Terminated, such as by a CI timeout + +Problems writing or publishing the HTML report never change the exit code. To see why a case scored low, run it locally without `--json` so the per-run progress and grader lines print. A CI runner needs a Claude Code install and [credentials in the environment](</docs/en/authentication>) such as `ANTHROPIC_API_KEY`. Without `--trust-plugin`, a job whose checkout directory Claude Code doesn’t already trust is refused with exit 1 when it has no terminal, or waits at the prompt when the runner allocates one. `claude plugin eval init` needs a terminal to ask you its questions; in CI, run `claude plugin eval init --bare <name>` to get the blank template. To keep costs predictable, give quick every-change suites only graders that don’t call a judge, use `--ablation none` where you don’t need `Δ`, and leave `partial: true` documents and runs with `skippedPaidGraders` out of any trend you chart. + +## + +​ + +Read the results + +Every run with at least one case writes a `results/<timestamp>/` directory inside the eval directory, containing `aggregate-result.json` and `report.html`. For a path target that’s under the plugin; for a plugin you named, it’s under your current directory, as the target table shows. The summary table, the JSON, and the report all render the same result data. + +### + +​ + +HTML report + +`report.html` is a single self-contained file that makes no external requests, so you can attach it to a CI job or open it from disk. This example is the top of a report for a three-case suite run with `--threshold 0.8`; the cost shown is a list-price estimate and varies with the model and the number of cases: Read it from the top down: + + * **The verdict line and tiles** answer whether the plugin helped across the whole suite. Suite score is the mean of the per-case with-plugin scores, Ablation Δ is how far that sits above or below the baseline score, and Cases counts how many met the threshold. Perfect runs is the share of with-plugin runs where every grader passed. + * **Each case card** shows the case’s own `Δ` and with-plugin score, with a tick on the bar at the threshold. A case whose `Δ` is negative gets a red left edge, so regressions stand out when you scroll. + * **Inside a case** , the with-plugin runs come first and the baseline runs after. Each run lists its graders with a pass or fail chip. A failed grader is already expanded with its explanation, and an `llm` grader also shows the judge’s votes and the evidence it was shown, which is where you find out why a run scored low. Graders that don’t count toward the score, such as `tool_used: Skill`, carry a `plugin-fired indicator` badge. + * **Prompt and Graders** , below the runs, show the case’s prompt and each grader’s rubric or pattern, so someone reading the report without the suite can see what was asked and what counted as good. + +If you’re signed in with a claude.ai subscription and [artifacts](</docs/en/artifacts>) are available for your account, Claude Code also publishes the report as a private artifact and prints `Published: <url>`. Pass `--no-publish` to keep it local. If no `Published:` line appears, such as with API-key authentication, the local file is the report. A run that a Claude Code session started, such as when you ask Claude to run the suite for you, also stays local, and its `Report:` line says `kept local`. Add `--publish-report` to that command to publish it. + +### + +​ + +JSON result + +`aggregate-result.json`, and `--json` output, is a versioned document with `schemaVersion: 1` for CI scripts to parse. Field names are camelCase and new fields are added without renaming existing ones, so write your script to ignore fields it doesn’t recognize. These are the fields a gating script usually reads. The document also carries the suite configuration, every grader definition, and per-run grader results with explanations and evidence: + +Field| Meaning +---|--- +`partial`, `partialReason`| `true` with `cost_ceiling`, `interrupted`, or `auth_failed` when the suite didn’t finish. Leave partial results out of trend charts +`aggregates.overallScore`| Mean case score across the suite +`aggregates.casesPassed`, `aggregates.casesTotal`| Cases at or above `--threshold`, and the total +`aggregates.meanDelta`| Mean `Δ` across cases, under the two-arm mode +`cases[].name`| Case name +`cases[].aggregates.score`| Mean with-arm run score for the case +`cases[].aggregates.delta`| With-arm score minus without-arm score. Omitted when the arms aren’t comparable +`cases[].arms.with[].error`| `null`, or why a run ended abnormally, such as `timed out after 300s`. A run that started but ended badly is still graded on what it produced, so a non-null error doesn’t imply score 0 +`cases[].arms.with[].aborted`| Present when a mock’s `expect:` or `abort_when` stopped the run, with `server`, `tool`, and `reason`. The run scores 0 and `error` stays `null` +`cases[].arms.with[].skippedPaidGraders`| `true` when the cost ceiling skipped this run’s judge graders, so its score isn’t comparable +`costUsd`, `durationSeconds`, `claudeVersion`| Estimated cost at list price including judge calls, wall-clock seconds, and the Claude Code version that ran the suite + +## + +​ + +What a run can access + +`claude plugin eval` loads the target plugin’s skills and hooks and runs its eval suite on your machine, as you. Pointing it at a plugin is the same trust decision as `claude --plugin-dir`, so only evaluate plugins you trust. The isolation described in this section limits what the agent under test can reach; it isn’t a boundary against the plugin’s own code, and a suite that passes says nothing about whether the plugin is safe. + +### + +​ + +Trust the plugin directory + +The first time you run `claude plugin eval` against a directory, Claude Code asks `Trust this plugin directory?` before it loads anything from it, unless you already accepted the trust prompt there in an interactive `claude` session. Inside a git repository, answering yes trusts the whole repository, for interactive sessions too. When stdin or stdout isn’t a terminal, or under `--json`, the run can’t ask and is refused with exit 1; pass `--trust-plugin` to assert the trust yourself, only for a plugin you’d run on your own machine. A target you name rather than give as a path, meaning an installed plugin or a skills-directory plugin, skips the prompt. Some parts of the plugin and suite run only when you pass their flag for that run: a case’s `scaffold_script` with `--scaffold`, tools beyond the read-only set with `--allow-tools`, and the plugin’s real MCP servers with `--allow-real-servers` or `--mocks off`. A case’s `allowed_tools` and a skill’s own `allowed-tools` frontmatter can’t widen any of them. When the plugin ships hooks you didn’t write, or you start its real MCP servers, treat its scores as advisory unless you ran it in an isolated environment such as a container or CI runner, since hooks and servers run outside the agent’s sandbox and could touch the files the graders read. + +### + +​ + +How runs are isolated + +Each run gets a throwaway home directory, working directory, and Claude Code configuration, and the agent under test runs there as a `claude -p` child process with only your plugin loaded. Keep these consequences in mind when you write cases: + + * **Nothing personal or project-level loads.** Your user settings, hooks, `CLAUDE.md` files, MCP servers, other installed plugins, memory, and skills are absent, and no project-scoped `.claude/` or `.mcp.json` above the sandbox is read. Most of your shell environment is withheld too; only an allowlist and `EVAL_*` variables reach the run. If the plugin needs setup, ship it in the plugin, create it in a `scaffold_script`, or pass `EVAL_*` variables. + * **Managed policy can still restrict a run.** Restrictions in [managed settings](</docs/en/managed-settings>) an administrator deployed to the machine apply inside a run, so results on a managed machine can differ from an unmanaged one by that policy. + * **The Artifact tool is off.** A skill that publishes an [artifact](</docs/en/artifacts>) can be graded only on what it produces before that step. + * **The case definitions are hidden from the agent.** A run can’t read the eval directory, so Claude can’t see the case’s prompt, its graders, or sibling cases. + * **No network sandbox outside shell commands.** Shell commands you grant run under the sandbox’s network rules. A `WebFetch(domain:…)` grant reaches that domain directly, and the plugin’s own hooks and any real MCP servers you start can reach any host. + +## + +​ + +Eval suite reference + +Everything an eval suite can contain lives under the plugin’s eval directory, `evals/` unless you configured another. This tree shows every file `claude plugin eval` reads or writes there; only `prompt.md` or `case.yaml` is required for a case to exist: + + evals/ + ├── <case>/ # one directory per case; nest under a non-case directory to group + │ ├── prompt.md # frontmatter: case and run fields; body: the prompt + │ ├── case.yaml # optional: context.* fields, or the whole case in one file + │ ├── graders/ + │ │ └── <name>.md # one grader per file; frontmatter: type and options; body: rubric + │ ├── mocks/ # optional: mocks for this case only, same layout as below + │ └── <fixtures, scripts, transcripts referenced by case.yaml> + ├── mocks/ # optional: suite-wide MCP mocks + │ ├── <server>/ + │ │ ├── <tool>.md # one mocked tool; body: the tool result + │ │ ├── _server.md # optional: one agent that answers several tools + │ │ ├── _tools.json # optional: saved tools/list response for real descriptions and schemas + │ │ └── fixtures/ # files inserted with {{file:fixtures/...}} + │ └── .replay/<server>/ # adopted agent-mock recordings, answered without a model call + └── results/<timestamp>/ # written by each run; add results/ to .gitignore + ├── aggregate-result.json + ├── report.html + └── mock-recordings/ # agent-mock answers from clean runs, with ADOPT.txt + +### + +​ + +prompt.md frontmatter + +`prompt.md` frontmatter accepts these fields. An unknown key is an error: + +Field| Default| Purpose +---|---|--- +`schema_version`| `"1.1"`, set for you| Case format version. Cases written as `prompt.md` get it automatically, so you rarely set it +`name`| The directory name| Case name. `--case` globs match it and the report keys on it +`description`| | For humans. Not used at run time +`tags`| `[]`| Labels for `--tag` filtering. A case runs if any of its tags matches +`plugins`| The nearest enclosing plugin| Plugin directories under test, relative to the case directory. Set `plugins: ["../.."]` when auto-detection doesn’t find your plugin; see the plugin didn’t load +`runs`| `3`| Runs per arm, 1 to 50. `--runs` overrides it +`expected_outcome`| | For humans. Not used at run time +`model`| The child session’s default| Model for the agent under test. `--model` overrides it +`max_turns`| `10`| Turn cap, up to 200. Hitting it is recorded as a run error and usually lowers the score, so set it generously +`timeout_seconds`| `300`| Wall-clock cap per run, up to 3600 +`allowed_tools`| `[]`| Tools the case wants, such as `[Read, Glob, Grep, Skill]`. Read-only tools are granted when listed here; for anything else, see Grant tools +`append_system_prompt`| | Text appended to the child session’s system prompt +`env`| `{}`| Extra environment variables for the child session. Keys must match `EVAL_[A-Z0-9_]*`; any other key fails the run. The run inherits only an allowlist from your shell: basics such as `PATH` and locale, proxy and certificate settings, the variables that select and authenticate your model provider, most `ANTHROPIC_*` and `CLAUDE_CODE_*` configuration, and `EVAL_*`. To hand the plugin anything else, such as a toolchain setting, export it as an `EVAL_*` variable + +### + +​ + +case.yaml fields + +`case.yaml` describes the same case in YAML and adds the fields that point at other files. It requires `schema_version: "1.1"` and `name`. The `prompt.md` fields `description`, `tags`, `plugins`, `runs`, and `expected_outcome` go at the top level; `model`, `max_turns`, `timeout_seconds`, `allowed_tools`, `append_system_prompt`, and `env` go under `execution:`. When both files exist, `prompt.md` frontmatter overrides the matching `case.yaml` fields, the `prompt.md` body is the prompt, and `graders/*.md` are added after any graders listed in `case.yaml`. These fields exist only in `case.yaml`: + +Field| Purpose +---|--- +`context.scaffold_script`| A Bash script in the case directory that runs in the empty workspace before Claude starts, to create fixture files or a git repository. It runs only when you pass `--scaffold` +`context.history_file`| A `.jsonl` transcript in the case directory to resume. The case’s prompt becomes the next user turn +`context.add_dirs`| Directories inside the case directory that Claude may read during the run, granted read-only +`execution.prompt`| The prompt, when you keep the whole case in `case.yaml` and omit `prompt.md` +`graders`| A list of graders, each with a `name` plus the same keys a `graders/*.md` file takes in frontmatter. For `llm` graders, put the rubric in `criteria` + +### + +​ + +Grader frontmatter + +Every grader file under `graders/` takes these keys in frontmatter, plus the options for its type. The grader’s name is the filename without `.md`: + +Key| Default| Purpose +---|---|--- +`type`| required| One of the grader types +`weight`| `1`| Relative weight in the run’s score. Any positive number +`arm`| unset| `with-only` excludes the grader from scoring in a two-arm run; `both` forces a `tool_used: Skill` grader to be scored in both arms + +#### + +​ + +What a grader can look at + +`regex` graders take a `target` and `llm` graders take a `focus`. Both accept the same values: + +Value| What the grader sees +---|--- +`last_message`| Claude’s final response text. This is the default +`trace`| The session as JSON, one message per line. A `regex` grader sees every message; an `llm` judge sees the first 12 and the last 12. Quotes and newlines inside it are JSON-escaped, so a regex matches `\"` rather than `"` +`files`| The list of paths Claude created during the run, one per line. Not their contents, and not files that a scaffold created or that Claude only modified +`{ source: file, path: <path> }`| The contents of one file in the workspace after the run. Use this to grade what the plugin produced. A PNG, JPEG, GIF, or WebP file is shown to an `llm` judge as an image. An `llm` judge refuses other binary files such as `.pptx` or PDF; render them to an image or write them out as text and grade that +`mock_calls`| Each call Claude made to a mocked MCP tool, with its input and the mock’s answer + +#### + +​ + +Grader types + +Each grader type below lists its options and when it passes: + +Type| Options| Passes when +---|---|--- +`regex`| `pattern`, `flags`, `match`, `target`| The JavaScript regex `pattern` is found in the target. Set `match: not_contains` to require absence or `match: "count:N"` to require exactly N matches. Put case-insensitivity in `flags: i`; inline `(?i)` isn’t supported +`tool_used`| `tool`, `input_match`, `min`, `max`| The number of calls to `tool` whose JSON-encoded input matches the optional `input_match` regex is between `min`, default 1, and `max`, default unlimited. To assert a tool was never called, set both `min: 0` and `max: 0` +`tool_order`| `before`, `after`| Both tools were called and the first matching `before` call precedes the first matching `after` call. Each is a tool name or `{ tool, input_match }` +`file_exists`| `path`, `exists`| A file Claude created matches the `path` glob, or none does with `exists: false`. Only files created during the run count +`llm`| `criteria`, `focus`| A judge model votes PASS on the rubric in at least two of three votes. In the `.md` layout the file body is the criteria +`baseline`| `baseline_file`, `criteria`| A judge finds the run satisfies the criteria at least as well as the reference transcript at `baseline_file`, a `.jsonl` in the case directory + +### + +​ + +Mock files + +A `<tool>.md` file under `mocks/<server>/` answers one tool. Its body is the tool result, with `{{input.<field>}}` and `{{file:fixtures/<name>}}` substitutions. Its frontmatter accepts these keys: + +Key| Default| Purpose +---|---|--- +`type`| `fixed`| `fixed` returns the body as written. `agent` treats the body as instructions for a small model that plays the server for the run and sees earlier calls as history +`expect`| unset| A map from dotted input paths to a type name such as `string`, `number`, `boolean`, `array`, or `object`, a `/regex/`, a literal, or a list of allowed literals. A call that violates it aborts the run with score 0 and is reported as `aborted` with the server, tool, and reason +`error`| `false`| `fixed` only. Return the body as a tool error +`abort_when`| unset| `agent` only. Prose listing the only conditions under which the agent may abort the run + +Two optional files sit beside the tool files in a server’s directory: + + * **`_server.md`** : a single `type: agent` mock that answers several tools, listed in its `tools:` frontmatter key. A `<tool>.md` for the same tool takes precedence. Put an `expect:` guard on the individual `<tool>.md`, not here + * **`_tools.json`** : a saved `tools/list` response from the real server, so mocked tools carry their real descriptions and input schemas instead of a permissive placeholder + +A case’s own `mocks/` directory uses the same layout and overrides the suite’s mocks file by file. + +## + +​ + +Troubleshooting + +These are the problems authors hit most often, keyed on what you see. + +### + +​ + +”plugin eval is currently in early access” + +Your build predates general availability of the command. Run `claude update`, then run the command again in a fresh session. + +### + +​ + +”plugin eval is currently unavailable” + +Anthropic has switched the command off server-side. Nothing on your machine turns it back on; run `claude update` and try again in a fresh session later. + +### + +​ + +”is not a trusted plugin directory, and this run cannot stop to ask you about it” + +This is the first run against a directory Claude Code doesn’t trust yet, and it can’t ask you because stdin or stdout isn’t a terminal or you passed `--json`. Run `claude plugin eval <dir>` once in a terminal and answer the prompt, or pass `--trust-plugin` if you trust the plugin’s code and suite. See What a run can access. + +### + +​ + +”No eval cases found” + +No `<case>/prompt.md` or `<case>/case.yaml` exists beneath the eval directory in effect, or your `--case` and `--tag` filters matched no case. Run from the plugin root, or run `claude plugin eval init` to create a suite. + +### + +​ + +The baseline arm shows no plugin, or delta is zero + +If the summary has no `W/OUT` column, or the case fails with “ablation requested but no plugin resolved”, no plugin was found for the case. Add `plugins: ["../.."]` to the case, giving the path from the case directory to the plugin directory. If the plugin did load and `Δ` is still near zero with your `tool_used: Skill` grader failing, that’s usually a real finding, meaning the skill’s `description` doesn’t trigger on the prompt’s phrasing. Adjust the description and re-run the same suite. + +### + +​ + +Everything scores zero although the right files were produced + +Your graders target `files`, the list of created paths, when you meant the file’s contents. Use `{ source: file, path: <path> }` as the `target` or `focus`. Separately, `file_exists` counts only files created during the run, so a file the scaffold created or that Claude only edited is invisible to it; grade its contents, or use `tool_used` on `Edit`. + +### + +​ + +A regex over the trace doesn’t match text I can see + +The default `target` is `last_message`, not the trace. When you do target `trace`, it’s JSON per line, so quotes appear as `\"`. Regexes use JavaScript syntax, so put `i` in `flags` rather than writing `(?i)`. + +### + +​ + +Tools are denied, MCP tools are missing, or Bash won’t run + +Anything beyond the read-only set needs your grant, such as `--allow-tools Bash Write`. Your personal MCP servers never load in a run. The plugin’s own servers don’t start unless you opt in, and their tools then also need an `--allow-tools "mcp__plugin_<plugin>_<server>__*"` grant; a mocked tool needs neither. + +### + +​ + +The run exits 1 but the results look fine + +The default `--threshold` is 1.0, so the command exits 1 when any case scores below perfect. Set a threshold that matches your bar. Exit 1 also covers a case file that failed to load, which is reported on stderr above the table. + +### + +​ + +”—json output path must end in .json” + +You put the target after `--json`, so it was read as the output path. Put the target first, as in `claude plugin eval . --json`, or give `--json` an explicit `.json` path. + +### + +​ + +A grader shows passed: false under a run that scored 1.0 + +That grader is excluded from the score by design in a two-arm run, and its `scored` field is `false`. See Compare against a no-plugin baseline. + +### + +​ + +Runs fail with a usage-limit or rate-limit error partway through + +If your account reaches its plan’s usage limit or an API rate limit while a suite is running, each later run ends with that error, is graded on what it produced, and usually scores 0. The suite still finishes and isn’t marked `partial`, so the result can look like a regression. Check the `NOTES` column or `cases[].arms.with[].error` in the JSON for the limit message before trusting the scores, then re-run after the limit resets, with `--runs 1` or a `--case` filter if you need to stay under it. + +### + +​ + +Runs time out or hit the turn cap + +The defaults are 10 turns and 300 seconds. Raise `max_turns` and `timeout_seconds` in the case for tasks that need more, and use `--max-cost-usd` as the cost ceiling rather than tight per-run limits. + +## + +​ + +See also + + * [Create plugins](</docs/en/plugins>): build the plugin you’re testing, and load it with `--plugin-dir` during development + * [Plugins reference](</docs/en/plugins-reference#plugin-eval>): the `plugin eval` and `plugin eval init` command entries and the manifest’s `experimental.evals` key + * [Skills](</docs/en/skills>): how a skill’s description decides when Claude invokes it, which is what a case that checks whether the skill triggers is measuring + * [Sandboxing](</docs/en/sandboxing>): the OS-level sandbox that applies when you grant Bash to a run + * [Create and distribute a plugin marketplace](</docs/en/plugin-marketplaces>): publish the plugin once its suite passes
modified Create and distribute a plugin marketplace View current →
--- a/plugin-marketplaces.md +++ b/plugin-marketplaces.md @@ -1159,7 +1159,7 @@ Validation and testing -Test your marketplace before sharing. From your marketplace directory, validate the JSON syntax: +Test your marketplace before sharing. Validation checks file structure; to test whether a plugin changes what Claude does on realistic prompts, run its eval suite with [`claude plugin eval`](</docs/en/plugin-evals>) before you publish a new version. From your marketplace directory, validate the JSON syntax: claude plugin validate .
modified Plugins reference View current →
Show diff (266 lines)
--- a/plugins-reference.md +++ b/plugins-reference.md @@ -411,7 +411,8 @@ "lspServers": "./.lsp.json", "experimental": { "themes": "./themes/", - "monitors": "./monitors.json" + "monitors": "./monitors.json", + "evals": "quality/evals" }, "dependencies": [ "helper-lib", @@ -499,6 +500,7 @@ `lspServers`| string|array|object| [Language Server Protocol](<https://microsoft.github.io/language-server-protocol/>) configs for code intelligence (go to definition, find references, etc.)| `"./.lsp.json"` `experimental.themes`| string|array| Color theme files/directories (replaces default `themes/`). See Themes| `"./themes/"` `experimental.monitors`| string|array| Background [Monitor](</docs/en/tools-reference#monitor-tool>) configurations that start automatically when the plugin is active. See Monitors| `"./monitors.json"` +`experimental.evals`| string|array| Directory below the plugin root that holds the plugin’s [eval cases](</docs/en/plugin-evals#use-a-different-eval-directory>), when it isn’t the default `evals/`. `claude plugin eval --eval-dir` overrides it| `"quality/evals"` `userConfig`| object| User-configurable values prompted at enable time. See User configuration| See below `channels`| array| Channel declarations for message injection (Telegram, Slack, Discord style). See Channels| See below `dependencies`| array| Other plugins this plugin requires, optionally with semver version constraints. See [Constrain plugin dependency versions](</docs/en/plugin-dependencies>)| `[{ "name": "secrets-vault", "version": "~2.1.0" }]` @@ -874,11 +876,11 @@ claude plugin init <name> [options] -**Arguments:** +The command takes these arguments: * `<name>`: Plugin name. Becomes the skill namespace and the directory name under `~/.claude/skills/`, so it cannot contain spaces or path separators. -**Options:** +The command accepts these options: Option| Description| Default ---|---|--- @@ -889,7 +891,7 @@ `-f, --force`| Overwrite an existing `.claude-plugin/` at the target| `-h, --help`| Display help for command| -**Aliases:** `new` Each `--with` value adds a starter file for that component, ready to edit: +`claude plugin new` is an alias for this command. Each `--with` value adds a starter file for that component, ready to edit: Component| What it scaffolds ---|--- @@ -901,7 +903,7 @@ `output-style`| An `output-styles/<name>.md` that applies automatically while the plugin is enabled `channel`| An MCP-based [channel](</docs/en/channels>): a stdio server (`server.ts`), its `.mcp.json`, and a `package.json` -The scaffolded plugin uses the `@skills-dir` source rather than a marketplace. Admins can block this source with `strictKnownMarketplaces` or by adding `{"source": "skills-dir"}` to `blockedMarketplaces` in [managed settings](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>). When blocked, `plugin init` fails before writing. **Examples:** +The scaffolded plugin uses the `@skills-dir` source rather than a marketplace. Admins can block this source with `strictKnownMarketplaces` or by adding `{"source": "skills-dir"}` to `blockedMarketplaces` in [managed settings](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>). When blocked, `plugin init` fails before writing. These examples show common invocations: # Scaffold a minimal plugin claude plugin init my-helper @@ -922,11 +924,11 @@ claude plugin install <plugin> [options] -**Arguments:** +The command takes these arguments: * `<plugin>`: Plugin name or `plugin-name@marketplace-name` for a specific marketplace -**Options:** +The command accepts these options: Option| Description| Default ---|---|--- @@ -942,7 +944,7 @@ * `outcome`: `ok` or `failed` * `message`: a human-readable description of the result -Other fields, such as `pluginId`, `scope`, and `failureCode`, appear only when they apply. The `--json` option on `plugin uninstall`, `plugin update`, `plugin enable`, and `plugin disable` prints the same object with that subcommand’s own fields. A usage error, such as an invalid `--scope`, prints no result line and exits 1 with the reason on stderr. **Examples:** +Other fields, such as `pluginId`, `scope`, and `failureCode`, appear only when they apply. The `--json` option on `plugin uninstall`, `plugin update`, `plugin enable`, and `plugin disable` prints the same object with that subcommand’s own fields. A usage error, such as an invalid `--scope`, prints no result line and exits 1 with the reason on stderr. These examples show common invocations: # Install to user scope (default) claude plugin install formatter@my-marketplace @@ -963,11 +965,11 @@ claude plugin uninstall <plugin> [options] -**Arguments:** +The command takes these arguments: * `<plugin>`: Plugin name or `plugin-name@marketplace-name` -**Options:** +The command accepts these options: Option| Description| Default ---|---|--- @@ -978,7 +980,7 @@ `--json`| Print the result as one JSON object on the last line of stdout, in the same format as `plugin install --json`. Can’t be combined with `--prune`. Requires Claude Code v2.1.268 or later| `-h, --help`| Display help for command| -**Aliases:** `remove`, `rm` By default, uninstalling from the last remaining scope also deletes the plugin’s `${CLAUDE_PLUGIN_DATA}` directory. Use `--keep-data` to preserve it, for example when reinstalling after testing a new version. +`claude plugin remove` and `claude plugin rm` are aliases for this command. By default, uninstalling from the last remaining scope also deletes the plugin’s `${CLAUDE_PLUGIN_DATA}` directory. Use `--keep-data` to preserve it, for example when reinstalling after testing a new version. When installed plugins from different marketplaces share a name, the `plugin-name@marketplace-name` form uninstalls only the plugin from the named marketplace. Before v2.1.212, the qualified form could match and uninstall the same-named plugin from a different marketplace. @@ -992,7 +994,7 @@ claude plugin prune [options] -**Options:** +The command accepts these options: Option| Description| Default ---|---|--- @@ -1001,7 +1003,7 @@ `-y, --yes`| Skip the confirmation prompt. Required when stdin or stdout is not a TTY| `-h, --help`| Display help for command| -**Aliases:** `autoremove` The command lists orphaned dependencies and asks for confirmation before removing them. To remove a plugin and clean up its dependencies in one step, run `claude plugin uninstall <plugin> --prune`. +`claude plugin autoremove` is an alias for this command. The command lists orphaned dependencies and asks for confirmation before removing them. To remove a plugin and clean up its dependencies in one step, run `claude plugin uninstall <plugin> --prune`. ### @@ -1013,11 +1015,11 @@ claude plugin enable <plugin> [options] -**Arguments:** +The command takes these arguments: * `<plugin>`: Plugin name or `plugin-name@marketplace-name` -**Options:** +The command accepts these options: Option| Description| Default ---|---|--- @@ -1035,11 +1037,11 @@ claude plugin disable [plugin] [options] -**Arguments:** +The command takes these arguments: * `[plugin]`: Plugin name or `plugin-name@marketplace-name`. Optional when using `--all` -**Options:** +The command accepts these options: Option| Description| Default ---|---|--- @@ -1058,11 +1060,11 @@ claude plugin update <plugin> [options] -**Arguments:** +The command takes these arguments: * `<plugin>`: Plugin name or `plugin-name@marketplace-name` -**Options:** +The command accepts these options: Option| Description| Default ---|---|--- @@ -1085,7 +1087,7 @@ claude plugin list [options] -**Options:** +The command accepts these options: Option| Description| Default ---|---|--- @@ -1111,11 +1113,11 @@ claude plugin details <name> -**Arguments:** +The command takes these arguments: * `<name>`: Plugin name or `plugin-name@marketplace-name` -**Options:** +The command accepts these options: Option| Description| Default ---|---|--- @@ -1162,11 +1164,11 @@ claude plugin validate <path> [options] -**Arguments:** +The command takes these arguments: * `<path>`: Path to a plugin directory or a marketplace directory. See [Validate a plugin or a directory without a manifest](</docs/en/plugin-marketplaces#validate-a-plugin-or-a-directory-without-a-manifest>) for which files a plugin run covers. -**Options:** +The command accepts these options: Option| Description| Default ---|---|--- @@ -1188,17 +1190,68 @@ ​ +plugin eval + +Run a plugin’s [eval cases](</docs/en/plugin-evals>) and report scored results. Requires Claude Code v2.1.269 or later. Each case is a prompt plus graders; Claude Code runs it several times in an isolated session with only the target plugin loaded, and by default also without the plugin so the report shows the difference. See [Test plugins with evals](</docs/en/plugin-evals>) for the case format, graders, results, and CI usage. + + claude plugin eval [target] [options] + +The optional `target` is a plugin directory, a single `prompt.md` or `case.yaml` file, an installed plugin as `name` or `name@marketplace`, or `name@skills-dir`, and defaults to the current directory. Put it before `--tag`, `--allow-tools`, and `--json`. This table lists the options most runs use. Run `claude plugin eval --help` for the complete set, including `--case`, `--tag`, `--output-dir`, `--report`, `--allow-real-servers`, `--keep-temp`, and `--verbose`. + +Option| Description| Default +---|---|--- +`--runs <n>`| Runs per case per arm| Each case’s `runs`, else 3 +`-j, --concurrency <n>`| Agent sessions to run at once, 1 to 8. They share your rate limit| `1` +`--model <model>`| Model for the agent under test| Each case’s `model`, else `ANTHROPIC_MODEL` if set, else Claude Code’s default +`--judge-model <model>`| Model for `llm` and `baseline` graders| A small fast model +`--ablation <mode>`| `none` or `with-without`. See [Compare against a no-plugin baseline](</docs/en/plugin-evals#compare-against-a-no-plugin-baseline>)| `with-without` when a plugin resolves, else `none` +`--threshold <0..1>`| Exit 1 if any case scores below this| `1.0` +`--max-cost-usd <usd>`| Stop before the next run once spend reaches this, exit 2, and report partial results| No ceiling +`--allow-tools <tools...>`| Grant tools beyond the read-only set, such as `Bash`, `Write`, `Edit`, or `"mcp__plugin_<plugin>_<server>__*"`. See [Grant tools](</docs/en/plugin-evals#grant-tools>)| +`--scaffold`| Run each case’s [`scaffold_script`](</docs/en/plugin-evals#add-setup-or-history-with-case-yaml>)| Off +`--trust-plugin`| Skip the first-run trust prompt, for CI. See [What a run can access](</docs/en/plugin-evals#security>)| Off +`--mocks <mode>`| `record` or `off`. See [Mock MCP servers](</docs/en/plugin-evals#mock-mcp-servers>)| `record` +`--eval-dir <dir>`| Directory below the plugin that holds the cases| The manifest’s `experimental.evals`, else `evals` +`--json [path]`| Print the [result document](</docs/en/plugin-evals#json-result>) to stdout, or write it to a `.json` path| +`--no-publish`| Keep the HTML report local| +`-h, --help`| Display help for command| + +The command exits 0 when every case meets the threshold, 1 on a failing case, a load error, or an untrusted plugin directory, 2 on a partial run, 130 when interrupted, and 143 when terminated. See [Run evals in CI](</docs/en/plugin-evals#run-evals-in-ci>). + +### + +​ + +plugin eval init + +Create an eval suite for the plugin in the current directory. Requires Claude Code v2.1.269 or later. In a terminal this starts an authoring interview that reads the plugin, proposes cases and graders, pilots them, and writes the files. With `--bare`, or without a terminal, it writes a blank single-case template instead. Run from inside an interactive Claude Code session, it prints the interview instructions for that session to follow rather than writing a template. See [Create your first eval suite](</docs/en/plugin-evals#create-your-first-eval-suite>). + + claude plugin eval init [name] [options] + +The optional `name` is a case name: the interview doesn’t need one, while `--bare` and the no-terminal template path require it. It accepts these options: + +Option| Description| Default +---|---|--- +`--bare`| Write a blank `prompt.md` and `graders/criteria.md` for `<name>` instead of running the interview| +`-i, --interactive`| Require the interview. Fails without a terminal instead of writing a template| +`--eval-dir <dir>`| Directory below the current directory to write cases into| The manifest’s `experimental.evals`, else `evals` +`-h, --help`| Display help for command| + +### + +​ + plugin tag Create a release git tag for a plugin. By default the command tags the plugin in the current directory; pass a path to tag a plugin elsewhere. See [Tag plugin releases](</docs/en/plugin-dependencies#tag-plugin-releases-for-version-resolution>). claude plugin tag [path] [options] -**Arguments:** +The command takes these arguments: * `[path]`: Path to the plugin directory. Defaults to the current directory. -**Options:** +The command accepts these options: Option| Description| Default ---|---|---
modified How Claude Code uses prompt caching View current →
--- a/prompt-caching.md +++ b/prompt-caching.md @@ -34,7 +34,7 @@ * **Microsoft Foundry** : depends on the deployment’s [hosting option](<https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry#hosting-options>). Hosted on Azure deployments are served on Azure infrastructure; Hosted on Anthropic deployments are served on Anthropic’s infrastructure * **Custom`ANTHROPIC_BASE_URL` or [LLM gateway](</docs/en/llm-gateway>)**: the cache lives wherever your requests are forwarded, and whether caching works depends on the gateway -Claude Code also appends system context mid-conversation, such as file-change notices, and marks that block for caching on every provider and connection. At the provider’s own endpoint, Amazon Bedrock and its [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), Google Cloud’s Agent Platform, and Microsoft Foundry cache the block the same way the Claude API does. When your requests pass through an [LLM gateway](</docs/en/llm-gateway>), a custom `ANTHROPIC_BASE_URL`, or a cloud provider base-URL override such as [`ANTHROPIC_BEDROCK_BASE_URL`](</docs/en/env-vars>), what stays cached depends on how the gateway handles the [`cache_control` markers](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#explicit-cache-breakpoints>) Claude Code sends: +Claude Code also appends system context mid-conversation, such as file-change notices, and marks that block for caching on every provider and connection unless you set [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`](</docs/en/llm-gateway-protocol#disable-pre-release-capabilities>), in which case that block is sent uncached. At the provider’s own endpoint, Amazon Bedrock and its [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), Google Cloud’s Agent Platform, and Microsoft Foundry cache the block the same way the Claude API does. When your requests pass through an [LLM gateway](</docs/en/llm-gateway>), a custom `ANTHROPIC_BASE_URL`, or a cloud provider base-URL override such as [`ANTHROPIC_BEDROCK_BASE_URL`](</docs/en/env-vars>), what stays cached depends on how the gateway handles the [`cache_control` markers](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#explicit-cache-breakpoints>) Claude Code sends: * **Forwards them unchanged** : the block and your conversation cache the same as at the provider’s own endpoint. * **Rejects the marked request with a`400` error naming `cache_control`**: Claude Code re-sends the request with the marker moved off the block and onto your last conversation message, and keeps it there for the rest of the conversation. The block bills as uncached input; your conversation stays cached.
modified Choose a sandbox environment View current →
--- a/sandbox-environments.md +++ b/sandbox-environments.md @@ -19,7 +19,7 @@ Virtual machine| Full operating system| No| High Claude Code on the web| Full operating system, hosted by Anthropic| No| None; requires a Claude subscription, and GitHub when you launch from the web interface -The [sandboxed Bash tool](</docs/en/sandboxing>) is built into Claude Code and restricts only Bash commands. Built-in file tools, MCP servers, and hooks still run directly on your host. Every other approach in the table puts the whole Claude Code process inside the isolation boundary, so file tools, MCP servers, and hooks are restricted too. +The [sandboxed Bash tool](</docs/en/sandboxing>) is built into Claude Code and restricts Bash commands. Built-in file tools, MCP servers, and hooks still run directly on your host. Every other approach in the table puts the whole Claude Code process inside the isolation boundary, so file tools, MCP servers, and hooks are restricted too. Sandbox isolation reduces the impact of a breach, but it does not eliminate risk. Any approach that allows network egress can still leak data the agent can read, and any approach that mounts your project directory writable can still modify that code. Review the [security limitations](</docs/en/sandboxing#security-limitations>) before relying on a sandbox as a hard control.Isolation also does not change what is sent to the model. Your prompts and the files Claude reads are transmitted to the Anthropic API or your configured provider with or without a sandbox. See [Data usage](</docs/en/data-usage>) for what Claude Code sends and how to reduce it. @@ -61,7 +61,7 @@ The sandboxed Bash tool is built into Claude Code. It uses operating system primitives to restrict the filesystem and network access of every Bash command Claude runs. Run the `/sandbox` command to open the sandbox panel and choose a mode. The [Sandboxing](</docs/en/sandboxing>) guide covers the approval modes, the default boundary, and how to widen or narrow it. The per-command sandbox does not cover everything that runs in a session: * Other [built-in tools](</docs/en/tools-reference>) such as Read, Edit, and WebFetch run inside the Claude Code process and do not spawn arbitrary code. [Permission rules](</docs/en/permissions>) for path or domain gate them instead. - * [MCP](</docs/en/mcp>) servers and hooks are separate processes that run unconstrained on the host. + * [MCP](</docs/en/mcp>) servers and [command hooks](</docs/en/hooks#command-hook-fields>) are separate processes that run unconstrained on the host. To put built-in tools, MCP servers, and hooks all behind one OS boundary, run the whole Claude Code process inside the sandbox runtime, the dev container, or a custom container. @@ -155,7 +155,7 @@ Claude Code on the web -[Claude Code on the web](</docs/en/claude-code-on-the-web>) runs each session in an isolated, Anthropic-managed virtual machine. A network proxy enforces a default allowlist, and a separate proxy holds your GitHub token outside the sandbox while issuing scoped credentials for repository access inside it. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on infrastructure you provision instead, where isolation, egress control, and git credentials are your deployment’s responsibility. Use this approach when you want full VM isolation without provisioning infrastructure yourself, or when you are delegating tasks from a device that does not have a local development environment. It requires a Claude subscription. When you launch a session from the web interface, you also need a connected GitHub account so the sandbox can clone your repository. When you launch from the CLI with `--cloud`, Claude Code can [bundle and upload your local repository](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) instead if GitHub isn’t connected. See [Claude Code on the web](</docs/en/claude-code-on-the-web>) for plan availability and GitHub authentication options. +[Claude Code on the web](</docs/en/claude-code-on-the-web>) runs each session in an isolated, Anthropic-managed virtual machine. A network proxy enforces a default allowlist, and a separate proxy holds your GitHub token outside the sandbox while issuing scoped credentials for repository access inside it. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on infrastructure you provision instead, where isolation, egress control, and git credentials are your deployment’s responsibility. Use this approach when you want full VM isolation without provisioning infrastructure yourself, or when you are delegating tasks from a device that does not have a local development environment. It requires a Claude subscription. When you launch a session from the web interface, you also need a connected GitHub account so the sandbox can clone your repository. When you launch from the CLI with `--cloud`, Claude Code can [bundle and upload your local repository](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) instead. See [Claude Code on the web](</docs/en/claude-code-on-the-web>) for plan availability and GitHub authentication options. ##
modified Configure the sandboxed Bash tool View current →
--- a/sandboxing.md +++ b/sandboxing.md @@ -38,7 +38,9 @@ Ask Claude to run a command, such as a build or a test suite. By default, commands inside the sandbox can write to the working directory, the session temp directory, and any [directories you’ve added](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) with `--add-dir`, `/add-dir`, or `permissions.additionalDirectories`. The first time a command needs a new network 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.Commands that can’t run sandboxed fall back to the regular permission flow. Claude Code titles their permission prompt “Bash command (unsandboxed)” instead of “Bash command”, so you can tell which commands ran outside the sandbox. To widen or narrow what the sandbox allows, see Configure sandboxing.If sandboxed commands fail with `Operation not permitted` inside a container, see the Bubblewrap entry under Troubleshooting. -When you select a mode in the panel, Claude Code saves it to your project’s local settings at `.claude/settings.local.json`, which apply to the current project. Claude Code adds that file to your global gitignore when it saves a setting there. To enable the sandbox across all of your projects, set [`sandbox.enabled`](</docs/en/settings-reference#sandbox-enabled>) to `true` in your user settings at `~/.claude/settings.json`. To enforce sandboxing for every developer in an organization, use managed settings. +When you select a mode in the panel, Claude Code saves it to your project’s local settings at `.claude/settings.local.json`, which apply to the current project. Claude Code adds that file to your global gitignore when it saves a setting there. To enable the sandbox across all of your projects, set [`sandbox.enabled`](</docs/en/settings-reference#sandbox-enabled>) to `true` in your user settings at `~/.claude/settings.json`. To enforce sandboxing for every developer in an organization, use managed settings. To change the sandbox for one session without writing to a settings file, start Claude Code with [`--settings`](</docs/en/settings#change-a-setting-for-one-session>). For example, this command starts a sandboxed session in which Claude can’t retry a blocked command outside the sandbox: + + claude --settings '{"sandbox": {"enabled": true, "allowUnsandboxedCommands": false}}' By default, if the sandbox cannot start because dependencies are missing or the platform is unsupported, Claude Code shows a warning and runs commands without sandboxing. To make this a hard failure instead, set [`sandbox.failIfUnavailable`](</docs/en/settings-reference#sandbox-failifunavailable>) to `true`. This is intended for managed deployments that require sandboxing as a security gate.
modified Deploy self-hosted environments to production View current →
--- a/self-hosted-environments-deploy.md +++ b/self-hosted-environments-deploy.md @@ -464,7 +464,7 @@ A session holding a background task that never finishes doesn’t count as idle, so `--release-idle-session-min` won’t release that session’s slot. A session that’s waiting on an approval requested from inside a running tool call also doesn’t count as idle. Always set `--kill-session-after-min` alongside it as a hard backstop so no session can hold a slot indefinitely. `--kill-session-after-min` is a backstop for runaway sessions. On a runner on v2.1.260 or later, a session that reaches the limit isn’t terminated outright. The runner gives it a grace window, 15 minutes by default, which you can change with [`SELF_HOSTED_RUNNER_MAX_LIFETIME_GRACE_MS`](</docs/en/self-hosted-environments-reference#environment-variable-only-settings>): - * If the session is waiting on its user, or its turn has ended and it holds only background tasks, the runner releases it right away. The session resumes when its user sends their next message. + * If the session is waiting on its user, the runner releases it. If its turn has ended and it holds only background tasks, the runner waits up to 60 seconds for those tasks to finish and then releases it. The session resumes when its user sends their next message. * If a turn is still running, the runner waits for the turn to finish, or for the session to next wait on its user, and then releases it. * If the session is still on the runner when the grace window ends, the runner terminates it, and any running turn’s work is lost. A turn waiting on an approval requested from inside a running tool call is one way a session outlasts the window.
modified Configure server-managed settings View current →
--- a/server-managed-settings.md +++ b/server-managed-settings.md @@ -151,12 +151,13 @@ Per-key exceptions across managed sources -Two kinds of keys are exceptions to the no-merge rule: +Three kinds of keys are exceptions to the no-merge rule: * **Cross-source lock keys** : a small set of keys, such as the sandbox allowlist locks, [listed on the managed settings page](</docs/en/managed-settings#precedence-within-the-managed-tier>). Claude Code honors them when any admin-controlled managed source sets them; the user-writable HKCU registry tier is excluded. When a [`policyHelper`](</docs/en/settings-reference#policyhelper>) supplies managed settings, its output is the only source these checks read, apart from [`forceRemoteSettingsRefresh`](</docs/en/settings-reference#forceremotesettingsrefresh>), which Claude Code reads from the admin sources directly at startup. * **The`env` block**: apart from the telemetry unit and routing variables paired with a credential key, both covered below, it merges per key across the admin-controlled sources. For each environment variable, the highest-priority source defining it wins, and lower admin sources fill in variables the higher sources leave unset. An endpoint-managed `env` entry therefore applies whenever the server-managed configuration leaves that variable unset, or while a cached server value for it is withheld pending server confirmation. Requires Claude Code v2.1.223 or later. Before v2.1.223, Claude Code applies the selected source’s whole `env` block only. * **Telemetry unit** : the `OTEL_EXPORTER_OTLP_*` exporter keys, the `OTEL_LOG_*` content-capture toggles, `OTEL_LOGS_EXPORTER`, and the beta tracing variables `ENABLE_BETA_TRACING_DETAILED` and `BETA_TRACING_ENDPOINT` follow the highest source that sets any of them as a unit. A source that delivers the `otelHeadersHelper` credential key claims the unit too, but lands these variables only when it is the selected source: a source that isn’t selected but delivers the key contributes none of them and still blocks lower sources from filling them in. Either way, an exporter endpoint from one source can never pair with credentials from another. * **Credential-paired routing** : a source that pairs routing variables with a selected-source-only credential key, such as `apiKeyHelper` or `otelHeadersHelper`, contributes those routing variables only when it wins the slot. + * **Gateway sign-in keys** : Claude Code never reads [`forceLoginGatewayUrl`](</docs/en/settings-reference#forcelogingatewayurl>) or the `"gateway"` value of [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>) from server-managed settings, so selecting server-managed settings neither supplies a gateway sign-in nor hides one set in an MDM policy or managed settings file. The [`managedSourcesBehavior` entry](</docs/en/settings-reference#managedsourcesbehavior>) says which admin source on the machine supplies them. ### @@ -276,7 +277,7 @@ * Terminal UI and accessibility options * Numeric limits, budgets, and timeouts -Other delivered variables can require the user’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, so the user sees exactly what the policy is asking to set. Before v2.1.218, Claude Code applied fewer variables without asking the user, so settings such as `DISABLE_AUTO_COMPACT` triggered the dialog at any non-empty value. Claude Code decides whether four privacy toggles need approval by the delivered value rather than by the variable name: `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, `DISABLE_ERROR_REPORTING`, `DISABLE_TELEMETRY`, and `DO_NOT_TRACK`. A truthy value such as `1` or `true` only turns tracking, reporting, or other nonessential traffic off, so Claude Code applies it without asking the user. For any other non-empty value, Claude Code shows the dialog. Before v2.1.218, all of them except `DO_NOT_TRACK` applied without approval at any value, and `DO_NOT_TRACK` triggered the dialog at any non-empty value. Claude Code also decides whether [`API_FORCE_IDLE_TIMEOUT`](</docs/en/env-vars>) needs approval by the delivered value: a truthy value only turns the [body idle timeout](</docs/en/network-config#streaming-idle-watchdogs>) on, so Claude Code applies it without asking the user. For any other non-empty value, Claude Code shows the dialog. Before v2.1.248, any non-empty value triggered the dialog. Whether [`ANTHROPIC_CUSTOM_HEADERS`](</docs/en/env-vars#variables>) needs approval also depends on the delivered value. Headers that only tag requests, such as `Accept-Language`, apply without the dialog. A line that names a credential, an org or tenant selector, a routing or host override, or an API-behavior header, such as `Authorization`, `X-Api-Key`, `Host`, `anthropic-beta`, or the `X-Amzn-Bedrock-*` headers, requires approval. So does a line whose name isn’t a valid HTTP header token, or whose value contains a character an HTTP header can’t carry. The check matches words inside the header name, so `X-Client-Version`, which contains `client` and `version`, requires approval too. Before v2.1.251, any `ANTHROPIC_CUSTOM_HEADERS` value applied without it. A falsy value such as `0` or `false` for [`ENABLE_BETA_TRACING_DETAILED`](</docs/en/env-vars#variables>) or [`OTEL_LOG_RAW_API_BODIES`](</docs/en/env-vars#variables>) applies without the dialog, because it only turns detailed tracing or raw API body capture off. Any other non-empty value for either variable requires approval. +Other delivered variables can require the user’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, so the user sees exactly what the policy is asking to set. Before v2.1.218, Claude Code applied fewer variables without asking the user, so settings such as `DISABLE_AUTO_COMPACT` triggered the dialog at any non-empty value. Claude Code decides whether four privacy toggles need approval by the delivered value rather than by the variable name: `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, `DISABLE_ERROR_REPORTING`, `DISABLE_TELEMETRY`, and `DO_NOT_TRACK`. A truthy value such as `1` or `true` only turns tracking, reporting, or other nonessential traffic off, so Claude Code applies it without asking the user. For any other non-empty value, Claude Code shows the dialog. Before v2.1.218, all of them except `DO_NOT_TRACK` applied without approval at any value, and `DO_NOT_TRACK` triggered the dialog at any non-empty value. Claude Code also decides whether [`API_FORCE_IDLE_TIMEOUT`](</docs/en/env-vars>) needs approval by the delivered value: a truthy value only turns the [body idle timeout](</docs/en/network-config#streaming-idle-watchdogs>) on, so Claude Code applies it without asking the user. For any other non-empty value, Claude Code shows the dialog. Before v2.1.248, any non-empty value triggered the dialog. Whether [`ANTHROPIC_CUSTOM_HEADERS`](</docs/en/env-vars#variables>) needs approval also depends on the delivered value. Headers that only tag requests, such as `Accept-Language`, apply without the dialog. A line that names a credential, an org or tenant selector, a routing or host override, or an API-behavior header, such as `Authorization`, `X-Api-Key`, `Host`, `anthropic-beta`, or the `X-Amzn-Bedrock-*` headers, requires approval. A line also requires approval when its name isn’t a valid HTTP header token or its value contains a character an HTTP header can’t carry. The check matches words inside the header name, so `X-Client-Version`, which contains `client` and `version`, requires approval too. Before v2.1.251, any `ANTHROPIC_CUSTOM_HEADERS` value applied without it. A falsy value such as `0` or `false` for [`ENABLE_BETA_TRACING_DETAILED`](</docs/en/env-vars#variables>) or [`OTEL_LOG_RAW_API_BODIES`](</docs/en/env-vars#variables>) applies without the dialog, because it only turns detailed tracing or raw API body capture off. Any other non-empty value for either variable requires approval. ##
modified Settings files and precedence View current →
--- a/settings.md +++ b/settings.md @@ -344,7 +344,7 @@ [`syncClaudeAiSkills`](</docs/en/settings-reference#syncclaudeaiskills>)| `false` from any managed source, `--settings`, `~/.claude/settings.json`, or `.claude/settings.local.json`| Honored even when the winning managed source sets `true`; a `false` in `.claude/settings.json` is ignored [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>)| A lower cap from any scope, including `--settings`| Honored even when the managed settings Claude Code applies set a higher cap; the lowest cap applies. Requires Claude Code v2.1.267 or later -An app that runs Claude Code inside itself and sets [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>) is also an exception. Claude Code takes that app’s model configuration over the `model`, `fallbackModel`, and `modelOverrides` keys from every managed source, and over the model-selection variables in a managed `env` block, such as `ANTHROPIC_MODEL` and the `ANTHROPIC_DEFAULT_*_MODEL` family. Claude Code keeps a managed [`availableModels`](</docs/en/settings-reference#availablemodels>) allowlist in force unless the app supplies its own. +An app that runs Claude Code inside itself and sets [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>) is also an exception. Claude Code takes that app’s model configuration over the `model`, `fallbackModel`, `modelPicker`, and `modelOverrides` keys from every managed source, and over the model-selection variables in a managed `env` block, such as `ANTHROPIC_MODEL` and the `ANTHROPIC_DEFAULT_*_MODEL` family. Claude Code keeps a managed [`availableModels`](</docs/en/settings-reference#availablemodels>) allowlist in force unless the app supplies its own. ##
modified All settings View current →
--- a/settings-reference.md +++ b/settings-reference.md @@ -51,6 +51,7 @@ `claudeMdExcludes`| Skip specific [CLAUDE.md](</docs/en/memory#exclude-specific-claude-md-files>) files when memory loads| Memory and context| Any file `cleanupPeriodDays`| Choose how many days Claude Code keeps [transcripts](</docs/en/data-usage#data-retention>) before deleting them| Privacy and telemetry| Any file `companyAnnouncements`| Show your organization’s announcements at startup| Interface and terminal| Any file +`copyOnSelect`| Turn off automatic copying of text you select with the mouse in [fullscreen rendering](</docs/en/fullscreen#use-the-mouse>) and agent view| Global config settings| Global config `crossSessionInbound`| Choose whether Claude Code delivers [messages from your other sessions](</docs/en/cross-session-messaging#control-inbound-messages>), shows a notice without delivering them, or refuses them| Agents, sessions, and worktrees| Any file `defaultShell`| Choose whether Bash or PowerShell runs the shell commands you type with the [`!` prefix](</docs/en/interactive-mode#shell-mode-with-prefix>)| Interface and terminal| Any file `deniedMcpServers`| Block specific [MCP servers](</docs/en/mcp>) by URL, command, or name| MCP| Any file @@ -779,7 +780,7 @@ * `true`: sessions start at `xhigh` effort, with ultracode on when dynamic workflows are enabled for you, your model supports `xhigh`, and no effort cap is below `xhigh` * `false`: sessions start with ultracode off * **Default** : unset, so ultracode is off - * **Per-session overrides** : `/effort ultracode` turns ultracode on for one session without this key. So does `--effort ultracode`, which requires Claude Code v2.1.203 or later + * **Per-session overrides** : `/effort ultracode` turns ultracode on for one session without this key. The `--effort ultracode` flag also turns it on for one session and requires Claude Code v2.1.203 or later settings.json @@ -1086,7 +1087,7 @@ * `"acceptEdits"`: Claude Code also runs file edits and common filesystem commands such as `mkdir` and `mv` without asking * `"plan"`: Claude Code reads and plans but blocks edits until you approve a plan * `"auto"`: Claude Code runs everything, with background safety checks - * `"dontAsk"`: Claude Code runs only pre-approved tools and auto-denies every call that would otherwise prompt + * `"dontAsk"`: Claude Code auto-denies every call that would otherwise prompt; reads, other actions that need no approval, and pre-approved tools still run * `"bypassPermissions"`: Claude Code runs everything without asking * `"manual"`: an alias for `"default"`, in Claude Code v2.1.200 or later * **Default** : unset @@ -5863,7 +5864,7 @@ `managedSourcesBehavior` -Choose whether Claude Code applies only the highest-priority [managed source](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) your organization delivers, or combines every admin source it delivers. By default Claude Code takes the highest-priority source that carries a [policy key](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) and ignores the rest. A policy key is any settings key other than this one and `wslInheritsWindowsSettings`. So once server-managed settings or an MDM policy deliver a policy key, a `managed-settings.json` file contributes only the [keys Claude Code reads from every admin source](</docs/en/managed-settings#keys-read-from-every-admin-source>). With `"merge"`, every admin source you deliver contributes its keys to one combined policy. Requires Claude Code v2.1.242 or later. Set `"merge"` only where every source [ranked](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) below your highest one is under an administrator’s control, because Claude Code then adds entries from a lower source, such as `permissions.allow` rules, to the policy. +Choose whether Claude Code applies only the highest-priority [managed source](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) your organization delivers, or combines every admin source it delivers. By default Claude Code takes the highest-priority source that carries a [policy key](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) and ignores the rest. A policy key is any settings key other than this one and `wslInheritsWindowsSettings`. Under that default, once server-managed settings or an MDM policy deliver a policy key, a `managed-settings.json` file contributes only the [keys Claude Code reads from every admin source](</docs/en/managed-settings#keys-read-from-every-admin-source>). With `"merge"`, every admin source you deliver contributes its keys to one combined policy. Requires Claude Code v2.1.242 or later. Set `"merge"` only where every source [ranked](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) below your highest one is under an administrator’s control, because Claude Code then adds entries from a lower source, such as `permissions.allow` rules, to the policy. * **Scope** : `Managed`. Claude Code reads this key from the highest-priority source that carries either this key or a policy key, and ignores this key in every source ranked lower, so a lower source can’t opt itself into combining with the source above it. Neither the Windows HKCU registry nor [parent settings from an embedding host](</docs/en/managed-settings#let-an-embedding-host-add-policy>) take part in the merge. * **Type** : string, one of: @@ -5886,15 +5887,15 @@ Restriction allowlists| Takes the list whole from the highest source that sets it, without adding entries from lower sources. When the highest source doesn’t set one, takes it whole from the next source down| `availableModels`, `allowedMcpServers`, `strictKnownMarketplaces`, `allowedChannelPlugins`, and the `fallbackModel` chain Values taken whole| Takes the value whole from the highest source that sets it, without combining entries or fields from lower sources. When the highest source doesn’t set it, takes it whole from the next source down| `sandbox.credentials.awsPairs`, `sandbox.ripgrep` Provided MCP servers| Combines the server names from every source. When two sources set the same name, applies the higher source’s whole entry| `managedMcpServers` -Read from the highest-priority source only| Reads the key only from the highest-priority source that carries a policy key, so a lower source’s value is ignored even when the highest source sets none| `apiKeyHelper`, `awsAuthRefresh`, `awsCredentialExport`, `gcpAuthRefresh`, `otelHeadersHelper`, `proxyAuthHelper`, `forceLoginOrgUUID`, `forceLoginMethod`, `forceLoginGatewayUrl`, `parentSettingsBehavior`, `modelPicker`, `policyHelper`, `permissions.defaultMode` +Read from the highest-priority source only| Reads the key only from the highest-priority source that carries a policy key, so a lower source’s value is ignored even when the highest source sets none| `apiKeyHelper`, `awsAuthRefresh`, `awsCredentialExport`, `gcpAuthRefresh`, `otelHeadersHelper`, `proxyAuthHelper`, `forceLoginOrgUUID`, the `"claudeai"` and `"console"` values of `forceLoginMethod`, `parentSettingsBehavior`, `modelPicker`, `policyHelper`, `permissions.defaultMode` `env`| [Merges per variable across admin sources](</docs/en/managed-settings#keys-read-from-every-admin-source>), under both `"first-wins"` and `"merge"`| `env` Every other key| Takes the value from the highest source that sets it| `cleanupPeriodDays`, `model` -Taking `sandbox.credentials.awsPairs` and `sandbox.ripgrep` whole requires Claude Code v2.1.257 or later. Three of those keys add a condition of their own: +Taking `sandbox.credentials.awsPairs` and `sandbox.ripgrep` whole requires Claude Code v2.1.257 or later. A few keys add a condition that the table doesn’t show: * **`policyHelper`** : Claude Code honors it only when the highest source that carries a policy key is an MDM policy or a managed settings file, so under server-managed settings it doesn’t apply. * **`modelOverrides`** : pairs with `availableModels`. Claude Code takes `modelOverrides` from the highest source that sets it, unless a higher source sets `availableModels` without `modelOverrides`. In that case it ignores `modelOverrides` from every source. - * **`forceLoginGatewayUrl` and the `"gateway"` value of `forceLoginMethod`**: Claude Code reads them only from the managed sources on the machine itself and ignores them in server-managed settings. The machine’s values apply even when server-managed settings are also present. + * **`forceLoginGatewayUrl` and the `"gateway"` value of `forceLoginMethod`**: Claude Code never reads either from server-managed settings, so a value there neither applies nor hides one set in an MDM policy or managed settings file. Among the admin sources on the machine, only the highest-ranked one that carries a policy key supplies them, whether or not server-managed settings are also present. To confirm which sources combined on a machine, run `/status` and [read the `Setting sources` line](</docs/en/managed-settings#read-the-source-in-/status>). @@ -5974,7 +5975,7 @@ * The helper writes more than 1 MiB to stdout or to stderr. * stdout isn’t a single JSON object, or its `managedSettings` has a [schema violation Claude Code can’t repair](</docs/en/managed-settings#find-entries-claude-code-dropped>). -When the startup run fails, Claude Code prints the reason and refuses to start. After a non-zero exit or a timeout, the message includes the helper’s stderr. The refusal covers interactive sessions, `claude -p`, Agent SDK sessions, [background sessions](</docs/en/agent-view>), and most subcommands. The refusal is deliberate, so a helper that needs outage resilience should serve from its own cache and exit `0`. When a background refresh fails, Claude Code keeps the last successful policy in effect, and `/status` shows the failing refresh with its reason until a refresh succeeds. Each refresh runs under the same `timeoutMs` and failure rules as the startup run. With `--debug`, Claude Code writes the helper’s stderr from every run to the [debug log](</docs/en/debug-your-config>). Claude Code reports an invalid `policyHelper` value as a [dropped entry](</docs/en/managed-settings#find-entries-claude-code-dropped>) and starts the session on the remaining managed settings without running a helper. Invalid values include a bare path string and a `timeoutMs` below its minimum. To turn a helper off, remove the key from the source that sets it. +When the startup run fails, Claude Code prints the reason and refuses to start. After a non-zero exit, the reason includes the helper’s stderr, or its stdout when stderr is empty. After a timeout, the reason names the `timeoutMs` limit and includes none of the helper’s output. The refusal covers interactive sessions, `claude -p`, Agent SDK sessions, [background sessions](</docs/en/agent-view>), and most subcommands. The refusal is deliberate, so a helper that needs outage resilience should serve from its own cache and exit `0`. When a background refresh fails, Claude Code keeps the last successful policy in effect, and `/status` shows the failing refresh with its reason until a refresh succeeds. Each refresh runs under the same `timeoutMs` and failure rules as the startup run. With `--debug`, Claude Code writes the helper’s stderr from every run to the [debug log](</docs/en/debug-your-config>). Claude Code reports an invalid `policyHelper` value as a [dropped entry](</docs/en/managed-settings#find-entries-claude-code-dropped>) and starts the session on the remaining managed settings without running a helper. Invalid values include a bare path string and a `timeoutMs` below its minimum. To turn a helper off, remove the key from the source that sets it. ### @@ -6112,6 +6113,28 @@ { "autoInstallIdeExtension": false + } + +Claude Code ignores this key in `settings.json`. + +### + +​ + +`copyOnSelect` + +Copy text to your clipboard automatically when you finish selecting it with the mouse in [fullscreen rendering](</docs/en/fullscreen#use-the-mouse>) or [agent view](</docs/en/agent-view>). Appears in `/config` as **Copy on select** while fullscreen rendering is on. + + * **Scope** : `Global config` + * **Type** : Boolean + * `true`: Claude Code copies text to your clipboard when you finish selecting it + * `false`: selecting text leaves your clipboard unchanged, and you [copy the selection with a keyboard shortcut](</docs/en/fullscreen#use-the-mouse>) instead + * **Default** : `true` + +~/.claude.json + + { + "copyOnSelect": false } Claude Code ignores this key in `settings.json`.
modified Advanced setup View current →
--- a/setup.md +++ b/setup.md @@ -214,7 +214,7 @@ } } -`DISABLE_AUTOUPDATER` only stops the background check; `claude update` and `claude install` still work. To block all update paths, including manual updates, set [`DISABLE_UPDATES`](</docs/en/env-vars>) instead. Use this when you distribute Claude Code through your own channels and need users to stay on the version you provide. +On a native or npm installation, confirm the change took effect by running `claude doctor` and checking that the `Auto-updates` line shows `disabled (set by env: DISABLE_AUTOUPDATER)` instead of `enabled`. `DISABLE_AUTOUPDATER` only stops the background check; `claude update` and `claude install` still work. To block all update paths, including manual updates, set [`DISABLE_UPDATES`](</docs/en/env-vars>) instead. Use this when you distribute Claude Code through your own channels and need users to stay on the version you provide. ###
modified Create custom subagents View current →
--- a/sub-agents.md +++ b/sub-agents.md @@ -232,7 +232,7 @@ `name`| Yes| Unique identifier using lowercase letters and hyphens. [Hooks](</docs/en/hooks#subagentstart>) receive this value as `agent_type`. The filename doesn’t have to match. Names can’t contain `:`, which is reserved for [plugin-scoped identifiers](</docs/en/plugins>) such as `my-plugin:reviewer`. Claude Code doesn’t load a file whose name contains one and logs an error to the debug log. Before v2.1.218, such names were accepted `description`| Yes| When Claude should delegate to this subagent `tools`| No| Tools the subagent can use. Inherits every tool available to subagents if omitted. If no entry in the list resolves to a tool, the subagent usually [fails to launch](</docs/en/errors#agent-would-be-spawned-with-zero-tools>) with an error naming the entries. To preload Skills into context, use the `skills` field rather than listing `Skill` here -`disallowedTools`| No| Tools to deny, removed from inherited or specified list +`disallowedTools`| No| Tools to deny, removed from inherited or specified list. An entry with a specifier, such as `Bash(git push *)`, still removes the whole tool `model`| No| Model to use: `sonnet`, `opus`, `haiku`, `fable`, a full model ID such as `claude-opus-5`, or `inherit`. When you omit it, Claude Code picks the model in the subagent model order `permissionMode`| No| Permission mode: `default`, `acceptEdits`, `auto`, `dontAsk`, `bypassPermissions`, `plan`, or `manual` as an alias for `default`. The `manual` alias requires Claude Code v2.1.200 or later. Ignored for plugin subagents `maxTurns`| No| Maximum number of agentic turns before the subagent stops. When the subagent reaches the limit, Claude Code returns its output marked as partial, and Claude can resume it to continue. The partial marking requires Claude Code v2.1.246 or later @@ -343,7 +343,7 @@ Available tools -Subagents inherit the [built-in tools](</docs/en/tools-reference>) and MCP tools available in the main conversation, narrowed by two filters: the first removes a short list of tools from every subagent, and the second reduces the built-in tool set for subagents that run in the background, which is the default. Forks skip both filters and receive the main conversation’s exact tool pool. The first filter removes these tools, even when listed in the `tools` field: +Subagents inherit the [built-in tools](</docs/en/tools-reference>) and MCP tools available in the main conversation, narrowed by two filters: the first removes a short list of tools from every subagent, and the second reduces the built-in tool set for subagents that run in the background, which is the default. On macOS, Linux, and WSL, a subagent can also receive the Glob and Grep tools when the main conversation doesn’t have them, as described under [Glob tool behavior](</docs/en/tools-reference#glob-tool-behavior>). Forks skip both filters and receive the main conversation’s exact tool pool. The first filter removes these tools, even when listed in the `tools` field: * `Agent`, when the subagent is at the depth limit; in a fork the tool stays listed but returns an error instead of spawning * `AskUserQuestion` @@ -378,6 +378,8 @@ description: Inherits every tool except those from the github MCP server disallowedTools: mcp__github --- + +A `disallowedTools` entry with a specifier, such as `Bash(git push *)`, still removes the whole tool from the subagent, not only the matching commands. To keep Bash and block specific commands, add a [Bash deny rule](</docs/en/permissions#bash>) such as `Bash(git push *)` to `permissions.deny` in your settings. The rule applies to the main conversation and to subagents. #### @@ -494,7 +496,7 @@ The full content of each listed skill is injected into the subagent’s context at startup. This field controls which skills are preloaded, not which skills the subagent can access: without it, the subagent can still discover and invoke project, user, and plugin skills through the Skill tool during execution. To prevent a subagent from invoking skills entirely, omit `Skill` from the `tools` list or add it to `disallowedTools`. You can’t preload skills that set [`disable-model-invocation: true`](</docs/en/skills#control-who-invokes-a-skill>), since preloading draws from the same set of skills Claude can invoke. This includes the bundled `/verify` skill: only you can run it, so it can’t be preloaded either. If a listed skill is missing or disabled, for example by your organization’s policy, Claude Code skips it and logs a warning to the debug log. -This is the inverse of [running a skill in a subagent](</docs/en/skills#run-skills-in-a-subagent>). With `skills` in a subagent, the subagent controls the system prompt and loads skill content. With `context: fork` in a skill, the skill content is injected into the agent you specify. Both use the same underlying system. +This is the inverse of [running a skill in a subagent](</docs/en/skills#run-skills-in-a-subagent>). With `skills` in a subagent, the subagent controls the system prompt and loads skill content. With `context: fork` in a skill, the skill content is injected into the agent you specify. In both cases the subagent starts without your conversation history. ####
modified Configure your terminal for Claude Code View current →
--- a/terminal-config.md +++ b/terminal-config.md @@ -21,10 +21,11 @@ Terminal| Shift+Enter for newline ---|--- Ghostty, Kitty, iTerm2, WezTerm, Warp, Apple Terminal, Windows Terminal| Works without setup -VS Code, Cursor, Devin Desktop, Alacritty, Zed| Run `/terminal-setup` once +Other terminals that support the kitty keyboard protocol, such as foot and Alacritty 0.16 or later| Works without setup. Requires Claude Code v2.1.269 or later +VS Code, Cursor, Devin Desktop, Alacritty before 0.16, Zed| Run `/terminal-setup` once gnome-terminal, JetBrains IDEs such as PyCharm and Android Studio| Not available; use Ctrl+J or `\` then Enter -For VS Code, Cursor, Devin Desktop, Alacritty, and Zed, `/terminal-setup` writes a Shift+Enter keybinding into the terminal’s configuration file. On the first run you see a confirmation such as `Installed VSCode terminal Shift+Enter key binding`. Existing bindings are left in place; if you see a message such as `VSCode terminal Shift+Enter key binding already configured`, no change was made. Run `/terminal-setup` directly in the host terminal rather than inside tmux or screen, since it needs to write to the host terminal’s configuration. In VS Code, Cursor, and Devin Desktop, `/terminal-setup` also updates two editor settings: it sets `terminal.integrated.gpuAcceleration` to `"off"` to prevent garbled text in the integrated terminal, and it sets `terminal.integrated.mouseWheelScrollSensitivity` for smoother scrolling in [fullscreen mode](</docs/en/fullscreen>). To undo the GPU acceleration change, set it back to `"auto"` and reload the editor window. In Zed, `/terminal-setup` updates your `keymap.json` in place: +For VS Code, Cursor, Devin Desktop, Alacritty before 0.16, and Zed, `/terminal-setup` writes a Shift+Enter keybinding into the terminal’s configuration file. On the first run you see a confirmation such as `Installed VSCode terminal Shift+Enter key binding`. Existing bindings are left in place; if you see a message such as `VSCode terminal Shift+Enter key binding already configured`, no change was made. Run `/terminal-setup` directly in the host terminal rather than inside tmux or screen, since it needs to write to the host terminal’s configuration. In VS Code, Cursor, and Devin Desktop, `/terminal-setup` also updates two editor settings: it sets `terminal.integrated.gpuAcceleration` to `"off"` to prevent garbled text in the integrated terminal, and it sets `terminal.integrated.mouseWheelScrollSensitivity` for smoother scrolling in [fullscreen mode](</docs/en/fullscreen>). To undo the GPU acceleration change, set it back to `"auto"` and reload the editor window. In Zed, `/terminal-setup` updates your `keymap.json` in place: * If the keymap already has bindings and none of them is a Terminal `shift-enter`, Claude Code first backs it up to a copy in the same directory, such as `keymap.json.1a2b3c4d.bak`, then merges the Shift+Enter binding into your keymap, keeping your other keybindings and comments * If Claude Code can’t read or parse the keymap, can’t back it up, or can’t verify the merged result, it [leaves the file unchanged and prints the keybinding block to add yourself](</docs/en/errors#terminal-setup-left-your-zed-keymap-unchanged>) @@ -214,7 +215,7 @@ ---|--- `success`| Success messages and passing checks `error`| Error messages and failures -`warning`| Warnings, caution messages, and the auto mode border +`warning`| Warnings, caution messages, and the auto mode indicator `merged`| Merged pull request status #### @@ -227,9 +228,9 @@ Token| Controls ---|--- -`promptBorder`| Input box border in Manual mode -`planMode`| Plan mode accent and border -`autoAccept`| Accept-edits mode accent and border +`promptBorder`| Input box border +`planMode`| Plan mode accent, plan messages, and plan-mode dialogs +`autoAccept`| Accept-edits mode accent `bashBorder`| Input box border when entering a `!` shell command `ide`| IDE connection indicator `fastMode`| Fast mode indicator
modified Tools reference View current →
--- a/tools-reference.md +++ b/tools-reference.md @@ -17,8 +17,8 @@ `EnterWorktree`| Creates an isolated [git worktree](</docs/en/worktrees>) and switches into it. Pass a `path` to switch into an existing worktree instead of creating a new one. On first entry the target may be a worktree of the current repository or, in a multi-repo workspace, of a repository nested inside it. Before v2.1.203, a nested repository’s worktree was rejected. A `path` outside `.claude/worktrees/` prompts for your approval before entering, since it moves the session’s working directory and write access to that location. New-worktree creation and paths under `.claude/worktrees/` don’t prompt. Before v2.1.206, Claude entered paths outside `.claude/worktrees/` without a prompt. From within a worktree session, or from a subagent with a pinned working directory such as [`isolation: worktree`](</docs/en/sub-agents#supported-frontmatter-fields>), only the `path` form is available and the target must be under `.claude/worktrees/` of the session’s repository| Yes `ExitPlanMode`| Presents a plan for approval and exits plan mode| Yes `ExitWorktree`| Exits a worktree session and returns to the original directory. Not available to subagents that already run in their own working directory, such as with [`isolation: worktree`](</docs/en/sub-agents#supported-frontmatter-fields>)| No -`Glob`| Finds files based on pattern matching. See Glob tool behavior| No -`Grep`| Searches for patterns in file contents. See Grep tool behavior| No +`Glob`| Finds files based on pattern matching. Absent by default on macOS, Linux, and WSL. See Glob tool behavior| No +`Grep`| Searches for patterns in file contents. Absent by default on macOS, Linux, and WSL. See Grep tool behavior| No `ListAgents`| Lists the agents Claude can message with `SendMessage`: subagents in the session, [agent team](</docs/en/agent-teams>) teammates, your other local Claude Code sessions, and, while this session is connected to [Remote Control](</docs/en/remote-control>), your [Claude Code on the web](</docs/en/claude-code-on-the-web>) sessions and your Remote Control sessions on other machines. Backs the `/list-agents` command. See [cross-session messaging](</docs/en/cross-session-messaging>). Requires Claude Code v2.1.224 or later, and appears only in sessions where [cross-session messaging is enabled](</docs/en/cross-session-messaging#availability>). Teammate rows and the first line showing this session’s own name require v2.1.239 or later| No `ListMcpResourcesTool`| Lists resources exposed by connected [MCP servers](</docs/en/mcp>)| No `LSP`| Code intelligence via language servers: jump to definitions, find references, report type errors and warnings. See LSP tool behavior| No @@ -61,7 +61,6 @@ * in [`permissions.allow`](</docs/en/settings-reference#permissions-allow>) and [`permissions.deny`](</docs/en/settings-reference#permissions-deny>) in settings, and the `/permissions` interface * in the `--allowedTools` and `--disallowedTools` [CLI flags](</docs/en/cli-reference>) * in the Agent SDK’s [`allowedTools` and `disallowedTools`](</docs/en/agent-sdk/permissions#allow-and-deny-rules>) options - * in a [subagent’s `tools` or `disallowedTools`](</docs/en/sub-agents#supported-frontmatter-fields>) frontmatter * in a [skill’s `allowed-tools`](</docs/en/skills#frontmatter-reference>) frontmatter * in a hook’s [`if` condition](</docs/en/hooks-guide#filter-by-tool-name-and-arguments-with-the-if-field>) @@ -250,7 +249,13 @@ Glob tool behavior -The Glob tool finds files by name pattern. It supports standard glob syntax including `**` for recursive directory matching: +The Glob tool finds files by name pattern. On Windows, it’s part of the default tool set. On macOS, Linux, and WSL, Claude Code leaves Glob and Grep out of the default tool set, and Claude searches with `find` and `grep` through the Bash tool instead. In Claude’s shell those two commands run embedded versions of `bfs` and `ugrep`, and the searches reach your hooks and permission rules as `Bash` calls. On macOS, Linux, and WSL, you get the Glob and Grep tools back in these cases: + + * You name `Glob` or `Grep` in [`--tools` or `--allowedTools`](</docs/en/cli-reference#cli-flags>) when you start the session, or in the equivalent [Agent SDK](</docs/en/agent-sdk/overview>) options. With `--tools` you get the ones you list, and naming either tool in `--allowedTools` restores both. An allow rule in a settings file doesn’t have this effect. + * A permissions [deny rule](</docs/en/permissions#match-all-uses-of-a-tool>), the `--disallowedTools` flag, or [`--restricted`](</docs/en/cli-reference#cli-flags>) removes `Bash` from the session. + * A [subagent](</docs/en/sub-agents#available-tools>) lists `Glob` or `Grep` in its `tools` field and leaves out `Bash`. The listed tools come back for that subagent only, or for the whole session when it runs as the main session agent through [`--agent`](</docs/en/sub-agents#invoke-subagents-explicitly>) or the `agent` setting. + +Glob supports standard glob syntax including `**` for recursive directory matching: * `**/*.js` matches all `.js` files at any depth * `src/**/*.ts` matches all `.ts` files under `src/` @@ -264,7 +269,7 @@ Grep tool behavior -The Grep tool searches file contents for patterns. Where Glob finds files by name, Grep finds lines inside them. Grep is built on [ripgrep](<https://github.com/BurntSushi/ripgrep>) and uses ripgrep’s regex syntax, not POSIX grep. Patterns that include regex metacharacters need escaping. For example, finding `interface{}` in Go code takes the pattern `interface\{\}`. A pattern, glob, or file type that ripgrep rejects returns an error that includes ripgrep’s diagnostic, so Claude can correct the input and search again. Before v2.1.208, Claude Code reported a rejected input as `No files found` instead of an error, even when the searched-for text existed in the target files. Three output modes control what comes back: +The Grep tool searches file contents for patterns. Where Glob finds files by name, Grep finds lines inside them. On macOS, Linux, and WSL, Grep is absent by default under the same conditions as Glob. See Glob tool behavior for when both tools are available. Grep is built on [ripgrep](<https://github.com/BurntSushi/ripgrep>) and uses ripgrep’s regex syntax, not POSIX grep. Patterns that include regex metacharacters need escaping. For example, finding `interface{}` in Go code takes the pattern `interface\{\}`. A pattern, glob, or file type that ripgrep rejects returns an error that includes ripgrep’s diagnostic, so Claude can correct the input and search again. Before v2.1.208, Claude Code reported a rejected input as `No files found` instead of an error, even when the searched-for text existed in the target files. Three output modes control what comes back: * `files_with_matches`: file paths only, no line content. This is the default. * `content`: matching lines with file and line number. When the tool’s `offset` parameter points past the last match for a pattern that has matches, Grep returns `No entries at this offset`, so Claude widens or resets the offset instead of concluding the pattern doesn’t match.
modified Troubleshoot installation and login View current →
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -310,25 +310,7 @@ `curl: (56) Failure writing output to destination` -The `curl ... | bash` command downloads the script and pipes it to Bash for execution. This error, and the related `curl: (23) Failure writing output to destination`, means Bash did not receive the complete script. Exit code 56 indicates the download itself was interrupted, and exit code 23 indicates curl could not write what it received to the pipe, usually because Bash exited early. **Solutions:** - - 1. **Check network stability** : Claude Code binaries are hosted at `downloads.claude.ai`. Test that you can reach it: - - curl -sI https://downloads.claude.ai/claude-code-releases/latest - -An `HTTP/2 200` line means you reached the server and the original failure was likely intermittent; retry the install command. Other results point to the cause: - * `403`: usually a proxy or network filter blocking the host, or Claude Code is [not available in your region](<https://www.anthropic.com/supported-countries>) - * `5xx`: usually a temporary service issue; wait a few minutes and retry - * `Could not resolve host` or a connection timeout: your network is blocking the download - 2. **Try an alternative install method** : On macOS: - - brew install --cask claude-code - -On Windows: - - winget install Anthropic.ClaudeCode - -Then run `claude --version` to confirm: the command prints a version number such as `2.1.211 (Claude Code)`. If the shell reports `claude` isn’t found, open a new terminal window and retry: the session you installed from keeps its old `PATH`. +The `curl ... | bash` command downloads the script and pipes it to Bash for execution. This error, and the related `curl: (23) Failure writing output to destination`, means Bash did not receive the complete script. Exit code 56 indicates the download itself was interrupted, and exit code 23 indicates curl could not write what it received to the pipe, usually because Bash exited early. Test that you can reach `downloads.claude.ai` with the check in Check network connectivity. If you reached the server, the original failure was likely intermittent; retry the install command. You can also [try an alternative install method](</docs/en/setup#install-claude-code>). ###
modified Agent SDK reference - TypeScript View current →
--- a/typescript.md +++ b/typescript.md @@ -659,7 +659,7 @@ `supportedAgents()`| Returns available subagents as `AgentInfo``[]` `mcpServerStatus()`| Returns status of connected MCP servers `getContextUsage(opts?)`| Returns an `SDKControlGetContextUsageResponse` breaking down the session’s context window usage by category, skill, and tool. With the default `detail`, it is the same data `/context` shows in an interactive session. The `detail` option requires Agent SDK v0.3.257 or later -`readFile(path, options?)`| Reads a file from the session’s filesystem. Claude Code resolves the path against `cwd` and applies the same read-permission rules as the Read tool. Pass `{ maxBytes }` to change the read cap (default 1 MB, ceiling 10 MB) and `{ encoding: 'base64' }` for binary files such as images. Resolves with an `SDKControlReadFileResponse`, or `null` on permission denial, a missing file, or a transport error. Requires TypeScript SDK v0.2.121 or later +`readFile(path, options?)`| Reads a file from the session’s filesystem. Claude Code resolves the path against `cwd`; What `readFile()` can read lists the files it serves. Pass `{ maxBytes }` to change the read cap (default 1 MB, ceiling 10 MB) and `{ encoding: 'base64' }` for binary files such as images. Resolves with an `SDKControlReadFileResponse`, or `null` on permission denial, a missing file, or a transport error. Requires TypeScript SDK v0.2.121 or later `reloadSkills()`| Reloads skills from disk, so skills you add or edit mid-session become available to the running session. Resolves with an `SDKControlReloadSkillsResponse` listing the skills available after the reload. Requires Agent SDK v0.3.163 or later `accountInfo()`| Returns account information `reconnectMcpServer(serverName)`| Reconnect an MCP server by name. If the name also matches an entry in a settings file such as `.mcp.json` or `~/.claude.json`, Claude Code reconnects the server you configured through `mcpServers` or `setMcpServers()`, not the settings-file entry. That resolution order requires Claude Code v2.1.257 or later @@ -743,7 +743,7 @@ `hooks_applied` reports whether Claude Code registered the `hooks` that the `initialize` request carried. The SDK sends that request once when the session starts and again on each `reinitialize()` call. The field requires Agent SDK v0.3.238 or later. Claude Code omits the field when the request carried no hooks. When the request carried hooks, the value depends on whether the request is the session’s first initialize and, for a repeated one, on how it reached the session: - * `true`: Claude Code registered the hooks. A session’s first initialize returns this value. So does a repeated initialize sent over the CLI’s stdin. In that case the hooks in the new request replace the hooks registered earlier. + * `true`: Claude Code registered the hooks. A session’s first initialize returns this value. A repeated initialize sent over the CLI’s stdin also returns `true`. In that case the hooks in the new request replace the hooks registered earlier. * `false`: Claude Code ignored the hooks. A repeated initialize sent to a remote session returns this value, so a second client that joins a session can’t replace the hooks the first client registered. Before Agent SDK v0.3.238, the response never carried the field, and Claude Code ignored `hooks` on every repeated initialize. The response always reports `fast_mode_state`, and when something blocks [fast mode](</docs/en/fast-mode>), `fast_mode_disabled_reason` carries the reason code alongside it, so you can explain the blocked state instead of re-deriving availability. Both behaviors require Claude Code v2.1.219 or later. Before v2.1.219, the response omitted `fast_mode_state` when fast mode wasn’t available and never carried a reason. For the reason codes and their meanings, see `fast_mode_disabled_reason` on the result message. The control-response wrapper for a successful `initialize` also carries a `pending_permission_requests` array. The field is on the response wrapper itself, not in the `SDKControlInitializeResponse` payload above. Each entry is a complete `control_request` message with the same `{ type: "control_request", request_id, request }` shape the session streams for permission requests while running. The array lists the permission requests that this Claude Code process has issued and not yet resolved. The SDK reads the array for you and dispatches each entry to your `canUseTool` callback, the same redelivery that `reinitialize()` triggers after a transport gap. Handle repeated request IDs idempotently, because an entry can repeat a request the callback already received before the connection dropped. The array is always present on a successful `initialize` response and is empty when this process has no unresolved permission request. Requires Claude Code v2.1.268 or later. Earlier versions could omit the field, so if you parse the wire protocol yourself, treat a missing field as an older CLI rather than as proof that nothing is pending. @@ -894,6 +894,19 @@ }; `contents` holds the file text, or base64 data when you requested `encoding: 'base64'`; the response’s `encoding` field is set to `'base64'` in that case. `absPath` is the resolved absolute path. `truncated` is set when the file was longer than the `maxBytes` cap and the contents were cut at that limit. + +#### + +​ + +What `readFile()` can read + +`readFile()` serves a narrower set of files than the Read tool: + + * A regular file inside one of the session’s working directories, such as `cwd` and `additionalDirectories` + * A few of Claude Code’s own files for the session, such as tool results + +`Read` deny and ask rules still block a matching path, and a broad `Read` allow rule doesn’t open the rest of the filesystem to `readFile()`. For anything else the call resolves with `null`. ### @@ -3943,7 +3956,7 @@ }; }; -Returns the fetched content with HTTP status and metadata. `artifactRead` is present only when Claude fetched an artifact the session can publish to, and it always carries that artifact’s `slug`. `seeded` is `false` on a read that didn’t deliver the page’s full source, and that entry carries no `ver`. The field requires Agent SDK v0.3.239 or later. +Returns the fetched content with HTTP status and metadata. `artifactRead` is Claude Code’s own record of an artifact read, present only when Claude fetched an artifact the session can publish to. Claude Code reads it back when a session resumes so a later publish builds on the right version; your code doesn’t need to act on it. `slug` names the artifact, `ver` is the version the read put on record and is absent when it recorded none, and `seeded: false` marks a read whose full source didn’t reach Claude. The `seeded` field requires Agent SDK v0.3.239 or later. ### @@ -5389,7 +5402,7 @@ `SDKLocalCommandOutputMessage` -Output from a local command such as `/voice` or `/usage`. Displayed as assistant-style text in the transcript. +Claude Code doesn’t emit this message type. When you send a command such as `/context` or `/usage` as a prompt, its output arrives as an `SDKAssistantMessage`. type SDKLocalCommandOutputMessage = { type: "system";
modified Use Claude Code in VS Code View current →
--- a/vs-code.md +++ b/vs-code.md @@ -256,6 +256,30 @@ ​ +Share a plugin install link + +To send someone straight to installing a specific plugin, give them the extension’s `install-plugin` URL. Opening it launches or focuses VS Code, opens the Claude Code panel, and opens the **Manage plugins** dialog on that plugin’s scope choice. Nothing installs until the person picks a scope. If the plugin’s marketplace isn’t configured in their Claude Code yet, the dialog first asks them to add it. + + vscode://anthropic.claude-code/install-plugin?plugin=code-review&marketplace=anthropics/claude-plugins-official + +The URL takes two query parameters: + +Parameter| Description +---|--- +`plugin`| The plugin’s name as its marketplace lists it. Required. +`marketplace`| Where the plugin comes from, in any form the Marketplaces tab accepts, such as a GitHub `owner/repo` or a git URL. URL-encode it if it contains characters such as `&`. Defaults to `anthropics/claude-plugins-official` when omitted. + +Two cases end at a message in the dialog instead of the scope choice: + + * **The marketplace doesn’t list a plugin by that name** : the dialog reports that the plugin wasn’t found. Check the `plugin` value against the marketplace’s listing. + * **The plugin is already installed** : the dialog says so, and nothing changes. + +GitHub READMEs, issues, and some other Markdown hosts strip links whose scheme isn’t `http` or `https`, so a `vscode://` link there renders as plain text. Put the URL in a code block on those hosts, as [The link renders as plain text instead of being clickable](</docs/en/deep-links#the-link-renders-as-plain-text-instead-of-being-clickable>) describes for `claude-cli://` links. + +### + +​ + Manage marketplaces Switch to the **Marketplaces** tab to add or remove plugin sources: @@ -348,7 +372,7 @@ vscode://anthropic.claude-code/open?prompt=review%20my%20changes -To launch a terminal session instead of a VS Code tab, use the CLI’s `claude-cli://` handler. See [Launch sessions from links](</docs/en/deep-links>). +The extension also handles `vscode://anthropic.claude-code/install-plugin`, which opens the plugin dialog on one plugin. To launch a terminal session instead of a VS Code tab, use the CLI’s `claude-cli://` handler. See [Launch sessions from links](</docs/en/deep-links>). ##
modified Get started with Claude Code on the web View current →
--- a/web-quickstart.md +++ b/web-quickstart.md @@ -64,7 +64,7 @@ Sign in with GitHub -After you sign in, claude.ai/code prompts you to connect GitHub. Follow the prompt, and claude.ai/code sends you to GitHub’s authorization page. Approve the authorization request, and GitHub returns you to claude.ai/code. Cloud sessions work with existing GitHub repositories and can reach any repository your GitHub account can see. To start a new project, [create an empty repository on GitHub](<https://github.com/new>) first.When Quick web setup is off, which it is by default on Team and Enterprise plans, claude.ai/code then asks you to install the Claude GitHub App on your repositories unless it’s already installed. Install it if you want [Auto-fix](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>), which lets Claude respond to CI failures and review comments on pull requests in those repositories; otherwise click **Skip**. Either way, sessions can reach the same repositories. +After you sign in, claude.ai/code prompts you to connect GitHub. Follow the prompt, and claude.ai/code sends you to GitHub’s authorization page. Approve the authorization request, and GitHub returns you to claude.ai/code. Cloud sessions work with existing GitHub repositories. To start a new project, [create an empty repository on GitHub](<https://github.com/new>) first.With this connection, a session can clone any public repository, but can work in a private repository only when the Claude GitHub App is installed on it. [Install the App](<https://github.com/apps/claude/installations/new>) on each GitHub account or organization whose private repositories you want to use. On a GitHub organization, an organization owner may need to approve the installation. Installing the App also enables [Auto-fix](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>), which lets Claude respond to CI failures and review comments on pull requests in those repositories.If onboarding prompts you to install the App at this point and you’d rather do it later, click **Skip**. 3 @@ -83,7 +83,7 @@ Connect from your terminal -If you already use the GitHub CLI (`gh`), you can set up Claude Code on the web without opening a browser. This requires the [Claude Code CLI](</docs/en/quickstart>). When you run `/web-setup`, Claude Code reads your local `gh` token, links it to your claude.ai account, and creates the **Default** cloud environment if you don’t have one. On Team and Enterprise plans, `/web-setup` is available only after an Owner turns on [Quick web setup](</docs/en/claude-code-on-the-web#github-authentication-options>). +If you already use the GitHub CLI (`gh`), you can set up Claude Code on the web without opening a browser. This requires the [Claude Code CLI](</docs/en/quickstart>). On Team and Enterprise plans, `/web-setup` is available only after an Owner turns on [Quick web setup](</docs/en/claude-code-on-the-web#github-authentication-options>). When you run `/web-setup`, Claude Code reads the token that `gh auth token` prints, asks you to confirm, and sends the token to Anthropic. Anthropic stores it encrypted with your claude.ai account, and your cloud sessions use it for GitHub access until you remove it. A cloud session can then access any repository that token can access, with no Claude GitHub App installation. If you already connected GitHub in the browser, `/web-setup` warns you that continuing replaces that connection for your cloud sessions. Organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled cannot use `/web-setup` or other cloud session features. If the GitHub CLI isn’t installed or isn’t authenticated, Claude Code opens the browser onboarding flow instead. @@ -109,7 +109,15 @@ /web-setup -This syncs your `gh` token to your Claude account. On success, Claude Code prints `Connected as <your-github-username>` and opens [claude.ai/code](<https://claude.ai/code>) in your browser. If you don’t have a cloud environment yet, `/web-setup` creates one with Trusted network access and no setup script. You can [edit the environment or add variables](</docs/en/cloud-environments#configure-your-environment>) afterward. Once `/web-setup` completes, you can start cloud sessions from your terminal with [`--cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>) or set up recurring tasks with [`/schedule`](</docs/en/routines>). +Confirm the prompt to send your `gh` token to your Claude account. On success, Claude Code prints `Connected as <your-github-username>` and opens [claude.ai/code](<https://claude.ai/code>) in your browser. If you don’t have a cloud environment yet, `/web-setup` creates one with Trusted network access and no setup script. You can [edit the environment or add variables](</docs/en/cloud-environments#configure-your-environment>) afterward. Once `/web-setup` completes, you can start cloud sessions from your terminal with [`--cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>) or set up recurring tasks with [`/schedule`](</docs/en/routines>). + +#### + +​ + +Remove the `/web-setup` token + +To remove the token from your Claude account, disconnect GitHub at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>). Disconnecting deletes the GitHub credentials your cloud sessions use, whether they came from the browser or from `/web-setup`, so cloud sessions lose GitHub access until you connect again. Your local `gh` stays signed in, and the token remains valid on GitHub. To invalidate the token itself, revoke it on GitHub. If you signed in to `gh` through the browser, the token belongs to the **GitHub CLI** entry under [**Settings > Applications > Authorized OAuth Apps**](<https://github.com/settings/applications>) on GitHub, and revoking that entry also signs the GitHub CLI out on your machines. Cloud sessions then lose GitHub access until you run `gh auth login` and `/web-setup` again. ## @@ -212,7 +220,7 @@ No repositories appear after connecting GitHub -A cloud session can use any repository the connected GitHub account can see, regardless of which repositories the Claude GitHub App is installed on. If a repository is missing, verify the connected GitHub account has access to it on GitHub. If you also want [Auto-fix](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>) for a repository, install the App on it: on github.com, open **Settings → Applications → Claude → Configure** and verify the repository is listed under **Repository access**. Private repositories need the same authorization as public ones. +If you connected GitHub in the browser, sessions can clone any public repository, but a private repository appears only when the Claude GitHub App is installed on the account or organization that owns it and the installation’s repository access includes it. [Install the Claude GitHub App](<https://github.com/apps/claude/installations/new>) there, or ask an organization owner to install or approve it. If you connected with `/web-setup`, sessions reach every repository your `gh` token can access. Run `gh repo view OWNER/REPO` in your shell to check that your GitHub CLI login can see the repository, and run `/web-setup` again if you’ve switched `gh` accounts since connecting. ###
modified Run parallel sessions with worktrees View current →
--- a/worktrees.md +++ b/worktrees.md @@ -1,6 +1,6 @@ A [git worktree](<https://git-scm.com/docs/git-worktree>) is a separate working directory with its own files and branch, sharing the same repository history and remote as your main checkout. Running each Claude Code session in its own worktree means edits in one session never touch files in another, so one session can build a feature while a second fixes a bug. -Worktrees require a git repository; for other version control systems, configure hooks to replace the git logic. In the [desktop app](</docs/en/desktop#work-in-parallel-with-sessions>), every new session gets its own worktree automatically. +Worktrees require a git repository; for other version control systems, configure hooks to replace the git logic. In the [desktop app](</docs/en/desktop#work-in-parallel-with-sessions>), select the **worktree** option when you start a session to give it its own worktree. Worktrees are one of several ways to run Claude in parallel. They isolate file edits. [Subagents](</docs/en/sub-agents>) split work up inside one session, and [cross-session messaging](</docs/en/cross-session-messaging>) lets Claude pass findings between the sessions in your worktrees. See [Run agents in parallel](</docs/en/agents>) to compare the approaches, or skip ahead to Isolate subagents with worktrees to use worktrees and subagents together. Most sessions need only the first two sections: start Claude in a worktree, then clean up when you exit. Return to the rest of the page when you need to resume a session, change how worktrees are created, or debug a failure.