[BUG] Status line receives incorrect model information after model switch in multi-session environment
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?
## Description
When running multiple Claude Code sessions simultaneously and switching models in one session, the status line continues to display outdated model information even though the actual API calls use the correct model.
## Environment
- Claude Code version: 2.0.76
- OS: macOS (Darwin 24.6.0)
- Date: 2025-12-27
## Steps to Reproduce
- Start Session A with Sonnet 4.5 (or any model)
- Start Session B with Sonnet 4.5
- In Session B, use
/modelcommand to switch to Haiku 4.5 - Send a message in Session B
- Observe the status line in Session B
## Expected Behavior
- Session B's status line should display:
Model: Haiku 4.5 - The actual API calls should use Haiku 4.5
## Actual Behavior
- Session B's status line displays:
Model: Sonnet 4.5❌ - The actual API calls correctly use Haiku 4.5 ✅
- Running
/modelcommand confirms: "Kept model as haiku" ✅ - The AI's response confirms it's using Haiku 4.5 ✅
## Evidence
I added debug logging to my custom status line script to capture the JSON data passed from Claude Code:
```bash
# In ~/.claude/statusline-command.sh
debug_log=~/.claude/statusline-debug.log
echo "=== $(date '+%Y-%m-%d %H:%M:%S') | PID: $$ | PPID: $PPID ===" >> "$debug_log"
echo "$input" | jq '.' >> "$debug_log" 2>&1
Debug log output for Session B (PPID: 76520) after switching to Haiku:
=== 2025-12-27 08:48:56 | PID: 81596 | PPID: 76520 ===
{
"session_id": "2df9f6e6-c78f-4af3-b40f-f15e3851b677",
"model": {
"id": "claude-sonnet-4-5-20250929",
"display_name": "Sonnet 4.5"
},
// ... other fields
}
The JSON data shows "Sonnet 4.5" even though:
- /model command shows: "Kept model as haiku"
- Actual API responses are from Haiku 4.5
- Session B should be using Haiku
Root Cause
Claude Code is passing stale/incorrect model information to the status line command, even though the actual session is correctly using the updated model for API calls. This appears to be an internal state synchronization issue where the model used for API calls and the model information passed to the status line script are not in sync.
Impact
- Users cannot trust the status line to show which model is actually being used
- This can lead to confusion about costs and model capabilities
- Particularly problematic when running multiple sessions with different models
Workaround
None currently available, as the issue is in Claude Code's core, not in the status line script.
Additional Notes
The status line script itself is working correctly - it's simply displaying the model information that Claude Code provides. The bug is in Claude Code's internal model state management when passing data to the status line.
What Should Happen?
- Session B's status line should display:
Model: Haiku 4.5 - The actual API calls should use Haiku 4.5
Error Messages/Logs
Steps to Reproduce
- Start Session A with Sonnet 4.5 (or any model)
- Start Session B with Sonnet 4.5
- In Session B, use
/modelcommand to switch to Haiku 4.5 - Send a message in Session B
- Observe the status line in Session B
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.76
Platform
Other
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗