Building with agents, lesson 8.2
Running many agents at once
Ten agents can do a day of work in an hour, or make a mess that takes a week to untangle. This lesson sets out how to split the work, keep each agent apart, watch the cost and merge the results one at a time.
Every example below changes to fit what you pick. The businesses are made up for teaching.
The picture, one step at a time
Each box is one stage. The picture lights up as you scroll.
Many agents at once, from splitting the work to merging it
1Split the work
Tasks that touch different files, so no two agents edit the same thing.
2One workspace each
A separate checkout or cloud machine per agent, so their edits never mix.
3Limits on each
A budget, a time limit and a stop rule for every agent.
4One board
Who is doing what, what is done, what is stuck and what it has cost.
5One at a time into main
Each result reviewed and merged in turn, with the tests run again after each.
Side by side only when the files do not overlap.
Step 1 of 6
Split by files, not by ideas
Running many agents is like running a small team that never talks to itself. Without a plan, two of them edit the same file, one undoes the other, and the bill grows. So for the shop's site, split the work into tasks that touch different files. Anything that depends on another task waits its turn.
Step 2 of 6
One workspace each
Each agent needs its own copy of the code, on its own branch, so its half-made edits never break another agent's tests. On one machine, git's worktrees give you that: several folders, one repo, a different branch in each. In the cloud, each session gets its own machine anyway.
From git's own manual: "A git repository can support multiple working trees, allowing you to check out more than one branch at a time."
Two agents work in the same folder on different tasks. What goes wrong?
Step 3 of 6
A limit on each
Every agent starts with a budget, a time limit and a stop rule: after so many tries, stop and report. One agent stuck in a loop is a nuisance. Ten of them is a bill.
Anthropic wrote in June 2025 that its agents "typically use about 4× more tokens than chat interactions", and multi-agent systems "about 15× more tokens than chats". Count the cost before you scale up.
Step 4 of 6
One board
Keep one list: the task, the agent, its branch, its status (running, waiting for you, done, stuck) and its cost so far. Look at it at set times, not every minute. Your attention is the thing in short supply, and the board protects it.
Step 5 of 6
Into main one at a time
Review and merge each result in turn. After each merge, bring the next branch up to date with main and run the tests again. Two changes that pass on their own can still break together.
Step 6 of 6
Write the runbook down
Put the rules in a file in the repo: how many agents at once, which tasks qualify, the limits, who reviews. Then every session and every teammate runs the fleet the same way for the shop's site, and you can change the rules in one place.
How many agents should you run at once?
Side by side, or one after another?
Here are four jobs in your business. Side by side: the tasks touch different files and do not depend on each other. One after another: they share a file, or one needs the other finished first.
1Write product pages for 60 new items, each in its own file.
2Change how prices are stored, then update the checkout that reads them.
3Fix three unrelated bugs: a broken footer link, a typo on the returns page, a slow image on one product page.
4Two agents are both asked to tidy the same stylesheet.
0 of 4 right so far, 4 to go.
A fleet runbook
This is what you keep: the rules for running many agents at once, ready to put in a file in your repo.
A fleet runbook
- Only run side by side what touches different files. Anything that depends on another task waits.
- Give each agent its own workspace: a worktree or a cloud machine, on its own branch.
- Set a budget, a time limit and a stop rule for every agent before it starts.
- Keep one board: task, agent, branch, status and cost so far.
- Merge one at a time, and run the tests again after each merge.
- Run only as many agents as you can review properly.
The limit on a fleet is your review time, not the number of agents you can start.
Next: Lesson 8.3: From an issue to a pull request. How to write an issue an agent can finish on its own, and the checks between its branch and main.