Skip to main content

Crate claude_quota_bar

Crate claude_quota_bar 

Source
Expand description

claude-quota-bar — fast Claude Code statusline.

Library surface exists so integration tests can call into render paths without spawning the binary; the binary itself is a thin shell in main.rs that does stdin/file IO and delegates to these modules.

Modules§

ansi
Minimal ANSI helpers. Respects NO_COLOR (https://no-color.org/).
cache
Cross-session stdin cache.
git
Git status — shells out to git with a tight timeout and 5s cache.
input
Parse Claude Code stdin JSON. Only the fields the renderer consumes are declared; serde ignores the rest of the payload.
progress
Battery-bar rendering — percentage text centered inside a colored bar, filled cells use the severity background, empty cells use the gutter. Text foreground flips per cell so digits stay readable on both the light severity bg and the dark gutter.
render
Status-line composition. Segments are pure functions over a Context; the caller in main.rs handles all I/O (stdin parse, git lookup, cache read) before invoking render.
theme
Color palette. One default theme (graphite) tuned to match the reference screenshot. Severity colors flip green→yellow→red at 30%/70%.
time_fmt
Time / countdown formatting. Pure functions, no clock reads except the now_unix() helper which is the only impurity.