Model switch to Opus not preserved after /compact — session restarts on previous model
Resolved 💬 3 comments Opened May 15, 2026 by JoyCal000Gold Closed May 19, 2026
Summary
After switching to Opus mid-session and running /compact, the new context window opened on Sonnet 4.6 instead of Opus. The model switch did not survive the compaction boundary.
Steps to reproduce
- Start a Claude Code session (opens on Sonnet 4.6 by default)
- Switch to Opus model (via model selector /
/modelcommand) - Run
/compactto compress context - Observe: new context window is back on Sonnet 4.6, not Opus
Expected behavior
The selected model should persist across /compact context boundaries. If I switched to Opus before compacting, the session should resume on Opus.
Actual behavior
Session restarts on Sonnet 4.6 after /compact, ignoring the prior model selection.
Environment
- Session UID:
20260515T192400Z-master-1fe68a4b - Platform: Windows 11 Home (10.0.26200)
- Claude Code version: current (as of 2026-05-15)
- Model intended: claude-opus-4-7 (or latest Opus)
- Model actually running after compact: claude-sonnet-4-6
Impact
Users lose their model selection silently on every compaction. In long agentic sessions where Opus is chosen specifically for its 1M context window and orchestration quality, this causes the coordinator to run on a lower-capability model without realizing it.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗