Changes on
43 changes detected
--- a/agent-loop.md
+++ b/agent-loop.md
@@ -45,7 +45,7 @@
As the loop runs, the SDK yields a stream of messages. Each message carries a type that tells you what stage of the loop it came from. The five core types are:
- * **`SystemMessage`:** session lifecycle events. The `subtype` field distinguishes them: `"init"` is the first message (session metadata), and `"compact_boundary"` fires after compaction. In TypeScript, the compact boundary is its own [`SDKCompactBoundaryMessage`](</docs/en/agent-sdk/typescript#sdk-compact-boundary-message>) type rather than a subtype of `SDKSystemMessage`.
+ * **`SystemMessage`:** session lifecycle events. The `subtype` field distinguishes them: `"init"` is the first message (session metadata), and `"compact_boundary"` fires after compaction. In TypeScript, the compact boundary is its own [`SDKCompactBoundaryMessage`](</docs/en/agent-sdk/typescript#sdkcompactboundarymessage>) type rather than a subtype of `SDKSystemMessage`.
* **`AssistantMessage`:** emitted after each Claude response, including the final text-only one. Contains text content blocks and tool call blocks from that turn.
* **`UserMessage`:** emitted after each tool execution with the tool result content sent back to Claude. Also emitted for any user inputs you stream mid-loop.
* **`StreamEvent`:** only emitted when partial messages are enabled. Contains raw API streaming events (text deltas, tool input chunks). See [Stream responses](</docs/en/agent-sdk/streaming-output>).
@@ -138,7 +138,7 @@
Parallel tool execution
-When Claude requests multiple tool calls in a single turn, both SDKs can run them concurrently or sequentially depending on the tool. Read-only tools (like `Read`, `Glob`, `Grep`, and MCP tools marked as read-only) can run concurrently. Tools that modify state (like `Edit`, `Write`, and `Bash`) run sequentially to avoid conflicts. Custom tools default to sequential execution. To enable parallel execution for a custom tool, mark it as read-only in its annotations: `readOnly` in [TypeScript](</docs/en/agent-sdk/typescript#tool>) or `readOnlyHint` in [Python](</docs/en/agent-sdk/python#tool>).
+When Claude requests multiple tool calls in a single turn, both SDKs can run them concurrently or sequentially depending on the tool. Read-only tools (like `Read`, `Glob`, `Grep`, and MCP tools marked as read-only) can run concurrently. Tools that modify state (like `Edit`, `Write`, and `Bash`) run sequentially to avoid conflicts. Custom tools default to sequential execution. To enable parallel execution for a custom tool, set `readOnlyHint` in its annotations. Both the [TypeScript](</docs/en/agent-sdk/typescript#tool>) and [Python](</docs/en/agent-sdk/python#tool>) SDKs use this field name from the MCP SDK.
##
@@ -146,7 +146,7 @@
Control how the loop runs
-You can limit how many turns the loop takes, how much it costs, how deeply Claude reasons, and whether tools require approval before running. All of these are fields on [`ClaudeAgentOptions`](</docs/en/agent-sdk/python#claude-agent-options>) (Python) / [`Options`](</docs/en/agent-sdk/typescript#options>) (TypeScript).
+You can limit how many turns the loop takes, how much it costs, how deeply Claude reasons, and whether tools require approval before running. All of these are fields on [`ClaudeAgentOptions`](</docs/en/agent-sdk/python#claudeagentoptions>) (Python) / [`Options`](</docs/en/agent-sdk/typescript#options>) (TypeScript).
###
@@ -159,7 +159,7 @@
Max turns (`max_turns` / `maxTurns`)| Maximum tool-use round trips| No limit
Max budget (`max_budget_usd` / `maxBudgetUsd`)| Maximum cost before stopping| No limit
-When either limit is hit, the SDK returns a `ResultMessage` with a corresponding error subtype (`error_max_turns` or `error_max_budget_usd`). See Handle the result for how to check these subtypes and [`ClaudeAgentOptions`](</docs/en/agent-sdk/python#claude-agent-options>) / [`Options`](</docs/en/agent-sdk/typescript#options>) for syntax.
+When either limit is hit, the SDK returns a `ResultMessage` with a corresponding error subtype (`error_max_turns` or `error_max_budget_usd`). See Handle the result for how to check these subtypes and [`ClaudeAgentOptions`](</docs/en/agent-sdk/python#claudeagentoptions>) / [`Options`](</docs/en/agent-sdk/typescript#options>) for syntax.
###
@@ -181,7 +181,7 @@
`effort` trades latency and token cost for reasoning depth within each response. [Extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>) is a separate feature that produces visible chain-of-thought blocks in the output. They are independent: you can set `effort: "low"` with extended thinking enabled, or `effort: "max"` without it.
-Use lower effort for agents doing simple, well-scoped tasks (like listing files or running a single grep) to reduce cost and latency. `effort` is set at the top-level `query()` options, not per-subagent.
+Use lower effort for agents doing simple, well-scoped tasks (like listing files or running a single grep) to reduce cost and latency. Set `effort` in the top-level `query()` options for the whole session, or per subagent with the `effort` field on [`AgentDefinition`](</docs/en/agent-sdk/subagents#agentdefinition-configuration>) to override the session level.
###
@@ -195,7 +195,7 @@
---|---
`"default"`| Tools not covered by allow rules trigger your approval callback; no callback means deny
`"acceptEdits"`| Auto-approves file edits and common filesystem commands (`mkdir`, `touch`, `mv`, `cp`, etc.); other Bash commands follow default rules
-`"plan"`| No tool execution; Claude produces a plan for review
+`"plan"`| Read-only tools run; Claude explores and produces a plan without editing your source files
`"dontAsk"`| Never prompts. Tools pre-approved by [permission rules](</docs/en/settings#permission-settings>) run, everything else is denied
`"auto"` (TypeScript only)| Uses a model classifier to approve or deny each tool call. See [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) for availability and behavior
`"bypassPermissions"`| Runs all allowed tools without asking. Cannot be used when running as root on Unix. Use only in isolated environments where the agent’s actions cannot affect systems you care about
@@ -271,7 +271,7 @@
A few strategies for long-running agents:
* **Use subagents for subtasks.** Each subagent starts with a fresh conversation (no prior message history, though it does load its own system prompt and project-level context like CLAUDE.md). It does not see the parent’s turns, and only its final response returns to the parent as a tool result. The main agent’s context grows by that summary, not by the full subtask transcript. See [What subagents inherit](</docs/en/agent-sdk/subagents#what-subagents-inherit>) for details.
- * **Be selective with tools.** Every tool definition takes context space. Use the `tools` field on [`AgentDefinition`](</docs/en/agent-sdk/subagents#agent-definition-configuration>) to scope subagents to the minimum set they need, and use [MCP tool search](</docs/en/agent-sdk/mcp#mcp-tool-search>) to load tools on demand instead of preloading all of them.
+ * **Be selective with tools.** Every tool definition takes context space. Use the `tools` field on [`AgentDefinition`](</docs/en/agent-sdk/subagents#agentdefinition-configuration>) to scope subagents to the minimum set they need, and use [MCP tool search](</docs/en/agent-sdk/mcp#mcp-tool-search>) to load tools on demand instead of preloading all of them.
* **Watch MCP server costs.** Each MCP server adds all its tool schemas to every request. A few servers with many tools can consume significant context before the agent does any work. The `ToolSearch` tool can help by loading tools on-demand instead of preloading all of them. See [MCP tool search](</docs/en/agent-sdk/mcp#mcp-tool-search>) for configuration.
* **Use lower effort for routine tasks.** Set effort to `"low"` for agents that only need to read files or list directories. This reduces token usage and cost.
@@ -285,7 +285,7 @@
Each interaction with the SDK creates or continues a session. Capture the session ID from `ResultMessage.session_id` (available in both SDKs) to resume later. The TypeScript SDK also exposes it as a direct field on the init `SystemMessage`; in Python it’s nested in `SystemMessage.data`. When you resume, the full context from previous turns is restored: files that were read, analysis that was performed, and actions that were taken. You can also fork a session to branch into a different approach without modifying the original. See [Session management](</docs/en/agent-sdk/sessions>) for the full guide on resume, continue, and fork patterns.
-In Python, `ClaudeSDKClient` handles session IDs automatically across multiple calls. See the [Python SDK reference](</docs/en/agent-sdk/python#choosing-between-query-and-claude-sdk-client>) for details.
+In Python, `ClaudeSDKClient` handles session IDs automatically across multiple calls. See the [Python SDK reference](</docs/en/agent-sdk/python#choosing-between-query-and-claudesdkclient>) for details.
##
@@ -303,7 +303,7 @@
`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
-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#sdk-result-message>) (TypeScript) or [`ResultMessage`](</docs/en/agent-sdk/python#result-message>) (Python) for the full type.
+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/authentication.md
+++ b/authentication.md
@@ -141,7 +141,11 @@
Claude Code securely manages your authentication credentials:
- * **Storage location** : on macOS, credentials are stored in the encrypted macOS Keychain. On Linux and Windows, credentials are stored in `~/.claude/.credentials.json`, or under `$CLAUDE_CONFIG_DIR` if that variable is set. On Linux, the file is written with mode `0600`; on Windows, it inherits the access controls of your user profile directory.
+ * **Storage location** :
+ * On macOS, credentials are stored in the encrypted macOS Keychain.
+ * On Linux, credentials are stored in `~/.claude/.credentials.json` with file mode `0600`.
+ * On Windows, credentials are stored in `%USERPROFILE%\.claude\.credentials.json` and inherit the access controls of your user profile directory, which restricts the file to your user account by default.
+ * If you’ve set the `CLAUDE_CONFIG_DIR` environment variable on Linux or Windows, the `.credentials.json` file lives under that directory instead.
* **Supported authentication types** : Claude.ai credentials, Claude API credentials, Azure Auth, Bedrock Auth, and Vertex Auth.
* **Custom credential scripts** : the [`apiKeyHelper`](</docs/en/settings#available-settings>) setting can be configured to run a shell script that returns an API key.
* **Refresh intervals** : by default, `apiKeyHelper` is called after 5 minutes or on HTTP 401 response. Set `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` environment variable for custom refresh intervals.
--- a/changelog.md
+++ b/changelog.md
@@ -5,6 +5,49 @@
> Use this file to discover all available pages before exploring further.
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.131
+
+May 6, 2026
+
+ * Fixed VS Code extension failing to activate on Windows due to a hardcoded build path in the bundled SDK (`createRequire` polyfill bug)
+ * Fixed Mantle endpoint authentication failing with missing `x-api-key` header
+
+
+
+2.1.129
+
+May 6, 2026
+
+ * Added `--plugin-url <url>` flag to fetch a plugin `.zip` archive from a URL for the current session
+ * Added `CLAUDE_CODE_FORCE_SYNC_OUTPUT=1` env var to force-enable synchronized output on terminals that auto-detection misses (e.g. Emacs `eat`)
+ * Added `CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE`: when set on Homebrew or WinGet installations, Claude Code runs the upgrade command in the background and prompts to restart
+ * Plugin manifests: `themes` and `monitors` should now be declared under `"experimental": { ... }`. Top-level declarations still work but `claude plugin validate` will warn
+ * Gateway `/v1/models` discovery for the `/model` picker is now opt-in via `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` (was automatic in 2.1.126–2.1.128)
+ * Ctrl+R history picker now defaults to searching all prompts across all projects, matching pre-2.1.124 behavior. Press Ctrl+S to narrow to the current project or session
+ * Third-party deployments (Bedrock, Vertex, Foundry, or `ANTHROPIC_BASE_URL` gateway) no longer see spinner tips pointing at first-party Anthropic surfaces
+ * `skillOverrides` setting now works: `off` hides from model and `/`, `user-invocable-only` hides from model only, `name-only` collapses description
+ * The `claude_code.pull_request.count` OTel metric now counts PRs/MRs created via MCP tools, not just shell commands
+ * Policy refusal error messages now include the API Request ID for easier support debugging
+ * Fixed API errors with unrecognized 400 status codes showing raw JSON instead of the underlying error message
+ * Fixed `/clear` not resetting the terminal tab title after a conversation
+ * Fixed session title chip from `/rename` disappearing while a permission or other dialog is active
+ * Fixed agent panel below the prompt being hidden when subagents are running (regression in 2.1.122)
+ * Fixed external-editor handoff (Ctrl+G) blanking the conversation history above the prompt
+ * Fixed `/context` dumping its rendered ASCII visualization grid into the conversation, wasting ~1.6k tokens per call
+ * Fixed `/agents` Library list arrow-key navigation: the highlighted agent now stays visible when the list exceeds the viewport
+ * Fixed `/branch` success message not including the new branch’s session id for `/resume`
+ * Fixed bold headers with keycap/ZWJ/skin-tone emoji losing trailing characters in fullscreen mode
+ * Fixed server-managed settings policy not applying for enterprise/team users whose stored OAuth credentials lacked the `user:inference` scope
+ * Fixed OAuth refresh race after wake-from-sleep that could log out all running sessions
+ * Fixed 1-hour prompt cache TTL being silently downgraded to 5 minutes
+ * Fixed cache-miss warning appearing spuriously after `/clear` or compaction when changing `/effort` or `/model`
+ * Fixed `Bash(mkdir *)`, `Bash(touch *)` and similar allow rules not being honored for in-project paths
+ * Fixed `deniedMcpServers` patterns with a `*://` scheme wildcard not matching mixed-case hostnames
+ * Fixed harmless WebSocket warning being logged as an error in `--debug` during voice mode
+ * [VSCode] Fixed `/clear` not clearing the conversation context and displayed transcript
--- a/channels.md
+++ b/channels.md
@@ -4,14 +4,14 @@
>
> Use this file to discover all available pages before exploring further.
-Channels are in research preview and require Claude Code v2.1.80 or later. They require claude.ai login. Console and API key authentication is not supported. Team and Enterprise organizations must explicitly enable them.
+Channels are in research preview and require Claude Code v2.1.80 or later. They require Anthropic authentication through claude.ai or a Console API key, and are not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. Team and Enterprise organizations must explicitly enable them.
A channel is an MCP server that pushes events into your running Claude Code session, so Claude can react to things that happen while you’re not at the terminal. Channels can be two-way: Claude reads the event and replies back through the same channel, like a chat bridge. Events only arrive while the session is open, so for an always-on setup you run Claude in a background process or persistent terminal. Unlike integrations that spawn a fresh cloud session or wait to be polled, the event arrives in the session you already have open: see how channels compare. You install a channel as a plugin and configure it with your own credentials. Telegram, Discord, and iMessage are included in the research preview. When Claude replies through a channel, you see the inbound message in your terminal but not the reply text. The terminal shows the tool call and a confirmation (like “sent”), and the actual reply appears on the other platform. This page covers:
* Supported channels: Telegram, Discord, and iMessage setup
* Install and run a channel with fakechat, a localhost demo
* Who can push messages: sender allowlists and how you pair
- * Enable channels for your organization on Team and Enterprise
+ * Enable channels for your organization if you manage a Team, Enterprise, or Console org
* How channels compare to web sessions, Slack, MCP, and Remote Control
To build your own channel, see the [Channels reference](</docs/en/channels-reference>).
@@ -209,9 +209,9 @@
Fakechat is an officially supported demo channel that runs a chat UI on localhost, with nothing to authenticate and no external service to configure. Once you install and enable fakechat, you can type in the browser and the message arrives in your Claude Code session. Claude replies, and the reply shows up back in the browser. After you’ve tested the fakechat interface, try out [Telegram](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/telegram>), [Discord](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/discord>), or [iMessage](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/imessage>). To try the fakechat demo, you’ll need:
- * Claude Code [installed and authenticated](</docs/en/quickstart#step-1-install-claude-code>) with a claude.ai account
+ * Claude Code [installed and authenticated](</docs/en/quickstart#step-1-install-claude-code>) with a claude.ai account or a Claude Console API key
* [Bun](<https://bun.sh>) installed. The pre-built channel plugins are Bun scripts. Check with `bun --version`; if that fails, [install Bun](<https://bun.sh/docs/installation>).
- * **Team/Enterprise users** : your organization admin must enable channels in managed settings
+ * **Team, Enterprise, or managed Console org** : your admin must enable channels in managed settings
1
@@ -260,7 +260,7 @@
3. In your Claude Code session, approve the code when prompted
4. Your sender ID is added to the allowlist
-iMessage works differently: texting yourself bypasses the gate automatically, and you add other contacts by handle with `/imessage:access allow`. On top of that, you control which servers are enabled each session with `--channels`, and on Team and Enterprise plans your organization controls availability with `channelsEnabled`. Being in `.mcp.json` isn’t enough to push messages: a server also has to be named in `--channels`. The allowlist also gates [permission relay](</docs/en/channels-reference#relay-permission-prompts>) if the channel declares it. Anyone who can reply through the channel can approve or deny tool use in your session, so only allowlist senders you trust with that authority.
+iMessage works differently: texting yourself bypasses the gate automatically, and you add other contacts by handle with `/imessage:access allow`. On top of that, you control which servers are enabled each session with `--channels`, and your organization controls availability with `channelsEnabled` on claude.ai Team and Enterprise plans and on Console organizations that deploy managed settings. Being in `.mcp.json` isn’t enough to push messages: a server also has to be named in `--channels`. The allowlist also gates [permission relay](</docs/en/channels-reference#relay-permission-prompts>) if the channel declares it. Anyone who can reply through the channel can approve or deny tool use in your session, so only allowlist senders you trust with that authority.
##
@@ -268,11 +268,16 @@
Enterprise controls
-On Team and Enterprise plans, channels are off by default. Admins control availability through two [managed settings](</docs/en/settings>) that users cannot override:
+Admins control availability through two [managed settings](</docs/en/settings>) that users cannot override. The default depends on how you authenticate:
+
+ * **claude.ai Team and Enterprise** : channels are blocked until an admin enables them.
+ * **Anthropic Console with API key authentication** : channels are permitted by default. You only need this setting if your organization deploys managed settings.
+
+In all cases, no channel runs until a user opts it in for the session with `--channels`.
Setting| Purpose| When not configured
---|---|---
-`channelsEnabled`| Master switch. Must be `true` for any channel to deliver messages. Set via the [claude.ai Admin console](<https://claude.ai/admin-settings/claude-code>) toggle or directly in managed settings. Blocks all channels including the development flag when off.| Channels blocked
+`channelsEnabled`| Master switch. Must be `true` for any channel to deliver messages. Set via the [claude.ai Admin console](<https://claude.ai/admin-settings/claude-code>) toggle or directly in managed settings. Blocks all channels including the development flag when off.| claude.ai Team and Enterprise: channels blocked. Console: channels allowed unless your organization deploys managed settings, in which case channels are blocked until this key is set
`allowedChannelPlugins`| Which plugins can register once channels are enabled. Replaces the Anthropic-maintained list when set. Only applies when `channelsEnabled` is `true`.| Anthropic default list applies
Pro and Max users without an organization skip these checks entirely: channels are available and users opt in per session with `--channels`.
--- a/channels-reference.md
+++ b/channels-reference.md
@@ -4,7 +4,7 @@
>
> Use this file to discover all available pages before exploring further.
-Channels are in [research preview](</docs/en/channels#research-preview>) and require Claude Code v2.1.80 or later. They require claude.ai login. Console and API key authentication is not supported. Team and Enterprise organizations must [explicitly enable them](</docs/en/channels#enterprise-controls>).
+Channels are in [research preview](</docs/en/channels#research-preview>) and require Claude Code v2.1.80 or later. Team and Enterprise organizations must [explicitly enable them](</docs/en/channels#enterprise-controls>).
A channel is an MCP server that pushes events into a Claude Code session so Claude can react to things happening outside the terminal. You can build a one-way or two-way channel. One-way channels forward alerts, webhooks, or monitoring events for Claude to act on. Two-way channels like chat bridges also expose a reply tool so Claude can send messages back. A channel with a trusted sender path can also opt in to relay permission prompts so you can approve or deny tool use remotely. This page covers:
@@ -136,7 +136,7 @@
claude --dangerously-load-development-channels server:webhook
-When Claude Code starts, it reads your MCP config, spawns your `webhook.ts` as a subprocess, and the HTTP listener starts automatically on the port you configured (8788 in this example). You don’t need to run the server yourself.If you see “blocked by org policy,” your Team or Enterprise admin needs to [enable channels](</docs/en/channels#enterprise-controls>) first.In a separate terminal, simulate a webhook by sending an HTTP POST with a message to your server. This example sends a CI failure alert to port 8788 (or whichever port you configured):
+When Claude Code starts, it reads your MCP config, spawns your `webhook.ts` as a subprocess, and the HTTP listener starts automatically on the port you configured (8788 in this example). You don’t need to run the server yourself.If you see “blocked by org policy,” your organization admin needs to [enable channels](</docs/en/channels#enterprise-controls>) first.In a separate terminal, simulate a webhook by sending an HTTP POST with a message to your server. This example sends a CI failure alert to port 8788 (or whichever port you configured):
curl -X POST localhost:8788 -d "build failed on main: https://ci.example.com/run/1234"
--- a/claude-code-features.md
+++ b/claude-code-features.md
@@ -12,7 +12,7 @@
Control filesystem settings with settingSources
-The setting sources option ([`setting_sources`](</docs/en/agent-sdk/python#claude-agent-options>) in Python, [`settingSources`](</docs/en/agent-sdk/typescript#setting-source>) in TypeScript) controls which filesystem-based settings the SDK loads. Pass an explicit list to opt in to specific sources, or pass an empty array to disable user, project, and local settings. This example loads both user-level and project-level settings by setting `settingSources` to `["user", "project"]`:
+The setting sources option ([`setting_sources`](</docs/en/agent-sdk/python#claudeagentoptions>) in Python, [`settingSources`](</docs/en/agent-sdk/typescript#settingsource>) in TypeScript) controls which filesystem-based settings the SDK loads. Pass an explicit list to opt in to specific sources, or pass an empty array to disable user, project, and local settings. This example loads both user-level and project-level settings by setting `settingSources` to `["user", "project"]`:
Python
@@ -37,7 +37,7 @@
if isinstance(message, ResultMessage) and message.subtype == "success":
print(f"\nResult: {message.result}")
-Each source loads settings from a specific location, where `<cwd>` is the working directory you pass via the `cwd` option (or the process’s current directory if unset). For the full type definition, see [`SettingSource`](</docs/en/agent-sdk/typescript#setting-source>) (TypeScript) or [`SettingSource`](</docs/en/agent-sdk/python#setting-source>) (Python).
+Each source loads settings from a specific location, where `<cwd>` is the working directory you pass via the `cwd` option, or the process’s current directory if unset. For the full type definition, see [`SettingSource`](</docs/en/agent-sdk/typescript#settingsource>) (TypeScript) or [`SettingSource`](</docs/en/agent-sdk/python#settingsource>) (Python).
Source| What it loads| Location
---|---|---
--- a/claude-code-on-the-web.md
+++ b/claude-code-on-the-web.md
@@ -185,7 +185,7 @@
#!/bin/bash
apt update && apt install -y gh
-If the script exits non-zero, the session fails to start. Append `|| true` to non-critical commands to avoid blocking the session on an intermittent install failure.
+If the script exits non-zero, the session fails to start. Append `|| true` to non-critical commands to avoid blocking the session on an intermittent install failure. Keep the script’s total runtime under roughly five minutes so the environment cache can build. Run independent installs in parallel with `&` and `wait`. If a single download won’t fit in the five-minute limit, move it to a SessionStart hook that launches it in the background.
Setup scripts that install packages need network access to reach registries. The default **Trusted** network access allows connections to common package registries including npm, PyPI, RubyGems, and crates.io. Scripts will fail to install packages if your environment uses **None** network access.
--- a/cli-reference.md
+++ b/cli-reference.md
@@ -91,7 +91,7 @@
`--output-format`| Specify output format for print mode (options: `text`, `json`, `stream-json`)| `claude -p "query" --output-format json`
`--permission-mode`| Begin in a specified [permission mode](</docs/en/permission-modes>). Accepts `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, or `bypassPermissions`. Overrides `defaultMode` from settings files| `claude --permission-mode plan`
`--permission-prompt-tool`| Specify an MCP tool to handle permission prompts in non-interactive mode| `claude -p --permission-prompt-tool mcp_auth_tool "query"`
-`--plugin-dir`| Load plugins from a directory for this session only. Each flag takes one path. Repeat the flag for multiple directories: `--plugin-dir A --plugin-dir B`| `claude --plugin-dir ./my-plugins`
+`--plugin-dir`| Load a plugin from a directory or `.zip` archive for this session only. Each flag takes one path. Repeat the flag for multiple plugins: `--plugin-dir A --plugin-dir B.zip`| `claude --plugin-dir ./my-plugin`
`--print`, `-p`| Print response without interactive mode (see [Agent SDK documentation](</docs/en/agent-sdk/overview>) for programmatic usage details)| `claude -p "query"`
`--remote`| Create a new [web session](</docs/en/claude-code-on-the-web>) on claude.ai with the provided task description| `claude --remote "Fix the login bug"`
`--remote-control`, `--rc`| Start an interactive session with [Remote Control](</docs/en/remote-control#start-a-remote-control-session>) enabled so you can also control it from claude.ai or the Claude app. Optionally pass a name for the session| `claude --remote-control "My Project"`
--- a/commands.md
+++ b/commands.md
@@ -17,7 +17,7 @@
`/chrome`| Configure [Claude in Chrome](</docs/en/chrome>) settings
`/claude-api [migrate|managed-agents-onboard]`| **[Skill](</docs/en/skills#bundled-skills>).** Load Claude API reference material for your project’s language (Python, TypeScript, Java, Go, Ruby, C#, PHP, or cURL) and Managed Agents reference. Covers tool use, streaming, batches, structured outputs, and common pitfalls. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk`. Run `/claude-api migrate` to upgrade existing Claude API code to a newer model: Claude asks which files to scan and which model to target, then updates model IDs, thinking configuration, and other parameters that changed between versions. Run `/claude-api managed-agents-onboard` for an interactive walkthrough that creates a new Managed Agent from scratch
`/clear`| Start a new conversation with empty context. The previous conversation stays available in `/resume`. To free up context while continuing the same conversation, use `/compact` instead. Aliases: `/reset`, `/new`
-`/color [color|default]`| Set the prompt bar color for the current session. Available colors: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan`. Use `default` to reset. When [Remote Control](</docs/en/remote-control>) is connected, the color syncs to claude.ai/code
+`/color [color|default]`| Set the prompt bar color for the current session. Available colors: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan`. Use `default` to reset, or run with no argument to pick a random color. When [Remote Control](</docs/en/remote-control>) is connected, the color syncs to claude.ai/code
`/compact [instructions]`| Free up context by summarizing the conversation so far. Optionally pass focus instructions for the summary. See [how compaction handles rules, skills, and memory files](</docs/en/context-window#what-survives-compaction>)
`/config`| Open the [Settings](</docs/en/settings>) interface to adjust theme, model, [output style](</docs/en/output-styles>), and other preferences. Alias: `/settings`
`/context`| Visualize current context usage as a colored grid. Shows optimization suggestions for context-heavy tools, memory bloat, and capacity warnings
@@ -34,7 +34,7 @@
`/fast [on|off]`| Toggle [fast mode](</docs/en/fast-mode>) on or off
`/feedback [report]`| Submit feedback about Claude Code. Alias: `/bug`
`/fewer-permission-prompts`| **[Skill](</docs/en/skills#bundled-skills>).** Scan your transcripts for common read-only Bash and MCP tool calls, then add a prioritized allowlist to project `.claude/settings.json` to reduce permission prompts
-`/focus`| Toggle the focus view, which shows only your last prompt, a one-line tool-call summary with edit diffstats, and the final response. The selection persists across sessions. Only available in [fullscreen rendering](</docs/en/fullscreen>)
+`/focus`| Toggle the focus view, which shows only your last prompt, a one-line tool-call summary with edit diffstats, and the final response. The selection persists across sessions; set [`viewMode`](</docs/en/settings#available-settings>) in settings to override it. Only available in [fullscreen rendering](</docs/en/fullscreen>)
`/heapdump`| Write a JavaScript heap snapshot and a memory breakdown to `~/Desktop`, or your home directory on Linux without a Desktop folder, for diagnosing high memory usage. See [troubleshooting](</docs/en/troubleshooting#high-cpu-or-memory-usage>)
`/help`| Show help and available commands
`/hooks`| View [hook](</docs/en/hooks>) configurations for tool events
@@ -79,7 +79,7 @@
`/statusline`| Configure Claude Code’s [status line](</docs/en/statusline>). Describe what you want, or run without arguments to auto-configure from your shell prompt
`/stickers`| Order Claude Code stickers
`/tasks`| List and manage background tasks. Also available as `/bashes`
-`/team-onboarding`| Generate a team onboarding guide from your Claude Code usage history. Claude analyzes your sessions, commands, and MCP server usage from the past 30 days and produces a markdown guide a teammate can paste as a first message to get set up quickly
+`/team-onboarding`| Generate a team onboarding guide from your Claude Code usage history. Claude analyzes your sessions, commands, and MCP server usage from the past 30 days and produces a markdown guide a teammate can paste as a first message to get set up quickly. For claude.ai subscribers on Pro, Max, Team, and Enterprise plans, also returns a share link teammates can open directly in Claude Code
`/teleport`| Pull a [Claude Code on the web](</docs/en/claude-code-on-the-web#from-web-to-terminal>) session into this terminal: opens a picker, then fetches the branch and conversation. Also available as `/tp`. Requires a claude.ai subscription
`/terminal-setup`| Configure terminal keybindings for Shift+Enter and other shortcuts. Only visible in terminals that need it, like VS Code, Cursor, Windsurf, Alacritty, or Zed
`/theme`| Change the color theme. Includes an `auto` option that matches your terminal’s light or dark background, light and dark variants, colorblind-accessible (daltonized) themes, ANSI themes that use your terminal’s color palette, and any [custom themes](</docs/en/terminal-config#create-a-custom-theme>) from `~/.claude/themes/` or plugins. Select **New custom theme…** to create one
--- a/cost-tracking.md
+++ b/cost-tracking.md
@@ -27,7 +27,7 @@
Both SDKs use the same underlying cost model and expose the same granularity. The difference is in field naming and where per-step usage is nested. Cost tracking depends on understanding how the SDK scopes usage data:
- * **`query()` call:** one invocation of the SDK’s `query()` function. A single call can involve multiple steps (Claude responds, uses tools, gets results, responds again). Each call produces one [`result`](</docs/en/agent-sdk/typescript#sdk-result-message>) message at the end.
+ * **`query()` call:** one invocation of the SDK’s `query()` function. A single call can involve multiple steps (Claude responds, uses tools, gets results, responds again). Each call produces one [`result`](</docs/en/agent-sdk/typescript#sdkresultmessage>) message at the end.
* **Step:** a single request/response cycle within a `query()` call. Each step produces assistant messages with token usage.
* **Session:** a series of `query()` calls linked by a session ID (using the `resume` option). Each `query()` call within a session reports its own cost independently.
@@ -43,7 +43,7 @@
The result message provides the cumulative estimate
-When the `query()` call completes, the SDK emits a result message with `total_cost_usd` and cumulative `usage`. This is available in both TypeScript ([`SDKResultMessage`](</docs/en/agent-sdk/typescript#sdk-result-message>)) and Python ([`ResultMessage`](</docs/en/agent-sdk/python#result-message>)). If you make multiple `query()` calls (for example, in a multi-turn session), each result only reflects the cost of that individual call. If you only need the estimated total, you can ignore the per-step usage and read this single value.
+When the `query()` call completes, the SDK emits a result message with `total_cost_usd` and cumulative `usage`. This is available in both TypeScript ([`SDKResultMessage`](</docs/en/agent-sdk/typescript#sdkresultmessage>)) and Python ([`ResultMessage`](</docs/en/agent-sdk/python#resultmessage>)). If you make multiple `query()` calls (for example, in a multi-turn session), each result only reflects the cost of that individual call. If you only need the estimated total, you can ignore the per-step usage and read this single value.
##
@@ -51,7 +51,7 @@
Get the total cost of a query
-The result message ([TypeScript](</docs/en/agent-sdk/typescript#sdk-result-message>), [Python](</docs/en/agent-sdk/python#result-message>)) marks the end of the agent loop for a `query()` call. It includes `total_cost_usd`, the cumulative estimated cost across all steps in that call. This works for both success and error results. If you use sessions to make multiple `query()` calls, each result only reflects the cost of that individual call. The following examples iterate over the message stream from a `query()` call and print the total cost when the `result` message arrives:
+The result message ([TypeScript](</docs/en/agent-sdk/typescript#sdkresultmessage>), [Python](</docs/en/agent-sdk/python#resultmessage>)) marks the end of the agent loop for a `query()` call. It includes `total_cost_usd`, the cumulative estimated cost across all steps in that call. This works for both success and error results. If you use sessions to make multiple `query()` calls, each result only reflects the cost of that individual call. The following examples iterate over the message stream from a `query()` call and print the total cost when the `result` message arrives:
TypeScript
@@ -71,7 +71,7 @@
Track per-step and per-model usage
-The examples in this section use TypeScript field names. In Python, the equivalent fields are [`AssistantMessage.usage`](</docs/en/agent-sdk/python#assistant-message>) and `AssistantMessage.message_id` for per-step usage, and [`ResultMessage.model_usage`](</docs/en/agent-sdk/python#result-message>) for per-model breakdowns.
+The examples in this section use TypeScript field names. In Python, the equivalent fields are [`AssistantMessage.usage`](</docs/en/agent-sdk/python#assistantmessage>) and `AssistantMessage.message_id` for per-step usage, and [`ResultMessage.model_usage`](</docs/en/agent-sdk/python#resultmessage>) for per-model breakdowns.
###
@@ -114,7 +114,7 @@
Break down usage per model
-The result message includes [`modelUsage`](</docs/en/agent-sdk/typescript#model-usage>), a map of model name to per-model token counts and cost. This is useful when you run multiple models (for example, Haiku for subagents and Opus for the main agent) and want to see where tokens are going. The following example runs a query and prints the cost and token breakdown for each model used:
+The result message includes [`modelUsage`](</docs/en/agent-sdk/typescript#modelusage>), a map of model name to per-model token counts and cost. This is useful when you run multiple models (for example, Haiku for subagents and Opus for the main agent) and want to see where tokens are going. The following example runs a query and prints the cost and token breakdown for each model used:
import { query } from "@anthropic-ai/claude-agent-sdk";
@@ -202,7 +202,7 @@
* `cache_creation_input_tokens`: tokens used to create new cache entries (charged at a higher rate than standard input tokens).
* `cache_read_input_tokens`: tokens read from existing cache entries (charged at a reduced rate).
-Track these separately from `input_tokens` to understand caching savings. In TypeScript, these fields are typed on the [`Usage`](</docs/en/agent-sdk/typescript#usage>) object. In Python, they appear as keys in the [`ResultMessage.usage`](</docs/en/agent-sdk/python#result-message>) dict (for example, `message.usage.get("cache_read_input_tokens", 0)`).
+Track these separately from `input_tokens` to understand caching savings. In TypeScript, these fields are typed on the [`Usage`](</docs/en/agent-sdk/typescript#usage>) object. In Python, they appear as keys in the [`ResultMessage.usage`](</docs/en/agent-sdk/python#resultmessage>) dict (for example, `message.usage.get("cache_read_input_tokens", 0)`).
###
--- a/custom-tools.md
+++ b/custom-tools.md
@@ -38,7 +38,7 @@
* `content` (required): an array of result blocks, each with a `type` of `"text"`, `"image"`, or `"resource"`. See Return images and resources for non-text blocks.
* `isError` (optional): set to `true` to signal a tool failure so Claude can react to it. See Handle errors.
-After defining a tool, wrap it in a server with [`createSdkMcpServer`](</docs/en/agent-sdk/typescript#create-sdk-mcp-server>) (TypeScript) or [`create_sdk_mcp_server`](</docs/en/agent-sdk/python#create-sdk-mcp-server>) (Python). The server runs in-process inside your application, not as a separate process.
+After defining a tool, wrap it in a server with [`createSdkMcpServer`](</docs/en/agent-sdk/typescript#createsdkmcpserver>) (TypeScript) or [`create_sdk_mcp_server`](</docs/en/agent-sdk/python#create_sdk_mcp_server>) (Python). The server runs in-process inside your application, not as a separate process.
###
@@ -214,7 +214,7 @@
async def get_temperature(args):
return {"content": [{"type": "text", "text": "..."}]}
-See `ToolAnnotations` in the [TypeScript](</docs/en/agent-sdk/typescript#tool-annotations>) or [Python](</docs/en/agent-sdk/python#tool-annotations>) reference.
+See `ToolAnnotations` in the [TypeScript](</docs/en/agent-sdk/typescript#toolannotations>) or [Python](</docs/en/agent-sdk/python#toolannotations>) reference.
##
--- a/data-usage.md
+++ b/data-usage.md
@@ -114,7 +114,7 @@
Telemetry services
-Claude Code connects from users’ machines to the Statsig service to log operational metrics such as latency, reliability, and usage patterns. This logging does not include any code or file paths. Data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the [Statsig security documentation](<https://www.statsig.com/trust/security>). To opt out of Statsig telemetry, set the `DISABLE_TELEMETRY` environment variable. Claude Code connects from users’ machines to Sentry for operational error logging. The data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the [Sentry security documentation](<https://sentry.io/security/>). To opt out of error logging, set the `DISABLE_ERROR_REPORTING` environment variable. When users run the `/feedback` command, a copy of their full conversation history including code is sent to Anthropic. The data is encrypted in transit via TLS. Optionally, a GitHub issue is created in the public repository. To opt out, set the `DISABLE_FEEDBACK_COMMAND` environment variable to `1`.
+Claude Code connects from users’ machines to Anthropic to log operational metrics such as latency, reliability, and usage patterns. This logging does not include any code or file paths. Data is encrypted in transit and at rest. To opt out of telemetry, set the `DISABLE_TELEMETRY` environment variable. Claude Code connects from users’ machines to Sentry for operational error logging. The data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the [Sentry security documentation](<https://sentry.io/security/>). To opt out of error logging, set the `DISABLE_ERROR_REPORTING` environment variable. When users run the `/feedback` command, a copy of their full conversation history including code is sent to Anthropic. The data is encrypted in transit via TLS. Optionally, a GitHub issue is created in the public repository. To opt out, set the `DISABLE_FEEDBACK_COMMAND` environment variable to `1`.
##
@@ -126,7 +126,7 @@
Service| Claude API| Vertex API| Bedrock API| Foundry API
---|---|---|---|---
-**Statsig (Metrics)**| Default on.
+**Anthropic (Metrics)**| Default on.
`DISABLE_TELEMETRY=1` to disable.| Default off.
`CLAUDE_CODE_USE_VERTEX` must be 1.| Default off.
`CLAUDE_CODE_USE_BEDROCK` must be 1.| Default off.
@@ -152,7 +152,7 @@
`skipWebFetchPreflight: true` in [settings](</docs/en/settings>) to disable.| Default on.
`skipWebFetchPreflight: true` in [settings](</docs/en/settings>) to disable.
-All environment variables can be checked into `settings.json` (see [settings reference](</docs/en/settings>)). As of v2.1.126, when a host platform sets `CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`, Statsig metrics default to on for Vertex, Bedrock, and Foundry, and follow the standard `DISABLE_TELEMETRY` opt-out. Sentry error reporting and `/feedback` reports remain off by default on those providers.
+All environment variables can be checked into `settings.json` (see [settings reference](</docs/en/settings>)). As of v2.1.126, when a host platform sets `CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`, metrics default to on for Vertex, Bedrock, and Foundry, and follow the standard `DISABLE_TELEMETRY` opt-out. Sentry error reporting and `/feedback` reports remain off by default on those providers.
###
--- a/desktop.md
+++ b/desktop.md
@@ -328,7 +328,7 @@
Work in parallel with sessions
-Click **\+ New session** in the sidebar, or press **Cmd+N** on macOS or **Ctrl+N** on Windows, to work on multiple tasks in parallel. Press **Ctrl+Tab** and **Ctrl+Shift+Tab** to cycle through sessions in the sidebar. For Git repositories, each session gets its own isolated copy of your project using [Git worktrees](</docs/en/worktrees>), so changes in one session don’t affect other sessions until you commit them. Worktrees are stored in `<project-root>/.claude/worktrees/` by default. You can change this to a custom directory in Settings → Claude Code under “Worktree location”. You can also set a branch prefix that gets prepended to every worktree branch name, which is useful for keeping Claude-created branches organized. To remove a worktree when you’re done, hover over the session in the sidebar and click the archive icon. To have sessions archive themselves when their pull request merges or closes, turn on **Auto-archive after PR merge or close** in Settings → Claude Code. Auto-archive only applies to local sessions that have finished running. To include gitignored files like `.env` in new worktrees, create a [`.worktreeinclude` file](</docs/en/worktrees#copy-gitignored-files-into-worktrees>) in your project root.
+Click **\+ New session** in the sidebar, or press **Cmd+N** on macOS or **Ctrl+N** on Windows, to work on multiple tasks in parallel. Press **Ctrl+Tab** and **Ctrl+Shift+Tab** to cycle through sessions in the sidebar. For Git repositories, each session gets its own isolated copy of your project using [Git worktrees](</docs/en/worktrees>), so changes in one session don’t affect other sessions until you commit them. To view two sessions at once, hold **Cmd** on macOS or **Ctrl** on Windows and click a session in the sidebar. The session opens in a second pane alongside the one you already have open. While the split is active, clicking another sidebar session replaces whichever pane has focus. Press **Cmd+\** on macOS or **Ctrl+\** on Windows to close the focused pane and return to a single session. Worktrees are stored in `<project-root>/.claude/worktrees/` by default. You can change this to a custom directory in Settings → Claude Code under “Worktree location”. You can also set a branch prefix that gets prepended to every worktree branch name, which is useful for keeping Claude-created branches organized. To remove a worktree when you’re done, hover over the session in the sidebar and click the archive icon. To have sessions archive themselves when their pull request merges or closes, turn on **Auto-archive after PR merge or close** in Settings → Claude Code. Auto-archive only applies to local sessions that have finished running. To include gitignored files like `.env` in new worktrees, create a [`.worktreeinclude` file](</docs/en/worktrees#copy-gitignored-files-into-worktrees>) in your project root.
Session isolation requires [Git](<https://git-scm.com/downloads>). Most Macs include Git by default. Run `git --version` in Terminal to check. On Windows, Git is required for the Code tab to work: [download Git for Windows](<https://git-scm.com/downloads/win>), install it, and restart the app. If you run into Git errors, ask Claude in the [Cowork tab](<https://claude.com/product/cowork>) to help troubleshoot your setup.
--- a/env-vars.md
+++ b/env-vars.md
@@ -58,7 +58,7 @@
`CLAUDE_CODE_ATTRIBUTION_HEADER`| Set to `0` to omit the attribution block (client version and prompt fingerprint) from the start of the system prompt. Disabling it improves prompt-cache hit rates when routing through an [LLM gateway](</docs/en/llm-gateway>). Anthropic API caching is unaffected
`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
-`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`. The native binary distribution is required for system store integration. On the Node.js runtime, only the bundled set is used regardless of this value
+`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_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)
@@ -179,7 +179,7 @@
`DISABLE_PROMPT_CACHING_HAIKU`| Set to `1` to disable prompt caching for Haiku models
`DISABLE_PROMPT_CACHING_OPUS`| Set to `1` to disable prompt caching for Opus models
`DISABLE_PROMPT_CACHING_SONNET`| Set to `1` to disable prompt caching for Sonnet models
-`DISABLE_TELEMETRY`| Set to `1` to opt out of Statsig telemetry (note that Statsig events do not include user data like code, file paths, or bash commands)
+`DISABLE_TELEMETRY`| Set to `1` to opt out of telemetry. Telemetry events do not include user data like code, file paths, or bash commands
`DISABLE_UPDATES`| Set to `1` to block all updates including manual `claude update` and `claude install`. Stricter than `DISABLE_AUTOUPDATER`. Use when distributing Claude Code through your own channels and users should not self-update
`DISABLE_UPGRADE_COMMAND`| Set to `1` to hide the `/upgrade` command
`ENABLE_CLAUDEAI_MCP_SERVERS`| Set to `false` to disable [claude.ai MCP servers](</docs/en/mcp#use-mcp-servers-from-claude-ai>) in Claude Code. Enabled by default for logged-in users
@@ -196,7 +196,7 @@
`MAX_STRUCTURED_OUTPUT_RETRIES`| Number of times to retry when the model’s response fails validation against the [`--json-schema`](</docs/en/cli-reference#cli-flags>) in non-interactive mode (the `-p` flag). Defaults to 5
`MAX_THINKING_TOKENS`| Override the [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>) token budget. The ceiling is the model’s [max output tokens](<https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison>) minus one. Set to `0` to disable thinking entirely. On models with [adaptive reasoning](</docs/en/model-config#adjust-effort-level>), the budget is ignored unless adaptive reasoning is disabled via `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING`
`MCP_CLIENT_SECRET`| OAuth client secret for MCP servers that require [pre-configured credentials](</docs/en/mcp#use-pre-configured-oauth-credentials>). Avoids the interactive prompt when adding a server with `--client-secret`
-`MCP_CONNECTION_NONBLOCKING`| Set to `true` in non-interactive mode (`-p`) to skip the MCP connection wait entirely. Useful for scripted pipelines where MCP tools are not needed. Without this variable, the first query waits up to 5 seconds for `--mcp-config` server connections
+`MCP_CONNECTION_NONBLOCKING`| Set to `true` in non-interactive mode (`-p`) to skip the MCP connection wait entirely. Useful for scripted pipelines where MCP tools are not needed. Without this variable, the first query waits up to 5 seconds for `--mcp-config` server connections. Servers configured with [`alwaysLoad: true`](</docs/en/mcp#exempt-a-server-from-deferral>) always block startup regardless of this variable, since their tools must be present when the first prompt is built
`MCP_OAUTH_CALLBACK_PORT`| Fixed port for the OAuth redirect callback, as an alternative to `--callback-port` when adding an MCP server with [pre-configured credentials](</docs/en/mcp#use-pre-configured-oauth-credentials>)
`MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE`| Maximum number of remote MCP servers (HTTP/SSE) to connect in parallel during startup (default: 20)
`MCP_SERVER_CONNECTION_BATCH_SIZE`| Maximum number of local MCP servers (stdio) to connect in parallel during startup (default: 3)
--- a/errors.md
+++ b/errors.md
@@ -335,7 +335,7 @@
* Ensure your firewall allows the hosts listed in [Network access requirements](</docs/en/network-config#network-access-requirements>)
* Intermittent failures are retried automatically; persistent failures point to a local network issue
-If `curl` succeeds but Claude Code still fails, the cause is usually something between Node.js and the network rather than the network itself:
+If `curl` succeeds but Claude Code still fails, the cause is usually something between the runtime and the network rather than the network itself:
* On Linux and WSL, check `/etc/resolv.conf` for an unreachable nameserver. WSL in particular can inherit a broken resolver from the host.
* On macOS, a VPN client that was disconnected or uninstalled can leave a tunnel interface or routing rule behind. Check `ifconfig` for stale `utun` interfaces and remove the VPN’s network extension in System Settings.
@@ -347,14 +347,14 @@
SSL certificate errors
-A proxy or security appliance on your network is intercepting TLS traffic with its own certificate, and Node.js does not trust it.
+A proxy or security appliance on your network is intercepting TLS traffic with its own certificate, and Claude Code does not trust it.
Unable to connect to API: SSL certificate verification failed. Check your proxy or corporate SSL certificates
Unable to connect to API: Self-signed certificate detected
**What to do:**
- * Export your organization’s CA bundle and point Node at it with `NODE_EXTRA_CA_CERTS=/path/to/ca-bundle.pem`
+ * Export your organization’s CA bundle and point Claude Code at it with `NODE_EXTRA_CA_CERTS=/path/to/ca-bundle.pem`
* See [Network configuration](</docs/en/network-config#custom-ca-certificates>) for full setup instructions
* Do not set `NODE_TLS_REJECT_UNAUTHORIZED=0`, which disables certificate validation entirely
--- a/fullscreen.md
+++ b/fullscreen.md
@@ -130,11 +130,11 @@
Use with tmux
-Fullscreen rendering works inside tmux, with two caveats. Mouse wheel scrolling requires tmux’s mouse mode. If your `~/.tmux.conf` does not already enable it, add this line and reload your config:
+Fullscreen rendering works inside tmux, with three caveats. Mouse wheel scrolling requires tmux’s mouse mode. If your `~/.tmux.conf` does not already enable it, add this line and reload your config:
set -g mouse on
-Without mouse mode, wheel events go to tmux instead of Claude Code. Keyboard scrolling with `PgUp` and `PgDn` works either way. Claude Code prints a one-time hint at startup if it detects tmux with mouse mode off. Fullscreen rendering is incompatible with iTerm2’s tmux integration mode, which is the mode you enter with `tmux -CC`. In integration mode, iTerm2 renders each tmux pane as a native split rather than letting tmux draw to the terminal. The alternate screen buffer and mouse tracking do not work correctly there: the mouse wheel does nothing, and double-click can corrupt the terminal state. Don’t enable fullscreen rendering in `tmux -CC` sessions. Regular tmux inside iTerm2, without `-CC`, works fine.
+Without mouse mode, wheel events go to tmux instead of Claude Code. Keyboard scrolling with `PgUp` and `PgDn` works either way. Claude Code prints a one-time hint at startup if it detects tmux with mouse mode off. Fullscreen rendering is incompatible with iTerm2’s tmux integration mode, which is the mode you enter with `tmux -CC`. In integration mode, iTerm2 renders each tmux pane as a native split rather than letting tmux draw to the terminal. The alternate screen buffer and mouse tracking do not work correctly there: the mouse wheel does nothing, and double-click can corrupt the terminal state. Don’t enable fullscreen rendering in `tmux -CC` sessions. Regular tmux inside iTerm2, without `-CC`, works fine. tmux does not support synchronized output, so you may see more flicker during redraws than when running Claude Code directly in your terminal. If the flicker is noticeable, especially over SSH, run Claude Code in its own terminal tab outside tmux.
##
--- a/headless.md
+++ b/headless.md
@@ -73,6 +73,8 @@
cat build-error.txt | claude -p 'concisely explain the root cause of this build error' > output.txt
With `--output-format json`, the response payload includes `total_cost_usd` and a per-model cost breakdown, so scripted callers can track spend per invocation without consulting the [usage dashboard](</docs/en/costs>).
+
+As of Claude Code v2.1.128, piped stdin is capped at 10MB. If you exceed the cap, Claude Code exits with a clear error and a non-zero status. To work with larger inputs, write the content to a file and reference the file path in your prompt instead of piping it.
###
@@ -155,7 +157,7 @@
Field| Type| Description
---|---|---
`plugins`| array| plugins that loaded successfully, each with `name` and `path`
-`plugin_errors`| array| plugin load-time errors such as an unsatisfied dependency version, each with `plugin`, `type`, and `message`. Affected plugins are demoted and absent from `plugins`. The key is omitted when there are no errors
+`plugin_errors`| array| plugin load-time errors, each with `plugin`, `type`, and `message`. Includes unsatisfied dependency versions and `--plugin-dir` load failures such as a missing path or invalid archive. Affected plugins are demoted and absent from `plugins`. The key is omitted when there are no errors
When [`CLAUDE_CODE_SYNC_PLUGIN_INSTALL`](</docs/en/env-vars>) is set, Claude Code emits `system/plugin_install` events while marketplace plugins install before the first turn. Use these to surface install progress in your own UI.
--- a/hooks.md
+++ b/hooks.md
@@ -1385,7 +1385,7 @@
Field| Description
---|---
-`decision`| `"block"` prompts Claude with the `reason`. Omit to allow the action to proceed
+`decision`| `"block"` adds the `reason` next to the tool result. Claude still sees the original output; to replace it, use `updatedToolOutput`
`reason`| Explanation shown to Claude when `decision` is `"block"`
`additionalContext`| String added to Claude’s context alongside the tool result. See Add context for Claude
`updatedToolOutput`| Replaces the tool’s output with the provided value before it is sent to Claude. The value must match the tool’s output shape
@@ -2533,8 +2533,8 @@
Field| Description
---|---
-`ok`| `true` allows the action, `false` blocks it
-`reason`| Required when `ok` is `false`. Explanation for the block
+`ok`| `true` to allow, `false` to block. See the per-event behavior below
+`reason`| Required when `ok` is `false`. Explanation for the decision
What happens on `ok: false` depends on the event:
--- a/hosting.md
+++ b/hosting.md
@@ -20,7 +20,7 @@
Container-Based Sandboxing
-For security and isolation, the SDK should run inside a sandboxed container environment. This provides process isolation, resource limits, network control, and ephemeral filesystems. The SDK also supports [programmatic sandbox configuration](</docs/en/agent-sdk/typescript#sandbox-settings>) for command execution.
+For security and isolation, the SDK should run inside a sandboxed container environment. This provides process isolation, resource limits, network control, and ephemeral filesystems. The SDK also supports [programmatic sandbox configuration](</docs/en/agent-sdk/typescript#sandboxsettings>) for command execution.
###
@@ -182,7 +182,7 @@
Next Steps
* [Secure Deployment](</docs/en/agent-sdk/secure-deployment>) \- Network controls, credential management, and isolation hardening
- * [TypeScript SDK - Sandbox Settings](</docs/en/agent-sdk/typescript#sandbox-settings>) \- Configure sandbox programmatically
+ * [TypeScript SDK - Sandbox Settings](</docs/en/agent-sdk/typescript#sandboxsettings>) \- Configure sandbox programmatically
* [Sessions Guide](</docs/en/agent-sdk/sessions>) \- Learn about session management
* [Permissions](</docs/en/agent-sdk/permissions>) \- Configure tool permissions
* [Cost Tracking](</docs/en/agent-sdk/cost-tracking>) \- Monitor API usage
--- a/interactive-mode.md
+++ b/interactive-mode.md
@@ -168,6 +168,7 @@
Command| Action
---|---
`h`/`j`/`k`/`l`| Move left/down/up/right
+`Space`| Move right
`w`| Next word
`e`| End of word
`b`| Previous word
--- a/mcp.md
+++ b/mcp.md
@@ -118,6 +118,8 @@
# (within Claude Code) Check server status
/mcp
+
+The `/mcp` panel shows the tool count next to each connected server and flags servers that advertise the tools capability but expose no tools. The server name `workspace` is reserved for internal use. If your configuration defines a server with that name, Claude Code skips it at load time and shows a warning asking you to rename it.
###
@@ -944,7 +946,7 @@
}
}
-The `alwaysLoad` field is available on all server types and requires Claude Code v2.1.121 or later. An MCP server can also mark individual tools as always-loaded by including `"anthropic/alwaysLoad": true` in the tool’s `_meta` object, which has the same effect for that tool only.
+The `alwaysLoad` field is available on all server types and requires Claude Code v2.1.121 or later. An MCP server can also mark individual tools as always-loaded by including `"anthropic/alwaysLoad": true` in the tool’s `_meta` object, which has the same effect for that tool only. Setting `alwaysLoad: true` also blocks startup until the server connects, capped at the standard 5-second connect timeout. This applies even when [`MCP_CONNECTION_NONBLOCKING=1`](</docs/en/env-vars>) is set, since the tools must be present when the first prompt is built. Other servers still connect in the background when nonblocking is enabled.
##
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -174,29 +174,18 @@
-Settings Sources No Longer Loaded by Default
-
-**What changed:** The SDK no longer reads from filesystem settings (CLAUDE.md, settings.json, slash commands, etc.) by default. **Migration:**
+Settings sources default
+
+This default was briefly changed in v0.1.0 and then reverted, so no migration action is needed. **Current behavior:** Omitting `settingSources` on `query()` loads user, project, and local filesystem settings, matching the CLI. This includes `~/.claude/settings.json`, `.claude/settings.json`, `.claude/settings.local.json`, CLAUDE.md files, and custom commands. To run isolated from filesystem settings, pass an empty array:
TypeScript
Python
- // BEFORE (v0.0.x) - Loaded all settings automatically
- const result = query({ prompt: "Hello" });
- // Would read from:
- // - ~/.claude/settings.json (user)
- // - .claude/settings.json (project)
- // - .claude/settings.local.json (local)
- // - CLAUDE.md files
- // - Custom slash commands
-
- // AFTER (v0.1.0) - No settings loaded by default
- // To get the old behavior:
- const result = query({
- prompt: "Hello",
- options: {
- settingSources: ["user", "project", "local"]
+ const result = query({
+ prompt: "Hello",
+ options: {
+ settingSources: [] // No filesystem settings loaded
}
});
@@ -208,14 +197,9 @@
}
});
-**Why this changed:** Ensures SDK applications have predictable behavior independent of local filesystem configurations. This is especially important for:
-
- * **CI/CD environments** \- Consistent behavior without local customizations
- * **Deployed applications** \- No dependency on filesystem settings
- * **Testing** \- Isolated test environments
- * **Multi-tenant systems** \- Prevent settings leakage between users
-
-Current SDK releases have reverted this default for `query()`: omitting the option once again loads user, project, and local settings, matching the CLI. Pass `settingSources: []` in TypeScript or `setting_sources=[]` in Python if your application depends on the isolated behavior described above. Python SDK 0.1.59 and earlier treated an empty list the same as omitting the option, so upgrade before relying on `setting_sources=[]`. See [What settingSources does not control](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) for inputs that are read even when `settingSources` is `[]`.
+Isolation is especially important for CI/CD pipelines, deployed applications, test environments, and multi-tenant systems where local customizations should not leak in.
+
+SDK v0.1.0 briefly defaulted to no settings loaded; this was reverted in subsequent releases. Python SDK 0.1.59 and earlier treated an empty list the same as omitting the option, so upgrade before relying on `setting_sources=[]`. See [What settingSources does not control](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) for inputs that are read even when `settingSources` is `[]`.
##
Show diff (140 lines)
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -59,6 +59,8 @@
}
Managed settings can be distributed via MDM (Mobile Device Management) or other device management solutions. Environment variables defined in the managed settings file have high precedence and cannot be overridden by users.
+
+Claude Code does not 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 does not 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.
##
@@ -84,8 +86,6 @@
`OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`| Protocol for logs, overrides general setting| `grpc`, `http/json`, `http/protobuf`
`OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`| OTLP logs endpoint, overrides general setting| `http://localhost:4318/v1/logs`
`OTEL_EXPORTER_OTLP_HEADERS`| Authentication headers for OTLP| `Authorization=Bearer token`
-`OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY`| Client key for mTLS authentication| Path to client key file
-`OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE`| Client certificate for mTLS authentication| Path to client cert file
`OTEL_METRIC_EXPORT_INTERVAL`| Export interval in milliseconds (default: 60000)| `5000`, `60000`
`OTEL_LOGS_EXPORT_INTERVAL`| Logs export interval in milliseconds (default: 5000)| `1000`, `10000`
`OTEL_LOG_USER_PROMPTS`| Enable logging of user prompt content (default: disabled)| `1` to enable
@@ -99,6 +99,21 @@
+mTLS authentication
+
+How you configure client certificates for the OTLP exporter depends on the OTLP protocol in use for that signal, set via `OTEL_EXPORTER_OTLP_PROTOCOL` or the per-signal override. The same configuration applies to metrics, logs, and traces.
+
+Protocol| Client certificate variables| Trust the collector’s CA with
+---|---|---
+`http/protobuf`, `http/json`| `CLAUDE_CODE_CLIENT_CERT`, `CLAUDE_CODE_CLIENT_KEY`, and optionally `CLAUDE_CODE_CLIENT_KEY_PASSPHRASE`. See [Network configuration](</docs/en/network-config#mtls-authentication>)| `NODE_EXTRA_CA_CERTS`
+`grpc`| `OTEL_EXPORTER_OTLP_CLIENT_KEY` and `OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE`, or the per-signal variants such as `OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY` to use a different certificate per signal| `OTEL_EXPORTER_OTLP_CERTIFICATE`
+
+For `grpc`, the OpenTelemetry SDK reads the standard OTLP variables directly, so existing configurations that set the per-signal metrics variables continue to work.
+
+###
+
+
+
Metrics cardinality control
The following environment variables control which attributes are included in metrics to manage cardinality:
@@ -117,7 +132,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, and headers.
+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.
Environment Variable| Description| Example Values
---|---|---
@@ -239,7 +254,7 @@
Dynamic headers
-For enterprise environments that require dynamic authentication, you can configure a script to generate headers dynamically:
+For enterprise environments that require dynamic authentication, you can configure a script to generate headers dynamically. Dynamic headers apply only to the `http/protobuf` and `http/json` protocols. The `grpc` exporter uses only the static `OTEL_EXPORTER_OTLP_HEADERS` value.
####
@@ -969,6 +984,79 @@
+Audit security events
+
+OpenTelemetry events are the audit data source for Claude Code activity. Every event carries identity attributes that tie tool calls, MCP activity, and permission decisions back to the user who triggered them, and the OTLP logs exporter can deliver these events to any Security Information and Event Management (SIEM) platform with an OTLP receiver or to an OpenTelemetry Collector that forwards to your SIEM.
+
+###
+
+
+
+Attribute actions to users
+
+The standard attributes on each event include the authenticated user’s identity: `user.email`, `user.account_uuid`, `user.account_id`, and `organization.id` when signed in with a Claude account, plus the installation-scoped `user.id` and the per-session `session.id`. MCP tool calls, Bash commands, and file edits are therefore attributed to the developer who started the session. Claude Code does not act under a separate service account; the identity recorded on each event is the developer’s own Claude account. When Claude Code authenticates with a direct API key, or against Bedrock, Vertex AI, or Microsoft Foundry, there is no Claude account in the session and only `user.id` and `session.id` are populated. In these deployments, attach user identity yourself with `OTEL_RESOURCE_ATTRIBUTES`, set per user through the managed settings file or a launch wrapper:
+
+ export OTEL_RESOURCE_ATTRIBUTES="enduser.id=jdoe@example.com,enduser.directory_id=S-1-5-21-..."
+
+###
+
+
+
+Audit MCP activity
+
+To capture MCP server activity with full call detail, enable the logs exporter and set `OTEL_LOG_TOOL_DETAILS=1`. Each MCP operation then produces structured events that carry the server name, tool name, and call arguments alongside the standard identity attributes:
+
+Event| What it records for MCP
+---|---
+`mcp_server_connection`| Server connect, disconnect, and connection failure with `server_name`, `transport_type`, `server_scope`, and error detail
+`tool_result`| Each MCP tool call with `tool_name` and `mcp_server_scope`, a `tool_parameters` payload containing `mcp_server_name` and `mcp_tool_name`, and a `tool_input` payload containing the call arguments
+`tool_decision`| Whether the call was allowed or denied, and whether the decision came from config, a hook, or the user
+
+Without `OTEL_LOG_TOOL_DETAILS`, `tool_result` events still carry `tool_name` and `mcp_server_scope` but omit the `mcp_server_name`/`mcp_tool_name` breakdown and the arguments, and `mcp_server_connection` events omit `server_name` and the error message.
+
+###
+
+
+
+Map security questions to events
+
+When building detection rules, look up the signal you want to monitor and query your backend for the corresponding event and attributes:
+
+Signal| Event| Key attributes
+---|---|---
+Tool call allowed or denied, and by what| `tool_decision`| `decision`, `source`, `tool_name`
+Permission mode escalation| `permission_mode_changed`| `from_mode`, `to_mode`, `trigger`
+Policy hook blocked an action| `hook_execution_complete`| `hook_event`, `num_blocking`
+Login, logout, and authentication failure| `auth`| `action`, `success`, `error_category`
+MCP server connect or failure| `mcp_server_connection`| `status`, `server_name`, `error_code`
+Plugin installed and its source| `plugin_installed`| `plugin.name`, `marketplace.name`, `marketplace.is_official`
+Commands run and files touched| `tool_result` with `OTEL_LOG_TOOL_DETAILS=1`| `tool_parameters`, `tool_input`
+
+Claude Code emits the raw event stream only. Anomaly detection, baselining, correlation across sessions, and alerting are the responsibility of your SIEM or observability backend.
+
+###
+
+
+
+Send events to a SIEM
+
+Point `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` at your SIEM’s OTLP receiver, or at an OpenTelemetry Collector that forwards to your SIEM’s native ingest API. The following managed-settings example exports events only, with full tool detail enabled for MCP and Bash auditing:
+
+ {
+ "env": {
+ "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
+ "OTEL_LOGS_EXPORTER": "otlp",
+ "OTEL_LOG_TOOL_DETAILS": "1",
+ "OTEL_EXPORTER_OTLP_LOGS_PROTOCOL": "http/protobuf",
+ "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT": "https://siem.example.com:4318/v1/logs",
+ "OTEL_EXPORTER_OTLP_HEADERS": "Authorization=Bearer your-siem-token"
+ }
+ }
+
+##
+
+
+
Backend considerations
Your choice of metrics, logs, and traces backends determines the types of analyses you can perform:
--- a/network-config.md
+++ b/network-config.md
@@ -57,11 +57,7 @@
CA certificate store
-By default, Claude Code trusts both its bundled Mozilla CA certificates and your operating system’s certificate store. Enterprise TLS-inspection proxies such as CrowdStrike Falcon and Zscaler work without additional configuration when their root certificate is installed in the OS trust store.
-
-System CA store integration requires the native Claude Code binary distribution. When running on the Node.js runtime, the system CA store is not merged automatically. In that case, set `NODE_EXTRA_CA_CERTS=/path/to/ca-cert.pem` to trust an enterprise root CA.
-
-`CLAUDE_CODE_CERT_STORE` accepts a comma-separated list of sources. Recognized values are `bundled` for the Mozilla CA set shipped with Claude Code and `system` for the operating system trust store. The default is `bundled,system`. To trust only the bundled Mozilla CA set:
+By default, Claude Code trusts both its bundled Mozilla CA certificates and your operating system’s certificate store. Enterprise TLS-inspection proxies such as CrowdStrike Falcon and Zscaler work without additional configuration when their root certificate is installed in the OS trust store. `CLAUDE_CODE_CERT_STORE` accepts a comma-separated list of sources. Recognized values are `bundled` for the Mozilla CA set shipped with Claude Code and `system` for the operating system trust store. The default is `bundled,system`. To trust only the bundled Mozilla CA set:
export CLAUDE_CODE_CERT_STORE=bundled
@@ -114,6 +110,7 @@
`downloads.claude.ai`| Plugin executable downloads; native installer and native auto-updater
`storage.googleapis.com`| Native installer and native auto-updater on versions prior to 2.1.116
`bridge.claudeusercontent.com`| [Claude in Chrome](</docs/en/chrome>) extension WebSocket bridge
+`raw.githubusercontent.com`| Changelog feed for [`/release-notes`](</docs/en/commands>) and the release notes shown after updating; plugin marketplace install counts
If you install Claude Code through npm or manage your own binary distribution, end users may not need access to `downloads.claude.ai` or `storage.googleapis.com`. Claude Code also sends optional operational telemetry by default, which you can disable with environment variables. See [Telemetry services](</docs/en/data-usage#telemetry-services>) for how to disable it before finalizing your allowlist. When using [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>), model traffic and authentication go to your provider instead of `api.anthropic.com`, `claude.ai`, or `platform.claude.com`. The WebFetch tool still calls `api.anthropic.com` for its [domain safety check](</docs/en/data-usage#webfetch-domain-safety-check>) unless you set `skipWebFetchPreflight: true` in [settings](</docs/en/settings>). [Claude Code on the web](</docs/en/claude-code-on-the-web>) and [Code Review](</docs/en/code-review>) connect to your repositories from Anthropic-managed infrastructure. If your GitHub Enterprise Cloud organization restricts access by IP address, enable [IP allow list inheritance for installed GitHub Apps](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#allowing-access-by-github-apps>). The Claude GitHub App registers its IP ranges, so enabling this setting allows access without manual configuration. To [add the ranges to your allow list manually](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#adding-an-allowed-ip-address>) instead, or to configure other firewalls, see the [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>). For self-hosted [GitHub Enterprise Server](</docs/en/github-enterprise-server>) instances behind a firewall, allowlist the same [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>) so Anthropic infrastructure can reach your GHES host to clone repositories and post review comments.
--- a/observability.md
+++ b/observability.md
@@ -144,6 +144,29 @@
+Attribute actions to your end users
+
+The CLI attaches [identity attributes](</docs/en/monitoring-usage#standard-attributes>) to every event based on the credential it uses to call Anthropic. When you build an application that serves many end users from one deployment, these attributes identify your service’s credential, not the end user on whose behalf the agent acted. To make tool calls and MCP activity attributable to your application’s end users, inject end-user identity as resource attributes on each `query()` call. Percent-encode values before interpolating them, since `OTEL_RESOURCE_ATTRIBUTES` [reserves commas, spaces, and equals signs](</docs/en/monitoring-usage#multi-team-organization-support>). The following example attaches the requesting user and tenant to every span and event from one request:
+
+Python
+
+TypeScript
+
+ from urllib.parse import quote
+
+ options = ClaudeAgentOptions(
+ env={
+ # ... exporter configuration ...
+ "OTEL_RESOURCE_ATTRIBUTES": f"enduser.id={quote(request.user_id)},tenant.id={quote(request.tenant_id)}",
+ },
+ )
+
+With end-user identity attached, the `tool_decision`, `tool_result`, `mcp_server_connection`, and `permission_mode_changed` events become a per-user audit trail you can forward to a Security Information and Event Management (SIEM) platform. See [Audit security events](</docs/en/monitoring-usage#audit-security-events>) in the Monitoring reference for the full list of security-relevant events and the attributes each one carries.
+
+##
+
+
+
Control sensitive data in exports
Telemetry is structural by default. Durations, model names, and tool names are recorded on every span; token counts are recorded when the underlying API request returns usage data, so spans for failed or aborted requests may omit them. The content your agent reads and writes is not recorded by default. These opt-in variables add content to the exported data:
--- a/permissions.md
+++ b/permissions.md
@@ -46,7 +46,7 @@
---|---
`default`| Standard behavior: prompts for permission on first use of each tool
`acceptEdits`| Automatically accepts file edits and common filesystem commands (`mkdir`, `touch`, `mv`, `cp`, etc.) for paths in the working directory or `additionalDirectories`
-`plan`| Plan Mode: Claude can analyze but not modify files or execute commands
+`plan`| Plan Mode: Claude reads files and runs read-only shell commands to explore but does not edit your source files
`auto`| Auto-approves tool calls with background safety checks that verify actions align with your request. Currently a research preview
`dontAsk`| Auto-denies tools unless pre-approved via `/permissions` or `permissions.allow` rules
`bypassPermissions`| Skips all permission prompts. Root and home directory removals such as `rm -rf /` still prompt as a circuit breaker
@@ -336,7 +336,7 @@
* Permission deny rules block Claude from even attempting to access restricted resources
* Sandbox restrictions prevent Bash commands from reaching resources outside defined boundaries, even if a prompt injection bypasses Claude’s decision-making
- * Filesystem restrictions in the sandbox use Read and Edit deny rules, not separate sandbox configuration
+ * Filesystem restrictions in the sandbox combine the [`sandbox.filesystem`](</docs/en/sandboxing>) settings with Read and Edit deny rules; both are merged into the final sandbox boundary
* Network restrictions combine WebFetch permission rules with the sandbox’s `allowedDomains` and `deniedDomains` lists
When sandboxing is enabled with `autoAllowBashIfSandboxed: true`, which is the default, sandboxed Bash commands run without prompting even if your permissions include `ask: Bash(*)`. The sandbox boundary substitutes for the per-command prompt. Explicit deny rules still apply, and `rm` or `rmdir` commands that target `/`, your home directory, or other critical system paths still trigger a prompt. See [sandbox modes](</docs/en/sandboxing#sandbox-modes>) to change this behavior.
@@ -364,7 +364,7 @@
`allowManagedMcpServersOnly`| When `true`, only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. See [Managed MCP configuration](</docs/en/mcp#managed-mcp-configuration>)
`allowManagedPermissionRulesOnly`| When `true`, prevents user and project settings from defining `allow`, `ask`, or `deny` permission rules. Only rules in managed settings apply
`blockedMarketplaces`| Blocklist of marketplace sources. Blocked sources are checked before downloading, so they never touch the filesystem. See [managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>)
-`channelsEnabled`| Allow [channels](</docs/en/channels>) for Team and Enterprise users. Unset or `false` blocks channel message delivery regardless of what users pass to `--channels`
+`channelsEnabled`| Allow [channels](</docs/en/channels>) for the organization. See [enterprise controls](</docs/en/channels#enterprise-controls>) for the default on each plan
`forceRemoteSettingsRefresh`| When `true`, blocks CLI startup until remote managed settings are freshly fetched and exits if the fetch fails. See [fail-closed enforcement](</docs/en/server-managed-settings#enforce-fail-closed-startup>)
`pluginTrustMessage`| Custom message appended to the plugin trust warning shown before installation
`sandbox.filesystem.allowManagedReadPathsOnly`| When `true`, only `filesystem.allowRead` paths from managed settings are respected. `denyRead` still merges from all sources
@@ -374,7 +374,7 @@
`disableBypassPermissionsMode` is typically placed in managed settings to enforce organizational policy, but it works from any scope. A user can set it in their own settings to lock themselves out of bypass mode.
-Access to [Remote Control](</docs/en/remote-control>) and [web sessions](</docs/en/claude-code-on-the-web>) is not controlled by a managed settings key. On Team and Enterprise plans, an admin enables or disables these features in [Claude Code admin settings](<https://claude.ai/admin-settings/claude-code>).
+On Team and Enterprise plans, an admin enables or disables [Remote Control](</docs/en/remote-control>) and [web sessions](</docs/en/claude-code-on-the-web>) organization-wide in [Claude Code admin settings](<https://claude.ai/admin-settings/claude-code>). Remote Control can additionally be disabled per device with the [`disableRemoteControl`](</docs/en/settings#available-settings>) managed setting. Web sessions have no per-device managed settings key.
##
--- a/platforms.md
+++ b/platforms.md
@@ -23,7 +23,7 @@
[Web](</docs/en/claude-code-on-the-web>)| Long-running tasks that don’t need much steering, or work that should continue when you’re offline| Anthropic-managed cloud, continues after you disconnect
Mobile| Starting and monitoring tasks while away from your computer| Cloud sessions from the Claude app for iOS and Android, [Remote Control](</docs/en/remote-control>) for local sessions, [Dispatch](</docs/en/desktop#sessions-from-dispatch>) to Desktop on Pro and Max
-The CLI is the most complete surface for terminal-native work: scripting, third-party providers, and the Agent SDK are CLI-only. Desktop and the IDE extensions trade some CLI-only features for visual review and tighter editor integration. The web runs in Anthropic’s cloud, so tasks keep going after you disconnect. Mobile is a thin client into those same cloud sessions or into a local session via Remote Control, and can send tasks to Desktop with Dispatch. You can mix surfaces on the same project. Configuration, project memory, and MCP servers are shared across the local surfaces.
+The CLI is the most complete surface for terminal-native work: scripting and the Agent SDK are CLI-only. Third-party providers also work in [VS Code](</docs/en/vs-code#use-third-party-providers>). Enterprise [Desktop](</docs/en/desktop>) deployments support Vertex AI and gateway providers; for Bedrock or Foundry, use the CLI or VS Code instead of Desktop. Desktop and the IDE extensions trade some CLI-only features for visual review and tighter editor integration. The web runs in Anthropic’s cloud, so tasks keep going after you disconnect. Mobile is a thin client into those same cloud sessions or into a local session via Remote Control, and can send tasks to Desktop with Dispatch. You can mix surfaces on the same project. Configuration, project memory, and MCP servers are shared across the local surfaces.
##
--- a/plugin-marketplaces.md
+++ b/plugin-marketplaces.md
@@ -27,7 +27,7 @@
Walkthrough: create a local marketplace
-This example creates a marketplace with one plugin: a `/quality-review` skill for code reviews. You’ll create the directory structure, add a skill, create the plugin manifest and marketplace catalog, then install and test it.
+This example creates a marketplace with one plugin: a `quality-review` skill for code reviews. You’ll create the directory structure, add a skill, create the plugin manifest and marketplace catalog, then install and test it.
1
@@ -41,7 +41,7 @@
Create the skill
-Create a `SKILL.md` file that defines what the `/quality-review` skill does.
+Create a `SKILL.md` file that defines what the `quality-review` skill does.
my-marketplace/plugins/quality-review-plugin/skills/quality-review/SKILL.md
@@ -68,7 +68,7 @@
{
"name": "quality-review-plugin",
- "description": "Adds a /quality-review skill for quick code reviews",
+ "description": "Adds a quality-review skill for quick code reviews",
"version": "1.0.0"
}
@@ -91,7 +91,7 @@
{
"name": "quality-review-plugin",
"source": "./plugins/quality-review-plugin",
- "description": "Adds a /quality-review skill for quick code reviews"
+ "description": "Adds a quality-review skill for quick code reviews"
}
]
}
@@ -109,9 +109,9 @@
Try it out
-Select some code in your editor and run your new skill.
-
- /quality-review
+Select some code in your editor and run your new skill. Plugin skills are namespaced with the plugin name.
+
+ /quality-review-plugin:quality-review
To learn more about what plugins can do, including hooks, agents, MCP servers, and LSP servers, see [Plugins](</docs/en/plugins>).
@@ -721,7 +721,7 @@
* For `hostPattern` sources: the marketplace host is matched against the regex pattern
* For `pathPattern` sources: the marketplace’s filesystem path is matched against the regex pattern
-Because `strictKnownMarketplaces` is set in [managed settings](</docs/en/settings#settings-files>), individual users and project configurations cannot override these restrictions. For complete configuration details including all supported source types and comparison with `extraKnownMarketplaces`, see the [strictKnownMarketplaces reference](</docs/en/settings#strictknownmarketplaces>).
+Exact matching does not normalize URLs: a trailing slash, `.git` suffix, or `ssh://` versus `https://` form are treated as different values. If your organization’s marketplace can be cloned by more than one URL form, prefer a `hostPattern` entry over a literal URL so all forms match. Because `strictKnownMarketplaces` is set in [managed settings](</docs/en/settings#settings-files>), individual users and project configurations cannot override these restrictions. For complete configuration details including all supported source types and comparison with `extraKnownMarketplaces`, see the [strictKnownMarketplaces reference](</docs/en/settings#strictknownmarketplaces>).
###
--- a/plugins-reference.md
+++ b/plugins-reference.md
@@ -235,7 +235,7 @@
---|---|---
`pyright-lsp`| Pyright (Python)| `pip install pyright` or `npm install -g pyright`
`typescript-lsp`| TypeScript Language Server| `npm install -g typescript-language-server typescript`
-`rust-lsp`| rust-analyzer| [See rust-analyzer installation](<https://rust-analyzer.github.io/manual.html#installation>)
+`rust-analyzer-lsp`| rust-analyzer| [See rust-analyzer installation](<https://rust-analyzer.github.io/manual.html#installation>)
Install the language server first, then install the plugin from the marketplace.
@@ -519,7 +519,7 @@
Environment variables
-Claude Code provides two variables for referencing plugin paths. Both are substituted inline anywhere they appear in skill content, agent content, hook commands, monitor commands, and MCP or LSP server configs. Both are also exported as environment variables to hook processes and MCP or LSP server subprocesses. **`${CLAUDE_PLUGIN_ROOT}`** : the absolute path to your plugin’s installation directory. Use this to reference scripts, binaries, and config files bundled with the plugin. This path changes when the plugin updates, so files you write here do not survive an update. **`${CLAUDE_PLUGIN_DATA}`** : a persistent directory for plugin state that survives updates. Use this for installed dependencies such as `node_modules` or Python virtual environments, generated code, caches, and any other files that should persist across plugin versions. The directory is created automatically the first time this variable is referenced.
+Claude Code provides two variables for referencing plugin paths. Both are substituted inline anywhere they appear in skill content, agent content, hook commands, monitor commands, and MCP or LSP server configs. Both are also exported as environment variables to hook processes and MCP or LSP server subprocesses. **`${CLAUDE_PLUGIN_ROOT}`** : the absolute path to your plugin’s installation directory. Use this to reference scripts, binaries, and config files bundled with the plugin. This path changes when the plugin updates. The previous version’s directory remains on disk for about seven days after an update before cleanup, but treat it as ephemeral and do not write state here. When a plugin updates mid-session, hook commands, monitors, MCP servers, and LSP servers keep using the previous version’s path. Run `/reload-plugins` to switch hooks, MCP servers, and LSP servers to the new path; monitors require a session restart. **`${CLAUDE_PLUGIN_DATA}`** : a persistent directory for plugin state that survives updates. Use this for installed dependencies such as `node_modules` or Python virtual environments, generated code, caches, and any other files that should persist across plugin versions. The directory is created automatically the first time this variable is referenced.
{
"hooks": {
@@ -665,6 +665,8 @@
The `.claude-plugin/` directory contains the `plugin.json` file. All other directories (commands/, agents/, skills/, output-styles/, themes/, monitors/, hooks/) must be at the plugin root, not inside `.claude-plugin/`.
+A `CLAUDE.md` file at the plugin root is not loaded as project context. Plugins contribute context through skills, agents, and hooks rather than CLAUDE.md. To ship instructions that load into Claude’s context, put them in a skill.
+
###
--- a/python.md
+++ b/python.md
@@ -909,6 +909,7 @@
effort: Literal["low", "medium", "high", "max"] | None = None
enable_file_checkpointing: bool = False
session_store: SessionStore | None = None
+ session_store_flush: SessionStoreFlushMode = "batched"
Property| Type| Default| Description
---|---|---|---
@@ -949,7 +950,8 @@
`max_thinking_tokens`| `int | None`| `None`| _Deprecated_ \- Maximum tokens for thinking blocks. Use `thinking` instead
`thinking`| `ThinkingConfig` ` | None`| `None`| Controls extended thinking behavior. Takes precedence over `max_thinking_tokens`
`effort`| `Literal["low", "medium", "high", "max"] | None`| `None`| Effort level for thinking depth
-`session_store`| [`SessionStore`](</docs/en/agent-sdk/session-storage#the-session-store-interface>) ` | None`| `None`| Mirror session transcripts to an external backend so any host can resume them. See [Persist sessions to external storage](</docs/en/agent-sdk/session-storage>)
+`session_store`| [`SessionStore`](</docs/en/agent-sdk/session-storage#the-sessionstore-interface>) ` | None`| `None`| Mirror session transcripts to an external backend so any host can resume them. See [Persist sessions to external storage](</docs/en/agent-sdk/session-storage>)
+`session_store_flush`| `Literal["batched", "eager"]`| `"batched"`| When to flush mirrored transcript entries to `session_store`. `"batched"` flushes once per turn or when the buffer fills; `"eager"` triggers a background flush after every frame. Ignored when `session_store` is `None`
###
@@ -1169,7 +1171,7 @@
PermissionMode = Literal[
"default", # Standard permission behavior
"acceptEdits", # Auto-accept file edits
- "plan", # Planning mode - no execution
+ "plan", # Planning mode - read-only tools only
"dontAsk", # Deny anything not pre-approved instead of prompting
"bypassPermissions", # Bypass all permission checks (use with caution)
]
@@ -1210,7 +1212,7 @@
Field| Type| Description
---|---|---
`signal`| `Any | None`| Reserved for future abort signal support
-`suggestions`| `list[PermissionUpdate]`| Permission update suggestions from the CLI
+`suggestions`| `list[PermissionUpdate]`| Permission update suggestions from the CLI. Bash prompts include a suggestion with the `localSettings` destination, so returning it in `updated_permissions` writes the rule to `.claude/settings.local.json` and persists across sessions.
###
@@ -1649,7 +1651,7 @@
`cache_creation_input_tokens`| `int`| Tokens used to create new cache entries.
`cache_read_input_tokens`| `int`| Tokens read from existing cache entries.
-The `model_usage` dict maps model names to per-model usage. The inner dict keys use camelCase because the value is passed through unmodified from the underlying CLI process, matching the TypeScript [`ModelUsage`](</docs/en/agent-sdk/typescript#model-usage>) type:
+The `model_usage` dict maps model names to per-model usage. The inner dict keys use camelCase because the value is passed through unmodified from the underlying CLI process, matching the TypeScript [`ModelUsage`](</docs/en/agent-sdk/typescript#modelusage>) type:
Key| Type| Description
---|---|---
--- a/remote-control.md
+++ b/remote-control.md
@@ -101,7 +101,7 @@
* **Open the session URL** in any browser to go directly to the session on [claude.ai/code](<https://claude.ai/code>).
* **Scan the QR code** shown alongside the session URL to open it directly in the Claude app. With `claude remote-control`, press spacebar to toggle the QR code display.
- * **Open[claude.ai/code](<https://claude.ai/code>) or the Claude app** and find the session by name in the session list. Remote Control sessions show a computer icon with a green status dot when online.
+ * **Open[claude.ai/code](<https://claude.ai/code>) or the Claude app** and find the session by name in the session list. In the Claude mobile app, tap **Code** in the navigation to reach the session list. Remote Control sessions show a computer icon with a green status dot when online.
The remote session title is chosen in this order:
@@ -239,11 +239,12 @@
”Remote Control is disabled by your organization’s policy”
-This error has three distinct causes. Run `/status` first to see which login method and subscription you’re using.
+This error has four distinct causes. Run `/status` first to see which login method and subscription you’re using.
* **You’re authenticated with an API key or Console account** : Remote Control requires claude.ai OAuth. Run `/login` and choose the claude.ai option. If `ANTHROPIC_API_KEY` is set in your environment, unset it.
- * **Your Team or Enterprise admin hasn’t enabled it** : Remote Control is off by default on these plans. An admin can enable it at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>) by turning on the **Remote Control** toggle. This is a server-side organization setting, not a [managed settings](</docs/en/permissions#managed-only-settings>) key.
+ * **Your Team or Enterprise admin hasn’t enabled it** : Remote Control is off by default on these plans. An admin can enable it at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>) by turning on the **Remote Control** toggle. This toggle is a server-side organization setting.
* **The admin toggle is grayed out** : your organization has a data retention or compliance configuration that is incompatible with Remote Control. This cannot be changed from the admin panel. Contact Anthropic support to discuss options.
+ * **The error mentions`disableRemoteControl`**: your IT administrator has disabled Remote Control on this device through [managed settings](</docs/en/settings#settings-files>), independent of the organization-wide toggle.
###
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -174,9 +174,9 @@
Jitter
-To avoid every session hitting the API at the same wall-clock moment, the scheduler adds a small deterministic offset to fire times:
-
- * Recurring tasks fire up to 10% of their period late, capped at 15 minutes. An hourly job might fire anywhere from `:00` to `:06`.
+To avoid every session hitting the API at the same wall-clock moment, the scheduler adds a deterministic offset to fire times:
+
+ * Recurring tasks fire up to 30 minutes after the scheduled time (or up to half the interval, for tasks that run more often than hourly). An hourly job scheduled for `:00` may fire anywhere up to `:30`.
* One-shot tasks scheduled for the top or bottom of the hour fire up to 90 seconds early.
The offset is derived from the task ID, so the same task always gets the same offset. If exact timing matters, pick a minute that is not `:00` or `:30`, for example `3 9 * * *` instead of `0 9 * * *`, and the one-shot jitter will not apply.
--- a/security.md
+++ b/security.md
@@ -37,7 +37,7 @@
* **Sandboxed bash tool** : [Sandbox](</docs/en/sandboxing>) bash commands with filesystem and network isolation, reducing permission prompts while maintaining security. Enable with `/sandbox` to define boundaries where Claude Code can work autonomously
* **Write access restriction** : Claude Code can only write to the folder where it was started and its subfolders—it cannot modify files in parent directories without explicit permission. While Claude Code can read files outside the working directory (useful for accessing system libraries and dependencies), write operations are strictly confined to the project scope, creating a clear security boundary
* **Prompt fatigue mitigation** : Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization
- * **Accept Edits mode** : Batch accept multiple edits while maintaining permission prompts for commands with side effects
+ * **Accept Edits mode** : Auto-approves file edits and a fixed set of filesystem Bash commands like `mkdir`, `touch`, `rm`, `mv`, `cp`, and `sed` for paths in the working directory. Other Bash commands and out-of-scope paths still prompt
###
--- a/sessions.md
+++ b/sessions.md
@@ -33,7 +33,7 @@
Continue, resume, and fork
-Continue, resume, and fork are option fields you set on `query()` ([`ClaudeAgentOptions`](</docs/en/agent-sdk/python#claude-agent-options>) in Python, [`Options`](</docs/en/agent-sdk/typescript#options>) in TypeScript). **Continue** and **resume** both pick up an existing session and add to it. The difference is how they find that session:
+Continue, resume, and fork are option fields you set on `query()` ([`ClaudeAgentOptions`](</docs/en/agent-sdk/python#claudeagentoptions>) in Python, [`Options`](</docs/en/agent-sdk/typescript#options>) in TypeScript). **Continue** and **resume** both pick up an existing session and add to it. The difference is how they find that session:
* **Continue** finds the most recent session in the current directory. You don’t track anything. Works well when your app runs one conversation at a time.
* **Resume** takes a specific session ID. You track the ID. Required when you have multiple sessions (for example, one per user in a multi-user app) or want to return to one that isn’t the most recent.
@@ -54,7 +54,7 @@
Python: `ClaudeSDKClient`
-[`ClaudeSDKClient`](</docs/en/agent-sdk/python#claude-sdk-client>) handles session IDs internally. Each call to `client.query()` automatically continues the same session. Call [`client.receive_response()`](</docs/en/agent-sdk/python#claude-sdk-client>) to iterate over the messages for the current query. The client must be used as an async context manager. This example runs two queries against the same `client`. The first asks the agent to analyze a module; the second asks it to refactor that module. Because both calls go through the same client instance, the second query has full context from the first without any explicit `resume` or session ID:
+[`ClaudeSDKClient`](</docs/en/agent-sdk/python#claudesdkclient>) handles session IDs internally. Each call to `client.query()` automatically continues the same session. Call [`client.receive_response()`](</docs/en/agent-sdk/python#claudesdkclient>) to iterate over the messages for the current query. The client must be used as an async context manager. This example runs two queries against the same `client`. The first asks the agent to analyze a module; the second asks it to refactor that module. Because both calls go through the same client instance, the second query has full context from the first without any explicit `resume` or session ID:
Python
@@ -99,7 +99,7 @@
asyncio.run(main())
-See the [Python SDK reference](</docs/en/agent-sdk/python#choosing-between-query-and-claude-sdk-client>) for details on when to use `ClaudeSDKClient` vs the standalone `query()` function.
+See the [Python SDK reference](</docs/en/agent-sdk/python#choosing-between-query-and-claudesdkclient>) for details on when to use `ClaudeSDKClient` vs the standalone `query()` function.
###
@@ -150,7 +150,7 @@
Capture the session ID
-Resume and fork require a session ID. Read it from the `session_id` field on the result message ([`ResultMessage`](</docs/en/agent-sdk/python#result-message>) in Python, [`SDKResultMessage`](</docs/en/agent-sdk/typescript#sdk-result-message>) in TypeScript), which is present on every result regardless of success or error. In TypeScript the ID is also available earlier as a direct field on the init `SystemMessage`; in Python it’s nested inside `SystemMessage.data`.
+Resume and fork require a session ID. Read it from the `session_id` field on the result message ([`ResultMessage`](</docs/en/agent-sdk/python#resultmessage>) in Python, [`SDKResultMessage`](</docs/en/agent-sdk/typescript#sdkresultmessage>) in TypeScript), which is present on every result regardless of success or error. In TypeScript the ID is also available earlier as a direct field on the init `SystemMessage`; in Python it’s nested inside `SystemMessage.data`.
Python
@@ -262,7 +262,7 @@
* **Move the session file.** Persist `~/.claude/projects/<encoded-cwd>/<session-id>.jsonl` from the first run and restore it to the same path on the new host before calling `resume`. The `cwd` must match.
* **Don’t rely on session resume.** Capture the results you need (analysis output, decisions, file diffs) as application state and pass them into a fresh session’s prompt. This is often more robust than shipping transcript files around.
-Both SDKs expose functions for enumerating sessions on disk and reading their messages: [`listSessions()`](</docs/en/agent-sdk/typescript#list-sessions>) and [`getSessionMessages()`](</docs/en/agent-sdk/typescript#get-session-messages>) in TypeScript, [`list_sessions()`](</docs/en/agent-sdk/python#list-sessions>) and [`get_session_messages()`](</docs/en/agent-sdk/python#get-session-messages>) in Python. Use them to build custom session pickers, cleanup logic, or transcript viewers. Both SDKs also expose functions for looking up and mutating individual sessions: [`get_session_info()`](</docs/en/agent-sdk/python#get-session-info>), [`rename_session()`](</docs/en/agent-sdk/python#rename-session>), and [`tag_session()`](</docs/en/agent-sdk/python#tag-session>) in Python, and [`getSessionInfo()`](</docs/en/agent-sdk/typescript#get-session-info>), [`renameSession()`](</docs/en/agent-sdk/typescript#rename-session>), and [`tagSession()`](</docs/en/agent-sdk/typescript#tag-session>) in TypeScript. Use them to organize sessions by tag or give them human-readable titles.
+Both SDKs expose functions for enumerating sessions on disk and reading their messages: [`listSessions()`](</docs/en/agent-sdk/typescript#listsessions>) and [`getSessionMessages()`](</docs/en/agent-sdk/typescript#getsessionmessages>) in TypeScript, [`list_sessions()`](</docs/en/agent-sdk/python#list_sessions>) and [`get_session_messages()`](</docs/en/agent-sdk/python#get_session_messages>) in Python. Use them to build custom session pickers, cleanup logic, or transcript viewers. Both SDKs also expose functions for looking up and mutating individual sessions: [`get_session_info()`](</docs/en/agent-sdk/python#get_session_info>), [`rename_session()`](</docs/en/agent-sdk/python#rename_session>), and [`tag_session()`](</docs/en/agent-sdk/python#tag_session>) in Python, and [`getSessionInfo()`](</docs/en/agent-sdk/typescript#getsessioninfo>), [`renameSession()`](</docs/en/agent-sdk/typescript#renamesession>), and [`tagSession()`](</docs/en/agent-sdk/typescript#tagsession>) in TypeScript. Use them to organize sessions by tag or give them human-readable titles.
##
@@ -272,5 +272,5 @@
* [How the agent loop works](</docs/en/agent-sdk/agent-loop>): Understand turns, messages, and context accumulation within a session
* [File checkpointing](</docs/en/agent-sdk/file-checkpointing>): Track and revert file changes across sessions
- * [Python `ClaudeAgentOptions`](</docs/en/agent-sdk/python#claude-agent-options>): Full session option reference for Python
+ * [Python `ClaudeAgentOptions`](</docs/en/agent-sdk/python#claudeagentoptions>): Full session option reference for Python
* [TypeScript `Options`](</docs/en/agent-sdk/typescript#options>): Full session option reference for TypeScript
--- a/settings.md
+++ b/settings.md
@@ -88,6 +88,8 @@
**MCP servers**| `~/.claude.json`| `.mcp.json`| `~/.claude.json` (per-project)
**Plugins**| `~/.claude/settings.json`| `.claude/settings.json`| `.claude/settings.local.json`
**CLAUDE.md**| `~/.claude/CLAUDE.md`| `CLAUDE.md` or `.claude/CLAUDE.md`| `CLAUDE.local.md`
+
+On Windows, paths shown as `~/.claude` resolve to `%USERPROFILE%\.claude`.
* * *
@@ -176,6 +178,7 @@
`apiKeyHelper`| Custom script, to be executed in `/bin/sh`, to generate an auth value. This value will be sent as `X-Api-Key` and `Authorization: Bearer` headers for model requests| `/bin/generate_temp_api_key.sh`
`attribution`| Customize attribution for git commits and pull requests. See Attribution settings| `{"commit": "🤖 Generated with Claude Code", "pr": ""}`
`autoMemoryDirectory`| Custom directory for [auto memory](</docs/en/memory#storage-location>) storage. Accepts an absolute path or a `~/`-prefixed path. Accepted from policy and user settings, and from the `--settings` flag. Not accepted from project or local settings, since a cloned repository could supply either file to redirect memory writes to sensitive locations| `"~/my-memory-dir"`
+`autoMemoryEnabled`| Enable [auto memory](</docs/en/memory#enable-or-disable-auto-memory>). When `false`, Claude does not read from or write to the auto memory directory. Default: `true`. You can also toggle this with `/memory` during a session| `false`
`autoMode`| Customize what the [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) classifier blocks and allows. Contains `environment`, `allow`, and `soft_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| `"stable"`
@@ -184,7 +187,7 @@
`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`
`blockedMarketplaces`| (Managed settings only) Blocklist of marketplace sources. Enforced on marketplace add and on plugin install, update, refresh, and auto-update, so a marketplace added before the policy was set cannot be used to fetch plugins. Blocked sources are checked before downloading, so they never touch the filesystem. See [Managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>)| `[{ "source": "github", "repo": "untrusted/plugins" }]`
-`channelsEnabled`| (Managed settings only) Allow [channels](</docs/en/channels>) for Team and Enterprise users. Unset or `false` blocks channel message delivery regardless of what users pass to `--channels`| `true`
+`channelsEnabled`| (Managed settings only) Allow [channels](</docs/en/channels>) for the organization. On claude.ai Team and Enterprise plans, channels are blocked when this is unset or `false`. For [Anthropic Console](</docs/en/authentication#claude-console-authentication>) accounts using API key authentication, channels are allowed by default unless your organization deploys managed settings, in which case this key must be set to `true`| `true`
`cleanupPeriodDays`| Session files older than this period are deleted at startup (default: 30 days, minimum 1). Setting to `0` is rejected with a validation error. Also controls the age cutoff for automatic removal of [orphaned subagent worktrees](</docs/en/worktrees#clean-up-worktrees>) at startup. To disable transcript writes entirely, set the [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](</docs/en/env-vars>) environment variable, or in non-interactive mode (`-p`) use the `--no-session-persistence` flag or the `persistSession: false` SDK option.| `20`
`companyAnnouncements`| Announcement to display to users at startup. If multiple announcements are provided, they will be cycled through at random.| `["Welcome to Acme Corp! Review our code guidelines at docs.acme.com"]`
`defaultShell`| Default shell for input-box `!` commands. Accepts `"bash"` (default) or `"powershell"`. Setting `"powershell"` routes interactive `!` commands through PowerShell on Windows. Requires `CLAUDE_CODE_USE_POWERSHELL_TOOL=1`. See [PowerShell tool](</docs/en/tools-reference#powershell-tool>)| `"powershell"`
@@ -193,6 +196,7 @@
`disableAutoMode`| Set to `"disable"` to prevent [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) from being activated. Removes `auto` from the `Shift+Tab` cycle and rejects `--permission-mode auto` at startup. Most useful in [managed settings](</docs/en/permissions#managed-settings>) where users cannot override it| `"disable"`
`disableDeepLinkRegistration`| Set to `"disable"` to prevent Claude Code from registering the `claude-cli://` protocol handler with the operating system on startup. [Deep links](</docs/en/deep-links>) let external tools open a Claude Code session with a pre-filled prompt. Useful in environments where protocol handler registration is restricted or managed separately| `"disable"`
`disabledMcpjsonServers`| List of specific MCP servers from `.mcp.json` files to reject| `["filesystem"]`
+`disableRemoteControl`| Disable [Remote Control](</docs/en/remote-control>): blocks `claude remote-control`, the `--remote-control` flag, auto-start, and the in-session toggle. Typically placed in [managed settings](</docs/en/permissions#managed-settings>) for per-device MDM enforcement, but works from any scope. Requires Claude Code v2.1.128 or later| `true`
`disableSkillShellExecution`| Disable inline shell execution for `!`...`` and ````!` blocks in [skills](</docs/en/skills>) and custom commands from user, project, plugin, or additional-directory sources. Commands are replaced with `[shell command execution disabled by policy]` instead of being run. Bundled and managed skills are not affected. Most useful in [managed settings](</docs/en/permissions#managed-settings>) where users cannot override it| `true`
`editorMode`| Key binding mode for the input prompt: `"normal"` or `"vim"`. Default: `"normal"`. 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. See [Adjust effort level](</docs/en/model-config#adjust-effort-level>) for supported models| `"xhigh"`
@@ -583,8 +587,10 @@
},
"extraKnownMarketplaces": {
"acme-tools": {
- "source": "github",
- "repo": "acme-corp/claude-plugins"
+ "source": {
+ "source": "github",
+ "repo": "acme-corp/claude-plugins"
+ }
}
}
}
@@ -601,6 +607,8 @@
* **Project settings** (`.claude/settings.json`): Project-specific plugins shared with team
* **Local settings** (`.claude/settings.local.json`): Per-machine overrides (not committed)
* **Managed settings** (`managed-settings.json`): Organization-wide policy overrides that block installation at all scopes and hide the plugin from the marketplace
+
+Project settings take precedence over user settings, so setting a plugin to `false` in `~/.claude/settings.json` does not disable a plugin that the project’s `.claude/settings.json` enables. To opt out of a project-enabled plugin on your machine, set it to `false` in `.claude/settings.local.json` instead.Plugins force-enabled by managed settings cannot be disabled this way, since managed settings override local settings.
**Example** :
@@ -691,7 +699,7 @@
* Only available in managed settings (`managed-settings.json`)
* Cannot be overridden by user or project settings (highest precedence)
* Enforced BEFORE network/filesystem operations (blocked sources never execute)
- * Uses exact matching for source specifications (including `ref`, `path` for git sources), except `hostPattern`, which uses regex matching
+ * Uses exact matching for source specifications (including `ref`, `path` for git sources), except `hostPattern` and `pathPattern`, which use regex matching
**Allowlist behavior** :
@@ -699,7 +707,7 @@
* Empty array `[]`: Complete lockdown - users cannot add any new marketplaces
* List of sources: Users can only add marketplaces that match exactly
-**All supported source types** : The allowlist supports multiple marketplace source types. Most sources use exact matching, while `hostPattern` uses regex matching against the marketplace host.
+**All supported source types** : The allowlist supports multiple marketplace source types. Most sources use exact matching, while `hostPattern` and `pathPattern` use regex matching against the marketplace host and filesystem path respectively.
1. **GitHub repositories** :
@@ -759,7 +767,12 @@
* `url`: extracts hostname from the URL
* `npm`, `file`, `directory`: not supported for host pattern matching
-**Configuration examples** : Example: allow specific marketplaces only:
+ 8. **Path pattern matching** :
+
+ { "source": "pathPattern", "pathPattern": "^/opt/approved/" }
+ { "source": "pathPattern", "pathPattern": ".*" }
+
+Fields: `pathPattern` (required: regex pattern matched against the `path` field of `file` and `directory` sources) Use path pattern matching to allow filesystem-based marketplaces alongside `hostPattern` restrictions for network sources. Set `".*"` to allow all local paths, or a narrower pattern to restrict to specific directories. **Configuration examples** : Example: allow specific marketplaces only:
{
"strictKnownMarketplaces": [
--- a/skills.md
+++ b/skills.md
@@ -169,7 +169,7 @@
2. Build the application
3. Push to the deployment target
-Your `SKILL.md` can contain anything, but thinking through how you want the skill invoked (by you, by Claude, or both) and where you want it to run (inline or in a subagent) helps guide what to include. For complex skills, you can also add supporting files to keep the main skill focused.
+Your `SKILL.md` can contain anything, but thinking through how you want the skill invoked (by you, by Claude, or both) and where you want it to run (inline or in a subagent) helps guide what to include. For complex skills, you can also add supporting files to keep the main skill focused. Keep the body itself concise. Once a skill loads, its content stays in context across turns, so every line is a recurring token cost. State what to do rather than narrating how or why, and apply the same conciseness test you would for [CLAUDE.md content](</docs/en/best-practices#write-an-effective-claude-md>).
###
--- a/statusline.md
+++ b/statusline.md
@@ -128,7 +128,7 @@
How status lines work
-Claude Code runs your script and pipes JSON session data to it via stdin. Your script reads the JSON, extracts what it needs, and prints text to stdout. Claude Code displays whatever your script prints. **When it updates** Your script runs after each new assistant message, when the permission mode changes, or when vim mode toggles. Updates are debounced at 300ms, meaning rapid changes batch together and your script runs once things settle. If a new update triggers while your script is still running, the in-flight execution is cancelled. If you edit your script, the changes won’t appear until your next interaction with Claude Code triggers an update. These triggers can go quiet when the main session is idle, for example while a coordinator waits on background subagents. To keep time-based or externally-sourced segments current during idle periods, set `refreshInterval` to also re-run the command on a fixed timer. **What your script can output**
+Claude Code runs your script and pipes JSON session data to it via stdin. Your script reads the JSON, extracts what it needs, and prints text to stdout. Claude Code displays whatever your script prints. **When it updates** Your script runs after each new assistant message, after `/compact` finishes, when the permission mode changes, or when vim mode toggles. Updates are debounced at 300ms, meaning rapid changes batch together and your script runs once things settle. If a new update triggers while your script is still running, the in-flight execution is cancelled. If you edit your script, the changes won’t appear until your next interaction with Claude Code triggers an update. These triggers can go quiet when the main session is idle, for example while a coordinator waits on background subagents. To keep time-based or externally-sourced segments current during idle periods, set `refreshInterval` to also re-run the command on a fixed timer. **What your script can output**
* **Multiple lines** : each `echo` or `print` statement displays as a separate row. See the multi-line example.
* **Colors** : use [ANSI escape codes](<https://en.wikipedia.org/wiki/ANSI_escape_code#Colors>) like `\033[32m` for green (terminal must support them). See the git status example.
@@ -265,7 +265,7 @@
**Fields that may be`null`**:
- * `context_window.current_usage`: `null` before the first API call in a session
+ * `context_window.current_usage`: `null` before the first API call in a session, and again after `/compact` until the next API call repopulates it
* `context_window.used_percentage`, `context_window.remaining_percentage`: may be `null` early in the session
Handle missing fields with conditional access and null values with fallback defaults in your scripts.
@@ -288,7 +288,7 @@
* `cache_creation_input_tokens`: tokens written to cache
* `cache_read_input_tokens`: tokens read from cache
-The `used_percentage` field is calculated from input tokens only: `input_tokens + cache_creation_input_tokens + cache_read_input_tokens`. It does not include `output_tokens`. If you calculate context percentage manually from `current_usage`, use the same input-only formula to match `used_percentage`. The `current_usage` object is `null` before the first API call in a session.
+The `used_percentage` field is calculated from input tokens only: `input_tokens + cache_creation_input_tokens + cache_read_input_tokens`. It does not include `output_tokens`. If you calculate context percentage manually from `current_usage`, use the same input-only formula to match `used_percentage`. The `current_usage` object is `null` before the first API call in a session, and again immediately after `/compact` until the next API call repopulates it.
##
--- a/subagents.md
+++ b/subagents.md
@@ -14,7 +14,7 @@
You can create subagents in three ways:
- * **Programmatically** : use the `agents` parameter in your `query()` options ([TypeScript](</docs/en/agent-sdk/typescript#agent-definition>), [Python](</docs/en/agent-sdk/python#agent-definition>))
+ * **Programmatically** : use the `agents` parameter in your `query()` options ([TypeScript](</docs/en/agent-sdk/typescript#agentdefinition>), [Python](</docs/en/agent-sdk/python#agentdefinition>))
* **Filesystem-based** : define agents as markdown files in `.claude/agents/` directories (see [defining subagents as files](</docs/en/sub-agents>))
* **Built-in general-purpose** : Claude can invoke the built-in `general-purpose` subagent at any time via the Agent tool without you defining anything
@@ -145,7 +145,7 @@
`effort`| `'low' | 'medium' | 'high' | 'xhigh' | 'max' | number`| No| Reasoning effort level for this agent
`permissionMode`| `PermissionMode`| No| Permission mode for tool execution within this agent
-In the Python SDK, these field names use camelCase to match the wire format. See the [`AgentDefinition` reference](</docs/en/agent-sdk/python#agent-definition>) for details.
+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.
--- a/tools-reference.md
+++ b/tools-reference.md
@@ -29,6 +29,7 @@
`Read`| Reads the contents of files| No
`ReadMcpResourceTool`| Reads a specific MCP resource by URI| No
`SendMessage`| Sends a message to an [agent team](</docs/en/agent-teams>) teammate, or [resumes a subagent](</docs/en/sub-agents#resume-subagents>) by its agent ID. Stopped subagents auto-resume in the background. Only available when `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set| No
+`ShareOnboardingGuide`| Uploads `ONBOARDING.md` and returns a share link teammates can open in Claude Code. Called from `/team-onboarding` after the guide is written. Available to claude.ai subscribers on Pro, Max, Team, and Enterprise plans| Yes
`Skill`| Executes a [skill](</docs/en/skills#control-who-invokes-a-skill>) within the main conversation| Yes
`TaskCreate`| Creates a new task in the task list| No
`TaskGet`| Retrieves full details for a specific task| No
--- a/typescript.md
+++ b/typescript.md
@@ -407,7 +407,7 @@
`abortController`| `AbortController`| `new AbortController()`| Controller for cancelling operations
`additionalDirectories`| `string[]`| `[]`| Additional directories Claude can access
`agent`| `string`| `undefined`| Agent name for the main thread. The agent must be defined in the `agents` option or in settings
-`agents`| `Record<string, [`AgentDefinition`](#agent-definition)>`| `undefined`| Programmatically define subagents
+`agents`| `Record<string, [`AgentDefinition`](#agentdefinition)>`| `undefined`| Programmatically define subagents
`allowDangerouslySkipPermissions`| `boolean`| `false`| Enable bypassing permissions. Required when using `permissionMode: 'bypassPermissions'`
`allowedTools`| `string[]`| `[]`| Tools to auto-approve without prompting. This does not restrict Claude to only these tools; unlisted tools fall through to `permissionMode` and `canUseTool`. Use `disallowedTools` to block tools. See [Permissions](</docs/en/agent-sdk/permissions#allow-and-deny-rules>)
`betas`| `SdkBeta``[]`| `[]`| Enable beta features
@@ -430,7 +430,7 @@
`maxBudgetUsd`| `number`| `undefined`| Stop the query when the client-side cost estimate reaches this USD value. Compared against the same estimate as `total_cost_usd`; see [Track cost and usage](</docs/en/agent-sdk/cost-tracking>) for accuracy caveats
`maxThinkingTokens`| `number`| `undefined`| _Deprecated:_ Use `thinking` instead. Maximum tokens for thinking process
`maxTurns`| `number`| `undefined`| Maximum agentic turns (tool-use round trips)
-`mcpServers`| `Record<string, [`McpServerConfig`](#mcp-server-config)>`| `{}`| MCP server configurations
+`mcpServers`| `Record<string, [`McpServerConfig`](#mcpserverconfig)>`| `{}`| MCP server configurations
`model`| `string`| Default from CLI| Claude model to use
`outputFormat`| `{ type: 'json_schema', schema: JSONSchema }`| `undefined`| Define output format for agent results. See [Structured outputs](</docs/en/agent-sdk/structured-outputs>) for details
`pathToClaudeCodeExecutable`| `string`| Auto-resolved from bundled native binary| Path to Claude Code executable. Only needed if optional dependencies were skipped during install or your platform isn’t in the supported set
@@ -443,7 +443,7 @@
`resumeSessionAt`| `string`| `undefined`| Resume session at a specific message UUID
`sandbox`| `SandboxSettings`| `undefined`| Configure sandbox behavior programmatically. See Sandbox settings for details
`sessionId`| `string`| Auto-generated| Use a specific UUID for the session instead of auto-generating one
-`sessionStore`| [`SessionStore`](</docs/en/agent-sdk/session-storage#the-session-store-interface>)| `undefined`| Mirror session transcripts to an external backend so any host can resume them. See [Persist sessions to external storage](</docs/en/agent-sdk/session-storage>)
+`sessionStore`| [`SessionStore`](</docs/en/agent-sdk/session-storage#the-sessionstore-interface>)| `undefined`| Mirror session transcripts to an external backend so any host can resume them. See [Persist sessions to external storage](</docs/en/agent-sdk/session-storage>)
`settingSources`| `SettingSource``[]`| CLI defaults (all sources)| Control which filesystem settings to load. Pass `[]` to disable user, project, and local settings. Managed policy settings load regardless. See [Use Claude Code features](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>)
`spawnClaudeCodeProcess`| `(options: SpawnOptions) => SpawnedProcess`| `undefined`| Custom function to spawn the Claude Code process. Use to run Claude Code in VMs, containers, or remote environments
`stderr`| `(data: string) => void`| `undefined`| Callback for stderr output
@@ -733,7 +733,7 @@
| "default" // Standard permission behavior
| "acceptEdits" // Auto-accept file edits
| "bypassPermissions" // Bypass all permission checks
- | "plan" // Planning mode - no execution
+ | "plan" // Planning mode - read-only tools only
| "dontAsk" // Don't prompt for permissions, deny if not pre-approved
| "auto"; // Use a model classifier to approve or deny each tool call
@@ -761,7 +761,7 @@
Option| Type| Description
---|---|---
`signal`| `AbortSignal`| Signaled if the operation should be aborted
-`suggestions`| `PermissionUpdate``[]`| Suggested permission updates so the user is not prompted again for this tool
+`suggestions`| `PermissionUpdate``[]`| Suggested permission updates so the user is not prompted again for this tool. Bash prompts include a suggestion with the `localSettings` destination, so returning it in `updatedPermissions` writes the rule to `.claude/settings.local.json` and persists across sessions.
`blockedPath`| `string`| The file path that triggered the permission request, if applicable
`decisionReason`| `string`| Explains why this permission request was triggered
`toolUseID`| `string`| Unique identifier for this specific tool call within the assistant message
--- a/user-input.md
+++ b/user-input.md
@@ -43,7 +43,7 @@
---|---
`toolName`| The name of the tool Claude wants to use (e.g., `"Bash"`, `"Write"`, `"Edit"`)
`input`| The parameters Claude is passing to the tool. Contents vary by tool.
-`options` (TS) / `context` (Python)| Additional context including optional `suggestions` (proposed `PermissionUpdate` entries to avoid re-prompting) and a cancellation signal. In TypeScript, `signal` is an `AbortSignal`; in Python, the signal field is reserved for future use. See [`ToolPermissionContext`](</docs/en/agent-sdk/python#tool-permission-context>) for Python.
+`options` (TS) / `context` (Python)| Additional context including optional `suggestions` (proposed `PermissionUpdate` entries to avoid re-prompting) and a cancellation signal. In TypeScript, `signal` is an `AbortSignal`; in Python, the signal field is reserved for future use. See [`ToolPermissionContext`](</docs/en/agent-sdk/python#toolpermissioncontext>) for Python.
The `input` object contains tool-specific parameters. Common examples:
@@ -54,7 +54,7 @@
`Edit`| `file_path`, `old_string`, `new_string`
`Read`| `file_path`, `offset`, `limit`
-See the SDK reference for complete input schemas: [Python](</docs/en/agent-sdk/python#tool-input-output-types>) | [TypeScript](</docs/en/agent-sdk/typescript#tool-input-types>). You can display this information to the user so they can decide whether to allow or reject the action, then return the appropriate response. The following example asks Claude to create and delete a test file. When Claude attempts each operation, the callback prints the tool request to the terminal and prompts for y/n approval.
+See the SDK reference for complete input schemas: [Python](</docs/en/agent-sdk/python#tool-input%2Foutput-types>) | [TypeScript](</docs/en/agent-sdk/typescript#tool-input-types>). You can display this information to the user so they can decide whether to allow or reject the action, then return the appropriate response. The following example asks Claude to create and delete a test file. When Claude attempts each operation, the callback prints the tool request to the terminal and prompts for y/n approval.
Python
@@ -595,4 +595,4 @@
* [Configure permissions](</docs/en/agent-sdk/permissions>): set up permission modes and rules
* [Control execution with hooks](</docs/en/agent-sdk/hooks>): run custom code at key points in the agent lifecycle
- * [TypeScript SDK reference](</docs/en/agent-sdk/typescript#can-use-tool>): full canUseTool API documentation
+ * [TypeScript SDK reference](</docs/en/agent-sdk/typescript#canusetool>): full canUseTool API documentation
--- a/voice-dictation.md
+++ b/voice-dictation.md
@@ -147,6 +147,7 @@
* **`Voice mode requires a Claude.ai account`** : you are authenticated with an API key or a third-party provider. Run `/login` to sign in with a Claude.ai account.
* **`Microphone access is denied`** : grant microphone permission to your terminal in system settings. On macOS, go to System Settings → Privacy & Security → Microphone and enable your terminal app, then run `/voice` again. On Windows, go to Settings → Privacy & security → Microphone and turn on microphone access for desktop apps, then run `/voice` again. If your terminal isn’t listed in the macOS settings, see Terminal not listed in macOS Microphone settings.
* **`No audio recording tool found` on Linux**: the native audio module could not load and no fallback is installed. Install SoX with the command shown in the error message, for example `sudo apt-get install sox`.
+ * **`Voice input is failing repeatedly and has been paused`** : voice dictation hit several start-up failures in a row and stopped attempting new sessions until one succeeds. This usually means the microphone or audio stack on this host can’t capture audio, for example a headless server, a remote shell with no audio passthrough, or a denied microphone permission. Confirm a working input device, fix the underlying cause from the entries above, then trigger voice again.
* **Nothing happens when holding`Space` in hold mode**: watch the prompt input while you hold. If spaces keep accumulating, voice dictation is likely off; run `/voice hold` to enable it. If only one or two spaces appear and then nothing, voice dictation is on but hold detection is not triggering. Hold detection requires your terminal to send key-repeat events, so it cannot detect a held key if key-repeat is disabled at the OS level. Switch to tap mode with `/voice tap` to avoid the key-repeat requirement.
* **Tapping`Space` types a space instead of recording in tap mode**: the first tap only starts recording when the prompt input is empty. Clear the input first, or check that you are in tap mode by running `/voice tap`.
* **`No audio detected from microphone`** : recording started but captured silence. Confirm the correct input device is set as the system default and that its input level is not muted or near zero. On Windows, open Settings → System → Sound → Input and select your microphone. On macOS, open System Settings → Sound → Input.
--- a/web-quickstart.md
+++ b/web-quickstart.md
@@ -264,6 +264,18 @@
+New sessions hang or time out during setup
+
+If new sessions stall on the setup script step or fail with a generic container error before the script finishes, the script is likely exceeding the roughly five-minute time budget for building the [environment cache](</docs/en/claude-code-on-the-web#environment-caching>). Heavy steps such as pulling large Docker images, syncing full dependency trees, or downloading model weights often push the total over the limit, especially when they run one after another. To fix this, trim the script so it reliably finishes in under five minutes:
+
+ * Run independent installs in parallel with `&` and a final `wait` instead of running them serially.
+ * Move the largest downloads out of the setup script and into a [SessionStart hook](</docs/en/claude-code-on-the-web#setup-scripts-vs-sessionstart-hooks>) that launches them in the background, so the session becomes usable while they finish.
+ * Remove long retry sleeps from the setup script, since a stalled retry loop counts against the budget.
+
+###
+
+
+
Session keeps running after closing the tab
This is by design. Closing the tab or navigating away doesn’t stop the session. It continues running in the background until Claude finishes the current task, then idles. From the sidebar, you can [archive a session](</docs/en/claude-code-on-the-web#archive-sessions>) to hide it from your list, or [delete it](</docs/en/claude-code-on-the-web#delete-sessions>) to remove it permanently.