tech

How to run 20 agents at the time

Do you want to maximize your AI output? Well, you can technically run as many agents as possible, but turns out it may not be that easy, nor a successful strategy.


Sandro Maglione

Sandro Maglione

Software

20 agents, can you do it? 🤔

Move aside the "should you do it", let get more practical.

What are the requirements and implications of running 20+ agents at the same time (for software development)? 👀

Let's see a few cases 👇


Do you review the code?

The first obvious implication of 20 agents is x20 code to review.

Now, the question becomes, do you even review the agent code? 🙌

If you do (as you should), then the bottleneck is not 20 agents, but you as 1 reviewer. You run 20 agents in no time, just to take the rest of the day to read code all over the place.

Technically possible, but good luck. You may be better off running 1 or 2 at the time at this point 💁🏼‍♂️

But what if you just don't read the code, do some manual QA, and release?

I tried that (for a few weeks), it gets ugly slowly, and then all of a sudden 🤯

This "strategy" works initially for a clean enough codebase. But each prompt left on its own introduces a small bad pattern. Those compound over weeks, and bugs start to become the norm.

Even faster if you can manage 20+ agents for hours everyday full time 😬

If maintainability over a medium-long term is a concern, not reviewing is a failing strategy (with today's AI generation) 🙌

What about conflicts?

Then there is the question of what those agents are working on.

If most of them are running on the same codebase, then it's no more "just" reviewing, it's also resolving conflicts.

If not the same codebase, then the question becomes: why 20 projects at the same time? 💁🏼‍♂️

How do you write your prompts?

Another problem is being so skilled to spawn 20 agents in parallel.

It all depends on how detailed are you prompts, and how big the feature to implement:

A good prompt for an average feature (not small fix, not a big new feature) requires some level of effort in pointing at references and detailing a few specs 🏗️

For me, it can take up to 10 minutes to write a single well defined prompt: define the issue, define the intended solution, point to reference files, list some assumptions and things to avoid.

Of course, for running 20 agents, prompts must be way shorter and faster ⚡️

You can point to a spec.md file and say "Do the next task" 20 times.

"Do the next task" only works if the spec is already broken down into precise, non-overlapping, acceptance-testable tasks. Good luck with that as well 🙌

If agent 3 learns that the original plan is wrong, how do the other 19 know? You need a shared log, updated spec, or human coordinator 🤯

Or you can just write "Do this, don't make mistakes" 20 times (fast enough so that the first agent does not finish before you).

If an agent takes on average 2 minutes for prompt, then you have 6~ seconds to write each prompt, go! ⚡️

If the average task takes 5 minutes, you need to write each prompt in about 15 seconds. At 10 minutes, 30 seconds. At 20 minutes, 1 minute.

Anything slower, and the first agent is already done before the 20th even starts.


All the above assumes you have a decent setup of linting/types/testing in your codebase.

Otherwise 20 agents will just step on top of each other, with no way to verify if anything at all makes sense.

All this to say: 20 agents theoretically works, and good luck with it 🫡


A few things can increase your output: being a good engineer, understanding the product and the codebase, and having solid types and linting.

Focus on those 🤝

See you next 👋

Start here.

Every week I dive headfirst into a topic, uncovering every hidden nook and shadow, to deliver you the most interesting insights

Not convinced? Well, let me tell you more about it