Feature request: expose plan_mode and sandbox in statusline JSON
Feature Request
Add plan_mode and sandbox fields to the JSON object piped to statusline commands via stdin.
Current statusline JSON schema
The statusline command currently receives these fields:
{
"session_id": "...",
"model": { "id": "claude-opus-4-6", ... },
"context_window": {
"total_input_tokens": ...,
"total_output_tokens": ...,
...
},
"cost": {
"total_cost_usd": ...
}
}
Requested additions
plan_mode (boolean)
Whether the session is currently in plan mode (/plan toggled on). This would allow statusline scripts to display the current planning state.
sandbox (boolean or object)
Whether sandbox mode is active. Could be a simple boolean, or an object with details like { "enabled": true, "network": {...}, "filesystem": {...} }.
Use case
I use a custom statusline script to display session state at a glance. Currently there is no way to detect plan mode or sandbox status from the statusline command — the JSON stdin doesn't include these fields, and there are no corresponding environment variables (CLAUDE_PLAN_MODE, CLAUDE_SANDBOX, etc.).
Without these fields, any plan/sandbox indicator in the statusline is always stale (e.g., always shows "off").
Example desired output
Month: $4.23 sandbox:on plan:on
Thank you\!
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗