tokenstat
tokenstat
Tools and sources

Which tools tokenstat reads, and what each one records

György
Reviewed by
György
Updated Jul 30, 2026 4 min

tokenstat reads what your coding tools have already written to disk. That means coverage is decided by them, not by us: a tool that records token counts locally can be read exactly, and a tool that does not cannot be, no matter how much anyone would like it to.

This page is the honest version of that. Every supported tool, where its numbers live, and where the gaps are.

The tools

Tool Where the usage lives Notes
Claude Code ~/.claude/projects/<project>/*.jsonl Per-session transcripts. The primary source, and the most complete
Claude Code (recovered) Claude Code's own rollup A second, coarser source used to recover usage whose transcripts are already gone. See below
Codex ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl Dated rollout files
Grok ~/.grok/logs/unified.jsonl One unified log
Cline ~/.cline/data/sessions/<id>/<id>.messages.json One file per session
OpenCode ~/.local/share/opencode/opencode.db SQLite
Copilot CLI ~/.copilot/session-store.db The assistant_usage_events table. Plain process logs under ~/.copilot/logs/ are ignored, because they are not usage
OpenClaw ~/.openclaw
Zed Zed's own local session data
Antigravity Three separate things, see below
Cursor Nothing on disk, see below

Run tokenstat doctor to see which of these are actually present on your machine, rather than working it out from this table.

Cursor records nothing locally

This is worth stating plainly because it surprises people: Cursor does not write token counts to disk. Every usage counter in its local state reads zero. That was checked rather than assumed.

So covering Cursor cannot be done by reading a file. It means using a credential the app already left on your machine (the macOS keychain today), or one you paste, and asking Cursor's API for aggregate usage:

tokenstat auth cursor

That is a genuinely larger ask than reading a log file, which is why it is a separate, deliberate command rather than something that happens on first run. If you never run it, tokenstat never touches a credential.

Antigravity splits three ways

  • CLI conversations under ~/.gemini/antigravity-cli/ hold real counters in protobuf. tokenstat scan reads them offline like any other source.
  • IDE sessions need the Antigravity app running, so tokenstat fetch can talk to its local language server and cache normalised JSONL for a later scan. Nothing to be done about that: the data is not on disk until the app puts it there.
  • Quota (how much of your plan remains) is status from Cloud Code, and it is kept separate. It is never turned into fake token events to make a chart look complete.

The Claude Code rollup, and why it exists

Claude Code deletes its transcripts after 30 days. Usage never scanned before then is gone from the machine for good.

It also keeps a coarser rollup of its own, which survives longer. tokenstat reads that as a distinct source (claude_code_rollup, shown as "Claude Code (recovered)") so some history can be recovered rather than simply lost. It is deliberately not merged into the main Claude Code numbers, because it is a different measurement with different precision and pretending otherwise would quietly reduce the quality of both.

tokenstat doctor compares your archive against that rollup and tells you how much has already been lost.

Where a number cannot be known

Two rules the tool follows, and both matter more than they look:

An unavailable number is reported as unavailable, never as zero. A zero you cannot distinguish from "no data" is worse than an honest gap, because you will make decisions on it.

Every row carries a confidence. exact, strong, or derived, depending on how solidly the event could be identified across repeated scans. It travels with the row into your reports and into the sync payload, so a number that had to be worked out never gets to look like one that was read. How confident is each number covers what the three levels mean and when the difference shows up.