Repository navigation
fix: resume Claude sessions with their launch model and effort until one is recorded - #22
Merged
Merged
Conversation
…one is recorded Claude reports its model and effort only through its status line, so a fresh session has nothing recorded until its first use. resumeArgsFor stripped the launch flags' --model and --effort and re-added only the recorded values, so a Claude session restarted before first use (a reboot, a bulk update) came back without either: on the saved default model and the default effort rather than what it was launched with. Resume now remembers the launch values while stripping them and falls back to them when nothing has been recorded. A recorded selection still wins, so a later /model or /effort change is honoured, and each setting falls back independently. Split and inline flag forms are both handled, and a dangling flag is ignored rather than consuming the next token. Codex and Pi are unaffected: both record model and effort from their own hook payloads at session start. Validated: full suite (548 tests, 3 new), shellcheck, .mjs syntax, npm run check, npm audit, and resumeArgsFor applied to six live Claude team sessions with nothing recorded: all now resume on Opus 5.5 1M at max effort, where previously all six dropped both settings. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Xs8AVBVrTGfpzUMiCQp2R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Claude reports its model and effort only through its status line, so a freshly started session has nothing recorded until its first use.
resumeArgsForstripped the launch flags'--model/--effortand re-added only the recorded values, so a Claude session restarted before first use (a reboot, a bulk/sab-update) came back with neither: it landed on the saved default model and the default effort rather than what it was launched with.Found while standing up a new six-session Claude team on
claude-opus-5-5[1m]atmax. Every one of them would have lost both settings on an early restart.Fix
Resume remembers the launch values while stripping them and falls back to them when nothing has been recorded.
/modelor/effortchange is honoured. The existing test pinning that is unchanged.--model X) and inline (--model=X) forms are handled, and a dangling flag is ignored rather than consuming the next token.Codex and Pi are unaffected: both record model and effort from their own hook payloads at session start.
Validation
npm test— 548 pass / 0 fail (3 new).mjssyntax,npm run check,npm run audit(0 vulnerabilities)resumeArgsForapplied to six live Claude team sessions with nothing recorded: all now resume on Opus 5.5 1M atmax; before the fix all six dropped both🤖 Generated with Claude Code
https://claude.ai/code/session_011Xs8AVBVrTGfpzUMiCQp2R