Menu

Why Your AI Coding Agent Bill Grows With Every Turn (and 7 Ways to Cut It)
📰

Why Your AI Coding Agent Bill Grows With Every Turn (and 7 Ways to Cut It)

DEV Community: productivity·Tech Geeks·10 days ago
#eKL9q6ro
#devtoproductivity#devto#dev#model#every
Reading 0:00
15s threshold

If you use Claude Code, Cursor or Codex every day, you have probably had one of two surprises: an API bill much larger than you expected, or a "you've hit your usage limit" message halfway through the afternoon. Both have the same cause, and once you see it, most of the fixes become obvious.

An agent resends everything, every time

A chatbot answers one message. A coding agent works in a loop: it thinks, reads a file, runs a command, reads the output, and thinks again. Every step is a separate request to the model, and every request carries the whole context:

Part of the request Typical size Sent when

System prompt and tool definitions Thousands of tokens Every request

Instruction files (CLAUDE.md, AGENTS.md, rules) Hundreds to thousands Every request

Conversation history Grows every turn Every request

Tool results (file contents, command output) Often the largest part Every request after they appear

So a one-line question asked in a session that has been open all day still pays for the whole day's…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.