Statusline shows model and context% from other sessions
Summary
The statusline command receives stale cross-session data. When I switch to Sonnet in one session, all other sessions' statuslines update to show "Sonnet" and that session's context%, even though they're still running Opus with different context usage.
Reproduction
- Open two Claude Code sessions (two terminals)
- Both start on Opus 4.6 – statuslines show correct model and context%
- In session B, run
/model sonnet - Session A's statusline now shows "Sonnet" and session B's context%
Session A never changed models. Its statusline should still show Opus.
Expected
Each session's statusline reflects its own model and context window usage.
Actual
The statusline input JSON (model and context_window.used_percentage) appears to come from whichever session most recently triggered an update, not the session the statusline belongs to.
Environment
- Claude Code 2.1.81
- tmux with multiple panes, each running a separate
claudesession - Custom
statusline_commandin settings.json (Python script reading from stdin)
Notes
The statusline script itself is stateless – it reads JSON from stdin and prints. The cross-contamination happens upstream in whatever feeds the JSON to the command. The used_percentage field is also null (not 0) when a session has no messages yet, which crashes scripts that do int(round(used_percentage)) – but that's a separate issue.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗