Guide
The historical ccusage cache-cost bug
A real cache-tier accounting bug, now fixed upstream, still makes a good case study for what a trustworthy cost parser has to guard against.
The historical bug
ccusage issue #899 documented that `calculate` mode once priced every `cache_creation` token at the single 5-minute rate (1.25× input). But Claude Code predominantly writes 1-hour caches, which cost 2× input, so those writes were under-billed by roughly 60%. That upstream bug has since been fixed.
The guardrail
The JSONL carries the split: `usage.cache_creation.ephemeral_5m_input_tokens` and `ephemeral_1h_input_tokens`. Price the 5-minute tokens at 1.25× and the 1-hour tokens at 2× separately. JP the Cat reads that split, preserves provenance, and keeps regression coverage so this class of bug does not recur here.
Common questions
- Does this mean ccusage is still wrong today?
- No. The point of the guide is historical and technical: the upstream bug was real, the fix is known, and JP keeps the same area explicitly guarded with parser provenance and regression tests.
See your real numbers with JP the Cat
A light, local menu-bar meter for Claude Code and Codex — real cost, honest limits.
Download Meow