Why AI coding agents burn tokens re-sending their history on every call
A coding agent's input token count can dwarf a single chat because models keep no memory between calls, so earlier turns must be re-sent each time. Because each call includes everything before it, total input across many calls grows close to the square of the number of calls, and server-side state saves upload bytes without shrinking the billed context. In a lab simulation of a 30-call agent task, about 94 percent of estimated input tokens were history re-sent from earlier calls. The author recommends trimming tool results before they enter history, enabling prompt caching with static content placed first, and clearing old tool results in large batches near context limits. The core takeaway is that measuring the re-sent share of history matters more than buying a larger context window.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in