Argoness Vane, VP of Engineering, Veristrux Inc.

If your Claude Code usage has felt heavier since late November, you are not alone. Several open reports describe 5-hour windows filling 2–6x faster for similar work. Some of that is server-side and out of your hands. Some of it is client-side, and you can measure that part yourself in about ten seconds.

Claude Code already keeps a full JSONL transcript of every session in ~/.claude/projects. Each assistant turn records its own token usage (input_tokens, cache_creation_input_tokens, cache_read_input_tokens, output_tokens), and each tool call records what came back. So the data needed to answer "where did my context go?" is already on your disk.

We added an xray subcommand to our MIT-licensed iron-veil-core CLI to read it. It is pure Python stdlib, makes zero network calls, and never prints file contents, shell commands, or full paths.

Run it

pip install git+https://github.com/argoness-prime/iron-veil.git iron-veil-core xray # last 7 days iron-veil-core xray --days 30 --json --no-upsell 

What it measures

1. Unwindowed file reads

A Read with no limit on a 1,300-line file puts all 1,300 lines into context, and that prefix is re-read from cache on every later turn of the session. xray counts reads over 350 lines that had no limit and estimates the share that a 350-line window would have avoided.

Fix: ask for symbols or line ranges first, then read offset/limit windows. A PreToolUse hook can enforce this automatically.

2. Prompt-cache idle cliffs

Prompt caching makes a long session cheap only while the cached prefix stays warm. Step away for a coffee, or let a long test suite run, and the next call can re-write the whole prefix at the cache-write rate instead of reading it at the much cheaper cache-read rate.

xray flags every gap longer than 5 minutes between consecutive API calls in a transcript where the next call wrote more tokens to the cache than it read. That condition separates real cliffs from harmless pauses.

Fixes: /compact or start a fresh session before long breaks; don't switch models mid-session (the model is part of the cache key); run long test suites in the background and poll the results.

3. Top tool-output bloat offenders

These are the five largest tool results that went into context. They are usually one giant file read, a verbose test log, or an MCP tool that returns an entire JSON document.

4. Illustrative waste

This gives a dollar figure at configurable list-price assumptions (--input-usd-per-mtok, --cache-write-usd-per-mtok, --cache-read-usd-per-mtok). On a subscription plan you are not billed per token, so read it as a relative signal of how much of your window goes to avoidable work.

What we found on our own workload

Over a 7-day window of our own internal sessions (351 transcripts, about 5.5K API calls, scanned in about 3 seconds):

  • Unwindowed reads were small: 7 of 3,387 reads, about 36K avoidable tokens. Our read guard was already doing its job.
  • Idle cliffs were the real cost: 50 cliffs out of 167 idle gaps re-wrote about 6.9M cache tokens.

That was not the result we expected, and it changed our habits more than any read optimization did.

Your mix will differ. Run it and see which one dominates for you.

Honest limits

  • Client-side only: xray is not a billing cap, and it cannot see server-side usage accounting changes.
  • Approximations: token estimates for tool output use about 4 characters per token.
  • Format changes: the transcript format is internal to Claude Code and may change. The parser skips unknown records instead of failing.

If you want this enforced instead of just measured

Token Czar v2 AST Windowing

The free Token Czar Lite desktop app (local context-hygiene guard — not a provider spend cap) auto-windows large reads locally: https://veristrux.com/

The $5 Iron Veil + Token Miser Pro Kit is the full <5 ms PreToolUse hook source: an AST read-window guard, a secret airgap, and exfil blocking. It is a one-time instant ZIP: https://argoness-prime.itch.io/iron-veil-token-miser-pro

The xray source and tests are in the MIT repo: https://github.com/argoness-prime/iron-veil