@wielgi/claude-statusline
v0.1.1
Published
Rich statusline for Claude Code with context/5h/weekly rate limits, burn-rate projections, git info, and effort-level badge.
Maintainers
Readme
@wielgi/claude-statusline
Rich two-line statusline for Claude Code with:
- 🤖 model + effort-level badge (including
/effort maxsession override) - 🧠 context window usage
- ⏰ 5-hour rate limit bar with burn-rate projection
- 📅 weekly rate limit bar with burn-rate projection
- 🌳 worktree / 🌿 git branch with
+N -Mdiff stats
Reads official rate_limits and context_window data from Claude Code's input JSON when available — no manual token-budget calibration needed.
Install
pnpm add -g @wielgi/claude-statusline
claude-statusline initThen open a new Claude Code session (or run /reload).
init writes this into ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "claude-statusline"
}
}Uninstall
claude-statusline uninstall
pnpm remove -g @wielgi/claude-statuslineOutput
🤖 Opus 4.7 (high) | 🧠 18% | ⏰ 5h █████░░░░░░░ 38% resets 1h06m | 📅 wk █░░░░░░░░░░░ 5% resets 6d20h
🌳 my-repo | 🌿 feat/new-thing +42 -7Colors
- Context (🧠): green <50%, yellow 50-80%, red ≥80%
- 5h / weekly: green by default. Turns yellow / red only when the burn-rate projection shows tokens will run out before the reset:
- yellow = exhaust 30–60min early (5h) / 8–24h early (weekly)
- red = exhaust >60min early (5h) / >24h early (weekly)
- Effort badge:
(low)amber,(medium)green,(high)blue,(xhigh)purple,(max)animated rainbow
Configuration (optional env in settings.json → env)
Most users don't need any of these — Claude Code now ships accurate
rate_limits and context_window in the statusline input, so calibration
is automatic. The env vars below only affect the fallback path and the
burn-rate projection.
| Variable | Default | Effect |
|----------|---------|--------|
| CLAUDE_WEEKLY_ACTIVE_FACTOR | 0.857 (6/7) | Projection multiplier for weekly burn-rate. Lower = assume less active time. 0.36 ≈ 10h × 6 days of real coding. |
| CLAUDE_5H_BUDGET_TOKENS | 190_000_000 | Fallback 5h budget when rate_limits isn't in the input. |
| CLAUDE_WEEKLY_BUDGET_TOKENS | 1_000_000_000 | Fallback weekly budget. |
| CLAUDE_5H_RESET_OFFSET_MINUTES | 0 | Shift fallback 5h reset time. |
| CLAUDE_WEEKLY_RESET | Fri 07:00 | Fallback weekly reset (local time, Day HH:MM). |
| CLAUDE_CACHE_READ_WEIGHT | 1 | Weight for cache-read tokens in fallback counter (0.1 = Anthropic's billing weight). |
Numeric values accept underscores as thousands separators: "250_000_000".
How the effort badge works
/effort in Claude Code only sets the session — it's not persisted to
settings.json. The statusline scans the current transcript (input.transcript_path)
for the latest Set effort level to X marker written by the /effort command
and falls back to settings.effortLevel if no session override is found.
License
MIT © wielgi
