See your Claude Code limits before you hit them.
A statusline plugin that shows your 5-hour and 7-day quota, context, tokens and reset countdowns, right in the terminal.
Windows (PowerShell)
irm https://raw.githubusercontent.com/aiedwardyi/claude-usage-monitor/v0.2.2/install.ps1 | iex
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/aiedwardyi/claude-usage-monitor/v0.2.2/install.sh | bash
Then restart Claude Code.
◆ Opus my-project/main 94% ↑24k ↓6k 5h: 92% (4h48m) 7d: 48% (4d6h) 12m0s
◆ Opus my-project/main 94% 5h: 92% 7d: 48%
◆ Opus my-project/main 28% ↑410k ↓96k 5h: 25% (1h18m) 7d: 34% (4d2h) 3h42m
◆ Opus my-project/main 28% 5h: 25% 7d: 34%
◆ Opus my-project/main 8% ↑780k ↓150k 5h: 6% (8m) 7d: 26% (4d1h) 4h52m
◆ Opus my-project/main 8% 5h: 6% 7d: 26%
What it shows
Two lines, updated each time Claude Code refreshes its statusline.
- ◆ Opus
- Active model
- my-project/main
- Project name and git branch
- 75%
- Context window remaining
- ↑50k ↓12k
- Input and output tokens
- 5h: 80% (1h55m)
- 5-hour quota remaining, with reset countdown
- 7d: 34% (2d5h)
- 7-day quota remaining, with reset countdown
- 2m0s
- Session duration
Color
Bars show what is left, like a fuel gauge. The color follows how much you have used.
- 75%Under 70% used
- 20%70 to 89% used
- 5%90% or more used
Set CQB_REMAINING=0 to show used % instead.
Trust and security
No API keys. No telemetry. No dependencies. Runs locally.
- Reads
- Session JSON from Claude Code on stdin, and your OAuth token from
~/.claude/.credentials.json(on macOS, the login Keychain if it is not there), unlessCLAUDE_CODE_OAUTH_TOKENis set. - Runs
git rev-parse --abbrev-ref HEADfor the branch name, and on macOS,security find-generic-passwordto read the token from the Keychain.- Writes
claude-sl-usage-<hash>.jsonand a matching.lockin your system temp directory, plus.errafter a failed fetch.- Calls
https://api.anthropic.com/over HTTPS. The result is cached for 5 minutes.api/ oauth/ usage - Installs
- Its launcher into a folder under
~/.claude/plugins/, and points~/.claude/settings.jsonat it after backing that file up tosettings.json.bak.
It does not install dependencies, collect telemetry, or send any local data besides the usage API call.
Requirements
Claude Code with an active subscription and an OAuth login. With an API-key login, the quota shows no token.
| Platform | Needs | Status |
|---|---|---|
| Windows 10 / 11 | Python 3.10+. No Git Bash needed. | Tested |
| macOS | Python 3.10+ and bash | Tested in CI |
| Linux | Python 3.10+ and bash | Tested in CI |
Any of python3, python or py -3 works. No Python packages needed.
The README covers manual install, uninstall and troubleshooting.
Customize
Every segment can be turned on or off with an environment variable. Set them in your shell profile or in the env block of ~/.claude/settings.json.
Maximal
Adds the pace indicator, context size and session cost.
◆ Opus my-project/main 75% of 1M ↑50k ↓12k 5h: 78% +52% (1h18m) 7d: 66% +24% (2d22h) $0.05 2m0s
{ "env": { "CQB_PACE": "1", "CQB_CONTEXT_SIZE": "1", "CQB_COST": "1" } }
Minimal
Hides token counts, reset countdowns and session duration.
◆ Opus my-project/main 75% 5h: 78% 7d: 66%
{ "env": { "CQB_TOKENS": "0", "CQB_RESET": "0", "CQB_DURATION": "0" } }
All environment variables
| Variable | Default | Description |
|---|---|---|
CQB_TOKENS | 1 | Show token counts |
CQB_RESET | 1 | Show reset countdowns |
CQB_DURATION | 1 | Show session duration |
CQB_BRANCH | 1 | Show git branch |
CQB_CONTEXT_SIZE | 0 | Show context size label such as of 1M |
CQB_PACE | 0 | Show pacing indicator |
CQB_COST | 0 | Show session cost |
CQB_REMAINING | 1 | Show remaining % (fuel gauge) for all gauges; set 0 for used % |
CQB_BAR | 1 | Show visual progress bar next to 5h/7d quotas |
CQB_EMAIL | 0 | Show the logged-in account email (Anthropic OAuth logins only; blank for API-key logins) |
CQB_MAX_WIDTH | terminal width | Max status line width; defaults to your terminal's, or 80 on Claude Code older than v2.1.153. Low-priority segments (tokens, duration) drop when the line overflows |