DEV Community

Cover image for Your AI Agent Is Burning Money — A Dev's Cost-Control Guide
Paul Lovelace
Paul Lovelace

Posted on

Your AI Agent Is Burning Money — A Dev's Cost-Control Guide

Quick housekeeping: no affiliate links in this one — links below go to reporting and docs, nothing sponsored. This is a guide, not a sales pitch.

A few days ago I wrote about Accenture capping Claude spend at $29 per employee per month. The detail that stuck with me wasn't the cap itself — it was the number behind it. Some of their engineers were running $500 to $1,000 a month. Each. On one coding assistant.

Seventeen to thirty-four times the allowance. That's not a budgeting problem, that's a leak nobody was watching.

And honestly? Most of us have the same leak. We just haven't done the math yet. So this is the practical piece: where the money actually goes, and the levers that genuinely bring it down. No vendor pitch, no "just switch to our platform." Everything here is stuff working teams are doing right now, as of October 2026.

Where the money actually goes

Agent spend isn't one number. It's four, and only one of them is obvious.

1. Model price per token. The headline number. Claude Opus-class models cost real money per million tokens; Haiku-class models cost a fraction. Anthropic made Haiku 5.5 (1M context, around $0.10 input / $0.50 output per million tokens) the default Haiku tier this month — the cheap tier keeps getting cheaper, which means the expensive tier is increasingly a choice, not a default.

2. Context bloat. This is the silent killer. Every tool call, every file read, every "let me check the whole directory" gets stuffed into context — and you pay for every token in that context on every subsequent turn. A session that starts at 20k tokens can be sitting at 200k by turn forty. You're not paying for thinking; you're paying for remembering.

3. Tool-call loops. Agents that retry, re-read, and re-run burn tokens in circles. One flaky test command run twelve times by an agent "being thorough" costs more than the actual fix.

4. The wrong model for the job. Running a frontier model to rename variables and format imports is like hiring a senior architect to hang a picture frame. It works. It also costs twenty times what it should.

The levers that actually work

I've been collecting what disciplined teams do about this. Not theory — the stuff that shows up in real cost dashboards.

Route by task, not by habit. Keep the strong model for architecture decisions, tricky debugging, and ambiguous requirements. Drop to a cheap/fast model for boilerplate, formatting, test scaffolding, and "write the obvious thing." Most teams find 60–80% of their agent calls don't need the flagship model. This single change is usually the biggest line-item win.

Cap context aggressively. Don't let agents dump whole repos into context. Scope file reads to what's needed, use summaries for the rest, and compact long sessions before they balloon. Some teams set a hard rule: if a session crosses a token threshold, it gets summarized and restarted. Crude, effective.

Turn on prompt caching and actually use it. If your agent re-sends the same system prompt and project context every turn — and it does — caching cuts that repeat cost dramatically. It's a checkbox in most providers. It should already be checked.

Kill the retry loops. Set max iterations. Log every tool call so you can see when an agent is going in circles. The most expensive agent behavior is the one nobody watches: a loop that "almost works" for forty turns.

Batch the small stuff. Five one-line questions to an agent cost five context setups. One batched request costs one. Sounds trivial; at team scale it isn't.

Give every seat a number. This is the Accenture lesson, minus the corporate memo. Per-developer monthly budgets — even soft ones with just a dashboard alert — change behavior overnight. Nobody optimizes what nobody measures. A simple "you're at 80% of your $50" ping does more than any policy document.

Run the grunt work locally. Small open-weight models on your own machine handle a surprising amount of the boring work for essentially $0 marginal cost. Not everything needs to round-trip to an API.

The team checklist

If you're the person who'd get the awkward email from finance, here's the short version:

  1. Dashboard first. Get per-seat, per-project spend visible before you change anything. You can't cut what you can't see.
  2. Set a soft cap per dev per month. Alert at 80%, hard conversation at 100%. Pick a number that stings a little — that's the point.
  3. Default to the cheap model. Make the flagship model the exception that needs a reason, not the default that needs none.
  4. Audit your three biggest sessions weekly. Where did the tokens go? Context bloat? Loops? Wrong model? Fix the pattern, not the person.
  5. Revisit quarterly. Prices move fast — Haiku-tier pricing today isn't Haiku-tier pricing next quarter. What's expensive now might be the cheap default in six months.

What I'd actually do

If I were setting this up for a team tomorrow: per-dev soft cap with alerts, cheap-model default with the strong model one flag away, prompt caching on, and a weekly ten-minute look at where the tokens went. Total setup time: an afternoon. Total savings for a heavy-usage team: usually 50–70% of the bill, based on what's been reported.

The deeper point: agent spend is the new cloud bill. Ten years ago teams learned that "just spin up instances" needed FinOps. We're at exactly that moment with tokens. The teams that build the discipline now will have the budget headroom later — everyone else will be writing apologetic emails to finance.

And if your employer hasn't capped you yet? Enjoy it. But set your own cap anyway. $29 a month is a weirdly good discipline to borrow.


Related: I covered the Accenture $29 cap and what it signals for the industry earlier today — the news side of this story. This piece is the evergreen how-to.

Are you tracking your agent spend per seat, or is it still "whatever the invoice says"? What's the most absurd single-session bill you've seen — and what caused it?

Top comments (0)