Skip to content

Commit 2641b0a

Browse files
lroolleclaude
andcommitted
feat: extra-usage gating, color hierarchy, test coverage, bug fixes
Add --extra flag (always/on-limit/off) to control when extra-usage component appears. on-limit shows it only when 5h >= 80% or 7d >= 70%, keeping the statusline compact until quota pressure makes the budget actionable. developer theme defaults to on-limit, minimal to off. Color hierarchy overhaul: path demoted to dim cyan, dirty git branch pops yellow while clean recedes to dim yellow, time goes plain dim to reduce color noise, user tier label gets semantic color (MAX=green, PRO=cyan). Bug fixes found by code review: - Color variables used before definition (git info had no ANSI codes) - format_duration(0) returned "1m" instead of "0m" - Division by zero when CLAUDE_CONTEXT_LIMIT=0 Also: integer quota percentages (12% not 12.0%), refresh indicator (~ in flight, ! on error), 1h30m for sessions over 60 minutes, space between model[1m] and context bar, dead code removal. 85 bats tests (was 56). README rewritten. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ddca5aa commit 2641b0a

5 files changed

Lines changed: 449 additions & 312 deletions

File tree

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,37 @@
1414
- Refreshes expired file-based Claude Code OAuth tokens before quota/profile
1515
requests.
1616

17+
### Extra Usage Display Mode
18+
19+
New `--extra` flag controls when the extra-usage component appears:
20+
21+
- `always` (default) — show whenever extra usage is enabled
22+
- `on-limit` — show only when 5h >= 80% or 7d >= 70% (quota under pressure)
23+
- `off` — never show
24+
25+
The `developer` theme defaults to `on-limit`; `minimal` defaults to `off`.
26+
27+
### UX Refinements
28+
29+
- Quota percentages now display as integers: `5h[12%]` instead of `5h[12.0%]`.
30+
- Refresh indicator: `~` appears after quota cluster when an API fetch is in
31+
flight, `!` when the last fetch failed and data may be stale. Extra usage
32+
has its own independent indicator (separate API call).
33+
- Duration shows hours for long sessions: `1h30m` instead of `90m`.
34+
- Added space between model suffix and context bar to prevent visual confusion:
35+
`opus4.6[1m] [█░░░░░26%]` instead of `opus4.6[1m][█░░░░░26%]`.
36+
- Removed dead `add_component_no_space` and `format_usage_bar` functions.
37+
- Fixed `format_duration(0)` returning "1m" instead of "0m".
38+
- Fixed color variables used before definition (git info, path had no color).
39+
- Guarded context percentage against division by zero (`CLAUDE_CONTEXT_LIMIT=0`).
40+
41+
### Color Hierarchy
42+
43+
- Path demoted to dim cyan — frees visual weight for primary signals.
44+
- Git branch: dirty=yellow (pops), clean=dim yellow (recedes).
45+
- Time: plain dim instead of dim cyan — less color noise.
46+
- User tier label gets color: MAX=green, PRO=cyan, ENT/TEAM=dim cyan.
47+
1748
### Documentation
1849

1950
- Documented the extra-usage component, API behavior, and updated README preview

0 commit comments

Comments
 (0)