Compact single-line status line for Claude Code: model, git, context %, and 5h/7d usage pacing
Find a file
Grandiras 7adc2b763c Modernize statusline: drop API fallback & rate pacing, add reset timestamps
- 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>
2026-06-07 05:13:27 +02:00
LICENSE Add Claude Code statusline script, README, and license 2026-06-07 05:02:49 +02:00
README.md Modernize statusline: drop API fallback & rate pacing, add reset timestamps 2026-06-07 05:13:27 +02:00
statusline.sh Modernize statusline: drop API fallback & rate pacing, add reset timestamps 2026-06-07 05:13:27 +02:00

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 / -deleted line 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

  1. Drop statusline.sh somewhere, 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
    
  2. Point Claude Code at it in ~/.claude/settings.json:

    {
      "statusLine": {
        "type": "command",
        "command": "bash ~/.claude/statusline.sh"
      }
    }
    
  3. Restart Claude Code (or run /statusline to reload).

Requirements

  • bash, jq, and git
  • Claude Code ≥ 2.1.80 (for the on-stdin rate-limit data)

License

MIT