Cmd. /sandbox
Toggle sandbox mode on supported platforms.
Key takeaways
- Toggle sandbox mode on supported platforms.
- Check the input surface and availability before using the examples below.
Purpose
Toggle sandbox mode on supported platforms.
/sandboxAvailability
| Field | Value |
|---|---|
| Input surface | Running CLI prompt |
| Kind | Built-in |
| Status | Conditional |
| Aliases | — |
| Documented minimum | Not specified |
| Reviewed against | 2026-09-22 · Claude Code 2.1.278 |
Supported on macOS and Linux/WSL2, not native Windows. Check the bubblewrap and socat dependencies on Linux/WSL2.
Examples
/sandboxEffects and persistence
Changes sandbox mode for tool execution on supported platforms.
Cautions
On v2.1.248+, claude --restricted or CLAUDE_CODE_RESTRICTED=1 starts a restricted execution profile.
Keep sandbox boundaries and tool approval rules distinct; changing one does not describe the complete permission policy.