/model command does not update model for the active session
Bug Report
Description
Running /model to switch models (e.g., from Sonnet 4.6 to Opus 4.6) reports success in the CLI output, but the session continues using the previous model. The statusline JSON payload confirms the old model is still being sent.
Steps to Reproduce
- Start a Claude Code session (e.g., on Sonnet 4.6)
- Run
/modeland select Opus 4.6 (1M context) - CLI output confirms:
Set model to Opus 4.6 (1M context) (default) - Send a message to trigger a new assistant turn
- Inspect the statusline JSON (via a custom
statusLinecommand insettings.json)
Expected Behavior
After /model changes the model, the next assistant turn should use the new model. The statusline JSON's model.id and model.display_name fields should reflect the newly selected model.
Actual Behavior
The statusline JSON still shows the previous model:
"model": {"id": "claude-sonnet-4-6", "display_name": "Sonnet 4.6"}
Despite /model confirming Opus 4.6 was selected.
Evidence
Added a debug line to the statusline script (echo "$INPUT" > /tmp/claude-statusline-debug.json) and confirmed the model field in the JSON payload sent to the statusline command was not updated after /model.
Environment
- Claude Code version: 2.1.85
- OS: macOS (Darwin 25.4.0)
- Shell: zsh
- StatusLine config: custom command in
settings.json→bash ~/.claude/statusline.sh
Notes
- The statusline script correctly reads
.model.display_namefrom the stdin JSON — the issue is that Claude Code is not updating the model data it sends. /clearfollowed by/modelmay work as a workaround (forces session reset).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗