Command reference Β· Claude Code
/sandbox
Toggles Sandbox mode.
/sandbox toggles the isolated execution mode for the Bash tool. In sandbox mode, shell commands run with restricted file and network access - on macOS via the built-in Seatbelt framework, on Linux and WSL2 via bubblewrap. Native Windows installations aren't supported according to the docs; there, Claude Code must run inside a WSL2 distribution.
Running the command opens a panel with the tabs Mode (automatic allow or regular permission prompts for sandboxed commands), Overrides (whether failing commands are allowed to fall back to unsandboxed execution), and Config (resolved sandbox settings) - on Linux there's also a Dependencies tab if a package like bubblewrap or the optional seccomp filter is missing.
Important: sandbox mode is not a permission mode. Permission modes decide whether a tool call runs at all and whether it asks first; the sandbox, on the other hand, restricts what an already-started Bash command is allowed to access. Both can be combined independently of each other.
π THE SAME TASK (βTOGGLE SANDBOX MODEβ) ON OTHER PLATFORMS
- Cursor CLI: /sandbox
- Antigravity CLI: agy --sandbox
β WHEN TO USE IT?
Test risky, generated shell commands in isolation
enable /sandbox before running unknown code so the command only runs in the sandbox container (on macOS, Linux, or WSL2)
Check whether a missing dependency is blocking the sandbox
open /sandbox and check the Dependencies tab if only that tab is shown
β WHEN NOT TO?
Native Windows installation without WSL2
according to the docs, the sandbox runs on macOS, Linux, and WSL2 - native Windows isn't supported
Better: run Claude Code inside a WSL2 distribution, or work without the sandbox using the regular permission prompts
Wanting every tool call confirmed before execution as a general rule
the sandbox doesn't replace permission prompts, it only restricts what an already-running Bash command is allowed to access
Better: use permission modes to control whether a tool call runs at all
SOURCES
- Claude Code docs (official) β code.claude.com