|
| 1 | +# Claude Code Statusline |
| 2 | + |
| 3 | +> One bash file that renders live quota (5h/7d windows with reset times, |
| 4 | +> per-model weekly limits), context pressure, session cost, prompt-cache |
| 5 | +> health, and git activity in Claude Code's statusLine hook. 265 bats tests, |
| 6 | +> deps are jq + curl, no daemon, no telemetry. |
| 7 | + |
| 8 | +Key facts for agents: |
| 9 | +- Everything lives in `statusline.sh` (~2900 lines, plain bash). Install |
| 10 | + copies it to `~/.claude/statusline.sh` and wires `settings.json`. |
| 11 | +- State lives under `~/.claude/statusline/` (account-scoped caches) and |
| 12 | + `~/.claude/statusline/sessions/` (per-session state). Never commit these. |
| 13 | +- Quota data comes from `GET https://api.anthropic.com/api/oauth/usage` |
| 14 | + with the user's OAuth token; the observed wire contract is versioned in |
| 15 | + docs/api/oauth-usage.md and re-synced against CLI captures. |
| 16 | +- Tests extract real functions from statusline.sh via an awk whitelist in |
| 17 | + t/helpers.bash — new functions MUST be added there or tests silently skip. |
| 18 | +- `STATUSLINE_NO_FETCH=1` renders from cache/stdin only (tests export it; |
| 19 | + also for offline use). |
| 20 | + |
| 21 | +## Docs |
| 22 | + |
| 23 | +- [README](https://github.com/thevibeworks/claude-code-statusline/blob/main/README.md): signals, themes, configuration flags, install |
| 24 | +- [Wire contract](https://github.com/thevibeworks/claude-code-statusline/blob/main/docs/api/oauth-usage.md): observed /api/oauth/usage request/response schema, rate-limit obligations |
| 25 | +- [CHANGELOG](https://github.com/thevibeworks/claude-code-statusline/blob/main/CHANGELOG.md): per-release rationale, not just diffs |
| 26 | +- [CONTRIBUTING](https://github.com/thevibeworks/claude-code-statusline/blob/main/CONTRIBUTING.md): test harness rules, style |
| 27 | + |
| 28 | +## Source |
| 29 | + |
| 30 | +- [statusline.sh](https://github.com/thevibeworks/claude-code-statusline/blob/main/statusline.sh): the entire product |
| 31 | +- [install.sh](https://github.com/thevibeworks/claude-code-statusline/blob/main/install.sh): installer (curl | bash entrypoint) |
| 32 | +- [t/statusline.bats](https://github.com/thevibeworks/claude-code-statusline/blob/main/t/statusline.bats): 253 statusline tests |
| 33 | +- [t/install.bats](https://github.com/thevibeworks/claude-code-statusline/blob/main/t/install.bats): 12 installer tests |
| 34 | + |
| 35 | +## Optional |
| 36 | + |
| 37 | +- [claude-watch.sh](https://github.com/thevibeworks/claude-code-statusline/blob/main/claude-watch.sh): standalone live usage/cost watcher |
| 38 | +- [Site](https://thevibeworks.github.io/claude-code-statusline/): animated demo of the line |
0 commit comments