Part 7 of 12 in the series Cutting LLM Costs Without Losing Trust. Part 1 to Part 6 covered caching, routing, trimming, output length and batching. Those parts made each model call cheaper. This part is about agents that make too many of them.
It's 9:45. A rep has a renewal call with Acme at 10:00. They type into the assistant: "Prep me for Acme. What's changed since our last call, any open support issues, and is the renewal at risk?"
The agent gets to work. It pulls the account from the CRM. It searches support tickets for "Acme" and finds nothing, because the ticketing system files them under "Acme Holdings Ltd." So it tries "Acme Inc," then "ACME," then the account ID, which the ticketing tool doesn't accept. It reads the last 40 email threads to find the renewal date. It opens the usage dashboard, gets a timeout, and tries again. And again.
At 9:53 the rep is still watching a spinner. At 9:58 they give up and join the call with the CRM page open.
The agent finishes at 10:04 with a good brief. Nobody reads it. It took 38 steps, and because every step re-sent everything the agent had gathered so far, it burned through more tokens than the rep's whole day of live answers.
The agent didn't fail. It just never decided it had enough.
A chatbot answers once and stops. An agent decides for itself when it's done, and without a budget, "done" can come very late.
Why loops get expensive so fast
An agent works in steps. At each step it reads everything so far, decides on the next tool call, and gets a result back. That result is added to the conversation, and the whole conversation is sent again for the next step.
So the cost of a step isn't flat. Each one carries every earlier step with it. Take the Acme prep: a 5,000-token start (instructions, tools, the rep's question) and about 2,000 tokens of tool results added at each step.
| Run | Steps | Input tokens across the run | Cost on Sonnet 5.5, no cache |
|---|---|---|---|
| A good run | 8 | 96,000 | $0.204 |
| The Acme run | 38 | 1,596,000 | $3.25 |
- Run
- A good run
- Steps
- 8
- Input tokens across the run
- 96,000
- Cost on Sonnet 5.5, no cache
- $0.204
- Run
- The Acme run
- Steps
- 38
- Input tokens across the run
- 1,596,000
- Cost on Sonnet 5.5, no cache
- $3.25
About five times the steps cost sixteen times as much, because the context keeps growing. That's the shape of every agent bill: the long runs cost far more than their step count suggests.
Anthropic sees this at scale. In its own research agents, a single agent used about 4 times the tokens of a chat, and a multi-agent system about 15 times. Among the failures they found by watching agents step by step: agents continuing when they already had sufficient results.
The same report has the other half of the story. On their hardest research benchmark, token use alone explained about 80% of the difference in performance. More effort really does buy better answers on hard tasks. So the goal isn't the fewest tokens. It's matching the effort to the task, and stopping when the task is done.
Five ways a sales agent loops
Every wasted step in the Acme run had a cause you could fix. None of them was the model being careless.
| What the agent did | Why it happened | The fix |
|---|---|---|
| Searched tickets for "Acme," "Acme Inc," "ACME" | The ticketing system knows the account by a different name | Give the agent the account's IDs in every system up front, or one tool that resolves the account once |
| Retried the usage dashboard after each timeout | A timeout looked like "try again" | Retries live in code: a limit, backoff with jitter, and a circuit breaker per tool. The tool returns a clear "unavailable, don't retry" |
| Read 40 email threads to find a renewal date | The tool returns everything and leaves the search to the model | Tools return what the task needs: the renewal date from the CRM, the last five threads, not all of them |
| Kept looking after it had enough | Nothing told it what "done" meant | The task states what a finished brief contains, so the agent can check it off |
| Checked the CRM a second time "to confirm" | No memory of what it already had | Remember results within the run; block identical repeat calls |
- What the agent did
- Searched tickets for "Acme," "Acme Inc," "ACME"
- Why it happened
- The ticketing system knows the account by a different name
- The fix
- Give the agent the account's IDs in every system up front, or one tool that resolves the account once
- What the agent did
- Retried the usage dashboard after each timeout
- Why it happened
- A timeout looked like "try again"
- The fix
- Retries live in code: a limit, backoff with jitter, and a circuit breaker per tool. The tool returns a clear "unavailable, don't retry"
- What the agent did
- Read 40 email threads to find a renewal date
- Why it happened
- The tool returns everything and leaves the search to the model
- The fix
- Tools return what the task needs: the renewal date from the CRM, the last five threads, not all of them
- What the agent did
- Kept looking after it had enough
- Why it happened
- Nothing told it what "done" meant
- The fix
- The task states what a finished brief contains, so the agent can check it off
- What the agent did
- Checked the CRM a second time "to confirm"
- Why it happened
- No memory of what it already had
- The fix
- Remember results within the run; block identical repeat calls
Most of these are tool design problems, not prompt problems. An agent can only be as efficient as the tools it's given. Fixing the account lookup alone would have removed every one of the Acme run's ticket-search retries.
The same pattern shows up with sub-agents. Anthropic's early research agents spawned 50 subagents for simple queries, until the team wrote scaling rules into the lead agent's prompt: one agent with 3 to 10 tool calls for simple fact-finding, more only for genuinely complex research. If your assistant uses sub-agents, each one needs its own step and spend cap, and fanning out should be saved for work that is genuinely parallel, like researching five accounts at once. The 15 times multiplier applies to every sub-agent you start.
Fewer agents is often the bigger fix. Most fan-out isn't needed. One agent with good tools and a running note avoids re-sending every sub-agent's context into the lead agent, which is where much of that 15 times comes from. When you do fan out, have each sub-agent return a short summary of what it found, not its whole transcript: the lead agent needs the findings, not the search. The cost is speed, because research that really could run in parallel gets slower when one agent does it in turn.
Ask once, not four times. "Prep me for Acme" can turn into four model calls, one each for the account, the tickets, the emails and the usage. Fetch the four sources in parallel and send them to one model call with all four asks, and the model reads the account context once instead of four times. One slow source then holds up the whole brief, so give each fetch its own timeout and let the brief go out with a "couldn't load" line, as below.
Give every task a budget
Anthropic's guide to building agents puts it simply: alongside finishing the task, it's common to include stopping conditions, such as a maximum number of iterations. For a sales assistant, one cap isn't enough. Different tasks deserve different effort.
An example to start from, set per task type:
| Task | Max steps | Max tool calls | Time limit | Spend cap |
|---|---|---|---|---|
| Live question during a call | 3 | 3 | 8 seconds | $0.05 |
| Last-minute call prep | 10 | 12 | 2 minutes, or 5 minutes before the meeting | $0.30 |
| Deep account research, run in the background | 30 | 40 | 15 minutes | $2.00 |
| CRM update | 4 | 1 write, after rep approval | 30 seconds | $0.05 |
- Task
- Live question during a call
- Max steps
- 3
- Max tool calls
- 3
- Time limit
- 8 seconds
- Spend cap
- $0.05
- Task
- Last-minute call prep
- Max steps
- 10
- Max tool calls
- 12
- Time limit
- 2 minutes, or 5 minutes before the meeting
- Spend cap
- $0.30
- Task
- Deep account research, run in the background
- Max steps
- 30
- Max tool calls
- 40
- Time limit
- 15 minutes
- Spend cap
- $2.00
- Task
- CRM update
- Max steps
- 4
- Max tool calls
- 1 write, after rep approval
- Time limit
- 30 seconds
- Spend cap
- $0.05
These numbers are a starting point, not a standard. To set your own, run a couple of hundred real tasks of each type without a budget, keep the runs that produced a good result, and look at how many steps they took. Set the cap near the 90th percentile of those successful runs. A task that needs more than that is usually stuck in a loop, not facing a harder question.
A few rules make budgets work in practice.
Enforce them in code, not in the prompt. Telling the model "use at most 10 steps" is a hint. The harness counting steps and stopping at 10 is a budget. Treat the spend cap as the loosest of the three. Usage is only known after each call returns, so a run can go past its cap by a step. Set it a little under what you can afford, and let the step and time caps do most of the work.
Tie the time limit to the rep's calendar. The agent knows the meeting starts at 10:00, so the deadline is 9:55, whatever the step count says. A perfect brief at 10:04 is worth nothing. For a live question, the 8-second limit isn't only about steps. How fast each step comes back depends on which model answers (Part 3) and how much it writes (Part 5). Three steps on a big model writing long answers won't fit.
Block repeats. The same tool with the same arguments twice in one run is almost always a loop. Stop it, or return the earlier result.
Fetch in parallel when the steps don't depend on each other. Most providers let a model ask for several tool calls in one step: the CRM record, the open tickets and the usage summary at once. That takes fewer steps and less time, which matters inside an 8-second budget. But all the results land in the context together, so count tool calls, not just steps, and make sure each tool returns only what the task needs.
Cap the session, not just the run. A rep who doesn't like the answer asks again, and again. Five retries spend five budgets. Add a cap per rep per day, or per conversation, so one frustrated rep can't run up the bill. Repeated retries of the same question are a signal too: something in the answer isn't working.
Gate the writes separately. A sales agent reads tickets, emails and notes written by people outside your company, and a carefully worded email can try to steer what the agent does next. In my harness engineering post, the agents were read-only. Once an agent can update the CRM, every write needs its own approval that has nothing to do with the budget: the rep confirms the change, and the agent can't write to any record outside the account it was asked about.
Shrink the context, but keep the facts. Old tool results don't need to ride along on every step. Anthropic's API can clear older tool results automatically once the context passes a threshold. Each clearing breaks the prompt cache, so clear in big chunks rather than a little at every step. But the renewal date found at step 3 may be the whole point of step 9. Before a result is cleared, have the agent write the facts it needs into a short running note (the renewal date, the open ticket count, the account owner) and keep that note in the context. Drop the transcript, keep the finding. Otherwise you get a cheaper agent that fetches the same data again, which is the loop you were trying to stop.
Route the steps, not just the task
Part 3 sent each question to the cheapest model that could answer it. The same idea works inside an agent run. Most steps are routine: pick the next tool, read a CRM record, pull a date out of an email. A small model handles those well. Only a few steps need the big model's judgement, usually planning the run and writing the final brief.
In the Acme prep, that might be seven steps on Claude Haiku 5.5 to gather the facts and one step on Sonnet 5.5 to write the brief. The cost table further down shows what that does to the bill.
Two things to watch. A cache belongs to one model, so every switch starts the other model's cache cold. Keep switches few: a run of cheap steps, then one big-model step at the end, rather than going back and forth. And check the cheap steps against your golden set, because a small model that picks the wrong tool can add the steps back.
When the budget runs out
A budget that just stops the agent leaves the rep with nothing, which is worse than a slow answer. What happens at the limit matters as much as the limit itself.
Return what you have, and say what's missing. At 9:55, the Acme agent had the CRM history and the recent emails. It didn't have the support tickets. The right output was a brief built from what it had, with one honest line at the top:
Couldn't load support tickets. The ticket system didn't recognise "Acme". Check open tickets here before the call: [link]
That brief is useful at 9:55. A complete one at 10:04 isn't.
That partial brief doesn't need the big model either. When the budget runs out, hand what the agent collected to a small model with one instruction: summarise what we have, and list what's missing. That last step costs a fraction of another big-model step, and it produces exactly the 9:55 brief the rep needs.
Hand the judgement to a person. Anthropic's guidance on agents notes they can pause for human feedback at checkpoints or when they hit a blocker. The cheapest checkpoint is often the earliest. If the CRM has two accounts called Acme, the agent shouldn't spend five steps guessing which one the rep meant. It should ask: "Acme Holdings or Acme Logistics?" One question costs the rep two seconds and saves the run. For broken tools, the blocker goes to whoever owns the integration.
Log every budget hit as a bug. A run that hits its limit is telling you something: a tool that doesn't understand account names, a dashboard that keeps timing out, a task with no clear end. Each one is a fix that makes the next run cheaper. The budget is a safety net; the tool fixes are the real saving.
Never cut off in the middle of a write. If the agent is part-way through updating the CRM when the budget runs out, finish or roll back that one change cleanly. A half-written record is worse than none. Stop between steps, not inside one. You can usually abort a streaming response, but you still pay for what was generated, and a tool call already sent to the CRM keeps running. Give every write an idempotency key too, so a retried or resumed run can't apply the same change twice.
What it saves, at real 2026 prices
Take the last-minute prep requests from Part 6: about 4,000 a month that couldn't wait for the overnight batch. Assume most runs take 8 steps, but 1 in 10 runs away to 38 steps like the Acme one. The budget caps those at 10. Each step writes about 150 output tokens. Prices are Claude Sonnet 5.5's: $2 per million input tokens and $10 output. With Part 2's prompt cache, cached reads cost $0.10 and writing new context to the cache costs $2.50, and the 5,000-token start is already cached from earlier runs. The routed rows use Claude Haiku 5.5 at $0.10 and $0.50, assuming the same cache ratios.
| Runs per month | Per run, no cache | Monthly, no cache | Per run, with cache | Monthly, with cache |
|---|---|---|---|---|
| 3,600 normal runs (8 steps) | $0.204 | $734 | $0.055 | $198 |
| 400 runaway runs, no budget (38 steps) | $3.25 | $1,300 | $0.394 | $158 |
| Total without budgets | $2,034 | $356 | ||
| 400 runs capped at 10 steps | $0.295 | $118 | $0.072 | $29 |
| Total with budgets | $852 (58% less) | $227 (36% less) | ||
| 3,600 normal runs, routed (7 Haiku steps, 1 Sonnet) | $0.048 | $173 | $0.039 | $140 |
| 400 capped runs, routed (9 Haiku steps, 1 Sonnet) | $0.060 | $24 | $0.050 | $20 |
| Total with budgets and per-step routing | $197 (90% less) | $160 (55% less) |
- Runs per month
- 3,600 normal runs (8 steps)
- Per run, no cache
- $0.204
- Monthly, no cache
- $734
- Per run, with cache
- $0.055
- Monthly, with cache
- $198
- Runs per month
- 400 runaway runs, no budget (38 steps)
- Per run, no cache
- $3.25
- Monthly, no cache
- $1,300
- Per run, with cache
- $0.394
- Monthly, with cache
- $158
- Runs per month
- Total without budgets
- Per run, no cache
- Monthly, no cache
- $2,034
- Per run, with cache
- Monthly, with cache
- $356
- Runs per month
- 400 runs capped at 10 steps
- Per run, no cache
- $0.295
- Monthly, no cache
- $118
- Per run, with cache
- $0.072
- Monthly, with cache
- $29
- Runs per month
- Total with budgets
- Per run, no cache
- Monthly, no cache
- $852 (58% less)
- Per run, with cache
- Monthly, with cache
- $227 (36% less)
- Runs per month
- 3,600 normal runs, routed (7 Haiku steps, 1 Sonnet)
- Per run, no cache
- $0.048
- Monthly, no cache
- $173
- Per run, with cache
- $0.039
- Monthly, with cache
- $140
- Runs per month
- 400 capped runs, routed (9 Haiku steps, 1 Sonnet)
- Per run, no cache
- $0.060
- Monthly, no cache
- $24
- Per run, with cache
- $0.050
- Monthly, with cache
- $20
- Runs per month
- Total with budgets and per-step routing
- Per run, no cache
- Monthly, no cache
- $197 (90% less)
- Per run, with cache
- Monthly, with cache
- $160 (55% less)
Three things stand out.
The runaway runs set the bill. Without budgets and without caching, one run in ten costs 64% of the total. Agent costs are decided by the worst runs, not the typical one, which is why averages hide the problem.
Prompt caching does most of the cost work by itself, because each step re-sends a prefix the cache already has. With caching on, budgets save less money. But they save the same time. The cache makes a 38-step run cheaper; only a budget makes it end before the call starts. For a rep at 9:58, that's the part that matters.
Routing the steps moves the bill more than anything else in this post. Budgets cut the uncached bill by 58%; budgets plus a small model for the routine steps cut it by 90%. With caching on, the extra saving is smaller, because the cache had already taken the repeated context off the bill, but it's still the biggest single step.
None of this is free to run. Budgets need per-step usage tracking, tracing and alerts. That's less plumbing than Part 6's batch queue, and most teams need the tracing anyway to debug their agents, but it belongs in the estimate.
How to know it's working
Averages lie about agents, so watch the tail.
- Steps and cost per task at p50, p95 and max. The p95 and max tell you about runaways; the p50 barely moves.
- Share of runs that hit a budget, by task and by cause. Steps, time or spend. A rising share means a tool broke or a task got harder.
- Repeated identical tool calls per run. Above zero means a loop, even if the run finished in budget.
- Errors by tool. One tool that times out or returns nothing usually sits behind most of the wasted steps.
- Briefs finished after the meeting started. The number that tells you whether reps are being served, not just billed.
- Partial answers, and whether reps used them. If reps open the "couldn't load" link and carry on, the fallback works. If they ignore the brief, the partial answer wasn't useful enough.
- Answer quality on a golden set, budgeted versus unbudgeted. Run the same tasks both ways and compare the briefs. Without this, "58% cheaper" says nothing about whether the answers got worse. The 300-example golden set from my harness engineering post is the kind of check this needs.
A budget is a promise to the rep
It's tempting to see agent budgets as cost control. A finance problem, solved with a cap.
But the cap that mattered in the Acme run wasn't the spend. It was the clock. The rep didn't need the best possible brief. They needed a good enough brief at 9:55, with an honest note about what was missing.
An agent with no budget isn't more thorough. It just hasn't been told what "enough" looks like.
The series
Each part uses the same sales assistant, so the savings stack on top of each other.
- Semantic caching: stop paying for the same answer twice
- Prompt caching: stop re-reading the same playbook on every call
- Model routing: use the big model only when the question needs it
- Trimming retrieved context: two good chunks beat ten average ones
- Controlling output length: your sales assistant talks too much
- Batch processing: not everything needs an answer right now
- Budgets for agent loops: your agent doesn't know when to stop (this post)
- Small models and fine-tuning: you probably don't need to fine-tune
- Prompt and context compression: your prompt is longer than the question
- Retrieval and tool-result caching: cache the lookup, not just the answer
- Commercial and governance levers: the biggest discount isn't in the code
- Cost per outcome: stop counting tokens, count deals
Next up, Part 8: small models and fine-tuning.
Sources
- How we built our multi-agent research system (Anthropic Engineering)
- Building effective agents (Anthropic)
- Context editing (Anthropic docs)
- Pricing (Anthropic, checked 15 November 2026)