[BUG] Status Bar Crosstalk in Multi-Session Environments

Resolved 💬 3 comments Opened Dec 24, 2025 by GongLe Closed Dec 27, 2025

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

📋 Bug Report: Status Bar Crosstalk in Multi-Session Environments
use this Repository https://github.com/MaurUppi/CCstatus
Title: Race Condition in Status Bar: Global State Pollution causing Model Name Crosstalk across Multiple Sessions

Severity: Medium (UX/Trust Issue) - Users may unknowingly interact with a more expensive model than displayed.

Summary: When running multiple concurrent claude CLI sessions (e.g., in split VS Code terminals or separate windows), the Status Bar integration fails to scope data to the specific session/terminal. Instead, it appears to use a global singleton for rendering. This causes the status bar to display the Model Name (and likely other metrics) from the last active background process rather than the currently focused foreground session.

🔄 Steps to Reproduce
Open VS Code with the Claude Code extension/integration enabled.

Open Terminal A, start a claude session, and configure it to use Claude 3.5 Sonnet.

Observation: Status bar correctly shows "Sonnet".

Open Terminal B (split view or new tab), start a new claude session, and configure it to use Claude 3.5 Haiku.

Observation: Status bar updates to "Haiku".

Return focus to Terminal A (Sonnet session) and trigger an interaction (or wait for a background refresh).

Simultaneously trigger activity in Terminal B.

Expected Behavior: The Status Bar should reflect the state of the currently focused terminal/session, OR maintain separate UI instances for separate windows.

Actual Behavior: The Status Bar flickers or persistently displays the state of the last process that wrote to stdout, regardless of which terminal the user is actually looking at. (e.g., User is typing in the "Sonnet" terminal, but Status Bar says "Haiku" because the background process just updated).

🔍 Technical Analysis & Root Cause
We have investigated the data flow and isolated the issue to the rendering logic, not the CLI data source.

The Data Source (CCstatus) is Valid: The CLI utility (CCstatus or equivalent) reading from stdin is correctly isolated per process. It reads the local session configuration and outputs the correct model name for its specific process tree. There is no cross-session pollution at the source level.

The Renderer is Likely a Global Singleton: The issue indicates that the VS Code extension host (or the logic handling the status bar updates) is treating the status update events as a Global Shared State.

Race Condition (Last Write Wins): The rendering logic follows a "Last Write Wins" pattern. Any update from any active background session overwrites the global status bar variable, causing the crosstalk.

What Should Happen?

Session model data can Isolation

Error Messages/Logs

Steps to Reproduce

  1. Open two separate Claude Code sessions in different terminal windows
  • Terminal A: Start session with Sonnet 4 model
  • Terminal B: Start session with Opus 4.5 model
  1. Configure a custom statusLine command in settings:

{
"statusLine": {
"type": "command",
"command": "your-statusline-command"
}
}

  1. Verify both sessions are active and displaying their respective status bars
  2. Switch focus between Terminal A and Terminal B, or wait for automatic status bar refresh

Expected Behavior:

  • Terminal A displays: Model: Sonnet 4
  • Terminal B displays: Model: Opus 4.5
  • Each window maintains its own session's model name independently

Actual Behavior:
Both windows display the model name from the most recently refreshed session. After Terminal B updates, Terminal A's status bar incorrectly shows "Opus 4.5" instead of "Sonnet 4".

Root Cause Analysis:
The statusLine command receives correct per-session data via stdin (unique session_id and model fields per window). The command outputs the correct model for each invocation. However, Claude Code appears to use a globally shared output cache for status bar rendering, causing the last command output to be displayed across all windows.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.76

Claude Code Version

2.0.76

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

_No response_

View original on GitHub ↗

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