Claude Code spends three-quarters of its token budget just reading the codebase, according to Red Hat’s analysis of 219 real-world sessions. The finding flips the usual assumption that AI-driven coding agents waste time generating code and suggests that developers should attack the context-management problem, not just model speed.

The data behind the claim

Red Hat examined 219 interactions with Anthropic’s Claude Code and calculated token usage per turn. Across the sample, the median turn allocated 75 % of tokens to ingesting the surrounding code and documentation, while only 25 % went toward producing new lines. Because most AI providers bill input and output tokens at the same rate, the “reading” half of the transaction drives the bulk of the cost.

Why the reading cost matters

Optimization strategy

Many teams pour resources into faster or larger models, hoping a speed boost will shave seconds off each generation. If three-quarters of the work is simply pulling in context, a faster model saves only a fraction of the total time. The real lever is how much context the model has to process each turn.

Cost control

When an AI assistant rereads the same repository state on every request, input tokens balloon. Projects with large context windows can see their bills swell dramatically, even if the amount of generated code stays modest.

Engineering focus

Tool builders often chase higher model quality while overlooking how prompts are constructed. The analysis suggests that “context engineering” – trimming, caching, and summarizing the code fed to the model – delivers a bigger ROI than incremental model upgrades.

Practical steps to curb the reading overhead

  • Prune irrelevant files – Remove files that the current task does not need from the prompt. Smaller prompts mean fewer input tokens.
  • Cache repeated reads – Store the model’s interpretation of stable parts of the codebase and reuse it across turns instead of re-sending the same text.
  • Compress tool outputs – When external tools return large blobs (e.g., lint reports), summarize them before feeding them back to Claude.
  • Use incremental diffs – Send only the changes since the last turn rather than the entire file contents.

These tactics aim to stop the AI from re-reading the same repository snapshot on every interaction, cutting both latency and cost.

Counter-argument: speed still counts

Some developers argue that a faster model still matters because it reduces the latency of the 25 % of tokens that are generated. In latency-sensitive environments—such as IDE plugins that must respond instantly—every millisecond counts. The reading-dominant profile does not eliminate the benefit of a swifter model; it simply reduces its relative impact.

What to watch next

Red Hat’s study is based on a limited set of sessions, so broader sampling could reveal different token distributions for other languages or project sizes. If future data confirms the 75 % reading figure, we may see a shift toward tooling that automatically prunes and caches context, or even model architectures tuned for rapid context ingestion.

Takeaway: For AI-assisted coding, the cheapest performance gain comes from feeding the model less, not from making it write faster. Red Hat’s numbers make a clear case: trim, cache, and summarize your prompts, and you’ll see tangible savings in both time and money.