One AI agent of mine burned 245,000 tokens building a single ROAS table. The table itself took a few lines of math. The cost came from somewhere else, and once I saw where, I rewrote how my whole AI team gets work.
This is the practical version of that fix. No theory, no hype. If you run a business with AI tools, this is how to stop paying premium prices for work that does not need a premium brain.
What Actually Went Wrong
I run a small AI operation. Claude Code does the thinking, scripts do the data work, and a couple of Mac Minis in my office run things around the clock. In late September I asked a sub-agent to pull ad data and build a return-on-ad-spend table. Simple job.
The agent did what agents do. It pulled raw API responses, read them into its working memory, pulled more, joined them, read the results again, and carried all of it along for every following step. By the end it had consumed 245K tokens.
Here is the lesson that cost me: the expensive part of AI is almost never the thinking. It is the raw data riding along in context across many steps. Every step re-pays for everything that came before it.
The Fix Part One: Match the Model to the Job
The first change was routing. I stopped using one model for everything and split the work into four lanes:
- Opus plans. Strategy, talking through decisions, final spot checks. The heaviest model, used sparingly.
- Sonnet builds. Research, code, multi-step builds, anything a human will read, like emails, posts, and reports.
- Haiku checks. Checklists, rule checks, comparing a claim against its source, status summaries.
- Gemma extracts. Classification, extraction, heartbeats and health checks. This runs locally through Ollama on a second Mac Mini, so it costs nothing per call.
One detail matters more than it looks. When you launch a sub-agent and do not name a model, it inherits the biggest one. That is exactly how my cold email build quietly ran on Opus for a whole session. Now every sub-agent call must name its model. No exceptions.
The Fix Part Two: Keep Raw Data Out of the Conversation
Routing alone would not have saved that ROAS table. The bigger change was about where data lives.
The rule now: agents never read raw data. A script pulls the numbers, joins them, and does the math in Python. The script prints a summary of two kilobytes or less, or writes a summary file and prints the path. The raw responses go to disk and stay there.
The agent sees the answer, not the haystack. Same table, a fraction of the tokens, and fewer mistakes because there is less noise to get confused by.
The Fix Part Three: Hard Budgets
Every sub-agent now gets a written budget in its prompt: 60,000 tokens and 15 tool calls. A data pull, a report section, or a workflow runs inside that box. Only a true multi-system reconciliation, like a month-end close, is allowed to go to 150,000, and only with my explicit yes.
When a task starts to look like it will blow the budget, the agent stops, writes what it has to disk, and hands back a plan. That one rule prevents the grind where an agent keeps looping because it never learned it was out of room.
A few supporting habits go with it:
- Reuse before re-pull. Every pull is saved with a timestamp. The next agent gets the file path, not instructions to fetch the data again.
- Patch, do not re-read. To add a section to a report, edit the local file and republish. Never load the whole finished page back into context.
- Return 500 words max. Agents hand back numbers and file paths, not essays.
- Recurring reports become scripts. If a report will run again, the agent’s last job is to save the script. Next time it is one command, zero reasoning tokens.
What I Would Tell a Business Owner Starting Today
You do not need two Mac Minis to use this. The pattern works at any size.
If you use a single AI tool, the equivalent is simple. Do not paste a spreadsheet into a chat and ask questions about it. Have a small script or a spreadsheet formula do the calculation, then give the AI the result and ask it what to do. You pay for judgment, not for scrolling through rows.
If you are paying for AI usage by the token, this is the difference between a tool that quietly drains your budget and one that stays predictable. I wrote about the broader cost picture in The Real Cost of AI Implementation, and the budget rules here are the follow-up I wish I had written first.
What Does Not Work
- One giant agent doing eight steps in a row. Quality drops by step six because the context is full of leftovers.
- Using the strongest model for health checks. A free local model handles those fine.
- Letting the default decide. Defaults pick the expensive option. Name the model every time.
- Trusting a long unattended chain. Each AI step is roughly 90 percent reliable. Chain five and you are near 59 percent. Keep chains short and put a human review before anything goes public.
What To Do Next
- Find your most expensive AI task this week. Check usage and look for the one job that ate the most. That is your 245K moment.
- Ask where the raw data sits. If the AI is reading rows, files, or API output directly, move that work into a script or formula.
- Write a budget into the prompt. A token ceiling and a tool-call limit, stated in plain words.
- Name the model on every delegated task. Strong model for planning, mid-tier for building, light model for checking.
- Turn any repeat job into a script. If you did it twice, the third time should cost nothing. A good place to begin is my first AI automation beginner guide.
If you want to see how the full agent setup fits together, start with how I built an AI agent team that runs while I sleep.