Your AI Coding Agent Costs More Than a Junior Dev. Here's the Token Math.
Agentic coding tools burn 10-100x more tokens than chat because the entire context is re-sent on every tool call. A one-word fix can cost 21,000 tokens. Why the meter spins so fast, and five tactics that cut the bill 60-90%.
TL;DR: Agentic coding tools burn 10–100× more tokens than chat because the entire context is re-sent on every tool call. A one-word fix can cost 21,000 tokens. Here's why the meter spins so fast — and five tactics that cut the bill 60–90% without losing quality.
Last month a developer watched their AI coding bill jump from $100 to $2,000. Some teams have seen single-developer months hit $20,000. The Register ran the headline plainly: AI coding agents could soon cost more than the developers using them.
The scary part isn't that agents are expensive. It's why they're expensive — and that most of that spend buys you nothing.
Let's do the math.
The one-word fix that cost 21,000 tokens
Here's the moment the problem clicks. You ask an agent to fix a typo — change recieve to receive in one file.
Task: fix the typo in auth.ts
Result: ~21,000 tokens, 6 tool calls, 4 reasoning steps
For a one-word change. A human would have hit Cmd+F and been done in three seconds, spending exactly zero tokens.
So where did 21,000 tokens go? To understand that, you have to understand the one thing about LLMs that makes agents leak money.
Why agents burn tokens: the stateless trap
LLMs are stateless. The model remembers nothing between calls. So every single step of an agent loop re-sends the entire preceding transcript — system prompt, tool schemas, conversation history, and every file the agent has read so far.
Turn 1: [system + tools + task] → 30k tokens in
Turn 2: [system + tools + task + turn1 + file A] → 38k tokens in
Turn 3: [system + tools + task + turn1 + turn2 + ...] → 47k tokens in
...
Turn 20: [everything, again] → 125k tokens in
Notice the pattern: you aren't paying once for that context. You're paying for it on every turn, over and over.
- ✅ Output tokens — the new code the model writes. Small.
- ❌ Input tokens — the same history re-read every turn. Enormous.
The cost is dominated by input, not output. You are, quite literally, paying repeatedly to remind the model of things it already "knew" ten seconds ago.
The compounding effect is brutal
A ten-turn agent loop sends roughly 50× the tokens of a single linear call. What looks like one task — "refactor this authentication module" — quietly explodes:
- One prompt that costs 50,000 tokens...
- ...routinely compounds to 500,000 tokens by the time the loop wraps.
And that's before the four classic waste mechanisms of ReAct-style loops pile on:
- ⚠️ Reasoning re-loops — the agent re-reads its own history to decide the next step.
- ⚠️ Context reloads — the same files and tool descriptions re-sent every invocation.
- ⚠️ Sequential tool calls — each call is a fresh full-context round trip.
- ❌ Retries on failure — a failed action means doing the whole expensive turn again.
Let's put a dollar figure on it. Take a mid-tier frontier model at ~$3 per million input tokens. A single "refactor this module" task that averages ~1.5M input tokens across 20 tool calls costs about $4.50. Run 50 of those a day across a team, five days a week:
$4.50 × 50 tasks/day × 20 working days ≈ $4,500 / developer / month
That's the junior-dev math. And it's why input tokens are on track to rival payroll.
Five tactics that actually cut the bill
The good news: most of that spend is waste, and waste is fixable. Teams combining three or four of these routinely cut blended costs 60–90% with no measurable quality loss.
1. Prompt caching — the single highest-leverage change
If you do one thing, do this. Cache reads cost roughly 10% of the standard input rate — a 90% discount that breaks even after just ~1.4 reads. One team cut total LLM spend 59% with caching alone.
The rule: put your stable content first (system instructions, tool schemas, retrieval context, few-shot examples) and your dynamic content last.
✅ [ stable: system + tools + docs ] ← cached, billed at 10%
[ dynamic: this turn's user input ] ← the only part re-billed at full rate
Because agents re-send the same prefix every turn, caching turns their single worst habit into their biggest discount.
2. Curate context — stop dumping the whole repo
In one controlled test, an agent given curated context used 42% fewer tokens and made 64% fewer tool calls than the same agent dumping context.
- ❌ Pasting whole repositories "just in case."
- ✅ Selective retrieval — pull only the relevant slice of code, tickets, and docs for this query.
- ✅ Dynamic windowing — only the snippets that matter for the current step enter the window.
3. Route to cheaper models
Not every task needs a frontier model. Routing everyday coding to open-weight models (GLM, Kimi, DeepSeek) can cut per-token cost 80%+, with a smaller quality gap than most expect.
Trivial edits, boilerplate, tests → cheap open-weight model
Architecture, tricky debugging → frontier model
4. Use batch APIs for non-interactive work
Bulk jobs — codemods, doc generation, test scaffolding — don't need real-time responses. Batch endpoints trade latency for a steep discount. If you don't need the answer right now, don't pay the real-time premium.
5. Don't send an agent to do a Cmd+F's job
The cheapest token is the one you never spend. If the mental overhead of prompting, reviewing, and correcting an agent exceeds just doing the edit yourself — do the edit yourself. Agents are a power tool, not a default.
The mindset shift
The industry spent 2025 asking "which model is best?" In 2026 the better question is "which model, with how much context, for this specific task?"
- ✅ Cache the stable prefix.
- ✅ Feed the agent a scalpel, not the whole repo.
- ✅ Match the model to the job.
- ⚠️ Watch input tokens, not output — that's where the money goes.
- ❌ Don't automate what a keyboard shortcut already solves.
Agents are worth it when the task is genuinely hard. The trick is making sure you're paying for the hard part — not paying, fifty times over, to re-read a file the model saw one second ago.
Sources
The Register — AI coding agents could soon cost more than the developers using them · Vantage — The hidden cost driver in agentic coding sessions · Unblocked — Why AI agents burn tokens · Unblocked — Cut AI token costs 50–90% · Atlas Cloud — How to reduce AI coding token cost · MindStudio — Token reduction strategies for AI agents · CIO — AI coding token costs are on track to rival human payroll
This article is also published on Medium.