Click any words you think contain an error. Click again to unmark.
Three errors: native 4K wastes tokens past the provider ceiling, append-only screenshot history overflows context within tens of steps, and prompt caching is neither automatic nor free.
Think of an agent's context window like a tiny office desk. Every screenshot is a thick photo album you drop on the desk after each step. Taking that photo in 4K does not help, because the office only reads pictures up to a certain size and shrinks the rest. Stacking every album you ever shot quickly buries the desk, even though you planned to take 200 photos. And the claim that the office files duplicate albums for free is wishful thinking: filing has rules, and any change to the older stack tears up the discount. Working agents take normal sized photos, keep only the most recent ones on the desk, and write a short note describing the older ones.
Detailed answer & concept explanation~6 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
7 minutes: walk through screenshot token math, the sliding-window memory pattern, prompt-caching mechanics and pricing, and the instrumentation needed to keep agents inside the budget.
Real products, models, and research that use this idea.
- Anthropic's computer-use reference implementation for Claude Opus 4.7 and Sonnet 4.6 caps active screenshots at a small sliding window and trims older images from the message history
- OpenAI's GPT-5.5 computer-use product documents prompt caching at a 50 percent discount on stable prefixes, not free reuse
- Browserbase, Stagehand, and similar agent frameworks downscale screenshots to roughly 1280 px wide before sending and store evicted frames as compact text observations
- Google's Gemini 3.1 Pro multimodal pricing bills image inputs by tile count, so 4K screenshots are explicitly more expensive than downscaled ones
What an interviewer would ask next. Try answering before peeking at the approach.
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating screenshots as free pixels rather than as the costliest tokens in the loop, then assuming caching reverses that cost without any prefix discipline.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.