Preflight Checklist
What's Wrong?
Enabling sandbox in settings causes all Bash tool calls to fail with Sandbox failed to initialize. — no additional error details provided.
The macOS Seatbelt framework itself works fine (sandbox-exec -n no-network echo "test" succeeds), so the issue appears to be in Claude Code's sandbox initialization logic, not in the OS-level sandbox.
What Should Happen?
Bash commands should execute within the macOS Seatbelt sandbox, with autoAllowBashIfSandboxed: true auto-approving commands that stay within sandbox boundaries. This would allow read-only and safe operations to run without individual permission prompts.
Error Messages/Logs
Sandbox failed to initialize.
Steps to Reproduce
- Add the sandbox config above to
~/.claude/settings.json
- Open Claude Code (CLI or VSCode extension)
- Run any Bash command (even
echo "test")
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.1.41
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
sandbox-exec works natively on this system — the Seatbelt framework is functional
- The error occurs for all commands, including trivial ones like
echo
- No symlinks involved — tested from a direct (non-symlinked) project directory
- Removing the sandbox config from settings restores normal behavior
Environment
| Aspect |
Details |
| OS |
macOS 26.2 Tahoe (BuildVersion 25C56) |
| Kernel |
Darwin 25.2.0 (xnu-12377.61.12~1/RELEASE_ARM64_T6041) |
| Architecture |
arm64 (Apple Silicon) |
| Claude Code |
2.1.41 |
| Node.js |
v20.19.4 (via nvm) |
| Context |
VSCode extension |
| sandbox-exec |
/usr/bin/sandbox-exec — functional |
Preflight Checklist
What's Wrong?
Enabling sandbox in settings causes all Bash tool calls to fail with Sandbox failed to initialize. — no additional error details provided.
The macOS Seatbelt framework itself works fine (sandbox-exec -n no-network echo "test" succeeds), so the issue appears to be in Claude Code's sandbox initialization logic, not in the OS-level sandbox.
What Should Happen?
Bash commands should execute within the macOS Seatbelt sandbox, with
autoAllowBashIfSandboxed: trueauto-approving commands that stay within sandbox boundaries. This would allow read-only and safe operations to run without individual permission prompts.Error Messages/Logs
Steps to Reproduce
~/.claude/settings.jsonecho "test")Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.1.41
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
sandbox-execworks natively on this system — the Seatbelt framework is functionalechoEnvironment
/usr/bin/sandbox-exec— functional