Changes on
30 changes detected
--- a/admin-setup.md
+++ b/admin-setup.md
@@ -68,7 +68,7 @@
[Permission lockdown](</docs/en/permissions#managed-only-settings>)| Only managed permission rules apply; disable `--dangerously-skip-permissions`| `allowManagedPermissionRulesOnly`, `permissions.disableBypassPermissionsMode`
[Sandboxing](</docs/en/sandboxing>)| OS-level filesystem and network isolation with domain allowlists| `sandbox.enabled`, `sandbox.network.allowedDomains`
[Managed policy CLAUDE.md](</docs/en/memory#deploy-organization-wide-claude-md>)| Org-wide instructions loaded in every session, cannot be excluded| File at the managed policy path
-[MCP server control](</docs/en/mcp#managed-mcp-configuration>)| Restrict which MCP servers users can add or connect to| `allowedMcpServers`, `deniedMcpServers`, `allowManagedMcpServersOnly`
+[MCP server control](</docs/en/managed-mcp>)| Restrict which MCP servers users can add or connect to, or deploy a fixed set| `allowedMcpServers`, `deniedMcpServers`, `allowManagedMcpServersOnly`, or a deployed `managed-mcp.json` file
[Plugin marketplace control](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>)| Restrict which marketplace sources users can add and install from| `strictKnownMarketplaces`, `blockedMarketplaces`
[Customization lockdown](</docs/en/settings#strictpluginonlycustomization>)| Block skills, agents, hooks, and MCP servers from user and project sources, so they can only come from plugins or managed settings| `strictPluginOnlyCustomization`
[Hook restrictions](</docs/en/settings#hook-configuration>)| Only managed hooks load; restrict HTTP hook URLs| `allowManagedHooksOnly`, `allowedHttpHookUrls`
--- a/agent-view.md
+++ b/agent-view.md
@@ -166,7 +166,7 @@
Agent view groups sessions so the ones that need input are at the top, with `Ready for review` and `Needs input` above `Working` and `Completed`. These group names don’t map one-to-one to the states above: a session moves to `Ready for review` when it has an open pull request, and `Completed` collects finished, failed, and stopped sessions together. Press `Ctrl+S` to group by directory instead. Your choice persists across runs. Within a group:
- * Press `Ctrl+T` to pin a session to the top
+ * Press `Ctrl+T` to pin a session to the top and keep its process running while idle
* Press `Shift+↑` or `Shift+↓` to reorder sessions
* Press `Ctrl+R` to rename a session
* Press `Enter` on a group header to collapse it
@@ -405,7 +405,7 @@
The supervisor process
-Background sessions are hosted by a per-user supervisor process, separate from your terminal and from agent view. The supervisor starts automatically the first time you background a session or open agent view, and you don’t manage it directly. The supervisor and its sessions authenticate with the same credentials as your interactive sessions and make no additional network connections beyond the model API. Each background session is its own Claude Code process, managed by the supervisor rather than tied to your terminal. A session that’s actively working, waiting for your input, or has a terminal attached keeps its process running. A running background shell command, subagent, workflow, or monitor counts as active work, so a long-running process such as a dev server keeps the session alive. Once a session finishes and sits unattached for about an hour, the supervisor stops its process to free resources. The transcript and state stay on disk, and the next time you attach, peek, or reply, the supervisor starts a fresh process from where it left off. When every session has finished and no terminal is connected, the supervisor itself exits and starts again the next time you need it. The supervisor watches the installed Claude Code binary on disk and restarts into the new version after the regular [auto-updater](</docs/en/setup#auto-updates>) replaces it. This is a local file watch, not a network check. Background sessions are detached processes, so they keep running through the restart and the new supervisor reconnects to them.
+Background sessions are hosted by a per-user supervisor process, separate from your terminal and from agent view. The supervisor starts automatically the first time you background a session or open agent view, and you don’t manage it directly. The supervisor and its sessions authenticate with the same credentials as your interactive sessions and make no additional network connections beyond the model API. Each background session is its own Claude Code process, managed by the supervisor rather than tied to your terminal. A session that’s actively working, waiting for your input, or has a terminal attached keeps its process running. A running background shell command, subagent, workflow, or monitor counts as active work, so a long-running process such as a dev server keeps the session alive. Once a session finishes and sits unattached for about an hour, the supervisor stops its process to free resources. A session you have pinned with `Ctrl+T` is exempt and keeps its process running while idle. The transcript and state stay on disk either way, and the next time you attach, peek, or reply to a stopped session, the supervisor starts a fresh process from where it left off. When every session has finished and no terminal is connected, the supervisor itself exits and starts again the next time you need it. When the host runs low on memory, the supervisor stops idle non-pinned sessions first and stops idle pinned ones only if that freed nothing. The supervisor watches the installed Claude Code binary on disk and restarts into the new version after the regular [auto-updater](</docs/en/setup#auto-updates>) replaces it. This is a local file watch, not a network check. Background sessions are detached processes, so they keep running through the restart and the new supervisor reconnects to them. An idle pinned session is also restarted in place onto the new version so it picks up the update without you reattaching.
###
@@ -483,7 +483,7 @@
A session is slow to respond after attaching
-Once a session has finished and sat unattached for about an hour, the supervisor stops its process to free resources. Attaching starts a fresh process from where it left off, which takes a moment. Sessions that are working or waiting on you are never stopped this way.
+Once a session has finished and sat unattached for about an hour, the supervisor stops its process to free resources. Attaching starts a fresh process from where it left off, which takes a moment. Sessions that are working, waiting on you, or pinned are not stopped this way, so pin a session with `Ctrl+T` to keep it responsive.
###
--- a/auto-mode-config.md
+++ b/auto-mode-config.md
@@ -6,7 +6,7 @@
[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without permission prompts by routing each tool call through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations.
-Auto mode is available on Max, Team, Enterprise, and API plans through the Anthropic API. It is not available on Pro or on Bedrock, Vertex, or Foundry. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and admin enablement on Team and Enterprise plans.
+Auto mode is available to all users on the Anthropic API. It is not available on Bedrock, Vertex, or Foundry. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and admin enablement on Team and Enterprise plans.
Out of the box, the classifier trusts only the working directory and the current repo’s configured remotes. Actions like pushing to your company’s source-control org or writing to a team cloud bucket are blocked until you add them to `autoMode.environment`. For how to enable auto mode and what it blocks by default, see [Permission modes](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to:
@@ -121,7 +121,7 @@
}
}
-Setting any of `environment`, `allow`, `soft_deny`, or `hard_deny` without `"$defaults"` replaces the entire default list for that section. A `soft_deny` array without `"$defaults"` discards every built-in soft block rule, including force push, `curl | bash`, and production deploys. A `hard_deny` array without `"$defaults"` discards the built-in data exfiltration and safety-check bypass rules.
+Setting any of `environment`, `allow`, `soft_deny`, or `hard_deny` without `"$defaults"` replaces the entire default list for that section. A `soft_deny` array without `"$defaults"` discards every built-in soft block rule, including force push, `curl | bash`, and production deploys. A `hard_deny` array without `"$defaults"` discards the built-in data exfiltration and auto-mode bypass rules.
Each section is evaluated independently, so setting `environment` alone leaves the default `allow`, `soft_deny`, and `hard_deny` lists intact. Only omit `"$defaults"` when you intend to take full ownership of the list. To do that safely, run `claude auto-mode defaults` to print the built-in rules, copy them into your settings file, then review each rule against your own pipeline and risk tolerance.
--- a/changelog.md
+++ b/changelog.md
@@ -8,26 +8,51 @@
-2.1.146
+2.1.148
+
+May 22, 2026
+
+ * Fixed the Bash tool returning exit code 127 on every command for some users (a regression introduced in 2.1.147)
+
+
+
+2.1.147
May 21, 2026
- * Renamed `/simplify` to `/code-review` with an optional effort level (e.g. `/code-review high`)
- * Auto mode no longer suppresses `AskUserQuestion` when the user or a skill explicitly relies on it
- * Fixed Windows PowerShell tool failing with “command line is invalid” when `pwsh` is installed via winget or the Microsoft Store (regression in v2.1.124)
- * Fixed MCP `resources/list`, `resources/templates/list`, and `prompts/list` dropping items past page 1 on paginating servers
+ * Pinned background sessions (`Ctrl+T` in `claude agents`) now stay alive when idle, are restarted in place to apply Claude Code updates, and are shed under memory pressure only after non-pinned sessions
+ * Renamed `/simplify` to `/code-review`. It now reports correctness bugs at a chosen effort level (e.g., `/code-review high`); pass `--comment` to post findings as inline GitHub PR comments. The old cleanup-and-fix behavior has been removed
+ * Improved auto-updater: retries transient network failures, reports specific error categories and OS error codes on failure, and shows the current version when an update fails
+ * Improved diff rendering performance for large file edits
+ * Prompt history no longer records consecutive duplicate entries — recalling a prompt with arrow-up and submitting it again won’t add another copy
+ * Fixed enterprise login restrictions (`forceLoginOrgUUID` and `forceLoginMethod` managed-settings) not being enforced against third-party-provider and API-key sessions
+ * Fixed `&` in `!` command output displaying as `&`, which broke copy-pasting URLs from commands like `gcloud auth login` on headless machines
+ * Fixed unknown slash commands silently doing nothing in headless/SDK mode — they now show an error message
+ * Fixed `/help` rendering a broken tab header and showing only one command per page on small terminals when not in fullscreen mode
+ * Fixed shell snapshot dropping user functions whose names start with a single underscore, which broke aliases referencing them
+ * Fixed plugin agents that declare multiple `Agent(...)` types in `tools:` frontmatter dropping all but the last entry
+ * Fixed hook `if` conditions like `PowerShell(git push*)` never matching — only `PowerShell(*)` worked
+ * Fixed PowerShell tool dropping output for commands that rely on the default formatter
+ * Fixed: on Windows, “Yes, and don’t ask again” for a PowerShell script invocation now writes a rule that actually matches on subsequent runs
+ * Fixed PowerShell tool failing on Windows with exit code 1 when `pwsh` is installed via winget or the Microsoft Store
+ * Fixed `/effort` opening with the slider on the wrong level — it now starts at your current effort
+ * Fixed paginating MCP servers dropping resources, templates, and prompts past page 1
* Fixed full-screen strobing in attached background sessions on Windows Terminal while Claude is streaming
- * Fixed the auto-updater status line not showing your current version when an update fails
- * Fixed on Windows, removing a background-job worktree no longer follows NTFS junctions into the main repo
+ * Fixed: on Windows, removing a background-job worktree no longer follows NTFS junctions into the main repo
* Fixed `/background` refusing sessions whose only typed input was a skill or custom slash command
+ * Fixed auto mode suppressing `AskUserQuestion` when the user or a skill explicitly relies on it; the auto-mode classifier now sees the user’s answers as intent signal
+ * Fixed `/theme` “New custom theme” and color editor dialogs not responding to Esc
+ * Fixed an uncaught exception at the end of streaming sessions when running via the Agent SDK
+ * Fixed a rare hang when waiting for scroll to settle on Windows
+ * Fixed stale and doubled rows in the agent view list on Windows when background session results contain wide (CJK) characters
+ * Fixed pasted text being delivered to agents as an unreadable `[Pasted text #N]` placeholder instead of the actual content
+ * Fixed plugin component counts in `claude plugin details` and `/plugin` being doubled when a plugin’s manifest listed paths overlapping its default directories
* Fixed backgrounded sessions re-prompting for tool permissions you already granted with “don’t ask again”
- * Fixed `/theme` color editor and “New custom theme” dialogs not responding to Esc
- * Fixed an uncaught exception at the end of streaming sessions when running via the Agent SDK
- * Fixed `forceLoginOrgUUID` and `forceLoginMethod` managed-settings policies not being enforced against third-party-provider and API-key sessions
* Fixed GNOME Terminal right-click and middle-click paste not inserting text
- * Fixed `CLAUDE_CODE_SUBAGENT_MODEL` not being forwarded to child processes in multi-agent sessions
- * Improved auto-updater reliability: native version checks and downloads now retry transient network failures instead of failing immediately
- * Improved diff rendering performance for large file edits
+ * Fixed `CLAUDE_CODE_SUBAGENT_MODEL` not applying to teammate processes spawned by agent teams
+ * Fixed slash commands followed by a tab or newline being treated as an unknown command
+ * Fixed several spacing and layout glitches in the `/plugin`, `/status`, `/mobile`, `/sandbox`, and `/permissions` menus
+ * Fixed stripped images prompting the model to repeatedly re-read media that was no longer present
--- a/commands.md
+++ b/commands.md
@@ -12,7 +12,7 @@
Commands across a typical workflow
-Most commands are useful at a specific point in a session, from setting up a project to shipping a change. **First session in a repo.** Run `/init` to generate a starter `CLAUDE.md`, then `/memory` to refine it. Use `/mcp` and `/agents` to set up any servers or subagents the project needs, and `/permissions` to set the approval rules you want. **During a task.** `/plan` switches into plan mode before a large change. `/model` and `/effort` adjust how much reasoning you’re spending. When the conversation gets long, `/context` shows where the window is going and `/compact` summarizes it down; use `/btw` for a quick aside that shouldn’t bloat history. **Running work in parallel.** `/agents` opens the manager for the [subagents](</docs/en/sub-agents>) Claude can delegate side tasks to, and `/tasks` lists what’s running in the background of the current session. `/background` detaches the whole session to keep running as a [background agent](</docs/en/agent-view>) and frees your terminal. For a large change that spans the codebase, `/batch` decomposes it into independent units and runs each in its own [worktree](</docs/en/worktrees>). See [Run agents in parallel](</docs/en/agents>) for how these approaches relate. **Before you ship.** `/diff` shows what changed, `/simplify` reviews recent files and applies quality and efficiency fixes, and `/review` or `/security-review` give a deeper read-only pass. **Between sessions.** `/clear` starts fresh on a new task while keeping project memory. `/resume` and `/branch` let you return to or fork an earlier conversation. `/teleport` pulls a web session into this terminal, and `/remote-control` lets you continue this local session from another device. **When something is wrong.** `/rewind` rolls code and conversation back to a checkpoint, or summarizes part of the conversation. `/doctor` and `/debug` diagnose install and runtime issues, and `/feedback` reports a bug with session context attached.
+Most commands are useful at a specific point in a session, from setting up a project to shipping a change. **First session in a repo.** Run `/init` to generate a starter `CLAUDE.md`, then `/memory` to refine it. Use `/mcp` and `/agents` to set up any servers or subagents the project needs, and `/permissions` to set the approval rules you want. **During a task.** `/plan` switches into plan mode before a large change. `/model` and `/effort` adjust how much reasoning you’re spending. When the conversation gets long, `/context` shows where the window is going and `/compact` summarizes it down; use `/btw` for a quick aside that shouldn’t bloat history. **Running work in parallel.** `/agents` opens the manager for the [subagents](</docs/en/sub-agents>) Claude can delegate side tasks to, and `/tasks` lists what’s running in the background of the current session. `/background` detaches the whole session to keep running as a [background agent](</docs/en/agent-view>) and frees your terminal. For a large change that spans the codebase, `/batch` decomposes it into independent units and runs each in its own [worktree](</docs/en/worktrees>). See [Run agents in parallel](</docs/en/agents>) for how these approaches relate. **Before you ship.** `/diff` shows what changed, `/code-review` checks the diff for correctness bugs, and `/review` or `/security-review` give a deeper read-only pass. **Between sessions.** `/clear` starts fresh on a new task while keeping project memory. `/resume` and `/branch` let you return to or fork an earlier conversation. `/teleport` pulls a web session into this terminal, and `/remote-control` lets you continue this local session from another device. **When something is wrong.** `/rewind` rolls code and conversation back to a checkpoint, or summarizes part of the conversation. `/doctor` and `/debug` diagnose install and runtime issues, and `/feedback` reports a bug with session context attached.
##
@@ -36,6 +36,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 [name]`| Start a new conversation with empty context. The previous conversation stays available in `/resume`. Pass a name to label the previous conversation in the `/resume` picker. To free up context while continuing the same conversation, use `/compact` instead. Aliases: `/reset`, `/new`
+`/code-review [low|medium|high|xhigh|max] [--comment] [target]`| **[Skill](</docs/en/skills#bundled-skills>).** Review the current diff for correctness bugs and report findings without editing files. Lower [effort levels](</docs/en/model-config#adjust-effort-level>) return fewer, higher-confidence findings, while `high` through `max` give broader coverage and may include uncertain findings. Without an effort argument, the review uses the session’s current effort. Pass `--comment` to post findings as inline comments on the current GitHub PR. Pass a path or PR reference to review a specific target. Formerly `/simplify`, which still works as an alias
`/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`
@@ -95,7 +96,6 @@
`/security-review`| Analyze pending changes on the current branch for security vulnerabilities. Reviews the git diff and identifies risks like injection, auth issues, and data exposure
`/setup-bedrock`| Configure [Amazon Bedrock](</docs/en/amazon-bedrock>) authentication, region, and model pins through an interactive wizard. Only visible when `CLAUDE_CODE_USE_BEDROCK=1` is set. First-time Bedrock users can also access this wizard from the login screen
`/setup-vertex`| Configure [Google Vertex AI](</docs/en/google-vertex-ai>) authentication, project, region, and model pins through an interactive wizard. Only visible when `CLAUDE_CODE_USE_VERTEX=1` is set. First-time Vertex AI users can also access this wizard from the login screen
-`/simplify [focus]`| **[Skill](</docs/en/skills#bundled-skills>).** Review your recently changed files for code reuse, quality, and efficiency issues, then fix them. Spawns three review agents in parallel, aggregates their findings, and applies fixes. Pass text to focus on specific concerns: `/simplify focus on memory efficiency`
`/skills`| List available [skills](</docs/en/skills>). Press `t` to sort by token count. Press `Space` to [hide a skill from Claude or the `/` menu](</docs/en/skills#override-skill-visibility-from-settings>), then `Enter` to save
`/stats`| Alias for `/usage`. Opens on the Stats tab
`/status`| Open the Settings interface (Status tab) showing version, model, account, and connectivity. Works while Claude is responding, without waiting for the current response to finish
--- a/desktop.md
+++ b/desktop.md
@@ -84,7 +84,7 @@
**Auto**| `auto`| Claude executes all actions with background safety checks that verify alignment with your request. Reduces permission prompts while maintaining oversight. Enable in your Settings → Claude Code. See availability requirements below.
**Bypass permissions**| `bypassPermissions`| Claude runs without any permission prompts, equivalent to `--dangerously-skip-permissions` in the CLI. Enable in your Settings → Claude Code under “Allow bypass permissions mode”. Only use this in sandboxed containers or VMs. Enterprise admins can disable this option.
-The `dontAsk` permission mode is available only in the [CLI](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>). Auto mode is a research preview available on Max, Team, Enterprise, and API plans. It is not available on Pro plans or third-party providers. On Team, Enterprise, and API plans it requires Claude Sonnet 4.6, Opus 4.6, or Opus 4.7. On Max plans it requires Claude Opus 4.7.
+The `dontAsk` permission mode is available only in the [CLI](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>). Auto mode is a research preview available to all users on the Anthropic API. It is not available on third-party providers. It requires Claude Sonnet 4.6, Opus 4.6, or Opus 4.7.
Start complex tasks in Plan mode so Claude maps out an approach before making changes. Once you approve the plan, switch to Auto accept edits or Ask permissions to execute it. See [explore first, then plan, then code](</docs/en/best-practices#explore-first-then-plan-then-code>) for more on this workflow.
--- a/devcontainer.md
+++ b/devcontainer.md
@@ -175,5 +175,6 @@
* [Network access requirements](</docs/en/network-config#network-access-requirements>): the full domain allowlist for proxies and firewalls
* [Telemetry services and opt-out](</docs/en/data-usage#telemetry-services>): what Claude Code sends by default and the environment variables that disable it
* [Explore the `.claude` directory](</docs/en/claude-directory>): what the volume mount holds, including credentials, settings, and session history
+ * [Sandbox environments](</docs/en/sandbox-environments>): compare dev containers with the built-in Bash sandbox, custom containers, and VMs
* [Security model](</docs/en/security>): how Claude Code’s permission system, sandboxing, and prompt-injection protections fit together
* [Permission modes](</docs/en/permission-modes>): the full range from plan mode to auto mode to bypass, and when to use each
--- a/env-vars.md
+++ b/env-vars.md
@@ -142,7 +142,7 @@
`CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR`| Return to the original working directory after each Bash or PowerShell command in the main session
`CLAUDE_CODE_ACCESSIBILITY`| Set to `1` to keep the native terminal cursor visible and disable the inverted-text cursor indicator. Allows screen magnifiers like macOS Zoom to track cursor position
`CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD`| Set to `1` to load memory files from directories specified with `--add-dir`. Loads `CLAUDE.md`, `.claude/CLAUDE.md`, `.claude/rules/*.md`, and `CLAUDE.local.md`. By default, additional directories do not load memory files
-`CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT`| Set to `1` to repaint the entire screen on every frame in [fullscreen rendering](</docs/en/fullscreen>) instead of sending incremental updates. Use this if fullscreen mode shows stale or misplaced text fragments. Claude Code enables this automatically for background sessions on Windows
+`CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT`| Set to `1` to repaint the entire screen on every frame in [fullscreen rendering](</docs/en/fullscreen>) instead of sending incremental updates. Use this if fullscreen mode shows stale or misplaced text fragments. Claude Code enables this automatically for background sessions and [agent view](</docs/en/agent-view>) on Windows
`CLAUDE_CODE_API_KEY_HELPER_TTL_MS`| Interval in milliseconds at which credentials should be refreshed (when using [`apiKeyHelper`](</docs/en/settings#available-settings>))
`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
@@ -312,7 +312,7 @@
`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)
`MCP_TIMEOUT`| Timeout in milliseconds for MCP server startup (default: 30000, or 30 seconds)
-`MCP_TOOL_TIMEOUT`| Timeout in milliseconds for MCP tool execution (default: 100000000, about 28 hours)
+`MCP_TOOL_TIMEOUT`| Timeout in milliseconds for MCP tool execution (default: 100000000, about 28 hours). A per-server `timeout` field in `.mcp.json` overrides this for that server. Values below 1000 are floored to one second
`NO_PROXY`| List of domains and IPs to which requests will be directly issued, bypassing proxy
`OTEL_LOG_RAW_API_BODIES`| Emit Anthropic Messages API request and response JSON as `api_request_body` / `api_response_body` log events. Set to `1` for inline bodies truncated at 60 KB, or `file:<dir>` to write untruncated bodies to disk and emit a `body_ref` path instead. Disabled by default; bodies include the entire conversation history. See [Monitoring](</docs/en/monitoring-usage#api-request-body-event>)
`OTEL_LOG_TOOL_CONTENT`| Set to `1` to include tool input and output content in OpenTelemetry span events. Disabled by default to protect sensitive data. See [Monitoring](</docs/en/monitoring-usage>)
--- a/errors.md
+++ b/errors.md
@@ -18,7 +18,7 @@
Message| Section
---|---
-`API Error: 500 ... Internal server error`| Server errors
+`API Error: 500 Internal server error`| Server errors
`API Error: Repeated 529 Overloaded errors`| Server errors
`Request timed out`| Server errors, or Network if the message mentions your internet connection
`<model> is temporarily unavailable, so auto mode cannot determine the safety of...`| Server errors
@@ -42,6 +42,7 @@
`Error during compaction: Conversation too long`| Request errors
`Request too large`| Request errors
`Image was too large`| Request errors
+`Unable to resize image`| Request errors
`PDF too large` / `PDF is password protected`| Request errors
`Extra inputs are not permitted`| Request errors
`There's an issue with the selected model`| Request errors
@@ -71,7 +72,7 @@
Server errors
-These errors come from Anthropic infrastructure rather than your account or request.
+These errors come from the inference provider rather than your account or request. On the Anthropic API that means Anthropic infrastructure. On Bedrock, Vertex AI, Foundry, or a custom gateway it means that provider’s infrastructure.
###
@@ -79,13 +80,13 @@
API Error: 500 Internal server error
-Claude Code shows the raw API response body for any 5xx status. The example below shows a 500 response:
-
- API Error: 500 {"type":"error","error":{"type":"api_error","message":"Internal server error"}} · check status.claude.com
-
-This indicates an unexpected failure inside the API. It is not caused by your prompt, settings, or account. **What to do:**
-
- * Check [status.claude.com](<https://status.claude.com>) for active incidents
+Claude Code shows the status code and the API’s error message for any 5xx response. The example below shows a 500 response on the Anthropic API:
+
+ API Error: 500 Internal server error. This is a server-side issue, usually temporary — try again in a moment. If it persists, check status.claude.com.
+
+The trailing sentence names where to check service health and varies by provider. Bedrock, Vertex AI, and Foundry configurations name that provider’s service status. A custom `ANTHROPIC_BASE_URL` names the gateway host. This indicates an unexpected failure inside the API. It is not caused by your prompt, settings, or account. **What to do:**
+
+ * Check [status.claude.com](<https://status.claude.com>), or the provider status page named in the message, for active incidents
* Wait a minute, then send your message again. Your original message is still in the conversation, so for a long prompt you can type `try again` instead of pasting the whole thing.
* If the error persists with no posted incident, run `/feedback` so Anthropic can investigate with your request details. See Report an error if `/feedback` is unavailable in your environment.
@@ -97,11 +98,11 @@
The API is temporarily at capacity across all users. Claude Code has already retried several times before showing this message:
- API Error: Repeated 529 Overloaded errors · check status.claude.com
-
-A 529 is not your usage limit and does not count against your quota. **What to do:**
-
- * Check [status.claude.com](<https://status.claude.com>) for capacity notices
+ API Error: Repeated 529 Overloaded errors. The API is at capacity — this is usually temporary. Try again in a moment. If it persists, check status.claude.com.
+
+The trailing sentence varies by provider in the same way as the 500 error above. A 529 is not your usage limit and does not count against your quota. **What to do:**
+
+ * Check [status.claude.com](<https://status.claude.com>), or the provider status page named in the message, for capacity notices
* Try again in a few minutes
* Run `/model` and switch to a different model to keep working, since capacity is tracked per model. Claude Code prompts you to do this when one model is under particularly high load, for example `Opus is experiencing high load, please use /model to switch to Sonnet`.
@@ -210,7 +211,7 @@
API Error: Request rejected (429) · this may be a temporary capacity issue. If it persists, check status.claude.com.
-The trailing sentence names where to check service health and varies by provider. Bedrock and Vertex AI configurations name that provider’s service status instead of the Anthropic status page. **What to do:**
+The trailing sentence names where to check service health and varies by provider. Bedrock, Vertex AI, and Foundry configurations name that provider’s service status instead of the Anthropic status page. A custom `ANTHROPIC_BASE_URL` names the gateway host. **What to do:**
* Run `/status` and confirm the active credential is the one you expect. A stray `ANTHROPIC_API_KEY` in your environment can route requests through a low-tier key instead of your subscription.
* Check your provider console for the active limits and request a higher tier if needed
@@ -513,6 +514,24 @@
+Unable to resize image
+
+Claude Code could not downscale an attached image before sending it to the API.
+
+ Unable to resize image — image processing is unavailable and dimensions could not be read from the file header. Please convert the image to PNG, JPEG, GIF, or WebP.
+ Unable to resize image — dimensions exceed the 2000x2000px limit and image processing failed. Please resize the image to reduce its pixel dimensions.
+ Unable to resize image (… raw, … base64). The image exceeds the … API limit and compression failed. Please resize the image manually or use a smaller image.
+ Unable to resize image — could not verify image dimensions are within the 2000x2000px API limit.
+
+Claude Code normally resizes large images automatically. These errors mean the native image processor failed to load or returned an error, so the image could not be resized to fit within API limits. **What to do:**
+
+ * If the message asks you to convert the image, convert it to PNG, JPEG, GIF, or WebP and attach it again. Claude Code can verify dimensions for these formats without the image processor.
+ * If the message reports a dimension or size limit, resize or recompress the image below that limit before attaching.
+
+###
+
+
+
PDF errors
The PDF you attached could not be processed.
--- a/features-overview.md
+++ b/features-overview.md
@@ -243,7 +243,7 @@
Keep CLAUDE.md under 200 lines. Move reference material to skills, which load on-demand.
-Skills are extra capabilities in Claude’s toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Claude Code includes [bundled skills](</docs/en/commands>) like `/simplify`, `/batch`, and `/debug` that work out of the box. You can also create your own. Claude uses skills when appropriate, or you can invoke one directly.**When:** Depends on the skill’s configuration. By default, descriptions load at session start and full content loads when used. For user-only skills (`disable-model-invocation: true`), nothing loads until you invoke them.**What loads:** For model-invocable skills, Claude sees names and descriptions in every request. When you invoke a skill with `/<name>` or Claude loads it automatically, the full content loads into your conversation.**How Claude chooses skills:** Claude matches your task against skill descriptions to decide which are relevant. If descriptions are vague or overlap, Claude may load the wrong skill or miss one that would help. To tell Claude to use a specific skill, invoke it with `/<name>`. Skills with `disable-model-invocation: true` are invisible to Claude until you invoke them.**Context cost:** Low until used. User-only skills have zero cost until invoked.**In subagents:** Skills work differently in subagents. Instead of on-demand loading, skills listed in the subagent’s `skills` field are fully preloaded into its context at launch. Subagents can still discover and invoke unlisted project, user, and plugin skills through the Skill tool.
+Skills are extra capabilities in Claude’s toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Claude Code includes [bundled skills](</docs/en/commands>) like `/code-review`, `/batch`, and `/debug` that work out of the box. You can also create your own. Claude uses skills when appropriate, or you can invoke one directly.**When:** Depends on the skill’s configuration. By default, descriptions load at session start and full content loads when used. For user-only skills (`disable-model-invocation: true`), nothing loads until you invoke them.**What loads:** For model-invocable skills, Claude sees names and descriptions in every request. When you invoke a skill with `/<name>` or Claude loads it automatically, the full content loads into your conversation.**How Claude chooses skills:** Claude matches your task against skill descriptions to decide which are relevant. If descriptions are vague or overlap, Claude may load the wrong skill or miss one that would help. To tell Claude to use a specific skill, invoke it with `/<name>`. Skills with `disable-model-invocation: true` are invisible to Claude until you invoke them.**Context cost:** Low until used. User-only skills have zero cost until invoked.**In subagents:** Skills work differently in subagents. Instead of on-demand loading, skills listed in the subagent’s `skills` field are fully preloaded into its context at launch. Subagents can still discover and invoke unlisted project, user, and plugin skills through the Skill tool.
Use `disable-model-invocation: true` for skills with side effects. This saves context and ensures only you trigger them.
--- a/glossary.md
+++ b/glossary.md
@@ -58,7 +58,7 @@
Auto mode
-A permission mode where a separate classifier model reviews each action in the background instead of showing you approval prompts. The classifier blocks scope escalation, untrusted infrastructure, and prompt injection. It never sees tool results, so injected instructions cannot influence its decisions. Auto mode is a research preview available on Max, Team, Enterprise, and API plans. Learn more: [Eliminate prompts with auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)
+A permission mode where a separate classifier model reviews each action in the background instead of showing you approval prompts. The classifier blocks scope escalation, untrusted infrastructure, and prompt injection. It never sees tool results, so injected instructions cannot influence its decisions. Auto mode is a research preview available to all users on the Anthropic API. Learn more: [Eliminate prompts with auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)
##
@@ -80,7 +80,7 @@
Bundled skills
-Prompt-based playbooks included with Claude Code, such as `/batch`, `/simplify`, `/debug`, and `/loop`. Unlike built-in commands, which execute fixed logic, bundled skills give Claude a detailed prompt and let it orchestrate the work, so they can spawn agents, read files, and adapt to your codebase. Learn more: [Bundled skills](</docs/en/skills#bundled-skills>)
+Prompt-based playbooks included with Claude Code, such as `/batch`, `/code-review`, `/debug`, and `/loop`. Unlike built-in commands, which execute fixed logic, bundled skills give Claude a detailed prompt and let it orchestrate the work, so they can spawn agents, read files, and adapt to your codebase. Learn more: [Bundled skills](</docs/en/skills#bundled-skills>)
##
--- a/interactive-mode.md
+++ b/interactive-mode.md
@@ -266,6 +266,7 @@
* Input history is stored per working directory
* Input history resets when you run `/clear` to start a new session. The previous session’s conversation is preserved and can be resumed.
+ * Submitting the same prompt twice in a row records one history entry, so pressing Up steps to the previous distinct prompt
* Use Up/Down arrows to navigate (see keyboard shortcuts above)
* **Note** : history expansion (`!`) is disabled by default
--- a/keybindings.md
+++ b/keybindings.md
@@ -181,7 +181,7 @@
Action| Default| Description
---|---|---
-`permission:toggleDebug`| Ctrl+D| Toggle permission debug info
+`permission:toggleDebug`| (unbound)| Toggle permission debug info. The previous default of Ctrl+D was removed in v2.1.146 because it shadowed `app:exit`
###
Show diff (361 lines)
--- a/managed-mcp.md
+++ b/managed-mcp.md
@@ -0,0 +1,358 @@
+> ## Documentation Index
+>
+> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt>
+>
+> Use this file to discover all available pages before exploring further.
+
+By default, anyone running Claude Code can connect any [MCP server](</docs/en/mcp>) they choose. Anthropic reviews connectors against its [listing criteria](<https://claude.com/docs/connectors/building/review-criteria>) before adding them to the [Anthropic Directory](<https://claude.ai/directory>), but doesn’t security-audit or manage any MCP server. As an administrator, you can restrict which servers run in your organization, from deploying a fixed approved set to disabling MCP entirely. This page covers how to:
+
+ * Choose a pattern that matches how much control you need
+ * Deploy a fixed server set with `managed-mcp.json`, including how to disable MCP entirely
+ * Control servers with allowlists and denylists
+ * Tell users what to expect when a restriction blocks a server
+ * Monitor which servers your organization actually uses
+
+The [Security](</docs/en/security>) page covers the MCP threat model and how to evaluate a server before approving it. [Decide what to enforce](</docs/en/admin-setup#decide-what-to-enforce>) covers MCP restrictions alongside the other administrative controls.
+
+##
+
+
+
+Choose a pattern
+
+Claude Code supports a range of restriction levels. Each pattern uses one or both of the mechanisms covered below: `managed-mcp.json` for deploying a fixed set, and `allowedMcpServers`/`deniedMcpServers` for filtering what users configure.
+
+Pattern| What it does| Configure
+---|---|---
+**Disable MCP**| No servers load anywhere| `managed-mcp.json` with an empty server map
+**Fixed deployment**| Every user gets the same servers and can’t add others| `managed-mcp.json` with the servers you want
+**Approved catalog**| Publish a list of approved servers; users add the ones they want, anything else is blocked| `allowedMcpServers` \+ `allowManagedMcpServersOnly: true`
+**Plugin servers only**| Servers can only come from plugins; users can’t add their own| [`strictPluginOnlyCustomization`](</docs/en/settings#strictpluginonlycustomization>) with `mcp` in the list
+**Soft allowlist**| Enforce an allowlist that users can broaden in their own settings| `allowedMcpServers` without `allowManagedMcpServersOnly`
+**Denylist only**| Block known-bad servers, allow everything else| `deniedMcpServers`
+**No restrictions**| Users add anything| Don’t deploy any managed MCP configuration
+
+Claude Code doesn’t have a built-in MCP server registry that users can browse and install from. For the approved-catalog pattern, share the approved list and its `claude mcp add` commands somewhere your users will find them, such as an internal wiki, or distribute the servers as plugins through a [managed plugin marketplace](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) so users can browse and install them from `/plugin`.
+
+##
+
+
+
+Exclusive control with managed-mcp.json
+
+If you deploy a `managed-mcp.json` file, Claude Code loads only the servers that file defines. Users cannot add, modify, or use any other MCP servers, including plugin-provided servers and claude.ai connectors. Two other settings can further filter the managed set:
+
+ * `allowedMcpServers` and `deniedMcpServers` apply to managed servers too, so a managed server that doesn’t pass them won’t load.
+ * A user’s own `deniedMcpServers` merges in from their settings, so users can block a managed server for themselves.
+
+See How a server is evaluated for the full order of checks. `managed-mcp.json` is a standalone file, so it cannot be delivered through [server-managed settings](</docs/en/server-managed-settings>). Any process that can write to a system path with administrator privileges can deploy it. At scale, that’s usually through device management tooling, such as Jamf or a configuration profile on macOS, Group Policy or Intune on Windows, or your fleet management of choice on Linux. Claude Code looks for the file at one of these paths:
+
+Platform| Path
+---|---
+macOS| `/Library/Application Support/ClaudeCode/managed-mcp.json`
+Linux and WSL| `/etc/claude-code/managed-mcp.json`
+Windows| `C:\Program Files\ClaudeCode\managed-mcp.json`
+
+The file uses the same format as a project [`.mcp.json`](</docs/en/mcp#project-scope>) file:
+
+ {
+ "mcpServers": {
+ "github": {
+ "type": "http",
+ "url": "https://api.githubcopilot.com/mcp/"
+ },
+ "sentry": {
+ "type": "http",
+ "url": "https://mcp.sentry.dev/mcp"
+ },
+ "company-internal": {
+ "type": "stdio",
+ "command": "/usr/local/bin/company-mcp-server",
+ "args": ["--config", "/etc/company/mcp-config.json"],
+ "env": {
+ "COMPANY_API_URL": "https://internal.example.com"
+ }
+ }
+ }
+ }
+
+###
+
+
+
+Authenticate with per-user credentials
+
+Any user on the machine can read this file, so don’t store API keys or other credentials in `env` blocks. Pass per-user credentials with one of these instead:
+
+ * [`${VAR}` expansion](</docs/en/mcp#environment-variable-expansion-in-mcp-json>) to read secrets from each user’s environment.
+ * [OAuth or per-user headers](</docs/en/mcp#authenticate-with-remote-mcp-servers>) so each user authenticates as themselves.
+ * [`headersHelper`](</docs/en/mcp#use-dynamic-headers-for-custom-authentication>) to generate credentials at connection time.
+
+###
+
+
+
+Validate the configuration
+
+To confirm the file is in effect, run two checks on a managed machine:
+
+ 1. `claude mcp list` shows only the servers in `managed-mcp.json`. If a user’s own servers still appear, the file isn’t being read; check the path and permissions.
+ 2. `claude mcp add --transport http test https://example.com/mcp` fails with `Cannot add MCP server: enterprise MCP configuration is active and has exclusive control over MCP servers`. The URL doesn’t need to be a real server, since the policy check rejects the command before anything is contacted.
+
+###
+
+
+
+Disable MCP entirely
+
+Deploy a `managed-mcp.json` containing an empty server map to block every MCP server:
+
+ {
+ "mcpServers": {}
+ }
+
+Users see no MCP servers in `/mcp`, and `claude mcp add` fails with the enterprise-policy error above. Servers users had previously configured stop loading the next time they start a session, with no warning that policy is the reason.
+
+##
+
+
+
+Policy-based control with allowlists and denylists
+
+Allowlists and denylists filter which configured servers are allowed to load. They aren’t a registry: a server still has to be added by a user, a plugin, or `managed-mcp.json` before the allowlist or denylist applies to it. To deploy servers to users, use `managed-mcp.json`. To make the allowlist authoritative, set `allowedMcpServers` and `allowManagedMcpServersOnly: true` together in a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>), such as server-managed settings or a deployed `managed-settings.json` file. Restrict the allowlist to managed settings only shows the configuration. Without `allowManagedMcpServersOnly`, allowlists from every settings source merge, including a user’s own `~/.claude/settings.json`, so a user can broaden what your allowlist permits. Denylists merge from every source regardless.
+
+`allowManagedMcpServersOnly` is separate from `allowManagedPermissionRulesOnly`, which locks down [permission rules](</docs/en/permissions#managed-settings>) only. Setting that flag does not enforce the MCP allowlist.
+
+###
+
+
+
+Match servers by URL, command, or name
+
+`allowedMcpServers` and `deniedMcpServers` are lists of entries. Each entry is an object with a single key that identifies servers by their URL, their command, or their name:
+
+Key| Matches| Use for
+---|---|---
+`serverUrl`| A remote server URL, exact or with `*` wildcards| HTTP and SSE servers
+`serverCommand`| The exact command and arguments that start a stdio server| Stdio servers
+`serverName`| The user-assigned label. Exact match only; wildcards are not expanded| Either type, but see the Warning below
+
+Leaving `allowedMcpServers` unset is different from setting it to an empty array:
+
+Setting| Unset (default)| Empty array `[]`| Populated
+---|---|---|---
+`allowedMcpServers`| All servers allowed| No servers allowed| Only matching servers allowed
+`deniedMcpServers`| No servers blocked| No servers blocked| Matching servers blocked
+
+An allowlist that uses only `serverName` entries is not a security control. The name is the label a user assigns when running `claude mcp add` or editing a config file, not the underlying server, so a user can call any server `github`. To enforce which servers actually run, add `serverCommand` or `serverUrl` entries.
+
+###
+
+
+
+How a server is evaluated
+
+Before loading a server, including one from `managed-mcp.json`, Claude Code runs three checks in order:
+
+ 1. **Merge the lists.** Allowlist and denylist entries from every settings source combine into one allowlist and one denylist. When `allowManagedMcpServersOnly` is `true`, only the managed allowlist is kept; the denylist always merges from every source.
+ 2. **Check the denylist.** A server that matches any denylist entry, by URL, command, or name, is blocked. Nothing overrides a denylist match.
+ 3. **Check the allowlist.** If `allowedMcpServers` isn’t set anywhere, every server that passed the denylist loads. If it is set, what the server must match depends on its type, shown in the table below.
+
+Server type| Allowed when it matches
+---|---
+Remote (HTTP or SSE)| A `serverUrl` entry. A `serverName` match counts only when the allowlist contains no `serverUrl` entries
+Stdio| A `serverCommand` entry. A `serverName` match counts only when the allowlist contains no `serverCommand` entries
+
+Two matching rules apply inside those checks:
+
+ * **Commands match exactly.** Every argument, in order. `["npx", "-y", "server"]` does not match `["npx", "server"]` or `["npx", "-y", "server", "--flag"]`.
+ * **URLs support`*` wildcards** anywhere in the pattern, including the scheme. Hostname matching is case-insensitive and ignores a trailing FQDN dot, so `https://Mcp.Example.com/*` matches `https://mcp.example.com/api`. Paths stay case-sensitive.
+
+Pattern| Allows
+---|---
+`https://mcp.example.com/*`| All paths on a specific domain
+`https://mcp.example.com`| Also all paths on that domain. A pattern with no path matches any path
+`https://*.example.com/*`| Any subdomain of `example.com`
+`http://localhost:*/*`| Any port on localhost
+`*://mcp.example.com/*`| Any scheme to a specific domain
+
+###
+
+
+
+Example configuration
+
+The configuration below sets up a hard allowlist with a denylist. The highlighted lines change how the rest of the list is evaluated, and the callouts after the block explain each one:
+
+ {
+ "allowedMcpServers": [
+ { "serverUrl": "https://api.githubcopilot.com/*" },
+ { "serverUrl": "https://mcp.sentry.dev/*" },
+ { "serverCommand": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "."] },
+ { "serverCommand": ["python", "/usr/local/bin/approved-server.py"] },
+ { "serverUrl": "https://mcp.example.com/*" },
+ { "serverUrl": "https://*.internal.example.com/*" }
+ ],
+ "deniedMcpServers": [
+ { "serverName": "dangerous-server" },
+ { "serverCommand": ["npx", "-y", "unapproved-package"] },
+ { "serverUrl": "https://*.untrusted.example.com/*" }
+ ]
+ }
+
+ * **Line 3** : the first `serverUrl` entry. Once one exists, every remote server must match a URL pattern, so a user can’t get an unlisted remote server through by giving it an allowed name.
+ * **Line 5** : the first `serverCommand` entry. Same effect for stdio servers, so every local server must match a listed command exactly.
+ * **Line 11** : a `serverName` entry in the denylist. Denylist entries always apply, so any server named `dangerous-server` is blocked regardless of its URL or command.
+
+A `serverName` entry in this allowlist would never match anything, since both transport types already have stricter entries. The accordions below walk through how a server is evaluated against other allowlist and denylist combinations.
+
+URL-only allowlist
+
+ {
+ "allowedMcpServers": [
+ { "serverUrl": "https://mcp.example.com/*" },
+ { "serverUrl": "https://*.internal.example.com/*" }
+ ]
+ }
+
+Server| Result
+---|---
+HTTP server at `https://mcp.example.com/api`| Allowed: matches URL pattern
+HTTP server at `https://api.internal.example.com/mcp`| Allowed: matches wildcard subdomain
+HTTP server at `https://external.example.com/mcp`| Blocked: doesn’t match any URL pattern
+Stdio server with any command| Blocked: no name or command entries to match
+
+Command-only allowlist
+
+ {
+ "allowedMcpServers": [
+ { "serverCommand": ["npx", "-y", "approved-package"] }
+ ]
+ }
+
+Server| Result
+---|---
+Stdio server with `["npx", "-y", "approved-package"]`| Allowed: matches command
+Stdio server with `["node", "server.js"]`| Blocked: doesn’t match command
+HTTP server named `my-api`| Blocked: no name entries to match
+
+Mixed name and command allowlist
+
+ {
+ "allowedMcpServers": [
+ { "serverName": "github" },
+ { "serverCommand": ["npx", "-y", "approved-package"] }
+ ]
+ }
+
+Server| Result
+---|---
+Stdio server named `local-tool` with `["npx", "-y", "approved-package"]`| Allowed: matches command
+Stdio server named `local-tool` with `["node", "server.js"]`| Blocked: command entries exist but doesn’t match
+Stdio server named `github` with `["node", "server.js"]`| Blocked: stdio servers must match commands when command entries exist
+HTTP server named `github`| Allowed: matches name
+HTTP server named `other-api`| Blocked: name doesn’t match
+
+Name-only allowlist
+
+ {
+ "allowedMcpServers": [
+ { "serverName": "github" },
+ { "serverName": "internal-tool" }
+ ]
+ }
+
+Server| Result
+---|---
+Stdio server named `github` with any command| Allowed: no command restrictions
+Stdio server named `internal-tool` with any command| Allowed: no command restrictions
+HTTP server named `github`| Allowed: matches name
+Any server named `other`| Blocked: name doesn’t match
+
+Allowlist with denylist override
+
+ {
+ "allowedMcpServers": [
+ { "serverUrl": "https://*.example.com/*" }
+ ],
+ "deniedMcpServers": [
+ { "serverUrl": "https://staging.example.com/*" }
+ ]
+ }
+
+Server| Result
+---|---
+HTTP server at `https://mcp.example.com/api`| Allowed: matches allowlist URL pattern, no denylist match
+HTTP server at `https://staging.example.com/api`| Blocked: matches both, but the denylist takes precedence
+HTTP server at `https://other.com/mcp`| Blocked: doesn’t match the allowlist
+
+###
+
+
+
+Restrict the allowlist to managed settings only
+
+To make the managed allowlist the only one that applies, set `allowManagedMcpServersOnly` in the managed settings file:
+
+ {
+ "allowManagedMcpServersOnly": true,
+ "allowedMcpServers": [
+ { "serverUrl": "https://api.githubcopilot.com/*" },
+ { "serverUrl": "https://*.internal.example.com/*" }
+ ]
+ }
+
+When `allowManagedMcpServersOnly` is `true`, allowlists from user, project, and local settings are ignored. The denylist still merges from all sources, so users can always block servers for themselves.
+
+##
+
+
+
+How restrictions appear to users
+
+When a restriction blocks a server, the user either sees an error from `claude mcp add` or the server silently stops loading. Use this table to recognize those reports and to tell users what to expect before you roll out a change:
+
+Restriction| What the user sees
+---|---
+`managed-mcp.json` is present and the user runs `claude mcp add`| `Cannot add MCP server: enterprise MCP configuration is active and has exclusive control over MCP servers`
+The server is on a denylist and the user runs `claude mcp add`| `Cannot add MCP server "<name>": server is explicitly blocked by enterprise policy`
+The server isn’t on the allowlist and the user runs `claude mcp add`| `Cannot add MCP server "<name>": not allowed by enterprise policy`
+A previously configured server is now blocked by policy| The server silently disappears from `/mcp` and `claude mcp list` with no warning
+
+In the last case, the user gets no signal that policy is the reason their server disappeared, so tell affected users which servers are blocked when you roll out a new restriction.
+
+##
+
+
+
+Monitor MCP usage
+
+When [OpenTelemetry export](</docs/en/monitoring-usage>) is configured, Claude Code can record which MCP servers and tools users invoke. Set `OTEL_LOG_TOOL_DETAILS=1` to include MCP server and tool names in tool events, then aggregate them in your collector to see which servers your users actually connect to. See [Monitoring](</docs/en/monitoring-usage>) to set up the exporter and for the full event schema.
+
+##
+
+
+
+Configuration summary
+
+Every file and setting this page covers, what it controls, and how to deliver it:
+
+Surface| What it controls| Where it lives| How to deliver
+---|---|---|---
+`managed-mcp.json`| Fixed server set, exclusive control| System path: `/Library/Application Support/ClaudeCode/`, `/etc/claude-code/`, or `C:\Program Files\ClaudeCode\`| MDM, GPO, fleet management, or any process with administrator privileges. Cannot be set through server-managed settings
+`allowedMcpServers`| Allowlist of permitted servers| Any [settings file](</docs/en/settings#settings-files>); entries from every source merge unless `allowManagedMcpServersOnly` is set| For enforcement, a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>): server-managed settings, `managed-settings.json`, MDM profile, or registry
+`deniedMcpServers`| Denylist of blocked servers| Any settings file; entries from every source merge| Same as `allowedMcpServers`
+`allowManagedMcpServersOnly`| Locks the allowlist to managed sources only| Managed settings sources only; the setting has no effect elsewhere| Same as `allowedMcpServers`
+
+##
+
+
+
+Related resources
+
+ * [Decide what to enforce](</docs/en/admin-setup#decide-what-to-enforce>): MCP restrictions alongside permission rules, sandboxing, and the other admin controls
+ * [Connect Claude Code to tools via MCP](</docs/en/mcp>): the full MCP reference, including transports, scopes, and authentication
+ * [Settings](</docs/en/settings>): the settings hierarchy and how managed settings take precedence
+ * [Server-managed settings](</docs/en/server-managed-settings>): deliver `allowedMcpServers` and `deniedMcpServers` from the Claude.ai admin console
+ * [Security](</docs/en/security>): the threat model these controls defend against
+ * [Claude Enterprise Administrator Guide](<https://claude.com/resources/tutorials/claude-enterprise-administrator-guide>): SSO, SCIM, seat management, and rollout playbook
Show diff (258 lines)
--- a/mcp.md
+++ b/mcp.md
@@ -173,8 +173,11 @@
* `user`: Available to you across all projects (was called `global` in older versions)
* Set environment variables with `--env` flags (for example, `--env KEY=value`)
* Configure MCP server startup timeout using the MCP_TIMEOUT environment variable (for example, `MCP_TIMEOUT=10000 claude` sets a 10-second timeout)
+ * Set a per-server tool execution timeout by adding a `timeout` field in milliseconds to that server’s `.mcp.json` entry, for example `"timeout": 600000` for ten minutes. This overrides the `MCP_TOOL_TIMEOUT` environment variable for that server only
* Claude Code will display a warning when MCP tool output exceeds 10,000 tokens. To increase this limit, set the `MAX_MCP_OUTPUT_TOKENS` environment variable (for example, `MAX_MCP_OUTPUT_TOKENS=50000`)
* Use `/mcp` to authenticate with remote servers that require OAuth 2.0 authentication
+
+The per-server `timeout` is a hard wall-clock limit per tool call, and progress notifications from the server do not extend it. Values below 1000 are floored to one second. For HTTP and SSE servers, the per-request fetch first-byte budget has a 60-second minimum regardless of this value, so only the tool-call watchdog honors smaller values.
###
@@ -1017,242 +1020,4 @@
Managed MCP configuration
-For organizations that need centralized control over MCP servers, Claude Code supports two configuration options:
-
- 1. **Exclusive control with`managed-mcp.json`**: Deploy a fixed set of MCP servers that users cannot modify or extend
- 2. **Policy-based control with allowlists/denylists** : Allow users to add their own servers, but restrict which ones are permitted
-
-These options allow IT administrators to:
-
- * **Control which MCP servers employees can access** : Deploy a standardized set of approved MCP servers across the organization
- * **Prevent unauthorized MCP servers** : Restrict users from adding unapproved MCP servers
- * **Disable MCP entirely** : Remove MCP functionality completely if needed
-
-###
-
-
-
-Option 1: Exclusive control with managed-mcp.json
-
-When you deploy a `managed-mcp.json` file, it takes **exclusive control** over all MCP servers. Users cannot add, modify, or use any MCP servers other than those defined in this file. This is the simplest approach for organizations that want complete control. System administrators deploy the configuration file to a system-wide directory:
-
- * macOS: `/Library/Application Support/ClaudeCode/managed-mcp.json`
- * Linux and WSL: `/etc/claude-code/managed-mcp.json`
- * Windows: `C:\Program Files\ClaudeCode\managed-mcp.json`
-
-These are system-wide paths (not user home directories like `~/Library/...`) that require administrator privileges. They are designed to be deployed by IT administrators.
-
-The `managed-mcp.json` file uses the same format as a standard `.mcp.json` file:
-
- {
- "mcpServers": {
- "github": {
- "type": "http",
- "url": "https://api.githubcopilot.com/mcp/"
- },
- "sentry": {
- "type": "http",
- "url": "https://mcp.sentry.dev/mcp"
- },
- "company-internal": {
- "type": "stdio",
- "command": "/usr/local/bin/company-mcp-server",
- "args": ["--config", "/etc/company/mcp-config.json"],
- "env": {
- "COMPANY_API_URL": "https://internal.company.com"
- }
- }
- }
- }
-
-###
-
-
-
-Option 2: Policy-based control with allowlists and denylists
-
-Instead of taking exclusive control, administrators can allow users to configure their own MCP servers while enforcing restrictions on which servers are permitted. This approach uses `allowedMcpServers` and `deniedMcpServers` in the [managed settings file](</docs/en/settings#settings-files>).
-
-**Choosing between options** : Use Option 1 (`managed-mcp.json`) when you want to deploy a fixed set of servers with no user customization. Use Option 2 (allowlists/denylists) when you want to allow users to add their own servers within policy constraints.
-
-####
-
-
-
-Restriction options
-
-Each entry in the allowlist or denylist can restrict servers in three ways:
-
- 1. **By server name** (`serverName`): Matches the configured name of the server
- 2. **By command** (`serverCommand`): Matches the exact command and arguments used to start stdio servers
- 3. **By URL pattern** (`serverUrl`): Matches remote server URLs with wildcard support
-
-**Important** : Each entry must have exactly one of `serverName`, `serverCommand`, or `serverUrl`.
-
-####
-
-
-
-Example configuration
-
- {
- "allowedMcpServers": [
- // Allow by server name
- { "serverName": "github" },
- { "serverName": "sentry" },
-
- // Allow by exact command (for stdio servers)
- { "serverCommand": ["npx", "-y", "@modelcontextprotocol/server-filesystem"] },
- { "serverCommand": ["python", "/usr/local/bin/approved-server.py"] },
-
- // Allow by URL pattern (for remote servers)
- { "serverUrl": "https://mcp.company.com/*" },
- { "serverUrl": "https://*.internal.corp/*" }
- ],
- "deniedMcpServers": [
- // Block by server name
- { "serverName": "dangerous-server" },
-
- // Block by exact command (for stdio servers)
- { "serverCommand": ["npx", "-y", "unapproved-package"] },
-
- // Block by URL pattern (for remote servers)
- { "serverUrl": "https://*.untrusted.com/*" }
- ]
- }
-
-####
-
-
-
-How command-based restrictions work
-
-**Exact matching** :
-
- * Command arrays must match **exactly** \- both the command and all arguments in the correct order
- * Example: `["npx", "-y", "server"]` will NOT match `["npx", "server"]` or `["npx", "-y", "server", "--flag"]`
-
-**Stdio server behavior** :
-
- * When the allowlist contains **any** `serverCommand` entries, stdio servers **must** match one of those commands
- * Stdio servers cannot pass by name alone when command restrictions are present
- * This ensures administrators can enforce which commands are allowed to run
-
-**Non-stdio server behavior** :
-
- * Remote servers (HTTP, SSE, WebSocket) use URL-based matching when `serverUrl` entries exist in the allowlist
- * If no URL entries exist, remote servers fall back to name-based matching
- * Command restrictions do not apply to remote servers
-
-####
-
-
-
-How URL-based restrictions work
-
-URL patterns support wildcards using `*` to match any sequence of characters. This is useful for allowing entire domains or subdomains. **Wildcard examples** :
-
- * `https://mcp.company.com/*` \- Allow all paths on a specific domain
- * `https://*.example.com/*` \- Allow any subdomain of example.com
- * `http://localhost:*/*` \- Allow any port on localhost
-
-Hostname matching is case-insensitive and ignores a trailing FQDN dot, matching DNS semantics. A pattern like `*://Mcp.Example.com/*` matches `https://mcp.example.com/api`, and `https://mcp.example.com.` is treated the same as `https://mcp.example.com`. Paths remain case-sensitive. **Remote server behavior** :
-
- * When the allowlist contains **any** `serverUrl` entries, remote servers **must** match one of those URL patterns
- * Remote servers cannot pass by name alone when URL restrictions are present
- * This ensures administrators can enforce which remote endpoints are allowed
-
-Example: URL-only allowlist
-
- {
- "allowedMcpServers": [
- { "serverUrl": "https://mcp.company.com/*" },
- { "serverUrl": "https://*.internal.corp/*" }
- ]
- }
-
-**Result** :
-
- * HTTP server at `https://mcp.company.com/api`: ✅ Allowed (matches URL pattern)
- * HTTP server at `https://api.internal.corp/mcp`: ✅ Allowed (matches wildcard subdomain)
- * HTTP server at `https://external.com/mcp`: ❌ Blocked (doesn’t match any URL pattern)
- * Stdio server with any command: ❌ Blocked (no name or command entries to match)
-
-Example: Command-only allowlist
-
- {
- "allowedMcpServers": [
- { "serverCommand": ["npx", "-y", "approved-package"] }
- ]
- }
-
-**Result** :
-
- * Stdio server with `["npx", "-y", "approved-package"]`: ✅ Allowed (matches command)
- * Stdio server with `["node", "server.js"]`: ❌ Blocked (doesn’t match command)
- * HTTP server named “my-api”: ❌ Blocked (no name entries to match)
-
-Example: Mixed name and command allowlist
-
- {
- "allowedMcpServers": [
- { "serverName": "github" },
- { "serverCommand": ["npx", "-y", "approved-package"] }
- ]
- }
-
-**Result** :
-
- * Stdio server named “local-tool” with `["npx", "-y", "approved-package"]`: ✅ Allowed (matches command)
- * Stdio server named “local-tool” with `["node", "server.js"]`: ❌ Blocked (command entries exist but doesn’t match)
- * Stdio server named “github” with `["node", "server.js"]`: ❌ Blocked (stdio servers must match commands when command entries exist)
- * HTTP server named “github”: ✅ Allowed (matches name)
- * HTTP server named “other-api”: ❌ Blocked (name doesn’t match)
-
-Example: Name-only allowlist
-
- {
- "allowedMcpServers": [
- { "serverName": "github" },
- { "serverName": "internal-tool" }
- ]
- }
-
-**Result** :
-
- * Stdio server named “github” with any command: ✅ Allowed (no command restrictions)
- * Stdio server named “internal-tool” with any command: ✅ Allowed (no command restrictions)
- * HTTP server named “github”: ✅ Allowed (matches name)
- * Any server named “other”: ❌ Blocked (name doesn’t match)
-
-####
-
-
-
-Allowlist behavior (`allowedMcpServers`)
-
- * `undefined` (default): No restrictions - users can configure any MCP server
- * Empty array `[]`: Complete lockdown - users cannot configure any MCP servers
- * List of entries: Users can only configure servers that match by name, command, or URL pattern
-
-####
-
-
-
-Denylist behavior (`deniedMcpServers`)
-
- * `undefined` (default): No servers are blocked
- * Empty array `[]`: No servers are blocked
- * List of entries: Specified servers are explicitly blocked across all scopes
-
-####
-
-
-
-Important notes
-
- * **Option 1 and Option 2 can be combined** : If `managed-mcp.json` exists, it has exclusive control and users cannot add servers. Allowlists/denylists still apply to the managed servers themselves.
- * **Denylist takes absolute precedence** : If a server matches a denylist entry (by name, command, or URL), it will be blocked even if it’s on the allowlist
- * Name-based, command-based, and URL-based restrictions work together: a server passes if it matches **either** a name entry, a command entry, or a URL pattern (unless blocked by denylist)
-
-**When using`managed-mcp.json`**: Users cannot add MCP servers through `claude mcp add` or configuration files. The `allowedMcpServers` and `deniedMcpServers` settings still apply to filter which managed servers are actually loaded.
+For organizations that need centralized control over which MCP servers users can connect to, see [Managed MCP configuration](</docs/en/managed-mcp>). It covers deploying a fixed server set with `managed-mcp.json`, restricting servers with `allowedMcpServers` and `deniedMcpServers`, and what users see when a server is blocked.
--- a/model-config.md
+++ b/model-config.md
@@ -312,7 +312,7 @@
`ANTHROPIC_DEFAULT_OPUS_MODEL`| The model to use for `opus`, or for `opusplan` when Plan Mode is active.
`ANTHROPIC_DEFAULT_SONNET_MODEL`| The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active.
`ANTHROPIC_DEFAULT_HAIKU_MODEL`| The model to use for `haiku`, or [background functionality](</docs/en/costs#background-token-usage>)
-`CLAUDE_CODE_SUBAGENT_MODEL`| The model to use for all [subagents](</docs/en/sub-agents#choose-a-model>). Overrides both the per-invocation `model` parameter and the subagent definition’s `model` frontmatter
+`CLAUDE_CODE_SUBAGENT_MODEL`| The model to use for all [subagents](</docs/en/sub-agents#choose-a-model>) and [agent teams](</docs/en/agent-teams>). Overrides the per-invocation `model` parameter and the subagent definition’s `model` frontmatter. Set to `inherit` to use normal model resolution instead
Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of `ANTHROPIC_DEFAULT_HAIKU_MODEL`.
--- a/permission-modes.md
+++ b/permission-modes.md
@@ -148,15 +148,15 @@
Auto mode requires Claude Code v2.1.83 or later.
-Auto mode lets Claude execute without permission prompts. A separate classifier model reviews actions before they run, blocking anything that escalates beyond your request, targets unrecognized infrastructure, or appears driven by hostile content Claude read. Auto mode also nudges Claude to keep working without stopping for clarifying questions. For stronger autonomous behavior while keeping permission prompts, set the [Proactive output style](</docs/en/output-styles>) instead.
+Auto mode lets Claude execute without permission prompts. A separate classifier model reviews actions before they run, blocking anything that escalates beyond your request, targets unrecognized infrastructure, or appears driven by hostile content Claude read. Auto mode also nudges Claude to keep working without stopping for clarifying questions, though Claude still asks when your prompt or a skill explicitly relies on it. For stronger autonomous behavior while keeping permission prompts, set the [Proactive output style](</docs/en/output-styles>) instead.
Auto mode is a research preview. It reduces prompts but does not guarantee safety. Use it for tasks where you trust the general direction, not as a replacement for review on sensitive operations.
Auto mode is available only when your account meets all of these requirements:
- * **Plan** : Max, Team, Enterprise, or API. Not available on Pro.
+ * **Plan** : All plans.
* **Admin** : on Team and Enterprise, an admin must enable it in [Claude Code admin settings](<https://claude.ai/admin-settings/claude-code>) before users can turn it on. Admins can also lock it off by setting `permissions.disableAutoMode` to `"disable"` in [managed settings](</docs/en/permissions#managed-settings>).
- * **Model** : Claude Sonnet 4.6, Opus 4.6, or Opus 4.7 on Team, Enterprise, and API plans; Claude Opus 4.7 only on Max plans. Other models, including Haiku and claude-3 models, are not supported.
+ * **Model** : Claude Sonnet 4.6, Opus 4.6, or Opus 4.7. Older models, including Sonnet 4.5, Opus 4.5, Haiku, and claude-3 models, are not supported.
* **Provider** : Anthropic API only. Not available on Bedrock, Vertex, or Foundry.
If Claude Code reports auto mode as unavailable, one of these requirements is unmet; this is not a transient outage. A separate message that names a model and says auto mode “cannot determine the safety” of an action is a transient classifier outage; see the [error reference](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>). If you set `defaultMode: "auto"` in [settings](</docs/en/settings#available-settings>) and the session starts in `default` mode with no error, the setting is likely in `.claude/settings.json` or `.claude/settings.local.json`. Claude Code ignores `auto` from those files so a repository cannot grant itself auto mode. Move it to `~/.claude/settings.json`.
--- a/permissions.md
+++ b/permissions.md
@@ -370,8 +370,8 @@
---|---
`allowedChannelPlugins`| Allowlist of channel plugins that may push messages. Replaces the default Anthropic allowlist when set. Requires `channelsEnabled: true`. See [Restrict which channel plugins can run](</docs/en/channels#restrict-which-channel-plugins-can-run>)
`allowManagedHooksOnly`| When `true`, only managed hooks, SDK hooks, and hooks from plugins force-enabled in managed settings `enabledPlugins` are loaded. User, project, and all other plugin hooks are blocked
-`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
+`allowManagedMcpServersOnly`| When `true`, only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. See [Managed MCP configuration](</docs/en/managed-mcp>)
+`allowManagedPermissionRulesOnly`| When `true`, prevents user and project settings from defining `allow`, `ask`, or `deny` permission rules. Only rules in managed settings apply. Does not affect the MCP server allowlist; for that, set `allowManagedMcpServersOnly`
`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 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>)
--- a/plugin-marketplaces.md
+++ b/plugin-marketplaces.md
@@ -170,7 +170,7 @@
`owner`| object| Marketplace maintainer information (see fields below)|
`plugins`| array| List of available plugins| See below
-**Reserved names** : The following marketplace names are reserved for official Anthropic use and cannot be used by third-party marketplaces: `claude-code-marketplace`, `claude-code-plugins`, `claude-plugins-official`, `anthropic-marketplace`, `anthropic-plugins`, `agent-skills`, `anthropic-agent-skills`, `knowledge-work-plugins`, `life-sciences`. Names that impersonate official marketplaces, such as `official-claude-plugins` or `anthropic-tools-v2`, are also blocked.
+**Reserved names** : The following marketplace names are reserved for official Anthropic use and cannot be used by third-party marketplaces: `claude-code-marketplace`, `claude-code-plugins`, `claude-plugins-official`, `anthropic-marketplace`, `anthropic-plugins`, `agent-skills`, `anthropic-agent-skills`, `knowledge-work-plugins`, `life-sciences`, `claude-for-legal`, `claude-for-financial-services`, `financial-services-plugins`. Names that impersonate official marketplaces, such as `official-claude-plugins` or `anthropic-tools-v2`, are also blocked.
###
Show diff (150 lines)
--- a/sandbox-environments.md
+++ b/sandbox-environments.md
@@ -0,0 +1,147 @@
+> ## Documentation Index
+>
+> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt>
+>
+> Use this file to discover all available pages before exploring further.
+
+Isolating Claude Code limits what a session can read, write, and reach on the network. This matters most when you let Claude work with fewer permission prompts, run it unattended, or point it at code you do not fully trust. Claude Code can run in several kinds of isolated environments, ranging from a lightweight per-command sandbox to a fully separate virtual machine. This page covers how to:
+
+ * Compare the available isolation approaches by what they isolate, what they require, and how much setup is involved
+ * Choose the approach that fits your goal and threat model
+ * Get started with the approach you picked, from the built-in Bash sandbox to a dedicated virtual machine
+ * Enforce isolation for every developer in your organization
+
+For the broader security model, see [Security](</docs/en/security>). For Agent SDK deployments, see [Secure deployment](</docs/en/agent-sdk/secure-deployment>).
+
+##
+
+
+
+Compare sandboxing approaches
+
+The first two approaches in the table below run on the host operating system without containers. The rest place Claude Code inside a container or virtual machine.
+
+Approach| What is isolated| Requires Docker| Setup effort
+---|---|---|---
+Sandboxed Bash tool| Bash commands and their child processes| No| Minimal on macOS; low on Linux and WSL2
+Sandbox runtime| The whole Claude Code process, including file tools, MCP servers, and hooks| No| Low
+Dev container| Full development environment| Yes| Medium
+Custom container| Full development environment| Yes| Medium to high
+Virtual machine| Full operating system| No| High
+Claude Code on the web| Full operating system, hosted by Anthropic| No| None; requires a Claude subscription and GitHub
+
+The [sandboxed Bash tool](</docs/en/sandboxing>) is built into Claude Code and restricts only Bash commands. Built-in file tools, MCP servers, and hooks still run directly on your host. Every other approach in the table puts the whole Claude Code process inside the isolation boundary, so file tools, MCP servers, and hooks are restricted too.
+
+Sandbox isolation reduces the impact of a breach, but it does not eliminate risk. Any approach that allows network egress can still leak data the agent can read, and any approach that mounts your project directory writable can still modify that code. Review the [security limitations](</docs/en/sandboxing#security-limitations>) before relying on a sandbox as a hard control.Isolation also does not change what is sent to the model. Your prompts and the files Claude reads are transmitted to the Anthropic API or your configured provider with or without a sandbox. See [Data usage](</docs/en/data-usage>) for what Claude Code sends and how to reduce it.
+
+##
+
+
+
+Choose an approach
+
+Match your goal to a row below, then read the detail section that follows.
+
+You want to| Start with
+---|---
+Reduce permission prompts during everyday work on your own machine| The [sandboxed Bash tool](</docs/en/sandboxing>), enabled with `/sandbox`
+Let Claude work unattended with `--dangerously-skip-permissions` or auto mode| The preconfigured [dev container](</docs/en/devcontainer>), any container or VM, or the sandbox runtime
+Isolate MCP servers and hooks as well as Bash, without Docker| The sandbox runtime
+Work on an untrusted repository| A dedicated virtual machine, or [Claude Code on the web](</docs/en/claude-code-on-the-web>) if you have a Claude subscription and a connected GitHub account
+Standardize a sandboxed environment across a team| The preconfigured [dev container](</docs/en/devcontainer>), copied into your repository
+Use Claude Code from a device with no local setup| [Claude Code on the web](</docs/en/claude-code-on-the-web>), which requires a Claude subscription and a connected GitHub account
+Require isolation for every developer in your organization| Enforce isolation across an organization
+Work on a native Windows host| A container or VM, or run the Bash sandbox inside WSL2
+
+###
+
+
+
+How isolation relates to permission modes
+
+[Permission modes](</docs/en/permission-modes>) decide whether a tool call runs and whether you are prompted first. Isolation restricts what a command can access once it runs. The two work together: when a permission mode lets actions run without asking you, an isolation boundary limits what those actions can reach. `--dangerously-skip-permissions` removes per-action review entirely, so an isolation boundary is the only thing limiting what Claude can do. Always run it inside a container, a VM, or the sandbox runtime, so that file tools, MCP servers, and hooks are also inside the boundary. [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) replaces the prompt with a classifier that reviews actions and blocks ones that escalate beyond the request, target unrecognized infrastructure, or appear driven by hostile content Claude read. The classifier is a per-action control, not an isolation boundary, so an isolation boundary still adds defense in depth for unattended runs, and is not required the way it is for `--dangerously-skip-permissions`. The sandboxed Bash tool on its own constrains only Bash, so it is not sufficient for fully unattended runs in either mode. You can layer approaches: running the sandboxed Bash tool inside a container or VM gives you OS-level command restrictions on top of the outer environment boundary. For how the Bash sandbox itself interacts with permission rules and modes, see [How sandboxing relates to permissions and permission modes](</docs/en/sandboxing#how-sandboxing-relates-to-permissions-and-permission-modes>).
+
+##
+
+
+
+Sandboxed Bash tool
+
+This option does not support native Windows. On Windows hosts, use WSL2 or one of the container or VM approaches below.
+
+The sandboxed Bash tool is built into Claude Code. It uses operating system primitives to restrict the filesystem and network access of every Bash command Claude runs: Seatbelt, the built-in macOS sandbox, and [bubblewrap](<https://github.com/containers/bubblewrap>) on Linux and WSL2. By default it allows writes to the working directory and prompts the first time a command needs a new network domain. Enable it with the `/sandbox` command. The [Sandboxing](</docs/en/sandboxing>) guide covers the approval modes, the default boundary, and how to widen or narrow it. The per-command sandbox does not cover everything that runs in a session:
+
+ * Other [built-in tools](</docs/en/tools-reference>) such as Read, Edit, and WebFetch run inside the Claude Code process and do not spawn arbitrary code. [Permission rules](</docs/en/permissions>) for path or domain gate them instead.
+ * [MCP](</docs/en/mcp>) servers and hooks are separate processes that run unconstrained on the host.
+
+To put built-in tools, MCP servers, and hooks all behind one OS boundary, run the whole Claude Code process inside the sandbox runtime, the dev container, or a custom container.
+
+##
+
+
+
+Sandbox runtime
+
+The [`@anthropic-ai/sandbox-runtime`](<https://github.com/anthropic-experimental/sandbox-runtime>) package wraps an entire process in the same Seatbelt or bubblewrap isolation that the built-in Bash sandbox uses. Running Claude Code through it constrains every tool, hook, and MCP server in the session, not only Bash. The runtime is a beta research preview, and its configuration format may change as the package evolves. The runtime denies all write and network access by default, so configure it before launching Claude Code through it. In `~/.srt-settings.json`, or a file you pass with `--settings`, allow write access to at least your project directory and Claude Code’s configuration paths `~/.claude` and `~/.claude.json`. Allow the network domains your session needs, including `api.anthropic.com` or your configured provider’s endpoint. See the package [README](<https://github.com/anthropic-experimental/sandbox-runtime>) for the full configuration schema. Once the settings file is in place, launch Claude Code with `npx` and pass `claude` as the command to wrap:
+
+ npx @anthropic-ai/sandbox-runtime claude
+
+Claude Code starts inside the sandbox with the filesystem and network boundaries you configured. The same command works for sandboxing standalone MCP servers or other helper processes.
+
+##
+
+
+
+Dev containers
+
+A dev container runs Claude Code inside a Docker container that VS Code or a compatible editor manages, with your project mounted in. You can define your own with a `.devcontainer/` directory in your repository. The claude-code repository publishes an [example dev container](</docs/en/devcontainer>) with a default-deny iptables firewall as a starting point. Copy it into your repository and adjust the firewall allowlist, base image, and pinned Claude Code version to fit your environment. Because the firewall blocks unapproved egress, a configuration like this supports running Claude Code with `--dangerously-skip-permissions` for unattended work.
+
+##
+
+
+
+Custom container
+
+You can run Claude Code in any Docker or OCI container image with your own network policies, mounted volumes, and seccomp profiles. This is the most common path for organizations with existing container infrastructure or CI runners. Several managed sandbox and remote execution services can host the container for you. The same checklist applies as for any container you operate: review what is mounted writable, what credentials and tokens are reachable inside it, and what the network egress policy allows. You can layer the built-in Bash sandbox inside the container for per-command restrictions. Unprivileged containers need the nested-sandbox setting described in [Sandboxing troubleshooting](</docs/en/sandboxing#troubleshooting>).
+
+##
+
+
+
+Virtual machine
+
+A dedicated virtual machine provides the strongest separation, with its own kernel and, in cloud or microVM deployments, its own virtualized hardware. Options include cloud instances, local hypervisors, and microVMs such as Firecracker. Use this approach when you are evaluating untrusted code, when your security policy requires kernel-level separation between the agent and the host, or when no host-level approach meets your compliance requirements. Docker Desktop’s [sandboxes feature](<https://docs.docker.com/ai/sandboxes/>) provides a microVM with its own Docker daemon and workspace sync, which can run Claude Code on hosts that already have Docker Desktop.
+
+##
+
+
+
+Claude Code on the web
+
+[Claude Code on the web](</docs/en/claude-code-on-the-web>) runs each session in an isolated, Anthropic-managed virtual machine. A network proxy enforces a default allowlist, and a separate proxy holds your GitHub token outside the sandbox while issuing scoped credentials for repository access inside it. Use this approach when you want full VM isolation without provisioning infrastructure yourself, or when you are delegating tasks from a device that does not have a local development environment. It requires a Claude subscription and a connected GitHub account, and sessions clone your repository from GitHub. See [Claude Code on the web](</docs/en/claude-code-on-the-web>) for plan availability and GitHub authentication options.
+
+##
+
+
+
+Enforce isolation across an organization
+
+Individual developers can opt into any approach above. What an organization can enforce, and with which tools, depends on the approach:
+
+ * **Built-in Bash sandbox** : the only approach Claude Code enforces itself. Deliver the `sandbox` settings keys through [managed settings](</docs/en/settings#settings-files>), either as a file managed by your MDM or through [server-managed settings](</docs/en/server-managed-settings>) on Claude.ai. See [Enforce sandboxing with managed settings](</docs/en/sandboxing#enforce-sandboxing-with-managed-settings>) for the keys to deploy and how to keep developers from widening the policy.
+ * **Dev containers** : commit the [example dev container](</docs/en/devcontainer>) to your repositories to standardize the environment across a team. This is a convention rather than an enforcement boundary, because Claude Code does not require a container. If developers should not be able to run Claude Code outside it, enforce that with your organization’s device management or software allowlisting tools.
+ * **Custom containers and VMs** : distribute Claude Code through the approved image and use your organization’s device management or software allowlisting tools to prevent installation outside it.
+
+##
+
+
+
+See also
+
+These pages cover configuration and policy details for the approaches above.
+
+ * [Sandboxing](</docs/en/sandboxing>): configure the built-in sandboxed Bash tool
+ * [Dev container](</docs/en/devcontainer>): the preconfigured Docker development container
+ * [Security](</docs/en/security>): the full Claude Code security model
+ * [Secure deployment](</docs/en/agent-sdk/secure-deployment>): isolation guidance for Agent SDK applications
+ * [Settings](</docs/en/settings#sandbox-settings>): all sandbox configuration keys, including managed settings delivery
Show diff (642 lines)
--- a/sandboxing.md
+++ b/sandboxing.md
@@ -4,98 +4,67 @@
>
> Use this file to discover all available pages before exploring further.
-##
-
-
-
-Overview
-
-Claude Code features native sandboxing to provide a more secure environment for agent execution while reducing the need for constant permission prompts. Instead of asking permission for each bash command, sandboxing creates defined boundaries upfront where Claude Code can work more freely with reduced risk. The sandboxed bash tool uses OS-level primitives to enforce both filesystem and network isolation.
-
-##
-
-
-
-Why sandboxing matters
-
-Traditional permission-based security requires constant user approval for bash commands. While this provides control, it can lead to:
-
- * **Approval fatigue** : Repeatedly clicking “approve” can cause users to pay less attention to what they’re approving
- * **Reduced productivity** : Constant interruptions slow down development workflows
- * **Limited autonomy** : Claude Code cannot work as efficiently when waiting for approvals
-
-Sandboxing addresses these challenges by:
-
- 1. **Defining clear boundaries** : Specify exactly which directories and network hosts Claude Code can access
- 2. **Reducing permission prompts** : Safe commands within the sandbox don’t require approval
- 3. **Maintaining security** : Attempts to access resources outside the sandbox trigger immediate notifications
- 4. **Enabling autonomy** : Claude Code can run more independently within defined limits
-
-Effective sandboxing requires **both** filesystem and network isolation. Without network isolation, a compromised agent could exfiltrate sensitive files like SSH keys. Without filesystem isolation, a compromised agent could backdoor system resources to gain network access. When configuring sandboxing it is important to ensure that your configured settings do not create bypasses in these systems.
-
-##
-
-
-
-How it works
-
-###
-
-
-
-Filesystem isolation
-
-The sandboxed bash tool restricts file system access to specific directories:
-
- * **Default writes behavior** : Read and write access to the current working directory and its subdirectories
- * **Default read behavior** : Read access to the entire computer, except certain denied directories
- * **Blocked access** : Cannot modify files outside the current working directory without explicit permission
- * **Configurable** : Define custom allowed and denied paths through settings
-
-You can grant write access to additional paths using `sandbox.filesystem.allowWrite` in your settings. These restrictions are enforced at the OS level (Seatbelt on macOS, bubblewrap on Linux), so they apply to all subprocess commands, including tools like `kubectl`, `terraform`, and `npm`, not just Claude’s file tools.
-
-###
-
-
-
-Network isolation
-
-Network access is controlled through a proxy server running outside the sandbox:
-
- * **Domain restrictions** : Only approved domains can be accessed
- * **User confirmation** : New domain requests trigger permission prompts (unless [`allowManagedDomainsOnly`](</docs/en/settings#sandbox-settings>) is enabled, which blocks non-allowed domains automatically)
- * **Custom proxy support** : Advanced users can implement custom rules on outgoing traffic
- * **Comprehensive coverage** : Restrictions apply to all scripts, programs, and subprocesses spawned by commands
-
-The built-in proxy enforces the allowlist based on the requested hostname and does not terminate or inspect TLS traffic. See Security limitations for the implications of this design, and Custom proxy configuration if your threat model requires TLS inspection.
-
-###
-
-
-
-OS-level enforcement
-
-The sandboxed bash tool leverages operating system security primitives:
-
- * **macOS** : Uses Seatbelt for sandbox enforcement
- * **Linux** : Uses [bubblewrap](<https://github.com/containers/bubblewrap>) for isolation
- * **WSL2** : Uses bubblewrap, same as Linux
-
-WSL1 is not supported because bubblewrap requires kernel features only available in WSL2. These OS-level restrictions ensure that all child processes spawned by Claude Code’s commands inherit the same security boundaries.
-
-##
-
-
-
-Getting started
-
-###
-
-
-
-Prerequisites
-
-On **macOS** , sandboxing works out of the box using the built-in Seatbelt framework. On **Linux and WSL2** , install the required packages first:
+The Bash sandbox lets Claude run most shell commands without stopping to ask permission. Instead of approving each command, you define which files and network domains commands can touch, and the operating system enforces that boundary for every Bash command and its child processes. This page covers how to:
+
+ * Enable the sandbox and choose how sandboxed commands are approved
+ * Configure which paths and network domains commands can reach
+ * Combine sandboxing with permission rules and permission modes
+ * Enforce sandboxing across an organization with managed settings
+
+To compare other isolation approaches such as dev containers, custom containers, and virtual machines, see [Sandbox environments](</docs/en/sandbox-environments>). To reduce permission prompts for tools other than Bash, see [permission modes](</docs/en/permission-modes>).
+
+##
+
+
+
+Get started
+
+The sandbox is built into Claude Code and runs on macOS, Linux, and WSL2. Native Windows is not supported. On Windows, run Claude Code inside a WSL2 distribution. On macOS, there is nothing to install: sandboxing uses the built-in Seatbelt framework. On Linux and WSL2, the sandbox relies on two packages, covered in Set up Linux and WSL2. Even if you haven’t installed them yet, you can start with `/sandbox`, because its panel shows whether anything is missing.
+
+1
+
+Run /sandbox
+
+Start a Claude Code session and run the `/sandbox` command:
+
+ /sandbox
+
+This opens the sandbox panel with three tabs:
+
+ * **Mode** : choose how sandboxed commands are approved, covered in the next step
+ * **Overrides** : choose whether commands that fail under the sandbox can fall back to running unsandboxed. This is the [`allowUnsandboxedCommands`](</docs/en/settings#sandbox-settings>) setting
+ * **Config** : view the resolved sandbox settings
+
+If the panel shows only a Dependencies tab, a required package is missing. Install it as described in Set up Linux and WSL2, restart Claude Code, and run `/sandbox` again.
+
+2
+
+Choose a mode
+
+On the Mode tab, select auto-allow or regular permissions. Auto-allow runs sandboxed commands without prompting, and regular permissions keeps the regular permission prompts even when commands are sandboxed. See Sandbox modes for which commands still prompt in auto-allow mode.
+
+3
+
+Run a Bash command
+
+Ask Claude to run a command, such as a build or a test suite. By default, commands inside the sandbox can write only to the working directory. The first time a command needs a new network domain, Claude Code prompts for approval.Commands that cannot run sandboxed fall back to the regular permission flow. To widen or narrow these boundaries, see Configure sandboxing.
+
+Selecting a mode in the panel writes to your project’s local settings at `.claude/settings.local.json`, which apply to the current project and are not checked into git. To enable the sandbox across all of your projects, set [`sandbox.enabled`](</docs/en/settings#sandbox-settings>) to `true` in your user settings at `~/.claude/settings.json`. To enforce sandboxing for every developer in an organization, use managed settings.
+
+By default, if the sandbox cannot start because dependencies are missing or the platform is unsupported, Claude Code shows a warning and runs commands without sandboxing. To make this a hard failure instead, set [`sandbox.failIfUnavailable`](</docs/en/settings#sandbox-settings>) to `true`. This is intended for managed deployments that require sandboxing as a security gate.
+
+###
+
+
+
+Set up Linux and WSL2
+
+On Linux and WSL2, the sandbox relies on two packages:
+
+ * [`bubblewrap`](<https://github.com/containers/bubblewrap>): the unprivileged sandboxing tool that enforces filesystem isolation
+ * [`socat`](<http://www.dest-unreach.org/socat/>): the relay used to route network traffic through the sandbox proxy
+
+Install them with your distribution’s package manager:
* Ubuntu/Debian
@@ -105,7 +74,11 @@
sudo dnf install bubblewrap socat
-On Ubuntu 24.04 and later, the default AppArmor policy prevents bubblewrap from creating the user namespaces it needs for isolation. Add an AppArmor profile that grants `bwrap` this capability:
+After installing, the Dependencies tab in `/sandbox` shows whether `ripgrep`, `bubblewrap`, `socat`, and the seccomp filter are available on your platform. Ripgrep is bundled with the native Claude Code binary. The seccomp filter is optional and adds Unix domain socket blocking. Install it with `npm install -g @anthropic-ai/sandbox-runtime` if it is missing. When a required dependency is missing, the Dependencies tab is the only tab shown until you install it. The dependency check runs at startup, so restart Claude Code after installing packages for `/sandbox` to detect them.
+
+Ubuntu 24.04 and later: allow bubblewrap to create user namespaces
+
+On Ubuntu 24.04 and later, the default AppArmor policy prevents bubblewrap from creating the user namespaces it needs for isolation.To check whether your environment enforces this restriction, including inside WSL2, run `sysctl kernel.apparmor_restrict_unprivileged_userns`. If the key does not exist or returns `0`, skip this step. If it returns `1`, add an AppArmor profile that grants `bwrap` this capability:
sudo tee /etc/apparmor.d/bwrap > /dev/null <<'EOF'
abi <abi/4.0>,
@@ -121,19 +94,9 @@
sudo systemctl reload apparmor
-WSL1 does not support sandboxing because it lacks the required Linux namespace primitives. If you see `Sandboxing requires WSL2`, upgrade your distribution to WSL2 or run Claude Code without sandboxing. On WSL2, sandboxed commands cannot launch Windows binaries such as `cmd.exe`, `powershell.exe`, or anything under `/mnt/c/`. WSL hands these off to the Windows host over a Unix socket, which the sandbox blocks. If a command needs to invoke a Windows binary, add it to [`excludedCommands`](</docs/en/settings#sandbox-settings>) so it runs outside the sandbox.
-
-###
-
-
-
-Enable sandboxing
-
-You can enable sandboxing by running the `/sandbox` command:
-
- /sandbox
-
-This opens a menu where you can choose between sandbox modes. If required dependencies are missing (such as `bubblewrap` or `socat` on Linux), the menu displays installation instructions for your platform. By default, if the sandbox cannot start (missing dependencies or unsupported platform), Claude Code shows a warning and runs commands without sandboxing. To make this a hard failure instead, set [`sandbox.failIfUnavailable`](</docs/en/settings#sandbox-settings>) to `true`. This is intended for managed deployments that require sandboxing as a security gate.
+WSL2 notes
+
+Check your WSL version with `wsl -l -v` from PowerShell. If you see `Sandboxing requires WSL2`, your distribution is running WSL1. Upgrade it to WSL2 or run Claude Code without sandboxing.On WSL2, sandboxed commands cannot launch Windows binaries such as `cmd.exe`, `powershell.exe`, or anything under `/mnt/c/`. WSL hands these off to the Windows host over a Unix socket, which the sandbox blocks. If a command needs to invoke a Windows binary, add it to [`excludedCommands`](</docs/en/settings#sandbox-settings>) so it runs outside the sandbox.
###
@@ -141,25 +104,23 @@
Sandbox modes
-Claude Code offers two sandbox modes: **Auto-allow mode** : Bash commands will attempt to run inside the sandbox and are automatically allowed without requiring permission. Commands that cannot be sandboxed (such as those needing network access to non-allowed hosts) fall back to the regular permission flow. Explicit deny rules are always respected, and `rm` or `rmdir` commands that target `/`, your home directory, or other critical system paths still trigger a permission prompt. Ask rules apply only to commands that fall back to the regular permission flow. **Regular permissions mode** : All bash commands go through the standard permission flow, even when sandboxed. This provides more control but requires more approvals. In both modes, the sandbox enforces the same filesystem and network restrictions. The difference is only in whether sandboxed commands are auto-approved or require explicit permission.
-
-Auto-allow mode works independently of your permission mode setting. Even if you’re not in “accept edits” mode, sandboxed bash commands will run automatically when auto-allow is enabled. This means bash commands that modify files within the sandbox boundaries will execute without prompting, even when file edit tools would normally require approval.
-
-###
+Claude Code offers two sandbox modes: **Auto-allow mode** : Bash commands will attempt to run inside the sandbox and are automatically allowed without requiring permission. Commands that cannot be sandboxed, such as those needing network access to non-allowed hosts, fall back to the regular permission flow, where Claude Code checks your [permission rules](</docs/en/permissions>) and prompts you for any command those rules do not already allow. Even in auto-allow mode, the following still apply:
+
+ * Explicit [deny rules](</docs/en/permissions>) are always respected
+ * `rm` or `rmdir` commands that target `/`, your home directory, or other critical system paths still trigger a permission prompt
+ * [Ask rules](</docs/en/permissions>) apply to commands that fall back to the regular permission flow
+
+**Regular permissions mode** : All Bash commands go through the regular permission flow, even when sandboxed. This provides more control but requires more approvals. In both modes, the sandbox enforces the same filesystem and network restrictions. The difference is only in whether sandboxed commands are auto-approved or require explicit permission. Some commands cannot run inside the sandbox at all, such as tools that are incompatible with it or that need a host you have not allowed. Rather than failing the task or requiring you to turn sandboxing off, Claude Code includes an escape hatch: when a command fails because of sandbox restrictions, Claude analyzes the failure and may retry the command with the `dangerouslyDisableSandbox` parameter. The retried command runs outside the sandbox, so it goes through the regular permission flow and requires your approval. You can disable this escape hatch by setting `"allowUnsandboxedCommands": false` in your [sandbox settings](</docs/en/settings#sandbox-settings>). When disabled, which the `/sandbox` Overrides tab shows as **Strict sandbox mode** , the `dangerouslyDisableSandbox` parameter is completely ignored and all commands must run sandboxed or be explicitly listed in `excludedCommands`.
+
+Auto-allow mode works independently of your permission mode setting. Even if you’re not in “accept edits” mode, sandboxed Bash commands will run automatically when auto-allow is enabled. This means Bash commands that modify files within the sandbox boundaries will execute without prompting, even when file edit tools would normally require approval.
+
+##
Configure sandboxing
-Customize sandbox behavior through your `settings.json` file. See [Settings](</docs/en/settings#sandbox-settings>) for complete configuration reference.
-
-####
-
-
-
-Granting subprocess write access to specific paths
-
-By default, sandboxed commands can only write to the current working directory. If subprocess commands like `kubectl`, `terraform`, or `npm` need to write outside the project directory, use `sandbox.filesystem.allowWrite` to grant access to specific paths:
+Customize sandbox behavior through your `settings.json` file. See [Settings](</docs/en/settings#sandbox-settings>) for the complete configuration reference. By default, sandboxed commands can only write to the current working directory. If subprocess commands like `kubectl`, `terraform`, or `npm` need to write outside the project directory, use `sandbox.filesystem.allowWrite` to grant access to specific paths:
{
"sandbox": {
@@ -170,7 +131,7 @@
}
}
-These paths are enforced at the OS level, so all commands running inside the sandbox, including their child processes, respect them. This is the recommended approach when a tool needs write access to a specific location, rather than excluding the tool from the sandbox entirely with `excludedCommands`. When `allowWrite` (or `denyWrite`/`denyRead`/`allowRead`) is defined in multiple [settings scopes](</docs/en/settings#settings-precedence>), the arrays are **merged** , meaning paths from every scope are combined, not replaced. For example, if managed settings allow writes to `/opt/company-tools` and a user adds `~/.kube` in their personal settings, both paths are included in the final sandbox configuration. This means users and projects can extend the list without duplicating or overriding paths set by higher-priority scopes. Path prefixes control how paths are resolved:
+These paths are enforced at the OS level, so all commands running inside the sandbox, including their child processes, respect them. This is the recommended approach when a tool needs write access to a specific location, rather than excluding the tool from the sandbox entirely with `excludedCommands`. When the same filesystem array is defined in multiple [settings scopes](</docs/en/settings#settings-precedence>), the arrays are merged: paths from every scope are combined, not replaced. Path prefixes control how paths are resolved:
Prefix| Meaning| Example
---|---|---
@@ -178,7 +139,7 @@
`~/`| Relative to home directory| `~/.kube` becomes `$HOME/.kube`
`./` or no prefix| Relative to the project root for project settings, or to `~/.claude` for user settings| `./output` in `.claude/settings.json` resolves to `<project-root>/output`
-The older `//path` prefix for absolute paths still works. If you previously used single-slash `/path` expecting project-relative resolution, switch to `./path`. This syntax differs from [Read and Edit permission rules](</docs/en/permissions#read-and-edit>), which use `//path` for absolute and `/path` for project-relative. Sandbox filesystem paths use standard conventions: `/tmp/build` is an absolute path. You can also deny write or read access using `sandbox.filesystem.denyWrite` and `sandbox.filesystem.denyRead`. These are merged with any paths from `Edit(...)` and `Read(...)` permission rules. To re-allow reading specific paths within a denied region, use `sandbox.filesystem.allowRead`, which takes precedence over `denyRead`. When `allowManagedReadPathsOnly` is enabled in managed settings, only managed `allowRead` entries are respected; user, project, and local `allowRead` entries are ignored. `denyRead` still merges from all sources. For example, to block reading from the entire home directory while still allowing reads from the current project, add this to your project’s `.claude/settings.json`:
+This syntax differs from [Read and Edit permission rules](</docs/en/permissions#read-and-edit>), which use `//path` for absolute and `/path` for project-relative. Sandbox filesystem paths use standard conventions: `/tmp/build` is absolute. You can also deny write or read access using `sandbox.filesystem.denyWrite` and `sandbox.filesystem.denyRead`, and re-allow specific paths within a denied region using `sandbox.filesystem.allowRead`. The example below blocks reading from the entire home directory while still allowing reads from the current project. Place it in your project’s `.claude/settings.json`, because the relative path `.` resolves to the project root only when the configuration lives in project settings:
{
"sandbox": {
@@ -192,115 +153,144 @@
The `.` in `allowRead` resolves to the project root because this configuration lives in project settings. If you placed the same configuration in `~/.claude/settings.json`, `.` would resolve to `~/.claude` instead, and project files would remain blocked by the `denyRead` rule.
-Not all commands are compatible with sandboxing out of the box. Some notes that may help you make the most out of the sandbox:
-
- * Many CLI tools require accessing certain hosts. As you use these tools, they will request permission to access certain hosts. Granting permission will allow them to access these hosts now and in the future, enabling them to safely execute inside the sandbox.
- * `watchman` is incompatible with running in the sandbox. If you’re running `jest`, consider using `jest --no-watchman`
- * `docker` is incompatible with running in the sandbox. Consider specifying `docker *` in `excludedCommands` to force it to run outside of the sandbox.
-
-Claude Code includes an intentional escape hatch mechanism that allows commands to run outside the sandbox when necessary. When a command fails due to sandbox restrictions (such as network connectivity issues or incompatible tools), Claude is prompted to analyze the failure and may retry the command with the `dangerouslyDisableSandbox` parameter. Commands that use this parameter go through the normal Claude Code permissions flow requiring user permission to execute. This allows Claude Code to handle edge cases where certain tools or network operations cannot function within sandbox constraints.You can disable this escape hatch by setting `"allowUnsandboxedCommands": false` in your [sandbox settings](</docs/en/settings#sandbox-settings>). When disabled, the `dangerouslyDisableSandbox` parameter is completely ignored and all commands must run sandboxed or be explicitly listed in `excludedCommands`.
-
-##
-
-
-
-Security benefits
-
-###
-
-
-
-Protection against prompt injection
-
-Even if an attacker successfully manipulates Claude Code’s behavior through prompt injection, the sandbox ensures your system remains secure: **Filesystem protection:**
-
- * Cannot modify critical config files such as `~/.bashrc`
- * Cannot modify system-level files in `/bin/`
- * Cannot read files that are denied in your [Claude permission settings](</docs/en/permissions#manage-permissions>)
-
-**Network protection:**
-
- * Cannot exfiltrate data to attacker-controlled servers
- * Cannot download malicious scripts from unauthorized domains
- * Cannot make unexpected API calls to unapproved services
- * Cannot contact any domains not explicitly allowed
-
-**Monitoring and control:**
-
- * All access attempts outside the sandbox are blocked at the OS level
- * You receive immediate notifications when boundaries are tested
- * You can choose to deny, allow once, or permanently update your configuration
-
-###
-
-
-
-Reduced attack surface
-
-Sandboxing limits the potential damage from:
-
- * **Malicious dependencies** : NPM packages or other dependencies with harmful code
- * **Compromised scripts** : Build scripts or tools with security vulnerabilities
- * **Social engineering** : Attacks that trick users into running dangerous commands
- * **Prompt injection** : Attacks that trick Claude into running dangerous commands
-
-###
-
-
-
-Transparent operation
-
-When Claude Code attempts to access network resources outside the sandbox:
-
- 1. The operation is blocked at the OS level
- 2. You receive an immediate notification
- 3. You can choose to:
- * Deny the request
- * Allow it once
- * Update your sandbox configuration to permanently allow it
-
-##
-
-
-
-Security Limitations
-
- * Network Sandboxing Limitations: The network filtering system operates by restricting the domains that processes are allowed to connect to. The built-in proxy does not terminate or perform TLS inspection on outbound traffic, so the contents of encrypted connections are not examined. You are responsible for ensuring that only trusted domains are allowed in your policy.
-
-Allowing broad domains such as `github.com` can create paths for data exfiltration. Because the proxy makes its allow decision from the client-supplied hostname without inspecting TLS, code running inside the sandbox can potentially use [domain fronting](<https://en.wikipedia.org/wiki/Domain_fronting>) or similar techniques to reach hosts outside the allowlist. If your threat model requires stronger guarantees, configure a custom proxy that terminates TLS and inspects traffic, and install its CA certificate inside the sandbox. Stronger TLS-aware network isolation is an active area of development.
-
- * Privilege Escalation via Unix Sockets: The `allowUnixSockets` configuration can inadvertently grant access to powerful system services that could lead to sandbox bypasses. For example, if it is used to allow access to `/var/run/docker.sock` this would effectively grant access to the host system through exploiting the docker socket. Users are encouraged to carefully consider any unix sockets that they allow through the sandbox.
- * Filesystem Permission Escalation: Overly broad filesystem write permissions can enable privilege escalation attacks. Allowing writes to directories containing executables in `$PATH`, system configuration directories, or user shell configuration files (`.bashrc`, `.zshrc`) can lead to code execution in different security contexts when other users or system processes access these files.
- * Linux Sandbox Strength: The Linux implementation provides strong filesystem and network isolation but includes an `enableWeakerNestedSandbox` mode that enables it to work inside of Docker environments without privileged namespaces. This option considerably weakens security and should only be used in cases where additional isolation is otherwise enforced.
-
-##
-
-
-
-How sandboxing relates to permissions
-
-Sandboxing and [permissions](</docs/en/permissions>) are complementary security layers that work together:
-
- * **Permissions** control which tools Claude Code can use and are evaluated before any tool runs. They apply to all tools: Bash, Read, Edit, WebFetch, MCP, and others.
+##
+
+
+
+How sandboxing works
+
+###
+
+
+
+Filesystem isolation
+
+The sandboxed Bash tool restricts file system access to specific directories:
+
+ * **Default write behavior** : read and write access to the current working directory and its subdirectories
+ * **Default read behavior** : read access to the entire computer, except certain denied directories. Note that this default still allows reading credential files such as `~/.aws/credentials` and `~/.ssh/`. Add them to `denyRead` to block them.
+ * **Blocked access** : cannot modify files outside the current working directory without explicit permission, including shell configuration files such as `~/.bashrc` and system binaries in `/bin/`
+ * **Configurable** : define custom allowed and denied paths through settings
+
+You can grant write access to additional paths using `sandbox.filesystem.allowWrite` in your settings. These restrictions are enforced at the OS level, so they apply to all subprocess commands, including tools like `kubectl`, `terraform`, and `npm`, not just Claude’s file tools.
+
+###
+
+
+
+Network isolation
+
+Network access is controlled through a proxy server running outside the sandbox:
+
+ * **Domain restrictions** : no domains are pre-allowed. The first time a command needs a new domain, Claude Code prompts for approval. Pre-allow domains with [`allowedDomains`](</docs/en/settings#sandbox-settings>) to avoid the prompt.
+ * **Managed lockdown** : if [`allowManagedDomainsOnly`](</docs/en/settings#sandbox-settings>) is set in managed settings, non-allowed domains are blocked automatically instead of prompting, and only `allowedDomains` from managed settings are honored.
+ * **Custom proxy support** : advanced users can implement custom rules on outgoing traffic
+ * **Comprehensive coverage** : restrictions apply to all scripts, programs, and subprocesses spawned by commands
+
+The built-in proxy enforces the allowlist based on the requested hostname and does not terminate or inspect TLS traffic. See Security limitations for the implications of this design, and Custom proxy configuration if your threat model requires TLS inspection.
+
+###
+
+
+
+OS-level enforcement
+
+The sandboxed Bash tool leverages operating system security primitives:
+
+ * **macOS** : uses Seatbelt for sandbox enforcement
+ * **Linux** : uses [bubblewrap](<https://github.com/containers/bubblewrap>) for isolation
+ * **WSL2** : uses bubblewrap, same as Linux
+
+WSL1 is not supported because bubblewrap requires kernel features only available in WSL2. These OS-level restrictions ensure that all child processes spawned by Claude Code’s commands inherit the same security boundaries. These same primitives are available as the standalone [`@anthropic-ai/sandbox-runtime`](<https://github.com/anthropic-experimental/sandbox-runtime>) package, which the [Sandbox environments](</docs/en/sandbox-environments#sandbox-runtime>) page covers as a separate approach for wrapping the entire Claude Code process.
+
+##
+
+
+
+How sandboxing relates to permissions and permission modes
+
+Sandboxing, [permission rules](</docs/en/permissions>), and [permission modes](</docs/en/permission-modes>) are complementary layers. The sections below cover how the sandbox interacts with each.
+
+###
+
+
+
+Permission rules
+
+Permission rules and sandboxing control different things:
+
+ * **Permission rules** control which tools Claude Code can use and are evaluated before any tool runs. They apply to all tools: Bash, Read, Edit, WebFetch, MCP, and others.
* **Sandboxing** provides OS-level enforcement that restricts what Bash commands can access at the filesystem and network level. It applies only to Bash commands and their child processes.
-Filesystem and network restrictions are configured through both sandbox settings and permission rules:
-
- * Use `sandbox.filesystem.allowWrite` to grant subprocess write access to paths outside the working directory
- * Use `sandbox.filesystem.denyWrite` and `sandbox.filesystem.denyRead` to block subprocess access to specific paths
- * Use `sandbox.filesystem.allowRead` to re-allow reading specific paths within a `denyRead` region
- * Use `Read` and `Edit` deny rules to block access to specific files or directories
- * Use `WebFetch` allow/deny rules to control domain access
- * Use sandbox `allowedDomains` to control which domains Bash commands can reach
- * Use sandbox `deniedDomains` to block specific domains even when a broader `allowedDomains` wildcard would otherwise permit them
-
-Paths from both `sandbox.filesystem` settings and permission rules are merged together into the final sandbox configuration. This [repository](<https://github.com/anthropics/claude-code/tree/main/examples/settings>) includes starter settings configurations for common deployment scenarios, including sandbox-specific examples. Use these as starting points and adjust them to fit your needs.
-
-##
-
-
-
-Advanced usage
+The two layers also differ in how they are enforced. Claude Code evaluates permission decisions before a command runs, based on the command string and, in auto mode, a separate classifier’s judgment about whether the command is safe. The operating system enforces the sandbox boundary on the running process, so it holds regardless of what the model chose to run and even if an allowed command does more than its name suggests. Filesystem and network restrictions are configured through both sandbox settings and permission rules:
+
+Setting or rule| What it does
+---|---
+`sandbox.filesystem.allowWrite`| Grants subprocess write access to paths outside the working directory
+`sandbox.filesystem.denyWrite` and `sandbox.filesystem.denyRead`| Block subprocess access to specific paths
+`sandbox.filesystem.allowRead`| Re-allows reading specific paths within a `denyRead` region
+`Edit` allow rules| Grant write access to specific paths, the same way `sandbox.filesystem.allowWrite` does
+`Read` and `Edit` deny rules| Block access to specific files or directories
+`WebFetch` allow and deny rules| Control domain access
+Sandbox `allowedDomains`| Controls which domains Bash commands can reach
+Sandbox `deniedDomains`| Blocks specific domains even when a broader `allowedDomains` wildcard would otherwise permit them
+
+Paths from both `sandbox.filesystem` settings and permission rules are merged together into the final sandbox configuration. The [claude-code repository’s examples directory](<https://github.com/anthropics/claude-code/tree/main/examples/settings>) includes starter settings configurations for common deployment scenarios, including sandbox-specific examples. Use these as starting points and adjust them to fit your needs.
+
+###
+
+
+
+Permission modes
+
+`/sandbox` is not a [permission mode](</docs/en/permission-modes>). Permission modes decide whether a tool call runs and whether you are prompted first, while the sandbox restricts what a Bash command can access once it runs. They differ in what they control and what replaces the per-action prompt:
+
+| What it controls| What replaces the prompt
+---|---|---
+`/sandbox`| What a Bash command can access once it runs| The sandbox boundary itself, in auto-allow mode
+[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)| Whether each tool call runs| A classifier that reviews actions
+`--dangerously-skip-permissions`| Whether each tool call runs| Nothing. [Protected path](</docs/en/permission-modes#protected-paths>) checks are also skipped; only removing `/` or your home directory still prompts
+
+The sandbox’s auto-allow mode is separate from [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>): auto-allow approves Bash commands because the sandbox boundary contains them, while auto mode uses a classifier to review actions. The two work independently and can be combined. To choose an isolation boundary for unattended runs, see [Sandbox environments](</docs/en/sandbox-environments#how-isolation-relates-to-permission-modes>).
+
+##
+
+
+
+Configure the sandbox for your organization
+
+Administrators can require sandboxing for every user, keep developers from widening the policy, and route sandbox traffic through a corporate proxy.
+
+###
+
+
+
+Enforce sandboxing with managed settings
+
+To require the sandbox for every developer, deliver the `sandbox` keys through [managed settings](</docs/en/settings#settings-files>), either as a file managed by your MDM or through [server-managed settings](</docs/en/server-managed-settings>) on Claude.ai. The following managed settings configuration enables the sandbox, refuses to start Claude Code if the sandbox cannot initialize, and prevents the model from retrying commands outside the sandbox:
+
+ {
+ "sandbox": {
+ "enabled": true,
+ "failIfUnavailable": true,
+ "allowUnsandboxedCommands": false
+ }
+ }
+
+The two keys beyond `enabled` control what happens when the sandbox cannot run a command:
+
+ * **`failIfUnavailable`** : a missing dependency such as bubblewrap on Linux blocks Claude Code from starting rather than showing a warning and falling back to unsandboxed execution
+ * **`allowUnsandboxedCommands: false`** : the `dangerouslyDisableSandbox` escape hatch is ignored, so commands that fail under the sandbox cannot be retried outside it
+
+Two additions are worth considering alongside them. Add `excludedCommands` for any organization-approved tools that must run without isolation. Add `denyRead` entries for credential directories such as `~/.aws` and `~/.ssh`, which the default read policy still allows. The sandbox does not run on native Windows, so if your fleet includes Windows hosts, scope this configuration to macOS and Linux or have those users run Claude Code inside WSL2 or a container.
+
+###
+
+
+
+Keep developers from widening the policy
+
+For boolean keys such as `enabled` and `failIfUnavailable`, Claude Code uses the managed value and ignores anything a developer sets locally. For array keys such as `excludedCommands` and `allowRead`, Claude Code merges entries from every scope, so a developer can append entries that widen the policy. Set `allowManagedReadPathsOnly` to `true` in managed settings so that only `allowRead` entries from managed settings are honored. User, project, and local `allowRead` entries are ignored. This prevents developers from widening read access beyond the organization-approved paths. To lock network domains to the managed values the same way, set [`allowManagedDomainsOnly`](</docs/en/settings#sandbox-settings>). `excludedCommands` has no equivalent managed-only lockdown, so a developer can always append entries that run additional commands outside the sandbox. Keep the managed list narrow.
###
@@ -314,6 +304,8 @@
* Apply custom filtering rules
* Log all network requests
* Integrate with existing security infrastructure
+
+To point Claude Code at your proxy, set the proxy ports in [sandbox settings](</docs/en/settings#sandbox-settings>):
{
"sandbox": {
@@ -324,41 +316,21 @@
}
}
-###
-
-
-
-Integration with existing security tools
-
-The sandboxed bash tool works alongside:
-
- * **Permission rules** : Combine with [permission settings](</docs/en/permissions>) for defense-in-depth
- * **Development containers** : Use with [dev containers](</docs/en/devcontainer>) for additional isolation
- * **Enterprise policies** : Enforce sandbox configurations through [managed settings](</docs/en/settings#settings-precedence>)
-
-##
-
-
-
-Best practices
-
- 1. **Start restrictive** : Begin with minimal permissions and expand as needed
- 2. **Monitor logs** : Review sandbox violation attempts to understand Claude Code’s needs
- 3. **Use environment-specific configs** : Different sandbox rules for development vs. production contexts
- 4. **Combine with permissions** : Use sandboxing alongside IAM policies for comprehensive security
- 5. **Test configurations** : Verify your sandbox settings don’t block legitimate workflows
-
-##
-
-
-
-Open source
-
-The sandbox runtime is available as an open source npm package for use in your own agent projects. This enables the broader AI agent community to build safer, more secure autonomous systems. This can also be used to sandbox other programs you may wish to run. For example, to sandbox an MCP server you could run:
-
- npx @anthropic-ai/sandbox-runtime <command-to-sandbox>
-
-For implementation details and source code, visit the [GitHub repository](<https://github.com/anthropic-experimental/sandbox-runtime>).
+##
+
+
+
+Troubleshooting
+
+Some commands fail inside the sandbox even though they work outside it. The fixes below cover the most common cases.
+
+ * **Commands fail with a host-not-allowed error** : many CLI tools need to reach specific hosts. Granting permission when prompted adds the host to your allowed list so the tool runs inside the sandbox in future.
+ * **`jest` hangs or fails**: `watchman` is incompatible with the sandbox. Run `jest --no-watchman` instead.
+ * **Go-based CLIs fail TLS verification on macOS** : tools such as `gh`, `gcloud`, and `terraform` may fail TLS verification under Seatbelt. List these tools in `excludedCommands` to run them outside the sandbox. If you are using `httpProxyPort` with a MITM proxy and custom CA, set [`enableWeakerNetworkIsolation`](</docs/en/settings#sandbox-settings>) to `true` instead.
+ * **`docker` commands fail**: `docker` is incompatible with the sandbox. Add `docker *` to `excludedCommands` to run it outside the sandbox.
+ * **Bubblewrap fails to start inside a container** : in an unprivileged container, bubblewrap cannot mount a fresh `/proc` filesystem. Set [`enableWeakerNestedSandbox`](</docs/en/settings#sandbox-settings>) to `true` so the inner sandbox bind-mounts the container’s existing `/proc` instead. Only use this setting when the outer container already provides the isolation boundary you need, since it exposes process information to sandboxed commands that a fresh `/proc` mount would hide.
+ * **Seccomp filter on Linux** : the seccomp filter is required to block Unix domain sockets. The Dependencies tab in `/sandbox` shows whether it is available. If it is missing, run `npm install -g @anthropic-ai/sandbox-runtime` to install the helper.
+ * **`--dangerously-skip-permissions` fails as root**: this flag is blocked when running as root or via sudo on Linux and macOS, because root access combined with no permission prompts can modify any file or service on the system. The check is skipped automatically inside a recognized sandbox. To run autonomously in a container, use the [dev container](</docs/en/devcontainer>) configuration, which runs Claude Code as a non-root user.
##
@@ -366,20 +338,47 @@
Limitations
- * **Performance overhead** : Minimal, but some filesystem operations may be slightly slower
- * **Compatibility** : Some tools that require specific system access patterns may need configuration adjustments, or may even need to be run outside of the sandbox
- * **Platform support** : Supports macOS, Linux, and WSL2. WSL1 is not supported. Native Windows support is planned.
-
-##
-
-
-
-What sandboxing does not cover
+Sandboxing reduces risk but is not a complete isolation boundary. Review the limitations below before relying on it as a hard security control.
+
+###
+
+
+
+Security limitations
+
+ * **Network filtering** : the network filtering system operates by restricting the domains that processes are allowed to connect to. The built-in proxy does not terminate or perform TLS inspection on outbound traffic, so the contents of encrypted connections are not examined. You are responsible for ensuring that only trusted domains are allowed in your policy.
+
+Allowing broad domains such as `github.com` can create paths for data exfiltration. Because the proxy makes its allow decision from the client-supplied hostname without inspecting TLS, code running inside the sandbox can potentially use [domain fronting](<https://en.wikipedia.org/wiki/Domain_fronting>) or similar techniques to reach hosts outside the allowlist. If your threat model requires stronger guarantees, configure a custom proxy that terminates TLS and inspects traffic, and install its CA certificate inside the sandbox. Stronger TLS-aware network isolation is an active area of development.
+
+ * **Privilege escalation via Unix sockets** : the `allowUnixSockets` configuration can inadvertently grant access to powerful system services that could lead to sandbox bypasses. For example, allowing access to `/var/run/docker.sock` effectively grants access to the host system through the Docker socket. Consider carefully any Unix sockets that you allow through the sandbox.
+ * **Filesystem permission escalation** : overly broad filesystem write permissions can enable privilege escalation attacks. Allowing writes to directories containing executables in `$PATH`, system configuration directories, or user shell configuration files such as `.bashrc` or `.zshrc` can lead to code execution in different security contexts when other users or system processes access these files.
+ * **Linux sandbox strength** : the Linux implementation provides strong filesystem and network isolation but includes an `enableWeakerNestedSandbox` mode that enables it to work inside Docker environments without privileged namespaces, or on Linux hosts where unprivileged user namespaces are disabled by sysctl. This option considerably weakens security and should only be used when additional isolation is otherwise enforced.
+ * **Settings files protected** : the sandbox automatically denies write access to Claude Code’s `settings.json` files at every scope and to the managed settings directory, so a sandboxed command cannot modify its own policy.
+
+###
+
+
+
+Platform and tool compatibility
+
+ * **Platform support** : supports macOS, Linux, and WSL2. WSL1 and native Windows are not supported.
+ * **Performance overhead** : minimal, but some filesystem operations may be slightly slower.
+ * **Tool compatibility** : some tools that require specific system access patterns may need configuration adjustments, or may need to be run outside the sandbox.
+
+###
+
+
+
+Scope
The sandbox isolates Bash subprocesses. Other tools operate under different boundaries:
* **Built-in file tools** : Read, Edit, and Write use the permission system directly rather than running through the sandbox. See [permissions](</docs/en/permissions>).
* **Computer use** : when Claude opens apps and controls your screen, it runs on your actual desktop rather than in an isolated environment. Per-app permission prompts gate each application. See [computer use in the CLI](</docs/en/computer-use>) or [computer use in Desktop](</docs/en/desktop#let-claude-use-your-computer>).
+ * **Environment variables** : sandboxed Bash commands inherit the parent process environment by default, including any credentials set there. To strip Anthropic and cloud provider credentials from subprocesses, set [`CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`](</docs/en/env-vars>).
+ * **Subagents** : [subagents](</docs/en/sub-agents>) run in the same process as the parent session and use the same sandbox configuration. Bash commands inside a subagent are sandboxed when sandboxing is enabled in the parent session.
+
+Effective sandboxing requires both filesystem and network isolation. Without network isolation, a compromised agent could exfiltrate sensitive files like SSH keys. Without filesystem isolation, a compromised agent could backdoor system resources to gain network access. When you widen the defaults, check that an `allowWrite` path, a broad `allowedDomains` entry, or an `excludedCommands` exception does not undo a restriction on the other side.
##
@@ -387,7 +386,8 @@
See also
- * [Security](</docs/en/security>) \- Comprehensive security features and best practices
- * [Permissions](</docs/en/permissions>) \- Permission configuration and access control
- * [Settings](</docs/en/settings>) \- Complete configuration reference
- * [CLI reference](</docs/en/cli-reference>) \- Command-line options
+ * [Sandbox environments](</docs/en/sandbox-environments>): compare the built-in sandbox with dev containers, containers, and VMs
+ * [Security](</docs/en/security>): comprehensive security features and best practices
+ * [Permissions](</docs/en/permissions>): permission configuration and access control
+ * [Settings](</docs/en/settings>): complete configuration reference
+ * [CLI reference](</docs/en/cli-reference>): command-line options
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -90,7 +90,7 @@
A bare `/loop` runs this prompt at a dynamically chosen interval. Add an interval, for example `/loop 15m`, to run it on a fixed schedule instead. To replace the built-in prompt with your own default, see Customize the default prompt with loop.md.
-The built-in maintenance prompt isn’t available to everyone yet, and isn’t supported on Bedrock, Vertex AI, or Microsoft Foundry. Where it isn’t active, `/loop` with no prompt prints the usage message instead.
+On Bedrock, Vertex AI, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of running the maintenance prompt.
###
@@ -116,7 +116,7 @@
Edits to `loop.md` take effect on the next iteration, so you can refine the instructions while a loop is running. When no `loop.md` exists in either location, the loop falls back to the built-in maintenance prompt. Keep the file concise: content beyond 25,000 bytes is truncated.
-`loop.md` follows the same availability as the built-in maintenance prompt. Where the maintenance prompt isn’t active, `/loop` with no prompt prints the usage message and the file isn’t read.
+On Bedrock, Vertex AI, and Microsoft Foundry, `loop.md` isn’t read and `/loop` with no prompt prints the usage message instead.
###
--- a/security.md
+++ b/security.md
@@ -189,8 +189,9 @@
Related resources
- * [Sandboxing](</docs/en/sandboxing>) \- Filesystem and network isolation for bash commands
- * [Permissions](</docs/en/permissions>) \- Configure permissions and access controls
- * [Monitoring usage](</docs/en/monitoring-usage>) \- Track and audit Claude Code activity
- * [Development containers](</docs/en/devcontainer>) \- Secure, isolated environments
- * [Anthropic Trust Center](<https://trust.anthropic.com>) \- Security certifications and compliance
+ * [Sandbox environments](</docs/en/sandbox-environments>): compare isolation approaches and choose one for your threat model
+ * [Sandboxing](</docs/en/sandboxing>): filesystem and network isolation for Bash commands
+ * [Permissions](</docs/en/permissions>): configure permissions and access controls
+ * [Monitoring usage](</docs/en/monitoring-usage>): track and audit Claude Code activity
+ * [Development containers](</docs/en/devcontainer>): secure, isolated environments
+ * [Anthropic Trust Center](<https://trust.anthropic.com>): security certifications and compliance
--- a/server-managed-settings.md
+++ b/server-managed-settings.md
@@ -139,7 +139,7 @@
Server-managed settings have the following limitations:
* Settings apply uniformly to all users in the organization. Per-group configurations are not yet supported.
- * [MCP server configurations](</docs/en/mcp#managed-mcp-configuration>) cannot be distributed through server-managed settings.
+ * A [`managed-mcp.json`](</docs/en/managed-mcp>) file cannot be distributed through server-managed settings. Deliver the `allowedMcpServers` and `deniedMcpServers` policy keys there instead.
* Settings restricted to OS-level policy sources, such as `policyHelper` and `wslInheritsWindowsSettings`, are not honored. Deploy them through MDM or a system `managed-settings.json` file instead.
##
--- a/settings.md
+++ b/settings.md
@@ -119,7 +119,7 @@
The legacy Windows path `C:\ProgramData\ClaudeCode\managed-settings.json` is no longer supported as of v2.1.75. Administrators who deployed settings to that location must migrate files to `C:\Program Files\ClaudeCode\managed-settings.json`.
File-based managed settings also support a drop-in directory at `managed-settings.d/` in the same system directory alongside `managed-settings.json`. This lets separate teams deploy independent policy fragments without coordinating edits to a single file. Following the systemd convention, `managed-settings.json` is merged first as the base, then all `*.json` files in the drop-in directory are sorted alphabetically and merged on top. Later files override earlier ones for scalar values; arrays are concatenated and de-duplicated; objects are deep-merged. Hidden files starting with `.` are ignored. Use numeric prefixes to control merge order, for example `10-telemetry.json` and `20-security.json`.
-See [managed settings](</docs/en/permissions#managed-only-settings>) and [Managed MCP configuration](</docs/en/mcp#managed-mcp-configuration>) for details. This [repository](<https://github.com/anthropics/claude-code/tree/main/examples/mdm>) includes starter deployment templates for Jamf, Iru (Kandji), Intune, and Group Policy. Use these as starting points and adjust them to fit your needs.
+See [managed settings](</docs/en/permissions#managed-only-settings>) and [Managed MCP configuration](</docs/en/managed-mcp>) for details. This [repository](<https://github.com/anthropics/claude-code/tree/main/examples/mdm>) includes starter deployment templates for Jamf, Iru (Kandji), Intune, and Group Policy. Use these as starting points and adjust them to fit your needs.
Managed deployments can also restrict **plugin marketplace additions** using `strictKnownMarketplaces`. For more information, see [Managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>).
@@ -181,9 +181,9 @@
`agent`| Run the main thread as a named subagent. Applies that subagent’s system prompt, tool restrictions, and model. See [Invoke subagents explicitly](</docs/en/sub-agents#invoke-subagents-explicitly>)| `"code-reviewer"`
`allowedChannelPlugins`| (Managed settings only) Allowlist of channel plugins that may push messages. Replaces the default Anthropic allowlist when set. Undefined = fall back to the default, empty array = block all channel plugins. Requires `channelsEnabled: true`. See [Restrict which channel plugins can run](</docs/en/channels#restrict-which-channel-plugins-can-run>)| `[{ "marketplace": "claude-plugins-official", "plugin": "telegram" }]`
`allowedHttpHookUrls`| Allowlist of URL patterns that HTTP hooks may target. Supports `*` as a wildcard. When set, hooks with non-matching URLs are blocked. Undefined = no restriction, empty array = block all HTTP hooks. Arrays merge across settings sources. See Hook configuration| `["https://hooks.example.com/*"]`
-`allowedMcpServers`| When set in managed-settings.json, allowlist of MCP servers users can configure. Undefined = no restrictions, empty array = lockdown. Applies to all scopes. Denylist takes precedence. See [Managed MCP configuration](</docs/en/mcp#managed-mcp-configuration>)| `[{ "serverName": "github" }]`
+`allowedMcpServers`| When set in managed-settings.json, allowlist of MCP servers users can configure. Undefined = no restrictions, empty array = lockdown. Applies to all scopes. Denylist takes precedence. See [Managed MCP configuration](</docs/en/managed-mcp>)| `[{ "serverName": "github" }]`
`allowManagedHooksOnly`| (Managed settings only) Only managed hooks, SDK hooks, and hooks from plugins force-enabled in managed settings `enabledPlugins` are loaded. User, project, and all other plugin hooks are blocked. See Hook configuration| `true`
-`allowManagedMcpServersOnly`| (Managed settings only) Only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. Users can still add MCP servers, but only the admin-defined allowlist applies. See [Managed MCP configuration](</docs/en/mcp#managed-mcp-configuration>)| `true`
+`allowManagedMcpServersOnly`| (Managed settings only) Only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. Users can still add MCP servers, but only the admin-defined allowlist applies. See [Managed MCP configuration](</docs/en/managed-mcp>)| `true`
`allowManagedPermissionRulesOnly`| (Managed settings only) Prevent user and project settings from defining `allow`, `ask`, or `deny` permission rules. Only rules in managed settings apply. See [Managed-only settings](</docs/en/permissions#managed-only-settings>)| `true`
`alwaysThinkingEnabled`| Enable [extended thinking](</docs/en/model-config#extended-thinking>) by default for all sessions. Typically configured via the `/config` command rather than editing directly. To force thinking off regardless of this setting, set [`CLAUDE_CODE_DISABLE_THINKING`](</docs/en/env-vars>) in `env`| `true`
`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. Set the refresh interval with [`CLAUDE_CODE_API_KEY_HELPER_TTL_MS`](</docs/en/env-vars>)| `/bin/generate_temp_api_key.sh`
@@ -204,7 +204,7 @@
`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"`
-`deniedMcpServers`| When set in managed-settings.json, denylist of MCP servers that are explicitly blocked. Applies to all scopes including managed servers. Denylist takes precedence over allowlist. See [Managed MCP configuration](</docs/en/mcp#managed-mcp-configuration>)| `[{ "serverName": "filesystem" }]`
+`deniedMcpServers`| When set in managed-settings.json, denylist of MCP servers that are explicitly blocked. Applies to all scopes including managed servers. Denylist takes precedence over allowlist. See [Managed MCP configuration](</docs/en/managed-mcp>)| `[{ "serverName": "filesystem" }]`
`disableAgentView`| Set to `true` to turn off [background agents and agent view](</docs/en/agent-view>): `claude agents`, `--bg`, `/background`, and the on-demand supervisor. Typically set in [managed settings](</docs/en/permissions#managed-settings>). Equivalent to setting `CLAUDE_CODE_DISABLE_AGENT_VIEW` to `1`| `true`
`disableAllHooks`| Disable all [hooks](</docs/en/hooks>) and any custom [status line](</docs/en/statusline>)| `true`
`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"`
@@ -220,8 +220,8 @@
`fastModePerSessionOptIn`| When `true`, fast mode does not persist across sessions. Each session starts with fast mode off, requiring users to enable it with `/fast`. The user’s fast mode preference is still saved. See [Require per-session opt-in](</docs/en/fast-mode#require-per-session-opt-in>)| `true`
`feedbackSurveyRate`| Probability (0–1) that the [session quality survey](</docs/en/data-usage#session-quality-surveys>) appears when eligible. Set to `0` to suppress entirely, or set [`CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY`](</docs/en/env-vars>) in `env`. Useful when using Bedrock, Vertex, or Foundry where the default sample rate does not apply| `0.05`
`fileSuggestion`| Configure a custom script for `@` file autocomplete. See File suggestion settings| `{"type": "command", "command": "~/.claude/file-suggestion.sh"}`
-`forceLoginMethod`| Use `claudeai` to restrict login to Claude.ai accounts, `console` to restrict login to Claude Console (API usage billing) accounts| `claudeai`
-`forceLoginOrgUUID`| Require login to belong to a specific organization. Accepts a single UUID string, which also pre-selects that organization during login, or an array of UUIDs where any listed organization is accepted without pre-selection. When set in managed settings, login fails if the authenticated account does not belong to a listed organization; an empty array fails closed and blocks login with a misconfiguration message| `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"` or `["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"]`
+`forceLoginMethod`| Use `claudeai` to restrict login to Claude.ai accounts, `console` to restrict login to Claude Console (API usage billing) accounts. When set in managed settings, sessions authenticated by API key, `apiKeyHelper`, or a third-party provider are blocked at startup, since neither value can be satisfied without first-party OAuth| `claudeai`
+`forceLoginOrgUUID`| Require login to belong to a specific organization. Accepts a single UUID string, which also pre-selects that organization during login, or an array of UUIDs where any listed organization is accepted without pre-selection. When set in managed settings, login fails if the authenticated account does not belong to a listed organization, and sessions authenticated by API key, `apiKeyHelper`, or a third-party provider are blocked at startup since organization membership cannot be verified for them. An empty array fails closed and blocks login with a misconfiguration message| `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"` or `["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"]`
`forceRemoteSettingsRefresh`| (Managed settings only) Block CLI startup until remote managed settings are freshly fetched from the server. If the fetch fails, the CLI exits rather than continuing with cached or no settings. When not set, startup continues without waiting for remote settings. See [fail-closed enforcement](</docs/en/server-managed-settings#enforce-fail-closed-startup>)| `true`
`gcpAuthRefresh`| Custom script that refreshes GCP Application Default Credentials when they expire or cannot be loaded. See [advanced credential configuration](</docs/en/google-vertex-ai#advanced-credential-configuration>)| `gcloud auth application-default login`
`hooks`| Configure custom commands to run at lifecycle events. See [hooks documentation](</docs/en/hooks>) for format| See [hooks](</docs/en/hooks>)
@@ -958,7 +958,7 @@
`skills`| `~/.claude/skills/`, `.claude/skills/`| Plugin skills, bundled skills, skills in the managed policy directory
`agents`| `~/.claude/agents/`, `.claude/agents/`| Plugin agents, built-in agents, agents in the managed policy directory
`hooks`| Hooks in user, project, and local `settings.json`| Plugin hooks, hooks in managed settings
-`mcp`| Servers in `~/.claude.json` and `.mcp.json`| Plugin MCP servers, [`managed-mcp.json`](</docs/en/mcp#managed-mcp-configuration>) servers
+`mcp`| Servers in `~/.claude.json` and `.mcp.json`| Plugin MCP servers, [`managed-mcp.json`](</docs/en/managed-mcp>) servers
Surface names that a Claude Code version doesn’t recognize are ignored rather than failing the settings file, so you can add new surface names before all clients have updated.
--- a/setup.md
+++ b/setup.md
@@ -22,7 +22,7 @@
* Alpine Linux 3.19+
* **Hardware** : 4 GB+ RAM, x64 or ARM64 processor
* **Network** : internet connection required. See [network configuration](</docs/en/network-config#network-access-requirements>).
- * **Shell** : Bash, Zsh, PowerShell, or CMD. On native Windows, [Git for Windows](<https://git-scm.com/downloads/win>) is recommended; Claude Code falls back to PowerShell when Git Bash is absent. WSL setups do not require Git for Windows.
+ * **Shell** : Bash, Zsh, PowerShell, or CMD.
* **Location** : [Anthropic supported countries](<https://www.anthropic.com/supported-countries>)
###
@@ -91,19 +91,22 @@
Option| Requires| [Sandboxing](</docs/en/sandboxing>)| When to use
---|---|---|---
-Native Windows| [Git for Windows](<https://git-scm.com/downloads/win>) recommended; PowerShell used if absent| Not supported| Windows-native projects and tools
+Native Windows| None; [Git for Windows](<https://git-scm.com/downloads/win>) is optional| Not supported| Windows-native projects and tools
WSL 2| WSL 2 enabled| Supported| Linux toolchains or sandboxed command execution
WSL 1| WSL 1 enabled| Not supported| If WSL 2 is unavailable
-**Option 1: Native Windows with Git Bash** Install [Git for Windows](<https://git-scm.com/downloads/win>), then run the install command from PowerShell or CMD. You do not need to run as Administrator. Whether you install from PowerShell or CMD only affects which install command you run. Your prompt shows `PS C:\Users\YourName>` in PowerShell and `C:\Users\YourName>` without the `PS` in CMD. If you’re new to the terminal, the [terminal guide](</docs/en/terminal-guide#windows>) walks through each step. After installation, launch `claude` from PowerShell, CMD, or Git Bash. When Git Bash is installed, Claude Code uses it internally to execute commands regardless of where you launched it. If Claude Code can’t find your Git Bash installation, set the path in your [settings.json file](</docs/en/settings>):
-
- {
- "env": {
- "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
- }
- }
-
-Claude Code can also run PowerShell natively on Windows. When Git Bash is installed, the PowerShell tool is rolling out progressively as an additional option: set `CLAUDE_CODE_USE_POWERSHELL_TOOL=1` to opt in or `0` to opt out. See [PowerShell tool](</docs/en/tools-reference#powershell-tool>) for setup and limitations. **Option 2: WSL** Open your WSL distribution and run the Linux installer from the install instructions above. You install and launch `claude` inside the WSL terminal, not from PowerShell or CMD.
+**Option 1: Native Windows** Run the install command from PowerShell or CMD. You do not need to run as Administrator. Installing [Git for Windows](<https://git-scm.com/downloads/win>) is optional. It enables the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) by providing Git Bash. Whether you install from PowerShell or CMD only affects which install command you run. Your prompt shows `PS C:\Users\YourName>` in PowerShell and `C:\Users\YourName>` without the `PS` in CMD. If you’re new to the terminal, the [terminal guide](</docs/en/terminal-guide#windows>) walks through each step. After installation, launch `claude` from any terminal.
+
+ * **Without Git for Windows** , Claude Code runs shell commands via the [PowerShell tool](</docs/en/tools-reference#powershell-tool>).
+ * **With Git for Windows** , Claude Code uses Git Bash for the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>). If Claude Code can’t find Git Bash, set the path in your [settings.json file](</docs/en/settings>):
+
+ {
+ "env": {
+ "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
+ }
+ }
+
+When Git for Windows is installed, the PowerShell tool is rolling out progressively as an additional option alongside Bash. Set `CLAUDE_CODE_USE_POWERSHELL_TOOL=1` to opt in or `0` to opt out. See [PowerShell tool](</docs/en/tools-reference#powershell-tool>) for setup and limitations. **Option 2: WSL** Open your WSL distribution and run the Linux installer from the install instructions above. You install and launch `claude` inside the WSL terminal, not from PowerShell or CMD.
###
--- a/skills.md
+++ b/skills.md
@@ -6,7 +6,7 @@
Skills extend what Claude can do. Create a `SKILL.md` file with instructions, and Claude adds it to its toolkit. Claude uses skills when relevant, or you can invoke one directly with `/skill-name`. Create a skill when you keep pasting the same instructions, checklist, or multi-step procedure into chat, or when a section of CLAUDE.md has grown into a procedure rather than a fact. Unlike CLAUDE.md content, a skill’s body loads only when it’s used, so long reference material costs almost nothing until you need it.
-For built-in commands like `/help` and `/compact`, and bundled skills like `/debug` and `/simplify`, see the [commands reference](</docs/en/commands>).**Custom commands have been merged into skills.** A file at `.claude/commands/deploy.md` and a skill at `.claude/skills/deploy/SKILL.md` both create `/deploy` and work the same way. Your existing `.claude/commands/` files keep working. Skills add optional features: a directory for supporting files, frontmatter to control whether you or Claude invokes them, and the ability for Claude to load them automatically when relevant.
+For built-in commands like `/help` and `/compact`, and bundled skills like `/debug` and `/code-review`, see the [commands reference](</docs/en/commands>).**Custom commands have been merged into skills.** A file at `.claude/commands/deploy.md` and a skill at `.claude/skills/deploy/SKILL.md` both create `/deploy` and work the same way. Your existing `.claude/commands/` files keep working. Skills add optional features: a directory for supporting files, frontmatter to control whether you or Claude invokes them, and the ability for Claude to load them automatically when relevant.
Claude Code skills follow the [Agent Skills](<https://agentskills.io>) open standard, which works across multiple AI tools. Claude Code extends the standard with additional features like invocation control, subagent execution, and dynamic context injection.
@@ -16,7 +16,7 @@
Bundled skills
-Claude Code includes a set of bundled skills that are available in every session, including `/simplify`, `/batch`, `/debug`, `/loop`, and `/claude-api`. Unlike most built-in commands, which execute fixed logic directly, bundled skills are prompt-based: they give Claude detailed instructions and let it orchestrate the work using its tools. You invoke them the same way as any other skill, by typing `/` followed by the skill name. Bundled skills are listed alongside built-in commands in the [commands reference](</docs/en/commands>), marked **Skill** in the Purpose column.
+Claude Code includes a set of bundled skills that are available in every session, including `/code-review`, `/batch`, `/debug`, `/loop`, and `/claude-api`. Unlike most built-in commands, which execute fixed logic directly, bundled skills are prompt-based: they give Claude detailed instructions and let it orchestrate the work using its tools. You invoke them the same way as any other skill, by typing `/` followed by the skill name. Bundled skills are listed alongside built-in commands in the [commands reference](</docs/en/commands>), marked **Skill** in the Purpose column.
###
--- a/tools-reference.md
+++ b/tools-reference.md
@@ -231,7 +231,7 @@
}
}
-On Windows, set the variable to `0` to opt out of the rollout. On Linux, macOS, and WSL, the tool requires PowerShell 7 or later: install `pwsh` and ensure it is on your `PATH`. On Windows, Claude Code auto-detects `pwsh.exe` for PowerShell 7+ with a fallback to `powershell.exe` for PowerShell 5.1. When the tool is enabled, Claude treats PowerShell as the primary shell. The Bash tool remains available for POSIX scripts when Git Bash is installed.
+On Windows, set the variable to `0` to opt out of the rollout. On Linux, macOS, and WSL, the tool requires PowerShell 7 or later: install `pwsh` and ensure it is on your `PATH`. On Windows, Claude Code auto-detects `pwsh.exe` for PowerShell 7+ with a fallback to `powershell.exe` for PowerShell 5.1. When the tool is enabled, Claude treats PowerShell as the primary shell. The Bash tool remains available for POSIX scripts when Git Bash is installed. Claude Code spawns PowerShell with `-ExecutionPolicy Bypass` at process scope only, so `.ps1` scripts and module imports work on default Windows installs without changing the machine’s policy. Process-scope bypass does not override Group Policy `MachinePolicy` or `UserPolicy`, so enterprise lockdowns still apply. To respect the machine’s effective execution policy instead, set `CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY=1`.
###
--- a/troubleshoot-install.md
+++ b/troubleshoot-install.md
@@ -18,7 +18,8 @@
---|---
`command not found: claude` or `'claude' is not recognized`| Fix your PATH
`syntax error near unexpected token '<'`| Install script returns HTML
-`curl: (56) Failure writing output to destination`| Check connectivity or use an alternative installer
+`curl: (22) The requested URL returned error: 403`| Install script returned 403
+`curl: (23)` or `curl: (56) Failure writing output to destination`| Check connectivity or use an alternative installer
`Killed` during install on Linux| Add swap space for low-memory servers
`TLS connect error` or `SSL/TLS secure channel`| Update CA certificates
`Failed to fetch version` or can’t reach download server| Check network and proxy settings
@@ -240,7 +241,11 @@
Invoke-Expression: Missing argument in parameter list.
-This means the install URL returned an HTML page instead of the install script. If the HTML page says “App unavailable in region,” Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). Otherwise, this can happen due to network issues, regional routing, or a temporary service disruption. **Solutions:**
+Depending on how the request was routed, you may instead see a 403 with no HTML body:
+
+ curl: (22) The requested URL returned error: 403
+
+These all mean the install URL returned an HTML page or an error status instead of the install script. If the HTML page says “App unavailable in region,” Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). A bare 403 with no body often has the same cause, but it can also come from a corporate proxy or firewall blocking the download. If you are in a supported country and still see the 403, work through Check network connectivity before trying the alternative installers below, since those reach the same hosts. Otherwise, this can happen due to network issues, regional routing, or a temporary service disruption. **Solutions:**
1. **Use an alternative install method** : On macOS, install via Homebrew:
@@ -275,7 +280,7 @@
`curl: (56) Failure writing output to destination`
-The `curl ... | bash` command downloads the script and pipes it to Bash for execution. This error means the connection broke before the script finished downloading. Common causes include network interruptions, the download being blocked mid-stream, or system resource limits. **Solutions:**
+The `curl ... | bash` command downloads the script and pipes it to Bash for execution. This error, and the related `curl: (23) Failure writing output to destination`, means Bash did not receive the complete script. Exit code 56 indicates the download itself was interrupted, and exit code 23 indicates curl could not write what it received to the pipe, usually because Bash exited early. **Solutions:**
1. **Check network stability** : Claude Code binaries are hosted at `downloads.claude.ai`. Test that you can reach it:
@@ -442,12 +447,7 @@
Claude Code on Windows requires either Git for Windows (for bash) or PowerShell
-Claude Code on native Windows needs at least one shell: either [Git for Windows](<https://git-scm.com/downloads/win>) for Bash, or PowerShell. When neither is found, this error appears at startup. If only PowerShell is found, Claude Code uses the PowerShell tool instead of Bash. **If neither is installed** , install one:
-
- * Git for Windows: download from [git-scm.com/downloads/win](<https://git-scm.com/downloads/win>). During setup, select “Add to PATH.” Restart your terminal after installing.
- * PowerShell 7: download from [aka.ms/powershell](<https://aka.ms/powershell>).
-
-**If Git is already installed** but Claude Code can’t find it, set the path in your [settings.json file](</docs/en/settings>):
+Git for Windows is optional. Claude Code uses the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) when Git Bash is absent, so this error means neither shell was found. **If PowerShell is missing from your PATH** , its default location is `C:\Windows\System32\WindowsPowerShell\v1.0\`. Add that directory to your `PATH`, or install [PowerShell 7](<https://aka.ms/powershell>), which provides `pwsh`. **To install Git for Windows instead** , download it from [git-scm.com/downloads/win](<https://git-scm.com/downloads/win>). During setup, select “Add to PATH.” Restart your terminal after installing. Installing it enables the Bash tool, useful when working with Bash-based scripts and tooling. **If Git is already installed** but Claude Code can’t find it, set the path in your [settings.json file](</docs/en/settings>):
{
"env": {
--- a/typescript.md
+++ b/typescript.md
@@ -3235,6 +3235,8 @@
signal: AbortSignal;
}
+The `signal` field tells your spawn function when to tear down the process. Pass it as the `signal` option to Node’s `spawn()`, or pass it to your VM or container teardown handler.This signal does not fire the instant `Options.abortController` aborts. The SDK first closes the process’s stdin and waits about two seconds so the CLI can shut down cleanly, then aborts this signal. To react the moment the caller aborts instead, listen on your own `Options.abortController.signal`, which your spawn function can reference from its enclosing scope.
+
###