Changes on
39 changes detected
--- a/agent-teams.md
+++ b/agent-teams.md
@@ -193,7 +193,7 @@
Ask the researcher teammate to shut down
-The lead sends a shutdown request. The teammate can approve, exiting gracefully, or reject with an explanation. The team’s shared directories are cleaned up automatically when the session ends, so there’s no separate cleanup step. See Architecture for which directories are removed and which persist for resumed sessions.
+The lead sends a shutdown request. The teammate can approve, exiting gracefully, or reject with an explanation. The team’s shared directories are cleaned up automatically when the session ends, so there’s no separate cleanup step. See Architecture for which directories are removed and which stay on disk.
###
@@ -240,10 +240,10 @@
Each agent’s mailbox is a JSON file at `~/.claude/teams/{team-name}/inboxes/{agent-name}.json`. Claude Code validates every entry when it reads a mailbox file. Entries that don’t match the message format are reported as errors and removed from the file; the valid messages are still delivered. Claude Code reports a message as sent only when the write to the recipient’s mailbox file succeeds, whether the message is plain text or a structured protocol message such as a plan approval or shutdown request. When the write fails, for example because the disk is full or the mailbox directory isn’t writable, the sending agent receives an error and nothing is sent. See [Failed to write to a teammate’s inbox](</docs/en/errors#failed-to-write-to-a-teammate-inbox>) for the error messages and recovery steps. Claude Code manages task dependencies automatically: when a teammate completes a task that other tasks depend on, it unblocks the dependent tasks without any action from you. Teams and tasks are stored locally under a session-derived name. The name is `session-` followed by the first eight characters of the session ID:
- * **Team config** : `~/.claude/teams/{team-name}/config.json`
- * **Task list** : `~/.claude/tasks/{team-name}/`
-
-Claude Code generates both of these automatically at session startup and updates them as teammates join, go idle, or leave. The team config directory is removed when the session ends. The task list directory persists locally and is never uploaded, so resumed sessions keep their tasks. Retention is governed by the same [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) you already control for session transcripts, following the [retention sweep rules](</docs/en/claude-directory#cleaned-up-automatically>). The team config holds runtime state such as session IDs and tmux pane IDs, so don’t edit it by hand or pre-author it: your changes are overwritten on the next state update. To define reusable teammate roles, use subagent definitions instead. The team config contains a `members` array with each member’s name and agent ID. The lead’s entry always carries the agent type `team-lead`. A teammate’s entry carries whatever agent type the lead named when spawning it, whether a [built-in type](</docs/en/sub-agents#built-in-subagents>) or a subagent definition, and omits the field when the lead named none. Teammates can read this file to discover other team members. There is no project-level equivalent of the team config. A file like `.claude/teams/teams.json` in your project directory is not recognized as configuration; Claude treats it as an ordinary file.
+ * **Team config** : `~/.claude/teams/{team-name}/config.json`. Claude Code removes the team config directory when the session ends.
+ * **Task list** : `~/.claude/tasks/{team-name}/`. This directory stays on disk after the session ends. To change [how long Claude Code keeps it](</docs/en/claude-directory#cleaned-up-automatically>), set [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>).
+
+Claude Code generates both of these automatically at session startup and updates them as teammates join, go idle, or leave. The team config holds runtime state such as session IDs and tmux pane IDs, so don’t edit it by hand or pre-author it: your changes are overwritten on the next state update. To define reusable teammate roles, use subagent definitions instead. The team config contains a `members` array with each member’s name and agent ID. The lead’s entry always carries the agent type `team-lead`. A teammate’s entry carries whatever agent type the lead named when spawning it, whether a [built-in type](</docs/en/sub-agents#built-in-subagents>) or a subagent definition, and omits the field when the lead named none. Teammates can read this file to discover other team members. There is no project-level equivalent of the team config. A file like `.claude/teams/teams.json` in your project directory is not recognized as configuration; Claude treats it as an ordinary file.
###
--- a/agent-view.md
+++ b/agent-view.md
@@ -237,7 +237,7 @@
* Press `Ctrl+R` to rename a session
* Press `Enter` on a group header to collapse it, except while a filter is active, when every group stays expanded
-To remove a session from the list, press `Ctrl+X` to stop it and `Ctrl+X` again within two seconds to delete it. Pressing `Ctrl+X` on a group header deletes every session in that group after confirmation. The second press deletes the session even when the stop attempt fails, for example because the background service isn’t responding: the confirmation stays active for another two seconds, and the delete ends the session’s process itself. Press `Esc` to dismiss the confirmation without deleting. Except in the kept cases covered in What deleting a session removes, deleting removes the session from the list, and a worktree Claude created for it is removed, kept, or left in place depending on how you delete and what the worktree holds. The conversation transcript always stays on your local machine, available through `claude --resume`. To bring a session back on Claude Code v2.1.212 or later, type `/resume` in the dispatch input. A picker opens with past sessions of the repository you opened agent view from, newest first, including sessions you deleted from the list; sessions that already have a row aren’t listed. `↑`/`↓` move the selection, `Enter` resumes the selected session as a background session so it rejoins the list as a row, and `Esc` closes the picker. The picker opens only for a bare `/resume`. A targeted, scoped, or restricted resume can’t be served by the picker, so agent view shows the `attach to a session to run it` hint instead when:
+To remove a session from the list, press `Ctrl+X` to stop it and `Ctrl+X` again within two seconds to delete it. Pressing `Ctrl+X` on a group header deletes every session in that group after confirmation. The second press deletes the session even when the stop attempt fails, for example because the background service isn’t responding: the confirmation stays active for another two seconds, and the delete ends the session’s process itself. Press `Esc` to dismiss the confirmation without deleting. Except in the kept cases covered in What deleting a session removes, deleting removes the session from the list, and a worktree Claude created for it is removed, kept, or left in place depending on how you delete and what the worktree holds. The conversation transcript stays on your local machine, available through `claude --resume`. To bring a session back on Claude Code v2.1.212 or later, type `/resume` in the dispatch input. A picker opens with past sessions of the repository you opened agent view from, newest first, including sessions you deleted from the list; sessions that already have a row aren’t listed. `↑`/`↓` move the selection, `Enter` resumes the selected session as a background session so it rejoins the list as a row, and `Esc` closes the picker. The picker opens only for a bare `/resume`. A targeted, scoped, or restricted resume can’t be served by the picker, so agent view shows the `attach to a session to run it` hint instead when:
* `/resume` names an id or a search term
* the view is scoped with `--cwd`
@@ -565,7 +565,7 @@
The [permission mode](</docs/en/permissions>) depends on how you started the session:
* **Backgrounded with`/bg` or `←`**: Claude Code keeps the permission mode the session was in, so one you switched to `acceptEdits` or `auto` stays there after detaching
- * **Dispatched from an agent view you opened with`←`**: the target’s own configuration comes first, and the permission mode of the session you came from applies when nothing else sets one
+ * **Dispatched from an agent view you opened with`←`**: Claude Code takes the new session’s permission mode from the target directory’s configuration first, then from the session you came from
* **Dispatched from`claude agents` started in a shell, or with `claude --bg`**: the new session starts the way a new `claude` session in that directory would, unless you dispatched it from an agent view you opened with dispatch defaults. [Which permission mode a session starts in](</docs/en/permission-modes#which-mode-a-session-starts-in>) lists the order
For a session you dispatch from an agent view opened with `←`, Claude Code takes the permission mode from the first of these that applies:
@@ -573,7 +573,7 @@
1. The target directory’s [`permissions.defaultMode`](</docs/en/settings-reference#permissions-defaultmode>). Two source rules apply:
* `auto` and `bypassPermissions` [take effect only from managed settings, a `--settings` file, or `~/.claude/settings.json`](</docs/en/settings-reference#permissions-defaultmode>).
* Claude Code refuses a `defaultMode` from the project’s `.claude/settings.json` or `.claude/settings.local.json` that selects a more permissive mode than the session you came from was in.
- 2. The permission mode of the session you came from
+ 2. The permission mode of the session you came from. If that session was in `bypassPermissions` mode, the new session can start in Manual mode instead, with the notice `Bypass permissions was requested at launch and ignored`. That happens when your acceptance of the bypass disclaimer is only in `.claude/settings.local.json` or a `--settings` file. Continue in Manual mode, or [add that acceptance to `~/.claude/settings.json`](</docs/en/permission-modes#bypass-permissions-acceptance>).
When Claude Code refuses a source’s mode as too permissive, the next source in the list decides. For example, if you dispatch from a plan-mode session into a directory whose checked-in settings ask for `acceptEdits`, the new session starts in plan mode. If you move that `defaultMode` to `~/.claude/settings.json`, it applies regardless of the permission mode of the session you came from. Permissiveness runs plan, then Manual and `dontAsk`, then `acceptEdits` and auto, which each count as more permissive than the other, then `bypassPermissions`.
--- a/auto-mode-classifier-billing.md
+++ b/auto-mode-classifier-billing.md
@@ -2,7 +2,7 @@
We're changing auto mode to no longer charge for classifier requests in Claude Code. However, this session isn't eligible.
-At the prompt, Claude Code holds the first action it would check that way until you answer. Nothing is broken: auto mode keeps working, and its classifier requests are billed as they were before. The most common cause is an LLM gateway or proxy between Claude Code and the API, and when Claude Code can identify one, the notice names it. Press **Enter** to continue, or see Make the session eligible to keep it from appearing in new sessions.
+At the prompt, Claude Code holds the first action it would check that way until you answer. Auto mode keeps working, and its classifier requests are billed as they were before. The most common cause is an LLM gateway or proxy between Claude Code and the API, and when Claude Code can identify one, the notice names it. Press **Enter** to continue, or see Make the session eligible to keep it from appearing in new sessions.
##
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,85 @@
This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Longer releases are grouped by type of change, with long lists of improvements and bug fixes collapsed. Run `claude --version` to check your installed version.
+
+
+
+2.1.302
+
+October 16, 2026
+
+**Added**
+
+ * Added `CLAUDE_CODE_AUTO_MODE_MODEL` to choose the model the client-side auto mode classifier uses; it does not change the model for server-side auto mode
+ * Added an `Idle compaction` row to `/config` for turning idle compaction off or back on; the notices shown after an idle compaction now say how to turn it off
+ * Added a notice to `/design-sync` and `/design-login` that standalone Claude Design (claude.ai/design) closes by December 14, 2026
+ * [Cloud sessions] Added a banner on a routine’s page that says why its last run didn’t start, such as your organization reaching its limit on concurrent cloud sessions
+
+**Changed**
+
+ * Changed `claude -p` and Agent SDK sessions with no permission mode to start in `default` mode on third-party providers, with telemetry off or on a fresh install; `--permission-mode auto` keeps auto
+ * Changed fork subagents (`subagent_type: "fork"`) to be on by default in `claude -p`, the Agent SDK, the desktop app and VS Code, as they already are in the terminal; `CLAUDE_CODE_FORK_SUBAGENT=0` turns them off, and `claude mcp serve` never offers them
+ * Changed the desktop app and VS Code to always run the main conversation’s subagents in the background, as the terminal does, rather than let Claude choose; a subagent’s own Agent calls in `claude -p`, the Agent SDK, the desktop app and VS Code now run in the foreground by default
+ * Changed the `← for agents` footer hint to hide 10 seconds after a session opens; the count of agents waiting on you still shows
+ * Changed where the Claude in Chrome instructions sit in the system prompt so that new conversations can read them from the shared prompt cache
+ * Changed prompt and agent hooks so that at most 12 of one event run at a time; the rest wait their turn
+ * Changed the message shown when your organization’s policy turns off `/feedback`: it now points to GitHub issues instead of an organization admin
+ * [Claude Tag] Changed Claude Tag admin settings to organize Claude’s access into four tabs: Bundles, Connectors, Skills and plugins, and Channels
+ * [Claude Tag] Changed the Roles page in organization settings to group the roles created for Claude Tag channel managers in a collapsed section below your organization’s own roles
+
+Show 7 improvements
+
+ * Improved startup time with many plugins enabled: plugin command and agent files now take far fewer file system calls to load, most of all on Windows
+ * Improved auto mode with the server-side classifier: a conversation too long for the safety check is now compacted, instead of every checked tool call being denied
+ * Improved the message when a background session reopened from another folder has no LLM gateway: it now says why, instead of “Not logged in”
+ * [Cloud sessions] Improved the error shown when a cloud session fails to start: it now says “Connection lost” or “Server error” instead of “Something went wrong”
+ * [Claude Tag] Improved repository search in Claude Tag admin settings to cover up to 100 connected GitHub accounts and find private repositories past the first 5,000 of a GitHub App install
+ * [Claude Tag] Improved Add place in Claude Tag admin settings to list a channel you type or paste right away, instead of only after your organization’s full channel list has loaded
+ * [Claude Tag] Improved Add > Domain on a workspace’s or channel’s page in Claude Tag admin settings to be available once that page loads, not only after every channel has loaded
+
+Show 43 bug fixes
+
+ * Fixed a “Prompt is too long” error when stopping a turn while the conversation was being compacted
+ * Fixed requests failing with “diagnostics: Extra inputs are not permitted” after switching to Vertex or Bedrock mid-session
+ * Fixed the Read tool loading an image file of any size, or a pipe or device named like an image, entirely into memory; image sources over 128 MB are now refused
+ * Fixed `/autocompact` and `/effort` saving to the wrong model when a gateway names Opus 4 or 4.1 with a prefix, such as `anthropic/claude-opus-4-1`
+ * Fixed a prompt cache miss when a tool added mid-session was loaded again through ToolSearch or after compaction
+ * Fixed `claude plugin` and other subcommands sometimes exiting before a queued settings or config write finished, which could lose the change or leave a `.tmp` file behind
+ * Fixed plugin marketplaces re-cloning on every refresh, and newly installed git plugins showing version “unknown”, when git defaults to the reftable ref format
+ * Fixed the PowerShell tool not finding commands in a plugin’s `bin/` folder, and reporting an error when a search that finds nothing (rg, grep, findstr, git grep) is piped into `Select-Object` or another formatting cmdlet
+ * Fixed Claude in the desktop app pointing you to claude.ai settings or `/mcp` to authorize or reconnect an MCP server where that option isn’t available
+ * Fixed artifact publishes sometimes failing when Claude sent an empty list of edits, and Claude retrying an artifact update the wrong way after a newer version of the artifact turned it away
+ * Fixed `classifier_category` missing from OpenTelemetry `tool_decision` events for most auto mode classifier blocks, and new `tool_decision` attributes pushing out `tool_use_id`, `tool_source` and `tool_parameters` when `OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT` is low
+ * Fixed rows in the agents view staying blank after moving down a long list or folding a section
+ * Fixed `claude remote-control --help` not printing its usage and exiting when not signed in
+ * Fixed `/design consent` and `/design revoke` suggesting `/design-login` when they fail in a cloud session, where it isn’t available; the message now points to claude.ai/design/settings
+ * Fixed MCP servers showing no tools, or every tool call failing, when the server negotiates protocol version 2026-07-28 but omits `resultType`, `ttlMs` or `cacheScope`
+ * Fixed prompt suggestions spending usage credits on models your plan pays for only with credits: they are now skipped after a reply billed to credits
+ * Fixed URLs written in backticks being clickable only on their first row when they wrap; the whole URL is now one link in terminals that support hyperlinks
+ * Fixed `claude plugin details <name>@builtin` suggesting `claude plugin list`, which never shows built-in plugins, when the plugin isn’t found; it now points to `/plugin`
+ * Fixed an emoji that a link starts inside wrapping one column too wide, which hid it in question previews and turned tables into lists
+ * Fixed worktree isolation refusing to create or resume worktrees under git 2.56 or later when a stray `.git` file points at a directory that doesn’t exist
+ * Fixed a cloud session’s cost and usage restarting from zero after the session resumed in a new process
+ * Self-hosted runner: Fixed git fetches failing with “bad object refs/heads” in sessions that reuse a checkout stored in git’s reftable format
+ * Windows: Fixed every file write being refused or asked about for projects on exFAT or FAT32 drives, including in sessions started with `--plugin-dir`
+ * [VSCode] Fixed text after an unclosed code block in a list showing as plain text while a reply streams, then turning into code
+ * [VSCode] Fixed MCP server sign-in from the panel opening a broken authorization page when the server URL contains a query string
+ * [VSCode] Fixed the `@browser` banner saying “Browser connected” when no browser with the Claude extension can be reached
+ * [Cloud sessions] Fixed “Rewind to here” failing on every message except the newest in cloud sessions; self-hosted runners need Claude Code v2.1.246 or later
+ * [Cloud sessions] Fixed the pull request status bar in cloud sessions flipping a pull request with merge conflicts back to ready while GitHub rechecked it
+ * [Cloud sessions] Fixed routine runs showing as Completed after their cloud session stopped unexpectedly, and as Cancelled when archived before they started, instead of failed
+ * [Cloud sessions] Fixed the diff view in cloud sessions missing changes or failing to load after the session’s GitHub repository was renamed or moved
+ * [Cloud sessions] Fixed a scheduled routine run that failed partway being run again from the start an hour or more later, which could repeat work such as posting the same report twice
+ * [Cloud sessions] Fixed an open cloud session sometimes not showing messages sent from another device until you reloaded the page or clicked away and back
+ * [Remote Control] Fixed a subagent’s pane spinning forever in a Remote Control session after your computer goes offline; it now says Remote Control is disconnected
+ * [Claude Tag] Fixed “is thinking…” staying up under a mention in a Slack channel or DM after Claude answered it by editing one of its earlier messages
+ * [Claude Tag] Fixed URLs in code blocks under a numbered or bulleted step of Claude’s Slack replies being wrapped in angle brackets, which broke copied commands
+ * [Claude Tag] Fixed HEIC, SVG, TIFF and BMP images attached in Slack never reaching Claude; they now arrive as files in its working files, like other file types
+ * [Claude Tag] Fixed new channel managers losing access to Claude in Slack in organizations that restrict Claude Tag by role; the manager role now also grants Claude Tag in Slack
+ * [Claude Tag] Fixed custom connectors whose MCP servers share one host showing as a single connector in Claude Tag admin settings; each server is now its own connector
+ * [Claude Tag] Fixed Claude in Slack sometimes answering a direct message with “DMs are temporarily unavailable” and dropping it when a single Slack lookup stalled; it now retries first
+ * [Claude Tag] Fixed direct messages with Claude on a Slack Enterprise Grid ignoring Slack’s workspace dropdown; they now run under the connected workspace you last opened Claude in
+ * [Claude Tag] Fixed Claude in Slack’s notice for a channel’s monthly spend limit saying a channel manager can raise it; it now names an organization owner and links the usage page
+ * [Claude Tag] Fixed links in Claude’s Slack replies absorbing the closing bold or italic marks, or full-width punctuation, right after them, which broke the link and the formatting
+ * [Code Review] Fixed Code Review setup not resuming after you leave to connect GitHub; back in admin settings, it now reopens at the repository picker
--- a/channels.md
+++ b/channels.md
@@ -35,7 +35,7 @@
If the install fails, match the message Claude Code reports:
* `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.
- * The plugin is [not found in the marketplace](</docs/en/plugins/install#install-a-plugin>): check the plugin name.
+ * `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](</docs/en/plugins/troubleshooting#plugin-not-found-in-marketplace>).
When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. Check the install summary: if it reports `Run /reload-plugins to apply.`, see [Apply plugin changes without restarting](</docs/en/plugins/cli-reference#reload-plugins>) to make the plugin’s configure command available.
@@ -113,7 +113,7 @@
If the install fails, match the message Claude Code reports:
* `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.
- * The plugin is [not found in the marketplace](</docs/en/plugins/install#install-a-plugin>): check the plugin name.
+ * `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](</docs/en/plugins/troubleshooting#plugin-not-found-in-marketplace>).
When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. Check the install summary: if it reports `Run /reload-plugins to apply.`, see [Apply plugin changes without restarting](</docs/en/plugins/cli-reference#reload-plugins>) to make the plugin’s configure command available.
@@ -170,7 +170,7 @@
If the install fails, match the message Claude Code reports:
* `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.
- * The plugin is [not found in the marketplace](</docs/en/plugins/install#install-a-plugin>): check the plugin name.
+ * `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](</docs/en/plugins/troubleshooting#plugin-not-found-in-marketplace>).
When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects.If the install summary reports `Run /reload-plugins to apply.`, you don’t need to act on it here, because restarting in the next step picks up the plugin.
@@ -223,7 +223,7 @@
If the install fails, match the message Claude Code reports:
* `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.
- * The plugin is [not found in the marketplace](</docs/en/plugins/install#install-a-plugin>): check the plugin name.
+ * `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](</docs/en/plugins/troubleshooting#plugin-not-found-in-marketplace>).
When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects.If the install summary reports `Run /reload-plugins to apply.`, you don’t need to act on it here, because restarting in the next step picks up the plugin.
--- a/claude-security.md
+++ b/claude-security.md
@@ -36,10 +36,10 @@
/plugin install claude-security@claude-plugins-official
-The command opens the plugin’s details, where you choose an [installation scope](</docs/en/plugins/install#install-a-plugin>) to start the install. If the install fails, the fix depends on which message Claude Code reports:
+The command opens the plugin’s details, where you choose an [installation scope](</docs/en/plugins/install#install-a-plugin>) to start the install. If the install fails, match the message Claude Code reports:
- * If it reports `Marketplace "claude-plugins-official" not found`, add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.
- * If it reports that it [can’t find the plugin in the marketplace](</docs/en/plugins/install#install-a-plugin>), check the plugin name for a typo.
+ * `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.
+ * `Plugin "claude-security" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](</docs/en/plugins/troubleshooting#plugin-not-found-in-marketplace>).
Check the install summary. If it reports `Run /reload-plugins to apply.`, see [Apply plugin changes without restarting](</docs/en/plugins/cli-reference#reload-plugins>) to activate the plugin in your current session. Once the plugin is active, you’re ready to scan and fix your codebase.
--- a/cli-reference.md
+++ b/cli-reference.md
@@ -78,7 +78,7 @@
`--continue`, `-c`| Load the most recent conversation in the current directory, including a [background session that has finished](</docs/en/sessions#where-the-session-picker-looks>); opening finished background sessions requires Claude Code v2.1.257 or later. Skips sessions created with `claude -p` or the Agent SDK, and sessions whose first prompt was `/loop`. `claude -p --continue` includes `-p`, SDK, and `/loop` sessions. Includes sessions that added this directory with `/add-dir`| `claude --continue`
`--dangerously-load-development-channels`| Enable [channels](</docs/en/channels-reference#test-during-the-research-preview>) that are not on the approved allowlist, for local development. Accepts `plugin:<name>@<marketplace>` and `server:<name>` entries. Prompts for confirmation, so it takes effect in interactive sessions. With `-p`, Claude Code ignores the flag| `claude --dangerously-load-development-channels server:webhook`
`--dangerously-skip-permissions`| Skip permission prompts. Equivalent to `--permission-mode bypassPermissions`. See [permission modes](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) for what this does and does not skip. For sessions started with `--bg`, the mode [persists when the supervisor restarts the session](</docs/en/agent-view#permission-mode-model-and-effort>)| `claude --dangerously-skip-permissions`
-`--debug`| Enable debug mode with optional category filtering, such as `--debug='mcp,startup'` or `--debug='!1p'`. The filter binds only in the `=` form; a space-separated filter enables debug mode without filtering| `claude --debug='mcp,startup'`
+`--debug`| Enable debug mode with optional category filtering, such as `--debug='mcp,startup'` or `--debug='!mcp'`. The filter binds only in the `=` form; a space-separated filter enables debug mode without filtering| `claude --debug='mcp,startup'`
`--debug-file <path>`| Write debug logs to a specific file path. Implicitly enables debug mode. Takes precedence over `CLAUDE_CODE_DEBUG_LOGS_DIR`| `claude --debug-file /tmp/claude-debug.log`
`--desktop`| Open the [Claude Desktop app](</docs/en/desktop>) on the current directory and exit without starting a session in the terminal. Add `--continue`, or `--resume` with a session ID, to [open that session in Desktop](</docs/en/desktop#coming-from-the-cli>) instead. `--resume` here takes only a session ID, not a name or transcript path. Takes no prompt and no other flags except `--verbose` and the `--debug` flags, since the app starts the session itself. Available on macOS and x64 Windows when you’re signed in with a Claude subscription. Requires Claude Code v2.1.285 or later| `claude --desktop`
`--disable-slash-commands`| Disable all skills and commands for this session| `claude --disable-slash-commands`
--- a/code-review-local.md
+++ b/code-review-local.md
@@ -110,7 +110,7 @@
After the effort level and flags, Claude Code reads the rest of the line as the review target. The `ultra` argument changes that reading:
* **With`ultra`**: Claude Code reads a single word as a base branch or PR number. Longer text that doesn’t name a branch or PR becomes [a note attached to the review](</docs/en/ultrareview#pass-a-request-in-plain-words>). `/code-review ultra check my auth changes` reviews your current branch, and Claude relates the findings to your note.
- * **Without`ultra`**: everything left is the review target, even when it starts with another command name. `/code-review /fix-issue 123` reviews with `/fix-issue 123` as target text instead of loading `/fix-issue` as a second [stacked skill](</docs/en/skills#pass-arguments-to-skills>). Before v2.1.218, a command stacked after `/code-review` expanded as its own skill.
+ * **Without`ultra`**: everything left is the review target, even when it starts with another command name. `/code-review /fix-issue 123` reviews with `/fix-issue 123` as target text instead of loading `/fix-issue` as a second [stacked skill](</docs/en/skills#stack-several-skills-in-one-message>). Before v2.1.218, a command stacked after `/code-review` expanded as its own skill.
##
--- a/commands.md
+++ b/commands.md
@@ -1,4 +1,4 @@
-Commands control Claude Code from inside a session. They provide a quick way to switch models, manage permissions, clear context, run a workflow, and more. Type `/` to see the commands available to you, or type `/` followed by letters to filter. How the command menu matches what you type covers highlighting, typos, and the few commands Claude Code hides from the menu until you type their full name. A command is only recognized at the start of your message. Text that follows the command name becomes its arguments. [Skills](</docs/en/skills#pass-arguments-to-skills>) are the exception: a skill invocation followed by more skills, such as `/skill-a /skill-b do XYZ`, loads the skills named at the start and passes the trailing text to each as arguments. Up to six skills can be chained. If you send a command while Claude is responding, Claude Code queues it and runs it after the current turn finishes. Claude Code runs some commands immediately without interrupting the response, such as `/status`, `/tasks`, and `/usage`. In [fullscreen rendering](</docs/en/fullscreen>), Claude Code also opens dialog commands such as `/theme` and `/help` immediately. Before v2.1.234, Claude Code queued those dialogs until the turn finished.
+Commands control Claude Code from inside a session. They provide a quick way to switch models, manage permissions, clear context, run a workflow, and more. Type `/` to see the commands available to you, or type `/` followed by letters to filter. How the command menu matches what you type covers highlighting, typos, and the few commands Claude Code hides from the menu until you type their full name. A command is only recognized at the start of your message. Text that follows the command name becomes its arguments. At the terminal prompt, you can start one message with several [skills](</docs/en/skills#stack-several-skills-in-one-message>): typing `/skill-a /skill-b do XYZ` loads both skills and passes the trailing text to each as arguments. Up to six skills can be chained. If you send a command while Claude is responding, Claude Code queues it and runs it after the current turn finishes. Claude Code runs some commands immediately without interrupting the response, such as `/status`, `/tasks`, and `/usage`. In [fullscreen rendering](</docs/en/fullscreen>), Claude Code also opens dialog commands such as `/theme` and `/help` immediately. Before v2.1.234, Claude Code queued those dialogs until the turn finished.
##
--- a/costs.md
+++ b/costs.md
@@ -425,7 +425,7 @@
A session that has been open for hours can use far more of your plan limits than your activity suggests, usually for one of these reasons:
* **Long context** : Claude Code sends your full conversation with every request, and each time Claude uses tools it sends another request carrying that batch of tool results. With [prompt caching](</docs/en/prompt-caching>), Claude Code re-reads that history at the [cached token rate](<https://platform.claude.com/docs/en/about-claude/pricing>), so a one-line question in a session that has been open all day still draws usage for the whole conversation. See Manage context proactively for ways to keep your context small
- * **Cache misses** : your first message after a break longer than the [cache lifetime](</docs/en/prompt-caching#cache-lifetime>) misses the cache and reprocesses your full context. The lifetime is an hour on a subscription and drops to five minutes once you’re drawing on [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>); on an API key or cloud provider, it’s five minutes by default. To keep the one-hour lifetime while drawing on usage credits, [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>). On Pro and Max plans, when you resume a large session after a long break, Claude Code [offers to resume from a summary](</docs/en/sessions#resume-from-a-summary>) so later requests don’t carry the full history
+ * **Cache misses** : your first message after a break longer than the [cache lifetime](</docs/en/prompt-caching#cache-lifetime>) misses the cache and reprocesses your full context. The lifetime is an hour on a subscription and drops to five minutes once you’re drawing on [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>); on an API key or cloud provider, it’s five minutes by default. To keep the one-hour lifetime while drawing on usage credits, [choose the TTL yourself](</docs/en/prompt-caching#choose-the-ttl-yourself>)
* **Scheduled tasks** : a [scheduled task](</docs/en/scheduled-tasks>) fires on its interval even while the session is idle, sending your full context each time
* **Cross-session messages** : Claude Code delivers a [message from another of your sessions](</docs/en/cross-session-messaging>) as a new turn when this session sits idle, sending your full context each time. To hold inbound messages instead of delivering them, set [`crossSessionInbound`](</docs/en/settings-reference#crosssessioninbound>) to `hold`
* **Goal check-ins** : while background work keeps an active [goal](</docs/en/goal>) waiting, Claude Code [asks Claude to check on that work](</docs/en/goal#background-work-defers-evaluation>) even when the session sits idle, starting a new turn that sends your full context. Claude Code starts at most three idle check-ins per goal between your prompts. Before v2.1.246, idle check-ins were uncapped. To turn check-ins off, set [`CLAUDE_CODE_GOAL_CHECKIN_MINUTES`](</docs/en/env-vars>) to `0`. Idle check-ins require Claude Code v2.1.236 or later
--- a/custom-tools.md
+++ b/custom-tools.md
@@ -155,7 +155,7 @@
Call a custom tool
-Pass the MCP server you created to `query` via the `mcpServers` option. The key in `mcpServers` becomes the `{server_name}` segment in each tool’s fully qualified name: `mcp__{server_name}__{tool_name}`. List that name in `allowedTools` so the tool runs without a permission prompt. These snippets reuse the `weatherServer` from the weather tool example to ask Claude what the weather is in a specific location.
+Pass the MCP server you created to `query` via the `mcpServers` option. Each tool’s [fully qualified name](</docs/en/agent-sdk/mcp#tool-naming-convention>) is `mcp__{server_name}__{tool_name}`, where `{server_name}` is the key you give the server in `mcpServers`. If the key contains characters such as `.` or spaces, replace them with `_` when you write `{server_name}`. List the fully qualified name in `allowedTools` so the tool runs without a permission prompt. These snippets reuse the `weatherServer` from the weather tool example to ask Claude what the weather is in a specific location.
Python
--- a/desktop.md
+++ b/desktop.md
@@ -1031,8 +1031,7 @@
For a task that must run while your computer is asleep or off, start a cloud session instead.
* **After sleep or a network loss** : you get the running task back if the process still runs and Desktop can log in without a prompt. If it can’t, send a message.
- * **After a quit, with Desktop on macOS or Linux and a Claude account** : you get the running task back if Desktop can rejoin the process. If it can’t, the task stops. If it stays stopped, send a message.
- * **After a quit, with Desktop on Windows or a[third-party provider](</docs/en/third-party-integrations>)**: you lose the running task, because Desktop ends the process when the session opens. Send a message to continue.
+ * **After a quit** : the task keeps running, but you lose it when the session opens again unless Desktop can rejoin its process. Check when Desktop can rejoin before you quit. If you lost the task, send a message to continue.
When you come back and the task isn’t done, check for word that Desktop can’t reconnect, an authentication error, or a waiting request:
@@ -1044,7 +1043,7 @@
##### Prepare a long task
* **Update first** : update Desktop before you start a long task. On macOS and Windows, Desktop can restart on its own to install an update that it has downloaded. That restart waits while Claude is working on an SSH task. On macOS with a Claude account, by default the restart can go ahead anyway once the update has waited 72 hours.
- * **Don’t quit Desktop** : if Desktop runs on Windows or uses a third-party provider, leave it open while the long task runs. After a quit, it ends the running task when the session opens. Leaving it open doesn’t protect a request that waits for you.
+ * **Don’t quit on Windows, or before v2.42304.0 with a third-party provider** : after a quit there you lose the running task, so leave Desktop open during the task. In any other case, see what you get back before you quit.
* **Reduce requests** : choose a permission mode, rules, or hooks that make the task wait for you less often
* **Check the jump host** : if your jump host asks for a sign-in, for example a push to a phone, switch to a login that works without a prompt. Otherwise Desktop can send another push each time it tries to reconnect.
* **Test the remote machine** : start a short task, quit Desktop while the task is still running, and open the session again well after the task should be done. If the task isn’t finished and the session shows no authentication error, check the remote machine for what can end a task.
@@ -1082,7 +1081,7 @@
##### Handle requests that arrive while you are away
-If Claude needs your approval or asks you a question while Desktop is disconnected, Claude waits on the remote machine. The wait has no time limit of its own. When Desktop rejoins the process, it shows you the request. If Desktop starts a new process instead, you lose the request. While a task waits for you, Desktop can restart on its own, for example to install an update. If Desktop runs on Windows or uses a third-party provider, you lose the request after that restart. If you lose a request, send a message to continue. To reduce how often a task stops to wait for you, and to hear from it while you are away, set up any of these before you leave:
+If Claude needs your approval or asks you a question while Desktop is disconnected, Claude waits on the remote machine. The wait has no time limit of its own. When Desktop rejoins the process, it shows you the request. If Desktop starts a new process instead, you lose the request. If a request that waited for you is gone when you come back, one cause is that Desktop restarted on its own, for example to install an update. You keep a request through a restart only if Desktop can rejoin the process, so check when Desktop can rejoin before you leave a task running. If you lose a request, send a message to continue. To reduce how often a task stops to wait for you, and to hear from it while you are away, set up any of these before you leave:
* **Auto mode** : choose Auto mode if it is available to you. After repeated blocks, you are [asked again](</docs/en/permission-modes#when-auto-mode-falls-back>).
* **Allow rules** : in your user settings file on the remote machine, `~/.claude/settings.json`, add [allow rules](</docs/en/permissions#manage-permissions>) for the commands the task needs. If your organization [accepts permission rules from managed settings only](</docs/en/settings-reference#allowmanagedpermissionrulesonly>), ask your administrator to add them to the managed settings that reach the remote machine. For allow rules in a project’s `.claude/settings.json`, see [Project allow rules and workspace trust](</docs/en/permissions#project-allow-rules-and-workspace-trust>).
@@ -1105,17 +1104,17 @@
* **Jump host, pushes keep coming** : where Desktop can’t tell that nobody answers, as with Desktop on Windows, it keeps trying while it has a process to rejoin, whether or not that process still runs. You can get another push with each attempt. To end the attempts, quit Desktop, which can cost you the running task.
* **Long outage** : Desktop slows to about one attempt every five minutes. To reconnect sooner, retry in the session or send a message, which Desktop delivers once it is connected.
* **Missing output** : while Desktop is disconnected, the helper keeps each session’s most recent Claude Code output in a 16 MiB buffer and drops older output. After Desktop reconnects, the session can show `Loading recent output from <host>…`. If Desktop can’t load all of the output, you see the row `Some output produced while you were disconnected may be missing here.` The row doesn’t mean that the task stopped.
- * **Process gone** : if the process is gone when Desktop reconnects, Desktop can start a new one from the conversation’s saved history and tell Claude to continue the task. Desktop doesn’t continue the task on its own if the process keeps ending, or if Desktop uses a third-party provider. Send a message to continue.
+ * **Process gone** : the process ended while Desktop was disconnected, as when the remote machine restarts. Desktop can then start a new one from the conversation’s saved history and tell Claude to continue the task. If the task stays stopped, send a message. With a third-party provider, update to Claude Desktop v2.42304.0 or later, because earlier versions never continue the task on their own.
##### Reopen a session after you quit Desktop
-After you quit Desktop, the task keeps running on the remote machine until it finishes, needs you, or reaches one of the limits.
-
- * **Desktop on macOS or Linux, with a Claude account** : start Desktop and open the session. You get the running task back when Desktop can rejoin the process. It can’t always rejoin, for example after some Desktop updates or after your organization changes its managed settings.
- * **On macOS or Linux, when Desktop can’t rejoin** : Desktop ends the process and starts a new one from the conversation’s saved history. Your running task stops, and you lose any approval or question that was waiting for you. After an update, Desktop can then tell Claude to continue. If the task stays stopped, send a message.
- * **Desktop on Windows, or with a third-party provider on any platform** : start Desktop again only when you expect the task to be done. You don’t get the running task back, because Desktop never rejoins after a quit. It ends the process when the session opens, which can happen as Desktop starts. Send a message to continue.
-
-For third-party deployments, see [SSH remote sessions in Claude Desktop on 3P](<https://claude.com/docs/third-party/claude-desktop/ssh-remote-sessions>).
+After you quit Desktop, the task keeps running on the remote machine, but it stops when the session opens again unless Desktop can rejoin its process. While Desktop is closed, the task runs until it finishes, needs you, or reaches one of the limits.
+
+ * **Desktop on Windows** : you don’t get the running task back, because Desktop never rejoins after a quit. Start Desktop again only when you expect the task to be done, because the session can open as Desktop starts.
+ * **Third-party provider, task from an earlier version** : if you started the task in a Desktop version before v2.42304.0, you don’t get it back on macOS or Linux either. Start Desktop again only when you expect the task to be done.
+ * **Any other task, with Desktop on macOS or Linux** : start Desktop and open the session, and the task goes on if Desktop rejoins. It can’t always rejoin, for example after some Desktop updates, so update before a long task.
+
+When Desktop can’t rejoin, you also lose any approval or question that was waiting for you. If the task doesn’t continue on its own, send a message, and Claude continues from the conversation’s saved history. For third-party deployments, see [SSH remote sessions in Claude Desktop on 3P](<https://claude.com/docs/third-party/claude-desktop/ssh-remote-sessions>).
While a conversation’s Claude Code process is still running, don’t run [`claude --resume`](</docs/en/cli-reference#cli-flags>) for it on the remote machine. Claude Code doesn’t stop you, and both processes then write to the same conversation. If you aren’t sure, add `--fork-session`, which continues in a copy of the conversation, but both processes still work on the same files.
--- a/env-vars.md
+++ b/env-vars.md
@@ -160,7 +160,7 @@
`ANTHROPIC_VERTEX_PROJECT_ID`| GCP project ID that Google Cloud’s Agent Platform requests are addressed to. See [Configure GCP credentials](</docs/en/google-vertex-ai#3-configure-gcp-credentials>)
`ANTHROPIC_WORKSPACE_ID`| Workspace ID for [workload identity federation](<https://platform.claude.com/docs/en/manage-claude/workload-identity-federation>). Set this when your federation rule is scoped to more than one workspace so the token exchange knows which workspace to target
`API_FORCE_IDLE_TIMEOUT`| Override the 5-minute body idle timeout that aborts a streaming model response when no bytes arrive. Set to `0` to turn the timeout off, for example when a slow [gateway](</docs/en/llm-gateway>) or local model pauses longer than 5 minutes between chunks, or `1` to keep it on for every provider. When unset, the timeout is active on providers other than the direct Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` set. The [stream watchdogs](</docs/en/network-config#streaming-idle-watchdogs>) run independently of it and abort a long silent pause even when you set `0` here
-`API_TIMEOUT_MS`| Timeout for API requests in milliseconds (default: 600000, or 10 minutes; maximum: 2147483647). Increase this when requests time out on slow networks or when routing through a proxy. Values above the maximum overflow the underlying timer and cause requests to fail immediately
+`API_TIMEOUT_MS`| Timeout for API requests in milliseconds (default: 600000, or 10 minutes; maximum: 2147483647). A streaming request has to receive its response headers within it. Increase this when requests time out on slow networks or when routing through a proxy
`AWS_BEARER_TOKEN_BEDROCK`| Amazon Bedrock API key for authentication (see [Amazon Bedrock API keys](<https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/>))
`BASH_DEFAULT_TIMEOUT_MS`| Default timeout for a foreground Bash or PowerShell tool command, in milliseconds (default: 120000, or 2 minutes). A value above the [default time limit for background commands](</docs/en/tools-reference#time-limit-for-background-commands>) replaces that default in unattended sessions. The background time limit requires Claude Code v2.1.285 or later
`BASH_MAX_OUTPUT_LENGTH`| Maximum number of characters of bash output that Claude Code reads back into a command’s result (default: 30000; maximum: 150000). If you set the [`bashOutputMaxChars`](</docs/en/settings-reference#bashoutputmaxchars>) setting, Claude Code ignores this variable. See [Output limits](</docs/en/tools-reference#output-limits>)
--- a/errors.md
+++ b/errors.md
@@ -336,6 +336,7 @@
`Can't open — this session is running in another terminal`| Background session errors
`This conversation is already open in another running Claude session`| Background session errors
`This session's saved conversation is no longer on disk`| Background session errors
+`Bypass permissions was requested at launch and ignored`| [Skip all checks with bypassPermissions mode](</docs/en/permission-modes#bypass-permissions-acceptance>)
`kept <id> — its worktree is still at <path>`| Background session errors
`kept <id> — <n> unpushed commits on <branch>`| Background session errors
`kept <id> — worktree has commits that are not pushed anywhere`| Background session errors
@@ -408,7 +409,7 @@
* Dropped connections. When a connection drops partway through a request before Claude has completed any part of its response, including its thinking, Claude Code re-issues the request with the same backoff and the turn continues, even if some text had already started streaming. When it drops after Claude has finished thinking but before it has started any text or tool call, Claude Code instead re-issues the request up to two times in quick succession, and ends the turn with `Connection lost before a response was produced` if the connection keeps dropping at that point.
* A connection that Claude Code detects was broken by your computer going to sleep partway through a request. Claude Code counts it as a dropped connection under the rules above; once the retry label names the specific reason, it reads `Connection lost while your computer was asleep`, and if the turn ends after Claude has finished thinking but before any text or tool call, the message reads `Your computer went to sleep before a response was produced`.
* A stalled response stream, when the response headers have arrived but none of Claude’s response has arrived, or when Claude has finished thinking but hasn’t started any text or tool call: Claude Code aborts the stalled connection and streams the request again at most once. If the response stalls a second time after Claude has finished thinking but before any text or tool call, Claude Code ends the turn with `The response stalled before a response was produced`.
- * A streaming request the API never answers with response headers, on a connection where the [first-byte deadline runs](</docs/en/network-config#streaming-idle-watchdogs>): Claude Code aborts it at the deadline and re-sends it at most once per model request, within the retry budget, then ends the turn with No response from API if that attempt goes unanswered too. On other connections, the request waits out `API_TIMEOUT_MS`. When you set `CLAUDE_CODE_RETRY_WATCHDOG`, the one-retry cap doesn’t apply.
+ * A streaming request the API never answers with response headers, on a connection where the [first-byte deadline runs](</docs/en/network-config#streaming-idle-watchdogs>): Claude Code aborts it at the deadline and re-sends it at most once per model request, within the retry budget, then ends the turn with No response from API if that attempt goes unanswered too. When you set `CLAUDE_CODE_RETRY_WATCHDOG`, the one-retry cap doesn’t apply.
* A streaming response that the API’s output content filter stops before Claude has either finished thinking or started any text or tool call. Claude Code re-sends the request once, within the retry budget, and shows Output blocked by content filtering policy if the filter stops the second response too.
* Temporary 429 throttles, but not a gateway’s spend-limit `429`, which isn’t a throttle; see Spend limit reached.
* When you’re signed in with a claude.ai subscription, this includes 429 throttles that don’t carry your plan’s quota headers. Before v2.1.199, Claude Code retried those throttles only for API key and Enterprise sign-ins.
@@ -3985,6 +3986,7 @@
* Correct each entry the error names against the [tools available to subagents](</docs/en/sub-agents#available-tools>)
* Remove entries for tools the session doesn’t have, such as MCP tools from a server that isn’t connected
+ * If the entry names a connected MCP server, compare the entry with that server’s name as the server’s [tool names](</docs/en/permissions#mcp>) spell it, such as `reports__v2` in `mcp__reports__v2__get_totals`. For that server, write `mcp__reports__v2__*`, which is `mcp__` followed by the whole name and `__*`. With the shorter `mcp__reports`, which names a server called `reports`, the subagent gets none of the `reports__v2` tools
* For a tool that [background subagents drop](</docs/en/sub-agents#available-tools>), such as `CronCreate`, remove the entry. To keep the tool, [turn fork mode off](</docs/en/sub-agents#turn-fork-mode-on-or-off>) and ask Claude to run the subagent in the foreground
* Delete the `tools` field instead of listing tools to give the subagent every [tool available to subagents](</docs/en/sub-agents#available-tools>)
* For a `tools` list that contains only `Agent`, raise the [depth limit](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>) or give the agent at least one other tool: Claude Code withholds `Agent` at that limit, so a list with nothing else in it resolves to no tools
--- a/events.md
+++ b/events.md
@@ -186,7 +186,12 @@
return { decision: 'deny', reason: 'Push from a branch other than main' }
})
-On `main`, the hook returns `deny`, even when a rule allows `git push`. On another branch, and for other commands, the call gets the decision it would get without the mod. The hook matches the text of the command, so treat it as a reminder for Claude. To block pushes to `main` for everyone, protect the branch on your Git host. A hook can return `allow`, `ask`, or `deny`, so it can also approve a call that a `PreToolUse` hook outside managed settings blocked. [Extend permissions with hooks](</docs/en/permissions#extend-permissions-with-hooks>) lists which decisions hold over a mod.
+The hook denies `git push` on `main` and passes every other call through:
+
+ * **On`main`**: the hook returns `deny`, even when a rule allows `git push`
+ * **On another branch, and for other commands** : the call gets the decision it would get without the mod
+
+The hook matches the text of the command, so treat it as a reminder for Claude. To block pushes to `main` for everyone, protect the branch on your Git host. A hook can return `allow`, `ask`, or `deny`, so it can also approve a call that a `PreToolUse` hook outside managed settings blocked. In [plan mode](</docs/en/permissions#hook-approvals-in-plan-mode>), for a call that isn’t read-only, such as a file edit, your hook can tighten the decision `next(e)` returns but can’t loosen it. [Extend permissions with hooks](</docs/en/permissions#extend-permissions-with-hooks>) lists which decisions hold over a mod.
###
@@ -297,7 +302,7 @@
* **`PreToolUse` hooks from managed settings**: run before the first mod’s `tool.call` hook, and a block from one of them is final, so no mod sees the call.
* **`PreToolUse` hooks from every other settings file and from plugins’ `hooks/hooks.json`**: run after the last mod calls `next`, as part of Claude Code’s own behavior. A mod that answers `tool.call` without calling `next` keeps them from running, and a mod that calls `next` sees their decision in the result it returns.
-`tool.check` fires after those hooks and the permission rules have decided, so a hook on it can approve a call that a hook in the second group blocked.
+A `tool.check` hook can approve a call that a `PreToolUse` hook outside managed settings blocked, because `tool.check` fires after those hooks and the permission rules have decided. In plan mode, a `tool.check` hook can approve such a call when it’s read-only, but not a file edit or another call that isn’t read-only.
###
--- a/features-overview.md
+++ b/features-overview.md
@@ -160,7 +160,7 @@
---|---|---
**Runs**| A shell command, HTTP request, MCP tool call, LLM prompt, or subagent| Instructions Claude reads and follows
**Triggered by**| [Lifecycle events](</docs/en/hooks#hook-events>) such as `PostToolUse` or `SessionStart`| You typing `/<name>`, or Claude matching the description to your task
-**Determinism**| Always fires on its event; the trigger is guaranteed| Claude interprets the instructions; outcome can vary
+**Determinism**| Fires on its event without Claude deciding| Claude interprets the instructions; outcome can vary
**Context cost**| Zero unless the hook returns output| Description loads each session; full content loads when used
**Best for**| Linting after edits, blocking unsafe commands, logging, notifications| Workflows that need reasoning, reference material, multi-step tasks
--- a/gallery.md
+++ b/gallery.md
@@ -110,7 +110,7 @@
`Text`
-`Text` draws a string with the styles you give it. This sample shows one line for each style:
+`Text` draws a string with the styles you give it. This sample shows plain text and eight styles, one on each line:
Box({
flexDirection: 'column',
Show diff (136 lines)
--- a/hooks.md
+++ b/hooks.md
@@ -1,7 +1,7 @@
Hooks are callback functions that run your code in response to agent events, like a tool being called, a session starting, or execution stopping. With hooks, you can:
* **Block dangerous operations** before they execute, like destructive shell commands or unauthorized file access
- * **Log and audit** every tool call for compliance, debugging, or analytics
+ * **Log and audit** tool calls for compliance, debugging, or analytics
* **Transform inputs and outputs** to sanitize data, inject credentials, or redirect file paths
* **Require human approval** for sensitive actions like database writes or API calls
* **Track session lifecycle** to manage state, clean up resources, or send notifications
@@ -42,7 +42,7 @@
After performing any operations (logging, API calls, validation), your callback returns an output object that tells the agent what to do: allow the operation, block it, modify the input, or inject context into the conversation.
-The following example puts these steps together. It registers a `PreToolUse` hook (step 1) with a `"Write|Edit"` matcher (step 3) so the callback only fires for file-writing tools. When triggered, the callback receives the tool’s input (step 4), checks if the file path targets a `.env` file, and returns `permissionDecision: "deny"` to block the operation (step 5):
+This example registers a `PreToolUse` hook (step 1) with a `"Write|Edit"` matcher (step 3) so the callback fires for the Write and Edit tools. When triggered, the callback receives the tool’s input (step 4), checks if the file path targets a `.env` file, and returns `permissionDecision: "deny"` to block the operation (step 5):
Python
@@ -64,7 +64,7 @@
file_name = file_path.split("/")[-1]
# Block the operation if targeting a .env file
- if file_name == ".env":
+ if file_name.lower() == ".env":
return {
"hookSpecificOutput": {
"hookEventName": input_data["hook_event_name"],
@@ -107,7 +107,7 @@
const fileName = filePath?.split("/").pop();
// Block the operation if targeting a .env file
- if (fileName === ".env") {
+ if (fileName?.toLowerCase() === ".env") {
return {
hookSpecificOutput: {
hookEventName: preInput.hook_event_name,
@@ -137,7 +137,9 @@
}
}
-When you run either script, Claude attempts to create the `.env` file and the hook denies the tool call.
+The hook denies a Write or Edit call whose `file_path` ends in `/.env`, in any letter case. On Windows, `file_path` uses backslashes, such as `C:\project\.env`, and this hook allows a Write or Edit call to `C:\project\.env`.
+
+The `Write|Edit` matcher limits this hook to the Write and Edit tools. If Claude writes `.env` with a Bash command, the hook doesn’t run. To block Bash writes to a file where [the sandbox runs](</docs/en/sandboxing>), see the sandbox configuration for [Python](</docs/en/agent-sdk/python#sandbox-configuration>) or [TypeScript](</docs/en/agent-sdk/typescript#sandbox-configuration>).
##
@@ -150,7 +152,7 @@
Hook Event| Python SDK| TypeScript SDK| What triggers it| Example use case
---|---|---|---|---
`PreToolUse`| Yes| Yes| Tool call request (can block or modify)| Block dangerous shell commands
-`PostToolUse`| Yes| Yes| Tool execution result| Log all file changes to audit trail
+`PostToolUse`| Yes| Yes| Tool execution result| Log file changes to an audit trail
`PostToolUseFailure`| Yes| Yes| Tool execution failure| Handle or log tool errors
`PostToolBatch`| No| Yes| A full batch of tool calls resolves, once per batch before the next model call| Inject conventions once for the whole batch
[`UserPromptSubmit`](</docs/en/hooks#userpromptsubmit>)| Yes| Yes| A prompt is submitted, including a turn Claude Code starts on its own| Inject additional context into prompts
@@ -230,11 +232,11 @@
Option| Type| Default| Description
---|---|---|---
-`matcher`| `string`| `undefined`| Pattern matched against the event’s filter field, following the [rules for matchers in settings files](</docs/en/hooks#matcher-patterns>). For tool hooks, this is the tool name. Built-in tools include `Bash`, `Read`, `Write`, `Edit`, `Glob`, `Grep`, `WebFetch`, `Agent`, and others (see [Tool Input Types](</docs/en/agent-sdk/typescript#tool-input-types>) for the full list). MCP tools use the pattern `mcp__<server>__<action>`, where `<server>` is the key you use in the `mcpServers` configuration.
+`matcher`| `string`| `undefined`| Pattern matched against the event’s filter field, following the [rules for matchers in settings files](</docs/en/hooks#matcher-patterns>). For tool hooks, that field is the tool name. Built-in tools include `Bash`, `Read`, `Write`, `Edit`, `Glob`, `Grep`, `WebFetch`, `Agent`, and others. See [Tool Input Types](</docs/en/agent-sdk/typescript#tool-input-types>) for the full list. MCP tools use the pattern `mcp__<server>__<action>`, where `<server>` is the key you use in the `mcpServers` configuration, spelled as the [tool naming convention](</docs/en/agent-sdk/mcp#tool-naming-convention>) describes.
`hooks`| `HookCallback[]`| -| Required. Array of callback functions to execute when the pattern matches
`timeout`| `number`| `undefined`| Timeout in seconds. When omitted, Claude Code applies the event’s default timeout. Your SDK callbacks follow the `command` hook defaults
-Use the `matcher` pattern to target specific tools whenever possible. A matcher with `'Bash'` only runs for Bash commands, while omitting the pattern runs your callbacks for every occurrence of the event. Omit it on purpose to log every tool call your session makes.
+Use the `matcher` pattern to target specific tools whenever possible. A matcher with `'Bash'` only runs for Bash commands, while omitting the pattern runs your callbacks for every occurrence of the event.
###
@@ -272,7 +274,7 @@
Return `{}` to allow the operation without changes. SDK callback hooks use the same JSON output format as [Claude Code shell command hooks](</docs/en/hooks#json-output>), which documents every field and event-specific option. For the SDK type definitions, see the [TypeScript](</docs/en/agent-sdk/typescript#synchookjsonoutput>) and [Python](</docs/en/agent-sdk/python#synchookjsonoutput>) SDK references.
-When multiple hooks or permission rules apply, `deny` takes priority over `defer`, which takes priority over `ask`, which takes priority over `allow`. If any hook returns `deny`, the operation is blocked regardless of other hooks.
+When multiple `PreToolUse` hooks return different [decisions](</docs/en/hooks#pretooluse-decision-control>), `deny` takes priority over `defer`, which takes priority over `ask`, which takes priority over `allow`.
####
@@ -318,7 +320,7 @@
Modify tool input
-This example intercepts Write tool calls and rewrites the `file_path` argument to prepend `/sandbox`, redirecting all file writes to a sandboxed directory. The callback returns `updatedInput` with the modified path and `permissionDecision: 'allow'` to auto-approve the rewritten operation:
+This example intercepts Write tool calls and rewrites the `file_path` argument to prepend `/sandbox`. The callback returns `updatedInput` with the modified path and `permissionDecision: 'allow'` to auto-approve the rewritten operation:
Python
@@ -373,10 +375,10 @@
Add context and block a tool
-This example blocks writes to the `/etc` directory and explains why to both the model and the user:
+This example denies tool calls whose `file_path` starts with `/etc` and explains why to both the model and the user:
* `permissionDecision: 'deny'` stops the tool call.
- * `permissionDecisionReason` tells the model why, so it avoids retrying.
+ * `permissionDecisionReason` tells the model why.
* `systemMessage` shows the user what happened.
Python
@@ -471,7 +473,7 @@
Register multiple hooks
-When an event fires, all matching hooks run in parallel. For permission decisions, the most restrictive result applies: a single `deny` blocks the tool call regardless of what the other hooks return. Because completion order is non-deterministic, write each hook to act independently rather than relying on another hook having run first. The example below registers three independent checks for every tool call. The hook names in it, such as `audit_logger` in Python or `auditLogger` in TypeScript, stand in for callbacks you define:
+When an event fires, the matching hooks run in parallel. For permission decisions, the most restrictive result applies. One hook’s `deny` blocks the tool call. Because completion order is non-deterministic, write each hook to act independently rather than relying on another hook having run first. The example below registers three independent checks, each with an [omitted matcher](</docs/en/hooks#matcher-patterns>). The hook names in it, such as `audit_logger` in Python or `auditLogger` in TypeScript, stand in for callbacks you define:
Python
@@ -505,9 +507,9 @@
Use multi-tool matchers to share one callback across related tools. This example registers three matchers with different scopes, and each hook it names stands in for a callback you define:
- * A pipe-separated exact list (`Write|Edit|NotebookEdit`) triggers `file_security_hook` only for file modification tools.
+ * A pipe-separated exact list (`Write|Edit|NotebookEdit`) triggers `file_security_hook` for the Write, Edit, and NotebookEdit tools.
* A regex (`^mcp__`) triggers `mcp_audit_hook` for any MCP tool whose name starts with `mcp__`.
- * An omitted matcher triggers `global_logger` for every tool call regardless of name.
+ * An omitted matcher triggers `global_logger` without filtering by tool name.
Python
@@ -822,9 +824,9 @@
Claude Code runs each callback with a timeout, which you set in seconds with the `timeout` field on its `HookMatcher`. When you don’t set one, Claude Code uses the event’s default: 600 seconds for most events, 30 seconds for `UserPromptSubmit`, `PreModelSwitch`, and `PostModelSwitch`, and 10 seconds for `MessageDisplay`. Claude Code runs `SessionEnd` callbacks during shutdown under the shorter [SessionEnd timeout budget](</docs/en/hooks#sessionend-input>), 1.5 seconds by default. When a callback exceeds its timeout, Claude Code cancels it and discards its output, and the session continues rather than hanging. What happens next depends on the event:
- * `PreToolUse`: Claude Code doesn’t run the tool call, Claude receives a tool result stating the hook didn’t respond before its timeout, and the turn continues. If another `PreToolUse` hook returned an explicit deny, Claude receives that denial instead of the timeout error. Before v2.1.210, Claude Code reported the timeout to Claude as a user rejection, which made unattended sessions stop and wait for input.
+ * `PreToolUse`: Claude Code blocks the tool call. In its place, Claude receives a tool result saying the hook didn’t respond before its timeout, and the turn continues. Before v2.1.210, Claude Code reported the timeout to Claude as a user rejection, which made unattended sessions stop and wait for input.
* `PostToolUse` and `PostToolUseFailure`: Claude Code keeps the tool result and the turn continues.
- * `UserPromptSubmit` and [`UserPromptExpansion`](</docs/en/hooks#userpromptexpansion>): Claude Code blocks the prompt with a message naming the hook and the timeout, and the session continues. Because a callback on these events can act as a policy gate, Claude Code never lets a timed-out prompt through unscreened. Before v2.1.208, Claude Code ended the query with `error_during_execution` when a callback on these events timed out.
+ * `UserPromptSubmit` and [`UserPromptExpansion`](</docs/en/hooks#userpromptexpansion>): Claude Code blocks the prompt with a message naming the hook and the timeout, and the session continues. Before v2.1.208, Claude Code ended the query with `error_during_execution` when a callback on these events timed out.
* `Stop` and `SubagentStop`: the timed-out callback counts as returning no decision. The agent or subagent stops as if that callback had allowed it, and a decision from your other hooks on the event still applies. Before Claude Code v2.1.273, a timed-out `Stop` or `SubagentStop` callback counted as a failed hook run, and Claude Code discarded the decisions of your other hooks on the event.
* `SessionStart`: the timed-out callback counts as returning no output, and the session continues with the output of your other `SessionStart` hooks.
* `PreModelSwitch`: Claude Code blocks the model switch. A hook that doesn’t answer hasn’t approved the switch.
--- a/hooks-guide.md
+++ b/hooks-guide.md
@@ -561,7 +561,7 @@
* For a `PreToolUse` hook this doesn’t approve the tool call: the normal [permission flow](</docs/en/permissions>) still applies.
* For `UserPromptSubmit`, `UserPromptExpansion`, `SessionStart`, and `PostModelSwitch` hooks, Claude Code adds stdout it [treats as plain text](</docs/en/hooks#exit-code-0>) to Claude’s context.
* **Exit 2** : Claude Code blocks the action. Write a reason to stderr. Where it lands depends on the event: some events feed it to Claude as feedback so it can adjust, others show it to the user, and a few, such as `ConfigChange` and `Elicitation`, surface no message. Some events can’t be blocked: for `SessionStart` and others, exit 2 shows stderr to the user and execution continues. See [exit code 2 behavior per event](</docs/en/hooks#exit-code-2-behavior-per-event>) for the full list.
- * **Any other exit code** : for most events, the outcome depends on what your hook printed to stdout:
+ * **Any other exit code** : for most events, the action proceeds as a [non-blocking error](</docs/en/hooks#exit-code-output>), unless the hook is one [whose failure blocks the action](</docs/en/hooks#block-the-action-when-a-hook-fails>) or its JSON output passes validation:
* A parsed object that passes schema validation: Claude Code ignores the exit code, the JSON alone decides the outcome, and the hook isn’t reported as an error. The per-event exceptions, like `WorktreeCreate` failing on any nonzero exit, are listed in the reference’s [Exit code output](</docs/en/hooks#exit-code-output>) section.
* A parsed object that fails schema validation, or stdout that Claude Code [tries to parse as JSON](</docs/en/hooks#exit-code-0>) but that isn’t valid JSON: a non-blocking error; the notice carries the validation or parse message.
* Stdout that Claude Code [treats as plain text](</docs/en/hooks#exit-code-0>), or empty stdout: the action proceeds as a non-blocking error. The transcript shows a `<hook name> hook error` notice, then the first line of stderr prefixed with `Failed with non-blocking status code:`. To capture the full stderr, enable [debug logging](</docs/en/hooks#debug-hooks>) with `claude --debug` or by running `/debug` mid-session.
@@ -588,7 +588,11 @@
With `"deny"`, Claude Code cancels the tool call and feeds `permissionDecisionReason` back to Claude. On `PreToolUse`, Claude Code handles each `permissionDecision` value as follows:
- * `"allow"`: skip the interactive permission prompt. Deny and ask rules, including enterprise managed deny lists, still apply, as do prompts for reads from [network paths](</docs/en/permissions#network-paths>), for MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), and for connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code
+ * `"allow"`: skip the interactive permission prompt. Deny and ask rules, including enterprise managed deny lists, still apply, as do prompts for:
+ * Reads from [network paths](</docs/en/permissions#network-paths>)
+ * MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>)
+ * Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code
+For what `"allow"` does in plan mode, see [Hook approvals in plan mode](</docs/en/permissions#hook-approvals-in-plan-mode>).
* `"deny"`: cancel the tool call and send the reason to Claude
* `"ask"`: show the permission prompt to the user as normal
@@ -897,7 +901,13 @@
Hooks and permission modes
-`PreToolUse` hooks fire before any permission-mode check, in every [permission mode](</docs/en/permission-modes>), including `dontAsk`. A hook that returns `permissionDecision: "deny"` blocks the tool even in `bypassPermissions` mode or with `--dangerously-skip-permissions`. This lets you enforce policy that users can’t bypass by changing their permission mode. The reverse is not true: a hook returning `"allow"` doesn’t bypass deny rules from settings, and it can’t suppress the prompt for reads from [network paths](</docs/en/permissions#network-paths>), for MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), or for connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code. Hooks in settings files and in a plugin’s `hooks/hooks.json` can tighten restrictions but not loosen them past what permission rules allow. A [mod](</docs/en/plugins/mods/overview>) you install that handles `tool.check` can approve a call that your `PreToolUse` hook blocked, unless the hook is in managed settings. [Extend permissions with hooks](</docs/en/permissions#extend-permissions-with-hooks>) lists which rules hold over a mod.
+`PreToolUse` hooks fire before any permission-mode check, in every [permission mode](</docs/en/permission-modes>), including `dontAsk`. A hook that returns `permissionDecision: "deny"` blocks the tool even in `bypassPermissions` mode or with `--dangerously-skip-permissions`. This lets you enforce policy that users can’t bypass by changing their permission mode. The reverse is not true: hooks in settings files and in a plugin’s `hooks/hooks.json` can tighten restrictions but not loosen them past what permission rules allow. A hook returning `"allow"` doesn’t bypass deny rules from settings, and it can’t suppress the prompt for:
+
+ * Reads from [network paths](</docs/en/permissions#network-paths>)
+ * MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>)
+ * Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code
+
+In [plan mode](</docs/en/permissions#hook-approvals-in-plan-mode>), if your `PreToolUse` hook returns `"allow"` for a file edit, you get the same prompt, block, or approval the edit would get with no hook. To lift this limit on hook approvals, [approve the plan](</docs/en/permission-modes#review-and-approve-a-plan>) or switch to another permission mode. A [mod](</docs/en/plugins/mods/overview>) you install that handles `tool.check` can approve a call that your `PreToolUse` hook blocked, unless the hook is in managed settings. In plan mode, the mod can approve such a call when it’s read-only, but not a file edit or another call that isn’t read-only. [Extend permissions with hooks](</docs/en/permissions#extend-permissions-with-hooks>) lists which rules hold over a mod.
###
@@ -926,6 +936,7 @@
* If you see “command not found”, use absolute paths or `${CLAUDE_PROJECT_DIR}` to reference scripts. To avoid shell quoting entirely, add `"args": []` to switch to [exec form](</docs/en/hooks#exec-form-and-shell-form>), which spawns the script directly without a shell
* If you see “jq: command not found”, install `jq` or use Python/Node.js for JSON parsing
+ * If the message includes `blocking because Git Bash wasn't found`, you’re on Windows, Claude Code didn’t find Git Bash, and the failed or timed-out hook blocked the tool call. See [Failed hooks on Windows without Git Bash](</docs/en/hooks#failed-hooks-on-windows-without-git-bash>) for the fixes
* If the notice shows a JSON validation message, your hook’s stdout parsed as JSON but failed schema validation. If it shows a JSON parse message, the stdout looked like a JSON object but wasn’t valid JSON. Both happen even on exit 0. To fix a parse failure, build the payload with a JSON encoder such as `jq` instead of string concatenation, so quotes and backslashes inside values are escaped. The reference’s [Exit code output](</docs/en/hooks#exit-code-output>) section covers the exit-code and JSON combinations
* If the script isn’t running at all, make it executable: `chmod +x ./my-hook.sh`
--- a/interface.md
+++ b/interface.md
@@ -375,8 +375,8 @@
Element| What it draws| Where
---|---|---
-`Box`| A flex container. Takes layout props such as `flexDirection`, `columnGap`, `padding`, [`borderStyle`](</docs/en/plugins/mods/reference#box-border-styles>), and `width`.| Everywhere
-`Text`| Styled text. Takes `color`, `bold`, `dimColor`, `italic`, and `wrap`. A `color` is a theme key or a color such as `'red'`. A `wrap` is `'wrap'`, `'truncate'`, `'truncate-start'`, `'truncate-middle'`, or `'truncate-end'`.| Everywhere
+`Box`| A flex container that takes layout props such as `flexDirection`, [`borderStyle`](</docs/en/plugins/mods/reference#box-border-styles>), and `width`. Spacing props such as `columnGap` and `padding` take a number or a [step name](</docs/en/plugins/mods/reference#box-spacing-steps>) from `'xs'` to `'xl'`.| Everywhere
+`Text`| Styled text. Takes `color`, `bold`, `dimColor`, `italic`, `wrap`, and others such as [`weight`](</docs/en/plugins/mods/reference#text-typography>). A `color` is a theme key or a color such as `'red'`. A `wrap` is `'wrap'`, `'truncate'`, `'truncate-start'`, `'truncate-middle'`, or `'truncate-end'`.| Everywhere
`Button`| A control that calls `onPress`| Everywhere
`Link`, `Code`, `Markdown`| A link with `href` and an optional `label`, a code block, and text formatted the way Claude’s replies are. `Markdown` takes its content in a `text` prop, not in `children`, and needs a `key` when you pass `onLinkPress`.| Everywhere
`Input`, `Select`| A text field and a dropdown| Terminal, Desktop, VS Code
--- a/large-codebases.md
+++ b/large-codebases.md
@@ -191,7 +191,7 @@
If the install fails, match the message Claude Code reports:
* `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.
- * The plugin is [not found in the marketplace](</docs/en/plugins/install#install-a-plugin>): check the plugin name.
+ * `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](</docs/en/plugins/troubleshooting#plugin-not-found-in-marketplace>).
To enable a plugin for everyone in the repository rather than installing it yourself, add it to the [`enabledPlugins` project setting](</docs/en/settings-reference#plugin-settings>). Code intelligence plugins require the language’s language server binary on each developer’s machine. See [which binary each language requires](</docs/en/plugins/code-intelligence>). Installing from the official marketplace requires network access to GitHub, where the marketplace is hosted. On a restricted network, [add the marketplace from an internal Git host or local path](</docs/en/plugins/install#add-a-marketplace>) instead. This pairs well with `claudeMdExcludes` and the `Read` deny rules above. Those keep irrelevant content out of context, and code intelligence keeps Claude from reading through what remains to locate a definition.
--- a/mcp.md
+++ b/mcp.md
@@ -178,7 +178,14 @@
Tool naming convention
-MCP tools follow the naming pattern `mcp__<server-name>__<tool-name>`. For example, a GitHub server named `"github"` with a `list_issues` tool becomes `mcp__github__list_issues`.
+MCP tools are named `mcp__<server-name>__<tool-name>`, where `<server-name>` is the name you register the server under, such as its key in `mcpServers`. Characters in the server name such as `.` and spaces are replaced by `_`. This table shows the full name of a `list_issues` tool for two server keys:
+
+Key in `mcpServers`| Full tool name
+---|---
+`github`| `mcp__github__list_issues`
+`my.server`| `mcp__my_server__list_issues`
+
+Use the full tool names in `allowedTools` and in [MCP permission rules](</docs/en/permissions#mcp>). For a server that a [plugin](</docs/en/agent-sdk/plugins>) provides, `<server-name>` takes the [plugin-scoped form](</docs/en/mcp#plugin-provided-mcp-servers>) and starts with `plugin_`.
###
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -684,7 +684,7 @@
Incremented after each API request. **Attributes** :
* All standard attributes
- * `type`: (`"input"`, `"output"`, `"cacheRead"`, `"cacheCreation"`). The `"input"` type excludes tokens read from or written to the prompt cache, which are counted under `"cacheRead"` and `"cacheCreation"`
+ * `type`: (`"input"`, `"output"`, `"cacheRead"`, `"cacheCreation"`). The `"input"` type excludes tokens read from or written to the prompt cache, which are counted under `"cacheRead"` and `"cacheCreation"`. The `"cacheCreation"` type counts cache writes with the five-minute and one-hour [cache lifetimes](</docs/en/prompt-caching#cache-lifetime>) together.
* `model`: Model identifier (for example, “claude-sonnet-5”)
* `query_source`: Category of the subsystem that issued the request. One of `"main"`, `"subagent"`, or `"auxiliary"`
* `speed`: `"fast"` when the request used fast mode. Absent otherwise
@@ -981,7 +981,7 @@
* `event.sequence`: per-process counter for ordering events, described under Event correlation attributes
* `from_mode`: The previous permission mode, for example `"default"`, `"plan"`, `"acceptEdits"`, `"auto"`, or `"bypassPermissions"`
* `to_mode`: The new permission mode
- * `trigger`: What caused the change. One of `"shift_tab"`, `"exit_plan_mode"`, `"auto_gate_denied"`, or `"auto_opt_in"`. Absent when the transition originates from the SDK or bridge
+ * `trigger`: What caused the change. One of `"shift_tab"`, `"exit_plan_mode"`, `"auto_gate_denied"`, or `"auto_opt_in"`. Absent for some changes, such as when the SDK sets the permission mode through [`setPermissionMode()`](</docs/en/agent-sdk/typescript#query-object>)
####
--- a/network-config.md
+++ b/network-config.md
@@ -163,14 +163,17 @@
Streaming idle watchdogs
-Claude Code runs four independent timers that abort a streaming model response when it goes quiet, so a dead connection fails and retries instead of hanging. The first-byte deadline covers the wait for response headers, before any of the response has arrived. Each of the other three watches a live response for a different signal.
+Claude Code runs four independent timers that abort a streaming model response when it goes quiet, so a dead connection fails and retries instead of hanging. A request that gets no response headers at all ends in one of two ways:
+
+ * **Where the first-byte deadline runs** : the first attempt ends at that deadline. To change it, set `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`. For the retry’s wait, see [No response from API](</docs/en/errors#no-response-from-api>).
+ * **On the other connections** : the request ends after 5 to 6 minutes, when the body idle timeout fires, unless you turned that timeout off. To end it sooner, lower `API_TIMEOUT_MS`.
Timer| Aborts when| Runs on| Default timeout
---|---|---|---
-First-byte deadline| No response headers arrive after Claude Code sends the request| Direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), including through an HTTPS proxy, but not when `ANTHROPIC_BASE_URL` or `ANTHROPIC_AWS_BASE_URL` routes them through a [gateway](</docs/en/gateways>). Opt-in on Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry| 180 seconds on the direct Anthropic API, 300 seconds elsewhere, plus one second per 32KB of request body
+First-byte deadline| No response headers arrive after Claude Code sends the request| Direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), including through an HTTPS proxy, but not when `ANTHROPIC_BASE_URL` or `ANTHROPIC_AWS_BASE_URL` routes them through a [gateway](</docs/en/gateways>). Opt-in on Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry, or in a [Claude apps gateway](</docs/en/claude-apps-gateway>) session| 180 seconds on the direct Anthropic API, 300 seconds elsewhere, plus one second per 32KB of request body
Event-level watchdog| No response events parse. Where the byte-level watchdog runs on a connection other than Amazon Bedrock, arriving bytes, including keep-alive pings, also reset this watchdog, for up to about five minutes without a parsed event| Every provider| 300 seconds
Byte-level watchdog| No bytes arrive on the wire, including SSE keep-alive pings| Direct Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and [gateway](</docs/en/gateways>) connections, including a custom `ANTHROPIC_BASE_URL`. Opt-in on Amazon Bedrock `vnd.amazon.eventstream` responses with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry| 180 seconds on the direct Anthropic API. 300 seconds on Claude Platform on AWS, on Amazon Bedrock, in a [Claude apps gateway](</docs/en/claude-apps-gateway>) session, and through a custom `ANTHROPIC_BASE_URL`
-Body idle timeout| No bytes arrive for 5 minutes| Providers other than the direct Anthropic API, Claude Platform on AWS, and Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` set, unless [`API_FORCE_IDLE_TIMEOUT`](</docs/en/env-vars>) changes that| 5 minutes
+Body idle timeout| No bytes arrive for 5 minutes, counting the wait for response headers| Providers other than the direct Anthropic API, Claude Platform on AWS, and Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` set, unless [`API_FORCE_IDLE_TIMEOUT`](</docs/en/env-vars>) changes that| 5 minutes
If you set `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`, the byte-level watchdog replaces the body idle timeout on Bedrock rather than running alongside it. `CLAUDE_STREAM_IDLE_TIMEOUT_MS` then also governs how long a Bedrock stream may stay silent before Claude Code treats the connection as dead, within the limits listed below. Arriving bytes still don’t reset the event-level watchdog on Bedrock. With debug logging on, each Bedrock stream then logs a debug message that starts with `wire-heartbeat: _chunkTimes absent`. Configure the timers with these variables, each detailed in the [environment variables reference](</docs/en/env-vars>):
@@ -178,6 +181,7 @@
* `CLAUDE_STREAM_IDLE_TIMEOUT_MS` sets both watchdogs’ timeout. Claude Code raises values below 5 minutes to 5 minutes, and caps the value at 30 minutes for the byte-level watchdog.
* `CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS` sets the byte-level watchdog’s timeout without changing the event-level watchdog’s, clamped to between 10 seconds and 30 minutes, and takes precedence over `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for that watchdog.
* `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` sets the first-byte deadline directly. Leave it unset and Claude Code uses the byte-level watchdog’s timeout, so `CLAUDE_STREAM_IDLE_TIMEOUT_MS` and `CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS` change the deadline too. For the clamps, the upload allowance, the `API_TIMEOUT_MS` cap, and how long the retry waits after a no-response abort, see [No response from API](</docs/en/errors#no-response-from-api>).
+ * `API_TIMEOUT_MS` limits the wait for response headers. Where the first-byte deadline doesn’t run, such as a Claude apps gateway session, set it below `300000`, which is 5 minutes, to retry an unanswered request sooner. Keep it above the longest wait for headers, and the longest [non-streaming request](</docs/en/errors#streaming-response-ended-before-any-complete-data-was-received>), that you expect: a request that needs longer times out again on each retry.
* `API_FORCE_IDLE_TIMEOUT` set to `0` turns the body idle timeout off, and set to `1` turns it on for every provider. The watchdogs run independently of it, so to let a stream pause longer than their thresholds, also raise or disable them.
When a watchdog aborts a stalled stream, Claude Code treats the abort as a mid-stream failure, and what you see depends on how far the response had got. Claude Code retries the request or ends the turn with an error, keeps the completed output and shows an [incomplete-response notice](</docs/en/errors#the-response-above-may-be-incomplete>), or ends the turn normally. [Automatic retries](</docs/en/errors#automatic-retries>) says where each outcome applies. In a [non-interactive session](</docs/en/headless>), and for a subagent’s response in any session, Claude Code may first prompt Claude to continue the cut-off response; [that notice’s entry](</docs/en/errors#the-response-above-may-be-incomplete>) says when it does and when you still see the notice. When the first-byte deadline fires, no response has started, so there is no partial output to keep. For how Claude Code re-sends the request and when the turn ends instead, see [No response from API](</docs/en/errors#no-response-from-api>).
--- a/permission-modes.md
+++ b/permission-modes.md
@@ -505,9 +505,11 @@
In [non-interactive mode](</docs/en/headless>) no dialog is shown. A [background session](</docs/en/agent-view>) honors your acceptance when it’s recorded in user or managed settings:
* With no acceptance recorded, `claude --bg --permission-mode bypassPermissions` is refused until you accept the dialog in an interactive session.
- * With `skipDangerousModePermissionPrompt` set only in `.claude/settings.local.json`, the background session starts with the bypass request ignored and pins the notice `Bypass permissions was requested at launch and ignored · if that was you, ~/.claude/settings.json needs "skipDangerousModePermissionPrompt": true`. To get bypass honored, add that key to `~/.claude/settings.json`, then start a new background session.
-
-On Linux and macOS, Claude Code refuses to start in this mode when running as root or under `sudo`:
+ * With `skipDangerousModePermissionPrompt` set only in `.claude/settings.local.json`, the background session starts with the bypass request ignored and pins the notice `Bypass permissions was requested at launch and ignored · if that was you, ~/.claude/settings.json needs "skipDangerousModePermissionPrompt": true`. Add that key to `~/.claude/settings.json`, then start a new background session. The session showing the notice still runs:
+ * With `--allow-dangerously-skip-permissions` ignored, `bypassPermissions` is left out of its `Shift+Tab` cycle.
+ * With `--permission-mode bypassPermissions` or `--dangerously-skip-permissions` ignored, the session starts in Manual mode instead.
+
+On Linux and macOS, Claude Code refuses to start in `bypassPermissions` mode when running as root or under `sudo`:
--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons
@@ -554,6 +556,7 @@
* Markdown files in the project’s [auto memory](</docs/en/memory#storage-location>) directory, such as `~/.claude/projects/<project>/memory/`, in a session started without `--restricted`
* Markdown files in a [subagent memory](</docs/en/sub-agents#enable-persistent-memory>) directory, such as `.claude/agent-memory/`, in a session started without `--restricted`
* A directory you loaded with [`--plugin-dir`](</docs/en/plugins/mods/create#change-a-mod-with-claude>), because Claude Code reloads and runs a mod’s code from it when a file changes
+ * `~/.claude/dev-mods/`, or `dev-mods/` in the directory [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>) points to, where Claude saves the [mods it writes for you](</docs/en/plugins/mods/create#ask-claude-for-a-mod>)
Protected files:
--- a/permissions.md
+++ b/permissions.md
@@ -12,7 +12,7 @@
Hooks
-Run [hooks](</docs/en/agent-sdk/hooks>) first. A hook can deny the call outright or pass it on. A hook that returns `allow` does not skip the deny and ask rules below; those are evaluated regardless of the hook result. A `PreToolUse` hook allow also can’t approve an `rm` or `rmdir` removal targeting a [critical path](</docs/en/permission-modes#critical-paths>).
+Run [hooks](</docs/en/agent-sdk/hooks>) first. A hook can deny the call outright or pass it on. A hook that returns `allow` does not skip the deny and ask rules below; those are evaluated regardless of the hook result. A `PreToolUse` hook that returns `allow` also can’t approve an `rm` or `rmdir` removal targeting a [critical path](</docs/en/permission-modes#critical-paths>). For what that `allow` does in plan mode, see [Hook approvals in plan mode](</docs/en/permissions#hook-approvals-in-plan-mode>).
2
@@ -135,7 +135,7 @@
* During streaming
-Pass `permission_mode` (Python) or `permissionMode` (TypeScript) when creating a query. This mode applies for the entire session unless changed dynamically.
+Pass `permission_mode` (Python) or `permissionMode` (TypeScript) when creating a query.
Python
@@ -276,7 +276,20 @@
Plan mode (`plan`)
-Claude explores the codebase and produces a plan without editing your source files. Read-only tools run as they do in the `default` permission mode. File edits are never auto-approved in plan mode, even when an allow rule matches. They prompt through your `canUseTool` callback instead. On Claude Code v2.1.212 or later, shell commands that modify files, such as `touch` and `rm`, reach your `canUseTool` callback the same way. In the TypeScript SDK, if you set `allowDangerouslySkipPermissions: true` alongside `permissionMode: 'plan'`, file edits and shell commands that modify files still reach your `canUseTool` callback. The option lets you switch to `bypassPermissions` later with `setPermissionMode()`. Claude may use `AskUserQuestion` to clarify requirements before finalizing the plan. See [Handle approvals and user input](</docs/en/agent-sdk/user-input#handle-clarifying-questions>) for handling these prompts. **Use when:** you want Claude to propose changes without executing them, such as during code review or when you need to approve changes before they’re made.
+Claude explores the codebase and produces a plan without editing your source files. Read-only tools run as they do in the `default` permission mode. File edits are never auto-approved in plan mode, even when an allow rule matches or a `PreToolUse` hook returns `allow`. They prompt through your `canUseTool` callback instead. On Claude Code v2.1.212 or later, shell commands that modify files, such as `touch` and `rm`, reach your `canUseTool` callback the same way. In the TypeScript SDK, if you set `allowDangerouslySkipPermissions: true` alongside `permissionMode: 'plan'`, file edits and shell commands that modify files still reach your `canUseTool` callback. The option lets you switch to `bypassPermissions` later with `setPermissionMode()`. Claude may use `AskUserQuestion` to clarify requirements before finalizing the plan. See [Handle approvals and user input](</docs/en/agent-sdk/user-input#handle-clarifying-questions>) for handling these prompts. **Use when:** you want Claude to propose changes without executing them, such as during code review or when you need to approve changes before they’re made.
+
+####
+
+
+
+Auto mode (`auto`)
+
+A classifier model reviews actions such as shell commands and network requests before they run, and allows or blocks each one it reviews. For the models and providers auto mode requires and the order it evaluates actions in, see [Eliminate permission prompts with auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). If you switch a session that’s in auto mode to a model that auto mode doesn’t support, using [`set_model()`](</docs/en/agent-sdk/python#claudesdkclient>), [`setModel()`](</docs/en/agent-sdk/typescript#query-object>), or [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>), the session changes to `default` mode:
+
+ * **What you see** : a `system` message with subtype `status` and `permissionMode` set to `"default"`, which the TypeScript SDK types as [`SDKStatusMessage`](</docs/en/agent-sdk/typescript#sdkstatusmessage>). From then on, calls that need approval and match no allow rule reach your `canUseTool` callback.
+ * **To return to auto mode** : switch to a supported model, then call `set_permission_mode("auto")` or `setPermissionMode("auto")`. If you switch the model back without making that call, the session stays in `default` mode. While the unsupported model is active, the call fails with `Cannot set permission mode to auto: auto mode unavailable for this model`.
+
+The change to `default` mode after a `set_model()`, `setModel()`, or `applyFlagSettings()` call requires Claude Code v2.1.299 or later.
##
--- a/prompt-caching.md
+++ b/prompt-caching.md
@@ -175,7 +175,7 @@
Compacting the conversation
-[Compaction](</docs/en/context-window#what-survives-compaction>) replaces your message history with a summary. By design, this invalidates the conversation layer, since the next request has a new, shorter history that doesn’t share a prefix with the old one. Claude Code reuses the system prompt layer unless the conversation was resumed while keeping a system prompt that would otherwise have changed; in that case the first compaction switches to the current prompt and that layer rebuilds once. It reloads project context from disk, which cache-hits only if CLAUDE.md and memory are unchanged since the session started. To produce the summary, Claude Code sends a separate request with the same system prompt, tools, and history as your conversation, plus a summarization instruction appended as a final user message. While the cache is warm, that request reads your prefix from the cache, so a mid-session `/compact` costs a fraction of what the context size suggests and spends most of its time generating the summary. After a break longer than the cache lifetime, there is no cache left to read, so the summarization request reprocesses the full history as uncached input. This is why `/compact` costs the most when you [resume an old session](</docs/en/sessions#resume-from-a-summary>). In both the warm and cold cases, the turn after compaction rebuilds the conversation cache for only the much shorter summary, so that turn is not the slow part.
+[Compaction](</docs/en/context-window#what-survives-compaction>) replaces your message history with a summary. By design, this invalidates the conversation layer, since the next request has a new, shorter history that doesn’t share a prefix with the old one. Claude Code reuses the system prompt layer unless the conversation was resumed while keeping a system prompt that would otherwise have changed; in that case the first compaction switches to the current prompt and that layer rebuilds once. It reloads project context from disk, which cache-hits only if CLAUDE.md and memory are unchanged since the session started. To produce the summary, Claude Code sends a separate request with the same system prompt, tools, and history as your conversation, plus a summarization instruction appended as a final user message. While the cache is warm, that request reads your prefix from the cache, so a mid-session `/compact` costs a fraction of what the context size suggests and spends most of its time generating the summary. After a break longer than the cache lifetime, there is no cache left to read, so the summarization request reprocesses the full history as uncached input. This is why `/compact` costs the most when you [resume an old session](</docs/en/sessions#resume-a-session>). In both the warm and cold cases, the turn after compaction rebuilds the conversation cache for only the much shorter summary, so that turn is not the slow part.
Compaction works in your favor when the context you discard is content you no longer need. To choose when its overhead happens, run `/compact` at a natural break in your work, such as between tasks, instead of waiting for auto-compaction to trigger mid-task. If you’ve gone down a path you want to abandon entirely, `/rewind` to an earlier turn instead. Rewinding truncates back to a prefix that is already cached, rather than building a new one as compaction does.
@@ -286,7 +286,7 @@
Cache lifetime
-Cached prefixes expire after a period of inactivity. Each request that hits the cache resets the timer, so the cache stays warm as long as you keep working. After a long enough gap, the next request recomputes the full input and re-establishes the cache, which is why the first turn back after stepping away can be noticeably slower. On a Pro or Max plan, when you resume a large session after a long break, Claude Code [offers to resume from a summary](</docs/en/sessions#resume-from-a-summary>) so later requests don’t carry the full history. The time to live (TTL) controls how long a gap the cache survives. The API offers two: a five-minute TTL, and a [one-hour TTL](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#1-hour-cache-duration>) that keeps the cache warm through longer breaks but [charges a higher rate for cache writes](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing>). The longer TTL helps when you leave a session idle and come back to it, because you skip the reprocessing an expired prefix costs. It costs more on short bursts of work that never idle past five minutes, where the higher write rate applies and the longer cache lifetime goes unused.
+Cached prefixes expire after a period of inactivity. Each request that hits the cache resets the timer, so the cache stays warm as long as you keep working. After a long enough gap, the next request recomputes the full input and re-establishes the cache, which is why the first turn back after stepping away can be noticeably slower. The time to live (TTL) controls how long a gap the cache survives. The API offers two: a five-minute TTL, and a [one-hour TTL](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#1-hour-cache-duration>) that keeps the cache warm through longer breaks but [charges a higher rate for cache writes](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing>). The longer TTL helps when you leave a session idle and come back to it, because you skip the reprocessing an expired prefix costs. It costs more on short bursts of work that never idle past five minutes, where the higher write rate applies and the longer cache lifetime goes unused.
###
--- a/python.md
+++ b/python.md
@@ -619,7 +619,7 @@
`receive_response()`| Receive messages until and including a ResultMessage
`interrupt()`| Send interrupt signal (only works in streaming mode)
`set_permission_mode(mode)`| Change the permission mode for the current session
-`set_model(model)`| Change the model for the current session. Pass `None` to reset to [Claude Code’s default model](</docs/en/model-config>)
+`set_model(model)`| Change the model for the current session. Pass `None` to reset to [Claude Code’s default model](</docs/en/model-config>). A session in `auto` mode [changes to `default` mode](</docs/en/agent-sdk/permissions#auto-mode-auto>) if the new model doesn’t support auto mode
`rewind_files(user_message_id)`| Restore files to their state at the specified user message. Requires `enable_file_checkpointing=True`. See [File checkpointing](</docs/en/agent-sdk/file-checkpointing>)
`get_mcp_status()`| Get the status of all configured MCP servers. Returns `McpStatusResponse`
`get_context_usage()`| Get a breakdown of context window usage by category, skill, and tool. The same data `/context` shows in an interactive session. Returns `ContextUsageResponse`. To compute the breakdown, Claude Code makes several token-counting API requests that don’t appear in the message stream; see how these requests are handled
@@ -3687,7 +3687,9 @@
`ignoreViolations`| `SandboxIgnoreViolations`| `None`| Configure which sandbox violations to ignore
`enableWeakerNestedSandbox`| `bool`| `False`| Enable a weaker nested sandbox for compatibility
-The sandbox depends on platform support and, on Linux, tools like `bubblewrap` and `socat`. By default, when `enabled` is `True` but the sandbox can’t start, commands run unsandboxed with a warning on stderr. This default differs from the TypeScript SDK, where `failIfUnavailable` defaults to `true`.Set `"failIfUnavailable": True` in your sandbox settings to stop instead. The key isn’t declared on `SandboxSettings` yet, but the SDK forwards it to Claude Code, which honors it. `query()` then reports a `ResultMessage` with `subtype="error_during_execution"` and the reason in `errors`. Because this is a single-shot `query()` call, the SDK raises after yielding that error result, so wrap the loop in a try block to continue past it. See [Handle the result](</docs/en/agent-sdk/agent-loop#handle-the-result>) for the error contract.
+The sandbox depends on platform support and, on Linux, tools like `bubblewrap` and `socat`. By default, when `enabled` is `True` but the sandbox can’t start, commands run unsandboxed with a warning on stderr. This default differs from the TypeScript SDK, where `failIfUnavailable` defaults to `true`.Set `"failIfUnavailable": True` in your sandbox settings to stop instead. The SDK forwards `failIfUnavailable` to Claude Code along with the declared `SandboxSettings` fields. `query()` then reports a `ResultMessage` with `subtype="error_during_execution"` and the reason in `errors`. Because this is a single-shot `query()` call, the SDK raises after yielding that error result, so wrap the loop in a try block to continue past it. See [Handle the result](</docs/en/agent-sdk/agent-loop#handle-the-result>) for the error contract.
+
+To keep sandboxed commands from writing to a file, list its absolute path under [`denyWrite`](</docs/en/settings-reference#sandbox-filesystem-denywrite>) in your sandbox settings, such as `"filesystem": {"denyWrite": ["/home/user/project/.env"]}`. The SDK forwards `filesystem` to Claude Code along with the declared `SandboxSettings` fields. Once the sandbox starts, it blocks writes to each absolute path you listed.
####
--- a/reference.md
+++ b/reference.md
@@ -314,7 +314,7 @@
Element| Main props| Terminal| Desktop| VS Code
---|---|---|---|---
[`Box`](</docs/en/plugins/mods/interface#build-a-tree-from-elements>)| `key`, flex layout, `gap`, `padding`, `margin`, `width`, `height`, `borderStyle`, `backgroundColor`, `position`, `hover`| ✓| ✓| ✓
-[`Text`](</docs/en/plugins/mods/interface#build-a-tree-from-elements>)| `color`, `backgroundColor`, `bold`, `italic`, `underline`, `dimColor`, `inverse`, `wrap`| ✓| ✓| ✓
+[`Text`](</docs/en/plugins/mods/interface#build-a-tree-from-elements>)| `color`, `backgroundColor`, `bold`, `italic`, `underline`, `dimColor`, `inverse`, `wrap`, `size`, `weight`, `mono`, `tabular`| ✓| ✓| ✓
[`Button`](</docs/en/plugins/mods/interface#respond-to-presses-and-typing>)| `key`, `label`, `onPress`, `hotkey`, `plain`, `dimColor`, `autoFocus`, `action`| ✓| ✓| ✓
[`Link`](</docs/en/plugins/mods/interface#link-in-the-desktop-app>)| `href`, `label`. See Limits.| ✓| ✓| ✓
[`Code`](</docs/en/plugins/mods/gallery#show-code-and-changes>)| `source`, `language`, `path`, `startLine`, `format`, `wrap`| ✓| ✓| ✓
@@ -329,6 +329,7 @@
More `Button` rules: `action` names one of Claude Code’s own [keybinding actions](</docs/en/keybindings>), and the user’s binding for it presses the button when that binding is a chord or a modified key. A digit `hotkey` on a button in the band also fires when the user types that digit alone into an empty prompt and pauses. When two buttons in one drawing name the same `hotkey`, the later one gets it. `autoFocus` accepts only `true` on any control, so omit the prop to leave it off. The VS Code extension ignores some element props and draws the element as if you had left them out:
* **`Box`** : `position` and `hover`
+ * **`Text`** : `size`, `mono`, and `tabular`
* **`Button`** : `hotkey`, `plain`, `autoFocus`, and `action`, so the user presses a button there with a click, or with Enter once it has focus
* **`Code`** : `language`, `path`, `startLine`, `format`, and `wrap`, so code draws without colors or line numbers, and a `format: 'diff'` block shows the diff’s raw text
* **`Input` and `Select`**: `autoFocus`
@@ -355,6 +356,49 @@
`'quote'`| A bar, `▎`, down the left side and blank cells on the other three sides| Blank
A `Box` whose `borderStyle` names anything else, such as `'rounded'`, draws with no border.
+
+###
+
+
+
+`Box` spacing steps
+
+The `Box` spacing props are `gap`, `columnGap`, `rowGap`, `padding`, `margin`, and the one-side and one-axis forms of `padding` and `margin`, such as `paddingX` and `marginTop`. Each takes a number of terminal cells such as `gap: 1`, or a step name such as `gap: 'md'`. In the terminal and the VS Code extension, each step is this many cells:
+
+Step| Cells across| Cells down
+---|---|---
+`'xs'`| 1| 0
+`'sm'`| 1| 0
+`'md'`| 2| 1
+`'lg'`| 3| 1
+`'xl'`| 4| 2
+
+If you set `gap`, `padding`, or `margin` to a step, the step applies across and down at once. For example, in the terminal and the VS Code extension, `padding: 'md'` is two cells at each side and one row above and below. Step names require Claude Code v2.1.299 or later. On an earlier release, Claude Code [draws its own version of the site](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) in place of a tree that uses a step name.
+
+###
+
+
+
+`Text` typography props
+
+Set `size`, `weight`, `mono`, or `tabular` on a `Text` to ask the app drawing your tree for a text size, a weight, a monospaced typeface, or equal-width digits. Before you rely on a prop, check what the terminal and the VS Code extension do with it. If an app ignores a prop you set, your tree still draws there, with the text as if you’d left that prop out.
+
+Prop| Values| In the terminal| In the VS Code extension
+---|---|---|---
+`size`| `'caption'`, `'footnote'`, `'body'`, `'heading'`, or `'title'`| Ignored: the terminal has one text size| Ignored
+`weight`| `'regular'`, `'medium'`, `'semibold'`, or `'bold'`| `semibold` and `bold` draw as bold text| `semibold` and `bold` draw as bold text
+`mono`| `true` to ask for the app’s monospaced typeface| Ignored: the terminal is always monospaced| Ignored, so text keeps the extension’s own typeface
+`tabular`| `true` to ask for digits of equal width, so that a number that updates in place or a column of numbers stays aligned| Ignored: the terminal’s digits are already one cell wide| Ignored
+
+These four props require Claude Code v2.1.299 or later. On an earlier release, Claude Code [draws its own version of the site](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) in place of a tree that sets `size`, `weight`, `mono`, or `tabular`.
+
+####
+
+
+
+Replace `bold` with `weight`
+
+`bold` on a `Text` is deprecated in favor of `weight` and still works. To replace it on a `Text` with no `weight`, change `bold: true` to `weight: 'semibold'` for the same result on Claude Code v2.1.299 or later. On a release earlier than v2.1.299, a tree that sets `weight` doesn’t draw, and Claude Code [draws its own version of the site](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) instead. If you set both `bold` and `weight` on a `Text`, `bold` has no effect.
##
--- a/sandboxing.md
+++ b/sandboxing.md
@@ -163,8 +163,8 @@
Claude Code approves a command automatically, with no prompt, when the command runs inside the sandbox. A command goes through the regular [permission flow](</docs/en/permissions>) when it runs outside the sandbox because it matches `excludedCommands` or because Claude retries it unsandboxed. A sandboxed command that connects to a host you haven’t allowed stays in the sandbox. Hosts outside your allowed domains covers who decides whether the connection goes through. Even in auto-allow mode, the following still apply:
- * Explicit [deny rules](</docs/en/permissions>) are always respected
- * `rm` or `rmdir` commands that target a [critical path](</docs/en/permission-modes#critical-paths>) still go through the regular permission flow
+ * A command in a [form that a `Bash` deny rule matches](</docs/en/permissions#bash-rule-limits>) is still blocked
+ * `rm` or `rmdir` commands recognized as targeting a [critical path](</docs/en/permission-modes#which-paths-are-critical>) still go through the regular permission flow
* Content-scoped [ask rules](</docs/en/permissions>) like `Bash(git push *)` still force a prompt even for sandboxed commands
* A bare `Bash` ask rule, or the equivalent `Bash(*)` form, is skipped for commands that run sandboxed; it still applies to commands that run outside the sandbox. 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
* [Monitor tool](</docs/en/tools-reference#monitor-tool>) commands aren’t approved automatically, though they still run in the sandbox. To skip the prompt, add an [allow rule](</docs/en/permissions#bash>) that matches the command, such as `Bash(npm run *)`
@@ -970,6 +970,18 @@
* **`Command line arguments`** : if you started Claude Code with [`--settings`](</docs/en/settings#change-a-setting-for-one-session>), check whether the file or JSON you passed sets one of those keys. If it does, change the value there, or start Claude Code again without those keys.
* **`Enterprise managed settings`** : your organization’s managed settings are loaded. If they set one of those keys, you can’t change that key from `/sandbox` or from any settings file you control, so ask your administrator.
+###
+
+
+
+`/sandbox` prints `Sandbox settings not changed`
+
+This line means `/sandbox` couldn’t save the choice you made in its panel to your project’s `.claude/settings.local.json`:
+
+ ✗ Sandbox settings not changed: /home/you/project/.claude/settings.local.json couldn't be updated (EACCES). Start Claude Code in a project folder you can write to.
+
+If the reason in parentheses is `EACCES`, `EPERM`, or `EROFS`, start Claude Code in a project folder you can write to, then run `/sandbox` again in that session. If the reason begins with `Invalid JSON syntax in settings file`, correct the JSON in your project’s `.claude/settings.local.json`, then run `/sandbox` again.
+
##
--- a/security.md
+++ b/security.md
@@ -120,7 +120,7 @@
IDE security
-See [VS Code security and privacy](</docs/en/vs-code#security-and-privacy>) for more information on running Claude Code in an IDE.
+See [The built-in IDE MCP server](</docs/en/vs-code#the-built-in-ide-mcp-server>) for more information on running Claude Code in an IDE.
##
--- a/security-guidance.md
+++ b/security-guidance.md
@@ -30,7 +30,7 @@
The terminal install prompts for a scope. Choose user scope to write the plugin to your user settings, so it loads in every new local session you start on this machine. If the install fails, match the message Claude Code reports:
* `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.
- * The plugin is [not found in the marketplace](</docs/en/plugins/install#install-a-plugin>): check the plugin name.
+ * `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](</docs/en/plugins/troubleshooting#plugin-not-found-in-marketplace>).
Check the install summary. If it reports `Run /reload-plugins to apply.`, see [Apply plugin changes without restarting](</docs/en/plugins/cli-reference#reload-plugins>) to activate the plugin in your current session.
--- a/skills.md
+++ b/skills.md
@@ -501,7 +501,7 @@
The [Claude Code skills guide](</docs/en/skills>) covers authoring in depth. Its guidance applies to SDK sessions. Start with these sections:
* [Frontmatter reference](</docs/en/skills#frontmatter-reference>): every supported field
- * [Pass arguments to skills](</docs/en/skills#pass-arguments-to-skills>): `$ARGUMENTS`, `$0`, `$1`, and skill stacking. The [full substitution table](</docs/en/skills#available-string-substitutions>) adds named arguments and the `${CLAUDE_*}` variables
+ * [Pass arguments to skills](</docs/en/skills#pass-arguments-to-skills>): `$ARGUMENTS`, `$0`, and `$1`. The [full substitution table](</docs/en/skills#available-string-substitutions>) adds named arguments and the `${CLAUDE_*}` variables
* [Inject dynamic context](</docs/en/skills#inject-dynamic-context>): `!`command`` lines that run before Claude sees the skill content
* [Choose where skills load](</docs/en/skills#where-skills-live>): every skill location, plugin namespacing, and which skill runs when two share a name
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -378,7 +378,15 @@
* `WaitForMcpServers`
* `Workflow`
-The second filter applies to subagents running in the background. Apart from `Agent` and `ExitPlanMode`, which follow the first filter’s conditions wherever the subagent runs, a background subagent keeps every MCP tool but only these built-in tools: `Read`, `Grep`, `Glob`, `LSP`, `Bash`, `PowerShell`, `Edit`, `Write`, `NotebookEdit`, `WebFetch`, `WebSearch`, `TodoWrite`, `Skill`, `ToolSearch`, `EnterWorktree`, `ExitWorktree`, `Monitor`, `TaskStop`, `SendMessage`, and `Artifact`, plus [`SubagentHandback`](</docs/en/tools-reference>) for a subagent that reports through it. Claude Code removes every other built-in tool from a background subagent, whether inherited or listed in the `tools` field, so the same definition can resolve to different tools in the foreground and the background. The removal reports no error unless it leaves the `tools` list [resolving to nothing](</docs/en/errors#agent-would-be-spawned-with-zero-tools>). Before v2.1.280, background subagents couldn’t use `LSP`. [`ListAgents`](</docs/en/cross-session-messaging>) follows these filters like any built-in tool: a foreground subagent inherits it in sessions where cross-session messaging is enabled, and a background subagent doesn’t keep it. Teammates in [agent teams](</docs/en/agent-teams>) additionally keep the task tools and cron tools: `TaskCreate`, `TaskGet`, `TaskList`, `TaskUpdate`, `CronCreate`, `CronDelete`, and `CronList`. In a [session without the Task tools](</docs/en/tools-reference#task-tool-availability>), Claude Code doesn’t provide the task tools to subagents either, even when the subagent runs a different model. An in-process teammate follows your session the same way, while a teammate in its own [split pane](</docs/en/agent-teams#choose-a-display-mode>) runs as a separate Claude Code process, so its own model decides. To restrict tools, use the `tools` field as an allowlist or the `disallowedTools` field as a denylist. This example uses `tools` to allow only Read, Grep, Glob, and Bash. The subagent can’t edit files, write files, or use any MCP tools:
+The second filter applies to subagents running in the background. Apart from `Agent` and `ExitPlanMode`, which follow the first filter’s conditions wherever the subagent runs, a background subagent keeps every MCP tool but only these built-in tools: `Read`, `Grep`, `Glob`, `LSP`, `Bash`, `PowerShell`, `Edit`, `Write`, `NotebookEdit`, `WebFetch`, `WebSearch`, `TodoWrite`, `Skill`, `ToolSearch`, `EnterWorktree`, `ExitWorktree`, `Monitor`, `TaskStop`, `SendMessage`, and `Artifact`, plus [`SubagentHandback`](</docs/en/tools-reference>) for a subagent that reports through it. Claude Code removes every other built-in tool from a background subagent, whether inherited or listed in the `tools` field, so the same definition can resolve to different tools in the foreground and the background. The removal reports no error unless it leaves the `tools` list [resolving to nothing](</docs/en/errors#agent-would-be-spawned-with-zero-tools>). Before v2.1.280, background subagents couldn’t use `LSP`. [`ListAgents`](</docs/en/cross-session-messaging>) follows these filters like any built-in tool: a foreground subagent inherits it in sessions where cross-session messaging is enabled, and a background subagent doesn’t keep it. Teammates in [agent teams](</docs/en/agent-teams>) additionally keep the task tools and cron tools: `TaskCreate`, `TaskGet`, `TaskList`, `TaskUpdate`, `CronCreate`, `CronDelete`, and `CronList`. In a [session without the Task tools](</docs/en/tools-reference#task-tool-availability>), Claude Code doesn’t provide the task tools to subagents either, even when the subagent runs a different model. An in-process teammate follows your session the same way, while a teammate in its own [split pane](</docs/en/agent-teams#choose-a-display-mode>) runs as a separate Claude Code process, so its own model decides.
+
+####
+
+
+
+Restrict which tools a subagent can use
+
+To restrict tools, use the `tools` field as an allowlist or the `disallowedTools` field as a denylist. If both are set, `disallowedTools` is applied first, then `tools` is resolved against the remaining pool. A tool listed in both is removed. This example uses `tools` to allow only Read, Grep, Glob, and Bash. The subagent can’t edit files, write files, or use any MCP tools:
---
name: safe-researcher
@@ -394,7 +402,15 @@
disallowedTools: Write, Edit
---
-If both are set, `disallowedTools` is applied first, then `tools` is resolved against the remaining pool. A tool listed in both is removed. When nothing in the `tools` list resolves to a tool, for example because every entry is misspelled or names a tool that isn’t available to subagents, Claude Code usually refuses to launch the subagent and the Agent tool returns an error naming the unresolved entries; see [Agent would be spawned with zero tools](</docs/en/errors#agent-would-be-spawned-with-zero-tools>) for the message and how to fix each entry. Before v2.1.208, that subagent launched with no tools and could return an empty or confusing result. Both fields accept MCP server-level patterns in addition to exact tool names: `mcp__<server>` or `mcp__<server>__*` grants or removes every tool from the named server. In `disallowedTools`, `mcp__*` also removes every MCP tool from any server. This example removes every tool from the `github` MCP server while keeping tools from other servers and the built-in tools in its pool:
+When nothing in the `tools` list resolves to a tool, for example because every entry is misspelled or names a tool that isn’t available to subagents, Claude Code usually refuses to launch the subagent and the Agent tool returns an error naming the unresolved entries; see [Agent would be spawned with zero tools](</docs/en/errors#agent-would-be-spawned-with-zero-tools>) for the message and how to fix each entry. Before v2.1.208, that subagent launched with no tools and could return an empty or confusing result. The `tools` and `disallowedTools` fields also take entries for a whole MCP server:
+
+Goal| Field| Example entry
+---|---|---
+Give the subagent every tool from one server| `tools`| `mcp__github__*`
+Withhold one server’s tools| `disallowedTools`| `mcp__github` or `mcp__github__*`
+Withhold every MCP tool from any server| `disallowedTools`| `mcp__*`
+
+This example removes every tool from the `github` MCP server while keeping tools from other servers and the built-in tools in the subagent’s pool:
---
name: local-only
--- a/terminal-config.md
+++ b/terminal-config.md
@@ -272,7 +272,7 @@
Fullscreen mode
-Claude Code paints `userMessageBackground`, `bashMessageBackgroundColor`, and `memoryBackgroundColor` in both the default and fullscreen renderers. It uses `userMessageBackgroundHover` and `selectionBg` only in [fullscreen rendering mode](</docs/en/fullscreen>).
+Claude Code uses `userMessageBackgroundHover`, `selectionBg`, and `composerSidebarBackground` only in [fullscreen rendering mode](</docs/en/fullscreen>). It paints `userMessageBackground`, `bashMessageBackgroundColor`, and `memoryBackgroundColor` in both the default and fullscreen renderers.
Token| Controls
---|---
@@ -281,6 +281,7 @@
`bashMessageBackgroundColor`| Background behind `!` shell command entries in the transcript
`memoryBackgroundColor`| Background behind `#` memory entries in the transcript
`selectionBg`| Background of text selected with the mouse
+`composerSidebarBackground`| Background of the panel beside the conversation, such as the [diff panel](</docs/en/fullscreen#watch-your-changes-in-the-diff-panel>) or a [mod’s pane](</docs/en/plugins/mods/interface>)
####
--- a/troubleshoot.md
+++ b/troubleshoot.md
@@ -245,6 +245,19 @@
+Another mod’s band shows and yours doesn’t
+
+There is one band above the prompt, and every mod shares it. A mod that runs [before yours](</docs/en/plugins/mods/events#the-order-mods-run-in>) replaces your band when it returns a tree without the result of `next(e)` in it. To show both bands, change that mod’s hook, or ask its author to:
+
+ * **Keep the bands after it** : put the result of `await next(e)` among the children of a `Box` in its tree, as in the Band above the prompt tab of [Pick where to draw](</docs/en/plugins/mods/interface#pick-where-to-draw>)
+ * **Keep the tree valid** : don’t give that `Box`, or any `Box` around it, a `width`, `height`, `minWidth`, `minHeight`, `position`, `top`, `left`, `right`, `bottom`, `display`, or `overflow` prop
+
+To find that mod, write a debug log and search it for `answered ui.render without next()`. A line such as `other-mod (user) answered ui.render without next()` names a mod that returned its tree without calling `next(e)`. It doesn’t name the [render site](</docs/en/plugins/mods/reference#render-sites>), so a pane-only mod can appear too. A mod that calls `next(e)` and drops the result gets no line, so check the hooks before yours too. After the change, you see nothing in the band if any of the mods returns a tree that doesn’t validate. To read the reason, look for a `ui.render (AbovePrompt) refused:` line in the transcript of a `--plugin-dir` session, or search the debug log for `does not validate`. With several mods in the band, neither line names a mod, so check each mod’s tree.
+
+###
+
+
+
A pane or band is empty or shows Claude Code’s usual content
The [tree](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) your hook returned didn’t validate. With `--plugin-dir`, the transcript says `ui.render (Pane) refused:` with the reason, as in `first-mod: ui.render (Pane) refused: Box prop "flexDirection" must be one of row, column, row-reverse, column-reverse; the engine drew its own`. The debug log has `a hook returned a tree that does not validate` with the same reason. Read the reason on that line. Common causes are a prop the element doesn’t take and an element the app doesn’t have.
--- a/typescript.md
+++ b/typescript.md
@@ -744,7 +744,7 @@
`interrupt()`| Interrupts the query. Only available in streaming input mode. When the CLI advertises the `interrupt_receipt_v1` capability in `SDKSystemMessage.capabilities`, resolves with an `SDKControlInterruptResponse` listing the messages that were pending when the interrupt arrived. Resolves `undefined` on CLIs before v2.1.205
`rewindFiles(userMessageId, options?)`| Restores files to their state at the specified user message. Pass `{ dryRun: true }` to preview changes. Requires `enableFileCheckpointing: true`. See [File checkpointing](</docs/en/agent-sdk/file-checkpointing>)
`setPermissionMode()`| Changes the permission mode (only available in streaming input mode)
-`setModel()`| Changes the model (only available in streaming input mode). Passing `undefined` or the string `"default"` resets to [Claude Code’s default model](</docs/en/model-config>)
+`setModel()`| Changes the model (only available in streaming input mode). Passing `undefined` or the string `"default"` resets to [Claude Code’s default model](</docs/en/model-config>). A session in `auto` mode [changes to `default` mode](</docs/en/agent-sdk/permissions#auto-mode-auto>) if the new model doesn’t support auto mode
`setMaxThinkingTokens()`| _Deprecated:_ Use the `thinking` option instead. Changes the maximum thinking tokens. Passing `null` resets thinking to the session default: a mid-session override is cleared, and thinking stays off for sessions that have it disabled
`applyFlagSettings(settings)`| Merges settings into the session’s flag settings layer at runtime (only available in streaming input mode). See `applyFlagSettings()`
`updateSettings(source, settings)`| Writes one allowlisted key to the project’s local settings file or your user settings file, so the value persists for later sessions. See `updateSettings()`. Requires TypeScript SDK v0.3.257 or later, which bundles Claude Code v2.1.257
@@ -6170,7 +6170,7 @@
Property| Type| Default| Description
---|---|---|---
`allowWrite`| `string[]`| `[]`| File path patterns to allow write access to
-`denyWrite`| `string[]`| `[]`| File path patterns to deny write access to
+`denyWrite`| `string[]`| `[]`| File path patterns to deny write access to. To block sandboxed writes to a file in the session’s working directory, list its absolute path.
`denyRead`| `string[]`| `[]`| File path patterns to deny read access to
###
Show diff (603 lines)
--- a/vs-code.md
+++ b/vs-code.md
@@ -1,4 +1,10 @@
-The VS Code extension provides a native graphical interface for Claude Code, integrated directly into your IDE. This is the recommended way to use Claude Code in VS Code. With the extension, you can review and edit Claude’s plans before accepting them, auto-accept edits as they’re made, @-mention files with specific line ranges from your selection, access conversation history, and open multiple conversations in separate tabs or windows.
+The VS Code extension provides a native graphical interface for Claude Code, integrated directly into your IDE. This is the recommended way to use Claude Code in VS Code. With the extension, you can:
+
+ * Review and edit Claude’s plans before accepting them
+ * Auto-accept edits as they’re made
+ * @-mention files with specific line ranges from your selection
+ * Access conversation history
+ * Open multiple conversations in separate tabs or windows
##
@@ -24,7 +30,11 @@
* [Install for VS Code](<vscode:extension/anthropic.claude-code>)
* [Install for Cursor](<cursor:extension/anthropic.claude-code>)
-Or in VS Code, press `Cmd+Shift+X` (Mac) or `Ctrl+Shift+X` (Windows/Linux) to open the Extensions view, search for “Claude Code”, and click **Install**. The extension’s version number is the Claude Code version it bundles. For example, a feature that requires Claude Code v2.1.286 or later needs version 2.1.286 or later of the extension, which the Extensions view shows. The extension also installs in other VS Code forks like Devin Desktop or Kiro. Search for “Claude Code” in the editor’s Extensions view, or install from the [Open VSX registry](<https://open-vsx.org/extension/Anthropic/claude-code>). If your editor can’t install the extension, [install the CLI](</docs/en/quickstart>) and run `claude` in its integrated terminal instead. The CLI works in any terminal. To run Claude Code inside a dev container, see [Development containers](</docs/en/devcontainer>).
+Or in VS Code, press `Cmd+Shift+X` (Mac) or `Ctrl+Shift+X` (Windows/Linux) to open the Extensions view, search for “Claude Code”, and click **Install**. The extension’s version number is the Claude Code version it bundles. For example, a feature that requires Claude Code v2.1.286 or later needs version 2.1.286 or later of the extension, which the Extensions view shows. Claude Code also runs in other editors and containers:
+
+ * **Other VS Code forks** : the extension also installs in forks like Devin Desktop or Kiro. Search for “Claude Code” in the editor’s Extensions view, or install from the [Open VSX registry](<https://open-vsx.org/extension/Anthropic/claude-code>).
+ * **Editors that can’t install the extension** : [install the CLI](</docs/en/quickstart>) and run `claude` in the editor’s integrated terminal instead. The CLI works in any terminal.
+ * **Dev containers** : to run Claude Code inside a dev container, see [Development containers](</docs/en/devcontainer>).
If the extension doesn’t appear after installation, restart VS Code or run “Developer: Reload Window” from the Command Palette.
@@ -52,7 +62,7 @@
Sign in
-The first time you open the panel, a sign-in screen appears. Click **Sign in** and complete authorization in your browser.If you see **Not logged in · Please run /login** later, the extension reopens the sign-in screen automatically. If it doesn’t appear, reload the window from the Command Palette with **Developer: Reload Window**.If you have `ANTHROPIC_API_KEY` set in your shell but still see the sign-in prompt, VS Code may not have inherited your shell environment. Launch VS Code from a terminal with `code .` so it inherits your environment variables, or sign in with your Claude account instead.After you sign in, a **Learn Claude Code** checklist appears. Work through each item by clicking **Show me** , or dismiss it with the X. To reopen it later, uncheck **Hide Onboarding** in VS Code settings under Extensions → Claude Code.
+The first time you open the panel, a sign-in screen appears. Click **Sign in** and complete authorization in your browser.If you see **Not logged in · Please run /login** later, the extension reopens the sign-in screen automatically. If it doesn’t appear, reload the window from the Command Palette with **Developer: Reload Window**.If you have `ANTHROPIC_API_KEY` set in your shell but still see the sign-in prompt, VS Code may not have inherited your shell environment. Launch VS Code from a terminal with `code .` so it inherits your environment variables, or sign in with your Claude account instead.After you sign in, a **Learn Claude Code** checklist appears. Work through each item by clicking **Show me** , or dismiss it with the X. To reopen it later, uncheck **Hide Onboarding** in VS Code settings under **Extensions > Claude Code**.
3
@@ -68,12 +78,12 @@
Review changes
-What you see depends on the [permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>) shown at the bottom of the prompt box:
-
- * In Auto or Edit automatically mode, Claude edits most files in your workspace without asking.
+Check the [permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>) shown at the bottom of the prompt box:
+
+ * In Auto or Edit automatically mode, Claude edits [most files](</docs/en/permission-modes#protected-paths>) in your workspace without asking.
* In Manual mode, when Claude wants to edit a file, it shows a side-by-side comparison of the original and proposed changes, then asks for permission. You can accept, reject, or tell Claude what to do instead. If you edit the proposed content directly in the diff view before accepting, Claude is told that you modified it so it doesn’t assume the file matches its original proposal.
-To review a proposed edit one change at a time, use the **Accept this change** and **Reject this change** buttons under each change in the diff. Rejecting a change reverts it in the proposed content; accepting marks it as reviewed. Accepting or rejecting the whole file still finishes the review. A diff with more than 100 changes opens without the per-change buttons, so review it as a whole file. Per-change review requires Claude Code v2.1.275 or later.The same actions are available at the cursor from the editor’s context menu and from the Command Palette as **Claude Code: Accept Change at Cursor** and **Claude Code: Reject Change at Cursor**.
+To review a proposed edit one change at a time, use the **Accept this change** and **Reject this change** buttons under each change in the diff. Rejecting a change reverts it in the proposed content; accepting marks it as reviewed. Per-change review requires Claude Code v2.1.275 or later.Accepting or rejecting the whole file still finishes the review. A diff with more than 100 changes opens without the per-change buttons, so review it as a whole file.The same actions are available at the cursor from the editor’s context menu and from the Command Palette as **Claude Code: Accept Change at Cursor** and **Claude Code: Reject Change at Cursor**.
For more ideas on what you can do with Claude Code, see [Common workflows](</docs/en/common-workflows>).
@@ -107,13 +117,13 @@
* Select **Sandbox** in the Customize section, or type `/sandbox`, to see whether Claude’s Bash commands run [sandboxed](</docs/en/sandboxing>). You can switch the sandbox mode and add [excluded commands](</docs/en/settings-reference#sandbox-excludedcommands>) there. Requires Claude Code v2.1.280 or later.
* Select **Claude in Chrome** in the Customize section, or type `/chrome`, to check and manage the [Claude in Chrome](</docs/en/chrome>) connection. Both require signing in with a claude.ai account. Requires Claude Code v2.1.280 or later.
* Select **Export conversation** in the Context section, or type `/export`, to copy the conversation as plain text or save it to a file. Add a file name, such as `/export notes.txt`, to skip the dialog and choose where to save the file. Requires Claude Code v2.1.280 or later.
- * The Settings section includes **Enable Remote Control for all sessions** , which sets [`remoteControlAtStartup`](</docs/en/settings-reference#remotecontrolatstartup>) to control whether [new interactive sessions connect to Remote Control automatically](</docs/en/remote-control#enable-remote-control-for-all-sessions>). Requires Claude Code v2.1.203 or later. When you turn the toggle on or off in a VS Code window, the change applies to the sessions already open in that VS Code window, not only to sessions you start afterwards. If you turn it off, the open sessions disconnect. With Claude Code v2.1.261 or later, the change also reaches sessions open in your other VS Code windows.
+ * The Settings section includes **Enable Remote Control for all sessions** , which sets [`remoteControlAtStartup`](</docs/en/settings-reference#remotecontrolatstartup>) to control whether [new interactive sessions connect to Remote Control automatically](</docs/en/remote-control#enable-remote-control-for-all-sessions>). Requires Claude Code v2.1.203 or later. When you turn the toggle on or off in a VS Code window, the change isn’t limited to sessions you start afterwards. It also applies to the sessions already open in that VS Code window. If you turn it off, the open sessions disconnect. With Claude Code v2.1.261 or later, the change also reaches sessions open in your other VS Code windows.
* The Settings section also includes **Focus view** , which hides tool calls, tool results, and thinking behind expandable rows, leaving your prompts and Claude’s responses. Toggle it there, with `Ctrl+Option+F` (Mac) / `Ctrl+Alt+F` (Windows/Linux), or from the Command Palette with **Claude Code: Toggle Focus view**. The change applies to every open session and persists across sessions. Requires Claude Code v2.1.221 or later. Claude’s latest to-do list stays visible, and so does the text a pending question from Claude is asking about; this requires Claude Code v2.1.225 or later. While Claude runs [subagents](</docs/en/sub-agents>), live progress rows with their latest activity appear under the tool-call group that started them. This requires Claude Code v2.1.269 or later.
* To sign out of your Anthropic account, select **Sign out** in the Settings section, or type `/logout`. On a third-party provider, the menu doesn’t offer either. Requires Claude Code v2.1.277 or later.
- * To report a bug, click **Report a problem** at the bottom of the menu, or type `/bug` or `/feedback` with an optional description that prefills the report. When you submit the report and you’re signed in to Anthropic on a first-party connection, Claude Code sends it to Anthropic. Requires Claude Code v2.1.229 or later. On a third-party provider, or without Anthropic credentials, nothing is sent. The dialog says so before you write. Submitting saves the report as a [local archive under `~/.claude/feedback-bundles/`](</docs/en/data-usage#telemetry-services>) with known API key and token patterns redacted. Send that file to your Anthropic account representative or attach it to a support request. The confirmation names the file and includes a **Show folder** button. Saving the report on your computer requires Claude Code v2.1.284 or later. If your organization’s policy turns product feedback off, **Report a problem** doesn’t appear in the menu, and `/bug` and `/feedback` show a `Feedback is turned off by your organization's policy or this environment's settings.` notice instead of opening the report. With Claude Code v2.1.284 or later, if you set the `DISABLE_FEEDBACK_COMMAND` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` environment variable, feedback is also turned off and opening the report shows that notice instead.
- * **Side questions** : type `/btw` followed by a question to ask about your session [without adding to the conversation](</docs/en/interactive-mode#side-questions-with-%2Fbtw>). The answer opens in a panel beside the chat, where you can ask follow-up questions. The thread survives window reloads. Claude Code keeps the newest 20 exchanges and expires stored threads on the [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) schedule, as long as Claude Code can [safely determine the retention period](</docs/en/claude-directory#cleaned-up-automatically>). To clear a thread, click the trash icon in the panel. Requires Claude Code v2.1.227 or later.
+ * To report a bug, click **Report a problem** at the bottom of the menu, or type `/bug` or `/feedback` with an optional description that prefills the report. When you submit the report and you’re signed in to Anthropic on a first-party connection, Claude Code sends it to Anthropic. Requires Claude Code v2.1.229 or later. On a third-party provider, or without Anthropic credentials, nothing is sent. The dialog says so before you write. Submitting saves the report as a [local archive under `~/.claude/feedback-bundles/`](</docs/en/data-usage#telemetry-services>) with known API key and token patterns redacted. Saving the report on your computer requires Claude Code v2.1.284 or later. After the report is saved, the confirmation names the file and includes a **Show folder** button. Send that file to your Anthropic account representative or attach it to a support request. If your organization’s policy turns product feedback off, **Report a problem** doesn’t appear in the menu, and `/bug` and `/feedback` show a `Feedback is turned off by your organization's policy or this environment's settings.` notice instead of opening the report. With Claude Code v2.1.284 or later, if you set the `DISABLE_FEEDBACK_COMMAND` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` environment variable, feedback is also turned off and opening the report shows that notice instead.
+ * **Side questions** : type `/btw` followed by a question to ask about your session [without adding to the conversation](</docs/en/interactive-mode#side-questions-with-%2Fbtw>). The answer opens in a panel beside the chat, where you can ask follow-up questions. Requires Claude Code v2.1.227 or later. The thread survives window reloads. Claude Code keeps the newest 20 exchanges and expires stored threads on the [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) schedule, as long as Claude Code can [safely determine the retention period](</docs/en/claude-directory#cleaned-up-automatically>). To clear a thread, click the trash icon in the panel.
* **Copy a response** : hover over a response and click **Copy response** to copy it to your clipboard, or type `/copy` to copy the latest response. `/copy 2` copies the second-to-last. Requires Claude Code v2.1.277 or later.
- * **Bookmarks** : hover over a response and click **Bookmark response** to save it, or click **Remove bookmark** on a saved response to remove it. To review saved responses, open the Bookmarks panel: click the bookmark icon at the top of the Claude Code panel, select **Bookmarks** in the Context section of the command menu, or type `/bookmarks`. Requires Claude Code v2.1.286 or later.
+ * **Bookmarks** : hover over a response and click **Bookmark response** to save it, or click **Remove bookmark** on a saved response to remove it. To review saved responses, open the Bookmarks panel. You can click the bookmark icon at the top of the Claude Code panel, select **Bookmarks** in the Context section of the command menu, or type `/bookmarks`. Requires Claude Code v2.1.286 or later.
* **Files Claude sends you** : when the session is connected to [Remote Control](</docs/en/remote-control#start-a-remote-control-session>) and Claude sends you files with the [`SendUserFile` tool](</docs/en/tools-reference>), the conversation shows a row such as **Sent report.md, chart.png**. Click a file’s name to open it in the editor.
* **Context indicator** : the prompt box shows how much of Claude’s context window you’re using. Claude automatically compacts when needed, or you can run `/compact` manually.
* **Prompt cache clock** : a clock icon next to the context indicator estimates how much time the conversation’s [prompt cache](</docs/en/prompt-caching>) has left before it expires. It counts down from the cache’s five-minute or one-hour [lifetime](</docs/en/prompt-caching#cache-lifetime>), and each response that uses the cache restarts the countdown. Apart from compaction, the [actions that invalidate the cache](</docs/en/prompt-caching#actions-that-invalidate-the-cache>) don’t reset the clock, so it can still show minutes left after you switch models.
@@ -135,7 +145,12 @@
Explain the logic in @auth (fuzzy matches auth.js, AuthService.ts, etc.)
What's in @src/components/ (include a trailing slash for folders)
-For large PDFs, you can ask Claude to read specific pages instead of the whole file: a single page, a range like pages 1-10, or an open-ended range like page 3 onward. Reading specific pages requires [poppler-utils](</docs/en/tools-reference#read-tool-behavior>) on the machine where Claude Code runs. When you select text in the editor, Claude can see your highlighted code automatically. The prompt box footer shows how many lines are selected. Press `Option+K` (Mac) / `Alt+K` (Windows/Linux) to insert an @-mention with the file path and line numbers (e.g., `@app.ts#5-10`). Click the **X** on the selection indicator to remove it so Claude doesn’t receive the selection. The indicator comes back when you select other text. The extension withholds selected text from some files. When the file is inside your workspace and matches your `files.exclude` or `search.exclude` settings, Claude receives at most the file’s path and not the text you selected. The same applies to a file git ignores, as long as VS Code’s `search.useIgnoreFiles` setting and the extension’s `respectGitIgnore` setting are both on, which is the default. This filter covers the chat panel only: when Claude Code runs in the integrated terminal, the CLI sends your selected text whatever the file, so add a `Read` deny rule to keep a file’s contents from Claude there. Claude also sees which file you have open in the editor, even when nothing is selected, and the prompt box shows its name. To add only your selected text, turn off the [Attach Open File setting](<vscode://settings/claudeCode.attachOpenFile>). The setting requires Claude Code v2.1.271 or later. You can also attach images and files to your message:
+For large PDFs, you can ask Claude to read specific pages instead of the whole file. Ask for a single page, a range like pages 1-10, or an open-ended range like page 3 onward. Reading specific pages requires [poppler-utils](</docs/en/tools-reference#read-tool-behavior>) on the machine where Claude Code runs. When you select text in the editor, Claude can see your highlighted code automatically. The prompt box footer shows how many lines are selected. Press `Option+K` (Mac) / `Alt+K` (Windows/Linux) to insert an @-mention with the file path and line numbers, for example `@app.ts#5-10`. Click the **X** on the selection indicator to remove it so Claude doesn’t receive the selection. The indicator comes back when you select other text. The extension withholds selected text from some files:
+
+ * When the file is inside your workspace and matches your `files.exclude` or `search.exclude` settings, Claude receives at most the file’s path and not the text you selected.
+ * The same applies to a file git ignores, as long as VS Code’s `search.useIgnoreFiles` setting and the extension’s `respectGitIgnore` setting are both on, which is the default.
+
+This filter covers the chat panel only. When Claude Code runs in the integrated terminal, the CLI sends your selected text whatever the file. To keep a file’s contents from Claude there, add a `Read` deny rule. Claude also sees which file you have open in the editor, even when nothing is selected, and the prompt box shows its name. To add only your selected text, turn off the [Attach Open File setting](<vscode://settings/claudeCode.attachOpenFile>). The setting requires Claude Code v2.1.271 or later. You can also attach images and files to your message:
* To attach an image, paste it from your clipboard into the prompt box.
* To attach files, hold `Shift` while dragging them into the prompt box.
@@ -145,6 +160,14 @@
+Include terminal output in prompts
+
+Reference terminal output in your prompts using `@terminal:name` where `name` is the terminal’s title. This lets Claude see command output, error messages, or logs without copy-pasting.
+
+###
+
+
+
Paste text
Text you paste stays visible in the prompt box, rather than collapsing to a placeholder as it does [in the terminal](</docs/en/terminal-config#paste-large-content>). In sessions where Claude Code [marks pasted text](</docs/en/terminal-config#how-claude-treats-pasted-text>), Claude still sees a large paste as text you pasted rather than typed. Claude Code also removes [invisible Unicode characters](</docs/en/interactive-mode#invisible-characters-in-prompts>) from text you paste into the prompt box and from anything else you send:
@@ -176,7 +199,16 @@
* **Session titles** : new sessions receive AI-generated titles based on your first message.
* **Rename and archive** : hover over a session to reveal these actions. Rename to give it a descriptive title, or archive to move it to the **Archived sessions** group at the bottom of the list.
-If the conversation is open in another Claude Code process, such as `claude` in a terminal or another VS Code window, a notice appears in place of the prompt box: `This conversation is still open somewhere else. Using it in two places at once can mix up its messages.` To continue here, close the conversation in the other place and then click **Open here anyway**. If you click without closing it, the conversation is open in both places. With `claudeProcessWrapper` set, the extension skips this check and opens the conversation directly. By default, a session with no activity for 14 days moves to **Archived sessions** automatically, unless it is open, unread, or in a group. Automatic archiving requires Claude Code v2.1.265 or later. To change the period or turn it off, open the [Archive Inactive Sessions setting](<vscode://settings/claudeCode.archiveInactiveSessions>) and select a number of days or **Never**. To restore an archived session, expand **Archived sessions** and click **Unarchive session**. To restore every archived session at once, hover over the **Archived sessions** header in the sessions list in the Activity Bar and click its unarchive icon, which requires Claude Code v2.1.277 or later. Before v2.1.257, the action was **Delete session** , which hid a session with no way to restore it. Sessions you deleted then appear under **Archived sessions** after you upgrade. When the conversation you resume ended in plan mode, Claude Code restores plan mode. Requires Claude Code v2.1.246 or later. Claude Code doesn’t restore it in these cases:
+If the conversation is open in another Claude Code process, such as `claude` in a terminal or another VS Code window, this notice appears in place of the prompt box:
+
+ This conversation is still open somewhere else. Using it in two places at once can mix up its messages.
+
+To continue here, close the conversation in the other place and then click **Open here anyway**. If you click without closing it, the conversation is open in both places. With `claudeProcessWrapper` set, the extension skips this check and opens the conversation directly. By default, a session with no activity for 14 days moves to **Archived sessions** automatically, unless it is open, unread, or in a group. Automatic archiving requires Claude Code v2.1.265 or later. To change the period or turn it off, open the [Archive Inactive Sessions setting](<vscode://settings/claudeCode.archiveInactiveSessions>) and select a number of days or **Never**. To restore archived sessions:
+
+ * **One session** : expand **Archived sessions** and click **Unarchive session**.
+ * **Every archived session at once** : hover over the **Archived sessions** header in the sessions list in the Activity Bar and click its unarchive icon. Requires Claude Code v2.1.277 or later.
+
+Before v2.1.257, the action was **Delete session** , which hid a session with no way to restore it. Sessions you deleted then appear under **Archived sessions** after you upgrade. When the conversation you resume ended in plan mode, Claude Code restores plan mode. Requires Claude Code v2.1.246 or later. Claude Code doesn’t restore it in these cases:
* The extension [chooses the starting permission mode](</docs/en/permission-modes#switch-permission-modes>) from `claudeCode.initialPermissionMode` or a pick that carries over from an earlier conversation
* You have `claudeCode.claudeProcessWrapper` configured
@@ -186,7 +218,7 @@
-Resume cloud sessions from Claude.ai
+Resume cloud sessions from claude.ai
If you run [cloud sessions](</docs/en/claude-code-on-the-web>), you can resume them directly in VS Code. This requires signing in with **Claude.ai Subscription** , not Anthropic Console.
@@ -210,7 +242,7 @@
When the folder you have open is a GitHub repository, the Web tab shows only sessions from that repository.When you resume a cloud session, the extension downloads a copy of the conversation history; changes don’t sync back to claude.ai.
-The Web tab also lists your [Remote Control](</docs/en/remote-control>) sessions. If you click one that ran in the folder you have open, the extension opens that local conversation instead of downloading a copy, and focuses the tab already showing it if there is one. If the extension can’t rule out that another Claude process has the conversation open, you get a downloaded copy instead. If any part of a conversation fails to download, an error appears and no copy is saved. Select the session again to retry. If you select a session that has no conversation to download yet, an error tells you where to continue it instead.
+The Web tab also lists your [Remote Control](</docs/en/remote-control>) sessions. If you click one that ran in the folder you have open, the extension opens that local conversation instead of downloading a copy. The extension focuses the tab already showing it, if there is one. If the extension can’t rule out that another Claude process has the conversation open, you get a downloaded copy instead. If any part of a conversation fails to download, an error appears and no copy is saved. Select the session again to retry. If you select a session that has no conversation to download yet, an error tells you where to continue it instead.
###
@@ -218,12 +250,26 @@
Check account and usage
-Run `/usage` to open the Account & usage dialog. It shows your signed-in account, and the usage it reports differs by sign-in:
-
- * **claude.ai plan** : usage bars for your plan’s limits, such as the current session and the week. Each bar shows how long until its limit resets. The dialog also breaks down what is contributing to your plan limits. It flags behaviors that account for 10% or more of recent usage, such as cache misses, long context, and subagent-heavy or highly parallel sessions, each with a tip to reduce it. Attribution tables show how much usage came from each skill, subagent, plugin, and MCP server. Use the Day and Week toggle to switch between the last 24 hours and the last 7 days. The figures are approximate and computed from local sessions on this machine, so usage from other devices or claude.ai is not included.
+Run `/usage` to open the Account & usage dialog, which shows your signed-in account and your usage. The usage figures match how you signed in:
+
+ * **claude.ai plan** : usage bars for your plan’s limits, such as the current session and the week. Each bar shows how long until its limit resets. The dialog also breaks down what is contributing to your plan limits. It flags behaviors that account for 10% or more of recent usage, such as cache misses, long context, and subagent-heavy or highly parallel sessions. Each flagged behavior comes with a tip to reduce it. Attribution tables show how much usage came from each skill, subagent, plugin, and MCP server. Use the Day and Week toggle to switch between the last 24 hours and the last 7 days. The figures are approximate and computed from local sessions on this machine, so usage from other devices or claude.ai is not included.
* **Other sign-ins** : when plan limits don’t apply to your sign-in, such as on a third-party provider or with an API key, the Usage section shows the session’s own cost and token usage instead. The CLI’s `/usage` shows the same totals in its [Session block](</docs/en/costs#track-your-costs>). The sessions list in the Activity Bar also shows the active session’s totals under its **Account & usage** header. Requires Claude Code v2.1.277 or later.
For more on tracking and reducing usage, see [Track your costs](</docs/en/costs#track-your-costs>).
+
+###
+
+
+
+Rewind with checkpoints
+
+The VS Code extension supports checkpoints, which track Claude’s file edits and let you rewind to a previous state. Hover over any message to reveal the rewind button, then choose from three options:
+
+ * **Fork conversation from here** : start a new conversation branch from this message while keeping all code changes intact
+ * **Rewind code to here** : revert file changes back to this point in the conversation while keeping the full conversation history
+ * **Fork conversation and rewind code** : start a new conversation branch and revert file changes to this point
+
+For full details on how checkpoints work and their limitations, see [Checkpointing](</docs/en/checkpointing>).
##
@@ -245,9 +291,9 @@
* **Primary sidebar** : the left sidebar with icons for Explorer, Search, etc.
* **Editor area** : opens Claude as a tab alongside your files. Useful for side tasks.
-When Claude opens a tab in a new editor group, the extension locks that group, so files you open while the Claude tab is focused go to another group instead of next to it. To stop the extension from locking groups, turn off the [Lock Editor Groups setting](<vscode://settings/claudeCode.lockEditorGroups>). Groups that are already locked stay locked until you unlock them. The setting requires Claude Code v2.1.274 or later.
-
-Use the sidebar for your main Claude session and open additional tabs for side tasks. Claude remembers your preferred location. The Activity Bar sessions list icon is separate from the Claude panel: the sessions list is always visible in the Activity Bar, while the Claude panel icon only appears there when the panel is docked to the left sidebar.
+When Claude opens a tab in a new editor group, the extension locks that group. Files you open while the Claude tab is focused then go to another group instead of next to it. To stop the extension from locking groups, turn off the [Lock Editor Groups setting](<vscode://settings/claudeCode.lockEditorGroups>). Groups that are already locked stay locked until you unlock them. The setting requires Claude Code v2.1.274 or later.
+
+Use the sidebar for your main Claude session and open additional tabs for side tasks. Claude remembers your preferred location. The Activity Bar sessions list icon is separate from the Claude panel. The sessions list is always visible in the Activity Bar, while the Claude panel icon only appears there when the panel is docked to the left sidebar.
###
@@ -255,24 +301,40 @@
Continue conversations after a reload
-After you run **Developer: Reload Window** or restart VS Code, whether a chat comes back with its conversation depends on where it was open:
+After you run **Developer: Reload Window** or restart VS Code, check where the conversation was open:
* **Editor tab** : the conversation comes back with its tab.
* **Sidebar** : the conversation comes back if you sent a message or Claude responded in it within the last 10 minutes. If it doesn’t come back, resume the conversation from Session history.
-If another Claude Code process still has the conversation open, you’re asked before it opens here, with the same **Open here anyway** notice as when you resume it from session history. If the messages stay blank at first, see why they’re blank and when they appear. If the reload interrupted Claude mid-step, Claude continues that step when the conversation comes back, and a notice in the chat marks the continuation. Requires Claude Code v2.1.274 or later. If the step was interrupted more than an hour ago or the session is open elsewhere, the conversation comes back idle instead. To turn continuation off, open the [Continue After Reload setting](<vscode://settings/claudeCode.continueAfterReload>) and uncheck it. Setting [`CLAUDE_CODE_RESUME_INTERRUPTED_TURN`](</docs/en/env-vars#variables>) or any other `CLAUDE_CODE_RESUME_` variable in VS Code’s environment or in the `environmentVariables` setting has no effect in the panel, because the extension removes those variables before it starts the panel’s sessions.
+If another Claude Code process still has the conversation open, you’re asked before it opens here, with the same **Open here anyway** notice as when you resume it from session history. If the messages stay blank at first, see why they’re blank and when they appear.
####
+Interrupted steps after a reload
+
+If the reload interrupted Claude mid-step, Claude continues that step when the conversation comes back, and a notice in the chat marks the continuation. Requires Claude Code v2.1.274 or later. If the step was interrupted more than an hour ago or the session is open elsewhere, the conversation comes back idle instead.
+
+####
+
+
+
+Turn off continuation after a reload
+
+To stop Claude from continuing an interrupted step after a reload, open the [Continue After Reload setting](<vscode://settings/claudeCode.continueAfterReload>) and uncheck it. If you set [`CLAUDE_CODE_RESUME_INTERRUPTED_TURN`](</docs/en/env-vars#variables>) or any other `CLAUDE_CODE_RESUME_` variable in VS Code’s environment or in the `environmentVariables` setting, it has no effect in the panel. That’s because the extension removes those variables before it starts the panel’s sessions.
+
+####
+
+
+
A conversation was not reopened
After a reload, a new chat with a notice like this above its prompt box means the panel left your conversation closed because the conversation’s last two opens didn’t finish:
“Fix the login bug” was not reopened. It did not finish opening the last 2 times, and opening it again may stop Claude Code from responding here.
-An open doesn’t finish when the panel crashes or stops responding while loading the conversation, or when you reload or close the window within about three seconds of it opening. Nothing is lost: the conversation is unchanged and stays in Session history.
+An open doesn’t finish when the panel crashes or stops responding while loading the conversation, or when you reload or close the window within about three seconds of it opening. The conversation is unchanged and stays in Session history.
* **To open it anyway** : click **Open it anyway** or pick the conversation from Session history. If it opens and the panel keeps working, it comes back after later reloads as usual. If the panel stops responding again, reload the window to return to a new chat with the notice.
* **To leave it closed** : keep working in the new chat. The notice disappears once you send a prompt.
@@ -319,7 +381,7 @@
Switch to terminal mode
-By default, the extension opens a graphical chat panel. If you prefer the CLI-style interface, open the [Use Terminal setting](<vscode://settings/claudeCode.useTerminal>) and check the box. You can also open VS Code settings (`Cmd+,` on Mac or `Ctrl+,` on Windows/Linux), go to Extensions → Claude Code, and check **Use Terminal**.
+By default, the extension opens a graphical chat panel. If you prefer the CLI-style interface, open the [Use Terminal setting](<vscode://settings/claudeCode.useTerminal>) and check the box. You can also press `Cmd+,` on Mac or `Ctrl+,` on Windows/Linux to open VS Code settings, go to **Extensions > Claude Code**, and check **Use Terminal**.
##
@@ -408,7 +470,7 @@
Plugin changes you make in the dialog apply right away to the Claude Code sessions open in that VS Code window. If the session you opened the dialog from can’t reload its plugins, the dialog offers to try again or to restart Claude in that session.
-Plugin management in VS Code uses the same CLI commands under the hood. Plugins and marketplaces you configure in the extension are also available in the CLI, and vice versa.
+The extension manages plugins by running the same commands as the CLI. Plugins and marketplaces you configure in the extension are also available in the CLI, and vice versa.
For more about the plugin system, see [Plugins](</docs/en/plugins/overview>) and [Plugin marketplaces](</docs/en/plugins/overview>).
@@ -442,7 +504,62 @@
@browser go to localhost:3000 and check the console for errors
-You can also open the attachment menu to select specific browser tools like opening a new tab or reading page content. Claude opens new tabs for browser tasks and shares your browser’s login state, so it can access any site you’re already signed into. To have each session connect to your browser as it starts, without typing `@browser`, see [Enable Chrome by default](</docs/en/chrome#enable-chrome-by-default>). For when Claude Code asks you before a browser action, see [Permission prompts in VS Code sessions](</docs/en/chrome#permission-prompts-in-vs-code-sessions>). For setup instructions, the full list of capabilities, and troubleshooting, see [Use Claude Code with Chrome](</docs/en/chrome>).
+You can also open the attachment menu to select specific browser tools like opening a new tab or reading page content. Claude opens new tabs for browser tasks and shares your browser’s login state, so it can access any site you’re already signed into. For more on working with the browser, see:
+
+ * [Enable Chrome by default](</docs/en/chrome#enable-chrome-by-default>): have each session connect to your browser as it starts, without typing `@browser`
+ * [Permission prompts in VS Code sessions](</docs/en/chrome#permission-prompts-in-vs-code-sessions>): when Claude Code asks you before a browser action
+ * [Use Claude Code with Chrome](</docs/en/chrome>): setup instructions, the full list of capabilities, and troubleshooting
+
+##
+
+
+
+Work with git
+
+Claude Code integrates with git to help with version control workflows directly in VS Code. Ask Claude to commit changes, create pull requests, or work across branches. To start Claude in an isolated worktree with its own files and branch, see [Run parallel sessions with worktrees](</docs/en/worktrees>).
+
+###
+
+
+
+Create commits and pull requests
+
+Claude can stage changes, write commit messages, and create pull requests based on your work:
+
+ commit my changes with a descriptive message
+ create a pr for this feature
+ summarize the changes I've made to the auth module
+
+When creating pull requests, Claude generates descriptions based on the actual code changes and can add context about testing or implementation decisions.
+
+##
+
+
+
+Run work in the background
+
+Send a long-running command or subagent to the background, then check on it from the prompt box.
+
+###
+
+
+
+Move a running command or subagent to the background
+
+When a command or a [subagent](</docs/en/sub-agents>) keeps Claude waiting longer than you want, click **Run in background** below its tool call in the conversation. Requires Claude Code v2.1.287 or later.
+
+ * **Timing** : the action appears once a command has been running for about two seconds, or as soon as a subagent starts.
+ * **After you click** : Claude stops waiting and continues the turn. The command or subagent keeps running as a [background task](</docs/en/tools-reference#background-commands>) that notifies Claude when done.
+
+To check on the task or stop it in the meantime, type `/tasks` in the prompt box to open the agent map. A subagent keeps its place in the tree of agents there, and a command is listed below the agents with its latest output on its card.
+
+###
+
+
+
+Monitor background processes
+
+Type `/tasks` in the prompt box to open the agent map, which lists the session’s background tasks, such as a dev server Claude left running as a background shell command. Click a task to open its card, where you can stop it. Requires Claude Code v2.1.277 or later. For a background shell command, or a [monitor](</docs/en/tools-reference#monitor-tool>) that runs a command, the card also shows the command’s latest output and refreshes it while the command runs.
##
@@ -450,7 +567,7 @@
VS Code commands and shortcuts
-Open the Command Palette (`Cmd+Shift+P` on Mac or `Ctrl+Shift+P` on Windows/Linux) and type “Claude Code” to see all available VS Code commands for the Claude Code extension. Some shortcuts depend on which panel is “focused” (receiving keyboard input). When your cursor is in a code file, the editor is focused. When your cursor is in Claude’s prompt box, Claude is focused. Use `Cmd+Esc` / `Ctrl+Esc` to toggle between them.
+To open the Command Palette, press `Cmd+Shift+P` on Mac or `Ctrl+Shift+P` on Windows/Linux. Type “Claude Code” there to see all available VS Code commands for the Claude Code extension. Some shortcuts depend on which panel is “focused” (receiving keyboard input). When your cursor is in a code file, the editor is focused. When your cursor is in Claude’s prompt box, Claude is focused. Use `Cmd+Esc` / `Ctrl+Esc` to toggle between them.
These are VS Code commands for controlling the extension. Not all built-in Claude Code commands are available in the extension. See VS Code extension vs. Claude Code CLI for details.
@@ -521,9 +638,9 @@
Configure settings
-The extension has two types of settings:
-
- * **Extension settings** in VS Code: control the extension’s behavior within VS Code. Open with `Cmd+,` (Mac) or `Ctrl+,` (Windows/Linux), then go to Extensions → Claude Code. You can also type `/` and select **General config…** to open settings.
+You configure the extension in two places, VS Code’s extension settings and the Claude Code settings file:
+
+ * **Extension settings** in VS Code: control the extension’s behavior within VS Code. Open with `Cmd+,` (Mac) or `Ctrl+,` (Windows/Linux), then go to **Extensions > Claude Code**. You can also type `/` and select **General config…** to open settings.
* **Claude Code settings** in `~/.claude/settings.json`: shared between the extension and CLI. Use it for allowed commands, environment variables, hooks, and MCP servers. With Claude Code v2.1.283 or later, it’s also one input to the permission mode conversations start in, and on earlier versions only on Pro, Max, and Team plans. [Switch permission modes](</docs/en/permission-modes#switch-permission-modes>) lists the order. See [Settings](</docs/en/settings>) for details.
Add `"$schema": "https://json.schemastore.org/claude-code-settings.json"` to your `settings.json` to get autocomplete and inline validation for all available settings directly in VS Code.
@@ -565,6 +682,34 @@
+Use third-party providers
+
+By default, Claude Code connects directly to Anthropic’s API. If your organization uses Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry to access Claude, configure the extension to use your provider instead:
+
+1
+
+Disable login prompt
+
+Open the [Disable Login Prompt setting](<vscode://settings/claudeCode.disableLoginPrompt>) and check the box.You can also press `Cmd+,` on Mac or `Ctrl+,` on Windows/Linux to open VS Code settings, search for “Claude Code login”, and check **Disable Login Prompt**.
+
+2
+
+Configure your provider
+
+Follow the setup guide for your provider:
+
+ * [Claude Code on Amazon Bedrock](</docs/en/amazon-bedrock>)
+ * [Claude Code on Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>)
+ * [Claude Code on Microsoft Foundry](</docs/en/microsoft-foundry>)
+
+These guides cover configuring your provider in `~/.claude/settings.json`, which ensures your settings are shared between the VS Code extension and the CLI.
+
+On a third-party provider, the extension doesn’t offer features that require a claude.ai account, such as plan usage bars, [voice dictation](</docs/en/voice-dictation>), and the Web tab for cloud sessions. For what the Account & usage dialog shows on these sign-ins, see Check account and usage. A claude.ai sign-in left over from an earlier `/login` stays unused: the extension doesn’t send it with any request.
+
+##
+
+
+
Use a screen reader
The extension’s chat panel works with screen readers. You don’t need to turn anything on: the extension announces conversation activity for every user, with no visual change. This is separate from the CLI’s opt-in [screen reader mode](</docs/en/accessibility>), which adapts the terminal interface. Screen reader support in the chat panel requires Claude Code v2.1.236 or later. During a conversation, the extension announces:
@@ -583,14 +728,17 @@
Use the chat panel from the keyboard
-Each turn in the transcript starts with a visually hidden heading labeled with the prompt that started the turn, so you can jump between turns with your screen reader’s heading navigation. Within a turn, your screen reader announces whose message you’re on as you move through it:
+Each turn in the transcript starts with a visually hidden heading labeled with the prompt that started the turn. Use your screen reader’s heading navigation to jump between turns. Within a turn, your screen reader announces whose message you’re on as you move through it:
* **Your messages** : “You”
* **Claude’s messages** : “Claude”
* **Tool steps** : “Claude” plus the tool name, such as “Claude, Bash”
* **Thinking blocks** : “Claude, thinking”
-Because the extension exposes the transcript as a labeled region, you can also move focus to the transcript itself with `Tab` and read it at your own pace. To move focus to the newest message or a waiting permission prompt instead, run **Claude Code: Focus last message** from the Command Palette. When an option on a permission prompt saves a permission rule or directory access, its label ends by naming where the approval is saved, such as “all projects” or “this session”. With that option focused, press the `Left` or `Right` arrow key to change the destination, and the extension announces each destination as you move to it. You can also click the destination in the label. The arrow keys require Claude Code v2.1.268 or later.
+Because the extension exposes the transcript as a labeled region, you can also move focus to the transcript itself with `Tab` and read it at your own pace. To move focus to the newest message or a waiting permission prompt instead, run **Claude Code: Focus last message** from the Command Palette. When a permission prompt option saves a permission rule or directory access, its label ends by naming where the approval is saved, such as “all projects” or “this session”. To change the destination:
+
+ * With that option focused, press the `Left` or `Right` arrow key. The extension announces each destination as you move to it. The arrow keys require Claude Code v2.1.268 or later.
+ * Click the destination in the label.
##
@@ -603,7 +751,7 @@
Feature| CLI| VS Code Extension
---|---|---
Commands and skills| [All](</docs/en/commands>)| Subset (type `/` to see available)
-MCP server config| Yes| Yes (add and manage servers with `/mcp` in the chat panel)
+MCP server config| Yes| Yes: add and manage servers with `/mcp` in the chat panel
Checkpoints| Yes| Yes
`!` Bash shortcut| Yes| No
Tab completion| Yes| No
@@ -612,23 +760,9 @@
-Rewind with checkpoints
-
-The VS Code extension supports checkpoints, which track Claude’s file edits and let you rewind to a previous state. Hover over any message to reveal the rewind button, then choose from three options:
-
- * **Fork conversation from here** : start a new conversation branch from this message while keeping all code changes intact
- * **Rewind code to here** : revert file changes back to this point in the conversation while keeping the full conversation history
- * **Fork conversation and rewind code** : start a new conversation branch and revert file changes to this point
-
-For full details on how checkpoints work and their limitations, see [Checkpointing](</docs/en/checkpointing>).
-
-###
-
-
-
Run CLI in VS Code
-To use the CLI while staying in VS Code, open the integrated terminal (`Ctrl+`` on Windows/Linux or `Cmd+`` on Mac) and run `claude`. The CLI automatically integrates with your IDE for features like diff viewing and diagnostic sharing. Installing the extension does not put `claude` on your shell PATH. The extension bundles a private copy of the CLI for its chat panel, but typing `claude` in a terminal requires the [standalone CLI install](</docs/en/setup>). Run the install once and the commands on this page, including `claude mcp add` and `claude --resume`, work in any terminal. If `claude` is still not found after installing, [verify your PATH](</docs/en/troubleshoot-install#verify-your-path>). If using an external terminal, run `/ide` inside Claude Code to connect it to VS Code.
+To use the CLI while staying in VS Code, press `Ctrl+`` on Windows/Linux or `Cmd+`` on Mac to open the integrated terminal, then run `claude`. The CLI automatically integrates with your IDE for features like diff viewing and diagnostic sharing. If you use an external terminal, run `/ide` inside Claude Code to connect it to VS Code. Installing the extension does not put `claude` on your shell PATH. The extension bundles a private copy of the CLI for its chat panel, but typing `claude` in a terminal requires the [standalone CLI install](</docs/en/setup>). Run the install once and the commands on this page, including `claude mcp add` and `claude --resume`, work in any terminal. If `claude` is still not found after installing, [verify your PATH](</docs/en/troubleshoot-install#verify-your-path>).
###
@@ -638,112 +772,54 @@
The extension and CLI share the same conversation history. To continue an extension conversation in the CLI, run `claude --resume` in the terminal. This opens an interactive picker where you can search for and select your conversation.
-###
-
-
-
-Include terminal output in prompts
-
-Reference terminal output in your prompts using `@terminal:name` where `name` is the terminal’s title. This lets Claude see command output, error messages, or logs without copy-pasting.
-
-###
-
-
-
-Move a running command or subagent to the background
-
-When Claude is waiting on a command or a [subagent](</docs/en/sub-agents>) that is taking longer than you want, click **Run in background** below its tool call in the conversation. The action appears once a command has been running for about two seconds, or as soon as a subagent starts. Claude stops waiting and continues the turn, while the command or subagent keeps running as a [background task](</docs/en/tools-reference#background-commands>) that notifies Claude when it finishes. Requires Claude Code v2.1.287 or later. To check on the task or stop it in the meantime, type `/tasks` in the prompt box to open the agent map. A subagent keeps its place in the tree of agents there, and a command is listed below the agents with its latest output on its card.
-
-###
-
-
-
-Monitor background processes
-
-Type `/tasks` in the prompt box to open the agent map, which lists the session’s background tasks, such as a dev server Claude left running as a background shell command. Click a task to open its card, where you can stop it. Requires Claude Code v2.1.277 or later. For a background shell command, or a [monitor](</docs/en/tools-reference#monitor-tool>) that runs a command, the card also shows the command’s latest output and refreshes it while the command runs.
-
-###
+##
Connect to external tools with MCP
-MCP (Model Context Protocol) servers give Claude access to external tools, databases, and APIs. To manage MCP servers without leaving VS Code, type `/mcp` in the chat panel. From the dialog that opens, you can add servers, remove servers saved at the local, user, or project [scope](</docs/en/mcp#mcp-installation-scopes>), enable or disable servers, reconnect to a server, and manage OAuth authentication. Adding and removing servers in the dialog requires Claude Code v2.1.261 or later. You can also run `claude mcp add` in VS Code’s integrated terminal (`Ctrl+`` or `Cmd+``). The dialog and the terminal command save to the same MCP configuration, and changes from either take effect in conversations you start afterwards. The example below adds GitHub’s remote MCP server, which authenticates with a [personal access token](<https://github.com/settings/personal-access-tokens>) passed as a header:
+MCP (Model Context Protocol) servers give Claude access to external tools, databases, and APIs. To manage MCP servers without leaving VS Code, type `/mcp` in the chat panel. From the dialog that opens, you can:
+
+ * Add servers
+ * Remove servers saved at the local, user, or project [scope](</docs/en/mcp#mcp-installation-scopes>)
+ * Enable or disable servers
+ * Reconnect to a server
+ * Manage OAuth authentication
+
+Adding and removing servers in the dialog requires Claude Code v2.1.261 or later. You can also run `claude mcp add` in VS Code’s integrated terminal (`Ctrl+`` or `Cmd+``). The dialog and the terminal command save to the same MCP configuration, and changes from either take effect in conversations you start afterwards. The example below adds GitHub’s remote MCP server, which authenticates with a [personal access token](<https://github.com/settings/personal-access-tokens>) passed as a header:
claude mcp add --transport http github https://api.githubcopilot.com/mcp/ \
--header "Authorization: Bearer YOUR_GITHUB_PAT"
-Replace `YOUR_GITHUB_PAT` with your personal access token. The `claude mcp add` command saves the configuration without validating credentials, so a placeholder value is accepted here but the server fails to connect later. To verify the connection, start a new conversation, type `/mcp`, and check that the server shows **Connected**. A server with bad credentials shows **Failed**. Once configured, ask Claude to use the tools (for example, “Review PR #456”). To find servers to connect, see [Find and build MCP servers](</docs/en/mcp#find-and-build-mcp-servers>).
-
-##
-
-
-
-Work with git
-
-Claude Code integrates with git to help with version control workflows directly in VS Code. Ask Claude to commit changes, create pull requests, or work across branches. To start Claude in an isolated worktree with its own files and branch, see [Run parallel sessions with worktrees](</docs/en/worktrees>).
-
-###
-
-
-
-Create commits and pull requests
-
-Claude can stage changes, write commit messages, and create pull requests based on your work:
-
- commit my changes with a descriptive message
- create a pr for this feature
- summarize the changes I've made to the auth module
-
-When creating pull requests, Claude generates descriptions based on the actual code changes and can add context about testing or implementation decisions.
-
-##
-
-
-
-Use third-party providers
-
-By default, Claude Code connects directly to Anthropic’s API. If your organization uses Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry to access Claude, configure the extension to use your provider instead:
-
-1
-
-Disable login prompt
-
-Open the [Disable Login Prompt setting](<vscode://settings/claudeCode.disableLoginPrompt>) and check the box.You can also open VS Code settings (`Cmd+,` on Mac or `Ctrl+,` on Windows/Linux), search for “Claude Code login”, and check **Disable Login Prompt**.
-
-2
-
-Configure your provider
-
-Follow the setup guide for your provider:
-
- * [Claude Code on Amazon Bedrock](</docs/en/amazon-bedrock>)
- * [Claude Code on Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>)
- * [Claude Code on Microsoft Foundry](</docs/en/microsoft-foundry>)
-
-These guides cover configuring your provider in `~/.claude/settings.json`, which ensures your settings are shared between the VS Code extension and the CLI.
-
-On a third-party provider, the extension doesn’t offer features that require a claude.ai account, such as plan usage bars, [voice dictation](</docs/en/voice-dictation>), and the Web tab for cloud sessions. For what the Account & usage dialog shows on these sign-ins, see Check account and usage. A claude.ai sign-in left over from an earlier `/login` stays unused: the extension doesn’t send it with any request.
-
-##
-
-
-
-Security and privacy
-
-Your code stays private. Claude Code processes your code to provide assistance but does not use it to train models. For details on data handling and how to opt out of logging, see [Data and privacy](</docs/en/data-usage>). With auto-edit permissions enabled, Claude Code can modify VS Code configuration files (like `settings.json` or `tasks.json`) that VS Code may execute automatically. To reduce risk when working with untrusted code:
-
- * Enable [VS Code Restricted Mode](<https://code.visualstudio.com/docs/editor/workspace-trust#_restricted-mode>) for untrusted workspaces
- * Use Manual mode instead of Edit automatically or Auto for edits
- * Review changes carefully before accepting them
-
-###
+Replace `YOUR_GITHUB_PAT` with your personal access token. The `claude mcp add` command saves the configuration without validating credentials, so a placeholder value is accepted here but the server fails to connect later. To verify the connection, start a new conversation, type `/mcp`, and check that the server shows **Connected**. A server with bad credentials shows **Failed**. Once configured, ask Claude to use the tools (for example, “Review PR #456”).
+
+To find servers to connect, see [Find and build MCP servers](</docs/en/mcp#find-and-build-mcp-servers>).
+
+##
The built-in IDE MCP server
-When the extension is active, it runs a local MCP server that the CLI connects to automatically. This is how the CLI opens diffs in VS Code’s native diff viewer, reads your current selection for `@`-mentions, and — when you’re working in a Jupyter notebook — asks VS Code to execute cells. The server is named `ide` and is hidden from `/mcp` because there’s nothing to configure. If your organization uses a `PreToolUse` hook to allowlist MCP tools, though, you’ll need to know it exists. **Selection and open-file context.** While connected, the CLI includes your current editor selection and the path of the active file as context on each prompt you send. The transcript shows a `⧉ Selected N lines from <file>` line when this happens. If you [queue a message while Claude works](</docs/en/interactive-mode#queue-messages-while-claude-works>), it keeps the selection you had when you pressed `Enter`, whatever you select afterward. To exclude a sensitive file such as `.env`, add a [`Read` deny rule](</docs/en/permissions#read-and-edit>) for its path. A matching deny rule prevents both the selected text and the open-file notice for that file from reaching Claude. If you turn off the Attach Open File setting, the CLI receives the active file’s path only while you have text selected in it. **Transport and authentication.** The server binds to `127.0.0.1` on a random port in the range 10000–65535, and the port is not configurable. The transport is unencrypted `ws://`; because the socket is loopback-only, any process that could capture the traffic can also read the token from the lock file, so TLS would not add protection. Each extension activation generates a fresh random auth token, writes it to a lock file at `~/.claude/ide/<port>.lock`, and the CLI must present it as the `X-Claude-Code-Ide-Authorization` header to connect. The lock file has `0600` permissions in a `0700` directory, so only the user running VS Code can read it. If `CLAUDE_CONFIG_DIR` is set, the lock file is written to `$CLAUDE_CONFIG_DIR/ide/` instead. **Tools exposed to the model.** The server hosts a dozen tools, but only two are visible to the model. The rest are internal RPC the CLI uses for its own UI, such as opening diffs, reading selections, and saving files. They are filtered out before the tool list reaches Claude.
+When the extension is active, it runs a local MCP server that the CLI connects to automatically. Through this server, the CLI:
+
+ * Opens diffs in VS Code’s native diff viewer
+ * Reads your current selection for `@`-mentions
+ * Asks VS Code to execute cells when you’re working in a Jupyter notebook
+
+The server is named `ide` and is hidden from `/mcp` because there’s nothing to configure. If your organization uses a `PreToolUse` hook to allowlist MCP tools, though, you’ll need to know it exists. **Selection and open-file context.** While connected, the CLI includes your current editor selection and the path of the active file as context on each prompt you send. The transcript shows a `⧉ Selected N lines from <file>` line when this happens. These cases change that context:
+
+ * **Queued messages** : if you [queue a message while Claude works](</docs/en/interactive-mode#queue-messages-while-claude-works>), it keeps the selection you had when you pressed `Enter`, whatever you select afterward.
+ * **Sensitive files** : to exclude a sensitive file such as `.env`, add a [`Read` deny rule](</docs/en/permissions#read-and-edit>) for its path. A matching deny rule prevents both the selected text and the open-file notice for that file from reaching Claude.
+ * **Attach Open File turned off** : if you turn off the Attach Open File setting, the CLI receives the active file’s path only while you have text selected in it.
+
+**Transport and authentication.** The server binds to `127.0.0.1` on a random port in the range 10000–65535, and the port is not configurable. The transport and the auth token work as follows:
+
+ * **Transport** : unencrypted `ws://`. Because the socket is loopback-only, any process that could capture the traffic can also read the token from the lock file, so TLS would not add protection.
+ * **Auth token** : each extension activation generates a fresh random auth token and writes it to a lock file at `~/.claude/ide/<port>.lock`. The CLI must present the token as the `X-Claude-Code-Ide-Authorization` header to connect.
+ * **Lock file permissions** : the lock file has `0600` permissions in a `0700` directory, so only the user running VS Code can read it. If `CLAUDE_CONFIG_DIR` is set, the lock file is written to `$CLAUDE_CONFIG_DIR/ide/` instead.
+
+**Tools exposed to the model.** The server hosts a dozen tools, but only two are visible to the model. The rest are internal RPC the CLI uses for its own UI, such as opening diffs, reading selections, and saving files. They are filtered out before the tool list reaches Claude.
Tool name (as seen by hooks)| What it does| Read-only
---|---|---
@@ -761,7 +837,13 @@
}
}
-A `Read` deny rule covers neither tool, so block them by name with a [deny rule](</docs/en/permissions#mcp>) as the example does. **Jupyter execution always asks first.** `mcp__ide__executeCode` can’t run anything silently. On each call, the code is inserted as a new cell at the end of the active notebook, VS Code scrolls it into view, and a native Quick Pick asks you to **Execute** or **Cancel**. Cancelling, or dismissing the picker with `Esc`, returns an error to Claude and nothing runs. The tool also refuses outright when there’s no active notebook, when the Jupyter extension (`ms-toolsai.jupyter`) isn’t installed, or when the kernel isn’t Python.
+A `Read` deny rule covers neither tool, so block them by name with a [deny rule](</docs/en/permissions#mcp>) as the example does. **Jupyter execution always asks first.** `mcp__ide__executeCode` can’t run anything silently. Each call goes through these steps:
+
+ 1. The code is inserted as a new cell at the end of the active notebook.
+ 2. VS Code scrolls the cell into view.
+ 3. A native Quick Pick asks you to **Execute** or **Cancel**.
+
+Cancelling, or dismissing the picker with `Esc`, returns an error to Claude and nothing runs. The tool also refuses outright when there’s no active notebook, when the Jupyter extension (`ms-toolsai.jupyter`) isn’t installed, or when the kernel isn’t Python.
The Quick Pick confirmation is separate from `PreToolUse` hooks. An allowlist entry for `mcp__ide__executeCode` lets Claude _propose_ running a cell; the Quick Pick inside VS Code is what lets it _actually_ run.
@@ -802,8 +884,8 @@
The Spark icon appears in the **Editor Toolbar** (top-right of editor) when you have a file open. If you don’t see it:
- 1. **Open a file** : The icon requires a file to be open. Having just a folder open isn’t enough.
- 2. **Check VS Code version** : Requires 1.94.0 or later (Help → About)
+ 1. **Open a file** : The icon requires a file to be open. Having only a folder open isn’t enough.
+ 2. **Check VS Code version** : Requires 1.94.0 or later. Check under **Help > About**
3. **Restart VS Code** : Run “Developer: Reload Window” from the Command Palette
4. **Disable conflicting extensions** : Temporarily disable other AI extensions (Cline, Continue, etc.)
5. **Check workspace trust** : The extension doesn’t work in Restricted Mode
@@ -876,7 +958,7 @@
To uninstall the Claude Code extension:
- 1. Open the Extensions view (`Cmd+Shift+X` on Mac or `Ctrl+Shift+X` on Windows/Linux)
+ 1. Press `Cmd+Shift+X` on Mac or `Ctrl+Shift+X` on Windows/Linux to open the Extensions view
2. Search for “Claude Code”
3. Click **Uninstall**
@@ -905,3 +987,4 @@
* [Explore common workflows](</docs/en/common-workflows>) to get the most out of Claude Code
* [Set up MCP servers](</docs/en/mcp>) to extend Claude’s capabilities with external tools. Add and manage them with `/mcp` in the chat panel.
* [Configure Claude Code settings](</docs/en/settings>) to customize allowed commands, hooks, and more. These settings are shared between the extension and CLI.
+ * [Review security safeguards](</docs/en/security>) and [data usage](</docs/en/data-usage>) for Claude Code
--- a/zero-data-retention.md
+++ b/zero-data-retention.md
@@ -64,6 +64,7 @@
Feature| Reason
---|---
[Cloud sessions](</docs/en/claude-code-on-the-web>), including those started from the [Desktop app](</docs/en/desktop#cloud-sessions>)| Requires server-side storage of session data, including conversation history with prompts and completions.
+[Chat and Cowork unified](<https://support.claude.com/en/articles/17444462-set-up-and-manage-the-new-unified-claude-experience-for-your-enterprise-organization>)| Requires cloud sessions.
[Claude Tag](<https://claude.com/docs/claude-tag>)| Retains channel memory and session transcripts.
[Artifacts](</docs/en/artifacts>)| Requires storing published page content on Anthropic-operated infrastructure.
Feedback submission (`/feedback`, `/bug`, `/share`)| Submitting feedback sends conversation data to Anthropic.