Claude Code tokens go to four places: the conversation history resent on every turn, tool calls and their results, files and images pasted into context, and the model's own output. Images are the outsized cost in that list — a single full-resolution screenshot costs 2,691 tokens by Anthropic's own formula, and a raw video frame-dumped into context multiplies that by dozens.

Updated August 2026. The clearest way to see where the money actually goes is one real example, worked in full: the same 30-second visual bug review, captured three different ways. Frame-dumped as video at 1 frame per second, it costs about 80,730 tokens, calculated from Anthropic's published image-token formula. Described out loud and paired with a few chosen frames, the same review runs about 3,500 tokens — a roughly 23-times difference for the same 30 seconds of information. Every figure below is labeled measured or calculated, and the formula is shown, not just the result.

What actually consumes tokens in a Claude Code session?

Four things: the full conversation history, which Claude Code resends on every single turn; tool calls and their results, such as file contents and command output; anything you paste or attach, including images; and the model's own response, including any extended thinking. History dominates in long sessions because it never shrinks on its own.

Every request Claude Code sends carries the whole transcript so far — every file it read, every command it ran, every screenshot you pasted, every reply it gave — because the model itself has no memory between calls. Prompt caching makes the repeated portion of that history cheaper to reprocess, but it doesn't remove it from the request; you're still being billed for that context, just at a lower rate on a cache hit. That's why a session left open for hours can burn through a plan limit faster than the amount of typing you actually did that hour would suggest.

Tool calls add up in the same way. A single grep across a large file, a test run with a noisy log, or a directory listing all return text that becomes part of the transcript from that point forward — not just for the turn that requested it, but for every turn after, until the session ends or gets cleared. None of that requires you to do anything unusual; it's what a normal working session looks like.

Tool definitions themselves have a footprint too, separate from what a tool returns once it's used. Every MCP server you have connected adds its available tools to the model's context, and every skill or subagent definition loaded at session start sits in the transcript from the first turn, before you've asked for anything. Output matters as well: the model's own response, including any extended thinking it does before answering, is billed as output, typically at a higher per-token rate than input — so a long, deliberative reply costs more than a short, direct one even before a single tool call happens.

Prompt caching lowers the cost of resending old context — it does not eliminate it. A gap between messages longer than the cache's lifetime forces a full-price reprocess on your next message, which is one reason a session picked back up after lunch can feel more expensive than one worked straight through.

For a line-item look at where a specific two-hour session's tokens actually landed — files read, tool calls, retries, screenshots pasted — see what one Claude Code session actually costs.

How much does an image cost an agent to read?

Claude prices images by patch, not by file size: one visual token per 28×28-pixel block, capped at 4,784 tokens regardless of how large the image gets. A full 1920×1080 screenshot works out to 2,691 tokens — ceil(1920/28) × ceil(1080/28) = 69 × 39. A smaller 1,288×811 screenshot measures 1,334 tokens.

Anthropic assigns one visual token to every 28×28-pixel patch of an image, then caps the total at 4,784 tokens no matter how large or high-resolution the source is (Source: Anthropic, 2026). That formula — tokens = min(4784, ceil(width / 28) × ceil(height / 28)) — is what a number of tools, including the Walkie desktop app, use to estimate cost before anything gets sent. The formula itself, and how patch tiling shaves the raw pixel count down to that final figure, is worked through step by step in how Claude calculates image tokens.

Applied to real sizes, the numbers add up quickly:

What you send Tokens Type
One 1080p screenshot (1920×1080) 2,691 calculated, exact
One real test screenshot (1,288×811) 1,334 measured
Four screenshots to explain one page, no narration 10,764 calculated
A 15-second spoken description, transcribed 65 measured
A typical spoken walkthrough, transcribed ~150 measured, range 100–200

Four screenshots strung together to explain a single page — the empty state, the error state, the hover state, the mobile width — already cost more than four times a single frame, and none of the four says which one actually matters or why. Words are the cheapest input in this table by a wide margin, which is worth remembering before reaching for a screenshot out of habit.

The cap matters practically: past a certain resolution, a bigger, sharper screenshot doesn't cost any more, because the patch count simply maxes out at 4,784 tokens. That makes resolution a legibility question rather than a cost question once you're above the threshold — the terrain the Retina-screenshot breakdown in the cluster below covers in full.

The full worked calculation, run across five real screen sizes step by step, is in how many tokens a screenshot costs an AI agent.

Why does the same task cost more on the second try?

Because nothing about the task repeats cheaply: Claude Code resends the entire session history with every retry, so a second attempt inherits the tokens spent on the first one plus its own. Long gaps between messages also trigger cache misses, meaning the whole context gets reprocessed at full price instead of the discounted cache-read rate.

This compounds hardest around visual work. A fix that doesn't land usually gets another screenshot pasted in to show what's still wrong — and that screenshot doesn't replace the last one in the conversation, it stacks on top of it, along with everything else the session has accumulated since. A bug reported three times, each time with a fresh screenshot, isn't three separate 2,691-token charges; it's three charges plus the growing weight of the conversation each one is now attached to.

That's also why the same task can feel dramatically more expensive for one person than another doing what looks like identical work. The difference usually isn't the fix — it's how many attempts it took to describe the problem clearly enough for the agent to act on, and how much of a stale session was still open when it happened. Twenty small visual reviews spread across a day, each dragging the growing history behind it, add up very differently depending on whether each review costs a few thousand tokens or a few hundred.

The cheapest version of a retry is the one that never has to happen. A bug report specific enough to act on the first time skips the second round of screenshots and the history they get added to entirely — that's a communication problem more than a token problem, but it shows up on the bill either way.

That compounding arithmetic — and what actually changes it — is worked through in why your Claude Max plan runs out faster than you expect.

What does a context window have to do with cost?

A context window is the fixed token budget a model holds in one request — system prompt, files, tool calls, images, and conversation history all draw from the same pool. Every token that budget holds is a token you're billed for that turn; a window filled with frame-dumped video leaves little room for the fix itself.

On a 200k-token context window, a single 30-second visual review frame-dumped at 1 fps eats roughly 40% of that budget before the fix even begins — calculated by dividing the frame-dump's 80,730 tokens by the window size. That figure describes the review alone, not the fix, the file reads, or anything else the session still needs to do afterward. Cost and context aren't two separate problems here; every token that fills the window is also a token on the bill, which is why they're discussed together rather than as unrelated concerns.

This is also why bigger context windows don't fully solve the cost problem, even though they solve the "it got cut off" problem. A larger window means more room before you hit a hard wall, not a lower price per token once you're in it. Filling more of it with the same inefficient inputs just means you can afford to be inefficient for longer before something breaks.

There's a second cost to an overfull window that isn't measured in dollars at all: output quality itself tends to degrade as token count grows, a pattern Anthropic calls context rot. A session bloated with old screenshots and abandoned attempts isn't just more expensive to keep running — it's also more likely to produce a worse answer, because whatever signal you actually need is now diluted across everything else still sitting in the window.

For what a context window actually is, what counts toward it, and what happens to output quality as it fills, see what is a context window, and why does filling it make your agent worse.

Which parts of your workflow are the expensive ones?

Visual review is the most expensive category — showing the agent your screen costs far more per turn than describing a bug in text, and raw video is the worst format for it. A 30-second recording frame-dumped at 1 fps costs about 80,730 tokens; the same review as a narrated bundle costs roughly 3,500 — about 23 times less.

At $10 per million input tokens, that gap is $0.81 for the frame-dumped version against $0.04 for the bundle — a 96% reduction, and one that compounds with every review in a day, not just the one you just ran.

Format Tokens (30-second review) Cost at $10/M input
Frame-dumped video, 1 fps 80,730 $0.81
Narrated bundle ~3,500 $0.04

Retries and multi-step debugging sessions are the second-largest category, for the reason covered above: every retry drags the full history behind it. Reading and editing code is comparatively cheap per turn — it's the visual proof that something works, not the code that makes it work, that tends to blow up a session's token count. For why a coding agent can't just watch the raw recording directly in the first place, see why your coding agent can't watch a screen recording.

None of this spending is optional in the sense of skippable. An agent that can't see its own output needs some way to be shown it's wrong, and visual work is disproportionately represented in coding sessions because so much of what's being built is meant to be looked at. The real question isn't whether to show it something — it's which format costs the least to say the same thing.

  • Resent conversation history, not new typing, is why long sessions cost more than they feel like they should.
  • Images are billed by patch and capped at 4,784 tokens each, regardless of file size.
  • Frame-dumped video is the single most expensive way to show an agent your screen — about 23 times more than a narrated bundle covering the same 30 seconds.

For the full three-way comparison of video, screenshots, and words — including which one actually carries the most meaning per token — see video, screenshots or words: the real cost of showing an AI your screen.

How do you cut cost without cutting quality?

Most savings come from three habits: clear context between unrelated tasks instead of letting history grow unbounded, match the model to the task instead of defaulting to the most expensive one, and stop sending raw video or screenshot dumps when a smaller, more targeted visual reference would say the same thing for a fraction of the tokens.

A partial, practical list:

  1. Clear context between unrelated tasks. History never shrinks on its own; starting fresh is the single biggest lever you control directly, and it costs nothing to do.
  2. Match the model to the job. Save the most capable, most expensive model for genuinely hard reasoning, not routine edits.
  3. Send one representative screenshot, not four. A single well-chosen 1080p screenshot costs 2,691 tokens; four to cover the same page cost 10,764 — for less clarity, not more, since none of the four says which one matters.
  4. Never frame-dump a screen recording. At 1 fps, a 30-second clip runs about 80,730 tokens — Claude Code can't watch the video itself anyway, so those tokens buy still frames, not understanding.
  5. Say what's wrong instead of just showing it. A spoken or written bug description runs 65–150 tokens measured; it's the cheapest input in this entire list, and it's the one thing a screenshot can't do on its own.
  6. If you're recording anyway, bundle it. A narrated screen-and-voice bundle — the format Walkie produces — measures around 3,500 tokens typical, close to the cost of a couple of screenshots and closer in meaning to sitting next to someone.

That's a partial list. The full set of eleven tactics, ranked by tokens saved per minute of effort — including which ones are honestly marginal — is in 11 ways to cut Claude Code token costs. For the narrate-and-point workflow itself, not just the numbers behind it, see give your AI agent visual feedback without burning tokens.

None of this requires new tooling to start; clearing context and choosing the right model cost nothing and take seconds. If you're already recording your screen to explain something to an agent, Walkie turns that recording into the roughly 3,500-token bundle in the table above instead of a video file the agent can't open on its own — but that's one tactic on this list, not the whole answer to token costs.

What should you measure?

Run /usage inside Claude Code to see the current session's token breakdown by model, including cache reads and writes, or configure the status line to show it continuously. On a paid plan, /usage also attributes recent consumption to skills, subagents, and MCP servers, so you can see which parts of your setup are actually driving the number up.

Every number in this article is either calculated from Anthropic's published formula or measured directly — but your own session is neither of those until you look. /usage is the ground truth for a specific session; the usage page in the Claude Console is the ground truth for billing across all of them. Neither requires guessing, and neither requires trusting an average from an article like this one over your own numbers.

Start with one week of just watching /usage before changing anything. Note which turns spike — a pasted screenshot, a long retry, a session left open since morning — and you'll usually find one or two habits doing most of the damage, not a dozen small ones scattered evenly. Fix those first, using the tactics above, then measure again. The point isn't to spend nothing; it's to know what you're spending it on, and to stop paying for tokens that never made the fix land any faster.