Track Claude Code token usage and API-equivalent cost
Every Claude Code turn is logged locally with its token counts. That is enough to compute how many tokens you used per model and what the same usage would cost at Anthropic API list prices.
Where Claude Code stores usage
Session logs live in ~/.claude/projects/<project>/<session-id>.jsonl. Each assistant turn includes a usage block:
{ "timestamp": "2026-05-22T07:53:00.000Z",
"model": "claude-opus-4-7",
"usage": {
"input_tokens": 3,
"output_tokens": 412,
"cache_creation_input_tokens": 6316,
"cache_read_input_tokens": 11164
} }
The four counters are priced differently, so a cost estimate needs all of them.
How API-equivalent cost is computed
- Stream every JSONL file and keep entries inside the time window (today, this week).
- Drop synthetic entries (
model == "<synthetic>"). - Sum input, output, cache-read and cache-write tokens per model.
- Multiply each sum by that model's price per million tokens.
On a Pro, Max, Team or Enterprise plan you are not billed per token. The figure shows what the same usage would cost through the API, which is useful for comparing plans and for spotting expensive sessions.
What you get in the menu bar
- Stacked bars for today and this week, split by Opus, Sonnet and Haiku.
- API-equivalent USD next to each model.
- A token count in the menu bar title when no plan data is available.
Privacy
Claude Status reads only the usage blocks and timestamps. It does not read message content, and the logs never leave your Mac. See what leaves your Mac.
Install
$ brew tap bcollard/claude-status
$ brew trust --tap bcollard/claude-status
$ brew install --cask claude-status
Questions
Where does Claude Code store token usage?
In JSONL files under ~/.claude/projects/. Each assistant turn has a usage block with input, output, cache-creation and cache-read token counts.
Is the cost shown what I am billed?
No. On subscription plans it is the API-equivalent cost at list prices. It is a comparison figure, not an invoice.
Does it read my conversations?
No. It extracts timestamps, model names and token counts. Message content is not read.