feat(statusline): cost-tier colors for model/effort + output-style segment - #8
Open
johnsje183 wants to merge 2 commits into
Open
Conversation
Model family and reasoning-effort code now carry a shared cost scale, green (cheap) -> bold red (most expensive): Ha green, So yellow, Op orange, Fb/My bold red; lo green, md yellow, hg orange, xhg red, mx bold red. The left edge of the line now answers "how expensive is this session" at a glance, the same way the context bar and rate-limit percentages already communicate urgency by color. The context-size suffix stays in its own dim span; unknown families and unknown effort levels keep the previous all-dim rendering. Own-key lookups on both color maps so prototype keys fall through to dim, matching the EFFORT_CODES guard. Only widely-supported ANSI codes (30-37, 1;31, and the truecolor orange already used elsewhere) - no TUI-incompatible attributes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude Code reports the active output style on stdin (output_style.name). A non-default style (Explanatory, Learning, or a custom one) changes how the assistant responds, is stored per settings scope - so it quietly differs between projects - and is easy to switch on and forget. Surface it as style:expl (dim label, magenta value) right after the model segment. Known styles get readable short codes (explanatory -> expl, learning -> learn); unknown styles abbreviate to their first five chars, own-key lookup so prototype keys take the generic fallback. The default style renders nothing - hide on happy path - so existing setups are visually unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
Two additions that make the left edge of the line more informative:
1. Cost-tier colors for the model family and effort code. Both scale green (cheap) → bold red (most expensive):
Hagreen,Soyellow,Oporange,Fb/Mybold red;lo→md→hg→xhg→mxon the same scale. The context bar and rate-limit percentages already communicate urgency by color — this extends the idea to "how expensive is this session", readable at a glance without parsing text. The context-size suffix stays in its own dim span; unknown families and unknown effort levels keep the previous all-dim rendering, so unrecognised models are visually unchanged.2.
style:exploutput-style segment. Claude Code reports the active output style on stdin (output_style.name). A non-default style (Explanatory, Learning, or a custom one) changes how the assistant responds, is stored per settings scope — so it quietly differs between projects — and is easy to switch on and forget. Rendered as a dim label + magenta value right after the model segment. Known styles get readable short codes (expl,learn); unknown styles abbreviate to their first five chars. The default style renders nothing.House rules
1;31, and the truecolor orange already used elsewhere — no TUI-incompatible attributesFAMILY_COLORS,EFFORT_COLORS,KNOWN_STYLES), matching theEFFORT_CODESprototype guard from feat(statusline): show reasoning-effort tier as a 2-letter code after the model #6Testing
node tests/statusline-smoke.test.js— green. The effort raw-span assertion is updated for the new colors, plus three new cases: family cost-tier colors (incl. dim fallback for unknown families), dim fallback for unknown effort levels, and output-style visibility rules (known / custom / default / absent). The README segment table is updated for both features.Example (Fable 5, xhigh effort, Explanatory style):
with
Fb5bold red,:xhgred,(1m)dim,explmagenta.🤖 Generated with Claude Code