Run /usage inside Claude Code for plan headroom and this session's tokens. For a permanent readout, configure a status line: Claude Code pipes rate_limits.five_hour and rate_limits.seven_day percentages to your script on stdin. For history, run npx ccusage@latest against the JSONL transcripts. For a team, use the Console dashboard or the Claude Code Analytics API.
/usageis the two-second answer, and/costis now an alias for it.- The status line receives live 5-hour and 7-day quota percentages on stdin. This is the best answer.
npx ccusage@latestgives you full history with no install.- The
/usagebreakdown only sees this machine. Two laptops means two partial pictures. - Organisations get per-user aggregates from the Claude Code Analytics API.
The five ways
Ordered by how quickly they answer, and whether you have to ask.
| Method | Answers | Effort | Live quota | History |
|---|---|---|---|---|
/usage | Plan bars plus session tokens | 2 seconds | Yes | Last 24h or 7d |
| Status line script | Whatever you print, always on screen | One config line | Yes | Whatever you script |
| ccusage | Full token and cost history | 30 seconds | No | Yes, complete |
| Console dashboard | Per-member spend for an org | A login | No | Yes |
| Analytics API | Per-user daily aggregates | A script | No | Yes |
Inside the CLI
Run /usage
/usage
On Pro, Max, Team, or Enterprise you get progress bars for the 5-hour and weekly windows, plus a session block with tokens and a dollar figure by model. On an API key you get the session block only, because there are no plan windows to draw.
Toggle the breakdown window
d last 24 hours
w last 7 days
The breakdown attributes recent usage to skills, subagents, plugins, and individual MCP servers, and flags behaviors such as long context or cache misses when one accounts for 10 percent or more. This is the fastest way to find out why a quiet week burned a lot of quota.
Check what is filling the context
/context
Not a usage command, but frequently what people actually want. It visualises what is consuming the context window, which is the thing you can fix immediately with /compact or /clear. Context pressure and quota pressure are different problems with different fixes.
Put quota in your status line
This is the highest-value option and almost nobody uses it. Claude Code runs a shell command to render its status line and pipes a JSON blob of session state to it on stdin. That blob includes your live plan percentages.
{
"rate_limits": {
"five_hour": { "used_percentage": 23.5, "resets_at": 1738425600 },
"seven_day": { "used_percentage": 41.2, "resets_at": 1738857600 }
},
"cost": { "total_cost_usd": 0.01234 },
"model": { "display_name": "Opus" },
"context_window": { "used_percentage": 8 }
}
Write the script
#!/usr/bin/env bash
input=$(cat)
model=$(jq -r '.model.display_name' <<< "$input")
dir=$( jq -r '.workspace.current_dir' <<< "$input" | xargs basename)
h5=$( jq -r '.rate_limits.five_hour.used_percentage // 0' <<< "$input" | cut -d. -f1)
d7=$( jq -r '.rate_limits.seven_day.used_percentage // 0' <<< "$input" | cut -d. -f1)
cost=$( jq -r '.cost.total_cost_usd // 0' <<< "$input")
printf "%s | %s | 5h %s%% | 7d %s%% | $%.2f" \
"$model" "$dir" "$h5" "$d7" "$cost"
Then make it executable with chmod +x ~/.claude/statusline.sh.
Point Claude Code at it
{
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh",
"padding": 2
}
}
Settings reload automatically, but the change appears on your next interaction rather than instantly.
Let Claude write it instead
/statusline show model, 5 hour and weekly limit percentages, and a context bar
The /statusline command takes plain English, generates a script under ~/.claude/, and updates your settings for you.
Full history from the session files
Claude Code writes a JSONL transcript for every session. ccusage reads them and aggregates, and needs no installation:
# daily totals across every detected agent CLI
npx ccusage@latest
# other groupings
npx ccusage@latest weekly
npx ccusage@latest monthly
npx ccusage@latest session
# just Claude Code, grouped by project
npx ccusage@latest claude daily --instances
# the current 5-hour block, with projections
npx ccusage@latest blocks --active
This works retroactively, because the data was already being written before you installed anything. The first time anyone runs it they usually discover weeks of history they did not know they had.
When two answers disagree
You will eventually get two different numbers for the same week and assume one tool is broken. Usually neither is. These are the five reasons, in the order they actually occur.
Why two usage figures for the same period differ.
| Symptom | Cause | Which is right |
|---|---|---|
| One tool is higher on tokens | It is not deduplicating repeated records after resumes and retries | The lower one |
| One tool is missing whole days | Transcripts older than cleanupPeriodDays were swept | Neither; the data is gone |
| The dollar figures differ | One prices at list rates, one at your contracted rate | Your invoice |
| Day boundaries are off by one | One buckets in UTC, one in your local timezone | Whichever matches your reporting |
| A whole machine is missing | Both are reading local files, and you work on two machines | Neither, on its own |
Quota is different. A status line re-runs only on events, such as a new assistant message or a refreshInterval tick, so between turns it is displaying the last values it was handed while a fresh /usage call asks now. A small gap between the two is normal and closes on your next message.
For a team or an organisation
None of the above scales past one machine, because the transcripts are local. Which route you take depends on how your organisation signs in.
Per-user reporting by setup, as documented in August 2026.
| Your setup | Where per-user numbers come from |
|---|---|
| Claude Console (API) | Console dashboard, or the Claude Code Analytics API |
| Claude for Teams | The spend report CSV in org analytics |
| Claude Enterprise | The Enterprise Analytics API, with an analytics key |
| Bedrock, Google Cloud, or Microsoft Foundry | OpenTelemetry export, or an LLM gateway |
curl "https://api.anthropic.com/v1/organizations/usage_report/claude_code?starting_at=2026-08-01&limit=100" \
-H "anthropic-version: 2023-06-01" \
-H "x-api-key: $ADMIN_API_KEY"
One call returns one UTC day of per-user records: sessions, lines added and removed, commits, pull requests, tool acceptance rates, and token and cost figures per model. Data lands with up to an hour of delay, and the endpoint is free.
Questions people ask
/usage, run inside an interactive session. It shows plan progress bars for the 5-hour and weekly windows plus this session's tokens and cost. /cost is an alias for the same screen as of August 2026.
Run npx ccusage@latest, which reads the JSONL transcripts under ~/.claude/projects/ and aggregates them by day, week, month, or session. It works retroactively over data already on disk.
Yes. Configure a status line and read rate_limits.five_hour.used_percentage and rate_limits.seven_day.used_percentage from the JSON Claude Code pipes to your script on stdin. The result renders in your prompt permanently.
Yes. ccusage reads the transcript files from any shell, and a desktop or menu-bar monitor shows live quota with no session open.
Because the breakdown is computed from local session history on that machine, and transcripts are swept after cleanupPeriodDays, 30 days by default. Longer history has to come from a tool that stores its own copy.
Use the Claude Code Analytics API with an organisation Admin key for per-user daily aggregates, the Console dashboard for spend per member, or the OpenTelemetry exporter if you run your own metrics stack.
The status line runs locally and consumes no API tokens. Anthropic notes that some background functionality, including commands such as /usage that check status, generates small requests, typically under $0.04 per session.
Not from Anthropic directly. Continuum mirrors live quota gauges to iPhone and Apple Watch from the machine running your sessions.
Sources
Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.