claude-code-usage-bar icon indicating copy to clipboard operation
claude-code-usage-bar copied to clipboard

feat: add `show_5h` toggle to hide the 5-hour usage window

Open anhede opened this issue 5 months ago • 2 comments

What you want

Add a show_5h: bool = True config key so users can hide the 5-hour usage segment via cs config set show_5h false.

Why

Users on a raw API key (no subscription plan) never receive the rate-limit headers that populate the 5-hour window — it permanently shows --% ↺ --. The segment is dead space for them. There is already an equivalent show_weekly toggle for the 7-day window; this adds the missing counterpart for the 5-hour one.

Sketch

# Default (show_5h=true)
› 5h █▃▁ 42% ↺ 2h47m ┊ › 7d ▆▁▁ 18% ↺ 3d12h ┊ › Sonnet 4.6(280k/1M)

# After: cs config set show_5h false
› 7d ▆▁▁ 18% ↺ 3d12h ┊ › Sonnet 4.6(280k/1M)

Same behavior in capsule and classic styles.

Constraints to keep in mind

cs runs ~60×/min in Claude Code's statusLine hook. New features should not:

  • Add heavy import-time deps to the render path (tests/test_import_perf.py pins this)
  • Break the visual identity (battery bar, [ ], emoji clocks, |, (used/size) parens are part of the product)
  • Require new external services or daemons beyond the existing optional cs daemon

This change is a conditional if show_5h: guard in the renderers — no new imports, no new deps, no layout changes when the flag is at its default.

anhede avatar Jun 11 '26 07:06 anhede

Accidentally closed. Could you reopen the issue @leeguooooo ? I have a branch where I've added the feature, and I'd like to open a PR.

anhede avatar Jun 11 '26 07:06 anhede

reopened, PR welcome

leeguooooo avatar Jun 11 '26 08:06 leeguooooo