Guide · as of October 2026
Your Claude Code token usage, explained
Where Claude Code writes its token counts, what each number means, how to add them up yourself and how the plan limits work. Plain facts, checked against the official docs.
Where it’s logged
Claude Code writes one JSON line per event, in one file per session:
~/.claude/projects/<project folder>/<session>.jsonlEach answer of the model is a line with "type": "assistant" and a message.usage object. Here is one, anonymized:
{
"type": "assistant",
"timestamp": "2026-10-05T10:00:00.000Z",
"message": {
"id": "msg_1",
"model": "m",
"content": [{ "type": "text", "text": "…" }],
"usage": {
"input_tokens": 2,
"cache_creation_input_tokens": 1200,
"cache_read_input_tokens": 38790,
"output_tokens": 857
}
}
}
the token counts
Claude Code deletes session data older than cleanupPeriodDays when it starts: 30 days by default. So your local history only goes back that far.
What the four numbers mean
They count different things. The value under each name is the one from the line above.
- input_tokens
- 2New input that wasn’t served from the prompt cache.
- cache_creation_input_tokens
- 1200Input written to the prompt cache.
- cache_read_input_tokens
- 38790Input read back from the cache, billed at a lower rate. Claude Code re-sends the conversation with each request, so this one grows fast in long sessions.
- output_tokens
- 857What the model wrote. Thinking tokens are billed as output tokens too.
Count it yourself
This prints your output tokens per day, from every session still on this machine. You need jq installed.
find ~/.claude/projects -name '*.jsonl' -exec cat {} + \
| jq -r 'select(.type=="assistant" and (.message.usage.output_tokens // 0) > 0)
| [.message.id, .timestamp[0:10], .message.usage.output_tokens] | @tsv' \
| sort -t$'\t' -k1,1 -k3,3nr \
| awk -F'\t' '!seen[$1]++ {t[$2]+=$3} END {for (d in t) print d, t[d]}' \
| sortStep by step
find … -exec catReads every session file as one stream.jqKeeps the answer lines that have output tokens and prints three columns: message id, day, output tokens.sort -k1,1 -k3,3nrGroups the lines by message id, highest count first.awkKeeps each message id once (its highest count) and adds it to its day.sortSorts the days.
The duplicate-line trap
The same answer (same message.id) is often written on 2 to 5 lines, and its output_tokens can differ between them: a provisional count, then the final one. Summing every line overcounts. Keeping the first line undercounts by about 1%. Count each message id once, with its highest value: that’s what the sort and awk steps do.
Measured on real logs while building Gustave.
What Claude Code shows you
/usage
A Session block with token usage by model and an estimated cost, computed locally at list price. That cost is meant for API users: on Pro or Max, it isn’t what you pay. On Pro, Max, Team and Enterprise plans, it also shows plan usage bars and what counts against your limits (skills, subagents, plugins, MCP servers, long context, cache misses). Press d or w to switch between the last 24 hours and 7 days.
The figures are approximate and come from the history on this machine: usage from other devices or claude.ai isn’t included.
The count beside the spinner
↓ 5.5k tokensA live, approximate count of the output of the current turn only. Not a session total.
/insights
Writes an HTML report on how you work, to ~/.claude/usage-data/report.html.
/status
The Help Center suggests it to monitor your remaining allocation.
Usage limits on Pro, Max, Team and Enterprise
How the limits work
Pro and Max include a five-hour session limit and a weekly limit. Max also has a separate weekly limit for some models.
These limits are shared between Claude (claude.ai) and Claude Code, IDE use included.
On Team and Enterprise, each seat has an allowance that resets on a rolling five-hour window and a weekly window.
When you reach one, Claude Code says “You’ve hit your session limit” or “You’ve hit your weekly limit” and shows when it resets. If usage credits are turned on (/usage-credits), you can keep going past the limit.
Anthropic doesn’t publish token amounts for these limits, so be wary of any exact figure.
Why usage climbs in long sessions
- The whole conversation is sent with every request.
- After a break longer than the cache lifetime (one hour on a subscription), the first message re-processes the whole context.
- Subagents and agent teammates send their own requests.
- /compact is itself a large request, while /clear costs nothing.
For scale: across enterprise deployments, Anthropic puts the average cost around $13 per developer per active day, and below $30 for 90% of users.
Source: the Claude Code docs and the Claude Help Center, as of October 2026.
Quick answers
Where are Claude Code logs stored?
In ~/.claude/projects: one folder per project, one .jsonl file per session. Claude Code deletes them after 30 days by default (cleanupPeriodDays).
How many tokens does Claude Code use a day?
It depends on how you work: long sessions, subagents and long breaks all add up. Run /usage and press d for the last 24 hours on this machine, or use the command above for output tokens per day. For scale, Anthropic puts the enterprise average around $13 per developer per active day.
Does /usage include claude.ai?
No. Its figures come from the history on this machine, so usage on claude.ai or on other devices isn’t included, even though your plan limits are shared with them.
Can I see how close I am to the five-hour limit?
On Pro, Max, Team and Enterprise, /usage shows plan usage bars, and the Help Center suggests /status to monitor your remaining allocation. Anthropic doesn’t publish the limits in tokens.
Sources, as of October 2026
- Claude Code docs: Manage costs effectively
- Claude Help Center: Use Claude Code with your Pro or Max plan
Gustave is an independent project, not affiliated with Anthropic, OpenAI or any other AI provider. Claude Code and Codex are named only to state compatibility.
And Gustave?
Gustave is a free Mac menu bar app that reads the output tokens in these logs (and in Codex’s) and turns them into gems for a tiny pixel character. Numbers only, never your prompts or your code.
It doesn’t track your limits, your cost or the five-hour window: for those, use /usage.