Token mix
Uncached input, cache reads, cache writes by cache tier, output, and reasoning tokens for each tool.
Free open-source command-line tool
Count Claude Code and Codex usage from the session logs on your machine, then price it by model, project, session, and token type.
05 / Run the audit
Agent logs are easy to miscount. Claude Code repeats usage on every streamed line, and Codex reports cached input inside input. The tool handles both and checks its totals before it prices anything.
What the report shows
The report separates new input from the context an agent resends on each call, because that resent context drives most of an agent's cost.
Uncached input, cache reads, cache writes by cache tier, output, and reasoning tokens for each tool.
API-equivalent cost by token type, model, project, and session, with the most expensive sessions listed.
The share spent by subagents, attempts replaced by a model fallback, and usage the rates file could not price.
Across 91,086 logged calls, cache reads and writes were 82% of API-equivalent cost and 10% of sessions drove 80% of it. Read the findings.
Costs are API-equivalent at the rates in the bundled file, not what a subscription plan charged or the rates in effect on the day of each call. Codex logs do not report cache writes, so Codex costs exclude them. The tool reads Claude Code and Codex logs only; other agents need their own verified adapter.
Compare current model rates