/model command does not update model for the active session

Resolved 💬 3 comments Opened Mar 29, 2026 by ricardoffmendes Closed Apr 2, 2026

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

  1. Start a Claude Code session (e.g., on Sonnet 4.6)
  2. Run /model and select Opus 4.6 (1M context)
  3. CLI output confirms: Set model to Opus 4.6 (1M context) (default)
  4. Send a message to trigger a new assistant turn
  5. Inspect the statusline JSON (via a custom statusLine command in settings.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.jsonbash ~/.claude/statusline.sh

Notes

  • The statusline script correctly reads .model.display_name from the stdin JSON — the issue is that Claude Code is not updating the model data it sends.
  • /clear followed by /model may work as a workaround (forces session reset).

View original on GitHub ↗

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