Skip to content
JP the catJP the Cat

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, Codex, Grok, and Muse Spark — real cost, honest limits.

Download Meow

Your download is on the way

JP is on her way to your Mac!

Check the Downloads folder for the DMG. Want the occasional, useful update? Leave your email — no spam, unsubscribe anytime.

Email is optional.

Download didn't start? Download it directly.

Prefer Homebrew? Install the same signed, notarized app from JP's public tap.

brew tap 8bittts/jpthecat
brew trust 8bittts/jpthecat
brew install --cask jpthecat
View and verify the tap