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), unless CLAUDE_CODE_OAUTH_TOKEN is set.
Runs
git rev-parse --abbrev-ref HEAD for the branch name, and on macOS, security find-generic-password to read the token from the Keychain.
Writes
claude-sl-usage-<hash>.json and a matching .lock in your system temp directory, plus .err after a failed fetch.
Calls
https://api.anthropic.com/api/oauth/usage over HTTPS. The result is cached for 5 minutes.
Installs
Its launcher into a folder under ~/.claude/plugins/, and points ~/.claude/settings.json at it after backing that file up to settings.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.

PlatformNeedsStatus
Windows 10 / 11Python 3.10+. No Git Bash needed.Tested
macOSPython 3.10+ and bashTested in CI
LinuxPython 3.10+ and bashTested 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
VariableDefaultDescription
CQB_TOKENS1Show token counts
CQB_RESET1Show reset countdowns
CQB_DURATION1Show session duration
CQB_BRANCH1Show git branch
CQB_CONTEXT_SIZE0Show context size label such as of 1M
CQB_PACE0Show pacing indicator
CQB_COST0Show session cost
CQB_REMAINING1Show remaining % (fuel gauge) for all gauges; set 0 for used %
CQB_BAR1Show visual progress bar next to 5h/7d quotas
CQB_EMAIL0Show the logged-in account email (Anthropic OAuth logins only; blank for API-key logins)
CQB_MAX_WIDTHterminal widthMax 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