Skip to content

fix: stop replaying leftover model-name words as a Claude prompt - #32

Merged
SergioTCG merged 1 commit into
mainfrom
fix/claude-stray-launch-words
Oct 14, 2026
Merged

SergioTCG merged 1 commit into
mainfrom
fix/claude-stray-launch-words

Conversation

@SergioTCG

Copy link
Copy Markdown
Owner

Problem

Older releases recorded the Claude status line's display name as the model, so stored launch flags held values like --model Opus 4.8 or --model Opus 5 (1M context). Launch flags are stored as one space-joined string. A later model change consumed only --model Opus and left the remaining words (4.8, 5 (1M context)) behind.

resumeArgsFor() passed those words through, so every resume started Claude with a positional argument. Claude treats that as a prompt and immediately runs a turn on "4.8" or "5" that nobody sent. Each new start reports its argv back through CCS_FLAGS, so the leftover words also stayed in the stored flags.

Current code already records a validated model ID (claudeModelForResume), so no new records get these words. This change cleans up the ones that already exist.

Fix

displayFlagsFor(), which feeds both resume and /sab-flags display, now drops a bare Claude word in two cases:

  • it follows an on/off flag (--dangerously-skip-permissions, --chrome) or another dropped word;
  • it follows a --model/--effort that already has its value.

Bare words after an option SAB does not know are kept, so operator CCS_NEW_FLAGS / CCS_RESUME_FLAGS such as --permission-mode acceptEdits or --add-dir /a /b still resume unchanged. The next start reports clean flags, so stored records heal themselves without a state migration. Codex and Pi parsing is unchanged.

Verification

  • New provider test covering the two real shapes, the original unsplit --model Opus 4.8, an inline --option=value followed by a leftover word, and preserved values of unknown options. It fails without the fix.
  • npm test: 594/594 pass.
  • Dry run against a real install's state (70 sessions): all Codex and Pi resume args are unchanged. Affected Claude sessions lose only the leftover words, for example --dangerously-skip-permissions 4.8 --model claude-opus-5-5[1m] … becomes --dangerously-skip-permissions --model claude-opus-5-5[1m] ….

🤖 Generated with Claude Code

Older releases recorded the status-line display name as the Claude model,
so stored launch flags held `--model Opus 4.8` or `--model Opus 5 (1M
context)` in one space-joined string. A later model change consumed only
`--model Opus` and left the remaining words behind. Every resume then
passed them to Claude as a positional prompt, so the session started a
turn on "4.8" or "5" that nobody sent.

Resume and flag display now drop a bare Claude word that follows an
on/off flag or an already-filled --model/--effort. Bare words after an
option SAB does not know, such as an operator CCS_NEW_FLAGS value, are
kept. The next start reports clean flags, so stored records heal
themselves without a migration.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@SergioTCG
SergioTCG merged commit 1cc96dc into main Oct 14, 2026
3 checks passed
@SergioTCG
SergioTCG deleted the fix/claude-stray-launch-words branch October 14, 2026 13:12
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