Feature Request: Expose Sandbox Status to Status Line JSON Input
Resolved 💬 2 comments Opened Jan 16, 2026 by danwan Closed Feb 27, 2026
Problem
When using Claude Code with a custom status line, there's currently no way to display whether sandbox mode is enabled or disabled. Users have to:
- Run
/sandboxor/configmanually to check the current state - Wait until a command gets blocked to realize sandbox is active
- Check settings files, which don't reflect runtime overrides
This creates uncertainty about the security posture of the current session, especially when switching between projects or using command-line flags like --sandbox.
Proposed Solution
Add a sandbox object to the status line JSON input:
{
"hook_event_name": "Status",
"session_id": "abc123...",
"cwd": "/current/working/directory",
"model": { ... },
"sandbox": {
"enabled": true,
"mode": "auto-allow",
"platform_supported": true
}
}
Use Cases
- Visual awareness: Display a 🔒 or
[SANDBOX]indicator in the status line - Security verification: Confirm sandbox is active before running sensitive operations
- Debugging: Understand why certain commands are being blocked
- Consistency with #6227: Similar to exposing permission mode, sandbox state is session context that scripts should access
Related Issues
- #6227 - Expose Active Permission Mode to Hooks and Statusline (covers permission mode, not sandbox)
- #7097 - Implement
--sandboxFlag for Granular Control
Environment
- Platform: macOS (Darwin)
- Claude Code version: Latest
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗