Skip to content

feat(statusline): cost-tier colors for model/effort + output-style segment - #8

Open
johnsje183 wants to merge 2 commits into
ilia-pluzhnikov:mainfrom
johnsje183:feat/output-style-and-cost-tier-colors
Open

feat(statusline): cost-tier colors for model/effort + output-style segment#8
johnsje183 wants to merge 2 commits into
ilia-pluzhnikov:mainfrom
johnsje183:feat/output-style-and-cost-tier-colors

Conversation

@johnsje183

Copy link
Copy Markdown

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): Ha green, So yellow, Op orange, Fb/My bold red; lomdhgxhgmx on 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:expl output-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

  • No deps, single file, exit-0-on-error preserved (the style segment is wrapped in its own try/catch)
  • Hide on happy path: default style is invisible, existing setups without styles render byte-for-byte the same line text
  • Only widely-supported ANSI codes: 30–37, 1;31, and the truecolor orange already used elsewhere — no TUI-incompatible attributes
  • Own-key lookups on all new maps (FAMILY_COLORS, EFFORT_COLORS, KNOWN_STYLES), matching the EFFORT_CODES prototype guard from feat(statusline): show reasoning-effort tier as a 2-letter code after the model #6

Testing

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):

Fb5:xhg (1m) │ style:expl │ myproject (main) │ ██░░░ 250k/1M │ ...

with Fb5 bold red, :xhg red, (1m) dim, expl magenta.

🤖 Generated with Claude Code

johnsje183 and others added 2 commits July 8, 2026 22:09
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>
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.

1 participant