Features · Built in · since version 2.0.24

Sandboxing

Run Claude's shell commands inside an operating-system sandbox that limits which files and websites they can reach.

What it is

With the sandbox on, every shell command Claude runs, and anything it starts, is fenced in by the operating system. By default commands can write only to the project folder and a temporary folder, and can reach only the network domains you allow. Because the limits are enforced by the system rather than by matching command text, Claude can run commands freely inside them without asking each time.

Why it matters

  • Fewer prompts, same safetyIn auto-allow mode, sandboxed commands run without asking because they cannot step outside the limits.
  • Protection that can't be talked aroundA command can't write outside its allowed folders or reach unknown sites, however it is phrased.
  • Organization-wide rulesAdmins can require the sandbox in managed settings, and a repository can't loosen it.

How it works

  1. Run /sandbox to turn it on and pick a mode; it also lists any missing dependencies.
  2. Or set sandbox.enabled to true in a settings file.
  3. Allow extra folders with filesystem.allowWrite and websites with network.allowedDomains.
  4. Works on macOS, Linux and WSL2; on Linux it needs bubblewrap and socat.
  5. Claude's own file tools, hooks and local MCP servers run outside the sandbox, so keep permission rules for them.

Hands-on example coming

This feature has no reviewed example yet. The official documentation below has the details.

Update history

  1. Version 2.0.30 · Oct 30, 2025

    Updated The allowUnsandboxedCommands setting lets admins remove the unsandboxed escape hatch.

  2. Version 2.0.24 · Oct 20, 2025

    Introduced A sandbox mode for Bash commands was released on Linux and macOS.

Official documentation