How to check Claude Code token usage: 4 ways to see what your agents spend
Four ways to check Claude Code token usage: the /cost command, the session transcripts, the ccusage CLI, and a live per-session meter. See exactly what each agent spends.
If you run Claude Code for more than a few minutes a day, tokens are your real currency. They decide when you hit a rate limit, how fast you burn through a subscription, and whether a long agent run was worth it. The problem is that Claude Code does not shout the number at you. You have to go and look.
Here are four ways to check Claude Code token usage, from the quickest built-in command to a live meter that shows every agent in real time. Pick the one that fits how deep you need to go.
1. The fastest way: /usage, /context and the status line
Inside any Claude Code session, type:
/usage
Claude Code prints the token usage of the current session and, on a Claude.ai plan, what is left of your quota: the 5-hour and 7-day rate limits, plus how much of the context window you are using. /cost and /stats still work, they are aliases of the same command. You can run it while Claude is answering and the numbers show up without interrupting the response (before v2.1.234 the command waited for the end of the turn).
Want the context window in detail rather than a single percentage? Type /context: it draws the window as a colored grid and flags what is eating it, a tool with a heavy output, a bloated memory file, a session close to capacity.
Both commands share one catch: you have to type them, and they only see the session you are in. Nothing tells you what you spent yesterday or what another project cost. If you want a number that stays on screen, use the status line. Ask Claude Code to write it for you:
/statusline show model name and context percentage with a progress bar
It generates a script in ~/.claude/ and wires it into your settings. If you would rather write it yourself, add a statusLine entry to ~/.claude/settings.json. The script receives a JSON object on stdin with context_window.used_percentage, cost.total_cost_usd and, for Pro and Max subscribers, rate_limits.five_hour.used_percentage. A one-liner is enough:
{
"statusLine": {
"type": "command",
"command": "jq -r '\"[\\(.model.display_name)] \\(.context_window.used_percentage // 0)% context\"'"
}
}
The status line refreshes after every API response, so the percentage moves while the session runs. It is still one session per terminal: for anything historical, or across several agents, keep reading.
2. Read the source: the session transcripts
Claude Code writes every session to disk as a JSONL transcript. On macOS and Linux you will find them here:
~/.claude/projects/<encoded-project-path>/<session-id>.jsonl
Each line is one message, and the assistant messages carry a usage object with the exact counts: input_tokens, output_tokens, and the cache fields (cache_creation_input_tokens, cache_read_input_tokens). Cache reads are the interesting part: they are much cheaper than fresh input, so a session with a high cache hit rate costs far less than the raw token count suggests.
This is the ground truth. Every other tool, including the two below, reads these same files. If you want to script your own report, jq over the JSONL will get you there.
3. A dedicated CLI: ccusage
If you would rather not write your own parser, the community ccusage tool reads those transcripts and rolls them up into daily, monthly, and per-session totals:
npx ccusage@latest
It is a good middle ground: more history than /usage, less work than hand-rolling jq. It stays in the terminal, though, so it answers "what did I spend" but not "which agent, right now, is spending it".
4. A live meter: per-session usage in AgentsRoom
The three methods above all share one blind spot: they are after-the-fact and single-stream. The moment you run several agents in parallel, you want to see usage per agent, live, without typing a command in each terminal.
That is what the Claude Code token usage meter in AgentsRoom does. It reads the same JSONL transcripts, per session, and surfaces:
- input, output and cache tokens per agent, updating as the session runs
- the cache hit rate, so you can see when context is being reused instead of re-sent
- a warning before a session drifts toward a rate limit
Because it attributes usage by session, it stays correct even when you run multiple Claude Code accounts side by side: each account keeps its own totals, which makes per-client rebilling straightforward.
Which one should you use
- Just need this session's number, or how much of your quota is left?
/usage, and the status line if you want it always visible. - Want to script a custom report? Read the JSONL transcripts directly.
- Want daily and monthly totals in the terminal?
ccusage. - Running several agents and want to watch usage live, per agent and per account? Use the meter in AgentsRoom.
Checking usage is step one. If the numbers make you wince, the next move is bringing them down: see how to reduce Claude Code token costs for the levers that actually matter, starting with cache reuse.
Frequently asked questions
How do I check Claude Code token usage?
Four ways, from quickest to deepest. Type /usage inside a session for the current session's counts and, on a Claude.ai plan, what is left of your 5-hour and 7-day windows. Add a status line if you want a percentage permanently on screen. Read the JSONL transcripts in ~/.claude/projects/ for the exact per-message counts, which is the ground truth every tool reads. Or run npx ccusage@latest for daily, monthly and per-session totals in the terminal. Which one fits depends on whether you need this session, a history, or several agents at once.
How do I see Claude token usage without typing a command every time?
Use the status line. Run /statusline and describe what you want, for example the model name and the context percentage with a progress bar, and Claude Code writes the script and wires it into your settings. You can also add a statusLine entry to ~/.claude/settings.json yourself: the script receives a JSON object on stdin carrying context_window.used_percentage, cost.total_cost_usd and, for Pro and Max subscribers, rate_limits.five_hour.used_percentage. It refreshes after every API response, so the number moves while the session runs.
Does /cost still work, or has it been replaced by /usage?
It still works. /cost and /stats are aliases of /usage, so all three print the same thing. /usage is the name to remember because it is the one the documentation uses. Since v2.1.234 you can also run it while Claude is answering and the numbers appear without interrupting the response; before that version the command waited for the end of the turn.
Where does Claude Code store its token counts?
In the session transcripts on disk. On macOS and Linux they live in ~/.claude/projects/<encoded-project-path>/<session-id>.jsonl, one JSON object per line. Assistant messages carry a usage object with input_tokens, output_tokens, cache_creation_input_tokens and cache_read_input_tokens. This is the ground truth: /usage, ccusage and every third-party meter read these same files, so jq over the JSONL is enough to script your own report.
How do I check how many tokens I have left rather than how many I used?
There is no token balance to look up. A Claude subscription is not sold as a token budget: it is metered as a share of a rolling session window plus a weekly window, so what you can read is a percentage of those windows and the time they reset. /usage shows that percentage inside Claude Code, and Settings then Usage shows it on claude.ai. The quota side of the question, what the windows meter and when they come back, is covered separately in how many tokens you have left in Claude.
How do I see token usage for several agents or several accounts at once?
The three built-in methods are single-stream: they answer for the session you are in. To watch several agents at the same time you need usage attributed per session, which is what the token usage meter in AgentsRoom does. It reads the same JSONL transcripts and shows input, output and cache tokens per agent as the session runs, plus the cache hit rate. Because the attribution is per session, the totals stay separate when you run several Claude accounts side by side.
Download AgentsRoom
Run all your AI agents, on all your projects, from a single window.
Companion app: monitor your agents on the go
Bring your own: Claude, Codex, Antigravity CLI, or other AI provider.
Push bugs and requests straight to your public backlog.
Agents you read like a conversation
Each agent has a role, a face, and a thread you read like a messaging app.

Keep reading
How Many Tokens Do I Have Left in Claude? The Two Screens to Check.
Your Claude plan is not denominated in tokens, so no screen shows a token balance. What it actually meters, the two screens that do show it, why it drains while you are not typing, and what the September 2026 weekly-window change does to your week.
Read the articleReduce MCP Token Usage: How We Cut Our Tool Definitions by 60%
Every MCP tool your agent can call is a block of JSON the model may read on every request. Ours weighed about 95,000 tokens. Here is how to measure yours in two minutes, what we cut without removing a single tool, and the budget check that stops it from growing back.
Read the articleHow to Cut Your Claude Code Token Costs Without Slowing Down
Claude Code bills you per token, and most of the spend is invisible: bloated context, the wrong model, raw PDFs, agents re-reading the same files. Here is where the money actually goes and how to cut it, with the habits and tools that keep your bill low without slowing you down.
Read the article