I Measured 23,968 Agent Turns. The Prompt Was 309× the Output.
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
An analysis of 166 real coding-agent sessions (23,968 billed turns, $5,816 spent) shows the prompt-to-output token ratio is 309:1, because the stateless API resends the entire conversation history on every turn. Cost per turn grows roughly quadratically with step count — identical work costs 3.8x more at turn 190 than turn 5. Prompt caching cuts costs 7.3x (98% of tokens served from cache), but doesn't change the underlying quadratic growth; one changed byte in the prefix invalidates the whole cache. Repeated tool calls (loop signals) are individually cheap (0.86x average) but structurally expensive because they add turns late in the session and permanently inflate context. Context compaction cuts token count ~92% but destroys detail the agent may need to rediscover. Recommended dashboard metrics: prompt-to-output ratio, repeated tool call counts, and cache read share.
Table of contents
What is being measured hereWhy does turn 40 cost more than turn 4?What does turn position actually cost?What does a loop actually cost?What is prompt caching actually doing?What does compaction look like in the data?What should you actually watch?FAQThe part that changed how I workQuestions this post answers
Why does an AI coding agent cost more per turn the longer the conversation gets?
Because the model API is stateless, so every turn resends the entire conversation history rather than just the new message. On turn 40 the agent might generate only 300 tokens, but the billed prompt includes all 39 prior turns. Across 23,968 measured turns, an identically sized turn cost 3.8x more at position 190 than at position 5. Track this kind of cost-per-position data on daily.dev before your own agent bills spiral.
How much money does prompt caching actually save when running AI agents at scale?
About 7.3x in one measured dataset: $5,816 with caching versus $42,649 for identical work without it, across 166 sessions and 23,968 turns. This is because 98% of all prompt tokens were served from cache at a tenth of list price. Caching doesn't remove the underlying quadratic cost growth, it just divides its coefficient by roughly ten. Developers comparing agent cost strategies can follow measurements like this on daily.dev.
Are repeated tool calls in an AI agent loop actually expensive?
Not individually. Measured against the average turn in their own session, repeated tool calls cost 0.86x, slightly cheaper than average, because rerunning a command produces less output than reasoning does. The real cost is structural: loops tend to start later in a session where the growing context makes every turn pricier, and their output permanently inflates the context for every subsequent turn. Anyone debugging runaway agent spend can keep up with findings like this on daily.dev.