Skip to main content

Claude Code statusline

OpenUsage can render a one-line status bar for Claude Code, shown at the bottom of the editor. It summarizes the model, your session and today's cost, the active 5-hour billing block, the burn rate, and how full the context window is — all from your local conversation logs, with no network call by default.

OpenUsage statusline in Claude Code

🤖 Opus 4.8 | 💰 $12.40 sess / $6.79 today / $3.40 block (2h41m left) | 🔥 $1.20/hr | 🕔 5h 15% | 🧠 96k (48%)
note

Costs are API-equivalent estimates derived from your local logs, not your subscription charge. The session figure is the whole conversation's lifetime; "today" is across all your Claude Code sessions since local midnight.

Install

The fastest path is the interactive installer. On a terminal, run:

openusage statusline install

This opens a one-screen, live-preview configurator (the same style as openusage tmux install). Toggle which segments you want, flip the options, and watch the preview update; press enter on Apply to write it into ~/.claude/settings.json (your previous settings are backed up to settings.json.bak).

Installing the Claude Code statusline with the live-preview configurator

Then restart Claude Code (or open a new session) so it re-reads settings.json.

What each segment shows

SegmentExampleNotes
Model name🤖 Opus 4.8From the session Claude Code pipes in.
Session cost$12.40 sessThe whole conversation's API-equivalent cost.
Today's cost$6.79 todayAll Claude Code spend since local midnight.
5h block$3.40 block (2h41m left)The active 5-hour billing block and time remaining.
Burn rate🔥 $1.20/hrSpend rate for the active block.
5h usage window🕔 5h 15%Rate-limit utilization of the rolling 5-hour window. This isn't in the local logs — it's read from the running OpenUsage daemon over the local socket (no network), and is shown only when the daemon is running and has it.
Context %🧠 96k (48%)Tokens in the context window vs. the model's limit; turns yellow then red as it fills.
tip

The 5h usage window segment needs the telemetry daemon (openusage telemetry daemon install), which is what polls Claude Code's rate-limit quota. The value is cached locally for ~30s (a single small file shared across sessions), so renders stay instant and the daemon isn't hit on every keystroke. The other segments work purely from local logs with no daemon.

Customize

Everything the configurator sets can also be passed as flags — useful for scripting or for editing the command in settings.json directly.

# Only show today's cost and the context gauge:
openusage statusline install --segments today,context

# Drop color (e.g. for a terminal that mishandles ANSI), keep all segments:
openusage statusline install --color=false

# Fetch live pricing instead of the embedded table (slightly slower):
openusage statusline install --offline=false

Passing any of --segments, --color, --offline, or --mode makes the install non-interactive and bakes those choices into the installed command.

Other flags:

  • --context-medium <pct> / --context-high <pct> — thresholds where the context gauge turns yellow / red (defaults: 50 / 80).
  • --mode calculate|display|autocalculate (default) recomputes cost from tokens and local pricing; display uses the cost Claude Code reports; auto prefers logged cost and falls back to calculation.

Manual configuration

If you'd rather edit ~/.claude/settings.json by hand, add a statusLine block. The installed command carries your options as flags:

{
"statusLine": {
"type": "command",
"command": "openusage statusline --segments today,context",
"padding": 0
}
}

A bare openusage statusline (no flags) shows every segment in full color.

Uninstall

openusage statusline uninstall

This removes only the OpenUsage statusLine block (it leaves a third-party statusline alone) and backs up the file first.

See also