modified Claude Code changelog View current →
--- a/changelog.md +++ b/changelog.md @@ -1,4 +1,31 @@ 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.217 + +July 21, 2026 + + * Added emoji shortcode autocomplete in the prompt input: type `:heart:` to insert ❤️, or `:hea` for suggestions — disable with the `emojiCompletionEnabled` setting + * Added warnings when transcript writes are failing (e.g. disk full) or when session saving is off due to an inherited environment variable, instead of losing transcripts silently + * Fixed a memory leak where truncated MCP tool outputs kept the full untruncated result in memory for the rest of the session + * Fixed Windows auto-update failures that could leave `claude.exe` missing; failed updates now restore the preserved executable automatically + * Fixed background session isolation not canonicalizing symlinked working directories, which could let sessions escape their workspace folder + * Fixed auto-compact never triggering for Claude Opus 4.8 on Bedrock and `/compact` failing once over the limit + * Fixed corporate mTLS, TLS-verify, OAuth scope, and proxy settings being ignored in Claude Desktop sessions + * Fixed screen reader mode’s startup announcement being cut off by the first prompt render, and the thinking status row re-rendering every few seconds to update elapsed time and token counts + * Fixed managed settings that set `OTEL_EXPORTER_OTLP_ENDPOINT` not governing all signals — lower-scope signal-specific overrides no longer redirect telemetry away from the managed endpoint + * Fixed `--resume`/`--continue` and `/resume` failing with a TypeError when a transcript has a malformed attachment entry + * Fixed Remote Control sessions not showing a pending permission prompt or dialog to viewers that connected after it appeared + * Fixed background shells sometimes becoming impossible to stop after a session is sent to the background (`/background` or `←`) or when the session exits on a heavily loaded machine, most visible on Windows + * Fixed a `CLAUDE.md` or `SKILL.md` paths frontmatter value with many brace groups OOM-killing or stalling the CLI at startup — brace expansion is now budget-bounded + * Fixed the transcript preview sitting flush against the input area when attaching to a starting background session; it now leaves the same one-line gap as the live layout, so the transcript no longer shifts when the session takes over + * Improved footer PR badge links to be clickable hyperlinks even when terminal support can’t be detected (e.g. over ssh/tmux); set `FORCE_HYPERLINK=0` to opt out + * Changed the login-expiry warning to appear 3 days before expiry instead of 5 + * Capped the frontend-design plugin suggestion tip at 3 lifetime impressions instead of repeating indefinitely + * Added a cap on concurrently-running subagents (default 20, override with `CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS`) so one message can’t fan out unbounded background agents + * Changed subagents to no longer spawn nested subagents by default; set `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH` to allow deeper nesting + * Fixed `--max-budget-usd` not stopping background subagents: once the cap is reached, new spawns are denied and running background agents are halted ​ @@ -266,6 +293,7 @@ * Added `vimInsertModeRemaps` setting: map two-key insert-mode sequences like `jj` to Escape in vim mode * Added `CLAUDE_CODE_PROCESS_WRAPPER`: agent view and the background service now honor a corporate launcher by running every Claude Code self-spawn through a required wrapper executable * Added mouse-click support for multi-select menus and “Other” input rows in fullscreen mode + * Changed the Fable 5 usage-credits consent prompt to start with the decline option focused * Fixed fast mode staying off after switching back to a model that supports it — it now restores automatically when enabled in settings * Fixed replies typed to a background agent being lost when delivery fails — the text is now saved and delivered when the session restarts * Fixed background-session attach failing permanently (“Couldn’t start the background daemon”) after an update replaced the binary a running `claude agents` process was launched from
modified Push events into a running session with channels View current →
--- a/channels.md +++ b/channels.md @@ -32,7 +32,7 @@ /plugin install telegram@claude-plugins-official -If Claude Code reports `Marketplace "claude-plugins-official" not found`, add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`. If it reports that the plugin is not found in the marketplace, your local copy is outdated: refresh it with `/plugin marketplace update claude-plugins-official`. Then retry the install.After installing, run `/reload-plugins` to activate the plugin’s configure command. +If Claude Code reports `Marketplace "claude-plugins-official" not found`, add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`. If it reports that the plugin is not found in the marketplace, your local copy is outdated: refresh it with `/plugin marketplace update claude-plugins-official`. Then retry the install.When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. After installing, run `/reload-plugins` to activate the plugin’s configure command. 3 @@ -105,7 +105,7 @@ /plugin install discord@claude-plugins-official -If Claude Code reports `Marketplace "claude-plugins-official" not found`, add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`. If it reports that the plugin is not found in the marketplace, your local copy is outdated: refresh it with `/plugin marketplace update claude-plugins-official`. Then retry the install.After installing, run `/reload-plugins` to activate the plugin’s configure command. +If Claude Code reports `Marketplace "claude-plugins-official" not found`, add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`. If it reports that the plugin is not found in the marketplace, your local copy is outdated: refresh it with `/plugin marketplace update claude-plugins-official`. Then retry the install.When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. After installing, run `/reload-plugins` to activate the plugin’s configure command. 5 @@ -157,7 +157,7 @@ /plugin install imessage@claude-plugins-official -If Claude Code reports `Marketplace "claude-plugins-official" not found`, add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`. If it reports that the plugin is not found in the marketplace, your local copy is outdated: refresh it with `/plugin marketplace update claude-plugins-official`. Then retry the install. +If Claude Code reports `Marketplace "claude-plugins-official" not found`, add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`. If it reports that the plugin is not found in the marketplace, your local copy is outdated: refresh it with `/plugin marketplace update claude-plugins-official`. Then retry the install.When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. Claude Code then suggests running `/reload-plugins`; you can skip that here, because restarting in the next step picks up the plugin. 3 @@ -207,7 +207,7 @@ /plugin install fakechat@claude-plugins-official -If Claude Code reports `Marketplace "claude-plugins-official" not found`, add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`. If it reports that the plugin is not found in the marketplace, your local copy is outdated: refresh it with `/plugin marketplace update claude-plugins-official`. Then retry the install. +If Claude Code reports `Marketplace "claude-plugins-official" not found`, add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`. If it reports that the plugin is not found in the marketplace, your local copy is outdated: refresh it with `/plugin marketplace update claude-plugins-official`. Then retry the install.When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. Claude Code then suggests running `/reload-plugins`; you can skip that here, because restarting in the next step picks up the plugin. 2 @@ -217,7 +217,7 @@ claude --channels plugin:fakechat@claude-plugins-official -The fakechat server starts automatically. +The fakechat server starts automatically. The startup screen shows a channels notice stating that messages from `plugin:fakechat@claude-plugins-official` inject directly in this session. If the plugin isn’t installed or isn’t on the approved allowlist, a warning line naming the problem appears below that notice. You can pass several plugins to `--channels`, space-separated. @@ -227,9 +227,9 @@ Open the fakechat UI at <http://localhost:8787> and type a message: - hey, what's in my working directory? - -The message arrives in your Claude Code session as a `<channel source="fakechat">` event. Claude reads it, does the work, and calls fakechat’s `reply` tool. The answer shows up in the chat UI. + what's in my working directory? + +The message arrives in your Claude Code session. The terminal shows it as an inbound channel line like `← fakechat · web: what's in my working directory?`, while the model receives it as a `<channel source="plugin:fakechat:fakechat">` event, using the plugin’s scoped server name. Claude reads it, does the work, and calls fakechat’s `reply` tool. The first reply triggers a permission prompt in your terminal; approve it, and the answer shows up in the chat UI. If Claude hits a permission prompt while you’re away from the terminal, the session pauses until you respond. Channel servers that declare the [permission relay capability](</docs/en/channels-reference#relay-permission-prompts>) can forward these prompts to you so you can approve or deny remotely. For unattended use, [`--dangerously-skip-permissions`](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) bypasses most prompts, but only use it in environments you trust. Explicit ask rules, 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>) still prompt. When you run channels in non-interactive mode with `-p`, tools that need terminal input, such as multiple-choice questions and plan mode approval, are disabled so the session never stalls waiting for input. @@ -301,7 +301,7 @@ Research preview -Channels are a research preview feature. Availability is rolling out gradually, and the `--channels` flag syntax and protocol contract may change based on feedback. During the preview, `--channels` only accepts plugins from an Anthropic-maintained allowlist, or from your organization’s allowlist if an admin has set `allowedChannelPlugins`. The channel plugins in [claude-plugins-official](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins>) are the default approved set. If you pass something that isn’t on the effective allowlist, Claude Code starts normally but the channel doesn’t register, and the startup notice tells you why. To test a channel you’re building, use `--dangerously-load-development-channels`. See [Test during the research preview](</docs/en/channels-reference#test-during-the-research-preview>) for information about testing custom channels that you build. Report issues or feedback on the [Claude Code GitHub repository](<https://github.com/anthropics/claude-code/issues>). +Channels are a research preview feature. Availability is rolling out gradually, and the `--channels` flag syntax and protocol contract may change based on feedback. Neither `--channels` nor `--dangerously-load-development-channels` appears in `claude --help` while the feature is in preview. The flags work even though they aren’t listed. During the preview, `--channels` only accepts plugins from an Anthropic-maintained allowlist, or from your organization’s allowlist if an admin has set `allowedChannelPlugins`. The channel plugins in [claude-plugins-official](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins>) are the default approved set. If you pass something that isn’t on the effective allowlist, Claude Code starts normally but the channel doesn’t register, and the startup notice tells you why. To test a channel you’re building, use `--dangerously-load-development-channels`. See [Test during the research preview](</docs/en/channels-reference#test-during-the-research-preview>) for information about testing custom channels that you build. Report issues or feedback on the [Claude Code GitHub repository](<https://github.com/anthropics/claude-code/issues>). ##
modified Checkpointing View current →
--- a/checkpointing.md +++ b/checkpointing.md @@ -110,6 +110,16 @@ ​ +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>). + +Before v2.1.216, `/rewind` wrote and deleted through links at tracked paths without a warning. + +### + +​ + Not a replacement for version control Checkpoints are designed for quick, session-level recovery. For permanent version history and collaboration:
modified Use Claude Code with Chrome View current →
--- a/chrome.md +++ b/chrome.md @@ -32,6 +32,8 @@ * [Claude Code](</docs/en/quickstart#step-1-install-claude-code>) * A direct Anthropic plan (Pro, Max, Team, or Enterprise) +Chrome integration also requires signing in with `/login`. If you authenticate with an API key or a long-lived token from [`claude setup-token`](</docs/en/authentication#generate-a-long-lived-token>), Claude Code keeps Chrome integration off, even when you pass `--chrome`, because the browser extension can’t authenticate with those credentials. Before v2.1.216, these sessions could enable Chrome integration, but every attempt to connect to the browser extension failed with a 403 error. + Chrome integration is not available through third-party providers like Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. If you access Claude exclusively through a third-party provider, you need a separate claude.ai account to use this feature. ## @@ -62,6 +64,20 @@ The first browser action asks for permission to use the `claude-in-chrome` skill. Approve it and Claude opens a new tab and starts the task. Run `/chrome` at any time to check the connection status, manage permissions, reconnect the extension, or choose which connected browser to use. The integration is working when the status panel shows “Status: Enabled” and “Extension: Installed”. If more than one browser is connected when a browser action starts, Claude prompts you to pick one. For VS Code, see [browser automation in VS Code](</docs/en/vs-code#automate-browser-tasks-with-chrome>). + +### + +​ + +Install the extension when Claude asks + +When Claude needs your browser for a task in an interactive session and Claude Code doesn’t detect the extension, Claude Code shows an install prompt titled “Claude wants to use your browser”, at most once per session. The prompt requires Claude Code v2.1.206 or later. On Windows, the **Install extension** choice requires v2.1.211 or later; before v2.1.211, choosing it couldn’t open the install page. The prompt offers three choices: + + * **Install extension** : opens the extension install page in your browser and starts a guided setup. Claude Code waits for the install, connects the extension, and enables browser tools in the same session. When the connection is ready, select “Continue with browser tools” and Claude resumes the task in your browser. You can leave setup at any point by selecting “Continue without browser tools” and finish later with `/chrome`. + * **Not now** : continues the task without browser tools. The prompt can appear again in a later session. + * **Don’t ask again** : stops the prompt in all future sessions. You can still set up the integration anytime with `/chrome`. + +If your organization blocks the `claude-in-chrome` MCP server with the [`deniedMcpServers` managed setting](</docs/en/managed-mcp#policy-based-control-with-allowlists-and-denylists>), Claude Code doesn’t show the install prompt. ###
modified CLI reference View current →
--- a/cli-reference.md +++ b/cli-reference.md @@ -66,7 +66,7 @@ `--bare`| Minimal mode: skip auto-discovery of hooks, skills, plugins, MCP servers, auto memory, and CLAUDE.md so scripted calls start faster. Claude has access to Bash, file read, and file edit tools. Sets [`CLAUDE_CODE_SIMPLE`](</docs/en/env-vars>). See [bare mode](</docs/en/headless#start-faster-with-bare-mode>)| `claude --bare -p "query"` `--betas`| Beta headers to include in API requests (API key users only)| `claude --betas interleaved-thinking` `--bg`, `--background`| Start the session as a [background agent](</docs/en/agent-view>) and return immediately. Prints the session ID and management commands. Combine with `--exec` to run a shell command as a background job instead of a Claude session, or with `--agent` to run a specific subagent. Cannot be combined with `-p`/`--print`; see the [error reference](</docs/en/errors#command-line-errors>)| `claude --bg "investigate the flaky test"` -`--channels`| (Research preview) MCP servers whose [channel](</docs/en/channels>) notifications Claude should listen for in this session. Space-separated list of `plugin:<name>@<marketplace>` entries. Requires Claude.ai authentication| `claude --channels plugin:my-notifier@my-marketplace` +`--channels`| (Research preview) MCP servers whose [channel](</docs/en/channels>) notifications Claude should listen for in this session. Space-separated list of `plugin:<name>@<marketplace>` entries. Requires Anthropic authentication through claude.ai or a Console API key| `claude --channels plugin:my-notifier@my-marketplace` `--chrome`| Enable [Chrome browser integration](</docs/en/chrome>) for web automation and testing| `claude --chrome` `--cloud`| Create a new [web session](</docs/en/claude-code-on-the-web>) on claude.ai with the provided task description| `claude --cloud "Fix the login bug"` `--continue`, `-c`| Load the most recent conversation in the current directory. Includes sessions that added this directory with `/add-dir`| `claude --continue` @@ -118,7 +118,7 @@ `--safe-mode`| Start with all customizations disabled to troubleshoot a broken configuration: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, custom keybindings, status line and file-suggestion commands, LSP servers, and auto-memory do not load. Authentication, model selection, built-in tools, and permissions work normally, which differs from [`--bare`](</docs/en/headless#start-faster-with-bare-mode>). Managed settings policy still applies, including policy-configured hooks, status line, and file-suggestion commands; managed plugins, managed skills, managed CLAUDE.md, and policy-configured MCP servers do not. Useful for checking whether a customization is what triggers [automatic fallback from Fable 5](</docs/en/model-config#automatic-model-fallback>). Sets [`CLAUDE_CODE_SAFE_MODE`](</docs/en/env-vars>)| `claude --safe-mode` `--session-id`| Use a specific session ID for the conversation (must be a valid UUID)| `claude --session-id "550e8400-e29b-41d4-a716-446655440000"` `--setting-sources`| Comma-separated list of setting sources to load (`user`, `project`, `local`)| `claude --setting-sources user,project` -`--settings`| Path to a settings JSON file or an inline JSON string. Values you set here override the same keys in your `settings.json` files for this session. Keys you omit keep their file-based values. See [settings precedence](</docs/en/settings#settings-precedence>)| `claude --settings ./settings.json` +`--settings`| Path to a settings JSON file or an inline JSON string. Values you set here override the same keys in your `settings.json` files for this session. Keys you omit keep their file-based values. The file must be a regular file no larger than 2 MiB. See [settings precedence](</docs/en/settings#settings-precedence>)| `claude --settings ./settings.json` `--strict-mcp-config`| Only use MCP servers from `--mcp-config`, ignoring all other MCP configurations| `claude --strict-mcp-config --mcp-config ./mcp.json` `--system-prompt`| Replace the entire system prompt with custom text| `claude --system-prompt "You are a Python expert"` `--system-prompt-file`| Load system prompt from a file, replacing the default prompt| `claude --system-prompt-file ./custom-prompt.txt`
modified Commands View current →
--- a/commands.md +++ b/commands.md @@ -17,6 +17,7 @@ The table below lists all the commands included in Claude Code. Most are built-in commands whose behavior is coded into the CLI. Two kinds of entries are marked: * **[Skill](</docs/en/skills#bundled-skills>)** : a bundled skill. It works like skills you write yourself: a prompt handed to Claude, which Claude can also invoke automatically when relevant. + * `/verify` and `/code-review` run only when you invoke them. Before v2.1.215, Claude could also run them on its own. * **[Workflow](</docs/en/workflows#bundled-workflows>)** : a bundled [dynamic workflow](</docs/en/workflows>) that fans work out across many subagents and runs in the background. To add your own commands, see [skills](</docs/en/skills>). In the table below, `<arg>` indicates a required argument and `[arg]` indicates an optional one. @@ -38,11 +39,11 @@ `/chrome`| Configure [Claude in Chrome](</docs/en/chrome>) settings `/claude-api [migrate|managed-agents-onboard]`| **[Skill](</docs/en/skills#bundled-skills>).** Load Claude API reference material for your project’s language (Python, TypeScript, Java, Go, Ruby, C#, PHP, or cURL) and Managed Agents reference. Covers tool use, streaming, batches, structured outputs, and common pitfalls. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk`. Run `/claude-api migrate` to upgrade existing Claude API code to a newer model: Claude asks which files to scan and which model to target, then updates model IDs, thinking configuration, and other parameters that changed between versions. Run `/claude-api managed-agents-onboard` for an interactive walkthrough that creates a new Managed Agent from scratch `/clear [name]`| Start a new conversation with empty context. Pass a name to label the previous conversation in the `/resume` picker. To free up context while continuing the same conversation, use `/compact` instead. Resume the previous conversation with `/resume`, or, in the same Claude Code process, restore it from [the rewind menu’s previous-session entry](</docs/en/checkpointing#rewind-past-a-cleared-conversation>). Aliases: `/reset`, `/new` -`/code-review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [target]`| **[Skill](</docs/en/skills#bundled-skills>).** Review the current diff for correctness bugs and for reuse, simplification, and efficiency cleanups. Pass `--fix` to apply findings to your working tree, `--comment` to post them as inline GitHub PR comments, or `ultra` to run a deep [cloud review](</docs/en/ultrareview>). From v2.1.154, `/simplify` runs a separate cleanup-only review that applies fixes without hunting for bugs. See [Review a diff locally](</docs/en/code-review#review-a-diff-locally>) for effort levels and targeting +`/code-review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [target]`| **[Skill](</docs/en/skills#bundled-skills>).** Review the current diff for correctness bugs and cleanup opportunities. Pass `--fix` to apply findings, `--comment` to post them as inline GitHub PR comments, or `ultra` to run a deep [cloud review](</docs/en/ultrareview>). See [Review a diff locally](</docs/en/code-review#review-a-diff-locally>) for effort levels, targeting, and how it relates to `/simplify` `/color [color|default]`| Set the prompt bar color for the current session. Available colors: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan`. Use `default` to reset, or run with no argument to pick a random color. When [Remote Control](</docs/en/remote-control>) is connected, the color syncs to claude.ai/code. Also available in non-interactive mode (`-p`); requires Claude Code v2.1.205 or later `/compact [instructions]`| Free up context by summarizing the conversation so far. Optionally pass focus instructions for the summary. See [how compaction handles rules, skills, and memory files](</docs/en/context-window#what-survives-compaction>) `/config [key=value ...]`| Open the [Settings](</docs/en/settings>) interface to adjust theme, model, [output style](</docs/en/output-styles>), and other preferences. From v2.1.181, pass one or more `key=value` pairs to set a setting directly without opening the interface, for example `/config thinking=false`. From v2.1.182, named shorthand keys are also accepted, such as `/config theme=dark` or `/config model=sonnet`. The `key=value` form also works in non-interactive mode (`-p`) and from the Claude mobile app via [Remote Control](</docs/en/remote-control>). Run `/config --help` to list every settable key with its options. Alias: `/settings` -`/context [all]`| Visualize current context usage as a colored grid. Shows optimization suggestions for context-heavy tools, memory bloat, and capacity warnings. In [fullscreen mode](</docs/en/fullscreen>) the per-item breakdown is collapsed to keep the grid visible. Pass `all` to expand it +`/context [all]`| Visualize current context usage as a colored grid. Shows optimization suggestions for context-heavy tools, memory bloat, and capacity warnings. When the conversation exceeds the context window, the output includes a [warning](</docs/en/errors#context-exceeds-the-token-limit>) showing how far over the limit you are and which command frees space; this warning requires Claude Code v2.1.216 or later. In [fullscreen mode](</docs/en/fullscreen>), `/context` collapses the per-item breakdown to keep the grid visible. Pass `all` to expand it `/copy [N]`| Copy the last assistant response to clipboard. Pass a number `N` to copy the Nth-latest response: `/copy 2` copies the second-to-last. When code blocks are present, shows an interactive picker to select individual blocks or the full response. Press `w` in the picker to write the selection to a file instead of the clipboard, which is useful over SSH `/cost`| Alias for `/usage` `/dataviz [request]`| **[Skill](</docs/en/skills#bundled-skills>).** Design guidance for charts, graphs, and dashboards. Claude picks the chart form for the data, assigns color by role, validates the palette for colorblind safety and contrast with a bundled script, and applies mark, interaction, and accessibility rules. Uses a brand-neutral placeholder palette that you replace with your own. Requires Claude Code v2.1.198 or later @@ -122,7 +123,7 @@ `/ultrareview [PR or branch]`| Run a deep, multi-agent code review in a cloud sandbox with [ultrareview](</docs/en/ultrareview>). Pass a PR reference to review that pull request, or a branch name to change the comparison base. The preferred invocation is now `/code-review ultra`, and `/ultrareview` remains as an alias. Includes 3 free runs on Pro and Max, then requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) `/upgrade`| Open the upgrade page in your browser to switch to a higher plan tier. When the browser fails to open, the command shows a sign-in prompt without printing the URL `/usage`| Show session cost, plan usage limits, and activity stats. On a Pro, Max, Team, or Enterprise plan, includes a breakdown of usage by skill, subagent, plugin, and MCP server. See the [cost tracking guide](</docs/en/costs#using-the-%2Fusage-command>) for details. `/cost` and `/stats` are aliases -`/usage-credits`| Configure usage credits, or request them from your admin, when you hit a limit. On Pro and Max plans, opens an [in-CLI dialog](</docs/en/costs#set-a-spend-limit-on-pro-and-max>) to buy usage credits, set a monthly spend limit, and configure auto-reload; on Claude Code versions before v2.1.207 and on other plans, opens the usage-credits billing page in your browser, except that Team and Enterprise members without billing access instead send a usage-credits request to their admin from the CLI, after confirming in a dialog that the request notifies their admins. Before v2.1.211, Claude Code sent the request without a confirmation step. When no browser can open the billing page, for example over SSH, the command prints the URL to visit instead; this requires Claude Code v2.1.205 or later, and earlier versions showed nothing in that case. Previously `/extra-usage` +`/usage-credits`| Configure usage credits, or request them from your admin, when you hit a limit. Opens your [usage-credits billing settings](</docs/en/costs#add-usage-credits-to-your-subscription>) in the browser, except that Team and Enterprise members without billing access instead send a usage-credits request to their admin from the CLI, after confirming in a dialog that the request notifies their admins. Before v2.1.211, Claude Code sent the request without a confirmation step. When no browser can open the billing page, for example over SSH, the command prints the URL to visit instead; this requires Claude Code v2.1.205 or later, and earlier versions showed nothing in that case. Previously `/extra-usage` `/verify`| **[Skill](</docs/en/skills#bundled-skills>).** Confirm a code change does what it should by building your project’s app, running it, and observing the result, rather than relying on tests or type checks. See [Run and verify your app](</docs/en/skills#run-and-verify-your-app>). Requires Claude Code v2.1.145 or later `/vim`| Removed in v2.1.92. To toggle between Vim and Normal editing modes, use `/config` → Editor mode `/voice [hold|tap|off]`| Toggle [voice dictation](</docs/en/voice-dictation>), or enable it in a specific mode. Requires a Claude.ai account
modified Let Claude use your computer from the CLI View current →
--- a/computer-use.md +++ b/computer-use.md @@ -28,7 +28,7 @@ * If the task is browser work and you have [Claude in Chrome](</docs/en/chrome>) set up, Claude uses that. * If none of those apply, Claude uses computer use. -Screen control is reserved for things nothing else can reach: native apps, simulators, and tools without an API. +Screen control is reserved for things nothing else can reach: native apps, simulators, and tools without an API. In the Desktop app, running or testing an iOS app opens the dedicated [iOS Simulator pane](</docs/en/desktop-ios-simulator>) rather than screen control; from the CLI, computer use is how Claude reaches the iOS Simulator. ## @@ -195,7 +195,7 @@ Open the iOS Simulator, launch the app, tap through the onboarding screens, and tell me if any screen takes more than a second to load. -Claude controls the simulator the same way you would with a mouse. +Claude controls the simulator the same way you would with a mouse. This flow applies to the CLI; in the Desktop app, the same request opens the [iOS Simulator pane](</docs/en/desktop-ios-simulator>) instead of screen control. ##
modified Manage costs effectively View current →
--- a/costs.md +++ b/costs.md @@ -29,16 +29,17 @@ ​ -Set a spend limit on Pro and Max - -On Pro and Max plans, the `/usage-credits` command opens a dialog in the CLI where you manage [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>). The command requires signing in with your claude.ai subscription through `/login` and isn’t available with API key authentication. From the dialog you can: - - * Turn on usage credits for your account - * Buy more usage credits, either a listed bundle or a custom amount - * Set, change, or remove your monthly spend limit - * Configure auto-reload, which buys more usage credits automatically when your balance falls below a threshold you set - -On Claude Code versions before v2.1.207 and on accounts where the in-CLI dialog isn’t available, `/usage-credits` opens the usage-credits billing page in your browser instead. On Team and Enterprise plans, members with billing access get the same browser page, and members without billing access request usage credits from their admin through the CLI. Because that request notifies your organization’s admins, the CLI asks for confirmation before sending it. Select **Send request** to ask your admin to turn on usage credits or raise the limit, or cancel to send nothing; canceling reports `No request sent to your admin.` The confirmation appears only in interactive sessions, so in non-interactive mode with the `-p` flag and from [Remote Control](</docs/en/remote-control>), `/usage-credits` doesn’t send a request and instead tells you to run the command in an interactive session. Before v2.1.211, Claude Code sent the request as soon as you ran the command, without a confirmation step. Changing the monthly spend limit requires billing access on the account. If you reach the limit while you still have usage credits available, Claude Code prompts you to raise or remove it so you can continue without leaving the CLI. Amounts you type into the dialog, such as a custom purchase amount, the monthly spend limit, or the auto-reload threshold and target, must be digits, optionally followed by a period and one or two decimal digits, for example `20` or `20.50`. Any other input, including commas, shows an inline error and isn’t saved. Versions before v2.1.207 don’t show the dialog and open the billing page instead. Claude Code asks you to type `yes` to confirm every purchase and every auto-reload change, whatever the amount, and the purchase confirmation shows the post-tax total you are approving. Changing the monthly spend limit asks for the same typed confirmation only above $1,000, or above 1,000 units of a non-US-dollar billing currency. Before v2.1.208, purchases and auto-reload changes used that threshold too, so smaller amounts went through the standard dialog flow without the extra typed `yes` step. Amount fields open prefilled with a suggested value, and the first digit you type replaces the suggestion instead of appending to it. The screen that turns on usage credits opens with Cancel selected, so turning them on takes a deliberate selection rather than a stray Enter. Both require Claude Code v2.1.208 or later. +Add usage credits to your subscription + +[Usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) let you keep working past your plan’s usage limit. To manage them, run `/usage-credits` after signing in with your claude.ai subscription through `/login`; the command isn’t available with API key authentication. What it opens depends on your role: + +Your role| What `/usage-credits` does +---|--- +Pro or Max subscriber| Opens your billing settings in the browser +Team or Enterprise member with billing access| Opens your organization’s usage settings in the browser +Team or Enterprise member without billing access| Asks you to confirm, then sends a request to your organization’s admins. Before v2.1.211, Claude Code sent the request without a confirmation step + +For Team and Enterprise members without billing access, the confirmation appears only in interactive sessions: in non-interactive mode with the `-p` flag and from [Remote Control](</docs/en/remote-control>), the command sends no request and tells you to run it in an interactive session instead. On Pro and Max plans, when you reach your spend limit with usage credits still available, Claude Code prompts you to raise or remove the limit without leaving the CLI. If the server rejects the change, see [Could not update your spend limit](</docs/en/errors#could-not-update-your-spend-limit>). ##
modified Desktop application View current →
--- a/desktop.md +++ b/desktop.md @@ -16,6 +16,7 @@ * 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 + * Watch Claude [run and test your iOS app](</docs/en/desktop-ios-simulator>) in the iOS Simulator pane * Arrange panes for the chat, diff, browser, terminal, and file editor side by side * Ask a side question that uses the session’s context without derailing it * Connect external tools like GitHub, Slack, and Linear @@ -181,7 +182,7 @@ Arrange your workspace -The Code tab is built around panes you can arrange in any layout: chat, diff, browser, terminal, file, plan, tasks, and subagent. Drag a pane by its header to reposition it, or drag a pane edge to resize it. Press **Cmd+\** on macOS or **Ctrl+\** on Windows to close the focused pane. Open additional panes from the **Views** menu in the session toolbar. +The Code tab is built around panes you can arrange in any layout: chat, diff, browser, terminal, file, plan, tasks, and subagent, along with the [iOS Simulator](</docs/en/desktop-ios-simulator>) on macOS. Drag a pane by its header to reposition it, or drag a pane edge to resize it. Press **Cmd+\** on macOS or **Ctrl+\** on Windows to close the focused pane. Open additional panes from the **Views** menu in the session toolbar. The pane layout, terminal, file editor, and view modes in this section require Claude Desktop v1.2581.0 or later. Open **Claude → Check for Updates** on macOS or **Help → Check for Updates** on Windows to update. @@ -274,7 +275,7 @@ Let Claude use your computer -Computer use lets Claude open your apps, control your screen, and work directly on your machine the way you would. Ask Claude to test a native app in a mobile simulator, interact with a desktop tool that has no CLI, or automate something that only works through a GUI. +Computer use lets Claude open your apps, control your screen, and work directly on your machine the way you would. Ask Claude to interact with a desktop tool that has no CLI, or automate something that only works through a GUI. For running and testing iOS apps, Desktop opens the dedicated [iOS Simulator pane](</docs/en/desktop-ios-simulator>) instead of controlling your screen; the pane works without enabling computer use. Computer use is a research preview on macOS and Windows that requires a Pro or Max plan. It is not available on Team or Enterprise plans. The Claude Desktop app must be running. @@ -293,9 +294,10 @@ * If you have a connector for a service, Claude uses the connector. * If the task is a shell command, Claude uses Bash. * If the task is browser work and you have [Claude in Chrome](</docs/en/chrome>) set up, Claude uses that. + * If the task is running or testing an iOS app, Claude uses the [iOS Simulator pane](</docs/en/desktop-ios-simulator>), which doesn’t use screen control. * If none of those apply, Claude uses computer use. -The per-app access tiers reinforce this: browsers are capped at view-only, and terminals and IDEs at click-only, steering Claude toward the dedicated tool even when computer use is active. Screen control is reserved for things nothing else can reach, like native apps, hardware control panels, mobile simulators, or proprietary tools without an API. +The per-app access tiers reinforce this: browsers are capped at view-only, and terminals and IDEs at click-only, steering Claude toward the dedicated tool even when computer use is active. Screen control is reserved for things nothing else can reach, like native apps, hardware control panels, or proprietary tools without an API. ### @@ -499,10 +501,42 @@ `autoPort`| boolean| How to handle port conflicts. See below `program`| string| A script to run with `node`. See when to use `program` vs `runtimeExecutable` `args`| string[]| Arguments passed to `program`. Only used when `program` is set +`url`| string| The address the preview opens instead of `http://localhost:<port>`. See open the preview at a specific URL ##### When to use `program` vs `runtimeExecutable` Use `runtimeExecutable` with `runtimeArgs` to start a dev server through a package manager. For example, `"runtimeExecutable": "npm"` with `"runtimeArgs": ["run", "dev"]` runs `npm run dev`. Use `program` when you have a standalone script you want to run with `node` directly. For example, `"program": "server.js"` runs `node server.js`. Pass additional flags with `args`. + +##### Open the preview at a specific URL + +By default, the preview opens `http://localhost:<port>`. Set `url` when your server needs a different address. Common cases are servers that require local HTTPS, apps that use `*.localhost` subdomains, and apps that sign you in through a redirect. + + { + "version": "0.0.1", + "configurations": [ + { + "name": "my-app", + "runtimeExecutable": "npm", + "runtimeArgs": ["run", "dev"], + "port": 8443, + "url": "https://localhost:8443" + } + ] + } + +Localhost addresses open directly, exactly like the default port address. This includes `localhost`, any `*.localhost` subdomain, `127.0.0.1`, and `::1`. For security, a localhost `url` must be just your server’s origin — no path or query, and the port must match the entry’s port. To show a specific page, ask Claude to navigate there after the preview opens. A localhost `url` with a path, query, or mismatched port is reported as a configuration error that names the url and shows the fix. Any other address asks for your permission the first time it opens, the same way browsing to a new site in the preview does. External addresses may include paths. Choose **Always allow** to skip the prompt for that site in the future. Organization policies that restrict external sites in the preview still apply. To preview a server you already run yourself, set `url` without a command. Claude attaches the preview to your running server instead of starting one: + + { + "version": "0.0.1", + "configurations": [ + { + "name": "my-app", + "url": "https://app.localhost:3000" + } + ] + } + +The `url` must be `http` or `https`, and must not contain a username or password. #### @@ -701,6 +735,7 @@ `disableAutoMode`| set to `"disable"` to prevent users from enabling [Auto](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) mode. Removes Auto from the mode selector. Also accepted under `permissions`. `autoMode`| customize what the auto mode classifier trusts and blocks across your organization. See [Configure auto mode](</docs/en/auto-mode-config>). `browserExternalPageTools`| set to `"disabled"` to prevent Claude from using tools to read or act on external pages in the Browser pane. Users can still navigate to external sites themselves, and local dev server previews are unaffected. +`disableMobileSimulatorTools`| set to `true` to block Claude’s tools for controlling and capturing devices in the [iOS Simulator pane](</docs/en/desktop-ios-simulator#turn-off-simulator-access>). The pane stays usable for the user’s own taps; only Claude’s access is removed. `disableBrowserExternalNavigation`| set to `true` to turn off external browsing in the Browser pane entirely. Neither users nor Claude can navigate to external sites, and localhost dev server previews are unaffected. The value must be the JSON boolean `true`; the string `"true"` is ignored. `sshConfigs`| pre-configure SSH connections that appear in the environment dropdown. Users cannot edit or delete managed connections. `sshHostAllowlist`| restrict SSH sessions to hosts whose resolved hostname matches one of these patterns. An empty array disables SSH sessions. Read from managed settings only. @@ -861,6 +896,7 @@ 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 +iOS simulator| Drive the simulator via [computer use](</docs/en/computer-use#test-a-simulator-flow>)| [iOS Simulator pane](</docs/en/desktop-ios-simulator>) opens automatically Dispatch integration| Not available| Dispatch sessions in the sidebar Scripting and automation| [`--print`](</docs/en/cli-reference>), [Agent SDK](</docs/en/headless>)| Not available
added Test iOS apps in the simulator View current →
Show diff (163 lines)
--- a/desktop-ios-simulator.md +++ b/desktop-ios-simulator.md @@ -0,0 +1,160 @@ +The iOS Simulator pane is in public beta in Claude Code Desktop on macOS. It’s available on Pro, Max, and Team plans, and not available on the Enterprise plan. + +The iOS Simulator pane shows your app running in Apple’s iOS Simulator next to your conversation in Claude Code Desktop. When Claude builds, installs, launches, or checks your app in a simulator, the pane opens automatically and streams the device screen live. Use it to watch Claude run and test your app, or to tap through the app yourself while Claude keeps working. The simulator pane drives the simulator directly, so it doesn’t need [computer use](</docs/en/desktop#let-claude-use-your-computer>) and never takes over your screen or hides your other windows. From the CLI, Claude reaches the iOS Simulator through [computer use](</docs/en/computer-use#test-a-simulator-flow>) instead, which controls the simulator on your screen the same way you would with a mouse. + +## + +​ + +Requirements + +The simulator pane uses Apple’s simulator tooling, which the desktop app doesn’t include. Before starting a session, make sure you have: + + * Claude Desktop v1.24012.0 or later + * A Mac, since Apple’s iOS Simulator runs only on macOS + * [Xcode](<https://developer.apple.com/xcode/>) with the iOS platform installed, which provides the simulator devices. If Xcode lists no simulators yet, see The simulator pane says no simulators were found + +On this page, “device” refers to a simulated iPhone or iPad, one of the same simulator devices you manage in Xcode under **Window → Devices and Simulators** , not physical hardware. + +The simulator pane is available in local sessions only. In [cloud](</docs/en/desktop#run-long-running-tasks-remotely>) and [SSH](</docs/en/desktop#ssh-sessions>) sessions, Claude runs on a machine that can’t reach the simulators on your Mac. + +## + +​ + +Run your app in the simulator + +You don’t need a command or setting to open the simulator pane. Claude opens it when it runs your app in a simulator. + +1 + +Open your iOS project + +In Claude Code Desktop, open the **Code** tab and start a session with your app’s project as the [project folder](</docs/en/desktop#start-a-session>). Any project that builds an app for the iOS Simulator works. + +2 + +Ask Claude to run or test the app + +Phrase the task around running or verifying the app. For example: + + Build the app and run it in the simulator to check the onboarding flow. + +3 + +Watch the app in the simulator pane + +When the app launches in a simulator, the iOS Simulator pane opens next to the conversation. The first time Claude uses a device, the desktop app asks you to allow it; see Grant Claude access to a device. Claude installs the app, taps through it, and reads the screen to verify its own changes while you watch. + +The simulator pane opens whenever Claude launches the app in a simulator, at any point in the session. When your request is about seeing the app, for example “does the new screen look right?”, Claude starts a simulator before it begins the work. After Claude fixes a bug or changes a screen, ask it to verify the change: relaunching the app reopens the pane if it isn’t open. The simulator pane shows whichever device the app actually launched in. To test on a specific device, name it in your request, for example “run it on the iPhone SE simulator”, and Claude targets that device when it builds and launches. A device Claude boots also appears in Apple’s Simulator app, and Claude can install the app on a device you already have booted. You can also open the simulator pane yourself. Once the session has a simulator attached or has edited Swift files, the **Views** menu in the session toolbar shows an **iOS Simulator** entry. If the pane isn’t showing a device yet, click **Attach simulator** , or pick a specific device from the device menu next to it; picking a shut-down device boots it. If Xcode or its simulators are missing, the pane shows the setup steps instead and checks them off as you complete them. + +## + +​ + +Control the simulator yourself + +The simulator pane is interactive, not only a viewer. While Claude works, or between tasks, you can: + + * Tap and swipe by clicking and dragging on the device screen + * Press hardware buttons with the same shortcuts as Apple’s Simulator app: **Cmd+Shift+H** for Home, **Cmd+L** to lock, **Cmd+Up Arrow** and **Cmd+Down Arrow** for volume + * Rotate the device a quarter turn clockwise with the rotate button or **Cmd+Right Arrow** + * Switch which device the pane shows from the device menu, which lists each simulator’s OS version and whether it’s booted + * Save a screenshot with **Cmd+S** or a screen recording with **Cmd+R** , using the pane’s capture buttons or the shortcuts; the files are saved to your Desktop + * Stop streaming a device without shutting it down by clicking **Detach simulator** , which returns the pane to its **Attach simulator** state + +The row under the device name tunes the video stream from the simulator. Lower **Frame rate** or **Resolution** if the pane strains your Mac, switch **Encoding** between H.264 and JPEG, or check **FPS** to display the frame rate the pane is receiving. These settings change how the pane displays the device, not how the app runs. You and Claude drive the same device, so your taps change the app state Claude sees. To have Claude check a specific screen, navigate to it by tapping, then ask. While Claude is driving the device, the pane shows a **Claude is using this device** badge above the screen; hold off tapping until the badge clears, so the result reflects the app rather than your input. + +## + +​ + +How sessions manage devices + +Each device belongs to the session that launched it, so [parallel sessions](</docs/en/desktop#work-in-parallel-with-sessions>) don’t share a device: what you see in one session’s pane reflects that session’s work, not another’s. Switching sessions in the sidebar switches the simulator view along with the conversation, and switching back resumes the same device where it left off. If Claude works with more than one device, each opens its own pane, up to 4 per session. Claude Code Desktop shuts down the simulators it booted once they’re no longer in use: when you quit the app, when you archive the session, or 10 minutes after you detach a device from its pane. Devices you boot yourself, whether from the pane or in Apple’s Simulator app, are never shut down automatically. To shut down the attached device right away, use the shutdown button in the pane. + +## + +​ + +Grant Claude access to a device + +Claude asks for your consent before it controls a device, while building the app or opening a URL on it follows your session’s permission mode. You or your organization can also turn Claude’s access off entirely. + +### + +​ + +Allow a device the first time + +The first time Claude uses a simulator, the desktop app asks you to allow it. The consent covers controlling that device and taking screenshots of it, and you give it once per device rather than once per session. Claude’s screenshots of the device are sent to Anthropic and kept under your normal conversation retention settings, so don’t sign in to real accounts on a device Claude uses. After you allow a device, Claude’s actions on it, such as tapping, typing, launching the app, and taking screenshots, run without further prompts. They carry the same trust as you clicking in the pane, and they only touch the simulated device, so the pane doesn’t need the macOS Accessibility and Screen Recording permissions that computer use requires. If you decline, the device still boots and the pane still works for your own taps; only Claude’s access stays off. To change your mind later, click **Let Claude use it** in the pane. + +### + +​ + +Actions that follow your permission mode + +Two actions follow your session’s [permission mode](</docs/en/permissions#permission-modes>) instead of the one-time consent: + + * Opening a URL on the device, for example to test a deep link or load a page in the device’s Safari, because a URL can carry data off the device. + * Building the app, because `xcodebuild` runs your project’s build scripts on your Mac. Checking on a build already in progress doesn’t prompt. + +### + +​ + +Turn off simulator access + +You can turn Claude’s simulator access off in the desktop app’s settings. Organizations have two ways to turn it off for everyone: + + * The `disableMobileSimulatorTools` [managed setting](</docs/en/desktop#managed-settings>) blocks Claude’s simulator tools. The simulator pane stays usable for your own taps, and the setting can’t be overridden from within the app. + * A policy that requires sessions to run inside an isolated virtual machine disables the pane and the tools entirely. + +Claude tells you when either applies. + +## + +​ + +Limitations + +Claude drives simulated devices only and can’t control a physical iPhone or iPad. To test on one, run the app on it from Xcode yourself, then describe what you see or attach a screenshot to the conversation for Claude to work from. + +## + +​ + +Troubleshooting + +### + +​ + +The simulator pane doesn’t open when Claude runs the app + +Claude may not have recognized that you wanted to run or test the app, or the simulator tooling may be missing. Check the following: + + * State the goal explicitly, for example “run the app in the iOS Simulator and tap through the signup flow”. + * Confirm Xcode and the iOS Simulator are installed by launching the Simulator app on its own. + * If your organization manages Claude Code, the simulator tools may be disabled by policy. + * The simulator pane requires Claude Desktop v1.24012.0 or later. Open **Claude → Check for Updates** , then restart the app. + +### + +​ + +The simulator pane says no simulators were found + +Xcode is installed but has no iOS simulators to list. The simulator pane shows the setup steps to follow and checks them off as each one completes. To install the missing piece manually, download the iOS simulator runtime from Xcode’s settings, or run `xcodebuild -downloadPlatform iOS`. + +## + +​ + +See also + + * [Computer use in Desktop](</docs/en/desktop#let-claude-use-your-computer>): screen control for apps without a dedicated pane + * [Computer use from the CLI](</docs/en/computer-use>): how the CLI reaches the iOS Simulator + * [Work in parallel with sessions](</docs/en/desktop#work-in-parallel-with-sessions>): how sessions isolate changes + * [Get started with Claude Code Desktop](</docs/en/desktop-quickstart>)
modified Discover and install prebuilt plugins through marketplaces View current →
--- a/discover-plugins.md +++ b/discover-plugins.md @@ -187,7 +187,7 @@ * **Project scope** : install for all collaborators on this repository * **Local scope** : install for yourself in this repository only -For example, select **commit-commands** , a plugin that adds git workflow skills, and install it to your user scope.You can also install directly from the command line: +For example, select **commit-commands** , a plugin that adds git workflow skills, and install it to your user scope.You can also start the install from the command line: /plugin install commit-commands@claude-code-plugins @@ -286,11 +286,11 @@ The command opens that plugin’s details, where you choose an [installation scope](</docs/en/settings#configuration-scopes>). You see the same choices when you run `/plugin`, go to the **Discover** tab, and press **Enter** on a plugin: - * **User scope** (default): install for yourself across all projects + * **User scope** : install for yourself across all projects * **Project scope** : install for all collaborators on this repository, which adds the plugin to `.claude/settings.json` * **Local scope** : install for yourself in this repository only, not shared with collaborators -To install without an interactive step, use the [`claude plugin install`](</docs/en/plugins-reference#plugin-install>) shell command, which installs to user scope unless you pass `--scope`. You may also see plugins with **managed** scope. These are installed by administrators via [managed settings](</docs/en/settings#settings-files>) and can’t be modified. +To install without an interactive step, use the [`claude plugin install`](</docs/en/plugins-reference#plugin-install>) shell command, which installs to user scope unless you pass `--scope`. You may also see plugins with **managed** scope. These are installed by administrators via [managed settings](</docs/en/settings#settings-files>) and can’t be modified. After installing, run `/reload-plugins` to activate the plugin in your current session. Make sure you trust a plugin before installing it. Anthropic doesn’t control what MCP servers, files, or other software are included in plugins and can’t verify that they work as intended. Check each plugin’s homepage for more information.
modified Error reference View current →
--- a/errors.md +++ b/errors.md @@ -26,7 +26,7 @@ `Server is temporarily limiting requests`| Usage limits `Request rejected (429)`| Usage limits `Credit balance is too low`| Usage limits -`Failed to update spend limit` / `Failed to update auto-reload` / `Could not update your spend limit`| Usage limits +`Could not update your spend limit`| Usage limits `Not logged in · Please run /login`| Authentication `Could not resolve authentication method`| Authentication `Invalid API key`| Authentication @@ -356,17 +356,15 @@ ​ -Failed to update spend limit or auto-reload - -The server rejected a spend limit or auto-reload change you made from the [`/usage-credits` dialog](</docs/en/costs#set-a-spend-limit-on-pro-and-max>) or from the prompt that appears when you reach your spend limit. - - Failed to update spend limit: <reason from the server> - Failed to update auto-reload: <reason from the server> +Could not update your spend limit + +The server rejected a spend limit change you made from the prompt that appears when you reach your spend limit. + Could not update your spend limit: <reason from the server> -When the server explains the rejection, for example a ceiling on auto-reload amounts, the message ends with that reason, and retrying the same value fails again. When the failure has no server-provided reason, such as a dropped connection, the message is the generic form without the trailing reason, and the spend limit prompt adds `Press Enter to retry`. Before v2.1.216, Claude Code showed the generic form for every failure. **What to do:** - - * If the message includes a reason, enter a value that satisfies it, such as a lower amount +When the server explains the rejection, the message ends with that reason, and retrying the same value fails again. When the failure has no server-provided reason, such as a dropped connection, the message reads `Could not update your spend limit. Press Enter to retry.` and retrying can succeed. Before v2.1.216, Claude Code showed the generic form for every failure. **What to do:** + + * If the message includes a reason, choose a limit that satisfies it, such as a lower amount * If the message shows only the generic form, retry; the failure may be transient * If the change keeps failing, make it from your [claude.ai billing settings](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) in the browser instead @@ -1466,8 +1464,9 @@ **What to do:** - * Run Claude Code with `--debug` and repeat the restore. The debug log names each skipped path. - * If a skipped file is a link you created on purpose, such as a config file managed by a dotfile manager or a file hard-linked by tools like pnpm, restore its contents from [version control](</docs/en/checkpointing#not-a-replacement-for-version-control>) instead + * Identify which files were skipped so you can handle each one with the steps below. The message gives only a count, so list your project’s links to find them: `find . -type l` for symlinks and `find . -type f -links +1` for hard-linked files. + * If debug logging is on, the log at `~/.claude/debug/<session-id>.txt` names each skipped path as the restore runs. Turn it on with `/debug` before your next restore to skip the search. + * If a skipped file is a link you created on purpose, such as a config file managed by a dotfile manager or a file hard-linked by tools like pnpm, the rewind left its contents alone. To undo the session’s changes to it, ask Claude to reverse the edit or edit the file yourself * If you didn’t create the link, inspect the path before trusting its contents: something replaced the file after the checkpoint ##
modified Run Claude Code programmatically View current →
--- a/headless.md +++ b/headless.md @@ -135,7 +135,7 @@ claude -p "Explain recursion" --output-format stream-json --verbose --include-partial-messages -The last line of the stream is a `result` message with the final response text, cost, and session metadata. Before v2.1.208, piping a large response could truncate the final line and omit the `result` message. Messages from [subagents](</docs/en/sub-agents>) appear in the stream as `assistant` and `user` messages whose `parent_tool_use_id` field is the ID of the tool call that spawned the subagent. Messages from the main conversation carry `null` in that field. By default, Claude Code emits only subagent `tool_use` and `tool_result` blocks. Pass [`--forward-subagent-text`](</docs/en/cli-reference#cli-flags>) or set [`CLAUDE_CODE_FORWARD_SUBAGENT_TEXT`](</docs/en/env-vars>) to also emit subagent text and thinking blocks, so you can reconstruct each subagent’s transcript. This requires Claude Code v2.1.211 or later. The following example uses [jq](<https://jqlang.org/>) to filter for text deltas and display just the streaming text. The `-r` flag outputs raw strings (no quotes) and `-j` joins without newlines so tokens stream continuously: +The last line of the stream is a `result` message with the final response text, cost, and session metadata. If your consumer reads the stream slowly, Claude Code waits for the queued output to drain before exiting, scaling the wait with how much is still queued, capped at 30 seconds. Before v2.1.214 the exit wait was capped at about two seconds, which could cut off the end of a large response, and before v2.1.208 piping a large response could truncate the final line and omit the `result` message. Messages from [subagents](</docs/en/sub-agents>) appear in the stream as `assistant` and `user` messages whose `parent_tool_use_id` field is the ID of the tool call that spawned the subagent. Messages from the main conversation carry `null` in that field. By default, Claude Code emits only subagent `tool_use` and `tool_result` blocks. Pass [`--forward-subagent-text`](</docs/en/cli-reference#cli-flags>) or set [`CLAUDE_CODE_FORWARD_SUBAGENT_TEXT`](</docs/en/env-vars>) to also emit subagent text and thinking blocks, so you can reconstruct each subagent’s transcript. This requires Claude Code v2.1.211 or later. The following example uses [jq](<https://jqlang.org/>) to filter for text deltas and display just the streaming text. The `-r` flag outputs raw strings (no quotes) and `-j` joins without newlines so tokens stream continuously: claude -p "Write a poem" --output-format stream-json --verbose --include-partial-messages | \ jq -rj 'select(.type == "stream_event" and .event.delta.type? == "text_delta") | .event.delta.text'
modified Hooks reference View current →
--- a/hooks.md +++ b/hooks.md @@ -2877,10 +2877,11 @@ What happens on `ok: false` depends on the event: * `Stop` and `SubagentStop`: the reason is fed back to Claude as its next instruction and the turn continues - * `PreToolUse`: the tool call is denied and the reason is returned to Claude as the tool error, equivalent to a command hook’s `permissionDecision: "deny"` + * `PreToolUse`: the tool call is denied; by default the turn ends and the deny reason appears in the chat as a warning line. Set `continueOnBlock: true` to instead return the reason to Claude as the tool error so it can adjust and continue, equivalent to a command hook’s `permissionDecision: "deny"`. Before v2.1.210, the deny reason was returned to Claude as the tool error and the turn continued * `PostToolUse`: by default the turn ends and the reason appears in the chat as a warning line. Set `continueOnBlock: true` to feed the reason back to Claude and continue the turn instead * `PostToolBatch`, `UserPromptSubmit`, and `UserPromptExpansion`: the turn ends and the reason appears as a warning line. These events end the turn on `decision: "block"` regardless of `continue` - * `PostToolUseFailure`, `TaskCreated`, and `TaskCompleted`: the reason is returned to Claude as a tool error, similar to `PreToolUse` + * `PostToolUseFailure` and `TaskCreated`: the reason is returned to Claude as a tool error and the turn continues, regardless of `continueOnBlock` + * `TaskCompleted`: when it fires because a task is marked completed during a turn, the reason is returned to Claude as a tool error and the turn continues, regardless of `continueOnBlock`. When it fires because a teammate stops, it behaves like `TeammateIdle` and halts the teammate by default * `TeammateIdle`: by default the teammate stops and the reason appears as a warning line. Set `continueOnBlock: true` to feed the reason back to the teammate and keep it working instead * `PermissionRequest`: `ok: false` has no effect. To deny an approval from a hook, use a command hook returning `hookSpecificOutput.decision.behavior: "deny"` * `PermissionDenied`: `ok: false` has no effect because the denial already happened. The only output this event reads is `hookSpecificOutput.retry`, which prompt and agent hooks can’t set. They run on this event, but their output is discarded. Use a command hook to return `retry`
modified Automate actions with hooks View current →
--- a/hooks-guide.md +++ b/hooks-guide.md @@ -743,8 +743,9 @@ * `"ok": true`: the action proceeds * `"ok": false`: what happens depends on the event: * `Stop` and `SubagentStop`: the `reason` is fed back to Claude so it keeps working - * `PreToolUse`: the tool call is denied and the `reason` is returned to Claude as the tool error, so it can adjust and continue - * `PostToolUse`, `PostToolBatch`, `UserPromptSubmit`, and `UserPromptExpansion`: the turn ends and the `reason` appears in the chat as a warning line + * `PreToolUse`: the tool call is denied; by default the turn ends and the deny `reason` appears in the chat as a warning line. Set `continueOnBlock: true` on the hook to instead return the `reason` to Claude as the tool error, so it can adjust and continue. Before v2.1.210, the deny `reason` was returned to Claude as the tool error and the turn continued + * `PostToolUse`: by default the turn ends and the `reason` appears in the chat as a warning line. Set `continueOnBlock: true` to feed the `reason` back to Claude and continue the turn instead + * `PostToolBatch`, `UserPromptSubmit`, and `UserPromptExpansion`: the turn ends and the `reason` appears in the chat as a warning line This example uses a `Stop` hook to ask the model whether all requested tasks are complete. If the model returns `"ok": false`, Claude keeps working and uses the `reason` as its next instruction:
modified How Claude Code works View current →
--- a/how-claude-code-works.md +++ b/how-claude-code-works.md @@ -152,7 +152,7 @@ Undo changes with checkpoints -**Every file edit is reversible.** Before Claude edits any file, it snapshots the current contents. If something goes wrong, press `Esc` twice to rewind to a previous state, or ask Claude to undo. Checkpoints are separate from git and remain available when you resume a conversation. They only cover file changes. Actions that affect remote systems (databases, APIs, deployments) can’t be checkpointed, which is why Claude asks before running commands with external side effects. +**File edits are reversible.** Before Claude edits a file, it snapshots the current contents. If something goes wrong, press `Esc` twice to rewind to a previous state, or ask Claude to undo. Checkpoints are separate from git and remain available when you resume a conversation. They only cover file changes, and a restore [skips symlinked and hard-linked files](</docs/en/checkpointing#symlinked-and-hard-linked-paths-not-restored>). Actions that affect remote systems (databases, APIs, deployments) can’t be checkpointed, which is why Claude asks before running commands with external side effects. ###
modified Interactive mode View current →
--- a/interactive-mode.md +++ b/interactive-mode.md @@ -35,7 +35,7 @@ `Left/Right arrows`| Cycle through dialog tabs| Navigate between tabs in permission dialogs and menus `Up/Down arrows` or `Ctrl+P`/`Ctrl+N`| Move cursor or navigate command history| When the input spans more than one visual row, whether wrapped or multiline, first moves the cursor within the prompt. Once the cursor is on the first or last visual row, pressing again navigates command history. As of v2.1.169, wrapped single-line input behaves the same as multiline `Esc`| Interrupt Claude, or close a dialog| Stop the current response or tool call mid-turn so you can redirect. Claude keeps the work done so far. When a dialog such as a permission prompt is open, `Esc` closes the dialog rather than interrupting Claude. Before v2.1.202, `Esc` on some dialogs interrupted Claude and left the dialog open -`Esc` \+ `Esc`| Clear input draft, or rewind| When the prompt input contains text, double `Esc` clears it and saves the draft to history so `Up` recalls it. When the input is empty, double `Esc` opens the [rewind menu](</docs/en/checkpointing>) to restore or summarize code and conversation from a previous point +`Esc` \+ `Esc`| Clear input draft, or rewind| When the prompt input contains text, double `Esc` clears it and saves the draft to history so `Up` recalls it. When the input is empty, double `Esc` opens the [rewind menu](</docs/en/checkpointing>) to restore or summarize code and conversation from a previous point. Before v2.1.216, double `Esc` at an empty prompt could stop opening the menu for the rest of a long-running session that used background tasks `Shift+Tab`, or `Alt+M` on Windows when the Node or Bun runtime doesn’t enable VT input mode| Cycle permission modes| Cycle through `default` (labeled Manual in the mode indicator), `acceptEdits`, `plan`, and any modes you have enabled, such as `auto` or `bypassPermissions`. See [permission modes](</docs/en/permission-modes>). `Option+P` (macOS) or `Alt+P` (Windows/Linux)| Switch model| Switch models without clearing your prompt `Option+T` (macOS) or `Alt+T` (Windows/Linux)| Toggle extended thinking| Enable or disable extended thinking mode. Has no effect on Fable 5, which always uses extended thinking. As of v2.1.132 this shortcut works on macOS without configuring Option as Meta @@ -228,7 +228,7 @@ `<<`| Dedent line `J`| Join lines `u`| Undo -`.`| Repeat last change +`.`| Repeat last change. Before v2.1.216, repeating a change operator such as `cw` or `cc` replayed only the inserted text without the deletion, and `.` after `p`/`P` repeated the previous change instead of the paste ###
modified JetBrains IDEs View current →
--- a/jetbrains.md +++ b/jetbrains.md @@ -77,7 +77,7 @@ /ide -If you want Claude to have access to the same files as your IDE, start Claude Code from the same directory as your IDE project root. +When the connection succeeds, Claude Code confirms with a message like `Connected to IntelliJ IDEA.` If Claude Code detects a running IDE that doesn’t have the plugin, `/ide` installs the plugin for you and asks you to restart the IDE. If you want Claude to have access to the same files as your IDE, start Claude Code from the same directory as your IDE project root. ## @@ -148,9 +148,7 @@ Remote development -When using JetBrains Remote Development, you must install the plugin in the remote host via **Settings → Plugin (Host)**. - -The plugin must be installed on the remote host, not on your local client machine. +When using JetBrains Remote Development, you must install the plugin on the remote host via **Settings → Plugin (Host)** , not on your local client machine. ### @@ -176,7 +174,7 @@ hostname -I -Note the subnet, for example `172.21.123.45` is in `172.21.0.0/16`. +Note your subnet: take the first two segments of the address and follow them with `.0.0/16`. For example, if the address is `172.21.123.45`, your subnet is `172.21.0.0/16`. 2 @@ -230,11 +228,11 @@ IDE not detected -If running `claude` shows “No available IDEs detected”: +If the `/ide` command shows “No available IDEs detected”: * Verify the plugin is installed and enabled * Restart the IDE completely - * Check that you’re running Claude Code from the integrated terminal + * If you expected an automatic connection without running `/ide`, check that you launched `claude` from the IDE’s integrated terminal * For WSL users, see WSL configuration above ###
modified Connect Claude Code to tools via MCP View current →
--- a/mcp.md +++ b/mcp.md @@ -160,7 +160,7 @@ Dynamic tool updates -Claude Code supports MCP `list_changed` notifications, allowing MCP servers to dynamically update their available tools, prompts, and resources without requiring you to disconnect and reconnect. When an MCP server sends a `list_changed` notification, Claude Code automatically refreshes the available capabilities from that server. +Claude Code supports MCP `list_changed` notifications, allowing MCP servers to dynamically update their available tools, prompts, and resources without requiring you to disconnect and reconnect. When an MCP server sends a `list_changed` notification, Claude Code automatically refreshes the available capabilities from that server. If a refresh request fails, Claude Code keeps the server’s previously discovered tools, prompts, and resources until a later refresh succeeds. Before v2.1.214, a transient error during the refresh replaced the server’s tools, prompts, and resources with an empty list. ### @@ -937,7 +937,7 @@ Require approval for a specific tool -If you’re building an MCP server, you can mark a tool as requiring explicit approval on every call by setting `_meta["anthropic/requiresUserInteraction"]` to `true` in the tool’s `tools/list` response entry. The value must be the JSON boolean `true`; any other value is ignored. Claude Code shows that tool’s permission prompt on every call, even in `acceptEdits`, `auto`, and `bypassPermissions` [permission modes](</docs/en/permissions#permission-modes>), and doesn’t offer a “don’t ask again” option for it. [Allow rules](</docs/en/permissions#permission-rule-syntax>) that match the tool don’t skip the prompt either. In `dontAsk` mode, which never prompts, Claude Code denies the call instead. The prompt has to reach a person. In non-interactive mode with [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>), an `allow` result from the prompt tool for a flagged tool is converted to a deny with the message `MCP tool requires user interaction; not supported via --permission-prompt-tool`. The Agent SDK’s [`canUseTool` callback](</docs/en/agent-sdk/permissions>) does receive these calls and can approve them, because the SDK host is expected to show them to a user. Use this for tools whose permission prompt is itself the point, such as a consent or access-grant step where auto-approval would mean no human ever agreed. Other tools from the same server keep their normal permission behavior. The following `tools/list` entry marks one tool as always requiring approval. +If you’re building an MCP server, you can mark a tool as requiring explicit approval on every call by setting `_meta["anthropic/requiresUserInteraction"]` to `true` in the tool’s `tools/list` response entry. The value must be the JSON boolean `true`; any other value is ignored. Claude Code shows that tool’s permission prompt on every call, even in `acceptEdits`, `auto`, and `bypassPermissions` [permission modes](</docs/en/permissions#permission-modes>), and doesn’t offer a “don’t ask again” option for it. [Allow rules](</docs/en/permissions#permission-rule-syntax>) that match the tool don’t skip the prompt either. In `dontAsk` mode, which never prompts, Claude Code denies the call instead. The prompt has to reach a person. In non-interactive mode with [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>), an `allow` result from the prompt tool for a flagged tool is converted to a deny with the message `MCP tool requires user interaction; not supported via --permission-prompt-tool`. The Agent SDK’s [`canUseTool` callback](</docs/en/agent-sdk/permissions>) does receive these calls and can approve them, because your SDK application is expected to show them to a user. Use this for tools whose permission prompt is itself the point, such as a consent or access-grant step where auto-approval would mean no human ever agreed. Other tools from the same server keep their normal permission behavior. The following `tools/list` entry marks one tool as always requiring approval. { "name": "grant_access", @@ -947,7 +947,7 @@ } } -The `anthropic/requiresUserInteraction` annotation requires Claude Code v2.1.199 or later. Earlier versions ignore it and apply the standard permission flow. When a session is connected to [Remote Control](</docs/en/remote-control>) or an SDK host, Claude Code marks the permission request as requiring user interaction, so the client shows the tool’s permission prompt for you to answer instead of a one-tap approve action. +The `anthropic/requiresUserInteraction` annotation requires Claude Code v2.1.199 or later. Earlier versions ignore it and apply the standard permission flow. Some surfaces, such as [Remote Control](</docs/en/remote-control>) and applications built on the [Agent SDK](</docs/en/agent-sdk/overview>), normally let you approve tool calls with one tap. For a tool marked with this annotation, Claude Code withholds the one-tap action and shows the tool’s full permission prompt instead, so approval still comes from a person answering the prompt rather than a tap. Claude Code withholds one-tap approval the same way for any permission request that only the terminal dialog can render in full, such as one that carries a safety warning or an always-allow option the remote surface can’t show. You answer that request in the terminal dialog rather than from Remote Control. Requires Claude Code v2.1.214 or later. ##
modified How Claude remembers your project View current →
--- a/memory.md +++ b/memory.md @@ -367,7 +367,7 @@ How it works -The first 200 lines of `MEMORY.md`, or the first 25KB, whichever comes first, are loaded at the start of every conversation. Content beyond that threshold is not loaded at session start. Claude keeps `MEMORY.md` concise by moving detailed notes into separate topic files. After Claude writes to `MEMORY.md`, Claude Code measures the file against the 200-line and 25KB read limits. If the file is near a limit, Claude Code reminds Claude to shorten it: keep one line per entry, move detail into topic files, and merge or drop stale entries. If the file is over a limit, the write still succeeds, but Claude Code returns an [error telling Claude to rewrite the index](</docs/en/errors#memory-index-is-over-its-read-limit>), because everything past the limit is dropped on the next load. The check measures only the content that loads: YAML frontmatter and block-level HTML comments are stripped before the index is loaded, so they don’t count toward the limits. Before v2.1.211, Claude Code measured the raw file, and frontmatter or comments could trigger the error even when the loaded content fit. This limit applies only to `MEMORY.md`. CLAUDE.md files are loaded in full regardless of length, though shorter files produce better adherence. Topic files like `debugging.md` or `patterns.md` are not loaded at startup. Claude reads them on demand using its standard file tools when it needs the information. The main conversation’s auto memory isn’t loaded into [subagents](</docs/en/sub-agents#what-loads-at-startup>); the exception is a [fork](</docs/en/sub-agents#fork-the-current-conversation>), which inherits the parent conversation and system prompt. A subagent’s own auto memory, enabled with the subagent `memory` field, is a separate directory. Claude reads and writes memory files during your session. When you see messages like “Saved 2 memories” or “Recalled 2 memories” in the Claude Code interface, Claude is actively updating or reading from `~/.claude/projects/<project>/memory/`. +The first 200 lines of `MEMORY.md`, or the first 25KB, whichever comes first, are loaded at the start of every conversation. Content beyond that threshold is not loaded at session start. Claude keeps `MEMORY.md` concise by moving detailed notes into separate topic files. After Claude writes to `MEMORY.md`, Claude Code measures the file against the 200-line and 25KB read limits. If the file is near a limit, Claude Code reminds Claude to shorten it: keep one line per entry, move detail into topic files, and merge or drop stale entries. If the file is over a limit, the write still succeeds, but Claude Code returns an [error telling Claude to rewrite the index](</docs/en/errors#memory-index-is-over-its-read-limit>), because everything past the limit is dropped on the next load. The check measures only the content that loads: YAML frontmatter and block-level HTML comments are stripped before the index is loaded, so they don’t count toward the limits. Before v2.1.211, Claude Code measured the raw file, and frontmatter or comments could trigger the error even when the loaded content fit. This limit applies only to `MEMORY.md`. CLAUDE.md files are loaded in full regardless of length, though shorter files produce better adherence. Topic files like `debugging.md` or `patterns.md` are not loaded at startup. Claude reads them on demand using its standard file tools when it needs the information. The main conversation’s auto memory isn’t loaded into [subagents](</docs/en/sub-agents#what-loads-at-startup>); the exception is a [fork](</docs/en/sub-agents#fork-the-current-conversation>), which inherits the parent conversation and system prompt. A subagent’s own auto memory, enabled with the subagent `memory` field, is a separate directory. Claude reads and writes memory files during your session. When you see messages like “Saved 2 memories” or “Recalled 2 memories” in the Claude Code interface, Claude is actively updating or reading from `~/.claude/projects/<project>/memory/`. When Claude writes a memory file that begins with YAML frontmatter, Claude Code records the write time in a `modified` frontmatter field as an ISO 8601 timestamp. The timestamp shows how current the fact is, both to you and to Claude when it reads the memory back. Any file that has frontmatter gets the field the next time Claude writes it, including files created on earlier versions; Claude Code never adds frontmatter to a file that has none. The `modified` field requires Claude Code v2.1.214 or later. ### @@ -383,7 +383,7 @@ View and edit with `/memory` -The `/memory` command lists your CLAUDE.md, CLAUDE.local.md, and other memory file locations across user and project scopes, including user and project CLAUDE.md entries for files that don’t exist yet. It also lets you toggle auto memory on or off and provides an option to open the auto memory folder. Select any file to open it in your editor; selecting one that doesn’t exist yet creates it first. To check which files actually loaded into the current session, run `/context`. When you ask Claude to remember something, like “always use pnpm, not npm” or “remember that the API tests require a local Redis instance,” Claude saves it to auto memory. To add instructions to CLAUDE.md instead, ask Claude directly, like “add this to CLAUDE.md,” or edit the file yourself via `/memory`. +The `/memory` command lists your CLAUDE.md, CLAUDE.local.md, and other memory file locations across user and project scopes, including user and project CLAUDE.md entries for files that don’t exist yet. It also lets you toggle auto memory on or off and provides an option to open the auto memory folder. Select any file to open it in your editor; selecting one that doesn’t exist yet creates it first. To check which files actually loaded into the current session, run `/context`. GUI editors such as VS Code open the file in a separate window, and you can keep using the session while it’s open. Before v2.1.216, `/memory` waited for you to close the file before responding. Terminal editors such as Vim take over the terminal until you exit. When you ask Claude to remember something, like “always use pnpm, not npm” or “remember that the API tests require a local Redis instance,” Claude saves it to auto memory. To add instructions to CLAUDE.md instead, ask Claude directly, like “add this to CLAUDE.md,” or edit the file yourself via `/memory`. ##
modified Model configuration View current →
--- a/model-config.md +++ b/model-config.md @@ -135,7 +135,7 @@ Excluded models are hidden from the `/model` picker. A full model ID in the list that has no built-in picker row, such as an older version that the list pins, appears in the `/model` picker as its own labeled row. Before v2.1.199, such an ID was selectable only by typing `/model <id>`. Model changes that Claude Code makes on your behalf are checked the same way: - * **Fallback model chains** : elements outside the allowlist are dropped + * **Fallback model chains** : entries outside the allowlist are dropped * **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model * **Automatic model fallback** : a fallback whose target is excluded does not run, so the flagged request ends with a refusal instead * **[Auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier’s Claude Sonnet 5 default applies only when the allowlist permits Sonnet 5. When it’s excluded, the classifier runs on the session’s model, which the allowlist already governs, or on an Opus model when the session runs on Fable 5. On providers other than the Anthropic API, that Opus fallback runs on the provider’s default Opus model without consulting the allowlist. Requires Claude Code v2.1.210 or later @@ -323,10 +323,10 @@ "fallbackModel": ["claude-sonnet-5", "claude-haiku-4-5"] } -The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each element accepts a model name or alias, and `"default"` expands to the default model. Claude Code doesn’t confirm the chain at startup and `/status` doesn’t display it. The notice shown when a switch happens is the first visible sign that a fallback is configured. Two cases cause an element to be skipped: - - * **Unavailable model** : a model that can’t be reached, such as a retired model pinned in settings, is skipped and Claude Code continues to the next element. - * **Outside the allowlist** : an element not permitted by `availableModels` is dropped when the chain is read and never tried. +The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each entry accepts a model name or alias, and `"default"` expands to the default model. Claude Code doesn’t confirm the chain at startup and `/status` doesn’t display it. The notice shown when a switch happens is the first visible sign that a fallback is configured. When a request fails over, Claude Code tries each entry in order until one accepts it. An entry that can’t be reached either, such as a retired model pinned in settings, fails over to the next one the same way. Two kinds of entry are removed before that walk starts: + + * **Outside the allowlist** : any entry not permitted by `availableModels` is dropped when Claude Code reads the chain. + * **Smaller context window during compaction** : the chain also covers [compaction](</docs/en/context-window#what-survives-compaction>), but Claude Code won’t fall back to a model with a smaller context window than the primary’s, since summarizing there would cut off part of the conversation first. If every fallback is smaller, compaction shows the original error and you can retry. ###
modified Monitoring View current →
Show diff (303 lines)
--- a/monitoring-usage.md +++ b/monitoring-usage.md @@ -31,7 +31,7 @@ The default export intervals are 60 seconds for metrics and 5 seconds for logs. During setup, you may want to use shorter intervals for debugging purposes. Remember to reset these for production use. -For full configuration options, see the [OpenTelemetry specification](<https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options>). +To verify a setup that exports metrics, check your backend for the `claude_code.session.count` metric, which Claude Code emits when a session starts. To verify a logs-only setup, submit a prompt and check for the `claude_code.user_prompt` event. If nothing arrives, run `claude --debug` and check the debug log for OTel export errors. For full configuration options, see the [OpenTelemetry specification](<https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options>). ## @@ -84,9 +84,10 @@ `OTEL_LOGS_EXPORT_INTERVAL`| Logs export interval in milliseconds (default: 5000)| `1000`, `10000` `OTEL_LOG_USER_PROMPTS`| Enable logging of user prompt content (default: disabled)| `1` to enable `OTEL_LOG_ASSISTANT_RESPONSES`| Enable logging of assistant response text on `assistant_response` events (default: disabled). When unset, falls back to the value of `OTEL_LOG_USER_PROMPTS`. Requires Claude Code v2.1.193 or later| `1` to enable, `0` to keep redacted -`OTEL_LOG_TOOL_DETAILS`| Enable logging of tool parameters and input arguments in tool events and trace span attributes: Bash commands, MCP server and tool names, skill names, user-authored workflow names, and tool input. Also enables custom, plugin, and MCP command names on `user_prompt` events (default: disabled)| `1` to enable -`OTEL_LOG_TOOL_CONTENT`| Enable logging of tool input and output content in span events (default: disabled). Requires tracing. Content is truncated at 60 KB| `1` to enable -`OTEL_LOG_RAW_API_BODIES`| Emit the full Anthropic Messages API request and response JSON as `api_request_body` / `api_response_body` log events (default: disabled). Bodies include the entire conversation history. Enabling this implies consent to everything `OTEL_LOG_USER_PROMPTS`, `OTEL_LOG_TOOL_DETAILS`, and `OTEL_LOG_TOOL_CONTENT` would reveal| `1` for inline bodies truncated at 60 KB, or `file:<dir>` for untruncated bodies on disk with a `body_ref` pointer in the event +`OTEL_LOG_TOOL_DETAILS`| Enable logging of tool parameters and input arguments in tool events and trace span attributes: Bash commands, MCP server and tool names, skill names, user-authored workflow names, and tool input. Also enables custom, plugin, and MCP command names on `user_prompt` events (default: disabled). For Claude Desktop’s built-in servers, in sessions Claude Desktop owns, `mcp_server_name`/`mcp_tool_name` emit on `tool_decision`/`tool_result` even with the flag off. The exception requires Claude Code v2.1.214 or later| `1` to enable +`OTEL_LOG_TOOL_CONTENT`| Enable logging of tool input and output content in span events (default: disabled). Requires tracing. Content is truncated at the content limit (60 KB by default)| `1` to enable +`OTEL_LOG_RAW_API_BODIES`| Emit the full Anthropic Messages API request and response JSON as `api_request_body` / `api_response_body` log events (default: disabled). Bodies include the entire conversation history. Enabling this implies consent to everything `OTEL_LOG_USER_PROMPTS`, `OTEL_LOG_TOOL_DETAILS`, and `OTEL_LOG_TOOL_CONTENT` would reveal| `1` for inline bodies truncated at the content limit (60 KB by default), or `file:<dir>` for untruncated bodies on disk with a `body_ref` pointer in the event +`CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH`| Content limit: the maximum length of content-bearing attributes such as model responses, tool content, system prompts, and raw API bodies, truncation marker included, in UTF-16 code units (default: 61440, i.e. 60 KB). The default is sized for backends that cap attribute values at 64 KB; raise it only if your backend accepts larger values, or lower it to cut telemetry volume. When an OpenTelemetry SDK attribute limit, `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT` or one of its logrecord and span variants, is set lower, Claude Code truncates at that smaller value so the `[TRUNCATED ...]` marker stays within the SDK limit. Requires Claude Code v2.1.214 or later| `262144` `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE`| Metrics temporality preference (default: `delta`). Set to `cumulative` if your backend expects cumulative temporality| `delta`, `cumulative` `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS`| Interval for refreshing dynamic headers (default: 1740000ms / 29 minutes)| `900000` @@ -141,7 +142,7 @@ `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`| OTLP traces endpoint, overrides `OTEL_EXPORTER_OTLP_ENDPOINT`| `http://localhost:4318/v1/traces` `OTEL_TRACES_EXPORT_INTERVAL`| Span batch export interval in milliseconds (default: 5000)| `1000`, `10000` -Spans redact user prompt text, tool input details, and tool content by default. Set `OTEL_LOG_USER_PROMPTS=1`, `OTEL_LOG_TOOL_DETAILS=1`, and `OTEL_LOG_TOOL_CONTENT=1` to include them. When tracing is active, Bash and PowerShell subprocesses automatically inherit a `TRACEPARENT` environment variable containing the W3C trace context of the active tool execution span. This lets any subprocess that reads `TRACEPARENT` parent its own spans under the same trace, enabling end-to-end distributed tracing through scripts and commands that Claude runs. When tracing is active and Claude Code is connected directly to the Anthropic API, each model request carries a W3C `traceparent` header set to the `claude_code.llm_request` span’s context, and the API’s `traceresponse` header is recorded as a span link. Together these connect Claude Code’s client-side spans to the server-side trace through any compliant intermediary. Outbound HTTP MCP requests carry `traceparent` the same way. The header is not sent to third-party providers. By default, the `traceparent` header on model and HTTP MCP requests is sent only when `ANTHROPIC_BASE_URL` is unset or points at the Anthropic API, since some proxies reject unrecognized headers. The subprocess `TRACEPARENT` variable is controlled by the same switch for consistency. If you run Claude Code through a custom `ANTHROPIC_BASE_URL` proxy and want trace context propagated, set `CLAUDE_CODE_PROPAGATE_TRACEPARENT=1`. In Agent SDK and non-interactive sessions started with `-p`, Claude Code also reads `TRACEPARENT` and `TRACESTATE` from its own environment when starting each interaction span. This lets an embedding process pass its active W3C trace context into the subprocess so Claude Code’s spans appear as children of the caller’s distributed trace. Interactive sessions ignore inbound `TRACEPARENT` to avoid accidentally inheriting ambient values from CI or container environments. The inbound trace context also applies to events. In Agent SDK and `-p` sessions with `TRACEPARENT` set, each OTLP event log record carries `trace_id` and `span_id` values that join it to your application’s trace, even when the traces exporter isn’t configured, so your logging backend can correlate events with the rest of the trace. A record emitted inside an active Claude Code span carries that span’s ids; a record emitted outside one carries the inbound `TRACEPARENT` ids directly. Before v2.1.212, event records emitted outside an active span didn’t carry `trace_id` or `span_id`. +Spans redact user prompt text, tool input details, and tool content by default. Set `OTEL_LOG_USER_PROMPTS=1`, `OTEL_LOG_TOOL_DETAILS=1`, and `OTEL_LOG_TOOL_CONTENT=1` to include them. When tracing is active, Bash and PowerShell subprocesses automatically inherit a `TRACEPARENT` environment variable containing the W3C trace context of the active tool execution span. This lets any subprocess that reads `TRACEPARENT` parent its own spans under the same trace, enabling end-to-end distributed tracing through scripts and commands that Claude runs. When tracing is active and Claude Code is connected directly to the Anthropic API, each model request carries a W3C `traceparent` header set to the `claude_code.llm_request` span’s context, and the API’s `traceresponse` header is recorded as a span link. Together these connect Claude Code’s client-side spans to the server-side trace through any compliant intermediary. Outbound HTTP MCP requests carry `traceparent` the same way. The header is not sent to third-party providers. By default, the `traceparent` header on model and HTTP MCP requests is sent only when `ANTHROPIC_BASE_URL` is unset or points at the Anthropic API, since some proxies reject unrecognized headers. The subprocess `TRACEPARENT` variable is controlled by the same switch for consistency. If you run Claude Code through a custom `ANTHROPIC_BASE_URL` proxy and want trace context propagated, set `CLAUDE_CODE_PROPAGATE_TRACEPARENT=1`. In Agent SDK and non-interactive sessions started with `-p`, Claude Code also reads `TRACEPARENT` and `TRACESTATE` from its own environment when starting each interaction span. This lets an embedding process pass its active W3C trace context into the subprocess so Claude Code’s spans appear as children of the caller’s distributed trace. Interactive sessions ignore inbound `TRACEPARENT` to avoid accidentally inheriting ambient values from CI or container environments. The inbound trace context also applies to events. In Agent SDK and `-p` sessions with `TRACEPARENT` set, each OTLP event log record carries `trace_id` and `span_id` values that join it to your application’s trace, even when the traces exporter isn’t configured, so your logging backend can correlate events with the rest of the trace. A record emitted while an interaction is active carries the interaction span’s IDs, even when Claude Code emits it outside the span’s async context, such as in a permission prompt callback or for a record buffered during startup and exported later. A record emitted with no active interaction span carries the inbound `TRACEPARENT` IDs directly. Before v2.1.214, records emitted outside the span’s async context carried the inbound `TRACEPARENT` IDs instead of the span’s IDs. Before v2.1.212, event records emitted outside an active span didn’t carry `trace_id` or `span_id`. #### @@ -225,7 +226,7 @@ `skill_name`| Skill name for the Skill tool| `OTEL_LOG_TOOL_DETAILS` `subagent_type`| Subagent type for the Agent tool or legacy Task tool| `OTEL_LOG_TOOL_DETAILS` -When `OTEL_LOG_TOOL_CONTENT=1`, this span also records a `tool.output` span event whose attributes contain the tool’s input and output bodies, truncated at 60 KB per attribute. **`claude_code.tool.blocked_on_user`** +When `OTEL_LOG_TOOL_CONTENT=1`, this span also records a `tool.output` span event whose attributes contain the tool’s input and output bodies, truncated at the content limit (60 KB by default) per attribute. **`claude_code.tool.blocked_on_user`** Attribute| Description| Gated by ---|---|--- @@ -257,7 +258,7 @@ `num_non_blocking_error`| Count of hooks that failed without blocking| `num_cancelled`| Count of hooks cancelled before completion| -Additional content-bearing attributes such as `new_context`, `system_prompt_preview`, `user_system_prompt`, `tool_input`, and `response.model_output` are emitted only when detailed beta tracing is active. They are not part of the stable span schema. `user_system_prompt` additionally requires `OTEL_LOG_USER_PROMPTS=1`. It carries only the system prompt text you provide via the `systemPrompt` SDK option or `--system-prompt` and `--append-system-prompt` flags, truncated at 60 KB, and is emitted once per session rather than per request. +Additional content-bearing attributes such as `new_context`, `system_prompt_preview`, `user_system_prompt`, `tool_input`, and `response.model_output` are emitted only when detailed beta tracing is active. They are not part of the stable span schema.`user_system_prompt` additionally requires `OTEL_LOG_USER_PROMPTS=1`. It carries only the system prompt text you provide via the `systemPrompt` SDK option or `--system-prompt` and `--append-system-prompt` flags, truncated at the content limit (60 KB by default), and is emitted once per session rather than per request. ### @@ -273,10 +274,10 @@ Settings configuration -Add to your `.claude/settings.json`: +Add to your `.claude/settings.json`, replacing the path with your own script: { - "otelHeadersHelper": "/bin/generate_opentelemetry_headers.sh" + "otelHeadersHelper": "/path/to/generate-otel-headers.sh" } The value can be the path to an executable file, including a path that contains spaces, or a shell command line with arguments. On Windows, the value always runs through the shell, so quote a path that contains spaces inside the JSON value. @@ -351,29 +352,32 @@ Example configurations -Set these environment variables before running `claude`. Each block shows a complete configuration for a different exporter or deployment scenario: - - # Console debugging (1-second intervals) +Set these environment variables before running `claude`. Each scenario below shows a complete configuration, and each variable is described under Common configuration variables. For console debugging with a 1-second export interval: + export CLAUDE_CODE_ENABLE_TELEMETRY=1 export OTEL_METRICS_EXPORTER=console export OTEL_METRIC_EXPORT_INTERVAL=1000 - # OTLP/gRPC +For OTLP over gRPC: + export CLAUDE_CODE_ENABLE_TELEMETRY=1 export OTEL_METRICS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_PROTOCOL=grpc export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 - # Prometheus +For Prometheus, scraped from `http://localhost:9464/metrics`: + export CLAUDE_CODE_ENABLE_TELEMETRY=1 export OTEL_METRICS_EXPORTER=prometheus - # Multiple exporters +To send metrics to multiple exporters: + export CLAUDE_CODE_ENABLE_TELEMETRY=1 export OTEL_METRICS_EXPORTER=console,otlp export OTEL_EXPORTER_OTLP_PROTOCOL=http/json - # Different endpoints/backends for metrics and logs +To send metrics and logs to different endpoints or backends: + export CLAUDE_CODE_ENABLE_TELEMETRY=1 export OTEL_METRICS_EXPORTER=otlp export OTEL_LOGS_EXPORTER=otlp @@ -382,13 +386,15 @@ export OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=grpc export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://logs.example.com:4317 - # Metrics only (no events/logs) +To export metrics only, without events or logs: + export CLAUDE_CODE_ENABLE_TELEMETRY=1 export OTEL_METRICS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_PROTOCOL=grpc export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 - # Events/logs only (no metrics) +To export events and logs only, without metrics: + export CLAUDE_CODE_ENABLE_TELEMETRY=1 export OTEL_LOGS_EXPORTER=otlp export OTEL_EXPORTER_OTLP_PROTOCOL=grpc @@ -434,18 +440,20 @@ Metrics -Claude Code exports the following metrics: +Claude Code exports the following metrics. The Unit column shows the OpenTelemetry unit string attached to each metric; count metrics carry none. Metric Name| Description| Unit ---|---|--- -`claude_code.session.count`| Count of CLI sessions started| count -`claude_code.lines_of_code.count`| Count of lines of code modified| count -`claude_code.pull_request.count`| Number of pull requests created| count -`claude_code.commit.count`| Number of git commits created| count +`claude_code.session.count`| Count of CLI sessions started| none +`claude_code.lines_of_code.count`| Count of lines of code modified| none +`claude_code.pull_request.count`| Number of pull requests created| none +`claude_code.commit.count`| Number of git commits created| none `claude_code.cost.usage`| Cost of the Claude Code session| USD `claude_code.token.usage`| Number of tokens used| tokens -`claude_code.code_edit_tool.decision`| Count of code editing tool permission decisions| count -`claude_code.active_time.total`| Total active time in seconds| s +`claude_code.code_edit_tool.decision`| Count of code editing tool permission decisions| none +`claude_code.active_time.total`| Total active time| s + +When `prometheus` is the only exporter listed in `OTEL_METRICS_EXPORTER`, Claude Code omits the `USD`, `tokens`, and `s` units from the exported metrics so the scrape stays valid Prometheus text format. Metric names don’t change, and configurations that combine exporters, such as `otlp,prometheus`, keep the units. Before v2.1.216, the Prometheus scrape included OpenMetrics-only `# UNIT` lines that some scrapers rejected. ### @@ -578,8 +586,14 @@ Attribute| Description ---|--- `prompt.id`| UUID v4 identifier linking all events produced while processing a single user prompt - -To trace all activity triggered by a single prompt, filter your events by a specific `prompt.id` value. This returns the user_prompt event, any api_request events, and any tool_result events that occurred while processing that prompt. +`message.uuid`| UUID of the message as persisted in the session transcript, the `~/.claude/projects/*/*.jsonl` files. Present on `assistant_response`, and on `user_prompt` except for command dispatches, which can produce zero or many messages. On `assistant_response`, this is the response’s final transcript entry, which the next turn’s `parentUuid` chains from. Requires Claude Code v2.1.214 or later +`client_request_id`| Client-generated UUID sent as the `x-client-request-id` request header. Present on `api_request` and `api_error` on first-party API connections; absent on third-party provider backends and when the request was retried through the non-streaming fallback. Pairs a request with its response and remains available for failures such as timeouts that never produced a server `request_id`. Matches the same attribute on the `llm_request` trace span. Requires Claude Code v2.1.214 or later + +To trace all activity triggered by a single prompt, filter your events by a specific `prompt.id` value. This returns the user_prompt event, any api_request events, and any tool_result events that occurred while processing that prompt. For message-level reconstruction, each event class carries a key that matches a field in the session transcript. The transcript entry format is [internal to Claude Code](</docs/en/sessions#where-transcripts-are-stored>) and changes between versions, so a pipeline that joins on these fields can break on any release; treat the joins as version-specific rather than a stable contract: + + * `message.uuid` on `user_prompt` and `assistant_response` + * `request_id` on the API events, persisted as `requestId` on the transcript’s assistant entries + * `tool_use_id` on `tool_result` and `tool_decision` events `prompt.id` is intentionally excluded from metrics because each prompt generates a unique ID, which would create an ever-growing number of time series. Use it for event-level analysis and audit trails only. @@ -597,6 +611,7 @@ * `event.sequence`: monotonically increasing counter for ordering events within a session * `prompt_length`: Length of the prompt * `prompt`: Prompt content. Redacted by default. Set `OTEL_LOG_USER_PROMPTS=1` to include it + * `message.uuid`: UUID of the resulting user message, matching the persisted transcript entry. Absent on command dispatches, which can produce zero or many messages. Requires Claude Code v2.1.214 or later * `command_name`: Command name when the prompt invokes one. Built-in and bundled command names such as `compact` or `debug` are emitted as-is; aliases such as `reset` emit as typed rather than the canonical name. Custom, plugin, and MCP command names collapse to `custom` or `mcp` unless `OTEL_LOG_TOOL_DETAILS=1` is set * `command_source`: Origin of the command when present: `builtin`, `custom`, or `mcp`. Plugin-provided commands report as `custom` @@ -613,9 +628,10 @@ * `event.timestamp`: ISO 8601 timestamp * `event.sequence`: monotonically increasing counter for ordering events within a session * `response_length`: Length of the response text in characters - * `response`: Response text, truncated at 60 KB. Redacted to `<REDACTED>` by default. Set `OTEL_LOG_ASSISTANT_RESPONSES=1` to include it. When `OTEL_LOG_ASSISTANT_RESPONSES` is unset, `OTEL_LOG_USER_PROMPTS` controls it instead, so set `OTEL_LOG_ASSISTANT_RESPONSES=0` to keep responses redacted while prompt logging is on + * `response`: Response text, truncated at the content limit (60 KB by default). Redacted to `<REDACTED>` by default. Set `OTEL_LOG_ASSISTANT_RESPONSES=1` to include it. When `OTEL_LOG_ASSISTANT_RESPONSES` is unset, `OTEL_LOG_USER_PROMPTS` controls it instead, so set `OTEL_LOG_ASSISTANT_RESPONSES=0` to keep responses redacted while prompt logging is on * `model`: Model identifier (for example, “claude-sonnet-5”) * `request_id`: Anthropic API request ID from the response’s `request-id` header. Present only when the API returns one + * `message.uuid`: UUID of the response’s final transcript entry. An API response is persisted as one transcript entry per content block; this is the last one, which the next turn’s `parentUuid` chains from. Requires Claude Code v2.1.214 or later * `query_source`: Subsystem that issued the request, such as `"repl_main_thread"`, `"compact"`, or a subagent name #### @@ -641,9 +657,8 @@ * `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) - * `tool_parameters` (when `OTEL_LOG_TOOL_DETAILS=1`): JSON string containing tool-specific parameters: - * For Bash tool: includes `bash_command`, `full_command`, `timeout`, `description`, `dangerouslyDisableSandbox`, and `git_commit_id` (the commit SHA, when a `git commit` command succeeds) - * For WorkspaceBash tool: includes `bash_command`, `full_command`, `timeout` + * `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 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` @@ -663,12 +678,14 @@ * `event.sequence`: monotonically increasing counter for ordering events within a session * `model`: Model used (for example, “claude-sonnet-5”) * `cost_usd`: Estimated cost in USD + * `cost_usd_micros`: Estimated cost in millionths of a US dollar, emitted as an integer * `duration_ms`: Request duration in milliseconds * `input_tokens`: Number of input tokens * `output_tokens`: Number of output tokens * `cache_read_tokens`: Number of tokens read from cache * `cache_creation_tokens`: Number of tokens used for cache creation * `request_id`: Anthropic API request ID from the response’s `request-id` header, such as `"req_011..."`. Present only when the API returns one. + * `client_request_id`: Client-generated UUID sent as the `x-client-request-id` request header. Matches the same attribute on the `llm_request` trace span. Absent on third-party provider backends and when the request was retried through the non-streaming fallback. Requires Claude Code v2.1.214 or later * `speed`: `"fast"` or `"normal"`, indicating whether fast mode was active * `query_source`: Subsystem that issued the request, such as `"repl_main_thread"`, `"compact"`, or a subagent name * `effort`: [Effort level](</docs/en/model-config#adjust-effort-level>) applied to the request: `"low"`, `"medium"`, `"high"`, `"xhigh"`, or `"max"`. Absent when the model doesn’t support effort. @@ -692,6 +709,7 @@ * `duration_ms`: Request duration in milliseconds * `attempt`: Total number of attempts made, including the initial request (`1` means no retries occurred) * `request_id`: Anthropic API request ID from the response’s `request-id` header, such as `"req_011..."`. Present only when the API returns one. + * `client_request_id`: Client-generated UUID sent as the `x-client-request-id` request header. Available even when a failure such as a timeout or connection error never produced a server `request_id`. Absent on third-party provider backends and when the request was retried through the non-streaming fallback. Requires Claude Code v2.1.214 or later * `speed`: `"fast"` or `"normal"`, indicating whether fast mode was active * `query_source`: Subsystem that issued the request, such as `"repl_main_thread"`, `"compact"`, or a subagent name * `effort`: [Effort level](</docs/en/model-config#adjust-effort-level>) applied to the request. Absent when the model doesn’t support effort. @@ -733,7 +751,7 @@ * `event.name`: `"api_request_body"` * `event.timestamp`: ISO 8601 timestamp * `event.sequence`: monotonically increasing counter for ordering events within a session - * `body`: JSON-serialized Messages API request parameters (system prompt, messages, tools, etc.), truncated at 60 KB. Extended-thinking content in prior assistant turns is redacted. Emitted only in inline mode (`OTEL_LOG_RAW_API_BODIES=1`). + * `body`: JSON-serialized Messages API request parameters, such as the system prompt, messages, and tools, truncated at the content limit (60 KB by default). Extended-thinking content in prior assistant turns is redacted. Emitted only in inline mode (`OTEL_LOG_RAW_API_BODIES=1`). * `body_ref`: Absolute path to a `<dir>/<uuid>.request.json` file containing the untruncated body. Emitted only in file mode (`OTEL_LOG_RAW_API_BODIES=file:<dir>`). * `body_length`: Untruncated body length. UTF-8 bytes when `OTEL_LOG_RAW_API_BODIES=file:<dir>`, or UTF-16 code units when `=1` * `body_truncated`: `"true"` when inline truncation occurred. Absent in file mode and when no truncation occurred. @@ -752,7 +770,7 @@ * `event.name`: `"api_response_body"` * `event.timestamp`: ISO 8601 timestamp * `event.sequence`: monotonically increasing counter for ordering events within a session - * `body`: JSON-serialized Messages API response (id, content blocks, usage, stop reason), truncated at 60 KB. Extended-thinking content is redacted. Emitted only in inline mode (`OTEL_LOG_RAW_API_BODIES=1`). + * `body`: JSON-serialized Messages API response, including the id, content blocks, usage, and stop reason, truncated at the content limit (60 KB by default). Extended-thinking content is redacted. Emitted only in inline mode (`OTEL_LOG_RAW_API_BODIES=1`). * `body_ref`: Absolute path to a `<dir>/<request_id>.response.json` file containing the untruncated body. Emitted only in file mode (`OTEL_LOG_RAW_API_BODIES=file:<dir>`). * `body_length`: Untruncated body length. UTF-8 bytes when `OTEL_LOG_RAW_API_BODIES=file:<dir>`, or UTF-16 code units when `=1` * `body_truncated`: `"true"` when inline truncation occurred. Absent in file mode and when no truncation occurred. @@ -775,16 +793,20 @@ * `tool_name`: Name of the tool (for example, “Read”, “Edit”, “Write”, “NotebookEdit”) * `tool_use_id`: Unique identifier for this tool invocation. Matches the `tool_use_id` passed to hooks, allowing correlation between OTel events and hook-captured data. * `decision`: Either `"accept"` or `"reject"` + * `tool_source`: Always present. The tool’s provenance, as a closed set of CLI-authored values. Requires Claude Code v2.1.214 or later + * `"builtin"`: the CLI’s own tools + * `"mcp"`: MCP servers generally + * `"sdk_host_builtin_mcp"`: an in-process server built into Claude Desktop itself, in a session Claude Desktop owns. Claude Desktop owns a session it started from one of its own entrypoints, `claude-desktop`, `claude-desktop-3p`, or `local-agent`, when that session isn’t a nested child; nested sessions, including sessions Claude Code itself spawns, report these servers as `"mcp"` * `source`: Where the decision came from: - * `"config"`: Decided automatically without prompting, based on project settings, allow or deny rules in the user’s personal settings, enterprise managed policy, `--allowedTools` or `--disallowedTools` flags, the active permission mode, a session-scoped grant from an earlier prompt in the same interactive CLI session, or because the tool is inherently safe. The event doesn’t indicate which of these sources matched. + * `"config"`: Decided automatically without prompting, based on project settings, allow or deny rules in the user’s personal settings, enterprise managed policy, `--allowedTools` or `--disallowedTools` flags, the active permission mode, a session-scoped grant from an earlier prompt in the same interactive CLI session, or because the tool is inherently safe. The event doesn’t indicate which of these sources matched. Claude Code also reports `"config"` when the permission prompt request itself fails, for example when the Agent SDK’s [`canUseTool`](</docs/en/agent-sdk/typescript#canusetool>) callback or the [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) tool returns an invalid result, or when the input stream closes while the request is pending. Before v2.1.216, Claude Code reported these failures as `"user_reject"`. * `"hook"`: A `PreToolUse` or `PermissionRequest` hook returned the decision. * `"user_permanent"`: Emitted when the user chose “Yes, and don’t ask again for …” at a permission prompt, which saves an allow rule to their personal settings. In the interactive CLI this is emitted only for that choice itself; later calls that match the saved rule emit `"config"` instead. In Agent SDK or non-interactive `-p` sessions, both the initial choice and later rule matches emit `"user_permanent"`. Treated as an accept. * `"user_temporary"`: Emitted when the user chose “Yes” at a permission prompt for a one-time approval, or chose one of the ”… during this session” options on a file edit or read prompt. In the interactive CLI this is emitted only for the choice itself; later calls allowed by that session-scoped grant emit `"config"` instead. In Agent SDK or non-interactive `-p` sessions, both the choice and later matches emit `"user_temporary"`. Treated as an accept. - * `"user_abort"`: Emitted when the user dismissed the permission prompt without answering. Treated as a reject. + * `"user_abort"`: Emitted when the user dismissed the permission prompt without answering. In Agent SDK and non-interactive `-p` sessions, this includes interrupting the turn while a `canUseTool` or `--permission-prompt-tool` permission request is pending; before v2.1.216, Claude Code reported that interrupt as `"user_reject"`. Treated as a reject. * `"user_reject"`: Emitted when the user chose “No” when prompted. In the interactive CLI this is emitted only for that choice itself; calls that match a deny rule in the user’s personal settings emit `"config"` instead. In Agent SDK or non-interactive `-p` sessions, calls that match a deny rule in personal settings emit `"user_reject"`. Treated as a reject. * `tool_parameters` (when `OTEL_LOG_TOOL_DETAILS=1`): JSON string containing tool-specific parameters. Same shape as the Tool result event, minus post-execution fields such as `git_commit_id`. Values may differ from `tool_result` for an accepted call if the permission decision rewrites the tool input via `updatedInput`. Use this attribute to see which command was rejected when `decision` is `"reject"`. - * For Bash tool: includes `bash_command`, `full_command`, `timeout`, `description`, `dangerouslyDisableSandbox` - * For WorkspaceBash tool: includes `bash_command`, `full_command`, `timeout` + * For `"sdk_host_builtin_mcp"` tools: `mcp_server_name` and `mcp_tool_name` are included even when `OTEL_LOG_TOOL_DETAILS` is off, because the host application defines these names; without them, a rejected call to one of these built-in servers would be unattributable on the default stream. For user-configured MCP servers, the event’s `tool_name` is always the literal `"mcp_tool"`, and the server and tool names appear only in `tool_parameters` with the flag on; argument content requires the flag everywhere. Requires Claude Code v2.1.214 or later + * For Bash tool: includes `bash_command`, `full_command`, `timeout`, `description`, `dangerouslyDisableSandbox`. The desktop app’s workspace bash tool also reports `tool_name` as `Bash`, but 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` @@ -1112,6 +1134,8 @@ Cost metrics are approximations. For official billing data, refer to your API provider (Claude Console, Amazon Bedrock, or Google Cloud’s Agent Platform). +Claude Code counts each streaming response toward the cost and token metrics exactly once, including when a gateway or proxy behind `ANTHROPIC_BASE_URL` streams usage progressively across multiple frames. Before v2.1.214, streams that carried usage in more than one frame inflated `claude_code.cost.usage` and `claude_code.token.usage` by roughly one extra full request per extra frame. + ### ​ @@ -1183,8 +1207,8 @@ Without `OTEL_LOG_TOOL_DETAILS`, these events drop the identifying detail: - * `tool_result`: keeps `tool_name` and `mcp_server_scope`, omits `mcp_server_name`, `mcp_tool_name`, and arguments - * `tool_decision`: keeps `tool_name`, omits `tool_parameters` + * `tool_result`: keeps `mcp_server_scope` and a `tool_name` redacted to the literal `"mcp_tool"` for user-configured servers, omits argument content. For Claude Desktop’s built-in servers, in sessions Claude Desktop owns, it also keeps the `mcp_server_name`/`mcp_tool_name` pair inside `tool_parameters`, the same host-authored exception as `tool_decision`, requiring Claude Code v2.1.214 or later + * `tool_decision`: keeps `tool_source` and a `tool_name` redacted to the literal `"mcp_tool"` for user-configured servers, omits argument content. For Claude Desktop’s built-in servers, in sessions Claude Desktop owns, it also keeps the `mcp_server_name`/`mcp_tool_name` pair inside `tool_parameters`; `tool_source` and the name pair both require Claude Code v2.1.214 or later * `mcp_server_connection`: omits `server_name` and the error message, but keeps `is_plugin`, `plugin_id_hash`, and `plugin.name`, with non-Anthropic plugin names redacted to the literal `"third-party"`, so plugin-provided servers remain distinguishable without detailed logging ### @@ -1304,13 +1328,13 @@ * When authenticated via OAuth, `user.email` is included in telemetry attributes. If this is a concern for your organization, work with your telemetry backend to filter or redact this field * User prompt content is not collected by default. Only prompt length is recorded. To include prompt content, set `OTEL_LOG_USER_PROMPTS=1` * Assistant response text is not collected by default. Only response length is recorded. To include response text, set `OTEL_LOG_ASSISTANT_RESPONSES=1`. Like all OpenTelemetry data from Claude Code, the response text is sent only to the OTel endpoint you configure, never to Anthropic. When this variable is unset, `OTEL_LOG_USER_PROMPTS` is used as a fallback, so set `OTEL_LOG_ASSISTANT_RESPONSES=0` if you want prompt content without response content - * Tool input arguments and parameters are not logged by default. To include them, set `OTEL_LOG_TOOL_DETAILS=1`. This data is sent only to the OTEL endpoint you configure, never to Anthropic. Arguments may still contain sensitive values, so configure your telemetry backend to filter or redact these attributes as needed. When enabled: + * Tool input arguments and parameters are not logged by default. To include them, set `OTEL_LOG_TOOL_DETAILS=1`. For Claude Desktop’s built-in servers, in sessions Claude Desktop owns, `tool_decision` and `tool_result` carry the `mcp_server_name`/`mcp_tool_name` pair, host-authored names rather than argument content, even with the flag off. The exception requires Claude Code v2.1.214 or later. This data is sent only to the OTEL endpoint you configure, never to Anthropic. Arguments may still contain sensitive values, so configure your telemetry backend to filter or redact these attributes as needed. When enabled: * `tool_result` and `tool_decision` events include a `tool_parameters` attribute with Bash commands, MCP server and tool names, and skill names. Fields such as `full_command` are emitted untruncated * `tool_result` events additionally include a `tool_input` attribute with file paths, URLs, search patterns, and other arguments. Individual values over 512 characters are truncated and the total is bounded to ~4 K characters * `user_prompt` events include the verbatim `command_name` for custom, plugin, and MCP commands * Trace spans include the same `tool_input` attribute and input-derived attributes such as `file_path`, with the same truncation as `tool_input` - * Tool input and output content is not logged in trace spans by default. To include it, set `OTEL_LOG_TOOL_CONTENT=1`. When enabled, span events include full tool input and output content truncated at 60 KB per span. This can include raw file contents from Read tool results and Bash command output. Configure your telemetry backend to filter or redact these attributes as needed - * Raw Anthropic Messages API request and response bodies are not logged by default. To include them, set `OTEL_LOG_RAW_API_BODIES`. With `=1`, each API call emits `api_request_body` and `api_response_body` log events whose `body` attribute is the JSON-serialized payload, truncated at 60 KB. With `=file:<dir>`, untruncated bodies are written to `.request.json` and `.response.json` files under that directory and the events carry a `body_ref` path instead of the inline body. Ship the directory with a log collector or sidecar rather than through the telemetry stream. In both modes, bodies contain the full conversation history (system prompt, every prior user and assistant turn, tool results), so enabling this implies consent to everything the other `OTEL_LOG_*` content flags would reveal. Claude’s extended-thinking content is always redacted from these bodies regardless of other settings + * Tool input and output content is not logged in trace spans by default. To include it, set `OTEL_LOG_TOOL_CONTENT=1`. When enabled, span events include full tool input and output content truncated at the content limit (60 KB by default) per attribute. This can include raw file contents from Read tool results and Bash command output. Configure your telemetry backend to filter or redact these attributes as needed + * Raw Anthropic Messages API request and response bodies are not logged by default. To include them, set `OTEL_LOG_RAW_API_BODIES`. With `=1`, each API call emits `api_request_body` and `api_response_body` log events whose `body` attribute is the JSON-serialized payload, truncated at the content limit (60 KB by default). With `=file:<dir>`, untruncated bodies are written to `.request.json` and `.response.json` files under that directory and the events carry a `body_ref` path instead of the inline body. Ship the directory with a log collector or sidecar rather than through the telemetry stream. In both modes, bodies contain the full conversation history, including the system prompt, every prior user and assistant turn, and tool results, so enabling this implies consent to everything the other `OTEL_LOG_*` content flags would reveal. Claude’s extended-thinking content is always redacted from these bodies regardless of other settings ##
modified Observability with OpenTelemetry View current →
--- a/observability.md +++ b/observability.md @@ -219,8 +219,8 @@ ---|--- `OTEL_LOG_USER_PROMPTS=1`| Prompt text on `claude_code.user_prompt` events and on the `claude_code.interaction` span `OTEL_LOG_TOOL_DETAILS=1`| Tool input arguments (file paths, shell commands, search patterns) on `claude_code.tool_result` events -`OTEL_LOG_TOOL_CONTENT=1`| Full tool input and output bodies as span events on `claude_code.tool`, truncated at 60 KB. Requires tracing to be enabled -`OTEL_LOG_RAW_API_BODIES`| Full Anthropic Messages API request and response JSON as `claude_code.api_request_body` and `claude_code.api_response_body` log events. Set to `1` for inline bodies truncated at 60 KB, or `file:<dir>` for untruncated bodies on disk with a `body_ref` path in the event. Bodies include the entire conversation history and have extended-thinking content redacted. Enabling this implies consent to everything the three variables above would reveal +`OTEL_LOG_TOOL_CONTENT=1`| Full tool input and output bodies as span events on `claude_code.tool`, truncated at 60 KB by default, configurable via `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH`, which requires Claude Code v2.1.214 or later. Requires tracing to be enabled +`OTEL_LOG_RAW_API_BODIES`| Full Anthropic Messages API request and response JSON as `claude_code.api_request_body` and `claude_code.api_response_body` log events. Set to `1` for inline bodies truncated at 60 KB by default, or `file:<dir>` for untruncated bodies on disk with a `body_ref` path in the event. `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` configures the inline truncation limit, and requires Claude Code v2.1.214 or later. Bodies include the entire conversation history and have extended-thinking content redacted. Enabling this implies consent to everything the three variables above would reveal Leave these unset unless your observability pipeline is approved to store the data your agent handles. See [Security and privacy](</docs/en/monitoring-usage#security-and-privacy>) in the Monitoring reference for the full list of attributes and redaction behavior.
modified Create and distribute a plugin marketplace View current →
--- a/plugin-marketplaces.md +++ b/plugin-marketplaces.md @@ -62,7 +62,10 @@ { "name": "quality-review-plugin", "description": "Adds a quality-review skill for quick code reviews", - "version": "1.0.0" + "version": "1.0.0", + "author": { + "name": "Your Name" + } } Setting `version` means users only receive updates when you change this field, so bump it on every release. If you omit `version` and host this marketplace in git, every commit automatically counts as a new version. See Version resolution to choose the right approach. @@ -93,10 +96,11 @@ Add and install -Add the marketplace and install the plugin. +From the directory that contains `my-marketplace`, start Claude Code and run the following commands. The install command opens a plugin details view where you select an installation scope to confirm the install, and `/reload-plugins` activates the plugin in your current session. /plugin marketplace add ./my-marketplace /plugin install quality-review-plugin@my-plugins + /reload-plugins 6 @@ -872,7 +876,7 @@ Validation and testing -Test your marketplace before sharing. Validate your marketplace JSON syntax: +Test your marketplace before sharing. From your marketplace directory, validate the JSON syntax: claude plugin validate . @@ -963,7 +967,7 @@ ---|--- `--json`| Output as JSON -With `--json`, each entry includes `name`, `source`, and source-specific fields: `repo` for GitHub sources, `url` for git and URL sources, and `path` for local sources. GitHub and git sources also include a `ref` field when the marketplace was added with a pinned branch or tag. +With `--json`, each entry includes `name`, `source`, an `installLocation` field with the local cache path where the marketplace is stored, and source-specific fields: `repo` for GitHub sources, `url` for git and URL sources, and `path` for local sources. GitHub and git sources also include a `ref` field when the marketplace was added with a pinned branch or tag. ### @@ -1074,8 +1078,8 @@ **Symptoms** : Authentication errors when installing plugins from private repositories **Solutions** : For manual installation and updates: * Verify you’re authenticated with your git provider (for example, run `gh auth status` for GitHub) - * Check that your credential helper is configured correctly: `git config --global credential.helper` - * Try cloning the repository manually to verify your credentials work + * Check that your credential helper is configured: `git config --global credential.helper` + * Run `git ls-remote <marketplace-url>` to test whether git can authenticate on its own. If git asks for a username or password, store the credential first: for GitHub over HTTPS, run `gh auth setup-git`, and for SSH remotes, load your key into `ssh-agent` For background auto-updates:
modified Continue local sessions from any device with Remote Control View current →
--- a/remote-control.md +++ b/remote-control.md @@ -266,11 +266,11 @@ * **Extended network outage** : if your machine is awake but unable to reach the network for more than roughly 10 minutes, the session times out and the process exits. Run `claude remote-control` again to start a new session. * **Ultraplan disconnects Remote Control** : starting an [ultraplan](</docs/en/ultraplan>) session disconnects any active Remote Control session because both features occupy the claude.ai/code interface and only one can be connected at a time. * **Some commands are local-only** : commands that only run in the terminal interface, such as `/plugin` or `/resume`, work only from the local CLI, whether or not you pass an argument. The following work from mobile and web: - * Text-output commands: `/compact`, `/clear`, `/context`, `/usage`, `/exit`, `/usage-credits` (runs the text form instead of opening the in-CLI dialog), `/recap`, `/reload-plugins` + * Text-output commands: `/compact`, `/clear`, `/context`, `/usage`, `/exit`, `/usage-credits` (prints the billing URL instead of opening a browser), `/recap`, `/reload-plugins` * `/model`, `/effort`, `/fast`, `/color`, and `/rename`: pass the value as an argument, for example `/model sonnet` or `/effort high`. From mobile and web, `/model` and `/effort` take the argument in place of the terminal picker or slider. * `/mcp`, from v2.1.166: from the mobile app, returns a text summary of server status instead of opening the picker. On the web, `/mcp` on its own opens a directory of [claude.ai connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>) instead of returning the summary. The `reconnect`, `enable`, and `disable` [subcommands](</docs/en/commands#all-commands>) work from both. Unlike the local CLI, `/mcp reconnect` without a server name reconnects every server that has failed or needs authentication. * `/config`, from v2.1.181: from the mobile app, pass `key=value` to set a setting, or run it with no argument to list the keys you can set. On the web, `/config` opens the Claude Code section of your settings instead, and ignores text after the command. - * On Team and Enterprise, `/usage-credits` from mobile or web doesn’t send a [usage-credits request to your admin](</docs/en/costs#set-a-spend-limit-on-pro-and-max>). Sending requires a confirmation that appears only in the interactive CLI, so the command tells you to run it there instead. Before v2.1.211, the text form sent the request without confirmation. + * On Team and Enterprise, `/usage-credits` from mobile or web doesn’t send a [usage-credits request to your admin](</docs/en/costs#add-usage-credits-to-your-subscription>). Sending requires a confirmation that appears only in the interactive CLI, so the command tells you to run it there instead. Before v2.1.211, the text form sent the request without confirmation. ##
modified Configure the sandboxed Bash tool View current →
Show diff (114 lines)
--- a/sandboxing.md +++ b/sandboxing.md @@ -100,7 +100,7 @@ * Content-scoped [ask rules](</docs/en/permissions>) like `Bash(git push *)` still force a prompt even for sandboxed commands * A bare `Bash` ask rule, or the equivalent `Bash(*)` form, is skipped for commands that run sandboxed; it still applies to commands that fall back to the regular permission flow. In [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>), the rule isn’t skipped: it prompts for sandboxed commands too, including read-only ones. Before v2.1.212, the skip applied in plan mode as well -**Regular permissions mode** : All Bash commands go through the regular permission flow, even when sandboxed. This provides more control but requires more approvals. In both modes, the sandbox enforces the same filesystem and network restrictions. The difference is only in whether sandboxed commands are auto-approved or require explicit permission. The session temp directory is writable inside the sandbox by default, alongside the working directory. Claude Code sets `$TMPDIR` to this directory for sandboxed commands, so tools that write temporary files work without extra configuration. Unsandboxed commands inherit your shell’s `$TMPDIR` unchanged, which means sandboxed and unsandboxed commands resolve `$TMPDIR` to different directories. To pass temporary files between the two, write them under the working directory instead. Some commands cannot run inside the sandbox at all, such as tools that are incompatible with it or that need a host you have not allowed. Rather than failing the task or requiring you to turn sandboxing off, Claude Code includes an escape hatch: when a command fails because of sandbox restrictions, Claude analyzes the failure and may retry the command with the `dangerouslyDisableSandbox` parameter. The retried command runs outside the sandbox, so it goes through the regular permission flow: in default mode you get a confirmation prompt; in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) the classifier evaluates the underlying command instead of prompting you. To be prompted on every unsandboxed retry even in auto mode, add an [ask rule](</docs/en/permissions#match-by-input-parameter>) for `Bash(dangerouslyDisableSandbox:true)`. You can disable this escape hatch by setting `"allowUnsandboxedCommands": false` in your [sandbox settings](</docs/en/settings#sandbox-settings>). When disabled, which the `/sandbox` Overrides tab shows as **Strict sandbox mode** , the `dangerouslyDisableSandbox` parameter is completely ignored and all commands must run sandboxed or be explicitly listed in `excludedCommands`. +**Regular permissions mode** : All Bash commands go through the regular permission flow, even when sandboxed. This provides more control but requires more approvals. In both modes, the sandbox enforces the same filesystem and network restrictions. The difference is only in whether sandboxed commands are auto-approved or require explicit permission. The session temp directory is writable inside the sandbox by default, alongside the working directory. Claude Code sets `$TMPDIR` to this directory for sandboxed commands, so tools that write temporary files work without extra configuration. Unsandboxed commands inherit your shell’s `$TMPDIR` unchanged, which means sandboxed and unsandboxed commands resolve `$TMPDIR` to different directories unless you disable filesystem isolation. To pass temporary files between the two, write them under the working directory instead. Some commands cannot run inside the sandbox at all, such as tools that are incompatible with it or that need a host you have not allowed. Rather than failing the task or requiring you to turn sandboxing off, Claude Code includes an escape hatch: when a command fails because of sandbox restrictions, Claude analyzes the failure and may retry the command with the `dangerouslyDisableSandbox` parameter. The retried command runs outside the sandbox, so it goes through the regular permission flow: in default mode you get a confirmation prompt; in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) the classifier evaluates the underlying command instead of prompting you. To be prompted on every unsandboxed retry even in auto mode, add an [ask rule](</docs/en/permissions#match-by-input-parameter>) for `Bash(dangerouslyDisableSandbox:true)`. You can disable this escape hatch by setting `"allowUnsandboxedCommands": false` in your [sandbox settings](</docs/en/settings#sandbox-settings>). When disabled, which the `/sandbox` Overrides tab shows as **Strict sandbox mode** , the `dangerouslyDisableSandbox` parameter is completely ignored and all commands must run sandboxed or be explicitly listed in `excludedCommands`. Auto-allow mode works independently of your permission mode setting, with one exception: [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>). Even if you’re not in “accept edits” mode, sandboxed Bash commands run automatically when auto-allow is enabled. This means Bash commands that modify files within the sandbox boundaries execute without prompting, even when file edit tools would normally require approval.In plan mode, only [read-only commands](</docs/en/permissions#read-only-commands>) run without prompting; any other Bash command prompts for approval even with auto-allow enabled. Before v2.1.212, auto-allow ran sandboxed commands without a prompt in plan mode too. @@ -154,9 +154,57 @@ ​ +Disable filesystem isolation + +Set `sandbox.filesystem.disabled` to `true` to skip filesystem isolation while keeping network isolation. The example below turns off filesystem isolation while keeping an allowlist of network domains: + + { + "sandbox": { + "enabled": true, + "filesystem": { + "disabled": true + }, + "network": { + "allowedDomains": ["github.com", "*.npmjs.org"] + } + } + } + +The sandbox has two independent layers: filesystem isolation controls which paths sandboxed commands can read and write, and network isolation controls which domains they can reach. With the filesystem layer off, sandboxed commands get unrestricted read and write access to the host filesystem, while their network egress stays confined to your allowed domains. Turn the layer off when you sandbox to control where commands connect rather than what they write. The setting is off by default and applies on the platforms where the sandbox runs: macOS, Linux, and WSL2. Requires Claude Code v2.1.216 or later. + +With filesystem isolation off and commands auto-allowed, a sandboxed command can write files that later commands run or read, such as shell startup files, executables on `$PATH`, or `~/.claude/settings.json`, and use them to widen its own access on the next run. Set `filesystem.disabled` to `true` only for workloads you trust not to escalate their own access. Locking network domains with `allowManagedDomainsOnly` narrows the risk but doesn’t remove it, since that lock applies only to commands running inside the sandbox. + +#### + +​ + +Which settings can disable it + +Because turning filesystem isolation off widens what sandboxed commands can do, Claude Code honors `filesystem.disabled` from these settings sources only: + + * User settings, managed settings, and the `--settings` CLI flag can set it. Project settings in `.claude/settings.json` and `.claude/settings.local.json` can’t, so a checked-out project can’t switch filesystem isolation off. + * When managed settings configure `sandbox.filesystem` at all, or list any `sandbox.credentials.files` entry, only managed settings can set the key. This keeps administrator-deployed filesystem restrictions in force; to relax such a deployment, set `"disabled": true` in managed settings. + * When [`CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`](</docs/en/env-vars>) is set, Claude Code ignores `filesystem.disabled` from every source, including managed settings, and keeps filesystem isolation on. + +#### + +​ + +What changes when isolation is off + +Turning the filesystem layer off also lifts its read protections and stops overriding `$TMPDIR`, while sandboxed commands stay auto-allowed: + + * The read protections from `filesystem.denyRead` and `credentials.files` don’t apply to sandboxed commands, because the filesystem layer enforces both. `credentials.envVars` deny and mask entries still apply, since environment variable scrubbing is independent of the filesystem layer. + * Sandboxed commands inherit your shell’s `$TMPDIR` instead of the session temp directory, since every temp directory is writable. + * [`autoAllowBashIfSandboxed`](</docs/en/settings#sandbox-settings>) still defaults to `true`, so sandboxed commands keep running without prompts. Set it to `false` to keep prompting for sandboxed commands. + +### + +​ + Protect credentials -The `sandbox.credentials` setting declares credential files and environment variables to protect from sandboxed commands. Each entry names a file path or an environment variable and a `mode`. The dedicated `credentials` block keeps credential rules grouped together and separate from general filesystem rules. Requires Claude Code v2.1.187 or later. For entries with `"mode": "deny"`, file paths are denied for reads inside the sandbox, the same restriction that `filesystem.denyRead` applies, and environment variables are unset before each sandboxed command runs. The example below blocks reads of the AWS credentials file and the SSH directory and removes `GITHUB_TOKEN` and `NPM_TOKEN` from the environment of sandboxed commands: +The `sandbox.credentials` setting declares credential files and environment variables to protect from sandboxed commands. Each entry names a file path or an environment variable and a `mode`. The dedicated `credentials` block keeps credential rules grouped together and separate from general filesystem rules. Requires Claude Code v2.1.187 or later. For entries with `"mode": "deny"`, file paths are denied for reads inside the sandbox, the same restriction that `filesystem.denyRead` applies, and environment variables are unset before each sandboxed command runs. The file protection is part of the filesystem layer, so it doesn’t apply if you disable filesystem isolation; the environment variable protection still does. The example below blocks reads of the AWS credentials file and the SSH directory and removes `GITHUB_TOKEN` and `NPM_TOKEN` from the environment of sandboxed commands: { "sandbox": { @@ -222,7 +270,7 @@ * **Git worktrees** : when the working directory is a [linked git worktree](</docs/en/worktrees>), the sandbox also allows writes to the main repository’s shared `.git` directory so commands such as `git commit` can update refs and the index. Writes to `hooks/` and `config` inside that directory remain denied. * **Configurable** : define custom allowed and denied paths through settings -You can grant write access to additional paths using `sandbox.filesystem.allowWrite` in your settings. These restrictions are enforced at the OS level, so they apply to all subprocess commands, including tools like `kubectl`, `terraform`, and `npm`, not just Claude’s file tools. +You can grant write access to additional paths using `sandbox.filesystem.allowWrite` in your settings. These restrictions are enforced at the OS level, so they apply to all subprocess commands, including tools like `kubectl`, `terraform`, and `npm`, not just Claude’s file tools. To skip filesystem isolation entirely while keeping network isolation, set `sandbox.filesystem.disabled`. ### @@ -279,6 +327,7 @@ `sandbox.filesystem.allowWrite`| Grants subprocess write access to paths outside the working directory `sandbox.filesystem.denyWrite` and `sandbox.filesystem.denyRead`| Block subprocess access to specific paths `sandbox.filesystem.allowRead`| Re-allows reading specific paths within a `denyRead` region +`sandbox.filesystem.disabled`| Turns the filesystem layer off entirely while keeping network isolation; requires Claude Code v2.1.216 or later `Edit` allow rules| Grant write access to specific paths, the same way `sandbox.filesystem.allowWrite` does `Read` and `Edit` deny rules| Block access to specific files or directories `WebFetch` allow and deny rules| Control domain access @@ -340,7 +389,7 @@ Keep developers from widening the policy -For boolean keys such as `enabled` and `failIfUnavailable`, Claude Code uses the managed value and ignores anything a developer sets locally. For array keys such as `excludedCommands` and `allowRead`, Claude Code merges entries from every scope, so a developer can append entries that widen the policy. Set `allowManagedReadPathsOnly` to `true` in managed settings so that only `allowRead` entries from managed settings are honored. User, project, and local `allowRead` entries are ignored. This prevents developers from widening read access beyond the organization-approved paths. To lock network domains to the managed values the same way, set [`allowManagedDomainsOnly`](</docs/en/settings#sandbox-settings>). `excludedCommands` has no equivalent managed-only lockdown, so a developer can always append entries that run additional commands outside the sandbox. Keep the managed list narrow. +For boolean keys such as `enabled` and `failIfUnavailable`, Claude Code uses the managed value and ignores anything a developer sets locally. For array keys such as `excludedCommands` and `allowRead`, Claude Code merges entries from every scope, so a developer can append entries that widen the policy. Set `allowManagedReadPathsOnly` to `true` in managed settings so that only `allowRead` entries from managed settings are honored. User, project, and local `allowRead` entries are ignored. This prevents developers from widening read access beyond the organization-approved paths. To lock network domains to the managed values the same way, set [`allowManagedDomainsOnly`](</docs/en/settings#sandbox-settings>). When managed settings configure `sandbox.filesystem` or list any `sandbox.credentials.files` entry, only managed settings can set `filesystem.disabled`, so developers can’t switch off administrator-deployed filesystem restrictions. `excludedCommands` has no equivalent managed-only lockdown, so a developer can always append entries that run additional commands outside the sandbox. Keep the managed list narrow. ### @@ -405,7 +454,7 @@ * **Filesystem permission escalation** : overly broad filesystem write permissions can enable privilege escalation attacks. Allowing writes to directories containing executables in `$PATH`, system configuration directories, or user shell configuration files such as `.bashrc` or `.zshrc` can lead to code execution in different security contexts when other users or system processes access these files. * **Linux sandbox strength** : the Linux implementation provides strong filesystem and network isolation but includes an `enableWeakerNestedSandbox` mode that enables it to work inside Docker environments without privileged namespaces, or on Linux hosts where unprivileged user namespaces are disabled by sysctl. This option considerably weakens security and should only be used when additional isolation is otherwise enforced. * **Apple Events on macOS** : the macOS sandbox blocks Apple Events by default. The `allowAppleEvents` setting lifts this restriction so tools such as `open` and `osascript` work, but it removes code-execution isolation: sandboxed commands can launch other applications unsandboxed with no user prompt, and can send AppleScript commands to running applications, subject to the per-app macOS automation-consent prompt (TCC). It is only honored from user, managed, or CLI settings. Project settings cannot enable it. - * **Settings files protected** : the sandbox automatically denies write access to Claude Code’s `settings.json` files at every scope and to the managed settings directory, so a sandboxed command cannot modify its own policy. In v2.1.210 and later, the deny rules resolve symlinks: when a symlink appears at a protected settings file path after startup, the sandbox adds its target to the deny list for the next command, so a linked settings file can’t be edited through the link. + * **Settings files protected** : the sandbox automatically denies write access to Claude Code’s `settings.json` files at every scope and to the managed settings directory, so a sandboxed command can’t modify its own policy unless you disable filesystem isolation, which turns these deny rules off. The deny rules resolve symlinks: when a symlink appears at a protected settings file path after startup, the sandbox adds its target to the deny list for the next command, so a linked settings file can’t be edited through the link. Before v2.1.210, the deny rules didn’t resolve symlinks. ### @@ -430,7 +479,7 @@ * **Environment variables** : sandboxed Bash commands inherit the parent process environment by default, including any credentials set there. Use `sandbox.credentials` to unset or mask specific variables for sandboxed commands, or set [`CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`](</docs/en/env-vars>) to strip Anthropic and cloud provider credentials from all subprocesses. * **Subagents** : [subagents](</docs/en/sub-agents>) run in the same process as the parent session and use the same sandbox configuration. Bash commands inside a subagent are sandboxed when sandboxing is enabled in the parent session. -Effective sandboxing requires both filesystem and network isolation. Without network isolation, a compromised agent could exfiltrate sensitive files like SSH keys. Without filesystem isolation, a compromised agent could backdoor system resources to gain network access. When you widen the defaults, check that an `allowWrite` path, a broad `allowedDomains` entry, or an `excludedCommands` exception does not undo a restriction on the other side. +Effective sandboxing requires both filesystem and network isolation. Without network isolation, a compromised agent could exfiltrate sensitive files like SSH keys. Without filesystem isolation, whether from a permissive policy or from disabling the filesystem layer, a compromised agent could backdoor system resources to gain network access. When you widen the defaults, check that an `allowWrite` path, a broad `allowedDomains` entry, or an `excludedCommands` exception does not undo a restriction on the other side. ##
modified Run prompts on a schedule View current →
--- a/scheduled-tasks.md +++ b/scheduled-tasks.md @@ -38,9 +38,9 @@ You can also pass a skill as the prompt, for example `/loop 20m /review-pr 1234`, to re-run that skill each iteration. As of v2.1.196, a scheduled fire only runs skills that Claude is [allowed to invoke on its own](</docs/en/skills#control-who-invokes-a-skill>). The following reach Claude as plain text instead of executing: - * built-in commands such as `/permissions`, `/model`, or `/clear` - * skills marked [`disable-model-invocation: true`](</docs/en/skills#frontmatter-reference>) - * skills withheld from Claude by a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) setting or a `Skill` [deny rule](</docs/en/skills#restrict-claude%E2%80%99s-skill-access>) + * Built-in commands such as `/permissions`, `/model`, or `/clear` + * Skills marked [`disable-model-invocation: true`](</docs/en/skills#frontmatter-reference>), including the bundled `/verify` and `/code-review` skills. + * Skills withheld from Claude by a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) setting or a `Skill` [deny rule](</docs/en/skills#restrict-claude%E2%80%99s-skill-access>) * [MCP prompts](</docs/en/mcp#use-mcp-prompts-as-commands>) such as `/mcp__github__list_prs` ### @@ -226,6 +226,7 @@ * Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal. * No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval. * Starting a fresh conversation clears all session-scoped tasks. Resuming with `claude --resume` or `claude --continue` restores tasks that have not expired: recurring tasks within seven days of creation, and one-shot tasks whose scheduled time has not yet passed. Background Bash and monitor tasks are never restored on resume. + * Claude Code stores the scheduled task list in the project’s `.claude` directory, and scheduling a task fails with an error when that directory, or the task file inside it, is a symlink. Before v2.1.216, Claude Code wrote the file through the link. For cron-driven automation that needs to run unattended:
modified Manage sessions View current →
--- a/sessions.md +++ b/sessions.md @@ -28,6 +28,7 @@ * Conversation history: the full history, including tool calls and results. * Model: the session continues on the model it was using. The model isn’t restored when it has been retired or isn’t allowed by `availableModels`, when a `--model` flag or `ANTHROPIC_MODEL`-family environment variable picks one at launch, or on providers that use provider-specific deployment IDs, such as [Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry](</docs/en/third-party-integrations>); see [model configuration](</docs/en/model-config#setting-your-model>) for the resolution order. + * Agent: a session started with [`--agent`](</docs/en/sub-agents#invoke-subagents-explicitly>) or the `agent` setting continues as that agent, keeping its system prompt, tool restrictions, and model. Pass `--agent` when resuming to pick a different one. If the agent no longer exists in the session’s original directory or the one you resume from, the session resumes with the default tools and system prompt and shows a [warning naming the agent](</docs/en/errors#session-agent-no-longer-available>). * Permission mode: the mode the session was in. `plan` and `bypassPermissions` are never restored; [bypassing permissions](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) must be enabled again at launch, with one of its launch flags or `permissions.defaultMode: "bypassPermissions"` in [settings](</docs/en/settings#permission-settings>). `auto` is restored only when your account still meets the [auto mode requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). Pass `--permission-mode` to override the restored mode. * Active goal: a [goal](</docs/en/goal#resume-with-an-active-goal>) that was still active when the session ended carries over; its turn count, timer, and token-spend baseline reset. * Scheduled tasks: [tasks that haven’t expired](</docs/en/scheduled-tasks#limitations>) are restored. Background Bash and monitor tasks aren’t. @@ -40,7 +41,12 @@ Where the session picker looks -Sessions are stored per project directory. By default the session picker shows interactive sessions from the current worktree, plus sessions started elsewhere that added the current directory with `/add-dir`. Use `Ctrl+W` to widen to all worktrees of the repository or `Ctrl+A` to widen to every project on this machine. Sessions whose first prompt was a [`/loop`](</docs/en/scheduled-tasks#run-a-prompt-repeatedly-with-%2Floop>) command don’t appear in the picker; running `/loop` later in a conversation doesn’t hide the session. Before v2.1.211, a `/loop` run early in a conversation hid the session from the picker permanently. From v2.1.169, moving a session with [`/cd`](</docs/en/commands>) relocates it to the new directory’s project storage, so it appears in that directory’s picker afterward. As of v2.1.196, a moved session stays out of the old directory’s picker even after a crash or forced exit. On earlier versions, it could also reappear in the old directory’s list after an exit that wasn’t clean when the old path contained special characters such as underscores. Selecting a session from another worktree of the same repository resumes it in place. Selecting a session from an unrelated project copies a `cd` and resume command to your clipboard instead. Resuming by name resolves across the current repository and its worktrees. Both forms look for an exact match and resume it directly even if it lives in a different worktree: +Claude Code stores sessions per project directory. By default the session picker shows: + + * Sessions from the current worktree, including [background sessions](</docs/en/agent-view>), which are marked `bg` in the list + * Sessions started elsewhere that added the current directory with `/add-dir` + +Use `Ctrl+W` to widen to all worktrees of the repository or `Ctrl+A` to widen to every project on this machine. Sessions whose first prompt was a [`/loop`](</docs/en/scheduled-tasks#run-a-prompt-repeatedly-with-%2Floop>) command don’t appear in the picker; running `/loop` later in a conversation doesn’t hide the session. Before v2.1.211, a `/loop` run early in a conversation hid the session from the picker permanently. From v2.1.169, moving a session with [`/cd`](</docs/en/commands>) relocates it to the new directory’s project storage, so it appears in that directory’s picker afterward. As of v2.1.196, a moved session stays out of the old directory’s picker even after a crash or forced exit. On earlier versions, it could also reappear in the old directory’s list after an exit that wasn’t clean when the old path contained special characters such as underscores. Selecting a session from another worktree of the same repository resumes it in place. Selecting a session from an unrelated project copies a `cd` and resume command to your clipboard instead. Resuming by name resolves across the current repository and its worktrees. Both forms look for an exact match and resume it directly even if it lives in a different worktree: Command| Exact match| Ambiguous name ---|---|--- @@ -85,7 +91,7 @@ `Ctrl+B`| Filter to sessions from the current git branch. Press again to show all branches `Esc`| Exit the session picker or search mode -Each row shows the session name if you set one, otherwise the AI-generated session title, conversation summary, or first prompt, along with time since last activity, git branch, and file size. Widen to all projects with `Ctrl+A` to also see each session’s project path. Sessions created with `/branch` or `--fork-session` get their own session IDs and appear as separate rows. When the picker finds more than one entry for the same session, it groups them under a single row. Press `→` to expand a group. +Each row shows the session name if you set one, otherwise the AI-generated session title, conversation summary, or first prompt, along with time since last activity, git branch, and file size. Widen to all projects with `Ctrl+A` to also see each session’s project path. Sessions created with `/branch` or `--fork-session` get their own session IDs and appear as separate rows. When the picker finds more than one entry for the same session, it groups them under a single row. Press `→` to expand a group. If Claude Code can’t load the session you select from the `claude --resume` picker, it prints [`Failed to resume the conversation`](</docs/en/errors#failed-to-resume-the-conversation>) with a command to retry, then exits with code 1. From the `/resume` picker inside a session, Claude Code reports the failure and your current conversation keeps running. ##
modified Extend Claude with skills View current →
--- a/skills.md +++ b/skills.md @@ -10,7 +10,11 @@ Bundled skills -Claude Code includes a set of bundled skills that are available in every session unless disabled with the [`disableBundledSkills`](</docs/en/settings#available-settings>) setting, including `/doctor`, `/code-review`, `/batch`, `/debug`, `/loop`, and `/claude-api`. Unlike most built-in commands, which execute fixed logic directly, bundled skills are prompt-based: they give Claude detailed instructions and let it orchestrate the work using its tools. You invoke them the same way as any other skill, by typing `/` followed by the skill name. The [`/doctor`](</docs/en/commands#all-commands>) setup checkup is the one exception to `disableBundledSkills` in Claude Code v2.1.205 and later: it stays typable when the setting is on. To hide it, set the `DISABLE_DOCTOR_COMMAND` environment variable or a `skillOverrides` entry of `"doctor": "off"`. Before v2.1.205, `/doctor` was a built-in command rather than a bundled skill. Bundled skills are listed alongside built-in commands in the [commands reference](</docs/en/commands>), marked **Skill** in the Purpose column. +Claude Code includes a set of bundled skills, such as `/doctor`, `/code-review`, `/batch`, `/debug`, `/loop`, and `/claude-api`. Bundled skills are prompt-based: they give Claude detailed instructions and let it orchestrate the work using its tools. Most built-in commands instead execute fixed logic directly. You invoke a bundled skill the same way as any other skill, by typing `/` followed by the skill name. Claude invokes some bundled skills automatically when relevant; others, including `/verify` and `/code-review`, run only when you invoke them, which keeps you in control of when these longer-running checks spend time and tokens. Before v2.1.215, Claude could also run `/verify` and `/code-review` on its own. Bundled skills are available in every session. To turn them off, use the [`disableBundledSkills`](</docs/en/settings#available-settings>) setting, which disables every bundled skill except `/doctor`. + +The [`/doctor`](</docs/en/commands#all-commands>) setup checkup stays typable when `disableBundledSkills` is on, in Claude Code v2.1.205 and later. To hide it, set the `DISABLE_DOCTOR_COMMAND` environment variable or a `skillOverrides` entry of `"doctor": "off"`. Before v2.1.205, `/doctor` was a built-in command rather than a bundled skill. + +Bundled skills are listed alongside built-in commands in the [commands reference](</docs/en/commands>), marked **Skill** in the Purpose column. ### @@ -225,7 +229,7 @@ Field| Required| Description ---|---|--- -`name`| No| Display name shown in skill listings. Defaults to the directory name. See How a skill gets its command name for how this differs from the name you type to invoke the skill. +`name`| No| Display name shown in skill listings. Defaults to the directory name. See How a skill gets its command name for how the field interacts with the name you type to invoke the skill. `description`| Recommended| What the skill does and when to use it. Claude uses this to decide when to apply the skill. If omitted, uses the first paragraph of markdown content. Put the key use case first: the combined `description` and `when_to_use` text is truncated at 1,536 characters in the skill listing to reduce context usage. `when_to_use`| No| Additional context for when Claude should invoke the skill, such as trigger phrases or example requests. Appended to `description` in the skill listing and counts toward the 1,536-character cap. `argument-hint`| No| Hint shown during autocomplete to indicate expected arguments. Example: `[issue-number]` or `[filename] [format]`. @@ -248,17 +252,17 @@ How a skill gets its command name -The command you type to invoke a skill comes from where the skill file lives. The frontmatter `name` field sets the display label shown in skill listings and, except for a plugin-root `SKILL.md`, does not change what you type after `/`. The table below shows where the command name comes from for each layout: +The command you type to invoke a skill comes from where the skill file lives and, for plugin skills, also from the frontmatter `name` field. In a personal or project skill, `name` sets only the display label shown in skill listings, and the command still comes from the directory or file name. In a plugin skill, `name` sets the last segment of the command and the plugin prefix stays in place. The table below shows where the command name comes from for each layout: Skill location| Command name source| Example ---|---|--- Skill directory under `~/.claude/skills/` or `.claude/skills/`| Directory name| `.claude/skills/deploy-staging/SKILL.md` → `/deploy-staging` Nested `.claude/skills/` directory, when the name clashes with another skill| Subdirectory path relative to the working directory, then the skill directory name| `apps/web/.claude/skills/deploy/SKILL.md` → `/apps/web:deploy` File under `.claude/commands/`| File name without extension| `.claude/commands/deploy.md` → `/deploy` -Plugin `skills/` subdirectory| Directory name, namespaced by plugin| `my-plugin/skills/review/SKILL.md` → `/my-plugin:review` +Plugin `skills/` subdirectory| Frontmatter `name` or the directory name, namespaced by plugin| `my-plugin/skills/review/SKILL.md` → `/my-plugin:review`, or `/my-plugin:fancy` with `name: fancy` Plugin root `SKILL.md`| Frontmatter `name`, with the plugin directory name as a fallback| `my-plugin/SKILL.md` with `name: review` → `/my-plugin:review`. See [Path behavior rules](</docs/en/plugins-reference#path-behavior-rules>) -The plugin-root case is the one place where `name` does set the command name, because there is no skill directory to take it from. If `name` is not set in the frontmatter, the plugin’s directory name is used instead. +In a plugin skill, the frontmatter `name` replaces the directory name in the last segment of the command, so `my-plugin/skills/review/SKILL.md` with `name: fancy` becomes `/my-plugin:fancy`. The bare `/fancy` also invokes the skill unless another command already uses that name. Before v2.1.216, the frontmatter name replaced the whole command name, so the menu showed `/fancy` without the plugin prefix and `/my-plugin:fancy` didn’t autocomplete. For a plugin-root `SKILL.md`, there is no skill directory to take the name from, so `name` supplies the whole final segment. Without a `name` field, Claude Code falls back to the plugin’s directory name. ####