SuperAPI AI Directory

saver-audit

saver-audit is an offline command-line tool for analyzing Claude Code and Codex session logs, calculating token costs at API list prices (including prompt cache writes and reads), and simulating how much mainstream token-saving tools could reduce spending on the same sessions. It reads existing local logs from ~/.claude/projects and ~/.codex/sessions, and outputs total spend, context composition (tool output, repeated reads of earlier turns, system prompts, user prompts), and the reduction effect of each saving tool, with every figure labeled by how it was obtained. The tool is fully offline and only goes online when the user explicitly requests it (updating prices, installing saving tools, opening an X share). Reports do not print prompts, code, file contents, or tool output; share cards contain only numbers.

Open website

About this tool

saver-audit is an offline CLI audit tool for Claude Code and Codex users, designed to answer three questions: where your tokens are spent, what that is worth at list prices, and how much popular token-saving tools could cut on your real sessions.

Purpose and data sources The tool reads session logs already saved locally by Claude Code (~/.claude/projects) and Codex (~/.codex/sessions), requiring no additional configuration. It prices deduplicated usage at API list prices, including cache writes and cache reads, and distinguishes "API-equivalent cost" from the price actually paid under a subscription plan.

Main capabilities

  1. Spend statistics: outputs deduplicated usage and total cost, and explains which calls were excluded due to missing prices or search fees not being counted.
  2. Context composition: shows the cost share by category such as tool output, repeated reads of earlier turns, system prompts and tool definitions, and user prompts.
  3. Saving tool simulation: for saving tools such as caveman, token-saver, lean-ctx, headroom, and rtk, replays the same sessions and gives the reduction amount, with each figure labeled as exact, indicative estimate, modeled, or upper bound.
  4. Interactive view: the short view shows totals, where the money went, and each saving tool's effect on one screen; press f for the full report, o to open the share card, s to generate an X post and put the card on the clipboard, e to trigger exact replay, and i to install missing saving tools and rerun.
  5. Share card: generates saver-audit.png containing only numbers, model names, and dates.

Usage Run from the command line; the default fast mode allocates a few seconds per saving tool, about 20 seconds the first time on a busy month and about 10 seconds thereafter. Use --short to output the short view, --exact to do exact replay for all output (headroom may take hours), --savers to specify which saving tools to replay, --update-prices to update prices, --install-savers to install saving tools, --show-projects to show project names, and --card to generate the share card. Results are cached to ~/.cache/saver-audit/replay-v1.json (or under $XDG_CACHE_HOME), storing only content hashes and token counts, not text.

Pricing and rePutting details Claude usage is deduplicated by message.id + requestId; Codex's token_count events are deduplicated and replayed history in fork threads is skipped; it matches ccusage token-for-token on the author's logs. Token counting uses o200k_base and is calibrated against local logs per Claude model; prices come from dated snapshots from models.dev, with LiteLLM filling in missing models and >200k token rates. Savings are priced cache-aware: the first send is billed as a cache write, and subsequent calls are billed as cache reads, until the next compaction. Replay cannot reflect whether a savings tool changes agent behavior (extra turns, retries, answer quality), and the report states this explicitly.

Use cases Suitable for developers who want to understand the real token cost breakdown of Claude Code / Codex, evaluate the actual benefits of token savings tools, or need shareable cost data.

Limitations Only supports Claude Code and Codex logs; figures for some savings tools are estimates or upper bounds; exact headroom replay may take hours; Codex web search fees are not included; unknown models are priced at $0; the lean-ctx installation option is not available on Windows; replay cannot prove the impact of savings tools on answer quality or agent behavior.