Why a 50-turn agent pays for the same screenshot 35 times unless it caches the pixels
Every API call resends the whole conversation from scratch. Here's why a repeated screenshot costs full price again, and how caching fixes that math.
It sounds like a bandwidth problem: sending the same image over the wire again and again. It isn't. It's a token problem, and the math behind it is easy to underestimate until you actually run the numbers on a long agent task.
The stakes: five pictures, fifty screenshots
A 50-turn form-filling agent might only ever encounter five unique desktop states, the same handful of screens revisited over and over as it works through a task. Naive math on that task looks brutal: 50 screenshots at roughly 2,000 tokens each comes out to 100,000 image tokens, for a task that only contains five actual pictures.
Why "the model already saw it" doesn't make it free
The natural assumption is that once the model has seen a screenshot, showing it again should be nearly free, since it's already sitting in the conversation. That assumption is wrong, because an API call carries no memory between requests. Every single turn resends the entire conversation so far, images included, and the model reprocesses all of it from scratch every time, whether or not it's seen that exact picture before.
The fix: hash it, then mark it cached
The fix is to hash each screenshot and mark it cached the first time it's sent, using the API's ephemeral cache setting. The next turn that sends an identical hash hits the cache instead of paying to reprocess the image again. Applied to the 50-turn task, only the five actual unique states ever get tokenized in full, 2,000 tokens each for 10,000 total, while the other 45 turns become cache hits. That's 10,000 tokens instead of 100,000, a tenfold difference from one change in how repeated images get handled.
Where the savings stop working
Caching only helps when a screen repeats byte-for-byte, an idle dialogue box, an unchanged form. A cursor that moved, or a text field mid-type, produces a different image and therefore a different hash, so it gets billed at full price again. The same limit applies to a task that's genuinely novel every single turn: a real navigation to a new page is a new state, tokenized like anything else. Caching can't invent savings where the screen has actually changed; it only pays off for the states that repeat exactly.
Key takeaways
- An API call has no memory between requests, so every turn resends the full conversation, images included, and reprocesses it from scratch.
- Naive per-turn image processing on a 50-turn, 5-state task costs roughly 100,000 image tokens.
- Hashing each screenshot and marking it cached on first send turns repeat views of the same state into cache hits, cutting that same task to roughly 10,000 tokens.
- Caching only pays off when a screen repeats byte-for-byte; any visible change, including a moved cursor, produces a new hash and full-price reprocessing.
Try it yourself
Paste this into Claude: "I'm building a 50-turn computer-use agent that revisits the same 5 desktop states repeatedly. Show me exactly where to place cache_control on the screenshot messages so each unique state is only billed once, and write the code that detects a repeated state and routes to the cached version instead of sending the raw image again." This video is part of Claude Basics from Humanitarians AI, narrated by Liam, in for Bear, answering the kind of practical question a general audience actually asks about building with Claude.
Chapters
- 0:00The question
- 0:11The stakes — a 50-turn task, 5 unique states
- 0:25The wrong guess — "the model already saw it, so it's free"
- 0:34Why it breaks — no memory between API calls
- 0:46The fix — hash it, mark it cached
- 0:58The payoff — 10,000 tokens instead of 100,000
- 1:13Both directions — only when the screen repeats exactly
- 1:25Both directions — not when the screen actually changes
- 1:37Carry-out
- 1:47Your turn
- 2:07Outro
Full transcript(auto-generated, with timestamps)
The question
[0:00]You might think this is a bandwidth problem, sending the same image over the wire again. It isn't, it's tokens. Why does a 50-turn agent pay to reprocess the same screenshot over and over? A 50-turn form-filling task only ever
The stakes — a 50-turn task, 5 unique states
[0:12]Shows five unique desktop states. Naive math, 50 screenshots at 2,000 tokens each is 100,000 image tokens for a task with five actual pictures.
The wrong guess — "the model already saw it, so it's free"
[0:25]The natural assumption is that the model already saw a screenshot once, so showing it again should be nearly free. It's already in the conversation. But an API call has no memory between
Why it breaks — no memory between API calls
[0:35]Requests. Every turn resends the entire conversation so far, images included, and the model reprocesses all of it from scratch every single time. The fix, hash the screenshot and mark it
The fix — hash it, mark it cached
[0:47]As cached the first time it's sent using the API's ephemeral cache setting. The next turn that sends the identical hash hits the cache instead of paying to reprocess it. Back to the 50-turn task,
The payoff — 10,000 tokens instead of 100,000
[0:59]Only five states ever get tokenized in full, 2,000 tokens each, 10,000 total. The other 45 turns are cache hits. 10,000 instead of 100,000.
Both directions — only when the screen repeats exactly
[1:13]This helps exactly when a screen repeats byte for byte, an idle dialogue, an unchanged form. A cursor that moved or a field mid-type is a different image and a different hash, full price again. And it doesn't help a task that's
Both directions — not when the screen actually changes
[1:25]Genuinely novel every turn. A real navigation to a new page is a new state, tokenized like anything else. Caching can't invent savings where the screen actually changed. An unchanged
Carry-out
[1:37]Screenshot isn't free just because the model already saw it. Every turn resends everything from scratch. Marking it cached is what makes a repeat actually free. Your turn, here's the prompt, read
Your turn
[1:48]It with me. I'm building a 50-turn computer use agent that revisits the same five desktop states repeatedly. Show me exactly where to place cache control on the screenshot messages, so each unique state is only billed once and write the code that detects a repeated state and routes to the cached version instead of sending the raw image again. Why a 50-turn agent pays for the same
Outro
[2:08]Screenshot 35 times unless it caches the pixels. This is Claude Basics from Humanitarian's AI. Find more at Humanitarian's AI Latam Inforbear.
More from HAI
1:53Why Claude's Click Lands in the Wrong Spot — and the One Ratio That Fixes It
4:20Three You Can Take Back. One You Can't.
3:00Mycroft Thesis Guard: Fighting Thesis Drift in Investment Research
2:04Why splitting a chunk from its document makes it retrieve for the wrong question
2:18Mycroft's GitHub MCP Assistant Part 2: The Manual Client & Debugging Harness
2:23