Skip to content

fix: resume Claude sessions with their launch model and effort until one is recorded - #22

Merged
SergioTCG merged 1 commit into
mainfrom
fix/claude-resume-launch-settings-fallback
Oct 5, 2026
Merged

SergioTCG merged 1 commit into
mainfrom
fix/claude-resume-launch-settings-fallback

Conversation

@SergioTCG

Copy link
Copy Markdown
Owner

Problem

Claude reports its model and effort only through its status line, so a freshly started session has nothing recorded until its first use. resumeArgsFor stripped the launch flags' --model / --effort and 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] at max. 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.

  • A recorded selection still wins, so a later /model or /effort change is honoured. The existing test pinning that is unchanged.
  • Each setting falls back independently (e.g. recorded model + launch effort).
  • Both split (--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)
  • shellcheck, .mjs syntax, npm run check, npm run audit (0 vulnerabilities)
  • resumeArgsFor applied to six live Claude team sessions with nothing recorded: all now resume on Opus 5.5 1M at max; before the fix all six dropped both
  • Deployed with a daemon restart: all 27 channel servers re-attached, teams intact

🤖 Generated with Claude Code

https://claude.ai/code/session_011Xs8AVBVrTGfpzUMiCQp2R

…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
@SergioTCG
SergioTCG merged commit 3ab7536 into main Oct 5, 2026
3 checks passed
@SergioTCG
SergioTCG deleted the fix/claude-resume-launch-settings-fallback branch October 5, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants