SpyBara
Go Premium

Documentation 2026-05-21 06:36 UTC to 2026-05-22 06:33 UTC

30 files changed +816 −479. View all changes and history on the product overview
2026
Sun 31 06:39 Sat 30 06:23 Fri 29 06:38 Thu 28 06:37 Wed 27 06:42 Tue 26 06:33 Sun 24 06:25 Sat 23 06:18 Fri 22 06:33 Thu 21 06:36 Wed 20 06:35 Tue 19 06:34 Mon 18 23:59 Sun 17 01:01 Fri 15 22:58 Thu 14 17:02 Wed 13 23:01 Tue 12 22:57 Mon 11 23:00 Sun 10 23:03 Sat 9 04:57 Fri 8 22:00 Thu 7 22:59 Tue 5 23:00 Mon 4 22:58 Sat 2 18:14 Fri 1 18:19
Details

68Managed settings can lock down tools, sandbox execution, restrict MCP servers and plugin sources, and control which hooks run. Each row is a control surface with the setting keys that drive it.68Managed settings can lock down tools, sandbox execution, restrict MCP servers and plugin sources, and control which hooks run. Each row is a control surface with the setting keys that drive it.

69 69 

70| Control | What it does | Key settings |70| Control | What it does | Key settings |

71| :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |71| :------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------- |

72| [Permission rules](/en/permissions) | Allow, ask, or deny specific tools and commands | `permissions.allow`, `permissions.deny` |72| [Permission rules](/en/permissions) | Allow, ask, or deny specific tools and commands | `permissions.allow`, `permissions.deny` |

73| [Permission lockdown](/en/permissions#managed-only-settings) | Only managed permission rules apply; disable `--dangerously-skip-permissions` | `allowManagedPermissionRulesOnly`, `permissions.disableBypassPermissionsMode` |73| [Permission lockdown](/en/permissions#managed-only-settings) | Only managed permission rules apply; disable `--dangerously-skip-permissions` | `allowManagedPermissionRulesOnly`, `permissions.disableBypassPermissionsMode` |

74| [Sandboxing](/en/sandboxing) | OS-level filesystem and network isolation with domain allowlists | `sandbox.enabled`, `sandbox.network.allowedDomains` |74| [Sandboxing](/en/sandboxing) | OS-level filesystem and network isolation with domain allowlists | `sandbox.enabled`, `sandbox.network.allowedDomains` |

75| [Managed policy CLAUDE.md](/en/memory#deploy-organization-wide-claude-md) | Org-wide instructions loaded in every session, cannot be excluded | File at the managed policy path |75| [Managed policy CLAUDE.md](/en/memory#deploy-organization-wide-claude-md) | Org-wide instructions loaded in every session, cannot be excluded | File at the managed policy path |

76| [MCP server control](/en/mcp#managed-mcp-configuration) | Restrict which MCP servers users can add or connect to | `allowedMcpServers`, `deniedMcpServers`, `allowManagedMcpServersOnly` |76| [MCP server control](/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 |

77| [Plugin marketplace control](/en/plugin-marketplaces#managed-marketplace-restrictions) | Restrict which marketplace sources users can add and install from | `strictKnownMarketplaces`, `blockedMarketplaces` |77| [Plugin marketplace control](/en/plugin-marketplaces#managed-marketplace-restrictions) | Restrict which marketplace sources users can add and install from | `strictKnownMarketplaces`, `blockedMarketplaces` |

78| [Customization lockdown](/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` |78| [Customization lockdown](/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` |

79| [Hook restrictions](/en/settings#hook-configuration) | Only managed hooks load; restrict HTTP hook URLs | `allowManagedHooksOnly`, `allowedHttpHookUrls` |79| [Hook restrictions](/en/settings#hook-configuration) | Only managed hooks load; restrict HTTP hook URLs | `allowManagedHooksOnly`, `allowedHttpHookUrls` |

Details

2885}2885}

2886```2886```

2887 2887 

2888<Note>

2889 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.

2890 

2891 This signal does not fire the instant [`Options.abortController`](#options) 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.

2892</Note>

2893 

2888### `McpSetServersResult`2894### `McpSetServersResult`

2889 2895 

2890Result of a `setMcpServers()` operation.2896Result of a `setMcpServers()` operation.

Details

176 176 

177Within a group:177Within a group:

178 178 

179* Press `Ctrl+T` to pin a session to the top179* Press `Ctrl+T` to pin a session to the top and [keep its process running](#the-supervisor-process) while idle

180* Press `Shift+↑` or `Shift+↓` to reorder sessions180* Press `Shift+↑` or `Shift+↓` to reorder sessions

181* Press `Ctrl+R` to rename a session181* Press `Ctrl+R` to rename a session

182* Press `Enter` on a group header to collapse it182* Press `Enter` on a group header to collapse it


421 421 

422Each 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.422Each 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.

423 423 

424Once 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.424Once a session finishes and sits unattached for about an hour, the supervisor stops its process to free resources. A session you have [pinned](#organize-the-list) 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.

425 425 

426The supervisor watches the installed Claude Code binary on disk and restarts into the new version after the regular [auto-updater](/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.426When the host runs low on memory, the supervisor stops idle non-pinned sessions first and stops idle pinned ones only if that freed nothing.

427 

428The supervisor watches the installed Claude Code binary on disk and restarts into the new version after the regular [auto-updater](/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.

427 429 

428### Where state is stored430### Where state is stored

429 431 


469 471 

470### A session is slow to respond after attaching472### A session is slow to respond after attaching

471 473 

472Once 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.474Once 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](#organize-the-list) are not stopped this way, so pin a session with `Ctrl+T` to keep it responsive.

473 475 

474### `.claude/worktrees/` is filling up476### `.claude/worktrees/` is filling up

475 477 

Details

9[Auto mode](/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.9[Auto mode](/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.

10 10 

11<Note>11<Note>

12 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](/en/permission-modes#eliminate-prompts-with-auto-mode), which also cover the supported models and admin enablement on Team and Enterprise plans.12 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](/en/permission-modes#eliminate-prompts-with-auto-mode), which also cover the supported models and admin enablement on Team and Enterprise plans.

13</Note>13</Note>

14 14 

15Out 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`.15Out 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`.


138```138```

139 139 

140<Danger>140<Danger>

141 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.141 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.

142</Danger>142</Danger>

143 143 

144Each 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.144Each 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.

en/commands.md +3 −3

Details

22 22 

23**Running work in parallel.** `/agents` opens the manager for the [subagents](/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](/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](/en/worktrees). See [Run agents in parallel](/en/agents) for how these approaches relate.23**Running work in parallel.** `/agents` opens the manager for the [subagents](/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](/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](/en/worktrees). See [Run agents in parallel](/en/agents) for how these approaches relate.

24 24 

25**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.25**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.

26 26 

27**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.27**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.

28 28 


39</Note>39</Note>

40 40 

41| Command | Purpose |41| Command | Purpose |

42| :---------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |42| :------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

43| `/add-dir <path>` | Add a working directory for file access during the current session. Most `.claude/` configuration is [not discovered](/en/permissions#additional-directories-grant-file-access-not-configuration) from the added directory. You can later resume the session from the added directory with `--continue` or `--resume` |43| `/add-dir <path>` | Add a working directory for file access during the current session. Most `.claude/` configuration is [not discovered](/en/permissions#additional-directories-grant-file-access-not-configuration) from the added directory. You can later resume the session from the added directory with `--continue` or `--resume` |

44| `/agents` | Manage [agent](/en/sub-agents) configurations |44| `/agents` | Manage [agent](/en/sub-agents) configurations |

45| `/autofix-pr [prompt]` | Spawn a [Claude Code on the web](/en/claude-code-on-the-web#auto-fix-pull-requests) session that watches the current branch's PR and pushes fixes when CI fails or reviewers leave comments. Detects the open PR from your checked-out branch with `gh pr view`; to watch a different PR, check out its branch first. By default the remote session is told to fix every CI failure and review comment; pass a prompt to give it different instructions, for example `/autofix-pr only fix lint and type errors`. Requires the `gh` CLI and access to [Claude Code on the web](/en/claude-code-on-the-web#who-can-use-claude-code-on-the-web) |45| `/autofix-pr [prompt]` | Spawn a [Claude Code on the web](/en/claude-code-on-the-web#auto-fix-pull-requests) session that watches the current branch's PR and pushes fixes when CI fails or reviewers leave comments. Detects the open PR from your checked-out branch with `gh pr view`; to watch a different PR, check out its branch first. By default the remote session is told to fix every CI failure and review comment; pass a prompt to give it different instructions, for example `/autofix-pr only fix lint and type errors`. Requires the `gh` CLI and access to [Claude Code on the web](/en/claude-code-on-the-web#who-can-use-claude-code-on-the-web) |


50| `/chrome` | Configure [Claude in Chrome](/en/chrome) settings |50| `/chrome` | Configure [Claude in Chrome](/en/chrome) settings |

51| `/claude-api [migrate\|managed-agents-onboard]` | **[Skill](/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 |51| `/claude-api [migrate\|managed-agents-onboard]` | **[Skill](/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 |

52| `/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` |52| `/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` |

53| `/code-review [low\|medium\|high\|xhigh\|max] [--comment] [target]` | **[Skill](/en/skills#bundled-skills).** Review the current diff for correctness bugs and report findings without editing files. Lower [effort levels](/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 |

53| `/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](/en/remote-control) is connected, the color syncs to claude.ai/code |54| `/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](/en/remote-control) is connected, the color syncs to claude.ai/code |

54| `/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](/en/context-window#what-survives-compaction) |55| `/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](/en/context-window#what-survives-compaction) |

55| `/config` | Open the [Settings](/en/settings) interface to adjust theme, model, [output style](/en/output-styles), and other preferences. Alias: `/settings` |56| `/config` | Open the [Settings](/en/settings) interface to adjust theme, model, [output style](/en/output-styles), and other preferences. Alias: `/settings` |


109| `/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 |110| `/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 |

110| `/setup-bedrock` | Configure [Amazon Bedrock](/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 |111| `/setup-bedrock` | Configure [Amazon Bedrock](/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 |

111| `/setup-vertex` | Configure [Google Vertex AI](/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 |112| `/setup-vertex` | Configure [Google Vertex AI](/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 |

112| `/simplify [focus]` | **[Skill](/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` |

113| `/skills` | List available [skills](/en/skills). Press `t` to sort by token count. Press `Space` to [hide a skill from Claude or the `/` menu](/en/skills#override-skill-visibility-from-settings), then `Enter` to save |113| `/skills` | List available [skills](/en/skills). Press `t` to sort by token count. Press `Space` to [hide a skill from Claude or the `/` menu](/en/skills#override-skill-visibility-from-settings), then `Enter` to save |

114| `/stats` | Alias for `/usage`. Opens on the Stats tab |114| `/stats` | Alias for `/usage`. Opens on the Stats tab |

115| `/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 |115| `/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 |

en/desktop.md +1 −1

Details

78 78 

79<span id="auto-mode-availability" />79<span id="auto-mode-availability" />

80 80 

81Auto 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.81Auto 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.

82 82 

83<Tip title="Best practice">83<Tip title="Best practice">

84 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](/en/best-practices#explore-first-then-plan-then-code) for more on this workflow.84 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](/en/best-practices#explore-first-then-plan-then-code) for more on this workflow.

Details

190* [Network access requirements](/en/network-config#network-access-requirements): the full domain allowlist for proxies and firewalls190* [Network access requirements](/en/network-config#network-access-requirements): the full domain allowlist for proxies and firewalls

191* [Telemetry services and opt-out](/en/data-usage#telemetry-services): what Claude Code sends by default and the environment variables that disable it191* [Telemetry services and opt-out](/en/data-usage#telemetry-services): what Claude Code sends by default and the environment variables that disable it

192* [Explore the `.claude` directory](/en/claude-directory): what the volume mount holds, including credentials, settings, and session history192* [Explore the `.claude` directory](/en/claude-directory): what the volume mount holds, including credentials, settings, and session history

193* [Sandbox environments](/en/sandbox-environments): compare dev containers with the built-in Bash sandbox, custom containers, and VMs

193* [Security model](/en/security): how Claude Code's permission system, sandboxing, and prompt-injection protections fit together194* [Security model](/en/security): how Claude Code's permission system, sandboxing, and prompt-injection protections fit together

194* [Permission modes](/en/permission-modes): the full range from plan mode to auto mode to bypass, and when to use each195* [Permission modes](/en/permission-modes): the full range from plan mode to auto mode to bypass, and when to use each

en/env-vars.md +2 −2

Details

138| `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` | Return to the original working directory after each Bash or PowerShell command in the main session |138| `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` | Return to the original working directory after each Bash or PowerShell command in the main session |

139| `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 |139| `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 |

140| `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 |140| `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 |

141| `CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT` | Set to `1` to repaint the entire screen on every frame in [fullscreen rendering](/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 |141| `CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT` | Set to `1` to repaint the entire screen on every frame in [fullscreen rendering](/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](/en/agent-view) on Windows |

142| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval in milliseconds at which credentials should be refreshed (when using [`apiKeyHelper`](/en/settings#available-settings)) |142| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval in milliseconds at which credentials should be refreshed (when using [`apiKeyHelper`](/en/settings#available-settings)) |

143| `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](/en/llm-gateway). Anthropic API caching is unaffected |143| `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](/en/llm-gateway). Anthropic API caching is unaffected |

144| `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](/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 |144| `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](/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 |


308| `MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE` | Maximum number of remote MCP servers (HTTP/SSE) to connect in parallel during startup (default: 20) |308| `MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE` | Maximum number of remote MCP servers (HTTP/SSE) to connect in parallel during startup (default: 20) |

309| `MCP_SERVER_CONNECTION_BATCH_SIZE` | Maximum number of local MCP servers (stdio) to connect in parallel during startup (default: 3) |309| `MCP_SERVER_CONNECTION_BATCH_SIZE` | Maximum number of local MCP servers (stdio) to connect in parallel during startup (default: 3) |

310| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup (default: 30000, or 30 seconds) |310| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup (default: 30000, or 30 seconds) |

311| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution (default: 100000000, about 28 hours) |311| `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 |

312| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy |312| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy |

313| `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](/en/monitoring-usage#api-request-body-event) |313| `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](/en/monitoring-usage#api-request-body-event) |

314| `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](/en/monitoring-usage) |314| `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](/en/monitoring-usage) |

en/errors.md +30 −9

Details

20 20 

21| Message | Section |21| Message | Section |

22| :-------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------- |22| :-------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------- |

23| `API Error: 500 ... Internal server error` | [Server errors](#api-error-500-internal-server-error) |23| `API Error: 500 Internal server error` | [Server errors](#api-error-500-internal-server-error) |

24| `API Error: Repeated 529 Overloaded errors` | [Server errors](#api-error-repeated-529-overloaded-errors) |24| `API Error: Repeated 529 Overloaded errors` | [Server errors](#api-error-repeated-529-overloaded-errors) |

25| `Request timed out` | [Server errors](#request-timed-out), or [Network](#unable-to-connect-to-api) if the message mentions your internet connection |25| `Request timed out` | [Server errors](#request-timed-out), or [Network](#unable-to-connect-to-api) if the message mentions your internet connection |

26| `<model> is temporarily unavailable, so auto mode cannot determine the safety of...` | [Server errors](#auto-mode-cannot-determine-the-safety-of-an-action) |26| `<model> is temporarily unavailable, so auto mode cannot determine the safety of...` | [Server errors](#auto-mode-cannot-determine-the-safety-of-an-action) |


44| `Error during compaction: Conversation too long` | [Request errors](#error-during-compaction-conversation-too-long) |44| `Error during compaction: Conversation too long` | [Request errors](#error-during-compaction-conversation-too-long) |

45| `Request too large` | [Request errors](#request-too-large) |45| `Request too large` | [Request errors](#request-too-large) |

46| `Image was too large` | [Request errors](#image-was-too-large) |46| `Image was too large` | [Request errors](#image-was-too-large) |

47| `Unable to resize image` | [Request errors](#unable-to-resize-image) |

47| `PDF too large` / `PDF is password protected` | [Request errors](#pdf-errors) |48| `PDF too large` / `PDF is password protected` | [Request errors](#pdf-errors) |

48| `Extra inputs are not permitted` | [Request errors](#extra-inputs-are-not-permitted) |49| `Extra inputs are not permitted` | [Request errors](#extra-inputs-are-not-permitted) |

49| `There's an issue with the selected model` | [Request errors](#theres-an-issue-with-the-selected-model) |50| `There's an issue with the selected model` | [Request errors](#theres-an-issue-with-the-selected-model) |


67 68 

68## Server errors69## Server errors

69 70 

70These errors come from Anthropic infrastructure rather than your account or request.71These 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.

71 72 

72### API Error: 500 Internal server error73### API Error: 500 Internal server error

73 74 

74Claude Code shows the raw API response body for any 5xx status. The example below shows a 500 response:75Claude 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:

75 76 

76```text theme={null}77```text theme={null}

77API Error: 500 {"type":"error","error":{"type":"api_error","message":"Internal server error"}} · check status.claude.com78API 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.

78```79```

79 80 

81The 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.

82 

80This indicates an unexpected failure inside the API. It is not caused by your prompt, settings, or account.83This indicates an unexpected failure inside the API. It is not caused by your prompt, settings, or account.

81 84 

82**What to do:**85**What to do:**

83 86 

84* Check [status.claude.com](https://status.claude.com) for active incidents87* Check [status.claude.com](https://status.claude.com), or the provider status page named in the message, for active incidents

85* 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.88* 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.

86* If the error persists with no posted incident, run `/feedback` so Anthropic can investigate with your request details. See [Report an error](#report-an-error) if `/feedback` is unavailable in your environment.89* If the error persists with no posted incident, run `/feedback` so Anthropic can investigate with your request details. See [Report an error](#report-an-error) if `/feedback` is unavailable in your environment.

87 90 


90The API is temporarily at capacity across all users. Claude Code has already retried several times before showing this message:93The API is temporarily at capacity across all users. Claude Code has already retried several times before showing this message:

91 94 

92```text theme={null}95```text theme={null}

93API Error: Repeated 529 Overloaded errors · check status.claude.com96API 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.

94```97```

95 98 

96A 529 is not your usage limit and does not count against your quota.99The 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.

97 100 

98**What to do:**101**What to do:**

99 102 

100* Check [status.claude.com](https://status.claude.com) for capacity notices103* Check [status.claude.com](https://status.claude.com), or the provider status page named in the message, for capacity notices

101* Try again in a few minutes104* Try again in a few minutes

102* 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`.105* 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`.

103 106 


208API Error: Request rejected (429) · this may be a temporary capacity issue. If it persists, check status.claude.com.211API Error: Request rejected (429) · this may be a temporary capacity issue. If it persists, check status.claude.com.

209```212```

210 213 

211The 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.214The 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.

212 215 

213**What to do:**216**What to do:**

214 217 


485* Resize the image before pasting. The API accepts images up to 8000 pixels on the longest edge for a single image, or 2000 pixels when many images are in context.488* Resize the image before pasting. The API accepts images up to 8000 pixels on the longest edge for a single image, or 2000 pixels when many images are in context.

486* Take a tighter screenshot of the relevant region instead of the full screen489* Take a tighter screenshot of the relevant region instead of the full screen

487 490 

491### Unable to resize image

492 

493Claude Code could not downscale an attached image before sending it to the API.

494 

495```text theme={null}

496Unable 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.

497Unable to resize image — dimensions exceed the 2000x2000px limit and image processing failed. Please resize the image to reduce its pixel dimensions.

498Unable to resize image (… raw, … base64). The image exceeds the … API limit and compression failed. Please resize the image manually or use a smaller image.

499Unable to resize image — could not verify image dimensions are within the 2000x2000px API limit.

500```

501 

502Claude 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.

503 

504**What to do:**

505 

506* 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.

507* If the message reports a dimension or size limit, resize or recompress the image below that limit before attaching.

508 

488### PDF errors509### PDF errors

489 510 

490The PDF you attached could not be processed.511The PDF you attached could not be processed.

Details

243 </Tab>243 </Tab>

244 244 

245 <Tab title="Skills">245 <Tab title="Skills">

246 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](/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.246 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](/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.

247 247 

248 **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.248 **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.

249 249 

en/glossary.md +2 −2

Details

42 42 

43### Auto mode43### Auto mode

44 44 

45A [permission mode](#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](#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.45A [permission mode](#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](#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.

46 46 

47Learn more: [Eliminate prompts with auto mode](/en/permission-modes#eliminate-prompts-with-auto-mode)47Learn more: [Eliminate prompts with auto mode](/en/permission-modes#eliminate-prompts-with-auto-mode)

48 48 


56 56 

57### Bundled skills57### Bundled skills

58 58 

59Prompt-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.59Prompt-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.

60 60 

61Learn more: [Bundled skills](/en/skills#bundled-skills)61Learn more: [Bundled skills](/en/skills#bundled-skills)

62 62 

Details

214 214 

215* Input history is stored per working directory215* Input history is stored per working directory

216* Input history resets when you run `/clear` to start a new session. The previous session's conversation is preserved and can be resumed.216* Input history resets when you run `/clear` to start a new session. The previous session's conversation is preserved and can be resumed.

217* Submitting the same prompt twice in a row records one history entry, so pressing Up steps to the previous distinct prompt

217* Use Up/Down arrows to navigate (see keyboard shortcuts above)218* Use Up/Down arrows to navigate (see keyboard shortcuts above)

218* **Note**: history expansion (`!`) is disabled by default219* **Note**: history expansion (`!`) is disabled by default

219 220 

Details

150Actions available in the `Confirmation` context for permission dialogs:150Actions available in the `Confirmation` context for permission dialogs:

151 151 

152| Action | Default | Description |152| Action | Default | Description |

153| :----------------------- | :------ | :--------------------------- |153| :----------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------ |

154| `permission:toggleDebug` | Ctrl+D | Toggle permission debug info |154| `permission:toggleDebug` | (unbound) | Toggle permission debug info. The previous default of Ctrl+D was removed in v2.1.146 because it shadowed `app:exit` |

155 155 

156### Transcript actions156### Transcript actions

157 157 

en/managed-mcp.md +340 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Control MCP server access for your organization

6 

7> Restrict which MCP servers users can add or connect to with managed configuration files, allowlists, and denylists.

8 

9By default, anyone running Claude Code can connect any [MCP server](/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.

10 

11This page covers how to:

12 

13* [Choose a pattern](#choose-a-pattern) that matches how much control you need

14* [Deploy a fixed server set with `managed-mcp.json`](#exclusive-control-with-managed-mcp-json), including how to [disable MCP entirely](#disable-mcp-entirely)

15* [Control servers with allowlists and denylists](#policy-based-control-with-allowlists-and-denylists)

16* [Tell users what to expect](#how-restrictions-appear-to-users) when a restriction blocks a server

17* [Monitor which servers your organization actually uses](#monitor-mcp-usage)

18 

19<Note>

20 The [Security](/en/security) page covers the MCP threat model and how to evaluate a server before approving it. [Decide what to enforce](/en/admin-setup#decide-what-to-enforce) covers MCP restrictions alongside the other administrative controls.

21</Note>

22 

23## Choose a pattern

24 

25Claude 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.

26 

27| Pattern | What it does | Configure |

28| :---------------------- | :----------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------- |

29| **Disable MCP** | No servers load anywhere | `managed-mcp.json` with an empty server map |

30| **Fixed deployment** | Every user gets the same servers and can't add others | `managed-mcp.json` with the servers you want |

31| **Approved catalog** | Publish a list of approved servers; users add the ones they want, anything else is blocked | `allowedMcpServers` + `allowManagedMcpServersOnly: true` |

32| **Plugin servers only** | Servers can only come from plugins; users can't add their own | [`strictPluginOnlyCustomization`](/en/settings#strictpluginonlycustomization) with `mcp` in the list |

33| **Soft allowlist** | Enforce an allowlist that users can broaden in their own settings | `allowedMcpServers` without `allowManagedMcpServersOnly` |

34| **Denylist only** | Block known-bad servers, allow everything else | `deniedMcpServers` |

35| **No restrictions** | Users add anything | Don't deploy any managed MCP configuration |

36 

37<Note>

38 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](/en/plugin-marketplaces#managed-marketplace-restrictions) so users can browse and install them from `/plugin`.

39</Note>

40 

41## Exclusive control with managed-mcp.json

42 

43If 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.

44 

45Two other settings can further filter the managed set:

46 

47* `allowedMcpServers` and `deniedMcpServers` apply to managed servers too, so a managed server that doesn't pass them won't load.

48* A user's own `deniedMcpServers` merges in from their settings, so users can block a managed server for themselves.

49 

50See [How a server is evaluated](#how-a-server-is-evaluated) for the full order of checks.

51 

52`managed-mcp.json` is a standalone file, so it cannot be delivered through [server-managed settings](/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:

53 

54| Platform | Path |

55| :------------ | :--------------------------------------------------------- |

56| macOS | `/Library/Application Support/ClaudeCode/managed-mcp.json` |

57| Linux and WSL | `/etc/claude-code/managed-mcp.json` |

58| Windows | `C:\Program Files\ClaudeCode\managed-mcp.json` |

59 

60The file uses the same format as a project [`.mcp.json`](/en/mcp#project-scope) file:

61 

62```json theme={null}

63{

64 "mcpServers": {

65 "github": {

66 "type": "http",

67 "url": "https://api.githubcopilot.com/mcp/"

68 },

69 "sentry": {

70 "type": "http",

71 "url": "https://mcp.sentry.dev/mcp"

72 },

73 "company-internal": {

74 "type": "stdio",

75 "command": "/usr/local/bin/company-mcp-server",

76 "args": ["--config", "/etc/company/mcp-config.json"],

77 "env": {

78 "COMPANY_API_URL": "https://internal.example.com"

79 }

80 }

81 }

82}

83```

84 

85### Authenticate with per-user credentials

86 

87Any 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:

88 

89* [`${VAR}` expansion](/en/mcp#environment-variable-expansion-in-mcp-json) to read secrets from each user's environment.

90* [OAuth or per-user headers](/en/mcp#authenticate-with-remote-mcp-servers) so each user authenticates as themselves.

91* [`headersHelper`](/en/mcp#use-dynamic-headers-for-custom-authentication) to generate credentials at connection time.

92 

93### Validate the configuration

94 

95To confirm the file is in effect, run two checks on a managed machine:

96 

971. `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.

982. `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.

99 

100### Disable MCP entirely

101 

102Deploy a `managed-mcp.json` containing an empty server map to block every MCP server:

103 

104```json theme={null}

105{

106 "mcpServers": {}

107}

108```

109 

110Users 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.

111 

112## Policy-based control with allowlists and denylists

113 

114Allowlists 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`](#exclusive-control-with-managed-mcp-json).

115 

116To make the allowlist authoritative, set `allowedMcpServers` and `allowManagedMcpServersOnly: true` together in a [managed settings source](/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](#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.

117 

118<Note>

119 `allowManagedMcpServersOnly` is separate from `allowManagedPermissionRulesOnly`, which locks down [permission rules](/en/permissions#managed-settings) only. Setting that flag does not enforce the MCP allowlist.

120</Note>

121 

122### Match servers by URL, command, or name

123 

124`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:

125 

126| Key | Matches | Use for |

127| :-------------- | :-------------------------------------------------------------------- | :------------------------------------- |

128| `serverUrl` | A remote server URL, exact or with `*` wildcards | HTTP and SSE servers |

129| `serverCommand` | The exact command and arguments that start a stdio server | Stdio servers |

130| `serverName` | The user-assigned label. Exact match only; wildcards are not expanded | Either type, but see the Warning below |

131 

132Leaving `allowedMcpServers` unset is different from setting it to an empty array:

133 

134| Setting | Unset (default) | Empty array `[]` | Populated |

135| :------------------ | :------------------ | :----------------- | :---------------------------- |

136| `allowedMcpServers` | All servers allowed | No servers allowed | Only matching servers allowed |

137| `deniedMcpServers` | No servers blocked | No servers blocked | Matching servers blocked |

138 

139<Warning>

140 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.

141</Warning>

142 

143### How a server is evaluated

144 

145Before loading a server, including one from `managed-mcp.json`, Claude Code runs three checks in order:

146 

1471. **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.

1482. **Check the denylist.** A server that matches any denylist entry, by URL, command, or name, is blocked. Nothing overrides a denylist match.

1493. **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.

150 

151| Server type | Allowed when it matches |

152| :------------------- | :--------------------------------------------------------------------------------------------------------------- |

153| Remote (HTTP or SSE) | A `serverUrl` entry. A `serverName` match counts only when the allowlist contains no `serverUrl` entries |

154| Stdio | A `serverCommand` entry. A `serverName` match counts only when the allowlist contains no `serverCommand` entries |

155 

156Two matching rules apply inside those checks:

157 

158* **Commands match exactly.** Every argument, in order. `["npx", "-y", "server"]` does not match `["npx", "server"]` or `["npx", "-y", "server", "--flag"]`.

159* **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.

160 

161| Pattern | Allows |

162| :-------------------------- | :--------------------------------------------------------------------- |

163| `https://mcp.example.com/*` | All paths on a specific domain |

164| `https://mcp.example.com` | Also all paths on that domain. A pattern with no path matches any path |

165| `https://*.example.com/*` | Any subdomain of `example.com` |

166| `http://localhost:*/*` | Any port on localhost |

167| `*://mcp.example.com/*` | Any scheme to a specific domain |

168 

169### Example configuration

170 

171The 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:

172 

173```json {3,5,11} theme={null}

174{

175 "allowedMcpServers": [

176 { "serverUrl": "https://api.githubcopilot.com/*" },

177 { "serverUrl": "https://mcp.sentry.dev/*" },

178 { "serverCommand": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "."] },

179 { "serverCommand": ["python", "/usr/local/bin/approved-server.py"] },

180 { "serverUrl": "https://mcp.example.com/*" },

181 { "serverUrl": "https://*.internal.example.com/*" }

182 ],

183 "deniedMcpServers": [

184 { "serverName": "dangerous-server" },

185 { "serverCommand": ["npx", "-y", "unapproved-package"] },

186 { "serverUrl": "https://*.untrusted.example.com/*" }

187 ]

188}

189```

190 

191* **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.

192* **Line 5**: the first `serverCommand` entry. Same effect for stdio servers, so every local server must match a listed command exactly.

193* **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.

194 

195A `serverName` entry in this allowlist would never match anything, since both transport types already have stricter entries.

196 

197The accordions below walk through how a server is evaluated against other allowlist and denylist combinations.

198 

199<Accordion title="URL-only allowlist">

200 ```json theme={null}

201 {

202 "allowedMcpServers": [

203 { "serverUrl": "https://mcp.example.com/*" },

204 { "serverUrl": "https://*.internal.example.com/*" }

205 ]

206 }

207 ```

208 

209 | Server | Result |

210 | :---------------------------------------------------- | :------------------------------------------- |

211 | HTTP server at `https://mcp.example.com/api` | Allowed: matches URL pattern |

212 | HTTP server at `https://api.internal.example.com/mcp` | Allowed: matches wildcard subdomain |

213 | HTTP server at `https://external.example.com/mcp` | Blocked: doesn't match any URL pattern |

214 | Stdio server with any command | Blocked: no name or command entries to match |

215</Accordion>

216 

217<Accordion title="Command-only allowlist">

218 ```json theme={null}

219 {

220 "allowedMcpServers": [

221 { "serverCommand": ["npx", "-y", "approved-package"] }

222 ]

223 }

224 ```

225 

226 | Server | Result |

227 | :---------------------------------------------------- | :-------------------------------- |

228 | Stdio server with `["npx", "-y", "approved-package"]` | Allowed: matches command |

229 | Stdio server with `["node", "server.js"]` | Blocked: doesn't match command |

230 | HTTP server named `my-api` | Blocked: no name entries to match |

231</Accordion>

232 

233<Accordion title="Mixed name and command allowlist">

234 ```json theme={null}

235 {

236 "allowedMcpServers": [

237 { "serverName": "github" },

238 { "serverCommand": ["npx", "-y", "approved-package"] }

239 ]

240 }

241 ```

242 

243 | Server | Result |

244 | :----------------------------------------------------------------------- | :-------------------------------------------------------------------- |

245 | Stdio server named `local-tool` with `["npx", "-y", "approved-package"]` | Allowed: matches command |

246 | Stdio server named `local-tool` with `["node", "server.js"]` | Blocked: command entries exist but doesn't match |

247 | Stdio server named `github` with `["node", "server.js"]` | Blocked: stdio servers must match commands when command entries exist |

248 | HTTP server named `github` | Allowed: matches name |

249 | HTTP server named `other-api` | Blocked: name doesn't match |

250</Accordion>

251 

252<Accordion title="Name-only allowlist">

253 ```json theme={null}

254 {

255 "allowedMcpServers": [

256 { "serverName": "github" },

257 { "serverName": "internal-tool" }

258 ]

259 }

260 ```

261 

262 | Server | Result |

263 | :-------------------------------------------------- | :------------------------------- |

264 | Stdio server named `github` with any command | Allowed: no command restrictions |

265 | Stdio server named `internal-tool` with any command | Allowed: no command restrictions |

266 | HTTP server named `github` | Allowed: matches name |

267 | Any server named `other` | Blocked: name doesn't match |

268</Accordion>

269 

270<Accordion title="Allowlist with denylist override">

271 ```json theme={null}

272 {

273 "allowedMcpServers": [

274 { "serverUrl": "https://*.example.com/*" }

275 ],

276 "deniedMcpServers": [

277 { "serverUrl": "https://staging.example.com/*" }

278 ]

279 }

280 ```

281 

282 | Server | Result |

283 | :----------------------------------------------- | :-------------------------------------------------------- |

284 | HTTP server at `https://mcp.example.com/api` | Allowed: matches allowlist URL pattern, no denylist match |

285 | HTTP server at `https://staging.example.com/api` | Blocked: matches both, but the denylist takes precedence |

286 | HTTP server at `https://other.com/mcp` | Blocked: doesn't match the allowlist |

287</Accordion>

288 

289### Restrict the allowlist to managed settings only

290 

291To make the managed allowlist the only one that applies, set `allowManagedMcpServersOnly` in the managed settings file:

292 

293```json theme={null}

294{

295 "allowManagedMcpServersOnly": true,

296 "allowedMcpServers": [

297 { "serverUrl": "https://api.githubcopilot.com/*" },

298 { "serverUrl": "https://*.internal.example.com/*" }

299 ]

300}

301```

302 

303When `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.

304 

305## How restrictions appear to users

306 

307When 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:

308 

309| Restriction | What the user sees |

310| :------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------- |

311| `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` |

312| 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` |

313| The server isn't on the allowlist and the user runs `claude mcp add` | `Cannot add MCP server "<name>": not allowed by enterprise policy` |

314| A previously configured server is now blocked by policy | The server silently disappears from `/mcp` and `claude mcp list` with no warning |

315 

316In 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.

317 

318## Monitor MCP usage

319 

320When [OpenTelemetry export](/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](/en/monitoring-usage) to set up the exporter and for the full event schema.

321 

322## Configuration summary

323 

324Every file and setting this page covers, what it controls, and how to deliver it:

325 

326| Surface | What it controls | Where it lives | How to deliver |

327| :--------------------------- | :------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

328| `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 |

329| `allowedMcpServers` | Allowlist of permitted servers | Any [settings file](/en/settings#settings-files); entries from every source merge unless `allowManagedMcpServersOnly` is set | For enforcement, a [managed settings source](/en/admin-setup#decide-how-settings-reach-devices): server-managed settings, `managed-settings.json`, MDM profile, or registry |

330| `deniedMcpServers` | Denylist of blocked servers | Any settings file; entries from every source merge | Same as `allowedMcpServers` |

331| `allowManagedMcpServersOnly` | Locks the allowlist to managed sources only | Managed settings sources only; the setting has no effect elsewhere | Same as `allowedMcpServers` |

332 

333## Related resources

334 

335* [Decide what to enforce](/en/admin-setup#decide-what-to-enforce): MCP restrictions alongside permission rules, sandboxing, and the other admin controls

336* [Connect Claude Code to tools via MCP](/en/mcp): the full MCP reference, including transports, scopes, and authentication

337* [Settings](/en/settings): the settings hierarchy and how managed settings take precedence

338* [Server-managed settings](/en/server-managed-settings): deliver `allowedMcpServers` and `deniedMcpServers` from the Claude.ai admin console

339* [Security](/en/security): the threat model these controls defend against

340* [Claude Enterprise Administrator Guide](https://claude.com/resources/tutorials/claude-enterprise-administrator-guide): SSO, SCIM, seat management, and rollout playbook

en/mcp.md +4 −227

Details

170 * `user`: Available to you across all projects (was called `global` in older versions)170 * `user`: Available to you across all projects (was called `global` in older versions)

171 * Set environment variables with `--env` flags (for example, `--env KEY=value`)171 * Set environment variables with `--env` flags (for example, `--env KEY=value`)

172 * Configure MCP server startup timeout using the MCP\_TIMEOUT environment variable (for example, `MCP_TIMEOUT=10000 claude` sets a 10-second timeout)172 * Configure MCP server startup timeout using the MCP\_TIMEOUT environment variable (for example, `MCP_TIMEOUT=10000 claude` sets a 10-second timeout)

173 * 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

173 * 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`)174 * 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`)

174 * Use `/mcp` to authenticate with remote servers that require OAuth 2.0 authentication175 * Use `/mcp` to authenticate with remote servers that require OAuth 2.0 authentication

175</Tip>176</Tip>

176 177 

178The 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.

179 

177### Plugin-provided MCP servers180### Plugin-provided MCP servers

178 181 

179[Plugins](/en/plugins) can bundle MCP servers, automatically providing tools and integrations when the plugin is enabled. Plugin MCP servers work identically to user-configured servers.182[Plugins](/en/plugins) can bundle MCP servers, automatically providing tools and integrations when the plugin is enabled. Plugin MCP servers work identically to user-configured servers.


1054 1057 

1055## Managed MCP configuration1058## Managed MCP configuration

1056 1059 

1057For organizations that need centralized control over MCP servers, Claude Code supports two configuration options:1060For organizations that need centralized control over which MCP servers users can connect to, see [Managed MCP configuration](/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.

1058 

10591. **Exclusive control with `managed-mcp.json`**: Deploy a fixed set of MCP servers that users cannot modify or extend

10602. **Policy-based control with allowlists/denylists**: Allow users to add their own servers, but restrict which ones are permitted

1061 

1062These options allow IT administrators to:

1063 

1064* **Control which MCP servers employees can access**: Deploy a standardized set of approved MCP servers across the organization

1065* **Prevent unauthorized MCP servers**: Restrict users from adding unapproved MCP servers

1066* **Disable MCP entirely**: Remove MCP functionality completely if needed

1067 

1068### Option 1: Exclusive control with managed-mcp.json

1069 

1070When 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.

1071 

1072System administrators deploy the configuration file to a system-wide directory:

1073 

1074* macOS: `/Library/Application Support/ClaudeCode/managed-mcp.json`

1075* Linux and WSL: `/etc/claude-code/managed-mcp.json`

1076* Windows: `C:\Program Files\ClaudeCode\managed-mcp.json`

1077 

1078<Note>

1079 These are system-wide paths (not user home directories like `~/Library/...`) that require administrator privileges. They are designed to be deployed by IT administrators.

1080</Note>

1081 

1082The `managed-mcp.json` file uses the same format as a standard `.mcp.json` file:

1083 

1084```json theme={null}

1085{

1086 "mcpServers": {

1087 "github": {

1088 "type": "http",

1089 "url": "https://api.githubcopilot.com/mcp/"

1090 },

1091 "sentry": {

1092 "type": "http",

1093 "url": "https://mcp.sentry.dev/mcp"

1094 },

1095 "company-internal": {

1096 "type": "stdio",

1097 "command": "/usr/local/bin/company-mcp-server",

1098 "args": ["--config", "/etc/company/mcp-config.json"],

1099 "env": {

1100 "COMPANY_API_URL": "https://internal.company.com"

1101 }

1102 }

1103 }

1104}

1105```

1106 

1107### Option 2: Policy-based control with allowlists and denylists

1108 

1109Instead 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](/en/settings#settings-files).

1110 

1111<Note>

1112 **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.

1113</Note>

1114 

1115#### Restriction options

1116 

1117Each entry in the allowlist or denylist can restrict servers in three ways:

1118 

11191. **By server name** (`serverName`): Matches the configured name of the server

11202. **By command** (`serverCommand`): Matches the exact command and arguments used to start stdio servers

11213. **By URL pattern** (`serverUrl`): Matches remote server URLs with wildcard support

1122 

1123**Important**: Each entry must have exactly one of `serverName`, `serverCommand`, or `serverUrl`.

1124 

1125#### Example configuration

1126 

1127```json theme={null}

1128{

1129 "allowedMcpServers": [

1130 // Allow by server name

1131 { "serverName": "github" },

1132 { "serverName": "sentry" },

1133 

1134 // Allow by exact command (for stdio servers)

1135 { "serverCommand": ["npx", "-y", "@modelcontextprotocol/server-filesystem"] },

1136 { "serverCommand": ["python", "/usr/local/bin/approved-server.py"] },

1137 

1138 // Allow by URL pattern (for remote servers)

1139 { "serverUrl": "https://mcp.company.com/*" },

1140 { "serverUrl": "https://*.internal.corp/*" }

1141 ],

1142 "deniedMcpServers": [

1143 // Block by server name

1144 { "serverName": "dangerous-server" },

1145 

1146 // Block by exact command (for stdio servers)

1147 { "serverCommand": ["npx", "-y", "unapproved-package"] },

1148 

1149 // Block by URL pattern (for remote servers)

1150 { "serverUrl": "https://*.untrusted.com/*" }

1151 ]

1152}

1153```

1154 

1155#### How command-based restrictions work

1156 

1157**Exact matching**:

1158 

1159* Command arrays must match **exactly** - both the command and all arguments in the correct order

1160* Example: `["npx", "-y", "server"]` will NOT match `["npx", "server"]` or `["npx", "-y", "server", "--flag"]`

1161 

1162**Stdio server behavior**:

1163 

1164* When the allowlist contains **any** `serverCommand` entries, stdio servers **must** match one of those commands

1165* Stdio servers cannot pass by name alone when command restrictions are present

1166* This ensures administrators can enforce which commands are allowed to run

1167 

1168**Non-stdio server behavior**:

1169 

1170* Remote servers (HTTP, SSE, WebSocket) use URL-based matching when `serverUrl` entries exist in the allowlist

1171* If no URL entries exist, remote servers fall back to name-based matching

1172* Command restrictions do not apply to remote servers

1173 

1174#### How URL-based restrictions work

1175 

1176URL patterns support wildcards using `*` to match any sequence of characters. This is useful for allowing entire domains or subdomains.

1177 

1178**Wildcard examples**:

1179 

1180* `https://mcp.company.com/*` - Allow all paths on a specific domain

1181* `https://*.example.com/*` - Allow any subdomain of example.com

1182* `http://localhost:*/*` - Allow any port on localhost

1183 

1184Hostname 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.

1185 

1186**Remote server behavior**:

1187 

1188* When the allowlist contains **any** `serverUrl` entries, remote servers **must** match one of those URL patterns

1189* Remote servers cannot pass by name alone when URL restrictions are present

1190* This ensures administrators can enforce which remote endpoints are allowed

1191 

1192<Accordion title="Example: URL-only allowlist">

1193 ```json theme={null}

1194 {

1195 "allowedMcpServers": [

1196 { "serverUrl": "https://mcp.company.com/*" },

1197 { "serverUrl": "https://*.internal.corp/*" }

1198 ]

1199 }

1200 ```

1201 

1202 **Result**:

1203 

1204 * HTTP server at `https://mcp.company.com/api`: ✅ Allowed (matches URL pattern)

1205 * HTTP server at `https://api.internal.corp/mcp`: ✅ Allowed (matches wildcard subdomain)

1206 * HTTP server at `https://external.com/mcp`: ❌ Blocked (doesn't match any URL pattern)

1207 * Stdio server with any command: ❌ Blocked (no name or command entries to match)

1208</Accordion>

1209 

1210<Accordion title="Example: Command-only allowlist">

1211 ```json theme={null}

1212 {

1213 "allowedMcpServers": [

1214 { "serverCommand": ["npx", "-y", "approved-package"] }

1215 ]

1216 }

1217 ```

1218 

1219 **Result**:

1220 

1221 * Stdio server with `["npx", "-y", "approved-package"]`: ✅ Allowed (matches command)

1222 * Stdio server with `["node", "server.js"]`: ❌ Blocked (doesn't match command)

1223 * HTTP server named "my-api": ❌ Blocked (no name entries to match)

1224</Accordion>

1225 

1226<Accordion title="Example: Mixed name and command allowlist">

1227 ```json theme={null}

1228 {

1229 "allowedMcpServers": [

1230 { "serverName": "github" },

1231 { "serverCommand": ["npx", "-y", "approved-package"] }

1232 ]

1233 }

1234 ```

1235 

1236 **Result**:

1237 

1238 * Stdio server named "local-tool" with `["npx", "-y", "approved-package"]`: ✅ Allowed (matches command)

1239 * Stdio server named "local-tool" with `["node", "server.js"]`: ❌ Blocked (command entries exist but doesn't match)

1240 * Stdio server named "github" with `["node", "server.js"]`: ❌ Blocked (stdio servers must match commands when command entries exist)

1241 * HTTP server named "github": ✅ Allowed (matches name)

1242 * HTTP server named "other-api": ❌ Blocked (name doesn't match)

1243</Accordion>

1244 

1245<Accordion title="Example: Name-only allowlist">

1246 ```json theme={null}

1247 {

1248 "allowedMcpServers": [

1249 { "serverName": "github" },

1250 { "serverName": "internal-tool" }

1251 ]

1252 }

1253 ```

1254 

1255 **Result**:

1256 

1257 * Stdio server named "github" with any command: ✅ Allowed (no command restrictions)

1258 * Stdio server named "internal-tool" with any command: ✅ Allowed (no command restrictions)

1259 * HTTP server named "github": ✅ Allowed (matches name)

1260 * Any server named "other": ❌ Blocked (name doesn't match)

1261</Accordion>

1262 

1263#### Allowlist behavior (`allowedMcpServers`)

1264 

1265* `undefined` (default): No restrictions - users can configure any MCP server

1266* Empty array `[]`: Complete lockdown - users cannot configure any MCP servers

1267* List of entries: Users can only configure servers that match by name, command, or URL pattern

1268 

1269#### Denylist behavior (`deniedMcpServers`)

1270 

1271* `undefined` (default): No servers are blocked

1272* Empty array `[]`: No servers are blocked

1273* List of entries: Specified servers are explicitly blocked across all scopes

1274 

1275#### Important notes

1276 

1277* **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.

1278* **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

1279* 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)

1280 

1281<Note>

1282 **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.

1283</Note>

Details

294names** (or equivalent for your API provider), to control the model names that the aliases map to.294names** (or equivalent for your API provider), to control the model names that the aliases map to.

295 295 

296| Environment variable | Description |296| Environment variable | Description |

297| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |297| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

298| `ANTHROPIC_DEFAULT_OPUS_MODEL` | The model to use for `opus`, or for `opusplan` when Plan Mode is active. |298| `ANTHROPIC_DEFAULT_OPUS_MODEL` | The model to use for `opus`, or for `opusplan` when Plan Mode is active. |

299| `ANTHROPIC_DEFAULT_SONNET_MODEL` | The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. |299| `ANTHROPIC_DEFAULT_SONNET_MODEL` | The model to use for `sonnet`, or for `opusplan` when Plan Mode is not active. |

300| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | The model to use for `haiku`, or [background functionality](/en/costs#background-token-usage) |300| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | The model to use for `haiku`, or [background functionality](/en/costs#background-token-usage) |

301| `CLAUDE_CODE_SUBAGENT_MODEL` | The model to use for all [subagents](/en/sub-agents#choose-a-model). Overrides both the per-invocation `model` parameter and the subagent definition's `model` frontmatter |301| `CLAUDE_CODE_SUBAGENT_MODEL` | The model to use for all [subagents](/en/sub-agents#choose-a-model) and [agent teams](/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 |

302 302 

303Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of303Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of

304`ANTHROPIC_DEFAULT_HAIKU_MODEL`.304`ANTHROPIC_DEFAULT_HAIKU_MODEL`.

Details

164 164 

165Auto 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.165Auto 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.

166 166 

167Auto 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](/en/output-styles) instead.167Auto 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](/en/output-styles) instead.

168 168 

169<Warning>169<Warning>

170 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.170 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.


172 172 

173Auto mode is available only when your account meets all of these requirements:173Auto mode is available only when your account meets all of these requirements:

174 174 

175* **Plan**: Max, Team, Enterprise, or API. Not available on Pro.175* **Plan**: All plans.

176* **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](/en/permissions#managed-settings).176* **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](/en/permissions#managed-settings).

177* **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.177* **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.

178* **Provider**: Anthropic API only. Not available on Bedrock, Vertex, or Foundry.178* **Provider**: Anthropic API only. Not available on Bedrock, Vertex, or Foundry.

179 179 

180If 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](/en/errors#auto-mode-cannot-determine-the-safety-of-an-action).180If 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](/en/errors#auto-mode-cannot-determine-the-safety-of-an-action).

Details

326| :--------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |326| :--------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

327| `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](/en/channels#restrict-which-channel-plugins-can-run) |327| `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](/en/channels#restrict-which-channel-plugins-can-run) |

328| `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 |328| `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 |

329| `allowManagedMcpServersOnly` | When `true`, only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. See [Managed MCP configuration](/en/mcp#managed-mcp-configuration) |329| `allowManagedMcpServersOnly` | When `true`, only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. See [Managed MCP configuration](/en/managed-mcp) |

330| `allowManagedPermissionRulesOnly` | When `true`, prevents user and project settings from defining `allow`, `ask`, or `deny` permission rules. Only rules in managed settings apply |330| `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` |

331| `blockedMarketplaces` | Blocklist of marketplace sources. Blocked sources are checked before downloading, so they never touch the filesystem. See [managed marketplace restrictions](/en/plugin-marketplaces#managed-marketplace-restrictions) |331| `blockedMarketplaces` | Blocklist of marketplace sources. Blocked sources are checked before downloading, so they never touch the filesystem. See [managed marketplace restrictions](/en/plugin-marketplaces#managed-marketplace-restrictions) |

332| `channelsEnabled` | Allow [channels](/en/channels) for the organization. See [enterprise controls](/en/channels#enterprise-controls) for the default on each plan |332| `channelsEnabled` | Allow [channels](/en/channels) for the organization. See [enterprise controls](/en/channels#enterprise-controls) for the default on each plan |

333| `forceRemoteSettingsRefresh` | When `true`, blocks CLI startup until remote managed settings are freshly fetched and exits if the fetch fails. See [fail-closed enforcement](/en/server-managed-settings#enforce-fail-closed-startup) |333| `forceRemoteSettingsRefresh` | When `true`, blocks CLI startup until remote managed settings are freshly fetched and exits if the fetch fails. See [fail-closed enforcement](/en/server-managed-settings#enforce-fail-closed-startup) |

Details

161| `plugins` | array | List of available plugins | See below |161| `plugins` | array | List of available plugins | See below |

162 162 

163<Note>163<Note>

164 **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.164 **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.

165</Note>165</Note>

166 166 

167### Owner fields167### Owner fields

en/sandbox-environments.md +141 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Choose a sandbox environment

6 

7> Compare Claude Code sandbox options: the built-in sandboxed Bash tool, sandbox runtime, dev containers, Docker, and VMs. Choose the right isolation for your threat model.

8 

9Isolating 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.

10 

11Claude 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:

12 

13* [Compare](#compare-sandboxing-approaches) the available isolation approaches by what they isolate, what they require, and how much setup is involved

14* [Choose](#choose-an-approach) the approach that fits your goal and threat model

15* [Get started](#sandboxed-bash-tool) with the approach you picked, from the built-in Bash sandbox to a dedicated virtual machine

16* [Enforce](#enforce-isolation-across-an-organization) isolation for every developer in your organization

17 

18<Info>

19 For the broader security model, see [Security](/en/security). For Agent SDK deployments, see [Secure deployment](/en/agent-sdk/secure-deployment).

20</Info>

21 

22## Compare sandboxing approaches

23 

24The 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.

25 

26| Approach | What is isolated | Requires Docker | Setup effort |

27| :------------------------------------------------ | :-------------------------------------------------------------------------- | :-------------- | :---------------------------------------------- |

28| [Sandboxed Bash tool](#sandboxed-bash-tool) | Bash commands and their child processes | No | Minimal on macOS; low on Linux and WSL2 |

29| [Sandbox runtime](#sandbox-runtime) | The whole Claude Code process, including file tools, MCP servers, and hooks | No | Low |

30| [Dev container](#dev-containers) | Full development environment | Yes | Medium |

31| [Custom container](#custom-container) | Full development environment | Yes | Medium to high |

32| [Virtual machine](#virtual-machine) | Full operating system | No | High |

33| [Claude Code on the web](#claude-code-on-the-web) | Full operating system, hosted by Anthropic | No | None; requires a Claude subscription and GitHub |

34 

35The [sandboxed Bash tool](/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.

36 

37<Warning>

38 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](/en/sandboxing#security-limitations) before relying on a sandbox as a hard control.

39 

40 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](/en/data-usage) for what Claude Code sends and how to reduce it.

41</Warning>

42 

43## Choose an approach

44 

45Match your goal to a row below, then read the detail section that follows.

46 

47| You want to | Start with |

48| :---------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |

49| Reduce permission prompts during everyday work on your own machine | The [sandboxed Bash tool](/en/sandboxing), enabled with `/sandbox` |

50| Let Claude work unattended with `--dangerously-skip-permissions` or auto mode | The preconfigured [dev container](/en/devcontainer), any container or VM, or the [sandbox runtime](#sandbox-runtime) |

51| Isolate MCP servers and hooks as well as Bash, without Docker | The sandbox runtime |

52| Work on an untrusted repository | A dedicated virtual machine, or [Claude Code on the web](/en/claude-code-on-the-web) if you have a Claude subscription and a connected GitHub account |

53| Standardize a sandboxed environment across a team | The preconfigured [dev container](/en/devcontainer), copied into your repository |

54| Use Claude Code from a device with no local setup | [Claude Code on the web](/en/claude-code-on-the-web), which requires a Claude subscription and a connected GitHub account |

55| Require isolation for every developer in your organization | [Enforce isolation across an organization](#enforce-isolation-across-an-organization) |

56| Work on a native Windows host | A container or VM, or run the Bash sandbox inside WSL2 |

57 

58### How isolation relates to permission modes

59 

60[Permission modes](/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.

61 

62`--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](#sandbox-runtime), so that file tools, MCP servers, and hooks are also inside the boundary.

63 

64[Auto mode](/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`.

65 

66The [sandboxed Bash tool](#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](/en/sandboxing#how-sandboxing-relates-to-permissions-and-permission-modes).

67 

68## Sandboxed Bash tool

69 

70<Note>

71 This option does not support native Windows. On Windows hosts, use WSL2 or one of the container or VM approaches below.

72</Note>

73 

74The 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.

75 

76Enable it with the `/sandbox` command. The [Sandboxing](/en/sandboxing) guide covers the approval modes, the default boundary, and how to widen or narrow it.

77 

78The per-command sandbox does not cover everything that runs in a session:

79 

80* Other [built-in tools](/en/tools-reference) such as Read, Edit, and WebFetch run inside the Claude Code process and do not spawn arbitrary code. [Permission rules](/en/permissions) for path or domain gate them instead.

81* [MCP](/en/mcp) servers and hooks are separate processes that run unconstrained on the host.

82 

83To put built-in tools, MCP servers, and hooks all behind one OS boundary, run the whole Claude Code process inside the [sandbox runtime](#sandbox-runtime), the [dev container](#dev-containers), or a [custom container](#custom-container).

84 

85## Sandbox runtime

86 

87The [`@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.

88 

89The 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.

90 

91Once the settings file is in place, launch Claude Code with `npx` and pass `claude` as the command to wrap:

92 

93```bash theme={null}

94npx @anthropic-ai/sandbox-runtime claude

95```

96 

97Claude 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.

98 

99## Dev containers

100 

101A 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.

102 

103The claude-code repository publishes an [example dev container](/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.

104 

105## Custom container

106 

107You 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.

108 

109Several 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.

110 

111You 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](/en/sandboxing#troubleshooting).

112 

113## Virtual machine

114 

115A 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.

116 

117Use 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.

118 

119## Claude Code on the web

120 

121[Claude Code on the web](/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.

122 

123Use 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](/en/claude-code-on-the-web) for plan availability and GitHub authentication options.

124 

125## Enforce isolation across an organization

126 

127Individual developers can opt into any approach above. What an organization can enforce, and with which tools, depends on the approach:

128 

129* **Built-in Bash sandbox**: the only approach Claude Code enforces itself. Deliver the `sandbox` settings keys through [managed settings](/en/settings#settings-files), either as a file managed by your MDM or through [server-managed settings](/en/server-managed-settings) on Claude.ai. See [Enforce sandboxing with managed settings](/en/sandboxing#enforce-sandboxing-with-managed-settings) for the keys to deploy and how to keep developers from widening the policy.

130* **Dev containers**: commit the [example dev container](/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.

131* **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.

132 

133## See also

134 

135These pages cover configuration and policy details for the approaches above.

136 

137* [Sandboxing](/en/sandboxing): configure the built-in sandboxed Bash tool

138* [Dev container](/en/devcontainer): the preconfigured Docker development container

139* [Security](/en/security): the full Claude Code security model

140* [Secure deployment](/en/agent-sdk/secure-deployment): isolation guidance for Agent SDK applications

141* [Settings](/en/settings#sandbox-settings): all sandbox configuration keys, including managed settings delivery

en/sandboxing.md +211 −177

Details

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.3> Use this file to discover all available pages before exploring further.

4 4 

5# Sandboxing5# Configure the sandboxed Bash tool

6 6 

7> Learn how Claude Code's sandboxed bash tool provides filesystem and network isolation for safer, more autonomous agent execution.7> Learn how Claude Code's sandboxed Bash tool provides filesystem and network isolation for safer, more autonomous agent execution.

8 8 

9## Overview9The 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.

10 10 

11Claude 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.11This page covers how to:

12 12 

13The sandboxed bash tool uses OS-level primitives to enforce both filesystem and network isolation.13* [Enable the sandbox](#get-started) and choose how sandboxed commands are approved

14* [Configure](#configure-sandboxing) which paths and network domains commands can reach

15* [Combine sandboxing with permission rules and permission modes](#how-sandboxing-relates-to-permissions-and-permission-modes)

16* [Enforce sandboxing across an organization](#configure-the-sandbox-for-your-organization) with managed settings

14 17 

15## Why sandboxing matters18<Note>

16 19 To compare other isolation approaches such as dev containers, custom containers, and virtual machines, see [Sandbox environments](/en/sandbox-environments). To reduce permission prompts for tools other than Bash, see [permission modes](/en/permission-modes).

17Traditional permission-based security requires constant user approval for bash commands. While this provides control, it can lead to:20</Note>

18 

19* **Approval fatigue**: Repeatedly clicking "approve" can cause users to pay less attention to what they're approving

20* **Reduced productivity**: Constant interruptions slow down development workflows

21* **Limited autonomy**: Claude Code cannot work as efficiently when waiting for approvals

22 

23Sandboxing addresses these challenges by:

24 

251. **Defining clear boundaries**: Specify exactly which directories and network hosts Claude Code can access

262. **Reducing permission prompts**: Safe commands within the sandbox don't require approval

273. **Maintaining security**: Attempts to access resources outside the sandbox trigger immediate notifications

284. **Enabling autonomy**: Claude Code can run more independently within defined limits

29 

30<Warning>

31 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.

32</Warning>

33 

34## How it works

35 21 

36### Filesystem isolation22## Get started

37 23 

38The sandboxed bash tool restricts file system access to specific directories:24The 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.

39 25 

40* **Default writes behavior**: Read and write access to the current working directory and its subdirectories26On 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](#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.

41* **Default read behavior**: Read access to the entire computer, except certain denied directories

42* **Blocked access**: Cannot modify files outside the current working directory without explicit permission

43* **Configurable**: Define custom allowed and denied paths through settings

44 27 

45You 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.28<Steps>

29 <Step title="Run /sandbox">

30 Start a Claude Code session and run the `/sandbox` command:

46 31 

47### Network isolation32 ```text theme={null}

33 /sandbox

34 ```

48 35 

49Network access is controlled through a proxy server running outside the sandbox:36 This opens the sandbox panel with three tabs:

50 37 

51* **Domain restrictions**: Only approved domains can be accessed38 * **Mode**: choose how sandboxed commands are approved, covered in the next step

52* **User confirmation**: New domain requests trigger permission prompts (unless [`allowManagedDomainsOnly`](/en/settings#sandbox-settings) is enabled, which blocks non-allowed domains automatically)39 * **Overrides**: choose whether commands that fail under the sandbox can fall back to running unsandboxed. This is the [`allowUnsandboxedCommands`](/en/settings#sandbox-settings) setting

53* **Custom proxy support**: Advanced users can implement custom rules on outgoing traffic40 * **Config**: view the resolved sandbox settings

54* **Comprehensive coverage**: Restrictions apply to all scripts, programs, and subprocesses spawned by commands

55 41 

56<Note>42 If the panel shows only a Dependencies tab, a required package is missing. Install it as described in [Set up Linux and WSL2](#set-up-linux-and-wsl2), restart Claude Code, and run `/sandbox` again.

57 The built-in proxy enforces the allowlist based on the requested hostname and does not terminate or inspect TLS traffic. See [Security limitations](#security-limitations) for the implications of this design, and [Custom proxy configuration](#custom-proxy-configuration) if your threat model requires TLS inspection.43 </Step>

58</Note>

59 44 

60### OS-level enforcement45 <Step title="Choose a mode">

46 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](#sandbox-modes) for which commands still prompt in auto-allow mode.

47 </Step>

61 48 

62The sandboxed bash tool leverages operating system security primitives:49 <Step title="Run a Bash command">

50 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.

63 51 

64* **macOS**: Uses Seatbelt for sandbox enforcement52 Commands that cannot run sandboxed fall back to the regular permission flow. To widen or narrow these boundaries, see [Configure sandboxing](#configure-sandboxing).

65* **Linux**: Uses [bubblewrap](https://github.com/containers/bubblewrap) for isolation53 </Step>

66* **WSL2**: Uses bubblewrap, same as Linux54</Steps>

67 55 

68WSL1 is not supported because bubblewrap requires kernel features only available in WSL2.56Selecting 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`](/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](#enforce-sandboxing-with-managed-settings).

69 57 

70These OS-level restrictions ensure that all child processes spawned by Claude Code's commands inherit the same security boundaries.58<Warning>

59 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`](/en/settings#sandbox-settings) to `true`. This is intended for managed deployments that require sandboxing as a security gate.

60</Warning>

71 61 

72## Getting started62### Set up Linux and WSL2

73 63 

74### Prerequisites64On Linux and WSL2, the sandbox relies on two packages:

75 65 

76On **macOS**, sandboxing works out of the box using the built-in Seatbelt framework.66* [`bubblewrap`](https://github.com/containers/bubblewrap): the unprivileged sandboxing tool that enforces filesystem isolation

67* [`socat`](http://www.dest-unreach.org/socat/): the relay used to route network traffic through the sandbox proxy

77 68 

78On **Linux and WSL2**, install the required packages first:69Install them with your distribution's package manager:

79 70 

80<Tabs>71<Tabs>

81 <Tab title="Ubuntu/Debian">72 <Tab title="Ubuntu/Debian">


91 </Tab>82 </Tab>

92</Tabs>83</Tabs>

93 84 

94On 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:85After 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.

95 

96```bash theme={null}

97sudo tee /etc/apparmor.d/bwrap > /dev/null <<'EOF'

98abi <abi/4.0>,

99include <tunables/global>

100 86 

101profile bwrap /usr/bin/bwrap flags=(unconfined) {87When 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.

102 userns,

103 include if exists <local/bwrap>

104}

105EOF

106```

107 

108The profile applies only to `bwrap` itself, not to the commands it runs inside the sandbox. Reload AppArmor to apply it:

109 88 

110```bash theme={null}89<AccordionGroup>

111sudo systemctl reload apparmor90 <Accordion title="Ubuntu 24.04 and later: allow bubblewrap to create user namespaces">

112```91 On Ubuntu 24.04 and later, the default AppArmor policy prevents bubblewrap from creating the user namespaces it needs for isolation.

113 92 

114WSL1 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.93 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:

115 94 

116On 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`](/en/settings#sandbox-settings) so it runs outside the sandbox.95 ```bash theme={null}

96 sudo tee /etc/apparmor.d/bwrap > /dev/null <<'EOF'

97 abi <abi/4.0>,

98 include <tunables/global>

117 99 

118### Enable sandboxing100 profile bwrap /usr/bin/bwrap flags=(unconfined) {

101 userns,

102 include if exists <local/bwrap>

103 }

104 EOF

105 ```

119 106 

120You can enable sandboxing by running the `/sandbox` command:107 The profile applies only to `bwrap` itself, not to the commands it runs inside the sandbox. Reload AppArmor to apply it:

121 108 

122```text theme={null}109 ```bash theme={null}

123/sandbox110 sudo systemctl reload apparmor

124```111 ```

112 </Accordion>

125 113 

126This 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.114 <Accordion title="WSL2 notes">

115 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.

127 116 

128By 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`](/en/settings#sandbox-settings) to `true`. This is intended for managed deployments that require sandboxing as a security gate.117 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`](/en/settings#sandbox-settings) so it runs outside the sandbox.

118 </Accordion>

119</AccordionGroup>

129 120 

130### Sandbox modes121### Sandbox modes

131 122 

132Claude Code offers two sandbox modes:123Claude Code offers two sandbox modes:

133 124 

134**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.125**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](/en/permissions) and prompts you for any command those rules do not already allow.

126 

127Even in auto-allow mode, the following still apply:

128 

129* Explicit [deny rules](/en/permissions) are always respected

130* `rm` or `rmdir` commands that target `/`, your home directory, or other critical system paths still trigger a permission prompt

131* [Ask rules](/en/permissions) apply to commands that fall back to the regular permission flow

135 132 

136**Regular permissions mode**: All bash commands go through the standard permission flow, even when sandboxed. This provides more control but requires more approvals.133**Regular permissions mode**: All Bash commands go through the regular permission flow, even when sandboxed. This provides more control but requires more approvals.

137 134 

138In 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.135In 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.

139 136 

137Some 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.

138 

139You can disable this escape hatch by setting `"allowUnsandboxedCommands": false` in your [sandbox settings](/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`.

140 

140<Info>141<Info>

141 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.142 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.

142</Info>143</Info>

143 144 

144### Configure sandboxing145## Configure sandboxing

145 

146Customize sandbox behavior through your `settings.json` file. See [Settings](/en/settings#sandbox-settings) for complete configuration reference.

147 146 

148#### Granting subprocess write access to specific paths147Customize sandbox behavior through your `settings.json` file. See [Settings](/en/settings#sandbox-settings) for the complete configuration reference.

149 148 

150By 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:149By 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:

151 150 


162 161 

163These 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`.162These 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`.

164 163 

165When `allowWrite` (or `denyWrite`/`denyRead`/`allowRead`) is defined in multiple [settings scopes](/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.164When the same filesystem array is defined in multiple [settings scopes](/en/settings#settings-precedence), the arrays are merged: paths from every scope are combined, not replaced.

166 165 

167Path prefixes control how paths are resolved:166Path prefixes control how paths are resolved:

168 167 


172| `~/` | Relative to home directory | `~/.kube` becomes `$HOME/.kube` |171| `~/` | Relative to home directory | `~/.kube` becomes `$HOME/.kube` |

173| `./` 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` |172| `./` 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` |

174 173 

175The 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](/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.174This syntax differs from [Read and Edit permission rules](/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.

176 175 

177You 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.176You 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`.

178 177 

179For 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`:178The 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:

180 179 

181```json theme={null}180```json theme={null}

182{181{


192 191 

193The `.` 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.192The `.` 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.

194 193 

195<Tip>194## How sandboxing works

196 Not all commands are compatible with sandboxing out of the box. Some notes that may help you make the most out of the sandbox:

197 195 

198 * 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.196### Filesystem isolation

199 * `watchman` is incompatible with running in the sandbox. If you're running `jest`, consider using `jest --no-watchman`

200 * `docker` is incompatible with running in the sandbox. Consider specifying `docker *` in `excludedCommands` to force it to run outside of the sandbox.

201</Tip>

202 197 

203<Note>198The sandboxed Bash tool restricts file system access to specific directories:

204 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.

205 199 

206 You can disable this escape hatch by setting `"allowUnsandboxedCommands": false` in your [sandbox settings](/en/settings#sandbox-settings). When disabled, the `dangerouslyDisableSandbox` parameter is completely ignored and all commands must run sandboxed or be explicitly listed in `excludedCommands`.200* **Default write behavior**: read and write access to the current working directory and its subdirectories

201* **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.

202* **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/`

203* **Configurable**: define custom allowed and denied paths through settings

204 

205You 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.

206 

207### Network isolation

208 

209Network access is controlled through a proxy server running outside the sandbox:

210 

211* **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`](/en/settings#sandbox-settings) to avoid the prompt.

212* **Managed lockdown**: if [`allowManagedDomainsOnly`](/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.

213* **Custom proxy support**: advanced users can implement custom rules on outgoing traffic

214* **Comprehensive coverage**: restrictions apply to all scripts, programs, and subprocesses spawned by commands

215 

216<Note>

217 The built-in proxy enforces the allowlist based on the requested hostname and does not terminate or inspect TLS traffic. See [Security limitations](#security-limitations) for the implications of this design, and [Custom proxy configuration](#custom-proxy-configuration) if your threat model requires TLS inspection.

207</Note>218</Note>

208 219 

209## Security benefits220### OS-level enforcement

210 221 

211### Protection against prompt injection222The sandboxed Bash tool leverages operating system security primitives:

212 223 

213Even if an attacker successfully manipulates Claude Code's behavior through prompt injection, the sandbox ensures your system remains secure:224* **macOS**: uses Seatbelt for sandbox enforcement

225* **Linux**: uses [bubblewrap](https://github.com/containers/bubblewrap) for isolation

226* **WSL2**: uses bubblewrap, same as Linux

214 227 

215**Filesystem protection:**228WSL1 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.

216 229 

217* Cannot modify critical config files such as `~/.bashrc`230These same primitives are available as the standalone [`@anthropic-ai/sandbox-runtime`](https://github.com/anthropic-experimental/sandbox-runtime) package, which the [Sandbox environments](/en/sandbox-environments#sandbox-runtime) page covers as a separate approach for wrapping the entire Claude Code process.

218* Cannot modify system-level files in `/bin/`

219* Cannot read files that are denied in your [Claude permission settings](/en/permissions#manage-permissions)

220 231 

221**Network protection:**232## How sandboxing relates to permissions and permission modes

222 233 

223* Cannot exfiltrate data to attacker-controlled servers234Sandboxing, [permission rules](/en/permissions), and [permission modes](/en/permission-modes) are complementary layers. The sections below cover how the sandbox interacts with each.

224* Cannot download malicious scripts from unauthorized domains

225* Cannot make unexpected API calls to unapproved services

226* Cannot contact any domains not explicitly allowed

227 235 

228**Monitoring and control:**236### Permission rules

229 237 

230* All access attempts outside the sandbox are blocked at the OS level238Permission rules and sandboxing control different things:

231* You receive immediate notifications when boundaries are tested

232* You can choose to deny, allow once, or permanently update your configuration

233 239 

234### Reduced attack surface240* **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.

241* **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.

235 242 

236Sandboxing limits the potential damage from:243The 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.

237 244 

238* **Malicious dependencies**: NPM packages or other dependencies with harmful code245Filesystem and network restrictions are configured through both sandbox settings and permission rules:

239* **Compromised scripts**: Build scripts or tools with security vulnerabilities

240* **Social engineering**: Attacks that trick users into running dangerous commands

241* **Prompt injection**: Attacks that trick Claude into running dangerous commands

242 246 

243### Transparent operation247| Setting or rule | What it does |

248| :--------------------------------------------------------------- | :------------------------------------------------------------------------------------------------ |

249| `sandbox.filesystem.allowWrite` | Grants subprocess write access to paths outside the working directory |

250| `sandbox.filesystem.denyWrite` and `sandbox.filesystem.denyRead` | Block subprocess access to specific paths |

251| `sandbox.filesystem.allowRead` | Re-allows reading specific paths within a `denyRead` region |

252| `Edit` allow rules | Grant write access to specific paths, the same way `sandbox.filesystem.allowWrite` does |

253| `Read` and `Edit` deny rules | Block access to specific files or directories |

254| `WebFetch` allow and deny rules | Control domain access |

255| Sandbox `allowedDomains` | Controls which domains Bash commands can reach |

256| Sandbox `deniedDomains` | Blocks specific domains even when a broader `allowedDomains` wildcard would otherwise permit them |

244 257 

245When Claude Code attempts to access network resources outside the sandbox:258Paths from both `sandbox.filesystem` settings and permission rules are merged together into the final sandbox configuration.

246 259 

2471. The operation is blocked at the OS level260The [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.

2482. You receive an immediate notification

2493. You can choose to:

250 * Deny the request

251 * Allow it once

252 * Update your sandbox configuration to permanently allow it

253 261 

254## Security Limitations262### Permission modes

255 263 

256* 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.264`/sandbox` is not a [permission mode](/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:

257 265 

258<Warning>266| | What it controls | What replaces the prompt |

259 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](#custom-proxy-configuration) 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.267| :----------------------------------------------------------------- | :------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------- |

260</Warning>268| `/sandbox` | What a Bash command can access once it runs | The sandbox boundary itself, in [auto-allow mode](#sandbox-modes) |

269| [Auto mode](/en/permission-modes#eliminate-prompts-with-auto-mode) | Whether each tool call runs | A classifier that reviews actions |

270| `--dangerously-skip-permissions` | Whether each tool call runs | Nothing. [Protected path](/en/permission-modes#protected-paths) checks are also skipped; only removing `/` or your home directory still prompts |

261 271 

262* 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.272The sandbox's [auto-allow mode](#sandbox-modes) is separate from [auto mode](/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](/en/sandbox-environments#how-isolation-relates-to-permission-modes).

263* 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.

264* 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.

265 273 

266## How sandboxing relates to permissions274## Configure the sandbox for your organization

267 275 

268Sandboxing and [permissions](/en/permissions) are complementary security layers that work together:276Administrators can require sandboxing for every user, keep developers from widening the policy, and route sandbox traffic through a corporate proxy.

269 277 

270* **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.278### Enforce sandboxing with managed settings

271* **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.

272 279 

273Filesystem and network restrictions are configured through both sandbox settings and permission rules:280To require the sandbox for every developer, deliver the `sandbox` keys through [managed settings](/en/settings#settings-files), either as a file managed by your MDM or through [server-managed settings](/en/server-managed-settings) on Claude.ai.

274 281 

275* Use `sandbox.filesystem.allowWrite` to grant subprocess write access to paths outside the working directory282The 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:

276* Use `sandbox.filesystem.denyWrite` and `sandbox.filesystem.denyRead` to block subprocess access to specific paths

277* Use `sandbox.filesystem.allowRead` to re-allow reading specific paths within a `denyRead` region

278* Use `Read` and `Edit` deny rules to block access to specific files or directories

279* Use `WebFetch` allow/deny rules to control domain access

280* Use sandbox `allowedDomains` to control which domains Bash commands can reach

281* Use sandbox `deniedDomains` to block specific domains even when a broader `allowedDomains` wildcard would otherwise permit them

282 283 

283Paths from both `sandbox.filesystem` settings and permission rules are merged together into the final sandbox configuration.284```json theme={null}

285{

286 "sandbox": {

287 "enabled": true,

288 "failIfUnavailable": true,

289 "allowUnsandboxedCommands": false

290 }

291}

292```

293 

294The two keys beyond `enabled` control what happens when the sandbox cannot run a command:

295 

296* **`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

297* **`allowUnsandboxedCommands: false`**: the `dangerouslyDisableSandbox` escape hatch is ignored, so commands that fail under the sandbox cannot be retried outside it

298 

299Two additions are worth considering alongside them. Add `excludedCommands` for any organization-approved tools that must run without isolation. Add [`denyRead`](#filesystem-isolation) entries for credential directories such as `~/.aws` and `~/.ssh`, which the default read policy still allows.

300 

301The 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.

302 

303### Keep developers from widening the policy

304 

305For 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.

284 306 

285This [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.307Set `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`](/en/settings#sandbox-settings).

286 308 

287## Advanced usage309`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.

288 310 

289### Custom proxy configuration311### Custom proxy configuration

290 312 


295* Log all network requests317* Log all network requests

296* Integrate with existing security infrastructure318* Integrate with existing security infrastructure

297 319 

320To point Claude Code at your proxy, set the proxy ports in [sandbox settings](/en/settings#sandbox-settings):

321 

298```json theme={null}322```json theme={null}

299{323{

300 "sandbox": {324 "sandbox": {


306}330}

307```331```

308 332 

309### Integration with existing security tools333## Troubleshooting

310 334 

311The sandboxed bash tool works alongside:335Some commands fail inside the sandbox even though they work outside it. The fixes below cover the most common cases.

312 336 

313* **Permission rules**: Combine with [permission settings](/en/permissions) for defense-in-depth337* **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.

314* **Development containers**: Use with [dev containers](/en/devcontainer) for additional isolation338* **`jest` hangs or fails**: `watchman` is incompatible with the sandbox. Run `jest --no-watchman` instead.

315* **Enterprise policies**: Enforce sandbox configurations through [managed settings](/en/settings#settings-precedence)339* **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`](/en/settings#sandbox-settings) to `true` instead.

340* **`docker` commands fail**: `docker` is incompatible with the sandbox. Add `docker *` to `excludedCommands` to run it outside the sandbox.

341* **Bubblewrap fails to start inside a container**: in an unprivileged container, bubblewrap cannot mount a fresh `/proc` filesystem. Set [`enableWeakerNestedSandbox`](/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.

342* **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.

343* **`--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](/en/devcontainer) configuration, which runs Claude Code as a non-root user.

316 344 

317## Best practices345## Limitations

318 346 

3191. **Start restrictive**: Begin with minimal permissions and expand as needed347Sandboxing reduces risk but is not a complete isolation boundary. Review the limitations below before relying on it as a hard security control.

3202. **Monitor logs**: Review sandbox violation attempts to understand Claude Code's needs

3213. **Use environment-specific configs**: Different sandbox rules for development vs. production contexts

3224. **Combine with permissions**: Use sandboxing alongside IAM policies for comprehensive security

3235. **Test configurations**: Verify your sandbox settings don't block legitimate workflows

324 348 

325## Open source349### Security limitations

326 350 

327The 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:351* **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.

328 352 

329```bash theme={null}353<Warning>

330npx @anthropic-ai/sandbox-runtime <command-to-sandbox>354 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](#custom-proxy-configuration) 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.

331```355</Warning>

332 356 

333For implementation details and source code, visit the [GitHub repository](https://github.com/anthropic-experimental/sandbox-runtime).357* **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.

358* **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.

359* **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.

360* **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.

334 361 

335## Limitations362### Platform and tool compatibility

336 363 

337* **Performance overhead**: Minimal, but some filesystem operations may be slightly slower364* **Platform support**: supports macOS, Linux, and WSL2. WSL1 and native Windows are not supported.

338* **Compatibility**: Some tools that require specific system access patterns may need configuration adjustments, or may even need to be run outside of the sandbox365* **Performance overhead**: minimal, but some filesystem operations may be slightly slower.

339* **Platform support**: Supports macOS, Linux, and WSL2. WSL1 is not supported. Native Windows support is planned.366* **Tool compatibility**: some tools that require specific system access patterns may need configuration adjustments, or may need to be run outside the sandbox.

340 367 

341## What sandboxing does not cover368### Scope

342 369 

343The sandbox isolates Bash subprocesses. Other tools operate under different boundaries:370The sandbox isolates Bash subprocesses. Other tools operate under different boundaries:

344 371 

345* **Built-in file tools**: Read, Edit, and Write use the permission system directly rather than running through the sandbox. See [permissions](/en/permissions).372* **Built-in file tools**: Read, Edit, and Write use the permission system directly rather than running through the sandbox. See [permissions](/en/permissions).

346* **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](/en/computer-use) or [computer use in Desktop](/en/desktop#let-claude-use-your-computer).373* **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](/en/computer-use) or [computer use in Desktop](/en/desktop#let-claude-use-your-computer).

374* **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`](/en/env-vars).

375* **Subagents**: [subagents](/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.

376 

377<Warning>

378 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.

379</Warning>

347 380 

348## See also381## See also

349 382 

350* [Security](/en/security) - Comprehensive security features and best practices383* [Sandbox environments](/en/sandbox-environments): compare the built-in sandbox with dev containers, containers, and VMs

351* [Permissions](/en/permissions) - Permission configuration and access control384* [Security](/en/security): comprehensive security features and best practices

352* [Settings](/en/settings) - Complete configuration reference385* [Permissions](/en/permissions): permission configuration and access control

353* [CLI reference](/en/cli-reference) - Command-line options386* [Settings](/en/settings): complete configuration reference

387* [CLI reference](/en/cli-reference): command-line options

Details

93A bare `/loop` runs this prompt at a [dynamically chosen interval](#let-claude-choose-the-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](#customize-the-default-prompt-with-loop-md).93A bare `/loop` runs this prompt at a [dynamically chosen interval](#let-claude-choose-the-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](#customize-the-default-prompt-with-loop-md).

94 94 

95<Note>95<Note>

96 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.96 On Bedrock, Vertex AI, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of running the maintenance prompt.

97</Note>97</Note>

98 98 

99### Customize the default prompt with loop.md99### Customize the default prompt with loop.md


119Edits 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.119Edits 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.

120 120 

121<Note>121<Note>

122 `loop.md` follows the same availability as the [built-in maintenance prompt](#run-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.122 On Bedrock, Vertex AI, and Microsoft Foundry, `loop.md` isn't read and `/loop` with no prompt prints the usage message instead.

123</Note>123</Note>

124 124 

125### Stop a loop125### Stop a loop

en/security.md +6 −5

Details

137 137 

138## Related resources138## Related resources

139 139 

140* [Sandboxing](/en/sandboxing) - Filesystem and network isolation for bash commands140* [Sandbox environments](/en/sandbox-environments): compare isolation approaches and choose one for your threat model

141* [Permissions](/en/permissions) - Configure permissions and access controls141* [Sandboxing](/en/sandboxing): filesystem and network isolation for Bash commands

142* [Monitoring usage](/en/monitoring-usage) - Track and audit Claude Code activity142* [Permissions](/en/permissions): configure permissions and access controls

143* [Development containers](/en/devcontainer) - Secure, isolated environments143* [Monitoring usage](/en/monitoring-usage): track and audit Claude Code activity

144* [Anthropic Trust Center](https://trust.anthropic.com) - Security certifications and compliance144* [Development containers](/en/devcontainer): secure, isolated environments

145* [Anthropic Trust Center](https://trust.anthropic.com): security certifications and compliance

Details

123Server-managed settings have the following limitations:123Server-managed settings have the following limitations:

124 124 

125* Settings apply uniformly to all users in the organization. Per-group configurations are not yet supported.125* Settings apply uniformly to all users in the organization. Per-group configurations are not yet supported.

126* [MCP server configurations](/en/mcp#managed-mcp-configuration) cannot be distributed through server-managed settings.126* A [`managed-mcp.json`](/en/managed-mcp) file cannot be distributed through server-managed settings. Deliver the `allowedMcpServers` and `deniedMcpServers` policy keys there instead.

127* 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.127* 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.

128 128 

129## Settings delivery129## Settings delivery

en/settings.md +9 −9

Details

108 108 

109 Use numeric prefixes to control merge order, for example `10-telemetry.json` and `20-security.json`.109 Use numeric prefixes to control merge order, for example `10-telemetry.json` and `20-security.json`.

110 110 

111 See [managed settings](/en/permissions#managed-only-settings) and [Managed MCP configuration](/en/mcp#managed-mcp-configuration) for details.111 See [managed settings](/en/permissions#managed-only-settings) and [Managed MCP configuration](/en/managed-mcp) for details.

112 112 

113 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.113 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.

114 114 


168`settings.json` supports a number of options:168`settings.json` supports a number of options:

169 169 

170| Key | Description | Example |170| Key | Description | Example |

171| :-------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------- |171| :-------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------- |

172| `agent` | Run the main thread as a named subagent. Applies that subagent's system prompt, tool restrictions, and model. See [Invoke subagents explicitly](/en/sub-agents#invoke-subagents-explicitly) | `"code-reviewer"` |172| `agent` | Run the main thread as a named subagent. Applies that subagent's system prompt, tool restrictions, and model. See [Invoke subagents explicitly](/en/sub-agents#invoke-subagents-explicitly) | `"code-reviewer"` |

173| `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](/en/channels#restrict-which-channel-plugins-can-run) | `[{ "marketplace": "claude-plugins-official", "plugin": "telegram" }]` |173| `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](/en/channels#restrict-which-channel-plugins-can-run) | `[{ "marketplace": "claude-plugins-official", "plugin": "telegram" }]` |

174| `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](#hook-configuration) | `["https://hooks.example.com/*"]` |174| `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](#hook-configuration) | `["https://hooks.example.com/*"]` |

175| `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](/en/mcp#managed-mcp-configuration) | `[{ "serverName": "github" }]` |175| `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](/en/managed-mcp) | `[{ "serverName": "github" }]` |

176| `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](#hook-configuration) | `true` |176| `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](#hook-configuration) | `true` |

177| `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](/en/mcp#managed-mcp-configuration) | `true` |177| `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](/en/managed-mcp) | `true` |

178| `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](/en/permissions#managed-only-settings) | `true` |178| `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](/en/permissions#managed-only-settings) | `true` |

179| `alwaysThinkingEnabled` | Enable [extended thinking](/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`](/en/env-vars) in `env` | `true` |179| `alwaysThinkingEnabled` | Enable [extended thinking](/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`](/en/env-vars) in `env` | `true` |

180| `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`](/en/env-vars) | `/bin/generate_temp_api_key.sh` |180| `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`](/en/env-vars) | `/bin/generate_temp_api_key.sh` |


195| `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](/en/worktrees#clean-up-worktrees) at startup. To disable transcript writes entirely, set the [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](/en/env-vars) environment variable, or in non-interactive mode (`-p`) use the `--no-session-persistence` flag or the `persistSession: false` SDK option. | `20` |195| `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](/en/worktrees#clean-up-worktrees) at startup. To disable transcript writes entirely, set the [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](/en/env-vars) environment variable, or in non-interactive mode (`-p`) use the `--no-session-persistence` flag or the `persistSession: false` SDK option. | `20` |

196| `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"]` |196| `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"]` |

197| `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](/en/tools-reference#powershell-tool) | `"powershell"` |197| `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](/en/tools-reference#powershell-tool) | `"powershell"` |

198| `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](/en/mcp#managed-mcp-configuration) | `[{ "serverName": "filesystem" }]` |198| `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](/en/managed-mcp) | `[{ "serverName": "filesystem" }]` |

199| `disableAgentView` | Set to `true` to turn off [background agents and agent view](/en/agent-view): `claude agents`, `--bg`, `/background`, and the on-demand supervisor. Typically set in [managed settings](/en/permissions#managed-settings). Equivalent to setting `CLAUDE_CODE_DISABLE_AGENT_VIEW` to `1` | `true` |199| `disableAgentView` | Set to `true` to turn off [background agents and agent view](/en/agent-view): `claude agents`, `--bg`, `/background`, and the on-demand supervisor. Typically set in [managed settings](/en/permissions#managed-settings). Equivalent to setting `CLAUDE_CODE_DISABLE_AGENT_VIEW` to `1` | `true` |

200| `disableAllHooks` | Disable all [hooks](/en/hooks) and any custom [status line](/en/statusline) | `true` |200| `disableAllHooks` | Disable all [hooks](/en/hooks) and any custom [status line](/en/statusline) | `true` |

201| `disableAutoMode` | Set to `"disable"` to prevent [auto mode](/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](/en/permissions#managed-settings) where users cannot override it | `"disable"` |201| `disableAutoMode` | Set to `"disable"` to prevent [auto mode](/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](/en/permissions#managed-settings) where users cannot override it | `"disable"` |


211| `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](/en/fast-mode#require-per-session-opt-in) | `true` |211| `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](/en/fast-mode#require-per-session-opt-in) | `true` |

212| `feedbackSurveyRate` | Probability (0–1) that the [session quality survey](/en/data-usage#session-quality-surveys) appears when eligible. Set to `0` to suppress entirely, or set [`CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY`](/en/env-vars) in `env`. Useful when using Bedrock, Vertex, or Foundry where the default sample rate does not apply | `0.05` |212| `feedbackSurveyRate` | Probability (0–1) that the [session quality survey](/en/data-usage#session-quality-surveys) appears when eligible. Set to `0` to suppress entirely, or set [`CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY`](/en/env-vars) in `env`. Useful when using Bedrock, Vertex, or Foundry where the default sample rate does not apply | `0.05` |

213| `fileSuggestion` | Configure a custom script for `@` file autocomplete. See [File suggestion settings](#file-suggestion-settings) | `{"type": "command", "command": "~/.claude/file-suggestion.sh"}` |213| `fileSuggestion` | Configure a custom script for `@` file autocomplete. See [File suggestion settings](#file-suggestion-settings) | `{"type": "command", "command": "~/.claude/file-suggestion.sh"}` |

214| `forceLoginMethod` | Use `claudeai` to restrict login to Claude.ai accounts, `console` to restrict login to Claude Console (API usage billing) accounts | `claudeai` |214| `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` |

215| `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"]` |215| `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"]` |

216| `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](/en/server-managed-settings#enforce-fail-closed-startup) | `true` |216| `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](/en/server-managed-settings#enforce-fail-closed-startup) | `true` |

217| `gcpAuthRefresh` | Custom script that refreshes GCP Application Default Credentials when they expire or cannot be loaded. See [advanced credential configuration](/en/google-vertex-ai#advanced-credential-configuration) | `gcloud auth application-default login` |217| `gcpAuthRefresh` | Custom script that refreshes GCP Application Default Credentials when they expire or cannot be loaded. See [advanced credential configuration](/en/google-vertex-ai#advanced-credential-configuration) | `gcloud auth application-default login` |

218| `hooks` | Configure custom commands to run at lifecycle events. See [hooks documentation](/en/hooks) for format | See [hooks](/en/hooks) |218| `hooks` | Configure custom commands to run at lifecycle events. See [hooks documentation](/en/hooks) for format | See [hooks](/en/hooks) |


983For each locked surface, Claude Code skips user-level and project-level sources and loads only plugin-provided and managed sources:983For each locked surface, Claude Code skips user-level and project-level sources and loads only plugin-provided and managed sources:

984 984 

985| Surface | Blocked when locked | Still loads |985| Surface | Blocked when locked | Still loads |

986| :------- | :------------------------------------------------ | :---------------------------------------------------------------------------------- |986| :------- | :------------------------------------------------ | :--------------------------------------------------------------------- |

987| `skills` | `~/.claude/skills/`, `.claude/skills/` | Plugin skills, bundled skills, skills in the managed policy directory |987| `skills` | `~/.claude/skills/`, `.claude/skills/` | Plugin skills, bundled skills, skills in the managed policy directory |

988| `agents` | `~/.claude/agents/`, `.claude/agents/` | Plugin agents, built-in agents, agents in the managed policy directory |988| `agents` | `~/.claude/agents/`, `.claude/agents/` | Plugin agents, built-in agents, agents in the managed policy directory |

989| `hooks` | Hooks in user, project, and local `settings.json` | Plugin hooks, hooks in managed settings |989| `hooks` | Hooks in user, project, and local `settings.json` | Plugin hooks, hooks in managed settings |

990| `mcp` | Servers in `~/.claude.json` and `.mcp.json` | Plugin MCP servers, [`managed-mcp.json`](/en/mcp#managed-mcp-configuration) servers |990| `mcp` | Servers in `~/.claude.json` and `.mcp.json` | Plugin MCP servers, [`managed-mcp.json`](/en/managed-mcp) servers |

991 991 

992Surface 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.992Surface 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.

993 993 

en/setup.md +14 −11

Details

20 * Alpine Linux 3.19+20 * Alpine Linux 3.19+

21* **Hardware**: 4 GB+ RAM, x64 or ARM64 processor21* **Hardware**: 4 GB+ RAM, x64 or ARM64 processor

22* **Network**: internet connection required. See [network configuration](/en/network-config#network-access-requirements).22* **Network**: internet connection required. See [network configuration](/en/network-config#network-access-requirements).

23* **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.23* **Shell**: Bash, Zsh, PowerShell, or CMD.

24* **Location**: [Anthropic supported countries](https://www.anthropic.com/supported-countries)24* **Location**: [Anthropic supported countries](https://www.anthropic.com/supported-countries)

25 25 

26### Additional dependencies26### Additional dependencies


104You can run Claude Code natively on Windows or inside WSL. Pick based on where your projects are located and which features you need:104You can run Claude Code natively on Windows or inside WSL. Pick based on where your projects are located and which features you need:

105 105 

106| Option | Requires | [Sandboxing](/en/sandboxing) | When to use |106| Option | Requires | [Sandboxing](/en/sandboxing) | When to use |

107| -------------- | ------------------------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------- |107| -------------- | ---------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------- |

108| Native Windows | [Git for Windows](https://git-scm.com/downloads/win) recommended; PowerShell used if absent | Not supported | Windows-native projects and tools |108| Native Windows | None; [Git for Windows](https://git-scm.com/downloads/win) is optional | Not supported | Windows-native projects and tools |

109| WSL 2 | WSL 2 enabled | Supported | Linux toolchains or sandboxed command execution |109| WSL 2 | WSL 2 enabled | Supported | Linux toolchains or sandboxed command execution |

110| WSL 1 | WSL 1 enabled | Not supported | If WSL 2 is unavailable |110| WSL 1 | WSL 1 enabled | Not supported | If WSL 2 is unavailable |

111 111 

112**Option 1: Native Windows with Git Bash**112**Option 1: Native Windows**

113 113 

114Install [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.114Run 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](/en/tools-reference#bash-tool-behavior) by providing Git Bash.

115 115 

116Whether 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](/en/terminal-guide#windows) walks through each step.116Whether 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](/en/terminal-guide#windows) walks through each step.

117 117 

118After 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](/en/settings):118After installation, launch `claude` from any terminal.

119 119 

120```json theme={null}120* **Without Git for Windows**, Claude Code runs shell commands via the [PowerShell tool](/en/tools-reference#powershell-tool).

121{121* **With Git for Windows**, Claude Code uses Git Bash for the [Bash tool](/en/tools-reference#bash-tool-behavior). If Claude Code can't find Git Bash, set the path in your [settings.json file](/en/settings):

122 

123 ```json theme={null}

124 {

122 "env": {125 "env": {

123 "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"126 "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"

124 }127 }

125}128 }

126```129 ```

127 130 

128Claude 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](/en/tools-reference#powershell-tool) for setup and limitations.131When 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](/en/tools-reference#powershell-tool) for setup and limitations.

129 132 

130**Option 2: WSL**133**Option 2: WSL**

131 134 

en/skills.md +2 −2

Details

11Create 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.11Create 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.

12 12 

13<Note>13<Note>

14 For built-in commands like `/help` and `/compact`, and bundled skills like `/debug` and `/simplify`, see the [commands reference](/en/commands).14 For built-in commands like `/help` and `/compact`, and bundled skills like `/debug` and `/code-review`, see the [commands reference](/en/commands).

15 15 

16 **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](#control-who-invokes-a-skill), and the ability for Claude to load them automatically when relevant.16 **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](#control-who-invokes-a-skill), and the ability for Claude to load them automatically when relevant.

17</Note>17</Note>


20 20 

21## Bundled skills21## Bundled skills

22 22 

23Claude 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.23Claude 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.

24 24 

25Bundled skills are listed alongside built-in commands in the [commands reference](/en/commands), marked **Skill** in the Purpose column.25Bundled skills are listed alongside built-in commands in the [commands reference](/en/commands), marked **Skill** in the Purpose column.

26 26 

Details

11Create 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.11Create 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.

12 12 

13<Note>13<Note>

14 For built-in commands like `/help` and `/compact`, and bundled skills like `/debug` and `/simplify`, see the [commands reference](/en/commands).14 For built-in commands like `/help` and `/compact`, and bundled skills like `/debug` and `/code-review`, see the [commands reference](/en/commands).

15 15 

16 **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](#control-who-invokes-a-skill), and the ability for Claude to load them automatically when relevant.16 **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](#control-who-invokes-a-skill), and the ability for Claude to load them automatically when relevant.

17</Note>17</Note>


20 20 

21## Bundled skills21## Bundled skills

22 22 

23Claude 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.23Claude 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.

24 24 

25Bundled skills are listed alongside built-in commands in the [commands reference](/en/commands), marked **Skill** in the Purpose column.25Bundled skills are listed alongside built-in commands in the [commands reference](/en/commands), marked **Skill** in the Purpose column.

26 26 

Details

227 227 

228On 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.228On 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.

229 229 

230Claude 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`.

231 

230### Shell selection in settings, hooks, and skills232### Shell selection in settings, hooks, and skills

231 233 

232Three additional settings control where PowerShell is used:234Three additional settings control where PowerShell is used:

Details

16| :------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------- |16| :------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------- |

17| `command not found: claude` or `'claude' is not recognized` | [Fix your PATH](#command-not-found-claude-after-installation) |17| `command not found: claude` or `'claude' is not recognized` | [Fix your PATH](#command-not-found-claude-after-installation) |

18| `syntax error near unexpected token '<'` | [Install script returns HTML](#install-script-returns-html-instead-of-a-shell-script) |18| `syntax error near unexpected token '<'` | [Install script returns HTML](#install-script-returns-html-instead-of-a-shell-script) |

19| `curl: (56) Failure writing output to destination` | [Check connectivity or use an alternative installer](#curl-56-failure-writing-output-to-destination) |19| `curl: (22) The requested URL returned error: 403` | [Install script returned 403](#install-script-returns-html-instead-of-a-shell-script) |

20| `curl: (23)` or `curl: (56) Failure writing output to destination` | [Check connectivity or use an alternative installer](#curl-56-failure-writing-output-to-destination) |

20| `Killed` during install on Linux | [Add swap space for low-memory servers](#install-killed-on-low-memory-linux-servers) |21| `Killed` during install on Linux | [Add swap space for low-memory servers](#install-killed-on-low-memory-linux-servers) |

21| `TLS connect error` or `SSL/TLS secure channel` | [Update CA certificates](#tls-or-ssl-connection-errors) |22| `TLS connect error` or `SSL/TLS secure channel` | [Update CA certificates](#tls-or-ssl-connection-errors) |

22| `Failed to fetch version` or can't reach download server | [Check network and proxy settings](#check-network-connectivity) |23| `Failed to fetch version` or can't reach download server | [Check network and proxy settings](#check-network-connectivity) |


298Invoke-Expression: Missing argument in parameter list.299Invoke-Expression: Missing argument in parameter list.

299```300```

300 301 

301This 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).302Depending on how the request was routed, you may instead see a 403 with no HTML body:

303 

304```text theme={null}

305curl: (22) The requested URL returned error: 403

306```

307 

308These 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).

309 

310A 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](#check-network-connectivity) before trying the alternative installers below, since those reach the same hosts.

302 311 

303Otherwise, this can happen due to network issues, regional routing, or a temporary service disruption.312Otherwise, this can happen due to network issues, regional routing, or a temporary service disruption.

304 313 


335 344 

336### `curl: (56) Failure writing output to destination`345### `curl: (56) Failure writing output to destination`

337 346 

338The `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.347The `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.

339 348 

340**Solutions:**349**Solutions:**

341 350 


527 536 

528### Claude Code on Windows requires either Git for Windows (for bash) or PowerShell537### Claude Code on Windows requires either Git for Windows (for bash) or PowerShell

529 538 

530Claude 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.539Git for Windows is optional. Claude Code uses the [PowerShell tool](/en/tools-reference#powershell-tool) when Git Bash is absent, so this error means neither shell was found.

531 540 

532**If neither is installed**, install one:541**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`.

533 542 

534* 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.543**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.

535* PowerShell 7: download from [aka.ms/powershell](https://aka.ms/powershell).

536 544 

537**If Git is already installed** but Claude Code can't find it, set the path in your [settings.json file](/en/settings):545**If Git is already installed** but Claude Code can't find it, set the path in your [settings.json file](/en/settings):

538 546