Element guide
Claude Code statusline with token usage
See live context window usage in your Claude Code statusline — percentage, progress bar, or absolute token counts.
Why track context in your statusline?
Claude Code emits `context_window.used_percentage`, `total_input_tokens`, and `context_window_size` on every render. Surfacing those numbers in your statusline lets you spot when a session is approaching the limit before you hit a compaction or rejection mid-edit.
statusline.sh ships two complementary elements: `contextBar` renders an inline progress bar with configurable width and fill characters, and `contextPct` prints the raw percentage. A `contextTokens` variant prints absolute used / remaining / ratio counts in compact (`94.4k/200k`) or full form.
Threshold-aware colors
All three context elements support a `colorMode` of `percentage` or `absolute` that color-codes the output as it crosses configurable green / yellow / orange / red thresholds. The bar in the preview below smoothly transitions through the palette as you grow the session — no extra script logic required.
How to add it
Drag the Context Bar or Context % element onto the builder canvas, set the width and characters, and pick a color mode. The live preview uses realistic mock session data so you can preview the bar at fresh, mid, and near-cap usage before installing.