Parse "Kept model as" and Claude Code 2.1.x transcript format - #5
Open
egerev wants to merge 2 commits into
Open
Conversation
- Match both "Set model to" and "Kept model as" in /model output so the status line reflects effort after both commands, not just model switches. - Handle new JSONL format (Claude Code 2.1.x), where /model output lives in top-level `content` on system entries, in addition to the legacy `message.content` on assistant entries. Without this, effort falls back to the stale settings.json value after a `/model` confirmation or on recent Claude Code versions.
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.
Summary
Set model toandKept model asin/modeloutput so the status line reflects effort after both commands, not just model switches./modeloutput lives in top-levelcontenton system entries (in addition to legacymessage.contenton assistant entries).Without this, effort falls back to the stale
settings.jsonvalue after a/modelconfirmation or on recent Claude Code versions, so[Opus 4.7]is shown without the effort suffix.Test plan
/modelin Claude Code 2.1.x, pick a model with explicit effort → status line shows[Opus 4.7 · max]./modeland choose "Kept model as" → status line keeps showing the correct effort.message.content) as well.