Status line: include permission_mode in the stdin payload (mode changes already trigger a refresh, but the field is missing)
Feature request
Add permission_mode to the status line stdin payload.
Motivation
A custom status line that shows the current permission mode (bypassPermissions / plan / acceptEdits / default) is a natural safety affordance — a big red "BYPASS" chip is exactly the kind of thing you want permanently visible. Today it cannot be built correctly:
- The status line payload does not include
permission_mode. Verified empirically on v2.1.212 (Linux/WSL2) by logging every status line invocation for 2 minutes across 14 concurrent sessions — 173 invocations, and the key set was always:
session_id, transcript_path, cwd, prompt_id, effort, session_name, model, workspace, version, output_style, cost, context_window, exceeds_200k_tokens, fast_mode, thinking, rate_limits (occasionally vim, agent) — never permission_mode.
- The status line is re-executed when the mode changes via Shift+Tab (as documented), but since the payload carries no mode field and the toggle leaves no observable trace on disk (no transcript control line, no session-state file change — also verified by watching the filesystem during toggles), the re-run renders the same stale data.
- Hook payloads (PreToolUse, UserPromptSubmit, …) do carry
permission_mode, so the current best workaround is a hook that mirrors the field into a sidecar file the status line reads. That lags by one prompt/tool call: cycling Shift+Tab while idle updates nothing until the next interaction, which is exactly when you'd want the red chip to appear.
Proposal
Include the same permission_mode string already present in hook payloads in the status line JSON (top-level, matching the hook field name). Since the status line already refreshes on permission-mode changes, this one field makes mode-aware status lines work instantly with no other changes.
Environment
- Claude Code v2.1.212, native install, Linux (WSL2, Ubuntu), multiple concurrent interactive sessions
statusLine:{"type": "command", "command": "node ~/.claude/helpers/statusline-lcars.mjs", "padding": 0, "refreshInterval": 10}