- Shell 100%
- Remove the pre-2.1.80 OAuth/curl usage-polling fallback; rate_limits now comes from stdin only. - Drop the per-window pacing indicator (current%/max%/unit ▲▼); show only usage remaining. - Reset display now pairs the relative countdown with the absolute 24h clock time, prefixing the weekday only when the reset is on a different day. - Normalize resets_at from epoch or ISO-8601 in jq; render in local time. - Strip accumulated dead code (effort glyph, context bar, duration, cost, unused dir-shortening). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| LICENSE | ||
| README.md | ||
| statusline.sh | ||
claude-statusline
A compact, single-line status line for Claude Code.
It shows, at a glance:
- Model — the active model's display name
- Git — current branch, plus changed-file count and
+added / -deletedline counts (cached for 5s so it stays cheap) - Context — percentage of the context window remaining, and the window size (e.g.
1M) - 5h usage — remaining percentage of the 5-hour rate-limit window, plus when it resets
- 7d usage — the same, for the 7-day window
claude-opus-4-8 | main 3f +120 -8 | ctx: 82% of 1M | 5h: 76% (3h, 16:20) | 7d: 91% (4d, Thu 05:12)
The reset shows both a relative countdown (3h, 4d, 45m) and the absolute clock time in 24-hour format. The weekday is added only when the reset falls on a different calendar day than today, so a same-day 5-hour reset stays compact (16:20) while a 7-day reset that crosses into another day reads Thu 05:12.
How it gets usage data
The rate-limit data arrives on stdin from Claude Code (version ≥ 2.1.80), so the script makes no network calls and reads no credentials. resets_at is accepted as either an epoch number or an ISO-8601 timestamp and rendered in your local timezone.
Install
-
Drop
statusline.shsomewhere, e.g.~/.claude/statusline.sh:curl -o ~/.claude/statusline.sh https://git.grandiras.net/Grandiras/claude-statusline/raw/branch/main/statusline.sh chmod +x ~/.claude/statusline.sh -
Point Claude Code at it in
~/.claude/settings.json:{ "statusLine": { "type": "command", "command": "bash ~/.claude/statusline.sh" } } -
Restart Claude Code (or run
/statuslineto reload).
Requirements
bash,jq, andgit- Claude Code ≥ 2.1.80 (for the on-stdin rate-limit data)
License
MIT