tokenscope ⏣

Why is my Claude Code bill so high?

Short answer: most of it usually isn't the model writing code. As an agentic-coding session grows, the entire context is re-sent on every turn — so you pay to re-read the same files, tool output, and history again and again. tokenscope shows you the split.

npx @wartzar-bee/tokenscope
Read-only · local · no network · no telemetry. Source on GitHub.

What's actually on the bill

Every API call in a session is priced in four buckets. Dashboards show you the total; tokenscope shows the attribution — which bucket your money is really going to:

Cache read — re-sent context

The conversation so far, re-sent every turn so the model can "remember" it. On long sessions this is often the single biggest line — and it grows the longer you go.

Cache write — new context

Newly added context (files you open, tool results) written into the prompt cache the first time.

Output — the model writing

The tokens the model actually generates. Often a surprisingly small slice of a big bill.

Fresh input

Uncached prompt tokens. Usually small once caching kicks in.

The fix is usually mundane: trim what stays in context — /compact or a fresh session when the window gets large, and don't keep huge files/tool output resident. tokenscope's insights point at the specific turns and tools doing the damage.

See your own split — in your browser

Nothing is uploaded. This page runs entirely in your browser. Paste the output of --json and the report + shareable card are rendered locally with JavaScript. There is no server, no analytics, and no network request — you can disconnect your machine and it still works.
  1. Run npx @wartzar-bee/tokenscope --json in your terminal
  2. Copy the JSON it prints.
  3. Paste it below and click Render.

Where the money went

Shareable cost report card

A self-contained SVG (numbers only — no paths, no content). Renders inline on GitHub. Download it or copy the markdown to share.

Guides

Plain-English explainers on what Claude Code actually costs and how to spend less — the mechanics are accurate and the advice is concrete.

FAQ

Is this affiliated with Anthropic? No. tokenscope is an independent, open-source tool.

Are the prices exact? They're documented defaults (incl. Anthropic's cache multipliers: write 1.25×/2×, read 0.1× of input). Token counts are read straight from your local logs; you can override prices in .tokenscope.json. Unknown models are flagged, never silently counted as $0.

Does the website see my data? No. The CLI reads ~/.claude/projects/**/*.jsonl locally; this page only parses text you paste, in your browser. The shareable summary is aggregate numbers only — no file paths and no prompt/response content.