TL;DR
- Claude Code caches your conversation for an hour on a Claude plan (5 minutes with an API key).
- The first message after a longer break reloads the whole conversation into the cache, at 2x the input price.
- In my last 7 days that was 37% of my usage. One short question cost $7.41.
- Fix: run
/compactbefore you step away. Check yours:uvx tokenops doctor
The problem nobody can see
The two most-commented issues in the Claude Code repo are the same complaint:
| Issue | Title | Comments |
|---|---|---|
| #16157 | Instantly hitting usage limits with Max subscription | 1,502 |
| #38335 | Claude Max plan session limits exhausted abnormally fast | 879 |
More than 3,000 issues in that repo have "limit" in the title. I was one of those people: the usage page told me I was near my limit, but not why.
Some of what's in those threads looks like server-side bugs, and nothing on your machine can explain those. But a lot of it is usage you really did spend, and Claude Code logs every model call, with exact token counts, in ~/.claude/projects/<project>/<session>.jsonl. So I read mine.
One short question: $7.41
This is the most expensive prompt of one evening:
#2 Wed 21:56 project B (prompt hidden)
█████████░░░░░░░░░░░ 44% of that 5-hour window | 24x your typical prompt
CACHE EXPIRED away 4h 45m, past the 1h cache: one call re-wrote your
whole 965k-token conversation to the cache at 2x the input price
1 model call, paid $7.41 -> /compact before leaving ~$0.52 (14x less) | /clear + note ~$0.27
The question itself was short. What made it expensive was what came before it: a long session and 4 hours and 45 minutes away.
Dollar figures are Anthropic API list prices. On a Pro or Max plan you don't pay them, but they are the clearest way to compare one message with another, and they track how much of your limit each message uses.
Why the first message after a break costs so much
Every message you send, Claude Code sends the whole conversation to the model again: the system prompt, the tools, every earlier message and every file it read. In a long session that is hundreds of thousands of tokens. Prompt caching makes this affordable, at these prices (Anthropic docs):
| What happens | Price vs. normal input |
|---|---|
| Read the conversation from the cache (cache warm) | 0.1x (0.05x on Opus 5.5 and Sonnet 5.5) |
| Write it to the 5-minute cache | 1.25x |
| Write it to the 1-hour cache | 2x |
And how long the cache lives in Claude Code (Claude Code docs):
| How you use Claude Code | Main conversation cache |
|---|---|
| Claude subscription, within your plan's usage | 1 hour |
| API key, cloud provider, or usage credits | 5 minutes |
While you keep working, every message reads the conversation from the cache cheaply. Step away for longer than the cache lifetime and the cache is gone: your next message writes the whole conversation to the cache again, at the write price.
On Opus 5.5 that is 2x the input price instead of 0.05x, or 40 times more for the same tokens. My $7.41 was almost all that one write: 921,577 tokens at the 1-hour write price. With a warm cache, the same message would have cost about $0.22.
Across a week: 37%
One expensive prompt is a story. The week is the pattern:
37% of your Claude usage went to the first message after a break.
41 times the cache had expired, so Claude reloaded the whole conversation.
/compact before you step away would have saved ~31%.
| Where my usage went (last 7 days) | Share |
|---|---|
| Re-reading the conversation on every call | 41% |
| The first message after a break | 37% |
| Claude's output | 11% |
| Caching new context | 10% |
Two things stood out:
- Breaks cost more than Claude's answers. Claude's own output was 11% of my usage. Tools that make Claude reply more briefly are real, but on my work they can save at most that 11%.
- Re-reading is the other big slice. Every call reads the whole conversation again, so a session gets more expensive per message the longer it runs.
What to change
-
Run
/compactbefore you step away. It replaces the conversation with a short summary, so the reload after your break is small. On my week: about 31% of my usage back. -
Or start fresh when you come back.
/clear, then paste a few lines about where you were. Cheaper still, if you don't need the full history. -
Use
/clearbetween unrelated tasks. This keeps the re-reading slice from growing. -
On an API key, use the 1-hour cache. Set
"promptCacheTtl": "1h"in~/.claude/settings.json(docs). With the 5-minute default, even a coffee break reloads the conversation.
See it for your own sessions
I turned this into a small open-source tool. It is read-only, standard-library Python, and sends nothing anywhere:
uvx tokenops doctor
It reads your last 7 days of transcripts and prints:
- the share of your usage that went to the first message after a break, and what compacting would have saved
- your 3 most expensive prompts: when, which project, the prompt (clipped, with key-like strings masked), the cause, and the cost of the cheaper move
- where the rest of your usage went, and what to change first
- one line you can paste, with no prompts, project names or dollars in it
| Option | What it does |
|---|---|
--redact |
Hides your prompts and project names, for screenshots |
--days 30 |
Looks at the last 30 days instead of 7 |
--top 5 |
Shows 5 prompts instead of 3 |
It also works as a Claude Code plugin, with an opt-in warning before the next expensive message after a break:
/plugin marketplace add theagentplane/tokenops
/plugin install tokenops@tokenops
/tokenops:doctor
Three things I got wrong on the way
If you write your own script for this, watch for these.
1. One response is logged on several lines
Claude Code writes one line per content block, and each line repeats the same message id and usage. Summing every line over-counts. Keep the last line per message id: it has the final usage.
2. Forked sessions copy their parent
When you fork or resume a session, the new transcript starts with a copy of the parent's history, with the same message ids. My first version counted those copies again and reported more than twice my real usage. Count each message id once across all files.
3. "One message" is the wrong unit
One prompt you type can lead to dozens or hundreds of model calls: tool calls, file reads, subagents. The tool groups every call under the prompt that started it, so "this prompt cost $X" means the whole chain. In the $7.41 case it really was one call, because the cost came from the context, not from a long loop.
What it can't tell you
- The 5-hour windows are estimated from your first prompt in each. Anthropic's own meter isn't in the logs.
- The cheaper costs are estimates (a fresh context of about 30k tokens, a summary of about 3k) and only re-price the calls a break made expensive.
- Server-side problems don't show up. It explains usage you actually spent.
The tool prints these limits in its own output too.
Try it
uvx tokenops doctor
theagentplane
/
tokenops
Run-aware token governance for multi-agent systems.
TokenOps
Cuts wasted agent spend by up to 65%, governing what the run has already spent before every call.
Toward token governance as a first-class discipline, not an afterthought.
Built by Susheem Koul and Tisha Chawla
See it stop a run mid-budget in the Quickstart below.
Core features · Quickstart · Quickdeploy · How it compares · Policies · Support · Contributing
🙌 Open to contribution
Token spend deserves the same first-class attention as compute or latency, and we are growing the community working on that. Policies, actuators, and the shared ledger are all open to extension. See CONTRIBUTING.md to get started.
✨ Core features
An AI agent's workflow can run up cost fast: dozens of small, individually cheap steps that quietly add up to a surprisingly large bill. TokenOps sets a single budget for the whole workflow and enforces it before every step so spending never gets away…
The report's last line is made for pasting. Drop yours in the comments: I'd like to know whether the first message after a break is the biggest slice for you too, especially on Max plans.
Sources
- Prompt caching prices and cache lifetime: Anthropic docs, Prompt caching
- Which cache lifetime Claude Code uses, and
promptCacheTtl: Claude Code docs, Prompt caching - The limit issues: #16157, #38335 (comment counts as of 2026-12-01)
- My numbers: one run of
uvx tokenops doctoron my own last 7 days (12 sessions, 316 prompts)
Working on TokenOps with @susheem-k.

Top comments (4)
output was 11% for us too, but about 70% of ours was thinking tokens. so a be brief tool only gets at a few percent of the bill
Interesting, my output share was about the same but I never split out thinking. If roughly 70% of your output was thinking, then you're right: "be brief" only shortens the visible answer, which is a small slice of the bill. Lowering the effort level, or using a lower-effort model for routine turns, should save more, because that's what controls how much the model thinks. Did you check which turns used the most thinking? I'd guess it's the planning or debugging turns, not ordinary edits.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.