A subscription hides the meter. The records don't.
usage-cost reads the local session records a coding agent already writes and reports the tokens used plus what that usage would have cost at published API list rates.
usage-cost reads the local session records a coding agent already writes and reports the tokens used plus what that usage would have cost at published API list rates.
A subscription bills the same amount whether a week went into one long refactor or a thousand small lookups. Nothing attaches a price to any individual request, so the shape of the work stays invisible: which models carried it, how much of it was cache, whether a change in habit made the volume go up or down. The tokens are recorded on disk anyway and list rates are published, so the two combine into one number.
That number is an equivalence, not an invoice.
skills/usage-cost/README.md
How much metered work went through a flat-rate plan — computed entirely from files already on the machine, at published list rates, over a stated window.
What anyone was charged. It does not predict a bill and it is not a reconciliation of one.
Only what this machine wrote is visible, so the figure is a floor, not an account total.
Runtime: claude-code Window: all recorded usage Rate table: 2026-08-16 (USD, list rates) Days: America/Los_Angeles
Period Requests Tokens Cost ------------------------------------------------------------------ Today (2026-08-15) 974 228.5M 232.25 Yesterday (2026-08-14) 1,754 333.9M 435.29 This week (from 2026-08-10) 9,060 1.7B 2,503.72
By model, over the full window: Model Requests Tokens Cost -------------------------------------------------------------------------- Claude Fable 5 28,615 6,594,388,669 11,226.52 Claude Opus 4.8 7,348 1,695,400,179 1,707.17 Claude Opus 4.7 8,516 1,515,189,685 1,453.50 Claude Opus 5 2,701 702,639,489 533.76 Claude Sonnet 5 3,260 214,884,210 141.14 Claude Sonnet 4.6 2,202 81,621,428 76.97 Claude Haiku 4.5 14 588,882 0.30 <synthetic> 22 0 not billable -------------------------------------------------------------------------- Total 52,678 10,804,712,542 15,139.36
Excluded as non-billable: <synthetic>. Read 978 transcript file(s); merged 71,653 repeated record(s) into their requests. 4,580 request(s) had copies whose counts differed; the most complete snapshot of each was used.
Example output. The shape is a real run — the model mix, the cache-dominated token profile, the duplicate volume — but every count is perturbed by up to ±10% and the costs recomputed from the perturbed counts. Illustrative, not an actual usage volume.
The transcript format appends one response several times as it streams, and the copies are not identical — an early copy can hold a small fraction of its final output tokens. Dropping duplicates by identity would undercount; keeping them all would multiply the same request. Copies merge to the largest snapshot per request instead.
Schematic. Bar lengths stand for recorded output tokens, not measured values.
Uncached input, output, cache reads, and each cache-write lifetime are priced separately. On a coding agent the token profile is cache-dominated, so collapsing these would be the largest single error available.
A model id resolves by exact match, then by the same id with a trailing -YYYYMMDD removed. No prefix matching, no similarity. A near-miss would produce a confident figure at the wrong rate.
Counted, not costed. They appear in the request column so the volume is visible, and contribute nothing to the total.
The 50% batch rate is deliberately left out. Coding-agent requests are interactive, so applying it would flatter the figure by half for work that could never have been batched.
Only what this machine wrote is visible. Work from another laptop, another checkout, or the web client is not in the records and not in the total — the figure is a floor.
claude-code is supported. codex is registered as an explicitly unavailable adapter: it exits 4 with a stated reason rather than implying the runtime does not exist.
The skill vendors its implementation and uses the standard library only. It reads local files and makes no network calls, so there is no package to add and no version to keep in step.