Statusline shows model and context% from other sessions

Resolved 💬 2 comments Opened Mar 23, 2026 by teal-bauer Closed Mar 27, 2026

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

  1. Open two Claude Code sessions (two terminals)
  2. Both start on Opus 4.6 – statuslines show correct model and context%
  3. In session B, run /model sonnet
  4. 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 claude session
  • Custom statusline_command in 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗