The agent swarm cost kit (task briefs, boundaries, one honest comparison)
The short version
Running more agents in parallel feels faster, and the bill does not care how it felt. Agent two opens the same files agent one already read. Agent three reads both of their diffs to check them. You pay for the same piece of work two or three times over, and the run still lands in roughly the same place a single agent would have.
Parallel agents only pay for themselves when each one can move a piece of work nobody else is touching. So the fix is boring: write a one page brief per agent before you start, give each of them an output file and a boundary they may not cross, make the lead agent wait instead of interviewing you, and then run the same task once with a single agent and compare what each one cost.
Copy these prompts
Paste them into Claude Code (or any agent that can see your project), in this order. The first one is usually the one that saves the money.
1. Write the task brief before you start any agent
I want to run several AI agents in parallel on this task: <describe the task>.
Before starting anything, split it into independent pieces of work.
For each piece give me: the one file or folder it owns, the single output it must produce, the files it is forbidden to touch, and what it needs from another piece.
If two pieces need to read or write the same file, say so and merge them into one. If fewer than three pieces survive, tell me to run this with a single agent instead.
2. Make the lead agent wait, not interview me
Act as the lead agent for the briefs above. Start every piece that has no unmet dependency, then wait.
Do not ask me questions while work is running. Collect anything unclear into one list and give it to me when every agent has stopped, or when one of them is blocked and cannot continue.
When an agent finishes, do not re-read its work to verify it. Report what it changed and move on.
3. Run it once the cheap way and compare
Run this exact same task again from a clean checkout with one agent and no parallelism.
Then give me a table comparing the two runs: wall clock time, total tokens in and out, total cost, files touched, and how many files were read more than once across the whole run.
End with a one line verdict: was the multi agent run worth the difference, yes or no.
I started using swarms because a big refactor felt too slow. It was slower and it cost about three times more, and the reason was visible in the logs once I looked: the same four files opened by three different agents, and a fourth agent whose entire job turned out to be reading the other three.
Where the money actually goes
- Re-reads. Every agent starts cold. It has no idea what the others have already loaded, so it pays full price for the same context. On a repo where the relevant context is 40k tokens, three agents is 120k tokens before a single line is written.
- Verification passes. An agent asked to "check" another agent's work reads both the original and the diff. That is the most expensive shape of work there is, and it usually produces a paragraph of agreement.
- The waiting lead. A main agent that polls its children, summarises progress and asks you what to do next is burning tokens producing status, not work.
- Overlap rewrites. Two agents touching the same file produce a conflict, and resolving that conflict is a third call that reads both versions.
The boundary test
Before an agent gets started, it must be able to answer three things in one line each. If it cannot, it is not an independent piece of work and it belongs to the agent next to it.
- What do I own? One directory, one file, or one clearly named surface. Not "the backend".
- What do I hand back? A specific artifact: this file changed, this test passing, this list written to that path.
- What am I not allowed to touch? Named. Shared config, migrations and lockfiles belong to exactly one agent or to none.
A useful default: shared files are owned by the lead and by nobody else. Agents propose a change to them in their report and the lead applies it once at the end.
The cost tracker
You cannot judge a swarm without a number, so keep the smallest possible log. One line per run, appended by hand if you have to:
date | task | mode (single/swarm) | agents | wall clock | tokens in | tokens out | cost | shipped?
Three runs in and the pattern shows up on its own. In mine, swarms won on tasks that split into genuinely separate surfaces, and lost on everything that shared a data model.
The comparison rule
Never judge a swarm against your memory of how long a single agent used to take. Run it. Same task, clean checkout, one agent, and write both numbers down. It costs you one extra run once, and it is the only way you ever find out that the expensive mode was not buying anything.
If the swarm is not at least meaningfully faster on wall clock, it lost. It was already more expensive.
Steal this for your app
- Count the pieces before you start. Under three independent pieces means one agent.
- One owner per file. If two agents can write the same path, you have one agent with extra steps.
- Ban the reviewer agent unless a human reads its output. Otherwise you are paying an agent to agree.
- Make the lead wait. Questions batched at the end, never mid run.
- Keep the one line cost log. Three entries is enough to settle the argument.
Run this on your codebase
Paste this into a Claude session in your repo:
Audit how I have been running AI agents on this project. Report before changing anything:
1. Split the work I am about to do into independent pieces, and list any two pieces that would read or write the same file.
2. Name the files that must have a single owner: shared config, migrations, lockfiles, generated files.
3. From my last run, list every file that was read by more than one agent.
4. Estimate the token cost of running this task with one agent versus with the number of agents I asked for.
5. Give me a one line verdict on whether this task should run in parallel at all, and say why.