1. Copy the scripts
cp fetch-usage.sh ~/.claude/fetch-usage.sh
cp statusline-command.sh ~/.claude/statusline-command.sh
chmod +x ~/.claude/fetch-usage.sh ~/.claude/statusline-command.sh2. Merge settings.json into ~/.claude/settings.json
Add the statusLine and hooks blocks from settings.json into your existing ~/.claude/settings.json. If you don't have one yet, copy it directly:
cp settings.json ~/.claude/settings.json3. Trigger an initial fetch (optional)
bash ~/.claude/fetch-usage.shThe usage cache will otherwise populate automatically on the next tool call or Claude response.
Everything on a single line:
Opus 4.6 (1M) | my-project • main | 5h: 3h 12m • 7d: 4d 22h | ctx 45% (430k/1000k)
| Segment | Description |
|---|---|
| Model | Active model name (shortened, e.g. "Opus 4.6 (1M)") |
| Folder | Current working directory basename |
| Branch | Git branch (if in a repo) |
| 5h / 7d | Time remaining until rate limit resets |
| ctx | Context window usage (percentage + token counts) |
statusline-command.sh— reads the JSON piped by Claude Code and renders a single-line status bar with model, folder, branch, rate limit reset countdowns, and context window usage.fetch-usage.sh— reads the OAuth token from the macOS keychain, caches it in/tmp/.claude_token_cachefor 15 minutes, hits the/oauth/usageendpoint (3s timeout), and writes results to/tmp/.claude_usage_cache. On failure the stale cache is preserved.settings.json— wires up the statusline command and triggersfetch-usage.shin the background onPreToolUseandStophooks.
jqcurlgit(optional, for branch display)
