Changes on
27 changes detected
--- a/2026-w24.md
+++ b/2026-w24.md
@@ -22,7 +22,7 @@
> /agents
-[Spawn nested subagents](</docs/en/sub-agents#spawn-nested-subagents>)
+[Spawn nested subagents](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>)
Troubleshoot with safe modev2.1.169
--- a/accessibility.md
+++ b/accessibility.md
@@ -51,7 +51,13 @@
`Permission Required:`| A permission prompt waiting for your answer
`Cost:`| The session cost summary when Claude Code exits, if your account [shows costs](</docs/en/costs>)
-The terminal cursor follows the input caret, so a screen reader’s read-current-line command answers “where am I” with the prompt you’re editing. Cycling [permission modes](</docs/en/permission-modes>) with `Shift+Tab` announces the mode you land on, such as `[plan mode on]` or `[accept edits on]`. Claude Code prints the announcement once and doesn’t repeat it on later redraws. Requires Claude Code v2.1.210 or later.
+The terminal cursor follows the input caret, so a screen reader’s read-current-line command answers “where am I” with the prompt you’re editing. When you delete a word or a line in the input, Claude Code announces the deleted text. Requires Claude Code v2.1.218 or later. The announcement covers:
+
+ * Deleting a word with `Ctrl+W`, `Option+Delete` on macOS, or `Ctrl+Backspace` on Windows
+ * Deleting to the start of the line with `Ctrl+U` or `Cmd+Backspace`
+ * Deleting to the end of the line with `Ctrl+K`
+
+See the [text editing shortcuts](</docs/en/interactive-mode#text-editing>) for what each key does. Cycling [permission modes](</docs/en/permission-modes>) with `Shift+Tab` announces the mode you land on, such as `[plan mode on]` or `[accept edits on]`. Claude Code prints the announcement once and doesn’t repeat it on later redraws. Requires Claude Code v2.1.210 or later.
###
@@ -103,7 +109,7 @@
These options address accessibility needs outside of screen reader mode. All of them work alongside it.
- * The `CLAUDE_CODE_ACCESSIBILITY` [environment variable](</docs/en/env-vars>) is for screen magnifiers. Set `CLAUDE_CODE_ACCESSIBILITY=1` to keep the native terminal cursor visible so that magnifiers, such as macOS Zoom, can track the cursor position.
+ * The `CLAUDE_CODE_ACCESSIBILITY` [environment variable](</docs/en/env-vars>) is for screen magnifiers. Set `CLAUDE_CODE_ACCESSIBILITY=1` to keep the native terminal cursor visible so that magnifiers, such as macOS Zoom, can track the cursor position. The cursor follows keyboard focus: the input caret while you type, and the highlighted row as you move through menus and panels, such as `/config` and `/plugin`, with the arrow keys. Row tracking in menus and panels requires Claude Code v2.1.218 or later.
* The `prefersReducedMotion` [setting](</docs/en/settings#available-settings>) reduces or disables spinners, shimmer, and other animations without changing the rest of the interface.
* The `theme` [setting](</docs/en/settings#available-settings>) selects the interface colors, including the colorblind-friendly `dark-daltonized` and `light-daltonized` themes.
--- a/authentication.md
+++ b/authentication.md
@@ -171,7 +171,7 @@
Renew an expiring login
-When the login you created with `/login` is within five days of expiring, Claude Code shows a warning at startup: `Your login expires in 3 days · run /login to renew`. Requires Claude Code v2.1.203 or later. Run `/login` to renew. The warning is informational and never blocks a request: authentication keeps working until the login actually expires. The login lifetime itself is unchanged; the advance warning is what v2.1.203 adds. Once the stored login expires and can’t be refreshed, each request fails with [`Login expired · Please run /login`](</docs/en/errors#login-expired>) until you sign in again. Before v2.1.206, an expired login surfaced as a model error instead. You can check for this state before a request fails: [`/status`](</docs/en/commands>) shows a `Login` row reading `Expired — log in again`, plus the organization and email it has saved for the expired login. The row appears only when the saved claude.ai or Claude Console login is the active credential. The row requires Claude Code v2.1.210 or later. The warning appears only when a claude.ai or Claude Console login is the active credential, and not when a cloud provider, `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` supplies the credential. Renewing early matters most for sessions that run unattended. A [background session in agent view](</docs/en/agent-view>) or a [Remote Control](</docs/en/remote-control>) session that outlives the login stops making progress once the credential expires and can’t recover until you sign in again.
+When the login you created with `/login` is within three days of expiring, Claude Code shows a warning at startup: `Your login expires in 3 days · run /login to renew`. Requires Claude Code v2.1.203 or later. Before v2.1.217, the warning appeared five days out. Run `/login` to renew. The warning is informational and never blocks a request: authentication keeps working until the login actually expires. The login lifetime itself is unchanged; the advance warning is what v2.1.203 adds. Once the stored login expires and can’t be refreshed, each request fails with [`Login expired · Please run /login`](</docs/en/errors#login-expired>) until you sign in again. Before v2.1.206, an expired login surfaced as a model error instead. You can check for this state before a request fails: [`/status`](</docs/en/commands>) shows a `Login` row reading `Expired — log in again`, plus the organization and email it has saved for the expired login. The row appears only when the saved claude.ai or Claude Console login is the active credential. The row requires Claude Code v2.1.210 or later. The warning appears only when a claude.ai or Claude Console login is the active credential, and not when a cloud provider, `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` supplies the credential. Renewing early matters most for sessions that run unattended. A [background session in agent view](</docs/en/agent-view>) or a [Remote Control](</docs/en/remote-control>) session that outlives the login stops making progress once the credential expires and can’t recover until you sign in again.
###
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,48 @@
This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Run `claude --version` to check your installed version.
+
+
+
+2.1.218
+
+July 22, 2026
+
+ * Changed `/code-review` to run as a background subagent, so review work no longer fills your conversation and keeps stacked slash commands as its review target
+ * Added screen-reader announcements of deleted text for word and line deletions (`Option+Delete`, `Ctrl+W`, `Cmd+Backspace`, `Ctrl+U`, `Ctrl+K`) in `--ax-screen-reader` mode
+ * Fixed Windows paths with `\u`-prefixed segments (like `C:\Users\unicorn`) being corrupted into CJK characters in tool inputs, which made those files inaccessible
+ * Fixed the left arrow key discarding the conversation with no undo: presses right after editing now ask to confirm, and Esc in the agent view returns to the conversation it backgrounded
+ * Added HTTP status and error text to `claude mcp list` and `/mcp` when a server fails to connect, and a warning for MCP config values with hidden leading or trailing whitespace
+ * Fixed multi-line paste collapsing into one line with `j` in place of newlines in terminals that encode pasted newlines as Ctrl+J
+ * Fixed `/context` reporting stale pre-compact token usage after compacting from the message picker
+ * Fixed `/ultrareview` failing on descriptive arguments like “review my auth changes” — they now run a review of your current branch with the text applied as a note to the findings
+ * Fixed `/code-review ultra` silently running a local review in non-interactive sessions — it now launches the cloud review
+ * Fixed gateway spend metering to price Bedrock application-inference-profile ARNs and other config-mapped upstream model IDs at the configured model’s rates
+ * Fixed mojibake when a long IDE selection was truncated mid-emoji, and a case where a tool executor error could be silently dropped
+ * Fixed an engine teardown race that could start and abandon a phantom turn, and made input pushed after close consistently rejected
+ * Fixed spurious “[Request interrupted by user]” messages after interrupted tool calls, and an unpaired `tool_use` block left in the transcript when a tool aborted mid-response
+ * Fixed VoiceOver reading “new line” instead of echoing the typed space at the end of the input in `--ax-screen-reader` mode
+ * Fixed plugin and settings panels not moving the terminal cursor to the focused row, so screen readers and magnifiers can follow arrow-key navigation
+ * Fixed crashes (maximum call stack exceeded) when a deeply nested watched directory tree was deleted or moved, and when rendering deeply nested UI trees
+ * Fixed pull request events occasionally being lost when a session exited immediately after creating or linking a PR
+ * Fixed the Bedrock setup wizard failing profile verification for assume-role profiles in partitioned AWS regions and on proxy-only networks
+ * Fixed rare negative or incorrect turn duration measurements after a system clock adjustment by timing turns with a monotonic clock
+ * Fixed the “N MCP servers need authentication” startup notice over-counting claude.ai connectors that aren’t connected in claude.ai
+ * Fixed prompt history entries being dropped or duplicated when history writes raced or failed
+ * Fixed a retry loop that re-sent identical doomed requests after a context-overflow error with a large thinking budget; `Ctrl+B` backgrounding now applies the same background-shell caps as other paths
+ * Fixed agent frontmatter hooks running from untrusted folders: hooks now require the agent file’s own folder to have accepted workspace trust
+ * Fixed fork-session lineage being lost after compaction in headless and SDK sessions
+ * Fixed a resumed session failing every turn, or crashing on resume, when its history held a malformed delta attachment
+ * Improved `/ultrareview` error feedback so Claude can correct an invalid argument instead of retrying it unchanged
+ * Improved auto mode: the dangerous-rm, background-`&`, and suspicious-Windows-path checks no longer open permission dialogs; the auto-mode classifier adjudicates them instead
+ * Improved sandbox command restrictions for IDE interactions
+ * Improved trust dialogs to name the repository root the grant covers
+ * Changed `/deep-research` to start only when invoked manually; Claude no longer launches it on its own
+ * Changed plan mode with auto to no longer prompt for Bash commands the static analyzer can’t prove read-only; the auto-mode classifier judges them instead
+ * Added an announcement when fast mode changes as a result of switching models via `/config model=<x>` or Remote Control
+ * Changed server-managed settings so benign feature and cost toggles no longer trigger the settings-approval prompt
+ * Changed agent markdown files to reject agent names containing `:`, which is reserved for plugin namespacing
+ * Changed skills with `context: fork` to run in the background by default; opt out per skill with `background: false`
+ * Added `yes`/`no`/`on`/`off`/`1`/`0` (case-insensitive) as accepted values for skill and plugin frontmatter booleans, alongside `true`/`false`
+ * Fixed remote sessions continuing to send heartbeats after their worker was replaced, which left long-lived desktop and IDE processes retrying a rejected request every few seconds forever
--- a/claude-code-on-the-web.md
+++ b/claude-code-on-the-web.md
@@ -632,7 +632,7 @@
`--cloud` creates cloud sessions. `--remote-control` is unrelated: it exposes a local CLI session for monitoring from the web. See [Remote Control](</docs/en/remote-control>).
-Use `/tasks` in the Claude Code CLI to check progress, or open the session on claude.ai or the Claude mobile app to interact directly. From there you can steer Claude, provide feedback, or answer questions just like any other conversation.
+Use `/tasks` in the Claude Code CLI to check progress, or open the session on claude.ai or the Claude mobile app to interact directly. From there you can steer Claude, provide feedback, or answer questions as in any other conversation. If Claude asks a question and the session sits idle, you can still answer when you come back, up to environment expiry, and the session continues from your answer.
####
@@ -686,7 +686,7 @@
* **From`/tasks`**: run `/tasks` to see your background sessions, then press `t` to teleport into one.
* **From the web interface** : select **Open in CLI** to copy a command you can paste into your terminal.
-When you teleport a session, Claude verifies you’re in the correct repository, fetches and checks out the branch from the cloud session, and loads the full conversation history into your terminal. `--teleport` is distinct from `--resume`. `--resume` reopens a conversation from this machine’s local history and doesn’t list cloud sessions; `--teleport` pulls a cloud session and its branch.
+When you teleport a session, Claude verifies you’re in the correct repository, fetches and checks out the branch from the cloud session, and loads the full conversation history into your terminal. The terminal gets its own copy of the session: new work there stays local and doesn’t appear in the cloud session on claude.ai or the Claude mobile app. To keep steering from your phone after teleporting, start [`/remote-control`](</docs/en/remote-control>) in the local session. `--teleport` is distinct from `--resume`. `--resume` reopens a conversation from this machine’s local history and doesn’t list cloud sessions; `--teleport` pulls a cloud session and its branch.
####
Show diff (180 lines)
--- a/claude-security.md
+++ b/claude-security.md
@@ -0,0 +1,177 @@
+The Claude Security plugin runs a multi-agent vulnerability scan of your codebase inside a Claude Code session. A team of Claude agents maps your architecture, builds a threat model, hunts for vulnerabilities, and independently reviews every finding before writing the report. Use the plugin to scan a whole repository or only a set of changes, such as a branch’s diff, a pull request’s diff, or a single commit, then turn the findings you choose into patches that you review and apply yourself. The plugin runs locally in your session, and each scan counts against your plan’s usage limits. If you want a managed service that monitors your repositories, see the [Claude Security](<https://claude.com/product/claude-security>) product, available on the Enterprise plan. The plugin reaches code the managed product can’t reach, such as repositories hosted on GitLab or Bitbucket, or on networks that don’t allow inbound connections. The plugin is also distinct from the review tools already in Claude Code: the [security guidance plugin](</docs/en/security-guidance>) reviews code as Claude writes it, [`/security-review`](</docs/en/commands#all-commands>) runs a single pass over your branch, and [Code Review](</docs/en/code-review>) reviews pull requests. For how the layers stack, see How the plugin fits with other security tools.
+
+##
+
+
+
+Prerequisites
+
+To run the plugin, you need:
+
+ * Claude Code v2.1.154 or later on a paid plan, for the [dynamic workflows](</docs/en/workflows>) the scan uses to orchestrate its agents. On Pro, turn them on from the Dynamic workflows row in `/config`.
+ * Python 3.9.6 or later available on your `PATH` as `python3`. Check with `python3 --version`. The plugin’s tooling uses only the Python standard library, so nothing is installed.
+ * Linux, macOS, or Windows.
+ * Git, for change scans and for turning findings into patches; those jobs don’t support other version control systems. A full scan works in any directory, with or without version control.
+
+##
+
+
+
+Install the plugin
+
+In a Claude Code session, install from the [official Anthropic marketplace](</docs/en/discover-plugins#official-anthropic-marketplace>):
+
+ /plugin install claude-security@claude-plugins-official
+
+If Claude Code reports that the marketplace is not found, run `/plugin marketplace add anthropics/claude-plugins-official` first, then retry the install.
+
+Then activate the plugin in the current session with `/reload-plugins`, which applies pending plugin changes without a restart:
+
+ /reload-plugins
+
+The plugin is now active, and you’re ready to scan and fix your codebase.
+
+###
+
+
+
+Uninstall the plugin
+
+To remove the plugin, uninstall it from the `/plugin` menu, or run `claude plugin uninstall claude-security` in your terminal.
+
+##
+
+
+
+Scan and fix your codebase
+
+The plugin adds one command, `/claude-security`, which opens a menu of its three jobs: scanning the codebase, scanning a set of changes, and suggesting patches. The happy path runs a full scan, then turns its findings into patches:
+
+1
+
+Open the Claude Security menu
+
+Run `/claude-security` and pick **Scan codebase**.
+
+2
+
+Choose what to scan
+
+The plugin reads your repository first, then offers the whole repository or a focused area, with each option’s file count and relative cost stated. Pick the whole repository, or answer “I don’t know” and the plugin picks a sensible default for your repository’s size.
+
+3
+
+Confirm the run
+
+A scan may take a while, may use a significant number of tokens, and needs Claude Code left open while it completes. Nothing runs until you confirm.
+
+4
+
+Read the report
+
+While the scan runs, it reports each stage as it starts, with the detail available under [`/workflows`](</docs/en/workflows>). Results land in a timestamped directory in your repository, described in Read the scan results.
+
+5
+
+Turn findings into patches
+
+Run `/claude-security` again and pick **Suggest patches** , then choose which findings to address. Reviewed patches land in the report’s `patches/` folder; Fix findings covers how each patch is built and reviewed.
+
+6
+
+Apply the patches you accept
+
+Apply each patch from your shell with `git apply`, in its own pull request. Patches are never applied automatically.
+
+You don’t have to start from the menu: ask for a job directly, as arguments to the command, such as `/claude-security scan my branch`, or in plain language, such as “scan commit abc1234”. The plugin works best in [auto mode](</docs/en/permission-modes>), which lets the scan’s agents proceed without a permission prompt at each step; the plugin reminds you how to enable it when a job starts.
+
+###
+
+
+
+Scan only your changes
+
+When your branch has commits its base doesn’t, the `/claude-security` menu offers to scan only that diff, so you can check a branch before merging. You can also scan one of your open pull requests, or a single commit by asking for it, such as “scan commit abc1234”. Only committed changes are scanned: commit or stash in-progress edits first, or run a full scan, which reads the working tree. Change scans need a git repository; full scans of an unversioned directory still work. Finding your open pull requests is the one step that reaches the network, and it’s offered only when your session already has permission to run the GitHub CLI and `gh` is signed in.
+
+###
+
+
+
+Scope large repositories
+
+On a large repository, scan one area at a time instead of the whole tree. Pick one of the focused scopes the plugin offers, such as your API layer or your authentication code, and the run sizes itself to what you pick. The report’s coverage section states what was and wasn’t examined. Run another scan on a different area anytime.
+
+###
+
+
+
+Read the scan results
+
+Every scan writes its results into a timestamped `CLAUDE-SECURITY-<timestamp>/` directory in your repository:
+
+ * **`CLAUDE-SECURITY-RESULTS.md`** : the report, with each finding’s ID, such as `F1`, plus its impact, exploit scenario, severity, confidence, and recommendation
+ * **`CLAUDE-SECURITY-RESULTS.jsonl`** : the same findings in machine-readable form, one JSON object per line
+ * **`CLAUDE-SECURITY-REVISION-<commit>.json`**: the revision stamp, recording which commit was scanned, at what effort, whether uncommitted changes were part of the scanned tree, and how thoroughly the run was verified, so a report is always tied to the code it describes. A scan outside version control stamps `UNVERSIONED` in place of the commit
+
+That directory is the only change a scan makes to your checkout, and it carries its own `.gitignore`, so a stray `git add` never sweeps a report into a commit. To keep a report in history for an audit trail, delete that one `.gitignore` file and commit the directory like any other. Findings only appear in the report after independent verifier agents analyze them, which keeps reports short and worth reading. Scans are nondeterministic: two scans of the same code can surface different findings. Run scans regularly, and use the revision stamps to attribute each report to the exact code and settings it covered.
+
+##
+
+
+
+Fix findings
+
+Start the fix flow by picking **Suggest patches** from the `/claude-security` menu, or ask in plain language, such as “fix finding F3”, then pick which findings from the report to address. Patches are built against committed code, and the report has to still describe the code you have: findings whose code has since changed are skipped with a note, and the plugin offers a fresh scan instead of patching from a stale report. Each patch is drafted in a scratch copy of your repository, so your source files stay untouched until you apply a patch yourself. Before delivery, each patch is reviewed by an agent independent of the one that wrote it, which runs your project’s tests against the change when the code has them and reads the diff on its own terms for anything new it might introduce. A patch is written only when that review can vouch that the change addresses the one finding, introduces no new vulnerability, and leaves behavior otherwise unchanged. When it can’t vouch for all three, you get a short note explaining why instead of a patch.
+
+###
+
+
+
+Patches are never applied automatically
+
+Applying a patch is always your decision. Patches land in the report’s `patches/` folder, one `F<n>.patch` per finding with a note beside it explaining the change. Apply one from your shell, or ask Claude to apply it and open a pull request:
+
+ git apply CLAUDE-SECURITY-<timestamp>/patches/F1.patch
+
+When the patched code has no tests, the patch’s note says so, so you know its review ran without a test pass. Apply each patch in its own pull request so it can be reviewed and tested on its own.
+
+##
+
+
+
+How the plugin fits with other security tools
+
+The Claude Security plugin is the on-demand deep-scan layer in a defense-in-depth stack, alongside the [security guidance plugin](</docs/en/security-guidance>), [`/security-review`](</docs/en/commands#all-commands>), [Code Review](</docs/en/code-review>), the managed [Claude Security](<https://claude.com/product/claude-security>) product, and your existing scanners:
+
+Stage| Tool| What it covers
+---|---|---
+In session| [Security guidance plugin](</docs/en/security-guidance>)| Common vulnerabilities in code Claude writes, fixed in the same session
+On demand, single pass| [`/security-review`](</docs/en/commands#all-commands>)| One-time security pass on the current branch
+On demand, deep scan| Claude Security plugin| Multi-agent scan of a repository or diff, with independently reviewed findings and patches
+On pull request| [Code Review](</docs/en/code-review>), Team and Enterprise plans| Multi-agent correctness and security review with full codebase context
+Managed| [Claude Security](<https://claude.com/product/claude-security>), Enterprise plan| Hosted scanning that monitors connected repositories
+In CI| Your existing static analysis and dependency scanners| Language-specific rules, supply-chain checks, and policy enforcement
+
+The plugin doesn’t replace your existing source-code security tools. Run it alongside static analysis, dependency scanning, and code review: it reasons about your code the way a human security researcher would, which complements the deterministic checks those tools provide.
+
+##
+
+
+
+Troubleshooting
+
+**The`/claude-security` menu opens with a Python warning.** The plugin needs `python3` 3.9.6 or later on your `PATH`. When it can’t find `python3` at all, the menu warns that Claude Security won’t work until one is installed; when the first `python3` on your `PATH` is older, the warning names the version it found. Install Python 3, or put a newer `python3` first on your `PATH`, then start a new session.
+
+##
+
+
+
+Related resources
+
+To go deeper on the pieces this page touches:
+
+ * [Security guidance plugin](</docs/en/security-guidance>): catch issues in code as Claude writes it, in the same session
+ * [Code Review](</docs/en/code-review>): set up the PR-time multi-agent review
+ * [Claude Security](<https://claude.com/product/claude-security>): the managed service that monitors connected repositories
+ * [Claude Code security](</docs/en/security>): how Claude Code approaches trust, permissions, and safeguards
+ * [Discover and install plugins](</docs/en/discover-plugins#official-anthropic-marketplace>): browse other official plugins
--- a/costs.md
+++ b/costs.md
@@ -23,7 +23,7 @@
Usage by model:
claude-sonnet-4-6: 1.2k input, 5.3k output, 940.0k cache read, 50.0k cache write ($0.55)
-These totals reset when `/clear` starts a new session, so the next session’s total cost starts at $0. Before v2.1.211, they kept accumulating across `/clear` for the lifetime of the Claude Code process. On a Pro, Max, Team, or Enterprise plan, `/usage` also shows a breakdown of what counts against your plan limits. It attributes recent usage to skills, subagents, plugins, and individual MCP servers, with each shown as a percentage of the total. Press `d` or `w` to switch between the last 24 hours and the last 7 days. The figures are approximate and computed from local session history on this machine, so usage from other devices or claude.ai is not included. When the request for your plan limits fails, most often because the usage endpoint is rate limited, `/usage` shows the last usage bars it loaded on this machine within the past 60 minutes, along with a `Showing last-known usage` note stating how long ago that data was fetched. Press `r` to retry; a successful retry replaces the last-known bars with fresh data. Without a snapshot from the past 60 minutes, `/usage` reports that the usage endpoint is rate limited and offers the same retry shortcut. Before v2.1.208, a rate-limited request in a session that hadn’t loaded usage yet always showed the error with no bars. In the [VS Code extension](</docs/en/vs-code#check-account-and-usage>), the same breakdown appears in the Account & usage dialog with a Day and Week toggle. Requires Claude Code v2.1.174 or later.
+These totals reset when `/clear` starts a new session, so the next session’s total cost starts at $0. Before v2.1.211, they kept accumulating across `/clear` for the lifetime of the Claude Code process. On a Pro, Max, Team, or Enterprise plan, `/usage` also shows a breakdown of what counts against your plan limits. It attributes recent usage to skills, subagents, plugins, and individual MCP servers, with each shown as a percentage of the total. It also flags behaviors such as long context or cache misses when one accounts for 10% or more of recent usage. Press `d` or `w` to switch between the last 24 hours and the last 7 days. The figures are approximate and computed from local session history on this machine, so usage from other devices or claude.ai is not included. When the request for your plan limits fails, most often because the usage endpoint is rate limited, `/usage` shows the last usage bars it loaded on this machine within the past 60 minutes, along with a `Showing last-known usage` note stating how long ago that data was fetched. Press `r` to retry; a successful retry replaces the last-known bars with fresh data. Without a snapshot from the past 60 minutes, `/usage` reports that the usage endpoint is rate limited and offers the same retry shortcut. Before v2.1.208, a rate-limited request in a session that hadn’t loaded usage yet always showed the error with no bars. In the [VS Code extension](</docs/en/vs-code#check-account-and-usage>), the same breakdown appears in the Account & usage dialog with a Day and Week toggle. Requires Claude Code v2.1.174 or later.
###
@@ -311,6 +311,22 @@
+Why usage climbs in a long session
+
+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 message, so a one-line question in a session that has been open all day uses tokens for the whole conversation, not just the one line. 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
+ * **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
+ * **Agent teammates** : each active teammate keeps consuming tokens until it exits
+ * **Compaction** : `/compact` reads the conversation it summarizes, so [compacting a large context](</docs/en/prompt-caching#compacting-the-conversation>) is itself a large request. When you want a fresh start instead of continuity, `/clear` costs nothing
+
+On a Pro, Max, Team, or Enterprise plan, the `/usage` breakdown flags behaviors that account for 10% or more of your recent usage, such as long context or cache misses, each with a tip to reduce it.
+
+##
+
+
+
Understanding changes in Claude Code behavior
Claude Code regularly receives updates that may change how features work, including cost reporting. Run `claude --version` to check your current version. For billing questions about your specific account, contact Anthropic support through the in-product messenger:
--- a/desktop.md
+++ b/desktop.md
@@ -33,7 +33,7 @@
Before you send your first message, configure four things in the prompt area:
- * **Environment** : choose where Claude runs. Select **Local** for your machine, **Remote** for Anthropic-hosted cloud sessions, an **SSH connection** for a remote machine you manage, or on Windows a [**WSL distribution**](</docs/en/desktop-wsl>). See environment configuration.
+ * **Environment** : choose where Claude runs. Select **Local** for your machine, **Cloud** for Anthropic-hosted cloud sessions, an **SSH connection** for a remote machine you manage, or on Windows a [**WSL distribution**](</docs/en/desktop-wsl>). See environment configuration.
* **Project folder** : select the folder or repository Claude works in. For cloud sessions, you can add multiple repositories.
* **Model** : pick a [model](</docs/en/model-config#available-models>) from the dropdown next to the send button. You can change this during the session.
* **Permission mode** : choose how much autonomy Claude has from the mode selector. You can change this during the session.
@@ -391,7 +391,7 @@
Run long-running tasks remotely
-For large refactors, test suites, migrations, or other long-running tasks, select **Remote** instead of **Local** when starting a session. Cloud sessions run on Anthropic’s cloud infrastructure and continue even if you close the app or shut down your computer. Check back anytime to see progress or steer Claude in a different direction. You can also monitor cloud sessions from [claude.ai/code](<https://claude.ai/code>) or the [Claude mobile app](</docs/en/mobile>). Cloud sessions also support multiple repositories. After selecting a cloud environment, click the **+** button next to the repo pill to add additional repositories to the session. Each repo gets its own branch selector. This is useful for tasks that span multiple codebases, such as updating a shared library and its consumers. See [Claude Code on the web](</docs/en/claude-code-on-the-web>) for more on how cloud sessions work.
+For large refactors, test suites, migrations, or other long-running tasks, select **Cloud** instead of **Local** when starting a session. Cloud sessions run on Anthropic’s cloud infrastructure and continue even if you close the app or shut down your computer. Check back anytime to see progress or steer Claude in a different direction. You can also monitor cloud sessions from [claude.ai/code](<https://claude.ai/code>) or the [Claude mobile app](</docs/en/mobile>). Cloud sessions also support multiple repositories. After selecting a cloud environment, click the **+** button next to the repo pill to add additional repositories to the session. Each repo gets its own branch selector. This is useful for tasks that span multiple codebases, such as updating a shared library and its consumers. See [Claude Code on the web](</docs/en/claude-code-on-the-web>) for more on how cloud sessions work.
###
@@ -628,7 +628,7 @@
The environment you pick when starting a session determines where Claude executes and how you connect:
* **Local** : runs on your machine with direct access to your files
- * **Remote** : runs on Anthropic’s cloud infrastructure. Sessions continue even if you close the app.
+ * **Cloud** : runs on Anthropic’s cloud infrastructure. Sessions continue even if you close the app.
* **SSH** : runs on a remote machine you connect to over SSH, such as your own servers, cloud VMs, or dev containers
* **WSL** (Windows): runs inside a [WSL 2 distribution](</docs/en/desktop-wsl>) on your machine, using its Linux toolchain and native paths
--- a/desktop-quickstart.md
+++ b/desktop-quickstart.md
@@ -62,7 +62,7 @@
You can also select:
- * **Remote** : Run sessions on Anthropic’s cloud infrastructure that continue even if you close the app. Cloud sessions use the same infrastructure as [Claude Code on the web](</docs/en/claude-code-on-the-web>).
+ * **Cloud** : Run sessions on Anthropic’s cloud infrastructure that continue even if you close the app. Cloud sessions use the same infrastructure as [Claude Code on the web](</docs/en/claude-code-on-the-web>).
* **SSH** : Connect to a remote machine over SSH, such as your own servers, cloud VMs, or dev containers. Desktop installs Claude Code on the remote machine automatically the first time you connect.
* **WSL** (Windows): Run the session inside a [WSL 2 distribution](</docs/en/desktop-wsl>); Claude Code, tools, and git execute on the Linux side with native paths.
--- a/env-vars.md
+++ b/env-vars.md
@@ -241,10 +241,12 @@
`CLAUDE_CODE_IDE_HOST_OVERRIDE`| Override the host address used to connect to the IDE extension. By default Claude Code auto-detects the correct address, including WSL-to-Windows routing
`CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL`| Set to `1` to skip auto-installation of IDE extensions. Equivalent to setting [`autoInstallIdeExtension`](</docs/en/settings#global-config-settings>) to `false`
`CLAUDE_CODE_IDE_SKIP_VALID_CHECK`| Set to `1` to skip validation of IDE lockfile entries during connection. Use when auto-connect fails to find your IDE despite it running
+`CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS`| How many [subagents](</docs/en/sub-agents#concurrent-subagent-limit>) can be running in one session before the Agent tool refuses to spawn another (default: 20). Accepts a positive whole number in plain digits; anything else is ignored, so the variable can adjust the cap but can’t disable it. Requires Claude Code v2.1.217 or later
`CLAUDE_CODE_MAX_CONTEXT_TOKENS`| Override the context window size Claude Code assumes for the active model. As of v2.1.193, applied directly for model names Claude Code does not recognize as a Claude model; for recognized Claude models it only takes effect when `DISABLE_COMPACT` is also set. Use this when routing to a model through `ANTHROPIC_BASE_URL` whose context window does not match the built-in size for its name
`CLAUDE_CODE_MAX_OUTPUT_TOKENS`| Set the maximum number of output tokens for most requests. Defaults and caps vary by model; see [max output tokens](<https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison>). Increasing this value reduces the effective context window available before [auto-compaction](</docs/en/costs#reduce-token-usage>) triggers
`CLAUDE_CODE_MAX_RETRIES`| Override the number of times to retry failed API requests (default: 10). Capped at 15 as of v2.1.186; as of v2.1.199, `CLAUDE_CODE_RETRY_WATCHDOG` raises the default and removes the cap. For unattended sessions that need to wait through longer outages, set `CLAUDE_CODE_RETRY_WATCHDOG` instead
`CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION`| Cap on the number of [subagents](</docs/en/sub-agents#session-subagent-limit>) one session can spawn with the Agent tool (default: 200). When Claude reaches the cap, spawning another subagent fails with an error telling Claude to finish the remaining work directly. Accepts a positive whole number in plain digits with no upper bound; this variable doesn’t take the scientific notation or digit-separator spellings. Anything else is ignored and the default applies, so the cap can be raised but not turned off. Requires Claude Code v2.1.212 or later
+`CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`| Number of [subagent layers](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>) allowed below the main conversation (default: 1). At the default, subagents can’t spawn their own subagents; set `2` or higher to allow it. Accepts a positive whole number in plain digits; anything else is ignored, so the limit can be raised but not turned off. Requires Claude Code v2.1.217 or later
`CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY`| Maximum number of read-only tools and subagents that can execute in parallel (default: 10). Higher values increase parallelism but consume more resources
`CLAUDE_CODE_MAX_TURNS`| Cap the number of agentic turns when no explicit limit is passed. Equivalent to passing [`--max-turns`](</docs/en/cli-reference#cli-flags>), which takes precedence when both are set. A value that is not a positive integer is rejected at startup with an error rather than treated as no cap
`CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION`| Cap on the total number of [WebSearch](</docs/en/tools-reference#websearch-tool-behavior>) calls one session can make (default: 200). When Claude reaches the cap, further WebSearch calls return a notice telling it to continue with the information it already gathered. Accepts a positive whole number with no upper bound. Anything else is ignored and the default applies, so the cap can be raised but not turned off. Requires Claude Code v2.1.212 or later
--- a/errors.md
+++ b/errors.md
@@ -1296,7 +1296,13 @@
Agent would be spawned with zero tools
-Nothing in a [subagent’s `tools` list](</docs/en/sub-agents#supported-frontmatter-fields>) resolved to a tool, so Claude Code refuses to launch the subagent rather than start one that can’t act. The message groups the entries by why they didn’t resolve: not a recognized tool, a tool that isn’t available to subagents, or recognized but matching no tool in the current session. Omitting the `tools` field never triggers this refusal. An MCP server pattern such as `mcp__github__*` isn’t exempt: when no connected tool comes from that server, the launch is refused with the pattern in the matched-nothing group. Before v2.1.208, the subagent launched with no tools and returned an empty or confusing result.
+Every entry in the subagent’s [`tools` list](</docs/en/sub-agents#supported-frontmatter-fields>) failed to match a usable tool, so Claude Code refused to launch the subagent: with no tools, it couldn’t act. The message groups your entries by what went wrong:
+
+ * **Unrecognized** : the entry matches no tool name, usually a typo such as `Grpe` for `Grep`.
+ * **Not available to subagents** : the entry names a real tool that [subagents can’t use](</docs/en/sub-agents#available-tools>). Background subagents keep a smaller built-in tool set, so an entry that only a foreground subagent can use lands here when the subagent would run in the background, which is the default. If you list `Agent`, the message reports it under the next group instead.
+ * **Matched no tools in this session** : the entry is valid but no tool in the current session matches it right now, such as `mcp__github__*` with no GitHub MCP server connected, or `Agent` while [nested spawning](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>) is off.
+
+Omitting the `tools` field never triggers this refusal. If you leave the `tools` list empty, or `disallowedTools` removes every entry in it, Claude Code also skips the refusal and launches the subagent without tools. Before v2.1.208, the subagent launched with no tools and could return an empty or confusing result.
Agent 'code-reviewer' would be spawned with zero tools — refusing. Its tools list resolved to nothing: unrecognized [Grpe]. Fix the agent's tools frontmatter or pass a different subagent_type.
@@ -1304,7 +1310,9 @@
* 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
- * To give the subagent every [subagent-available](</docs/en/sub-agents#available-tools>) tool the parent has, delete the `tools` field instead of listing tools
+ * For a tool that [background subagents drop](</docs/en/sub-agents#available-tools>), such as `LSP` or `TaskCreate`, remove the entry or 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`, allow [nested spawning](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>) or give the agent at least one other tool: `Agent` isn’t available inside a subagent by default, so a list with nothing else in it resolves to no tools
###
--- a/hooks.md
+++ b/hooks.md
@@ -523,7 +523,7 @@
command: "./scripts/security-check.sh"
---
-Agents use the same format in their YAML frontmatter.
+Subagents use the same format in their YAML frontmatter. Frontmatter hooks in a project subagent run only after you accept the [workspace trust dialog](</docs/en/permissions#project-allow-rules-and-workspace-trust>) for the folder the agent file came from; see [which scopes are exempt](</docs/en/sub-agents#hooks-in-subagent-frontmatter>). Before v2.1.218, these hooks could run from folders you hadn’t trusted.
###
--- a/interactive-mode.md
+++ b/interactive-mode.md
@@ -53,7 +53,7 @@
`Ctrl+E`| Move cursor to end of current line| In multiline input, moves to the end of the current logical line
`Ctrl+K`| Delete to end of line| Stores deleted text for pasting
`Ctrl+U`| Delete from cursor to line start| Stores deleted text for pasting. Repeat to clear across lines in multiline input. On macOS, terminal emulators including iTerm2 and Terminal.app map `Cmd+Backspace` to this shortcut
-`Ctrl+W`| Delete previous word| Stores deleted text for pasting. On Windows, `Ctrl+Backspace` also deletes the previous word
+`Ctrl+W`| Delete previous word| Stores deleted text for pasting. On macOS, `Option+Delete` also deletes the previous word, and on Windows, `Ctrl+Backspace` does
`Ctrl+Y`| Paste deleted text| Paste text deleted with `Ctrl+K`, `Ctrl+U`, or `Ctrl+W`
`Alt+Y` (after `Ctrl+Y`)| Cycle paste history| After pasting, cycle through previously deleted text. Requires Option as Meta on macOS
`Alt+B`| Move cursor back one word| Word navigation. Requires Option as Meta on macOS
@@ -97,6 +97,7 @@
`/` at start| Command or skill| See commands and [skills](</docs/en/skills>)
`!` at start| Shell mode| Run a command directly, add its output to the session, and have Claude respond to it
`@`| File path mention| Trigger file path autocomplete
+`:`| Emoji shortcode| Type a full `:name:` to insert the emoji, or two or more characters for suggestions. See Emoji shortcodes. Requires Claude Code v2.1.217 or later
`?` on empty input| Toggle the shortcut help panel| Typing `?` when the input already contains text inserts the character. Before v2.1.211, an edit that left a lone `?` in the input, such as backspacing from `?x`, also toggled the panel and discarded the edit
###
@@ -332,7 +333,7 @@
* Background tasks have unique IDs for tracking and output retrieval
* Background tasks are automatically cleaned up when Claude Code exits. Backgrounding the session instead of exiting it hands them to the background session, where they keep running. See [background a running session](</docs/en/agent-view#from-inside-a-session>)
* Background tasks are automatically terminated if output exceeds 5GB, with a note in stderr explaining why
- * As of v2.1.193, on macOS and Linux, running background tasks are terminated when the operating system signals memory pressure, provided the session has been idle for at least 30 minutes with no turn or subagent running. Set [`CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP`](</docs/en/env-vars>) to `1` to turn this off
+ * On macOS and Linux, Claude Code terminates running background tasks when the operating system signals memory pressure, provided the session has been idle for at least 30 minutes and no turn or subagent is running. Set [`CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP`](</docs/en/env-vars>) to `1` to turn this off. Requires Claude Code v2.1.193 or later. Background commands owned by a [subagent](</docs/en/sub-agents>) are instead terminated after 60 minutes, configurable in milliseconds with [`CLAUDE_SUBAGENT_BG_SHELL_MAX_MS`](</docs/en/env-vars>). Before v2.1.218, neither limit covered commands moved to the background with `Ctrl+B`
To disable all background task functionality, set the `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` environment variable to `1`. See [Environment variables](</docs/en/env-vars>) for details. **Common backgrounded commands:**
@@ -386,6 +387,19 @@
+Emoji shortcodes
+
+Type a `:` followed by an emoji shortcode in the prompt input to insert the emoji. Requires Claude Code v2.1.217 or later.
+
+ * Type a complete shortcode such as `:heart:` and Claude Code replaces it with ❤️ as soon as you type the closing `:`
+ * Type `:` plus at least two characters of a name, such as `:hea`, to open a suggestion popup, then press `Tab` or `Enter` to insert the highlighted emoji
+
+The shortcode must start the input or follow a space, so a `:` inside a word or URL doesn’t open suggestions. To turn the feature off, set [`emojiCompletionEnabled`](</docs/en/settings#available-settings>) to `false` in `settings.json`. This disables both the suggestion popup and the inline replacement.
+
+##
+
+
+
Side questions with /btw
Use `/btw` to ask a quick question about your current work without adding to the conversation history. This is useful when you want a fast answer but don’t want to clutter the main context or derail Claude from a long-running task.
@@ -446,7 +460,7 @@
* Red: changes requested
* Gray: draft
-The badge disappears once the pull request merges or closes. `Cmd+click` (macOS) or `Ctrl+click` (Windows/Linux) the link to open the pull request in your browser. The status refreshes every 60 seconds, and immediately after a `gh pr` or `git push` command runs in the session.
+The badge disappears once the pull request merges or closes. `Cmd+click` (macOS) or `Ctrl+click` (Windows/Linux) the link to open the pull request in your browser. The status refreshes every 60 seconds, and immediately after a `gh pr` or `git push` command runs in the session. Claude Code renders the badge as a hyperlink even when it can’t detect hyperlink support in your terminal, which commonly happens over SSH or in tmux. Set [`FORCE_HYPERLINK=0`](</docs/en/env-vars>) to render the badge as plain text. Before v2.1.217, the badge was a hyperlink only when detection succeeded.
PR status requires the `gh` CLI to be installed and authenticated (`gh auth login`).
--- a/keybindings.md
+++ b/keybindings.md
@@ -54,7 +54,7 @@
`Task`| Background task is running
`ThemePicker`| Theme picker dialog
`Attachments`| Image attachment navigation in select dialogs
-`Footer`| Footer indicator navigation (tasks, teams, diff)
+`Footer`| Footer indicator navigation (tasks, teams, diff, artifacts)
`MessageSelector`| Rewind and summarize dialog message selection
`DiffDialog`| Diff viewer navigation
`ModelPicker`| Model picker effort level
@@ -289,6 +289,7 @@
`footer:down`| Down| Navigate down in footer
`footer:openSelected`| Enter| Open selected footer item
`footer:clearSelection`| Escape| Clear footer selection
+`footer:dismiss`| Backspace, Delete| Dismiss the selected [artifact](</docs/en/artifacts>) link from the footer; the published artifact itself is unaffected. On other footer rows, these keys have no effect. Requires v2.1.217 or later
###
--- a/mcp.md
+++ b/mcp.md
@@ -475,7 +475,7 @@
Authenticate with remote MCP servers
-Many cloud-based MCP servers require authentication. Claude Code supports OAuth 2.0 for secure connections. Claude Code marks a remote server as needing authentication when the server responds with `401 Unauthorized` or `403 Forbidden`. For a server you haven’t signed in to, either status code flags it in `/mcp` so you can complete the OAuth flow. When a request to an OAuth server you already signed in to returns `401 Unauthorized`, Claude Code refreshes the stored token, reconnects, and retries the request once. It flags the server in `/mcp` only if that retry also fails. Before v2.1.206, a token refresh that failed for a transient reason, such as a network error, flagged an OAuth server as needing authentication for the rest of the session even though its refresh token was still valid. As of v2.1.195, when a token refresh fails because the server rejects the stored refresh token, Claude Code immediately shows a notice pointing at `/mcp`. The connected server’s menu there offers Re-authenticate, so you can sign in again before the next tool call fails. A custom server that returns a `WWW-Authenticate` header pointing to its authorization server gets the same automatic discovery as any other remote server. As of v2.1.193, Claude Code also shows a startup notice when one or more configured servers need authentication, so you don’t have to open `/mcp` to discover which servers need sign-in. In non-interactive mode there’s no `/mcp` panel, so Claude Code can’t run the OAuth flow for you. As of v2.1.196, when a configured server needs authentication during a `claude -p` or Agent SDK run with tool search enabled, which is the default, Claude Code tells Claude that the server’s tools are unavailable until you authorize it. Claude can then name the server that needs sign-in instead of responding as if the server weren’t configured. Complete the sign-in from an interactive session with `/mcp` or `claude mcp login <name>`. If you configured `headers.Authorization` for the server and the server rejects that header, Claude Code reports the connection as failed instead of falling back to OAuth. Check that the token is valid for the MCP endpoint, or remove the header to use the OAuth flow.
+Many cloud-based MCP servers require authentication. Claude Code supports OAuth 2.0 for secure connections. Claude Code marks a remote server as needing authentication when the server responds with `401 Unauthorized` or `403 Forbidden`. For a server you haven’t signed in to, either status code flags it in `/mcp` so you can complete the OAuth flow. When a request to an OAuth server you already signed in to returns `401 Unauthorized`, Claude Code refreshes the stored token, reconnects, and retries the request once. It flags the server in `/mcp` only if that retry also fails. Before v2.1.206, a token refresh that failed for a transient reason, such as a network error, flagged an OAuth server as needing authentication for the rest of the session even though its refresh token was still valid. As of v2.1.195, when a token refresh fails because the server rejects the stored refresh token, Claude Code immediately shows a notice pointing at `/mcp`. The connected server’s menu there offers Re-authenticate, so you can sign in again before the next tool call fails. A custom server that returns a `WWW-Authenticate` header pointing to its authorization server gets the same automatic discovery as any other remote server. Claude Code also shows a startup notice when one or more configured servers need authentication, so you don’t have to open `/mcp` to discover which servers need sign-in. The notice requires Claude Code v2.1.193 or later. It counts only servers you can sign in to from Claude Code. Before v2.1.218, it also counted claude.ai connectors that weren’t connected in claude.ai, which you can connect only from claude.ai settings. In non-interactive mode there’s no `/mcp` panel, so Claude Code can’t run the OAuth flow for you. As of v2.1.196, when a configured server needs authentication during a `claude -p` or Agent SDK run with tool search enabled, which is the default, Claude Code tells Claude that the server’s tools are unavailable until you authorize it. Claude can then name the server that needs sign-in instead of responding as if the server weren’t configured. Complete the sign-in from an interactive session with `/mcp` or `claude mcp login <name>`. If you configured `headers.Authorization` for the server and the server rejects that header, Claude Code reports the connection as failed instead of falling back to OAuth. Check that the token is valid for the MCP endpoint, or remove the header to use the OAuth flow.
1
--- a/memory.md
+++ b/memory.md
@@ -223,7 +223,7 @@
- "tests/**/*.test.ts"
---
-Glob syntax treats `[` as the start of a bracket expression such as `[abc]`. A pattern with a `[` that can’t be read as a bracket expression, such as `photos [2024/**`, is invalid: it matches nothing, and the rule’s other patterns keep working. To match a literal `[` in a file name, escape it as `photos \[2024/**`. Before v2.1.207, one invalid pattern made the Read tool fail for every file the rule was evaluated against, instead of matching nothing.
+Each brace group multiplies the number of expanded patterns: `src/*.{ts,tsx}` expands to two patterns, and `{a,b}/{c,d}/*.{ts,tsx}` to eight. To keep expansion bounded, a rule’s whole `paths` list shares one budget of 1,000 expanded patterns and 4 MiB, and patterns without braces don’t count against it. Claude Code uses any pattern that would exceed the budget unexpanded, and its literal braces match no files. Before v2.1.217, a `paths` value with many brace groups stalled or crashed the CLI at startup. Glob syntax treats `[` as the start of a bracket expression such as `[abc]`. A pattern with a `[` that can’t be read as a bracket expression, such as `photos [2024/**`, is invalid: it matches nothing, and the rule’s other patterns keep working. To match a literal `[` in a file name, escape it as `photos \[2024/**`. Before v2.1.207, one invalid pattern made the Read tool fail for every file the rule was evaluated against, instead of matching nothing.
####
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -56,6 +56,19 @@
Claude Code doesn’t pass `OTEL_*` environment variables to the subprocesses it spawns, including the Bash tool, hooks, MCP servers, and language servers. An OpenTelemetry-instrumented application that you run through the Bash tool doesn’t inherit Claude Code’s exporter endpoint or headers, so set those variables directly in the command if that application needs to export its own telemetry.
+###
+
+
+
+Managed endpoints govern signal-specific endpoints
+
+A generic `OTEL_EXPORTER_OTLP_ENDPOINT` set in managed settings governs every signal’s endpoint. If a lower-precedence source, such as user settings or a shell export, sets a signal-specific endpoint like `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`, Claude Code removes that variable at startup and logs a warning, visible with `claude --debug`. Users can’t point one signal’s OTLP traffic at a different endpoint, so you don’t need to set the signal-specific endpoint variables in managed settings to prevent it. This applies only on machines where an administrator deploys managed settings with telemetry configured, and it changes where telemetry is delivered, not what Claude Code collects. A managed `OTEL_EXPORTER_OTLP_HEADERS`, `OTEL_EXPORTER_OTLP_CLIENT_KEY`, or `OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE` variable also governs the endpoint variables, since those credentials would otherwise accompany telemetry to a collector the managed settings didn’t choose. Two cases keep the normal per-key precedence:
+
+ * Signal-specific variables set in the managed settings file itself still apply, so you can route one signal to a different collector by setting them there, as the SIEM example does.
+ * The exporter selectors (`OTEL_METRICS_EXPORTER`, `OTEL_LOGS_EXPORTER`, and the beta `OTEL_TRACES_EXPORTER`) and the protocol variables follow per-key precedence, so a lower-precedence source can still change how a signal is exported. To make those authoritative too, set the signal-specific keys in managed settings directly.
+
+Before v2.1.217, every variable followed per-key settings precedence independently, so a signal-specific endpoint set in user settings or the shell redirected that signal away from the managed collector.
+
##
@@ -67,6 +80,8 @@
Common configuration variables
+
+These variables configure exporters, endpoints, and export behavior for all deployments. A signal-specific variable overrides its generic counterpart, except that a generic endpoint or credential variable set in managed settings governs all signals’ endpoints and can’t be overridden from lower-precedence sources.
Environment Variable| Description| Example Values
---|---|---
@@ -132,7 +147,7 @@
Traces (beta)
-Distributed tracing exports spans that link each user prompt to the API requests and tool executions it triggers, so you can view a full request as a single trace in your tracing backend. Tracing is off by default. To enable it, set both `CLAUDE_CODE_ENABLE_TELEMETRY=1` and `CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1`, then set `OTEL_TRACES_EXPORTER` to choose where spans are sent. Traces reuse the common OTLP configuration for endpoint, protocol, headers, and mTLS.
+Distributed tracing exports spans that link each user prompt to the API requests and tool executions it triggers, so you can view a full request as a single trace in your tracing backend. Tracing is off by default. To enable it, set both `CLAUDE_CODE_ENABLE_TELEMETRY=1` and `CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1`, then set `OTEL_TRACES_EXPORTER` to choose where spans are sent. Traces reuse the common OTLP configuration for endpoint, protocol, headers, and mTLS. A generic endpoint or credential variable set in managed settings governs the traces endpoint too, so the `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` override in the table below applies only when managed settings don’t set one.
Environment Variable| Description| Example Values
---|---|---
--- a/python.md
+++ b/python.md
@@ -1245,7 +1245,7 @@
---|---|---
`description`| Yes| Natural language description of when to use this agent
`prompt`| Yes| The agent’s system prompt
-`tools`| No| Array of allowed tool names. If omitted, inherits all tools
+`tools`| No| Array of allowed tool names. If omitted, inherits every [tool available to subagents](</docs/en/sub-agents#available-tools>)
`disallowedTools`| No| Array of tool names to remove from the agent’s tool set. MCP server-level patterns are also accepted: `mcp__server` or `mcp__server__*` removes every tool from that server, and `mcp__*` removes every MCP tool from any server
`model`| No| Model override for this agent. Accepts an alias such as `"sonnet"`, `"opus"`, `"haiku"`, or `"inherit"`, or a full model ID. If omitted, uses the main model
`skills`| No| List of skill names to preload into the agent’s context at startup. Unlisted skills remain invocable through the Skill tool
--- a/routines.md
+++ b/routines.md
@@ -22,7 +22,7 @@
Create a routine
-Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app, click **Routines** in the sidebar, then **New routine** , and choose **Remote** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select and their branch-push setting, the [environment’s](</docs/en/claude-code-on-the-web#the-cloud-environment>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services.
+Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select and their branch-push setting, the [environment’s](</docs/en/claude-code-on-the-web#the-cloud-environment>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services.
###
--- a/security-guidance.md
+++ b/security-guidance.md
@@ -245,7 +245,8 @@
Stage| Tool| What it covers
---|---|---
In session| Security guidance plugin| Common vulnerabilities in code Claude writes, fixed in the same session
-On demand| [`/security-review`](</docs/en/commands#all-commands>)| One-time security pass on the current branch, run when you ask
+On demand, single pass| [`/security-review`](</docs/en/commands#all-commands>)| One-time security pass on the current branch, run when you ask
+On demand, deep scan| [Claude Security plugin](</docs/en/claude-security>)| Multi-agent vulnerability scan of a repository or diff, with independently reviewed findings and patches
On pull request| [Code Review](</docs/en/code-review>), Team and Enterprise plans| Multi-agent correctness and security review with full codebase context
In CI| Your existing static analysis and dependency scanners| Language-specific rules, supply-chain checks, and policy enforcement the plugin does not attempt
--- a/sessions.md
+++ b/sessions.md
@@ -107,7 +107,15 @@
claude --continue --fork-session
-The original session is unchanged and remains available in the session picker. The `/branch` confirmation prints two session IDs: the new branch you are now in and the original. To return to the original, pass its ID to `/resume`, use the session picker, or run `/resume <original-name>`. Permissions you approved with “allow for this session” do not carry over to the new branch. If you resume the same session in two terminals without forking, messages from both interleave into one transcript. For checkpoint-based rewind within a single session, see [Checkpointing](</docs/en/checkpointing>).
+The `/branch` confirmation prints two session IDs: the new branch you are now in and the original. The original is unchanged on disk and remains in the session picker; return to it with `/resume <original-name>` or by passing its ID to `/resume`. `/branch` copies the transcript and switches the running Claude Code process to write to it. That distinction determines what the branch inherits:
+
+State| After `/branch`
+---|---
+Conversation history| Copied into the branch up to the point you ran `/branch`
+”Allow for this session” permission grants| Carried over; the branch runs in the same process, so your existing grants still apply. If you fork into a separate process with `--fork-session`, the new process starts without them and you re-approve there
+In-flight [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) and [background Bash commands](</docs/en/interactive-mode#background-bash-commands>)| Keep running. Their output appears in the new branch you switched into, not in the original session
+
+If you resume the same session in two terminals without forking, messages from both interleave into one transcript. For checkpoint-based rewind within a single session, see [Checkpointing](</docs/en/checkpointing>).
##
--- a/settings.md
+++ b/settings.md
@@ -259,6 +259,7 @@
`disableWorkflows`| **Default** : `false`. Disable [dynamic workflows](</docs/en/workflows#turn-workflows-off>) and the bundled workflow commands. Equivalent to setting `CLAUDE_CODE_DISABLE_WORKFLOWS` to `1`| `true`
`editorMode`| **Default** : `"normal"`. Key binding mode for the input prompt: `"normal"` or `"vim"`. Appears in `/config` as **Editor mode**| `"vim"`
`effortLevel`| Persist the [effort level](</docs/en/model-config#adjust-effort-level>) across sessions. Accepts `"low"`, `"medium"`, `"high"`, or `"xhigh"`. Written automatically when you run `/effort` with one of those values. `--effort` and [`CLAUDE_CODE_EFFORT_LEVEL`](</docs/en/env-vars>) override this for one session. See [Adjust effort level](</docs/en/model-config#adjust-effort-level>) for supported models| `"xhigh"`
+`emojiCompletionEnabled`| **Default** : `true`. Show emoji suggestions when you type `:` plus a shortcode in the prompt input, and replace a completed shortcode such as `:heart:` with its emoji. Set to `false` to disable both. See [Emoji shortcodes](</docs/en/interactive-mode#emoji-shortcodes>). Requires Claude Code v2.1.217 or later| `false`
`enableAllProjectMcpServers`| Automatically approve all MCP servers defined in project `.mcp.json` files. As of v2.1.196, `claude mcp list` and `claude mcp get` honor this key in an untrusted folder only from [settings files that aren’t checked into the repository](</docs/en/mcp#managing-your-servers>)| `true`
`enableArtifact`| Enable or disable the [Artifact](</docs/en/artifacts>) tool for this user. When unset, the default follows the feature’s [availability](</docs/en/artifacts#availability>) for your account. The **Artifacts** row in `/config` writes this key. A managed `disableArtifact` and your organization’s [admin setting](</docs/en/artifacts#manage-artifacts-for-your-organization>) take precedence, and the key is ignored in project and local settings (`.claude/settings.json`, `.claude/settings.local.json`), which a repository could otherwise commit. Requires Claude Code v2.1.196 or later| `true`
`enabledMcpjsonServers`| List of specific MCP servers from `.mcp.json` files to approve. As of v2.1.196, `claude mcp list` and `claude mcp get` honor this key in an untrusted folder only from [settings files that aren’t checked into the repository](</docs/en/mcp#managing-your-servers>)| `["memory", "github"]`
@@ -421,6 +422,7 @@
`filesystem.denyRead`| Paths where sandboxed commands cannot read. Arrays are merged across all settings scopes. Also merged with paths from `Read(...)` deny permission rules.| `["~/.aws/credentials"]`
`filesystem.allowRead`| Paths to re-allow reading within `denyRead` regions. An `allowRead` path re-opens reading inside a broader `denyRead` region, and an exact path in `denyRead` stays blocked inside a broader `allowRead`; see the [overlap table](</docs/en/sandboxing#configure-sandboxing>) for examples. Arrays are merged across all settings scopes. Use this to create workspace-only read access patterns.| `["."]`
`filesystem.allowManagedReadPathsOnly`| (Managed settings only) Only `filesystem.allowRead` paths from managed settings are respected. `denyRead` still merges from all sources. Default: false| `true`
+`filesystem.disabled`| Skip filesystem isolation while keeping network isolation: sandboxed commands get unrestricted read and write access to the host filesystem, and network egress stays confined to `network.allowedDomains`. Only honored from user, managed, or CLI `--settings` settings. Default: false. Requires Claude Code v2.1.216 or later. See [Disable filesystem isolation](</docs/en/sandboxing#disable-filesystem-isolation>) for which sources can set it and what changes when isolation is off| `true`
`credentials.files`| Credential files or directories that sandboxed commands cannot read. Applies the same read block as `filesystem.denyRead`; the separate key keeps credential paths grouped with `credentials.envVars` and apart from general filesystem rules. Each entry is `{ "path": "...", "mode": "deny" }`, and `deny` is the only supported mode for files. Paths use the same prefixes as `filesystem.*` settings. Arrays are merged across all settings scopes. Requires Claude Code v2.1.187 or later.| `[{ "path": "~/.aws/credentials", "mode": "deny" }]`
`credentials.envVars`| Environment variables to [protect from sandboxed commands](</docs/en/sandboxing#protect-credentials>). Each entry has a `name` and a `mode`; the name must start with a letter or underscore and contain only letters, digits, and underscores. `deny` removes the variable from the environment of sandboxed commands. Requires Claude Code v2.1.187 or later. `mask` replaces the variable with a per-session sentinel value inside the sandbox while the sandbox proxy substitutes the real value on outbound requests to that entry’s `injectHosts`; it requires `network.tlsTerminate` and Claude Code v2.1.199 or later. `mask` entries are only honored from user, managed, or CLI `--settings` settings, not from `.claude/settings.json` or `.claude/settings.local.json`. Arrays are merged across all settings scopes, and `deny` takes precedence when the same variable appears with both modes.| `[{ "name": "GITHUB_TOKEN", "mode": "deny" }]`
`credentials.envVars[].injectHosts`| Hosts where the sandbox proxy substitutes the real value of a `mask` entry. Each host must also be covered by `network.allowedDomains`, either exactly or by a wildcard. When unset, the proxy substitutes the value on requests to every host in `network.allowedDomains`. Accepted but ignored when `mode` is `deny`. Requires Claude Code v2.1.199 or later. | `["api.github.com"]`
@@ -479,7 +481,7 @@
**Filesystem and network restrictions** can be configured in two ways that are merged together:
- * **`sandbox.filesystem` settings** (shown above): Control paths at the OS-level sandbox boundary. These restrictions apply to all subprocess commands (e.g., `kubectl`, `terraform`, `npm`), not just Claude’s file tools.
+ * **`sandbox.filesystem` settings** (shown above): Control paths at the OS-level sandbox boundary, or set `filesystem.disabled` to `true` to turn that layer off entirely. These restrictions apply to all subprocess commands (e.g., `kubectl`, `terraform`, `npm`), not just Claude’s file tools.
* **Permission rules** : Use `Edit` allow/deny rules to control Claude’s file tool access, `Read` deny rules to block reads (a `Read` deny rule also blocks the Edit tool on the matching paths), and `WebFetch` allow/deny rules to control network domains. Paths from these rules are also merged into the sandbox configuration.
###
Show diff (171 lines)
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -47,7 +47,7 @@
A capable agent for complex, multi-step tasks that require both exploration and action.
* **Model** : inherits from the main conversation
- * **Tools** : all tools
+ * **Tools** : every tool available to subagents
* **Purpose** : complex research, multi-step operations, code modifications
Claude delegates to general-purpose when the task requires both exploration and modification, complex reasoning to interpret results, or multiple dependent steps.
@@ -208,7 +208,7 @@
You are a code reviewer. When invoked, analyze the code and provide
specific, actionable feedback on quality, security, and best practices.
-The frontmatter defines the subagent’s metadata and configuration. The body becomes the system prompt that guides the subagent’s behavior. Subagents receive only this system prompt plus basic environment details like the working directory, not the full Claude Code system prompt. In [non-interactive mode](</docs/en/headless>), the [`--append-subagent-system-prompt`](</docs/en/cli-reference#cli-flags>) flag appends the text you provide to the end of every subagent’s system prompt, including nested subagents. Requires Claude Code v2.1.205 or later. A subagent starts in the main conversation’s current working directory. Within a subagent, `cd` commands don’t persist between Bash or PowerShell tool calls and don’t affect the main conversation’s working directory. To give the subagent an isolated copy of the repository instead, set `isolation: worktree`. A subagent with `isolation: worktree` runs its Bash and PowerShell commands inside its worktree. A command whose working directory resolves to your main checkout instead, for example because the worktree directory was removed while the subagent was running, fails with an error. Before v2.1.203, such a command could run in the main checkout. This working-directory check covers the whole repository containing the directory you launched Claude Code from. When your session runs in a linked [worktree](</docs/en/worktrees>) of its own, the check also covers the main checkout that worktree is linked from. Before v2.1.210, the check covered only the launch directory itself. A command whose working directory resolved elsewhere in the same repository, such as the repository root when you launched Claude Code from a monorepo subdirectory, ran there instead of failing.
+The frontmatter defines the subagent’s metadata and configuration. The body becomes the system prompt that guides the subagent’s behavior. Subagents receive only this system prompt plus basic environment details like the working directory, not the full Claude Code system prompt. In [non-interactive mode](</docs/en/headless>), the [`--append-subagent-system-prompt`](</docs/en/cli-reference#cli-flags>) flag appends the text you provide to the end of every subagent’s system prompt, including nested subagents. Requires Claude Code v2.1.205 or later. A subagent starts in the main conversation’s current working directory. Within a subagent, `cd` commands don’t persist between Bash or PowerShell tool calls and don’t affect the main conversation’s working directory. To give the subagent an isolated copy of the repository instead, set `isolation: worktree`. A subagent with `isolation: worktree` runs its Bash and PowerShell commands inside its worktree. A command whose working directory resolves to your main checkout instead, for example because the worktree directory was removed while the subagent was running, fails with an error. Before v2.1.203, such a command could run in the main checkout. This working-directory check covers the whole repository containing the directory you launched Claude Code from. When your session runs in a linked [worktree](</docs/en/worktrees>) of its own, the check also covers the main checkout that worktree is linked from. Before v2.1.210, the check covered only the launch directory itself. A command whose working directory resolved elsewhere in the same repository, such as the repository root when you launched Claude Code from a monorepo subdirectory, ran there instead of failing. For Bash commands, Claude Code also checks the command itself: a command that redirects git into the main checkout fails with an error, whether it uses `git -C`, `--git-dir`, a `GIT_DIR` or `GIT_WORK_TREE` variable, or a `cd` into the main checkout first. A command too complex to check also fails, with an error telling Claude to split it into separate plain commands. This check applies to Bash only; PowerShell commands get only the working-directory check.
####
@@ -222,7 +222,7 @@
---|---|---
`name`| Yes| Unique identifier using lowercase letters and hyphens. [Hooks](</docs/en/hooks#subagentstart>) receive this value as `agent_type`. The filename doesn’t have to match
`description`| Yes| When Claude should delegate to this subagent
-`tools`| No| Tools the subagent can use. Inherits all tools if omitted. If no entry in the list resolves to a tool, the subagent fails to launch with an error naming the entries. To preload Skills into context, use the `skills` field rather than listing `Skill` here
+`tools`| No| Tools the subagent can use. Inherits every tool available to subagents if omitted. If no entry in the list resolves to a tool, the subagent usually [fails to launch](</docs/en/errors#agent-would-be-spawned-with-zero-tools>) with an error naming the entries. To preload Skills into context, use the `skills` field rather than listing `Skill` here
`disallowedTools`| No| Tools to deny, removed from inherited or specified list
`model`| No| Model to use: `sonnet`, `opus`, `haiku`, `fable`, a full model ID (for example, `claude-opus-4-8`), or `inherit`. Defaults to `inherit`
`permissionMode`| No| Permission mode: `default`, `acceptEdits`, `auto`, `dontAsk`, `bypassPermissions`, `plan`, or `manual` as an alias for `default`. The `manual` alias requires Claude Code v2.1.200 or later. Ignored for plugin subagents
@@ -273,16 +273,19 @@
Available tools
-Subagents inherit the [internal tools](</docs/en/tools-reference>) and MCP tools available in the main conversation by default. The following tools depend on the main conversation’s UI or session state and aren’t available to subagents, even when listed in the `tools` field:
-
+Subagents inherit the [built-in tools](</docs/en/tools-reference>) and MCP tools available in the main conversation, narrowed by two filters: the first removes a short list of tools from every subagent, and the second reduces the built-in tool set for subagents that run in the background, which is the default. Forks skip both filters and receive the main conversation’s exact tool pool. The first filter removes these tools, even when listed in the `tools` field:
+
+ * `Agent`, until you turn on nested spawning; in a fork the tool stays listed but returns an error instead of spawning
* `AskUserQuestion`
* `EndConversation`, which can end only the main conversation; see [EndConversation tool behavior](</docs/en/tools-reference#endconversation-tool-behavior>)
* `EnterPlanMode`
* `ExitPlanMode`, unless the subagent’s `permissionMode` is `plan`
* `ScheduleWakeup`
+ * `TaskOutput`
* `WaitForMcpServers`
-
-The `Agent` tool itself is inherited, so a subagent can spawn nested subagents. 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:
+ * `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`, `Bash`, `PowerShell`, `Edit`, `Write`, `NotebookEdit`, `WebFetch`, `WebSearch`, `TodoWrite`, `Skill`, `ToolSearch`, `EnterWorktree`, `ExitWorktree`, `Monitor`, `TaskStop`, `SendMessage`, and `Artifact`. 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>). Teammates in [agent teams](</docs/en/agent-teams>) additionally keep the task tools and cron tools: `TaskCreate`, `TaskGet`, `TaskList`, `TaskUpdate`, `CronCreate`, `CronDelete`, and `CronList`. 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:
---
name: safe-researcher
@@ -290,15 +293,15 @@
tools: Read, Grep, Glob, Bash
---
-This example uses `disallowedTools` to inherit every tool from the main conversation except Write and Edit. The subagent keeps Bash, MCP tools, and everything else:
+This example uses `disallowedTools` to inherit the subagent’s tool pool except Write and Edit. The subagent keeps Bash, MCP tools, and the rest of its pool:
---
name: no-writes
- description: Inherits every tool except file writes
+ description: Inherits the available tools except file writes
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 refuses to launch the subagent and the Agent tool returns an error naming the unresolved entries. 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 every built-in tool:
+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:
---
name: local-only
@@ -326,7 +329,7 @@
tools: Agent, Read, Bash
-If `Agent` is omitted from the `tools` list entirely, the agent can’t spawn any subagents. The `Agent(agent_type)` allowlist syntax applies only to an agent running as the main thread with `claude --agent`. In a subagent definition, listing `Agent` in `tools` lets that subagent spawn nested subagents, but any type list inside the parentheses is ignored.
+If you omit `Agent` from the `tools` list entirely, the agent can’t spawn any subagents with the Agent tool. The `Agent(agent_type)` allowlist syntax applies only to an agent running as the main thread with `claude --agent`. In a subagent definition, listing `Agent` in `tools` lets that subagent spawn subagents of its own once you allow nested spawning, but any type list inside the parentheses is ignored.
####
@@ -407,7 +410,7 @@
Implement API endpoints. Follow the conventions and patterns from the preloaded skills.
-The full content of each listed skill is injected into the subagent’s context at startup. This field controls which skills are preloaded, not which skills the subagent can access: without it, the subagent can still discover and invoke project, user, and plugin skills through the Skill tool during execution. To prevent a subagent from invoking skills entirely, omit `Skill` from the `tools` list or add it to `disallowedTools`. You can’t preload skills that set [`disable-model-invocation: true`](</docs/en/skills#control-who-invokes-a-skill>), since preloading draws from the same set of skills Claude can invoke. If a listed skill is missing or disabled, Claude Code skips it and logs a warning to the debug log.
+The full content of each listed skill is injected into the subagent’s context at startup. This field controls which skills are preloaded, not which skills the subagent can access: without it, the subagent can still discover and invoke project, user, and plugin skills through the Skill tool during execution. To prevent a subagent from invoking skills entirely, omit `Skill` from the `tools` list or add it to `disallowedTools`. You can’t preload skills that set [`disable-model-invocation: true`](</docs/en/skills#control-who-invokes-a-skill>), since preloading draws from the same set of skills Claude can invoke. This includes the bundled `/verify` and `/code-review` skills: only you can run them, so they can’t be preloaded either. If a listed skill is missing or disabled, Claude Code skips it and logs a warning to the debug log.
This is the inverse of [running a skill in a subagent](</docs/en/skills#run-skills-in-a-subagent>). With `skills` in a subagent, the subagent controls the system prompt and loads skill content. With `context: fork` in a skill, the skill content is injected into the agent you specify. Both use the same underlying system.
@@ -436,7 +439,7 @@
`project`| `.claude/agent-memory/<name-of-agent>/`| the subagent’s knowledge is project-specific and shareable via version control
`local`| `.claude/agent-memory-local/<name-of-agent>/`| the subagent’s knowledge is project-specific but shouldn’t be checked into version control
-When memory is enabled:
+Subagent memory is part of [auto memory](</docs/en/memory#auto-memory>): if you turn auto memory off, with the `autoMemoryEnabled` setting or `CLAUDE_CODE_DISABLE_AUTO_MEMORY`, the `memory` field has no effect and the subagent launches without the memory instructions or the memory tool access described below. When memory is enabled:
* The subagent’s system prompt includes instructions for reading and writing to the memory directory.
* The subagent’s system prompt also includes the first 200 lines or 25KB of `MEMORY.md` in the memory directory, whichever comes first, with instructions to curate `MEMORY.md` if it exceeds that limit.
@@ -637,7 +640,7 @@
claude --agent code-reviewer
-The subagent’s system prompt replaces the default Claude Code system prompt entirely, the same way [`--system-prompt`](</docs/en/cli-reference>) does. `CLAUDE.md` files and project memory still load through the normal message flow. The agent name appears as `@<name>` in the startup header so you can confirm it’s active. This works with built-in and custom subagents, and the choice persists when you resume the session. For a plugin-provided subagent, you can pass only the agent name and Claude Code finds it:
+The subagent’s system prompt replaces the default Claude Code system prompt entirely, the same way [`--system-prompt`](</docs/en/cli-reference>) does. `CLAUDE.md` files and project memory still load through the normal message flow. The agent name appears as `@<name>` in the startup header so you can confirm it’s active. This works with built-in and custom subagents, and the choice persists when you resume the session: Claude Code restores the agent’s system prompt, tool restrictions, and model along with the conversation. If the agent no longer exists when you resume, the session continues with the default tools and system prompt and shows a [warning naming the agent](</docs/en/errors#session-agent-no-longer-available>). For a plugin-provided subagent, you can pass only the agent name and Claude Code finds it:
claude --agent security-reviewer
@@ -664,7 +667,7 @@
* **Foreground subagents** block the main conversation until complete. Permission prompts are passed through to you as they come up.
* **Background subagents** run concurrently while you continue working. As of v2.1.186, when a background subagent reaches a tool call that needs permission, the prompt surfaces in your main session and names the subagent that is asking. Approve to let the subagent continue, or press Esc to deny that one tool call without stopping the subagent. Before v2.1.186, background subagents auto-denied any tool call that would have prompted.
-As of v2.1.198, subagents run in the background by default. Claude runs a subagent in the foreground when it needs the result before continuing. The default changes where a subagent runs, not what it’s allowed to do: background subagents still surface every permission prompt in your main session. Before v2.1.198, Claude chose between foreground and background based on the task. A background subagent’s results reach Claude as a completion notification in a later turn. Claude waits for that notification before reporting the subagent’s results, and if you ask about progress first, it reports that the subagent is still running. Before v2.1.211, Claude sometimes reported results for a background subagent that hadn’t finished. You can also steer this yourself:
+As of v2.1.198, subagents run in the background by default. Claude runs a subagent in the foreground when it needs the result before continuing. Background subagents run with a smaller built-in tool set than foreground subagents, and they surface every permission prompt in your main session. A background subagent’s results reach Claude as a completion notification in a later turn. Claude waits for that notification before reporting the subagent’s results, and if you ask about progress first, it reports that the subagent is still running. Before v2.1.211, Claude sometimes reported results for a background subagent that hadn’t finished. You can also steer this yourself:
* Ask Claude to run a task in the background or in the foreground
* Press **Ctrl+B** to background a running task
@@ -766,9 +769,19 @@
-Spawn nested subagents
-
-As of Claude Code v2.1.172, a subagent can spawn its own subagents. Use this when a delegated task itself splits into parallel subtasks, such as a reviewer subagent that dispatches a verifier per finding, so the intermediate output never reaches your main conversation. Only the top-level subagent’s summary returns to you. A nested subagent is configured the same way as a top-level one and resolves from the same scopes. The subagent panel below the prompt input shows the full tree: each row displays a `(+N)` count of descendants, and as of v2.1.193, opening a row shows that subagent’s siblings and direct children with a path back to `main`. Depth is counted as the number of subagent levels below the main conversation, regardless of whether each level runs in the foreground or background. A subagent at depth five doesn’t receive the Agent tool and can’t spawn further. The limit is fixed and not configurable. As of Claude Code v2.1.187, a background subagent’s depth is fixed when it is first spawned, and resuming it later doesn’t change that depth. For example, if your main conversation spawns subagent A, and A spawns a background subagent B at depth two, B is still at depth two when you resume it directly from the main conversation. Resuming a subagent from a shallower context doesn’t let it spawn additional levels that the depth limit already prevented. To prevent a specific subagent from spawning others, omit `Agent` from its `tools` list or add it to `disallowedTools`. A fork still can’t spawn another fork. It can spawn other subagent types, and those count toward the depth limit.
+Let subagents spawn their own subagents
+
+By default, a subagent can’t spawn subagents of its own, so a subagent you ask to delegate does the work itself and returns one summary. While nesting is off, Claude Code withholds the `Agent` tool from every subagent except a fork, which inherits the parent’s full tool list. `Agent` stays in that list, but returns an error instead of spawning. Nested subagents suit a delegated task that itself splits into parallel subtasks, such as a reviewer subagent that dispatches a verifier per finding, so the intermediate output never reaches your main conversation. Only the top-level subagent’s summary returns to you. To allow nesting, set [`CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`](</docs/en/env-vars>) to the number of subagent layers you want below your main conversation. For example, this entry in [`settings.json`](</docs/en/settings>) allows two layers:
+
+ {
+ "env": {
+ "CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH": "2"
+ }
+ }
+
+With this value, your subagents can delegate to a second layer of their own, and that second layer can’t delegate further. A nested subagent is configured the same way as a top-level one and resolves from the same scopes. To keep one subagent from spawning while nesting is on, such as a reviewer that should stay read-only, omit `Agent` from its `tools` list or add it to `disallowedTools`. The subagent panel below the prompt input shows the full tree: each row displays a `(+N)` count of descendants, and as of v2.1.193, opening a row shows that subagent’s siblings and direct children with a path back to `main`.
+
+From Claude Code v2.1.172 through v2.1.216, subagents could nest by default, up to five layers deep, and the limit couldn’t be changed.
###
@@ -776,7 +789,20 @@
Session subagent limit
-By default, Claude can spawn at most 200 subagents per session. To raise the limit, set [`CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION`](</docs/en/env-vars>) to any positive whole number; there is no upper bound, but the limit can’t be turned off. Requires Claude Code v2.1.212 or later. Every subagent Claude spawns with the Agent tool counts toward the limit: nested subagents, forks, and background subagents, including subagents that a [workflow](</docs/en/workflows>)’s agents spawn with the Agent tool. An in-session fork you start yourself with `/subtask` counts too: it spends the same budget, though the limit blocks only subagents Claude spawns with the Agent tool, so your own `/subtask` still starts after Claude reaches the limit. A session you create with `/fork` doesn’t count; it runs as a separate background session with its own budget. Before v2.1.212, the in-session fork was named `/fork`. Agents a workflow script spawns with `agent()` don’t count; workflows have their own per-run limit. A finished subagent still counts. When Claude reaches the limit, the Agent tool fails with `Subagent spawn limit reached`, and the error tells Claude to complete the remaining work directly with its own tools. Run [`/clear`](</docs/en/commands#all-commands>) to reset the count and start a new conversation with the full budget. If work that can still spawn subagents survives the clear, such as a running workflow, the count carries over instead. This limit is separate from the depth limit, which caps how deeply subagents nest.
+Three separate limits control subagent use, each with its own variable: this one caps the total spawned over a session, the concurrent subagent limit stops Claude from spawning more while too many are running, and the depth limit caps how deeply subagents nest. By default, Claude can spawn at most 200 subagents per session. To raise the limit, set [`CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION`](</docs/en/env-vars>) to any positive whole number; there is no upper bound, but the limit can’t be turned off. Requires Claude Code v2.1.212 or later. Every subagent Claude spawns with the Agent tool counts toward the limit: nested subagents, forks, and background subagents, including subagents that a [workflow](</docs/en/workflows>)’s agents spawn with the Agent tool. An in-session fork you start yourself with `/subtask` counts too: it spends the same budget, though the limit blocks only subagents Claude spawns with the Agent tool, so your own `/subtask` still starts after Claude reaches the limit. A session you create with `/fork` doesn’t count; it runs as a separate background session with its own budget. Before v2.1.212, the in-session fork was named `/fork`. Agents a workflow script spawns with `agent()` don’t count; workflows have their own per-run limit. A finished subagent still counts. When Claude reaches the limit, the Agent tool fails with `Subagent spawn limit reached`, and the error tells Claude to complete the remaining work directly with its own tools. Run [`/clear`](</docs/en/commands#all-commands>) to reset the count and start a new conversation with the full budget. If work that can still spawn subagents survives the clear, such as a running workflow, the count carries over instead.
+
+###
+
+
+
+Concurrent subagent limit
+
+By default, when 20 subagents are running in a session, spawning another with the Agent tool fails with `Concurrent subagent limit reached`, and the error tells Claude not to retry. Spawning succeeds again when the running count drops below the limit. To change the limit, set [`CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS`](</docs/en/env-vars>) to any positive whole number. Sessions with [ultracode](</docs/en/model-config#adjust-effort-level>) active are exempt: the limit isn’t enforced there. Requires Claude Code v2.1.217 or later. The limit blocks only subagents Claude spawns with the Agent tool, but other runs occupy the same slots:
+
+ * An in-session fork you start with `/subtask` takes a slot while it runs and is never blocked by the limit.
+ * Resuming a subagent that already finished takes a fresh slot without checking the limit, so resumes can push the running count past it.
+
+Agents that other features run, such as [workflow](</docs/en/workflows>) agents and [agent team](</docs/en/agent-teams>) teammates, follow their own limits instead. The session subagent limit separately caps the total Claude spawns over the whole session.
###
@@ -891,7 +917,7 @@
| Fork| Named subagent
---|---|---
Context| Full conversation history| Fresh context with the prompt you pass
-System prompt and tools| Same as main session| From the subagent’s definition file
+System prompt and tools| Same as main session| From the subagent’s definition file, filtered for background runs
Model| Same as main session| From the subagent’s `model` field
Permissions| Prompts surface in your terminal| Prompts surface in your main session when running in the background
Prompt cache| Shared with main session| Separate cache
--- a/subagents.md
+++ b/subagents.md
@@ -174,7 +174,7 @@
---|---|---|---
`description`| `string`| Yes| Natural language description of when to use this agent
`prompt`| `string`| Yes| The agent’s system prompt defining its role and behavior
-`tools`| `string[]`| No| Array of allowed tool names. If omitted, inherits all tools
+`tools`| `string[]`| No| Array of allowed tool names. If omitted, inherits every [tool available to subagents](</docs/en/sub-agents#available-tools>)
`disallowedTools`| `string[]`| No| Array of tool names to remove from the agent’s tool set. MCP server-level patterns are also accepted: `mcp__server` or `mcp__server__*` removes every tool from that server, and `mcp__*` removes every MCP tool from any server
`model`| `string`| No| Model override for this agent. Accepts an alias such as `'fable'`, `'opus'`, `'sonnet'`, `'haiku'`, `'inherit'`, or a full model ID. Defaults to main model if omitted
`skills`| `string[]`| No| List of skill names to preload into the agent’s context at startup. Unlisted skills remain invocable through the Skill tool
@@ -191,7 +191,7 @@
* Subagents run in the background by default. An Agent tool call that omits the [`run_in_background`](</docs/en/agent-sdk/typescript>) input launches a background subagent, and Claude sets `run_in_background: false` when it needs the result before continuing. Before v2.1.198, omitting `run_in_background` ran the subagent synchronously. Set the `background` field to `true` to force background execution for a specific agent regardless of what Claude requests.
* A subagent inherits the main session’s extended thinking configuration. On earlier versions, extended thinking is disabled inside subagents regardless of the main session’s setting.
-As of Claude Code v2.1.172, subagents can spawn their own subagents. A subagent five levels below the main agent can’t spawn further subagents, regardless of whether it runs in the foreground or background. To prevent a subagent from spawning others, omit `Agent` from its `tools` array or add it to `disallowedTools`. See [nested subagents](</docs/en/sub-agents#spawn-nested-subagents>) for the full depth rules.
+By default, subagents can’t spawn subagents of their own. To let them, set [`CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`](</docs/en/env-vars>) to the number of subagent layers you want below your main conversation, `2` or higher; see [nested subagents](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>). From Claude Code v2.1.172 through v2.1.216, subagents could nest by default, up to five layers.
###
@@ -215,7 +215,7 @@
---|---
Its own system prompt (`AgentDefinition.prompt`) and the Agent tool’s prompt| The parent’s conversation history or tool results
Project CLAUDE.md (loaded via [`settingSources`](</docs/en/agent-sdk/claude-code-features#control-filesystem-settings-with-settingsources>))| Preloaded skill content, unless listed in `AgentDefinition.skills`
-Tool definitions (inherited from parent, or the subset in `tools`)| The parent’s system prompt
+Tool definitions (inherited from parent or the subset in `tools`, [filtered for background runs](</docs/en/sub-agents#available-tools>))| The parent’s system prompt
The parent receives the subagent’s final message as the Agent tool result, but may summarize it in its own response. To preserve subagent output verbatim in the user-facing response, include an instruction to do so in the prompt or `systemPrompt` option you pass to the main `query()` call.In v2.1.210 and later, Claude Code [scans the final message for instruction-shaped patterns](</docs/en/sub-agents#subagent-output-scanning>) before the parent reads it. The scan treats three kinds of pattern differently:
@@ -560,12 +560,12 @@
Tool restrictions
-Subagents can have restricted tool access via the `tools` field:
-
- * **Omit the field** : agent inherits all available tools (default)
- * **Specify tools** : agent can only use listed tools
-
-This example creates a read-only analysis agent that can examine code but can’t modify files or run commands.
+Use the `tools` field to limit what a subagent can do:
+
+ * **Omit`tools`**: the subagent gets every [tool available to subagents](</docs/en/sub-agents#available-tools>)
+ * **List tools** : the subagent gets only those. A code reviewer that should never edit files, for example, gets `["Read", "Grep", "Glob"]`
+
+A tool you leave out isn’t in the subagent’s session at all: Claude works without it, with no permission prompt or error. This example creates a read-only analysis agent that can examine code but can’t modify files or run commands.
Python
@@ -626,7 +626,7 @@
Read-only analysis| `Read`, `Grep`, `Glob`| Can examine code but not modify or execute
Test execution| `Bash`, `Read`, `Grep`| Can run commands and analyze output
Code modification| `Read`, `Edit`, `Write`, `Grep`, `Glob`| Full read/write access without command execution
-Full access| All tools| Inherits all tools from parent (omit `tools` field)
+Full access| All tools| Inherits the tools available to subagents (omit the `tools` field)
##
--- a/tools-reference.md
+++ b/tools-reference.md
@@ -6,7 +6,7 @@
---|---|---
`Agent`| Spawns a [subagent](</docs/en/sub-agents>) with its own context window to handle a task. See Agent tool behavior| No
`Artifact`| Publishes an HTML or Markdown file as an [artifact](</docs/en/artifacts>): a private, interactive page on claude.ai. You can share it with a public link, or inside your organization on Team and Enterprise plans, where public sharing requires an Owner to [enable it](</docs/en/artifacts#control-public-sharing>). Requires a Pro, Max, Team, or Enterprise plan and `/login` authentication; see [Availability](</docs/en/artifacts#availability>)| Yes
-`AskUserQuestion`| Asks multiple-choice questions to gather requirements or clarify ambiguity. Questions stay open until you answer them: there’s no idle timeout by default. To have an idle dialog auto-continue instead, set the [`askUserQuestionTimeout`](</docs/en/settings#available-settings>) setting to `60s`, `5m`, or `10m`, either in your user `settings.json` or from the **Question auto-continue timeout** row in `/config`. Once the chosen idle time passes with no input, the dialog closes on its own: it submits any options you’d already selected and tells Claude you may be away from your keyboard, so Claude proceeds on its own judgment and can re-ask later. A countdown appears for the last 20 seconds. Any keypress restarts the timer, and so does a focused window on terminals that report focus. The timeout applies only to `AskUserQuestion`’s multiple-choice questions; permission prompts, including plan approval, never auto-resolve on idle. In v2.1.198 and v2.1.199, the dialog auto-continued after 60 seconds of idle by default, and [`CLAUDE_AFK_TIMEOUT_MS`](</docs/en/env-vars#variables>) was the only way to change that| No
+`AskUserQuestion`| Asks multiple-choice questions to gather requirements or clarify ambiguity. Questions stay open until you answer them by default. See AskUserQuestion tool behavior| No
`Bash`| Executes shell commands in your environment. See Bash tool behavior| Yes
`CronCreate`| Schedules a recurring or one-shot prompt within the current session. Tasks are session-scoped and restored on `--resume` or `--continue` if unexpired. See [scheduled tasks](</docs/en/scheduled-tasks>)| No
`CronDelete`| Cancels a scheduled task by ID| No
@@ -86,17 +86,33 @@
The Agent tool spawns a subagent in a separate context window. The subagent works through its task autonomously, then returns a single text result to the parent conversation. The parent doesn’t see the subagent’s intermediate tool calls or outputs, only that final result. To cap how many turns a subagent runs, set `maxTurns` in the [subagent definition](</docs/en/sub-agents#supported-frontmatter-fields>). The same Agent tool also launches [forked subagents](</docs/en/sub-agents#fork-the-current-conversation>) when fork mode is enabled. A fork inherits the full parent conversation instead of starting fresh, always runs in the background, and still surfaces permission prompts in your terminal. The rest of this section describes named subagents. Which tools a named subagent can use depends on the `tools` and `disallowedTools` fields in the [subagent definition](</docs/en/sub-agents>):
- * **Neither field set** : the subagent inherits every tool available to the parent.
+ * **Neither field set** : the subagent inherits every [tool available to subagents](</docs/en/sub-agents#available-tools>).
* **`tools` only**: the subagent gets only the listed tools.
* **`disallowedTools` only**: the subagent gets every parent tool except the listed ones.
* **Both set** : `disallowedTools` takes precedence. A tool listed in both is removed.
-When a subagent’s `tools` list resolves to no tools at all, for example because every entry is misspelled or names a tool that isn’t available to subagents, the Agent tool returns an error listing those entries instead of launching the subagent. Before v2.1.208, the subagent launched with no tools and could return an empty or confusing result. Launching the subagent doesn’t itself prompt for permission. Claude Code checks the subagent’s own tool calls against your permission rules as it runs. As of v2.1.198, subagents run in the background by default; Claude runs one in the foreground when it needs the result before continuing.
+In every case, the resolved set is limited to the [tools available to subagents](</docs/en/sub-agents#available-tools>): a tool that isn’t available to subagents is never granted, even when listed in `tools`. If every entry in a subagent’s `tools` list fails to match a usable tool, the Agent tool usually returns an error naming the entries instead of launching the subagent; see [Agent would be spawned with zero tools](</docs/en/errors#agent-would-be-spawned-with-zero-tools>) for the message and how to fix each entry. Launching the subagent doesn’t itself prompt for permission. Claude Code checks the subagent’s own tool calls against your permission rules as it runs. As of v2.1.198, subagents run in the background by default; Claude runs one in the foreground when it needs the result before continuing.
* **Foreground subagents** show the same permission prompts you would see in the main conversation, at the moment each tool call happens.
* **Background subagents** surface permission prompts in your main session as of v2.1.186. The prompt names which subagent is asking, and pressing Esc denies that one tool call without stopping the subagent. Before v2.1.186, background subagents auto-denied any tool call that would otherwise prompt and continued without that tool.
To limit what a subagent can reach in the first place, narrow its `tools` field, leave Bash off the list, or set deny rules in your settings, as described in [Control subagent capabilities](</docs/en/sub-agents#control-subagent-capabilities>). For more on choosing between foreground and background, see [Run subagents in foreground or background](</docs/en/sub-agents#run-subagents-in-foreground-or-background>).
+
+##
+
+
+
+AskUserQuestion tool behavior
+
+Claude uses `AskUserQuestion` to ask you multiple-choice questions when it needs a decision or a clarification. Answer by picking an option, or type your own text through the `Other` row or the notes field. When you answer by typing your own text, Claude Code relays the answer with neutral wording so Claude follows what you wrote, including a request to wait or explain first.
+
+###
+
+
+
+Question auto-continue timeout
+
+Questions stay open until you answer them. If you want a question you leave unanswered to eventually close and let Claude continue without you, set the [`askUserQuestionTimeout`](</docs/en/settings#available-settings>) setting to `60s`, `5m`, or `10m`, either in your user `settings.json` or from the **Question auto-continue timeout** row in `/config`. After a question sits that long with no input, the dialog closes on its own: it submits any options you’d already selected and tells Claude you may be away from your keyboard, so Claude proceeds on its own judgment and can re-ask later. You see a countdown for the last 20 seconds. Press any key to restart the timer; on terminals that report focus, switching to the window restarts it too. The timeout applies only to `AskUserQuestion`’s multiple-choice questions; permission prompts, including plan approval, never auto-resolve on idle.
##
@@ -326,6 +342,22 @@
+Windows encoding and exit codes
+
+On Windows, the following PowerShell encoding and exit-code behaviors require Claude Code v2.1.214 or later:
+
+ * Redirection with `>` and `>>` writes UTF-8 files on PowerShell 5.1
+ * Claude Code encodes text piped to a native command’s standard input as UTF-8
+ * Claude Code captures error output without ANSI escape sequences
+ * A command whose child process waits on standard input receives end-of-file instead of hanging
+ * Exit code 1 from `where.exe` means no match, and from `fc.exe` and `diff.exe` it means the files differ, so when the command produces output, Claude Code treats that exit code as a valid negative answer rather than a command error. Claude Code still reports a silenced form, such as `where.exe /Q` or a redirect to `$null`, as a failure on exit code 1
+
+Before v2.1.214, `>` on PowerShell 5.1 wrote UTF-16LE files, non-ASCII piped input arrived as `?`, and Python scripts could crash with a `UnicodeEncodeError` when printing non-ASCII characters.
+
+###
+
+
+
Preview limitations
The PowerShell tool has the following known limitations during the preview:
@@ -339,7 +371,7 @@
Read tool behavior
-The Read tool takes a file path and returns the contents with line numbers. Claude is instructed to always pass absolute paths. By default, Read returns the file from the start. When a whole-file read exceeds the token limit, Read returns the first page with a `PARTIAL view` notice that tells Claude how much of the file it received and how to read more with `offset` and `limit`. A read that passes an explicit `offset` or `limit` and still exceeds the token limit returns an error. A read with an explicit `limit` stops as soon as the selected lines exceed what the token limit could ever fit and returns an error without loading the rest of the range. The error tells Claude to use a smaller `limit`, or to search for specific content with Grep instead when a single line is that large. Before v2.1.208, Claude Code loaded the whole range into memory before rejecting it, so a file with an extremely long single line could exhaust memory. Reading an empty file returns a notice that the file exists but its contents are empty, and an `offset` past the last line returns a notice giving the file’s line count. Before v2.1.208, reading an empty file returned the past-the-end notice instead. Read handles several file types beyond plain text:
+The Read tool takes a file path and returns the contents with line numbers. Claude is instructed to always pass absolute paths. By default, Read returns the file from the start. When a whole-file read exceeds the token limit, Read returns the first page with a `PARTIAL view` notice that tells Claude how much of the file it received and how to read more with `offset` and `limit`. A read that passes an explicit `offset` or `limit` and still exceeds the token limit returns an error. A read with an explicit `limit` stops as soon as the selected lines exceed what the token limit could ever fit and returns an error without loading the rest of the range. The error tells Claude to use a smaller `limit`, or to search for specific content with Grep instead when a single line is that large. Before v2.1.208, Claude Code loaded the whole range into memory before rejecting it, so reading a file with an extremely long single line could run it out of memory. Reading an empty file returns a notice that the file exists but its contents are empty, and an `offset` past the last line returns a notice giving the file’s line count. Before v2.1.208, reading an empty file returned the past-the-end notice instead. Read handles several file types beyond plain text:
* **Images** : PNG, JPG, and other image formats are returned as visual content that Claude can see, not as raw bytes. Claude Code resizes and recompresses large images to fit the model’s image size limits before sending them, so Claude may see a downscaled version of a large screenshot. As of v2.1.196, an image that is still larger than 500KB after that resize is re-encoded as a JPEG at reduced quality with its pixel dimensions unchanged. If Claude misses fine pixel-level detail in a large image, ask it to crop the region of interest first, for example with ImageMagick via Bash.
* **PDFs** : Claude reads short `.pdf` files whole. For PDFs longer than 10 pages, it reads in ranges with a `pages` parameter, such as `"1-5"`, up to 20 pages at a time.
--- a/typescript.md
+++ b/typescript.md
@@ -310,7 +310,7 @@
`session_id`| `string`| Session this message belongs to
`message`| `unknown`| Raw message payload from the transcript
`parent_tool_use_id`| `string | null`| For subagent messages, the `tool_use_id` of the spawning `Agent` tool call. `null` for main-session messages and older sessions
-`parent_agent_id`| `string | null`| For messages from a [nested subagent](</docs/en/sub-agents#spawn-nested-subagents>), the `agentId` of the subagent that spawned it. `null` for main-session messages, messages from top-level subagents, and older sessions. Requires Claude Code v2.1.202 or later
+`parent_agent_id`| `string | null`| For messages from a [nested subagent](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>), the `agentId` of the subagent that spawned it. `null` for main-session messages, messages from top-level subagents, and older sessions. Requires Claude Code v2.1.202 or later
####
@@ -755,7 +755,7 @@
Field| Required| Description
---|---|---
`description`| Yes| Natural language description of when to use this agent
-`tools`| No| Array of allowed tool names. If omitted, inherits all tools from parent. To preload Skills into the agent’s context, use the `skills` field rather than listing `'Skill'` here
+`tools`| No| Array of allowed tool names. If omitted, inherits every [tool available to subagents](</docs/en/sub-agents#available-tools>). To preload Skills into the agent’s context, use the `skills` field rather than listing `'Skill'` here
`disallowedTools`| No| Array of tool names to explicitly disallow for this agent. MCP server-level patterns are also accepted: `mcp__server` or `mcp__server__*` removes every tool from that server, and `mcp__*` removes every MCP tool from any server
`prompt`| Yes| The agent’s system prompt
`model`| No| Model override for this agent. Accepts an alias such as `'fable'`, `'opus'`, `'sonnet'`, `'haiku'`, `'inherit'`, or a full model ID. If omitted or `'inherit'`, uses the main model
--- a/vs-code.md
+++ b/vs-code.md
@@ -129,9 +129,9 @@
2
-Select the Remote tab
-
-The dialog shows two tabs: Local and Remote. Click **Remote** to see sessions from claude.ai.
+Select the Web tab
+
+The dialog shows two tabs: Local and Web. Click **Web** to see sessions from claude.ai.
3
@@ -139,7 +139,7 @@
Browse or search your cloud sessions. Click any session to download it and continue the conversation locally.
-Only web sessions started with a GitHub repository appear in the Remote tab. Resuming loads the conversation history locally; changes are not synced back to claude.ai.
+Only web sessions started with a GitHub repository appear in the Web tab. Resuming loads the conversation history locally; changes are not synced back to claude.ai.
###