This site is in beta and I'm collecting feedback: LinkedIn or genaivikas@gmail.com.

learn-genai.inBeta

concept 03 of 12

Why your bill jumps:
the cache.

A normal turn writes about 1K tokens to the cache. Switch models halfway, and the whole session gets written again: about 115K.

You are here: Feel it → next: See it

1Feel it · 1 min

You switch models halfway through a long session. How many tokens get written to the cache on the next message?

2See it · 5 min
Read the transcript instead

"Same chat. Same question. One message wrote about one thousand tokens to the cache. The next wrote one hundred and fifteen thousand. Nothing about the question changed. So what did?" …

Up next · 10 minKeep it: the hand-drawn page and the exact rules
3Keep it · 10 min

The book page: what the cache keeps, and the 5 things that break it.

  • A cached read costs 0.1×. Writing to the cache costs 1.25×.
  • The order is fixed: tools → system prompt → messages. Change anything early and everything after it is written again.
  • The API cache lasts 5 minutes by default. Claude Code behaves like 1 hour.
  • Each model has its own cache. Switching models means writing everything again.
Read the full lesson
A page of the handwritten notes
4Prove it · 10 min

Lab 12: watch the cache work, then break it.

Runs right here in your browser with your own key. Three cells, real numbers from the API, under one cent.

Chart of cache writes per call from my own Claude Code logs; breaks spike to about 115K
My own Claude Code logs: each spike is a cache break.
[1]Your key

Stays in this tab only: it is never saved or sent to us, only to api.anthropic.com. The model is Claude Haiku 5.5, the cheapest, and the whole lab costs well under one cent.

[2]Send the same briefing pack twice
system = briefing_pack      # ~1,500 tokens: an AGENTS.md and team rules
cache_control = "ephemeral" # mark it cacheable
ask("What's the test command?")   # call 1
ask("What's the test command?")   # call 2

Guess first: on call 2, how many tokens are read from the cache?

[3]Now break it

Change one thing, then send the same question again:

[4]Your own logs (free, no key)

Find the cache breaks in your own Claude Code history. It reads only the usage numbers, never your prompts.

Coming soon as a one-line command. My own run found 23,608 calls and 125 cache breaks.

5Use it · at work

Try this tomorrow

Myth vs fact

"Switching to a bigger model halfway is free."

✅ It writes the whole session to a new cache.

More myths and tips are coming.
Next concept · coming soon04 · Lost in the middle: why your first instruction sinks