[Feature Request] --resume should restore the last active model (including [1m] variants)
Summary
When resuming a session with --resume, the active model defaults to whatever is configured at startup rather than the model that was last used in the session. This breaks continuity, especially when:
- The user switched models mid-session (e.g.
/model claude-opus-4-8[1m]) - The session used a
[1m]context variant that affects prompt cache validity - The session was long-running and the user expects to continue exactly where they left off
Expected Behavior
--resume should restore the last active model at the time the session ended — not the model at session start. If the user switched models during the session, the final model should be what gets restored.
This should include full model ID fidelity, including:
- Base model names (e.g.
claude-sonnet-4-6) [1m]context window variants (e.g.claude-opus-4-8[1m])- Any other modifier suffixes
Current Behavior
The active model reverts to the default or whatever --model is passed at startup. Mid-session model switches are silently lost.
Why "Last Used" Matters
A user may start a session with the default model, then switch to a more capable or larger-context model for heavy work. On resume, they expect to continue with that heavier model — not silently downgrade back to the default.
Implementation Suggestion
Persist the active model ID in the session journal on every model change (and at session close). On --resume, read the last persisted model from the journal and apply it before replaying context — unless --model is explicitly passed, which should take precedence.
Related Issues
- #65805 —
--resumedrops the[1m]modifier (invalidates prompt cache) - #66005 —
--resumedrops the session's--effortlevel
Both are symptoms of the same root cause: session resume doesn't restore runtime state. This request asks for that to be fixed holistically for the active model.