Changes on
25 changes detected
--- a/agent-loop.md
+++ b/agent-loop.md
@@ -168,7 +168,7 @@
`"low"`| Minimal reasoning, fast responses| File lookups, listing directories
`"medium"`| Balanced reasoning| Routine edits, standard tasks
`"high"`| Thorough analysis| Refactors, debugging
-`"xhigh"`| Extended reasoning depth| Coding and agentic tasks; recommended on Opus 4.8 and Opus 4.7
+`"xhigh"`| Extended reasoning depth| Coding and agentic tasks; recommended on Fable 5 and Opus 4.7+
`"max"`| Maximum reasoning depth| Multi-step problems requiring deep analysis
If you don’t set `effort`, both SDKs leave the parameter unset and defer to the model’s default behavior.
@@ -295,7 +295,7 @@
`error_max_turns`| Hit the `maxTurns` limit before finishing| No
`error_max_budget_usd`| Hit the `maxBudgetUsd` limit before finishing| No
`error_during_execution`| An error interrupted the loop (for example, an API failure or cancelled request)| No
-`error_max_structured_output_retries`| Structured output validation failed after the configured retry limit| No
+`error_max_structured_output_retries`| No valid structured output was produced within the configured retry limit: every attempt failed validation, or a model fallback retracted the completed output with no successful retry| No
The `result` field (the final text output) is only present on the `success` variant, so always check the subtype before reading it. All result subtypes carry `total_cost_usd`, `usage`, `num_turns`, and `session_id` so you can track cost and resume even after errors. In Python, `total_cost_usd` and `usage` are typed as optional and may be `None` on some error paths, so guard before formatting them. See [Tracking costs and usage](</docs/en/agent-sdk/cost-tracking>) for details on interpreting the `usage` fields. The result also includes a `stop_reason` field (`string | null` in TypeScript, `str | None` in Python) indicating why the model stopped generating on its final turn. Common values are `end_turn` (model finished normally), `max_tokens` (hit the output token limit), and `refusal` (the model declined the request). On error result subtypes, `stop_reason` carries the value from the last assistant response before the loop ended. To detect refusals, check `stop_reason === "refusal"` (TypeScript) or `stop_reason == "refusal"` (Python). See [`SDKResultMessage`](</docs/en/agent-sdk/typescript#sdkresultmessage>) (TypeScript) or [`ResultMessage`](</docs/en/agent-sdk/python#resultmessage>) (Python) for the full type.
--- a/agent-teams.md
+++ b/agent-teams.md
@@ -459,7 +459,7 @@
Orphaned tmux sessions
-If a tmux session persists after the team ends, it may not have been fully cleaned up. List sessions and kill the one created by the team:
+If a tmux session persists after the team ends, it may not have been fully cleaned up. List sessions and end the one created by the team:
tmux ls
tmux kill-session -t <session-name>
--- a/amazon-bedrock.md
+++ b/amazon-bedrock.md
@@ -138,7 +138,7 @@
# Enable Bedrock integration
export CLAUDE_CODE_USE_BEDROCK=1
- export AWS_REGION=us-east-1 # or your preferred region
+ export AWS_REGION=us-east-1 # optional if your AWS profile already sets a region
# Optional: Override the AWS region for the small/fast model (Bedrock and Mantle).
# On Bedrock, has no effect without ANTHROPIC_DEFAULT_HAIKU_MODEL
@@ -150,7 +150,12 @@
When enabling Bedrock for Claude Code, keep the following in mind:
- * `AWS_REGION` is a required environment variable. Claude Code does not read from the `.aws` config file for this setting.
+ * As of v2.1.172, you only need to set `AWS_REGION` to override your AWS profile’s region or when your profile has no region. Claude Code resolves the region in this order:
+ * `AWS_REGION`
+ * `AWS_DEFAULT_REGION`
+ * the `region` set on your active AWS profile, read from the AWS shared credentials file first and then the shared config file, matching AWS SDK precedence
+ * `us-east-1`
+The active profile is `AWS_PROFILE` if set, otherwise `default`. Set `AWS_SHARED_CREDENTIALS_FILE` or `AWS_CONFIG_FILE` to point at non-default file paths. Run `/status` to see the resolved region. When the region came from your AWS config files or the default fallback, `/status` also notes the source. On v2.1.171 and earlier, Claude Code does not read the AWS config files, so set `AWS_REGION` explicitly.
* When using Bedrock, the `/logout` command is unavailable since authentication is handled through AWS credentials.
* The WebSearch tool is not available on Bedrock. See [WebSearch tool behavior](</docs/en/tools-reference#websearch-tool-behavior>).
* You can use settings files for environment variables like `AWS_PROFILE` that you don’t want to leak to other processes. See [Settings](</docs/en/settings>) for more information.
@@ -169,7 +174,7 @@
export ANTHROPIC_DEFAULT_SONNET_MODEL='us.anthropic.claude-sonnet-4-6'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='us.anthropic.claude-haiku-4-5-20251001-v1:0'
-These variables use cross-region inference profile IDs (with the `us.` prefix). If you use a different region prefix or application inference profiles, adjust accordingly. For current and legacy model IDs, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). See [Model configuration](</docs/en/model-config#pin-models-for-third-party-deployments>) for the full list of environment variables. Claude Code uses these default models when no pinning variables are set:
+These variables use cross-region inference profile IDs (with the `us.` prefix). If you use a different region prefix or application inference profiles, adjust accordingly. In AWS GovCloud regions, use the `us-gov.` prefix. For current and legacy model IDs, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). See [Model configuration](</docs/en/model-config#pin-models-for-third-party-deployments>) for the full list of environment variables. Claude Code uses these default models when no pinning variables are set:
Model type| Default value
---|---
@@ -324,7 +329,7 @@
export CLAUDE_CODE_USE_MANTLE=1
export AWS_REGION=us-east-1
-Claude Code constructs the endpoint URL from `AWS_REGION`. To override it for a custom endpoint or gateway, set `ANTHROPIC_BEDROCK_MANTLE_BASE_URL`. Run `/status` inside Claude Code to confirm. The provider line shows `Amazon Bedrock (Mantle)` when Mantle is active.
+Claude Code constructs the endpoint URL from the AWS region. As of v2.1.172, the region is resolved with the same precedence as Bedrock above; earlier versions use `AWS_REGION` only. To override the URL for a custom endpoint or gateway, set `ANTHROPIC_BEDROCK_MANTLE_BASE_URL`. Run `/status` inside Claude Code to confirm. The provider line shows `Amazon Bedrock (Mantle)` when Mantle is active.
###
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,33 @@
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.176
+
+June 12, 2026
+
+ * Session titles are now generated in the language of your conversation (set the `language` setting to pin a specific language)
+ * Added `footerLinksRegexes` setting for regex-matched link badges in the footer row, configurable via user or managed settings
+ * Improved Bedrock credential caching: credentials from `awsCredentialExport` are now cached until their `Expiration` instead of a fixed 1 hour
+ * Fixed `availableModels` enforcement: alias model picks can no longer be redirected to a blocked model via `ANTHROPIC_DEFAULT_*_MODEL` environment variables, and `/fast` now refuses to toggle when it would switch to a model outside the allowlist
+ * Fixed auto mode failing on Fable 5 for organizations without Opus 4.8 enabled — the classifier now falls back to the best available Opus model
+ * Fixed hook `if` conditions for Read/Edit/Write tool paths: documented patterns like `Edit(src/**)`, `Read(~/.ssh/**)`, and `Read(.env)` now match correctly
+ * Fixed Linux sandbox failing to start when `.claude/settings.json` is a symlink with an absolute target
+ * Fixed `/copy` and mouse-selection copy not reaching the system clipboard inside tmux over SSH, and tmux paste buffer not loading on versions older than 3.2
+ * Fixed Remote Control connecting from web/mobile silently switching the session’s model
+ * Fixed Remote Control disconnect notifications showing a bare numeric code instead of a human-readable reason, and connection failures adding a duplicate line to the conversation transcript
+ * Fixed Remote Control sessions not disconnecting when you sign in to a different account
+ * Fixed `/cd` and worktree moves leaving the session reporting the previous directory’s git branch
+ * Fixed `claude agents`: pressing back in one window no longer detaches other windows attached to the same session
+ * Fixed backgrounded sessions showing “Working” forever when `/bg` mid-turn had nothing left to continue
+ * Fixed background agent search by PR URL: PRs opened during scheduled wakeups or while a job was blocked now appear in `claude agents` search
+ * Fixed the agents view input showing no text cursor on Windows
+ * Fixed `claude --bg -cn <name>` not seeding the session name
+ * Fixed background sessions to neutralize Windows network paths in persisted state before respawn
+ * Fixed background-session respawn rejecting malformed resume IDs from corrupted state files
+ * Fixed the Windows background-service daemon not starting when `~/.claude/daemon` has the ReadOnly attribute set
+ * Fixed cloud sessions failing with “Could not resolve authentication method” when idle for too long before being claimed
+ * Background sessions now show clearer guidance when a window left open across an auto-update can’t submit a reply, and `claude daemon status` explains version-skew behavior
--- a/claude-code-on-the-web.md
+++ b/claude-code-on-the-web.md
@@ -707,7 +707,7 @@
`/context`| Yes| Shows what’s currently in the context window
`/clear`| No| Start a new session from the sidebar instead
-Auto-compaction runs automatically when the context window approaches capacity, the same as in the CLI. To trigger it earlier, set [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/env-vars>) in your environment variables. For example, `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=70` compacts at 70% capacity instead of the default ~95%. To change the effective window size for compaction calculations, use [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>). [Subagents](</docs/en/sub-agents>) work the same way they do locally. Claude can spawn them with the Task tool to offload research or parallel work into a separate context window, keeping the main conversation lighter. Subagents defined in your repo’s `.claude/agents/` are picked up automatically. [Agent teams](</docs/en/agent-teams>) are off by default but can be enabled by adding `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` to your environment variables.
+Auto-compaction runs automatically when the context window approaches capacity. To trigger it earlier, set [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](</docs/en/env-vars>) in your environment variables. For example, `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=70` compacts at 70% capacity instead of waiting until the window is nearly full. To change the effective window size for compaction calculations, use [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>). [Subagents](</docs/en/sub-agents>) work the same way they do locally. Claude can spawn them with the Task tool to offload research or parallel work into a separate context window, keeping the main conversation lighter. Subagents defined in your repo’s `.claude/agents/` are picked up automatically. [Agent teams](</docs/en/agent-teams>) are off by default but can be enabled by adding `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` to your environment variables.
###
--- a/costs.md
+++ b/costs.md
@@ -21,7 +21,7 @@
Total duration (wall): 6h 33m 10.2s
Total code changes: 0 lines added, 0 lines removed
-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.
+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. 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.
##
--- a/env-vars.md
+++ b/env-vars.md
@@ -132,11 +132,11 @@
`BASH_MAX_OUTPUT_LENGTH`| Maximum number of characters in bash outputs before the full output is saved to a file and Claude receives the path plus a short preview. See [Bash tool behavior](</docs/en/tools-reference#bash-tool-behavior>)
`BASH_MAX_TIMEOUT_MS`| Maximum timeout the model can set for long-running bash commands (default: 600000, or 10 minutes)
`CCR_FORCE_BUNDLE`| Set to `1` to force [`claude --remote`](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) to bundle and upload your local repository even when GitHub access is available
-`CLAUDECODE`| Set to `1` in subprocesses Claude Code spawns (Bash and PowerShell tools, tmux sessions, [hook](</docs/en/hooks>) commands, [status line](</docs/en/statusline>) commands, stdio [MCP server](</docs/en/mcp>) subprocesses). Use to detect when a script is running inside a subprocess spawned by Claude Code
+`CLAUDECODE`| Set to `1` in subprocesses Claude Code spawns (Bash and PowerShell tools, tmux sessions, [hook](</docs/en/hooks>) commands, [status line](</docs/en/statusline>) commands, stdio [MCP server](</docs/en/mcp>) subprocesses). IDE extensions also set this in their integrated terminals. Use to detect when a script is running inside a subprocess spawned by Claude Code. To check whether the current process was spawned directly by a tool call or hook, rather than inside a stdio MCP server that Claude Code started, use `CLAUDE_CODE_CHILD_SESSION` instead
`CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS`| Set to `1` to disable all built-in [subagent](</docs/en/sub-agents>) types such as Explore and Plan. Only applies in non-interactive mode (the `-p` flag). Useful for SDK users who want a blank slate
`CLAUDE_AGENT_SDK_MCP_NO_PREFIX`| Set to `1` to skip the `mcp__<server>__` prefix on tool names from SDK-created MCP servers. Tools use their original names. SDK usage only
`CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS`| Stall timeout in milliseconds for background subagents. Default `600000` (10 minutes). The timer resets on each streaming progress event; if no progress arrives within the window, the subagent is aborted and the task is marked failed, surfacing any partial result to the parent
-`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`| Set the percentage of context capacity (1-100) at which auto-compaction triggers. By default, auto-compaction triggers at approximately 95% capacity. Use lower values like `50` to compact earlier. Values above the default threshold have no effect. Applies to both main conversations and subagents. This percentage aligns with the `context_window.used_percentage` field available in [status line](</docs/en/statusline>)
+`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`| Set the percentage (1-100) of the auto-compaction window at which auto-compaction triggers. Use lower values like `50` to compact earlier. This variable only causes earlier compaction when Claude Code compacts proactively: when `CLAUDE_CODE_AUTO_COMPACT_WINDOW` is set, in [cloud sessions](</docs/en/claude-code-on-the-web>), in [Remote Control](</docs/en/remote-control>) sessions, and on Sonnet 4.6 and Opus 4.6 without [extended context](</docs/en/model-config#extended-context>), which compact at the 200K boundary by default. In other cases, such as a default local session, auto-compaction triggers when the conversation reaches the model’s context limit. The override can only lower the threshold, so values above the default have no effect. Applies to both main conversations and subagents
`CLAUDE_AUTO_BACKGROUND_TASKS`| Set to `1` to force-enable automatic backgrounding of long-running agent tasks. When enabled, subagents are moved to the background after running for approximately two minutes
`CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR`| Return to the original working directory after each Bash or PowerShell command in the main session
`CLAUDE_CODE_ACCESSIBILITY`| Set to `1` to keep the native terminal cursor visible and disable the inverted-text cursor indicator. Allows screen magnifiers like macOS Zoom to track cursor position
@@ -148,6 +148,7 @@
`CLAUDE_CODE_AUTO_COMPACT_WINDOW`| Set the context capacity in tokens used for auto-compaction calculations. Defaults to the model’s context window: 200K for standard models or 1M for [extended context](</docs/en/model-config#extended-context>) models. Use a lower value like `500000` on a 1M model to treat the window as 500K for compaction purposes. The value is capped at the model’s actual context window. `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` is applied as a percentage of this value. Setting this variable decouples the compaction threshold from the status line’s `used_percentage`, which always uses the model’s full context window
`CLAUDE_CODE_AUTO_CONNECT_IDE`| Override automatic [IDE connection](</docs/en/vs-code>). By default, Claude Code connects automatically when launched inside a supported IDE’s integrated terminal. Set to `false` to prevent this. Set to `true` to force a connection attempt when auto-detection fails, such as when tmux obscures the parent terminal. Takes precedence over the [`autoConnectIde`](</docs/en/settings#global-config-settings>) global config setting
`CLAUDE_CODE_CERT_STORE`| Comma-separated list of CA certificate sources for TLS connections. `bundled` is the Mozilla CA set shipped with Claude Code. `system` is the operating system trust store. Default is `bundled,system`
+`CLAUDE_CODE_CHILD_SESSION`| Set to `1` in subprocesses Claude Code spawns via the Bash, PowerShell, and Monitor tools, [hook](</docs/en/hooks>) commands, and [status line](</docs/en/statusline>) commands. Not set for stdio [MCP server](</docs/en/mcp>) subprocesses, which are long-lived and outlive the session that spawned them. Unlike `CLAUDECODE`, this is only set by Claude Code’s own spawn path and not by IDE extensions, so it reliably distinguishes a nested session from a top-level `claude` launched in an IDE-integrated terminal. A nested interactive `claude` TUI started this way is automatically excluded from `--resume`, `--continue`, up-arrow history, and the `claude agents` list. Non-interactive `claude -p` sessions still persist. Set `CLAUDE_CODE_FORCE_SESSION_PERSISTENCE=1` to override this exclusion. Requires Claude Code v2.1.172 or later
`CLAUDE_CODE_CLIENT_CERT`| Path to client certificate file for mTLS authentication
`CLAUDE_CODE_CLIENT_KEY`| Path to client private key file for mTLS authentication
`CLAUDE_CODE_CLIENT_KEY_PASSPHRASE`| Passphrase for encrypted CLAUDE_CODE_CLIENT_KEY (optional)
@@ -194,7 +195,7 @@
`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS`| Set to `1` to enable [agent teams](</docs/en/agent-teams>). Agent teams are experimental and disabled by default
`CLAUDE_CODE_EXTRA_BODY`| JSON object to merge into the top level of every API request body. Useful for passing provider-specific parameters that Claude Code does not expose directly
`CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS`| Override the default token limit for file reads. Useful when you need to read larger files in full
-`CLAUDE_CODE_FORCE_SESSION_PERSISTENCE`| Removed in v2.1.170. This variable forced transcript persistence when an inherited `CLAUDECODE` value caused a top-level session to be misclassified as nested. The nested-session detection it overrode was removed in v2.1.170, so the variable no longer applies
+`CLAUDE_CODE_FORCE_SESSION_PERSISTENCE`| Set to `1` to force transcript persistence, prompt history, and `claude agents` registration even when this `claude` was launched from inside another Claude Code session. Use when an inherited `CLAUDE_CODE_CHILD_SESSION` value, for example from a tmux server first started by Claude Code’s Bash tool, causes a genuine top-level session to be misclassified as nested. Also honored on v2.1.169 and earlier; has no effect on v2.1.170 and v2.1.171, where the nested-session detection it overrides was removed
`CLAUDE_CODE_FORCE_SYNC_OUTPUT`| Set to `1` to force-enable DEC private mode 2026 [synchronized output](<https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036>) when your terminal supports it but is not auto-detected. Useful for emulators such as Emacs `eat` that implement BSU/ESU but do not reply to the capability probe. Has no effect under tmux
`CLAUDE_CODE_FORK_SUBAGENT`| Set to `1` to make [forked subagents](</docs/en/sub-agents#fork-the-current-conversation>) the model’s default, or `0` to disable them, overriding any server-side rollout. When enabled, Claude spawns a fork, a subagent that inherits the full conversation context instead of starting fresh, whenever it would otherwise use the general-purpose subagent, and all subagent spawns run in the background. The explicit [`/fork`](</docs/en/commands>) command works without this variable. Works in interactive mode and via the SDK or `claude -p`
`CLAUDE_CODE_GIT_BASH_PATH`| Windows only: path to the Git Bash executable (`bash.exe`). Use when Git Bash is installed but not in your PATH. See [Windows setup](</docs/en/setup#set-up-on-windows>)
@@ -238,7 +239,7 @@
`CLAUDE_CODE_RESUME_PROMPT`| Override the continuation message injected when resuming a session that ended mid-turn. Defaults to `Continue from where you left off.`. Spawn scripts for long-running agents can set this to a more directive boot message. An empty string uses the default
`CLAUDE_CODE_SAFE_MODE`| Set to `1` to start in safe mode: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, custom keybindings, status line and file-suggestion commands, LSP servers, and auto-memory do not load, for troubleshooting a broken configuration. Managed settings policy still applies, including policy-configured hooks, status line, and file-suggestion commands; managed plugins, managed skills, managed CLAUDE.md, and policy-configured MCP servers do not. Equivalent to passing [`--safe-mode`](</docs/en/cli-reference#cli-flags>). Directly spawned child processes inherit the variable
`CLAUDE_CODE_SCRIPT_CAPS`| JSON object limiting how many times specific scripts may be invoked per session when `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` is set. Keys are substrings matched against the command text; values are integer call limits. For example, `{"deploy.sh": 2}` allows `deploy.sh` to be called at most twice. Matching is substring-based so shell-expansion tricks like `./scripts/deploy.sh $(evil)` still count against the cap. Runtime fan-out via `xargs` or `find -exec` is not detected; this is a defense-in-depth control
-`CLAUDE_CODE_SCROLL_SPEED`| Set the mouse wheel scroll multiplier in [fullscreen rendering](</docs/en/fullscreen#mouse-wheel-scrolling>). Accepts values from 1 to 20. Set to `3` to match `vim` if your terminal sends one wheel event per notch without amplification. Ignored in the JetBrains IDE terminal, where Claude Code uses its own scroll handling
+`CLAUDE_CODE_SCROLL_SPEED`| Set the mouse wheel scroll multiplier in [fullscreen rendering](</docs/en/fullscreen#mouse-wheel-scrolling>). Accepts values from 1 to 20, and fractional values below 1 such as `0.5` to slow accelerated trackpad and wheel scrolling in terminals on the native scroll path. Set to `3` to match `vim` if your terminal sends one wheel event per notch without amplification. Ignored in the JetBrains IDE terminal, where Claude Code uses its own scroll handling
`CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS`| Override the time budget in milliseconds for [SessionEnd](</docs/en/hooks#sessionend>) hooks. Applies to session exit, `/clear`, and switching sessions via interactive `/resume`. By default the budget is 1.5 seconds, automatically raised to the highest per-hook `timeout` configured in settings files, up to 60 seconds. Timeouts on plugin-provided hooks do not raise the budget
`CLAUDE_CODE_SESSION_ID`| Set automatically to the current session ID in Bash and PowerShell tool subprocesses, [hook command](</docs/en/hooks>) subprocesses, and stdio [MCP server](</docs/en/mcp>) subprocesses. For Bash, PowerShell, and hooks this matches the `session_id` field in the hook JSON input and is updated on `/clear`. An MCP server subprocess retains the ID it was spawned with. On `--resume <session-id>` it receives the resumed ID, matching hooks and Bash. On `--continue` or `--resume` without an explicit ID it may receive the initial startup ID instead. Use to correlate scripts and external tools with the Claude Code session that launched them
`CLAUDE_CODE_SHELL`| Override automatic shell detection. Useful when your login shell differs from your preferred working shell (for example, `bash` vs `zsh`)
--- a/errors.md
+++ b/errors.md
@@ -24,6 +24,7 @@
`Request rejected (429)`| Usage limits
`Credit balance is too low`| Usage limits
`Not logged in · Please run /login`| Authentication
+`Could not resolve authentication method`| Authentication
`Invalid API key`| Authentication
`This organization has been disabled`| Authentication
`Your organization has disabled API key authentication`| Authentication
@@ -192,7 +193,7 @@
API Error: Usage credits required for 1M context · run /usage-credits to turn them on, or /model to switch to standard context
-This is an entitlement check, not a quota exhaustion. It fires even when your session and weekly allowances have capacity remaining. See [Extended context](</docs/en/model-config#extended-context>) for which plans include 1M context directly and which require usage credits. **What to do:**
+This is an entitlement check, not a quota exhaustion. It fires even when your session and weekly allowances have capacity remaining. See [Extended context](</docs/en/model-config#extended-context>) for which plans include 1M context directly and which require usage credits. When this error appears mid-conversation because the context grew past 200K tokens, Claude Code automatically compacts the conversation back under the standard context limit and keeps the session at that limit afterward, so no action is needed. On versions before v2.1.172, the error repeated on every subsequent request including `/compact`; run `/clear` on those versions to recover. The steps below apply when you explicitly selected a `[1m]` model. **What to do:**
* Run `/model` and select the variant without the `[1m]` suffix to fall back to the standard context window
* Run `/usage-credits` to turn on metered billing for the 1M variant on Pro and Max, or to request it from your admin on Team and Enterprise
@@ -273,6 +274,23 @@
* See [Authentication precedence](</docs/en/authentication#authentication-precedence>) to understand which credential wins when several are present
If you are prompted to log in repeatedly, see [Not logged in or token expired](</docs/en/troubleshoot-install#not-logged-in-or-token-expired>) for system clock and macOS Keychain fixes.
+
+###
+
+
+
+Could not resolve authentication method
+
+The session reached the API client without any credential. This appears in [background sessions](</docs/en/agent-view>), cloud sessions, and Agent SDK contexts where the interactive login check does not run before the first request.
+
+ Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted
+
+Before v2.1.174, a background or cloud session assigned to an idle pre-initialized worker could fail this way even when valid credentials were configured. Upgrade to recover. On current versions the error means no credential was available to the worker process. **What to do:**
+
+ * Upgrade to v2.1.174 or later if this appears in a background or cloud session and your credentials are already configured
+ * Confirm `ANTHROPIC_API_KEY`, `CLAUDE_CODE_OAUTH_TOKEN`, or your cloud provider credentials are set in the environment that launches the worker, not only in your interactive shell
+ * For the Agent SDK, see [authentication setup](</docs/en/agent-sdk/overview#get-started>)
+ * Run `/status` in an interactive session in the same environment to confirm which credential source resolves
###
@@ -692,7 +710,7 @@
* Press Esc twice or run `/rewind` to step back to a checkpoint before the turn that triggered the refusal, then rephrase or take a different approach. See [Checkpointing](</docs/en/checkpointing>).
* If you cannot identify which turn caused it, run `/clear` to start a fresh conversation in the same project. Your previous conversation is preserved on disk and remains available in `/resume`.
- * In [non-interactive mode](</docs/en/headless>) (`-p`), where rewind is unavailable, retry with a rephrased prompt or start a new session without `--continue`.
+ * In [non-interactive mode](</docs/en/headless>) (`-p`), where rewind is unavailable, retry with a rephrased prompt in a new session without `--continue`. Policy checks vary by model, so switching to a different model with `--model` may also resolve the refusal in some cases.
##
--- a/fullscreen.md
+++ b/fullscreen.md
@@ -84,7 +84,7 @@
export CLAUDE_CODE_SCROLL_SPEED=3
-A value of `3` matches the default in `vim` and similar applications. The setting accepts values from 1 to 20. To adjust scroll speed interactively, run `/scroll-speed`. The dialog shows a ruler you can scroll while it is open so you can feel the change immediately. Press `←` and `→` to adjust, `r` to reset to the auto-detected default, and `Enter` to save. The command writes the same value the `CLAUDE_CODE_SCROLL_SPEED` environment variable sets, persisted to `~/.claude/settings.json`. The command is not available in the JetBrains IDE terminal.
+A value of `3` matches the default in `vim` and similar applications. The setting accepts values from 1 to 20, and fractional values below 1 such as `0.5` to slow accelerated trackpad and wheel scrolling in terminals on the native scroll path. To adjust scroll speed interactively, run `/scroll-speed`. The dialog shows a ruler you can scroll while it is open so you can feel the change immediately. Press `←` and `→` to adjust, `r` to reset to the auto-detected default, and `Enter` to save. The command writes the same value the `CLAUDE_CODE_SCROLL_SPEED` environment variable sets, persisted to `~/.claude/settings.json`. The command is not available in the JetBrains IDE terminal. Separately from the base speed, Claude Code accelerates the scroll rate when you spin the wheel quickly, so a fast spin covers more distance than the same number of slow notches. To turn acceleration off and keep a constant rate per notch, set `wheelScrollAccelerationEnabled` to `false` in [`settings.json`](</docs/en/settings#available-settings>). This setting requires Claude Code v2.1.174 or later.
###
--- a/hooks.md
+++ b/hooks.md
@@ -577,7 +577,7 @@
`agent_id`| Unique identifier for the subagent. Present only when the hook fires inside a subagent call. Use this to distinguish subagent hook calls from main-thread calls.
`agent_type`| Agent name (for example, `"Explore"` or `"security-reviewer"`). Present when the session uses `--agent` or the hook fires inside a subagent. For subagents, the subagent’s type takes precedence over the session’s `--agent` value. For [custom subagents](</docs/en/sub-agents>), this is the `name` field from the agent’s frontmatter, not the filename.
-Only `SessionStart` hooks receive a `model` field. There is no `$CLAUDE_MODEL` environment variable. A hook process inherits the parent environment, so it can read `$ANTHROPIC_MODEL` if you set it in your shell, but that value does not change when you switch models with `/model` during a session. For example, a `PreToolUse` hook for a Bash command receives this on stdin:
+Only `SessionStart` hooks can receive a `model` field, and it is not guaranteed to be present. There is no `$CLAUDE_MODEL` environment variable. A hook process inherits the parent environment, so it can read `$ANTHROPIC_MODEL` if you set it in your shell, but that value does not change when you switch models with `/model` during a session. For example, a `PreToolUse` hook for a Bash command receives this on stdin:
{
"session_id": "abc123",
@@ -856,7 +856,7 @@
SessionStart input
-In addition to the common input fields, SessionStart hooks receive `source`, `model`, and optionally `agent_type` and `session_title`. The `source` field indicates how the session started: `"startup"` for new sessions, `"resume"` for resumed sessions, `"clear"` after `/clear`, or `"compact"` after compaction. The `model` field contains the model identifier. If you start Claude Code with `claude --agent <name>`, an `agent_type` field contains the agent name. The `session_title` field carries the current session title if one is already set, for example via `--name` or `/rename`. A hook that emits `sessionTitle` can check `session_title` first to avoid overwriting a title the user set explicitly.
+In addition to the common input fields, SessionStart hooks receive `source` and optionally `model`, `agent_type`, and `session_title`. The `source` field indicates how the session started: `"startup"` for new sessions, `"resume"` for resumed sessions, `"clear"` after `/clear`, or `"compact"` after compaction. The `model` field contains the active model identifier. It can be omitted, for example after `/clear` or when a session is restored through conversation recovery, so check for the field before reading it. If you start Claude Code with `claude --agent <name>`, an `agent_type` field contains the agent name. The `session_title` field carries the current session title if one is already set, for example via `--name` or `/rename`. A hook that emits `sessionTitle` can check `session_title` first to avoid overwriting a title the user set explicitly.
{
"session_id": "abc123",
@@ -1382,12 +1382,13 @@
`status`| string| `"completed"`| `"completed"` for synchronous calls, `"async_launched"` for `run_in_background: true`
`agentId`| string| `"a4d2c8f1e0b3a297"`| Identifier for the subagent run
`content`| array| `[{"type": "text", "text": "Found 12 endpoints..."}]`| The subagent’s final text blocks
+`resolvedModel`| string| `"claude-sonnet-4-5"`| Model the subagent ran on, which may differ from the requested model. Requires Claude Code v2.1.174 or later
`totalTokens`| number| `12450`| Total tokens billed across the subagent’s turns
`totalDurationMs`| number| `48211`| Wall-clock duration of the subagent run
`totalToolUseCount`| number| `7`| Count of tool calls the subagent made
`usage`| object| `{"input_tokens": 8320, ...}`| Per-type token breakdown: `input_tokens`, `output_tokens`, `cache_creation_input_tokens`, `cache_read_input_tokens`
-For `run_in_background: true` calls, the tool returns immediately after launching the subagent, so `tool_response` carries no usage fields. It has `status: "async_launched"`, `agentId`, `description`, `prompt`, and `outputFile` instead.
+For `run_in_background: true` calls, the tool returns immediately after launching the subagent, so `tool_response` carries no usage fields. It has `status: "async_launched"`, `agentId`, `description`, `prompt`, `outputFile`, and `resolvedModel`. The `resolvedModel` field names the model the subagent actually runs on, which can differ from the `model` value in `tool_input`. It requires Claude Code v2.1.174 or later.
##### AskUserQuestion
--- a/interactive-mode.md
+++ b/interactive-mode.md
@@ -21,7 +21,7 @@
Shortcut| Description| Context
---|---|---
`Ctrl+C`| Interrupt, or clear input| Interrupts a running operation. If nothing is running, the first press clears the prompt input and a second press exits Claude Code
-`Ctrl+X Ctrl+K`| Kill all running [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) in this session. Press twice within 3 seconds to confirm| Subagent control
+`Ctrl+X Ctrl+K`| Stop all running [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) in this session. Press twice within 3 seconds to confirm| Subagent control
`Ctrl+D`| Exit Claude Code session| EOF signal
`Ctrl+G` or `Ctrl+X Ctrl+E`| Open in default text editor| Edit your prompt or custom response in your default text editor. `Ctrl+X Ctrl+E` is the readline-native binding. Turn on Show last response in external editor in `/config` to prepend Claude’s previous reply as `#`-commented context above your prompt; the comment block is stripped when you save
`Ctrl+L`| Redraw screen| Forces a full terminal redraw. Input and conversation history are kept. Use this to recover if the display becomes garbled or partially blank
--- a/jetbrains.md
+++ b/jetbrains.md
@@ -33,13 +33,21 @@
Installation
-###
-
-
-
-Marketplace installation
-
-Find and install the [Claude Code plugin](<https://plugins.jetbrains.com/plugin/27310-claude-code-beta->) from the JetBrains marketplace and restart your IDE. If you haven’t installed Claude Code yet, see the [quickstart guide](</docs/en/quickstart>) for installation instructions. Claude Code works with any paid Claude subscription (Pro, Max, Team, or Enterprise) or a Claude Console account, and no API key is required. You’ll be prompted to [log in](</docs/en/authentication#log-in-to-claude-code>) the first time you run `claude`.
+The plugin runs the `claude` command in your IDE’s integrated terminal and connects to it. It does not bundle its own copy of the CLI, so install both pieces:
+
+1
+
+Install the Claude Code CLI
+
+Follow the [quickstart](</docs/en/quickstart>) to install the CLI if you haven’t already. The plugin shows a “Cannot launch Claude Code” notification when `claude` isn’t on your PATH.
+
+2
+
+Install the JetBrains plugin
+
+Install the [Claude Code plugin](<https://plugins.jetbrains.com/plugin/27310-claude-code-beta->) from the JetBrains Marketplace and restart your IDE.
+
+If `claude` is installed somewhere your IDE can’t find, set the full path in the plugin’s Claude command setting. Claude Code works with any paid Claude subscription (Pro, Max, Team, or Enterprise) or a Claude Console account, and no API key is required. You’ll be prompted to [log in](</docs/en/authentication#log-in-to-claude-code>) the first time you run `claude`.
After installing the plugin, you may need to restart your IDE completely for it to take effect.
--- a/keybindings.md
+++ b/keybindings.md
@@ -116,7 +116,7 @@
`chat:cancel`| Escape| Cancel current input
`chat:clearInput`| Ctrl+L| Force a full screen redraw, preserving input. In [fullscreen rendering](</docs/en/fullscreen#clear-the-conversation>), press twice within two seconds to run `/clear`
`chat:clearScreen`| Cmd+K| In [fullscreen rendering](</docs/en/fullscreen#clear-the-conversation>), press twice within two seconds to run `/clear`
-`chat:killAgents`| Ctrl+X Ctrl+K| Kill all running [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) in this session
+`chat:killAgents`| Ctrl+X Ctrl+K| Stop all running [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) in this session
`chat:cycleMode`| Shift+Tab*| Cycle permission modes
`chat:modelPicker`| Meta+P| Open model picker
`chat:fastMode`| Meta+O| Toggle fast mode
--- a/model-config.md
+++ b/model-config.md
@@ -95,7 +95,14 @@
Restrict model selection
-Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, or `ANTHROPIC_MODEL` environment variable. Elements of a fallback model chain outside the list are dropped.
+Enterprise administrators can use `availableModels` in [managed or policy settings](</docs/en/settings#settings-files>) to restrict which models users can select. When `availableModels` is set, the allowlist applies to every surface where a user can name a model:
+
+ * **Main session model** : `/model`, the `--model` flag, and the `ANTHROPIC_MODEL` environment variable
+ * **Subagent models** : the `model` field in [subagent](</docs/en/sub-agents#choose-a-model>) frontmatter, the Agent tool’s `model` parameter, the model picker in `/agents`, and `CLAUDE_CODE_SUBAGENT_MODEL`
+ * **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting
+ * **Fallback chains** : elements of a fallback model chain outside the list are dropped
+
+Switching to a blocked model with `/model` is rejected with an error, while a blocked `--model` flag or `ANTHROPIC_MODEL` value is ignored at startup and the session starts on the default model. A blocked subagent or advisor override falls back to the inherited or default model rather than failing the request.
{
"availableModels": ["sonnet", "haiku"]
@@ -147,7 +154,7 @@
Mantle model IDs
-When the [Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is enabled, entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options and routed to the Mantle endpoint. This is an exception to the alias-only matching described in Pin models for third-party deployments. The setting still restricts the picker to listed entries, so include the standard aliases alongside any Mantle IDs.
+When the [Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is enabled, entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options and routed to the Mantle endpoint. The setting still restricts the picker to listed entries, so include the standard aliases alongside any Mantle IDs.
##
@@ -181,7 +188,7 @@
* **In plan mode** \- Uses `opus` for complex reasoning and architecture decisions
* **In execution mode** \- Automatically switches to `sonnet` for code generation and implementation
-This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase runs with the standard 200K context window. The automatic 1M upgrade described in Extended context applies to the `opus` model setting and does not extend to `opusplan`. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>).
+This gives you the best of both worlds: Opus’s superior reasoning for planning, and Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting. On subscription tiers where Opus is automatically upgraded to 1M context, `opusplan` receives the upgrade in plan mode as well. To force 1M context for both phases when you are not on an auto-upgrade tier, set the model to `opusplan[1m]`. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>).
###
@@ -425,13 +432,13 @@
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8[1m]'
-The `[1m]` suffix applies the 1M context window to all usage of the `opus` and `sonnet` aliases. It does not extend the plan-mode Opus phase of `opusplan`, which remains capped at 200K.
+The `[1m]` suffix applies the 1M context window to all usage of the `opus` and `sonnet` aliases, including the plan-mode Opus phase of `opusplan`.
* Claude Code strips the suffix before sending the model ID to your provider.
* Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>).
* The suffix is read per variable, not per model. On Bedrock, Vertex, and Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix.
-The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias (`fable`, `opus`, `sonnet`, `haiku`), not the provider-specific model ID.
+The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias such as `opus`, the version prefix such as `claude-opus-4-8`, or the full model ID. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching, so an entry of `claude-opus-4-8` permits both the standard and 1M-context Opus rows. Provider-specific prefixes such as `us.anthropic.` are not stripped: list the same form in `availableModels` that the picker shows, or map it through `modelOverrides`.
###
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -470,6 +470,7 @@
* All standard attributes
* `type`: (`"added"`, `"removed"`)
+ * `model`: Model identifier for the model that made the change (for example, “claude-sonnet-4-6”). Requires Claude Code v2.1.172 or later
####
@@ -865,6 +866,7 @@
* `plugin_id_hash`: deterministic hash of the plugin name and marketplace, sent only to your configured exporter. Lets you count how many distinct third-party plugins are loaded across your fleet without recording their names
* `has_hooks`: whether the plugin contributes hooks
* `has_mcp`: whether the plugin contributes MCP servers
+ * `host_owned_mcp`: `true` when the SDK host manages this plugin’s MCP connections and Claude Code skipped reading the plugin’s MCP server configuration, `false` otherwise. Requires Claude Code v2.1.172 or later
* `skill_path_count`: number of skill directories the plugin declares
* `command_path_count`: number of command directories the plugin declares
* `agent_path_count`: number of agent directories the plugin declares
@@ -1060,7 +1062,7 @@
---|---
`claude_code.token.usage`| Break down by `type` (input/output), user, team, model, `skill.name`, `plugin.name`, or `agent.name`
`claude_code.session.count`| Track adoption and engagement over time
-`claude_code.lines_of_code.count`| Measure productivity by tracking code additions/removals
+`claude_code.lines_of_code.count`| Measure productivity by tracking code additions and removals, broken down by model
`claude_code.commit.count` & `claude_code.pull_request.count`| Understand impact on development workflows
###
@@ -1089,7 +1091,7 @@
* Unusual token consumption
* High session volume from specific users
-All metrics can be segmented by the standard attributes. The `model` attribute is available on `claude_code.token.usage` and `claude_code.cost.usage` only; activity counters have never carried it. Per-model breakdowns of lines of code or commits can only be approximated by joining against the token or cost metrics on `session.id`, since one session can span multiple models.
+All metrics can be segmented by the standard attributes. The `model` attribute is available on `claude_code.token.usage`, `claude_code.cost.usage`, and from v2.1.172, `claude_code.lines_of_code.count`. Per-model breakdowns of commits can only be approximated by joining against the token or cost metrics on `session.id`, since one session can span multiple models.
###
--- a/overview.md
+++ b/overview.md
@@ -78,7 +78,7 @@
Run Claude Code in your browser with no local setup. Kick off long-running tasks and check back when they’re done, work on repos you don’t have locally, or run multiple tasks in parallel. Available on desktop browsers and the Claude iOS app.Start coding at [claude.ai/code](<https://claude.ai/code>).[Get started on the web →](</docs/en/web-quickstart>)
-A plugin for IntelliJ IDEA, PyCharm, WebStorm, and other JetBrains IDEs with interactive diff viewing and selection context sharing.Install the [Claude Code plugin](<https://plugins.jetbrains.com/plugin/27310-claude-code-beta->) from the JetBrains Marketplace and restart your IDE.[Get started with JetBrains →](</docs/en/jetbrains>)
+A plugin for IntelliJ IDEA, PyCharm, WebStorm, and other JetBrains IDEs with interactive diff viewing and selection context sharing.Install the [Claude Code plugin](<https://plugins.jetbrains.com/plugin/27310-claude-code-beta->) from the JetBrains Marketplace and restart your IDE. The plugin requires the Claude Code CLI, installed separately; see the [JetBrains setup steps](</docs/en/jetbrains#installation>).[Get started with JetBrains →](</docs/en/jetbrains>)
##
--- a/permissions.md
+++ b/permissions.md
@@ -253,7 +253,7 @@
`Read(.env)` or `Read(**/.env)`| any `.env` at or under the current directory| `.env` in a parent directory or another project
`Read(//**/.env)`| any `.env` anywhere on the filesystem| nothing; the rule is anchored at the filesystem root
-In gitignore patterns, `*` matches files in a single directory while `**` matches recursively across directories. To allow all file access, use just the tool name without parentheses: `Read`, `Edit`, or `Write`.
+In gitignore patterns, `*` matches within a single path segment and can appear at any position in the pattern, while `**` matches across directories. To allow all file access, use just the tool name without parentheses: `Read`, `Edit`, or `Write`.
When Claude accesses a symlink, permission rules check two paths: the symlink itself and the file it resolves to. Allow and deny rules treat that pair differently: allow rules fall back to prompting you, while deny rules block outright.
@@ -268,7 +268,13 @@
WebFetch
- * `WebFetch(domain:example.com)` matches fetch requests to example.com
+WebFetch rules use a `domain:` prefix and match against the hostname of the requested URL. Matching is case-insensitive, supports `*` wildcards, and strips a trailing `.` from both the rule and the hostname so `example.com.` and `example.com` are treated the same.
+
+ * `WebFetch(domain:example.com)` matches requests to `example.com`
+ * `WebFetch(domain:*.example.com)` matches any subdomain at any depth, such as `api.example.com` or `a.b.example.com`, but not `example.com` itself
+ * `WebFetch(domain:*)` matches every domain and is equivalent to a bare `WebFetch` rule
+
+A `*` matches across a `.` only as a leading `*.` or as the entire pattern. Elsewhere it stays within one label, so `WebFetch(domain:github.*)` matches `github.io` but not `github.evil.com`, a domain an attacker could register. When an exact rule and a wildcard rule in the same allow, ask, or deny list both match a hostname, the exact rule is the one matched. Evaluation order is unchanged: deny rules still run before ask and allow rules regardless of specificity.
###
--- a/plugin-hints.md
+++ b/plugin-hints.md
@@ -6,7 +6,7 @@
How it works
-Claude Code sets the [`CLAUDECODE`](</docs/en/env-vars>) environment variable to `1` for every command it runs through the Bash and PowerShell tools, and for [hook](</docs/en/hooks>) commands. When your CLI sees that variable, it writes a self-closing `<claude-code-hint />` tag to stderr. In hook commands the hint tag is stripped and ignored. Only Bash and PowerShell tool output triggers the install prompt. When Claude Code receives the command output, it:
+Claude Code sets the [`CLAUDECODE`](</docs/en/env-vars>) environment variable to `1` for every command it runs through the Bash and PowerShell tools, and for [hook](</docs/en/hooks>) commands. From v2.1.172 it also sets [`CLAUDE_CODE_CHILD_SESSION`](</docs/en/env-vars>) to `1` in those same subprocesses. When your CLI sees one of these variables, it writes a self-closing `<claude-code-hint />` tag to stderr. In hook commands the hint tag is stripped and ignored. Only Bash and PowerShell tool output triggers the install prompt. When Claude Code receives the command output, it:
1. Scans for hint lines and removes them before the output reaches the model
2. Checks that the hint targets a plugin in an official Anthropic marketplace
@@ -21,7 +21,12 @@
Emit the hint
-Gate emission on the `CLAUDECODE` environment variable so the marker never appears in a human user’s terminal. Then write the tag to stderr on its own line. The following examples emit a hint for a plugin named `example-cli` in the official marketplace:
+Gate emission on an environment variable so the marker is unlikely to appear when a human runs your CLI directly, then write the tag to stderr on its own line. Choose which variable to check:
+
+ * `CLAUDECODE`: set on every Claude Code version, so it reaches the most sessions. It is also set in tmux sessions and stdio MCP server subprocesses that Claude Code starts, and IDE extensions set it in their integrated terminals, where a human may be running your CLI directly.
+ * `CLAUDE_CODE_CHILD_SESSION`: set only in subprocesses Claude Code itself spawns, such as tool calls, hook commands, and [status line](</docs/en/statusline>) commands, so the tag does not normally reach a human terminal. A long-lived process that was started inside a session, such as a tmux server, captures the variable, so shells later launched from that process still show the raw tag. Requires Claude Code v2.1.172 or later, so sessions on older versions miss the hint.
+
+The following examples gate on `CLAUDECODE` for maximum reach and emit a hint for a plugin named `example-cli` in the official marketplace:
Node.js
@@ -117,7 +122,7 @@
The hint line is always removed from the output before it reaches the model, even when the version or type is unrecognized, so the marker is never counted toward token usage. The remaining guidance is recommended but not enforced. Claude Code cannot observe whether your CLI follows it:
* **Write to stderr** : stderr keeps the tag out of shell pipelines such as `example-cli deploy | jq`. Claude Code scans both streams, so stdout also works.
- * **Gate on`CLAUDECODE`**: only emit when the `CLAUDECODE` environment variable is set. This prevents the marker from appearing to users running your CLI directly.
+ * **Gate on an environment variable** : only emit when `CLAUDECODE` or `CLAUDE_CODE_CHILD_SESSION` is set. See Emit the hint for how the two variables differ.
##
--- a/remote-control.md
+++ b/remote-control.md
@@ -67,7 +67,7 @@
claude --remote-control "My Project"
-This gives you a full interactive session in your terminal that you can also control from claude.ai or the Claude app. Unlike `claude remote-control` (server mode), you can type messages locally while the session is also available remotely.As of v2.1.162, a `Remote Control active` indicator stays in the footer below the input box while Remote Control is connected. The indicator text is a link to the session on claude.ai, so you can reopen it from the terminal at any time. Select the indicator with the down arrow key and press Enter to open a status panel with the session URL and a QR code.
+This gives you a full interactive session in your terminal that you can also control from claude.ai or the Claude app. Unlike `claude remote-control` (server mode), you can type messages locally while the session is also available remotely.As of v2.1.162, a Remote Control indicator stays in the footer below the input box while the connection is up. From v2.1.172, the indicator reads `/rc active` and is hidden when the terminal is too narrow to fit it; earlier versions always show `Remote Control active`. The indicator text is a link to the session on claude.ai, so you can reopen it from the terminal at any time. Select the indicator with the down arrow key and press Enter to open a status panel with the session URL and a QR code.
If you’re already in a Claude Code session and want to continue it remotely, use the `/remote-control` (or `/rc`) command:
@@ -77,7 +77,7 @@
/remote-control My Project
-This starts a Remote Control session that carries over your current conversation history.As of v2.1.162, a `Remote Control active` indicator appears in the footer below the input box and stays visible while the connection is up. The indicator text is a link to the session on claude.ai. Select it with the down arrow key and press Enter, or run `/remote-control` again, to open a status panel with the session URL and a QR code you can use to connect from another device.The `--verbose`, `--sandbox`, and `--no-sandbox` flags are not available with this command.
+This starts a Remote Control session that carries over your current conversation history.As of v2.1.162, a Remote Control indicator appears in the footer below the input box and stays visible while the connection is up. From v2.1.172, the indicator reads `/rc active` and is hidden when the terminal is too narrow to fit it; earlier versions always show `Remote Control active`. The indicator text is a link to the session on claude.ai. Select it with the down arrow key and press Enter, or run `/remote-control` again, to open a status panel with the session URL and a QR code you can use to connect from another device.The `--verbose`, `--sandbox`, and `--no-sandbox` flags are not available with this command.
In the [Claude Code VS Code extension](</docs/en/vs-code>), type `/remote-control` or `/rc` in the prompt box, or open the command menu with `/` and select it. Requires Claude Code v2.1.79 or later.
--- a/settings.md
+++ b/settings.md
@@ -212,7 +212,7 @@
`autoMode`| Customize what the [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) classifier blocks and allows. Contains `environment`, `allow`, `soft_deny`, and `hard_deny` arrays of prose rules. Include the literal string `"$defaults"` in an array to inherit the built-in rules at that position. See [Configure auto mode](</docs/en/auto-mode-config>). Not read from shared project settings| `{"soft_deny": ["$defaults", "Never run terraform apply"]}`
`autoScrollEnabled`| In [fullscreen rendering](</docs/en/fullscreen>), follow new output to the bottom of the conversation. Default: `true`. Appears in `/config` as **Auto-scroll**. Permission prompts still scroll into view when this is off| `false`
`autoUpdatesChannel`| Release channel to follow for updates. Use `"stable"` for a version that is typically about one week old and skips versions with major regressions, or `"latest"` (default) for the most recent release. To disable auto-updates entirely, set [`DISABLE_AUTOUPDATER`](</docs/en/setup#disable-auto-updates>) in `env`| `"stable"`
-`availableModels`| Restrict which models users can select via `/model`, `--model`, or `ANTHROPIC_MODEL`. Does not affect the Default option. See [Restrict model selection](</docs/en/model-config#restrict-model-selection>)| `["sonnet", "haiku"]`
+`availableModels`| Restrict which models users can select for the main session, [subagents](</docs/en/sub-agents>), and the [advisor](</docs/en/advisor>). Does not affect the Default option. See [Restrict model selection](</docs/en/model-config#restrict-model-selection>)| `["sonnet", "haiku"]`
`awaySummaryEnabled`| Show a one-line session recap when you return to the terminal after a few minutes away. Set to `false` or turn off Session recap in `/config` to disable. Same as [`CLAUDE_CODE_ENABLE_AWAY_SUMMARY`](</docs/en/env-vars>)| `true`
`awsAuthRefresh`| Custom script that modifies the `.aws` directory (see [advanced credential configuration](</docs/en/amazon-bedrock#advanced-credential-configuration>))| `aws sso login --profile myprofile`
`awsCredentialExport`| Custom script that outputs JSON with AWS credentials (see [advanced credential configuration](</docs/en/amazon-bedrock#advanced-credential-configuration>))| `/bin/generate_aws_grant.sh`
@@ -291,6 +291,7 @@
`viewMode`| Default transcript view mode on startup: `"default"`, `"verbose"`, or `"focus"`. Overrides the sticky `/focus` selection when set. The `--verbose` flag overrides this for one session| `"verbose"`
`voice`| [Voice dictation](</docs/en/voice-dictation>) settings: `enabled` turns dictation on, `mode` selects `"hold"` or `"tap"`, and `autoSubmit` sends the prompt on key release in hold mode. Written automatically when you run `/voice`. Requires a Claude.ai account| `{ "enabled": true, "mode": "tap" }`
`voiceEnabled`| Legacy alias for `voice.enabled`. Prefer the `voice` object| `true`
+`wheelScrollAccelerationEnabled`| In [fullscreen rendering](</docs/en/fullscreen#mouse-wheel-scrolling>), accelerate mouse-wheel scroll speed during fast scrolls. Default: `true`. Set to `false` for a constant scroll rate per wheel notch. Requires Claude Code v2.1.174 or later| `false`
`workflowKeywordTriggerEnabled`| Whether the keyword `ultracode` in a prompt triggers a [dynamic workflow](</docs/en/workflows#ask-for-a-workflow-in-your-prompt>). Set to `false` to type the word without triggering one. The `ultracode` effort setting, `/workflows`, and saved workflow commands are unaffected. Default: `true`. Appears in `/config` as **Ultracode keyword trigger**. Added in v2.1.157; before v2.1.160 the trigger keyword was `workflow`| `false`
`wslInheritsWindowsSettings`| (Windows managed settings only) When `true`, Claude Code on WSL reads managed settings from the Windows policy chain in addition to `/etc/claude-code`, with Windows sources taking priority. Only honored when set in the HKLM registry key or `C:\Program Files\ClaudeCode\managed-settings.json`, both of which require Windows admin to write. For HKCU policy to also apply on WSL, the flag must additionally be set in HKCU itself. Has no effect on native Windows| `true`
--- a/structured-outputs.md
+++ b/structured-outputs.md
@@ -223,12 +223,12 @@
Error handling
-Structured output generation can fail when the agent cannot produce valid JSON matching your schema. This typically happens when the schema is too complex for the task, the task itself is ambiguous, or the agent hits its retry limit trying to fix validation errors. When an error occurs, the result message has a `subtype` indicating what went wrong:
+Structured output generation can fail when the agent cannot produce valid JSON matching your schema. This typically happens when the schema is too complex for the task, the task itself is ambiguous, or the agent hits its retry limit trying to fix validation errors. It can also happen without any validation failure: a [model fallback](</docs/en/model-config#automatic-model-fallback>) can retract an already-completed output mid-stream, and if no retry replaces it the run ends with the same error. Check the result’s `errors` text to tell the two causes apart before debugging your schema. When an error occurs, the result message has a `subtype` indicating what went wrong:
Subtype| Meaning
---|---
`success`| Output was generated and validated successfully
-`error_max_structured_output_retries`| Agent couldn’t produce valid output after multiple attempts
+`error_max_structured_output_retries`| No valid output survived after multiple attempts (validation failures, or a model-fallback retraction with no successful retry)
The example below checks the `subtype` field to determine whether the output was generated successfully or if you need to handle a failure:
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -49,7 +49,7 @@
* **Tools** : Read-only tools (denied access to Write and Edit tools)
* **Purpose** : Codebase research for planning
-When you’re in plan mode and Claude needs to understand your codebase, it delegates research to the Plan subagent. This prevents infinite nesting (subagents cannot spawn other subagents) while still gathering necessary context.
+When you’re in plan mode and Claude needs to understand your codebase, it delegates research to the Plan subagent so that exploration output stays in a separate context window while the main conversation remains read-only.
A capable agent for complex, multi-step tasks that require both exploration and action.
@@ -150,7 +150,7 @@
Use the /agents command
-The `/agents` command opens a tabbed interface for managing subagents. The **Running** tab shows live subagents and lets you open or stop them. The **Library** tab lets you:
+The `/agents` command opens a tabbed interface for managing subagents. The **Running** tab lists live and recently finished subagents and lets you open or stop them. The **Library** tab lets you:
* View all available subagents (built-in, user, project, and plugin)
* Create new subagents with guided setup or Claude generation
@@ -301,7 +301,6 @@
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 are not available to subagents, even when listed in the `tools` field:
- * `Agent`
* `AskUserQuestion`
* `EnterPlanMode`
* `ExitPlanMode`, unless the subagent’s `permissionMode` is `plan`
@@ -346,7 +345,7 @@
tools: Agent, Read, Bash
-If `Agent` is omitted from the `tools` list entirely, the agent cannot spawn any subagents. This restriction only applies to agents running as the main thread with `claude --agent`. Subagents cannot spawn other subagents, so `Agent(agent_type)` has no effect in subagent definitions.
+If `Agent` is omitted from the `tools` list entirely, the agent cannot 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.
####
@@ -754,7 +753,18 @@
Consider [Skills](</docs/en/skills>) instead when you want reusable prompts or workflows that run in the main conversation context rather than isolated subagent context. For a quick question about something already in your conversation, use [`/btw`](</docs/en/interactive-mode#side-questions-with-%2Fbtw>) instead of a subagent. It sees your full context but has no tool access, and the answer is discarded rather than added to history.
-Subagents cannot spawn other subagents. If your workflow requires nested delegation, use [Skills](</docs/en/skills>) or chain subagents from the main conversation.
+###
+
+
+
+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 opening a row shows that subagent’s direct children with a path back to `main`. The Running tab in `/agents` lists running subagents as a flat list. Depth is counted as the number of subagent levels below the main conversation, regardless of whether each level runs in the foreground or background:
+
+ * **Foreground subagents** : can spawn at any depth. Each level blocks its parent until it returns, so the chain is self-limiting: the main conversation waits on the entire chain.
+ * **Background subagents** : a background subagent at depth five does not receive the Agent tool and cannot spawn further. The limit is fixed and not configurable, and exists to prevent runaway concurrent trees.
+
+To prevent a specific subagent from spawning others, omit `Agent` from its `tools` list or add it to `disallowedTools`. A fork still cannot spawn another fork. It can spawn other subagent types, and those count toward the depth limit.
###
@@ -804,7 +814,7 @@
Auto-compaction
-Subagents support automatic compaction using the same logic as the main conversation. By default, auto-compaction triggers at approximately 95% capacity. To trigger compaction earlier, set `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` to a lower percentage (for example, `50`). See [environment variables](</docs/en/env-vars>) for details. Compaction events are logged in subagent transcript files:
+Subagents support automatic compaction using the same logic as the main conversation. Compaction triggers under the same conditions, and `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` applies to subagents as well. See [environment variables](</docs/en/env-vars>) for when the override takes effect. Compaction events are logged in subagent transcript files:
{
"type": "system",
--- a/subagents.md
+++ b/subagents.md
@@ -142,7 +142,7 @@
In the Python SDK, these field names use camelCase to match the wire format. See the [`AgentDefinition` reference](</docs/en/agent-sdk/python#agentdefinition>) for details.
-Subagents cannot spawn their own subagents. Don’t include `Agent` in a subagent’s `tools` array.
+As of Claude Code v2.1.172, subagents can spawn their own subagents. A background subagent five levels below the main agent cannot spawn further subagents; foreground subagents can spawn at any depth. 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.
###
--- a/typescript.md
+++ b/typescript.md
@@ -1038,12 +1038,14 @@
type SdkPluginConfig = {
type: "local";
path: string;
+ skipMcpDiscovery?: boolean;
};
Field| Type| Description
---|---|---
`type`| `'local'`| Must be `'local'` (only local plugins currently supported)
`path`| `string`| Absolute or relative path to the plugin directory
+`skipMcpDiscovery`| `boolean`| When `true`, the SDK loads skills, hooks, agents, and commands from this plugin but does not read its `.mcp.json` or manifest `mcpServers`. Set this when your application owns the plugin’s MCP connections.
**Example:**
@@ -1371,15 +1373,17 @@
| { kind: "channel"; server: string }
| { kind: "peer"; from: string; name?: string }
| { kind: "task-notification" }
- | { kind: "coordinator" };
+ | { kind: "coordinator" }
+ | { kind: "auto-continuation" };
`kind`| Meaning
---|---
`human`| Direct input from the end user. On user messages, an absent `origin` also means human input.
`channel`| Message arriving on a [channel](</docs/en/channels>). `server` is the source MCP server name.
-`peer`| Message from another agent session via `SendMessage`. `from` is the sender address; `name` is the sender’s display name when available.
+`peer`| Reserved for messages from another agent session. `from` is the sender address and `name` is the sender’s display name when available. The Agent SDK does not emit this origin; treat as an unknown origin.
`task-notification`| Synthetic turn injected after a background task finished. See `SDKTaskNotificationMessage`.
`coordinator`| Message from a team coordinator in an [agent team](</docs/en/agent-teams>).
+`auto-continuation`| Synthetic turn injected when the session continues without fresh user input, such as a command result that triggers a follow-up prompt.
##
@@ -2401,6 +2405,7 @@
status: "completed";
agentId: string;
content: Array<{ type: "text"; text: string }>;
+ resolvedModel?: string;
totalToolUseCount: number;
totalDurationMs: number;
totalTokens: number;
@@ -2425,6 +2430,7 @@
status: "async_launched";
agentId: string;
description: string;
+ resolvedModel?: string;
prompt: string;
outputFile: string;
canReadOutputFile?: boolean;
@@ -2435,7 +2441,7 @@
message: string;
};
-Returns the result from the subagent. Discriminated on the `status` field: `"completed"` for finished tasks, `"async_launched"` for background tasks, and `"sub_agent_entered"` for interactive subagents.
+Returns the result from the subagent. Discriminated on the `status` field: `"completed"` for finished tasks, `"async_launched"` for background tasks, and `"sub_agent_entered"` for interactive subagents. The `resolvedModel` field on the `completed` and `async_launched` variants names the model the subagent actually ran on, which can differ from the requested `model` input when [`availableModels`](</docs/en/model-config#restrict-model-selection>) or another override applies. This field requires Claude Code v2.1.174 or later.
###
--- a/vs-code.md
+++ b/vs-code.md
@@ -136,6 +136,14 @@
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.
+
+###
+
+
+
+Check account and usage
+
+Run `/usage` from the command menu to open the Account & usage dialog. It shows your signed-in account, plan, and usage bars for the current session and week with how long until each limit resets. The dialog also breaks down what is contributing to your plan limits. It flags behaviors that account for 10% or more of recent usage, such as cache misses, long context, and subagent-heavy or highly parallel sessions, each with a tip to reduce it. Attribution tables show how much usage came from each skill, subagent, plugin, and MCP server. Requires Claude Code v2.1.174 or later. Use the Day and Week toggle to switch between the last 24 hours and the last 7 days. The figures are approximate and computed from local sessions on this machine, so usage from other devices or claude.ai is not included. For more on tracking and reducing usage, see [Track your costs](</docs/en/costs#track-your-costs>).
##