Free open-source command-line tool

See where your AI agent's tokens go.

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

Count each call once, then price it.

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.

  • Claude Code and Codex session logs
  • Each attempt counted once, model fallbacks included
  • Codex totals reconciled against each session's running total
  • Prices from a dated rates file; unlisted models stay unpriced
View on GitHub MIT licensed · Python 3.9+

What the report shows

Find the context, sessions, and models behind the bill.

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.

01

Token mix

Uncached input, cache reads, cache writes by cache tier, output, and reasoning tokens for each tool.

02

Where the cost sits

API-equivalent cost by token type, model, project, and session, with the most expensive sessions listed.

03

Hidden costs

The share spent by subagents, attempts replaced by a model fallback, and usage the rates file could not price.

Measured example

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.

Limits of a log audit

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