DEV Community

SecondShiftDev
SecondShiftDev

Posted on Edited on Originally published at youtube.com

I Run 4 Coding Agents at Once: My Full Orchestration Setup

I Run 4 Coding Agents at Once: My Full Orchestration Setup

Watch the video version here: I Run 4 Coding Agents at Once: My Full Orchestration Setup (8 minutes, 9 seconds). This article is the written version of the same system, with the pieces laid out so you can copy the parts that fit your setup.

The problem is management, not models

Leave one AI coding agent alone for an hour and you get a chaotic intern. Fast, eager, weirdly confident, and every so often completely wrong. Leave four alone together and they overwrite each other's work, duplicate each other, and burn your token budget arguing about who is right.

I run four coding agents at once: Claude Code, Codex, Antigravity, and Hermes. None of them runs unmanaged. This is the full setup: how the team is cast, how work gets briefed, where the money goes, and why nothing ships until it has been checked. It is about managing agents like a team, not about which model is best.

1. The cast: one orchestrator, the rest are workers

Rule one: not every agent gets to be a general purpose coder. I run one orchestrator and a handful of workers, and they are not interchangeable.

The orchestrator is the only agent I actually talk to. Its job is not to write the most code. Its job is to break a goal into tasks, pick which worker gets each one, and review whatever comes back. Tech lead, not typist.

Workers get exactly one assigned task each. One tool takes an architectural change, another takes the boilerplate, a third knocks out a quick prototype. A worker does not need the ten thousand foot view. It needs a brief it cannot misread.

Splitting the thinking from the doing is the whole trick. It is what keeps agents from wandering off into a big codebase and getting lost.

2. Roles before tools

The mistake I see everywhere in this space is model chasing. A new tool drops, everyone switches, and the same process problems follow them to the new tool.

In a multi agent setup, the role matters more than the model. Every time.

Roles are defined by the work. A refactorer reduces complexity without changing behavior, and that is all it does. A test writer writes tests, and it is flatly not allowed to fix the code it is testing. A feature implementer builds to a spec. Hand a refactoring job to an implementer and it will helpfully add a feature while it cleans up. Now your cleanup has a bug in it.

The useful part is that tools can swap in and out of a role whenever pricing or performance changes. The role and its boundaries stay put. That is what makes this a system instead of a pile of prompts glued to one model.

3. The packet: briefs an agent cannot misread

Open ended prompts are where agents drift. So I do not send prompts anymore. I send packets.

Every task that goes from the orchestrator to a worker is a self contained brief, and it always has the same five parts:

  1. Goal. One sentence. What done looks like.
  2. Context. The specific files, signatures, and constraints that matter. Not the entire codebase dumped in for luck.
  3. Steps. The sequence I expect the worker to follow.
  4. Output format. Exactly what comes back: a diff, tests, a summary, in a stated shape.
  5. Verification. Stated up front, so the worker knows from the start that its work will be tested, not trusted.

A good packet has a simple test: a worker with zero memory of the conversation could run it cold. When a worker fails, I do not type "try again" and cross my fingers. I fix the packet. Nine times out of ten, the failure was in the brief, not in the model.

4. Cost routing: pay for judgment, not for typing

Run four agents on top tier models for everything and you will set money on fire. Work gets routed by how much judgment it actually needs, not by habit.

The bulk work goes to fast, cheap models: docs, type updates, boilerplate, first drafts, summaries. That work is pattern matching. A premium model does not do it better, it just does it at three times the price. Premium models are saved for the orchestrator, for design decisions, and for hard debugging.

I track spend per task too. When a simple refactor costs more than a feature build, the agent is stuck in a loop or the packet was bad. Cost is a diagnostic. Treat it like one.

5. Verification before trust

This is the load bearing wall of the whole setup. Nothing merges because a worker says it is done. Agent output is guilty until proven innocent.

Verification happens in three stages:

  1. Tests. The worker ships tests with its code, runs them, and reports the real output. Failures included. Especially failures.
  2. The diff. No agent commits straight to the main branch, ever. Every change shows up as a readable diff that a person can actually inspect.
  3. A reviewer agent. A different model from the one that wrote the code, read only access, one job: find what is wrong. The reviewer does not share the author's blind spots, which is exactly the point.

That last stage catches the failure mode these tools specialize in: confident, polished, completely wrong output. A worker's report is a claim. Tests and diffs are evidence. Run on evidence.

6. Rules in CLAUDE.md, not in chat history

Agents forget. Context windows end, sessions restart, and a fresh session on one machine knows nothing about what another machine figured out yesterday. The fix is boring and it works: a written project brief that every agent reads at the start of every session. In Claude Code that file is CLAUDE.md.

Mine has four kinds of content:

  • The exact commands to build and test, written as "run these, not guesses."
  • The conventions that actually matter for that project.
  • The boundaries: what never gets edited, what never gets logged, where the secrets live.
  • A definition of done, so "done" stops being a matter of opinion.

I am picky about what goes in. Rules of the game, yes. State of the game, no. Current state lives in the code and the task list, where it stays current on its own. And the file stays short enough that an agent will actually read all of it. Do that, and the same rules greet every agent, on every machine, every session.

Why this exists: the honest failure

Early on I pointed two agents at one bug, with no roles, no packets, and no reviewer, and told them to collaborate. One changed the code. The other reverted it and applied its own fix. Then the first one reapplied its version. Back and forth they went, both confident, both documenting their reasoning, and the code ended up worse than where it started. Plus a token bill for the privilege.

More agents had just made more noise. Every piece of this system exists because that afternoon showed it had to.

Get the Starter Pack

The free Multi Agent Starter Pack is the three CLAUDE.md templates from this system plus the one page orchestration checklist I run before any multi agent session:

The video version of this article is here if you want to see the setup walked through: https://www.youtube.com/watch?v=hUVGVdimCRw

The day job ends. The agent team clocks in.

Second Shift Dev

Top comments (13)

Collapse
 
rodrigo-duarte profile image
Rodrigo Lemela Duarte •

"Leave four alone together and they overwrite each other's work" is why our setup ended up close to yours: one manager agent splits the work into one card per task with a single owner, each coding agent works in its own clone and branch with one PR per card, and before anything merges the manager checks it against staging and the other open PRs with git merge-tree. The difference is where the talking happens. Instead of the orchestrator being the only one you talk to, the agents and the people share a room in agent-chat, which is what we build: each agent is woken when it's mentioned, reviewers answer in the room, and decisions come to you there. With four agents going, how do you see what's waiting on you: does everything come back through the orchestrator?

Collapse
 
secondshiftdev profile image
SecondShiftDev •

Yes, everything comes back through the orchestrator. It is the only agent I talk to, and it reviews whatever comes back before I see it. That is deliberate: one place where status lives, instead of four agents each reporting their own version of done. The shared-room setup is interesting, and the merge-tree check before anything lands is a solid guard. How do you keep the room from turning into a second inbox when all four agents are talking at once?

Collapse
 
rodrigo-duarte profile image
Rodrigo Lemela Duarte •

That makes sense: one voice, and it's already reviewed by the time it reaches you. One correction on my side: the merge-tree check is against staging, not against the other open PRs. Our rule: before each merge, the manager builds the tree staging would have with that PR and runs the full suite on it; a PR that no longer merges cleanly goes back to its owner. On the second inbox: we ask agents to flag decisions that need my input with a mention, one decision per message, with options and a recommendation. Does your orchestrator ever send work back to an agent before you see it, or does it mostly summarize?

Thread Thread
 
secondshiftdev profile image
SecondShiftDev •

Good correction, thanks. And yes, the orchestrator sends work back. That is what the review step is for: if verification fails, the work goes back to the worker with a fixed packet, and I only see it once it passes. I mostly see the reviewed result, not the raw output. The mention rule is a good one too. One decision per message, with options and a recommendation, keeps the room from becoming a second inbox.

Thread Thread
 
Sloan, the sloth mascot
Comment deleted
 
rodrigo-duarte profile image
Rodrigo Lemela Duarte •

good to hear the work goes back before it reaches you.

Thread Thread
 
secondshiftdev profile image
SecondShiftDev •

Exactly. The send-back is the part that makes the rest trustworthy, since nothing reaches me unreviewed. Thanks for the detailed thread, and good luck with the shared-room setup.

Collapse
 
paul_irolla_6b5ae261d0224 profile image
Paul Irolla •

Tokenade is my token-cost tool for agents, and the cheap routing is where I'd look first. A cheaper worker only saves money if the verification step catches its mistakes before merge. Otherwise the saving comes back as a second pass by the expensive model.

Collapse
 
secondshiftdev profile image
SecondShiftDev •

Good point, and that is exactly how the reviewer stage earns its keep. A cheaper worker only saves money if verification catches the mistakes before merge, and that is what the reviewer checks in the diff. Cost per task is how I spot it early. If a cheap worker starts burning a second pass by the expensive model, the cost per task jumps and the routing is wrong for that task.

Collapse
 
appsbymo profile image
Apps by Mo •

One line I’d add to your packet: the files the worker will touch. In my setup each part of a job lists them, parts whose paths overlap run one after another, and a part only starts when the earlier one has reported done. That takes care of the overwriting you describe without the orchestrator having to think about it each time. How do you handle two workers that turn out to need the same file halfway through?

Collapse
 
secondshiftdev profile image
SecondShiftDev •

Good addition. Listing the files each part touches is exactly what the Context section of the packet is for, and it is what lets the orchestrator spot the overlap before the work starts. When two workers still end up needing the same file halfway through, that is a packet failure, not a model failure. The fix is in the packet, and the reviewer catches whatever slips through in the diff before anything merges.

Collapse
 
steven_mock_afbb801174fc3 profile image
Steven Mock •

The packet idea is the part I'd steal first. A one-sentence definition of done, the exact files and constraints, and how the work will be verified — that's just a good work order, and it's what keeps an agent from "finishing" something that isn't actually finished.

I also like roles before tools. In a small operation you don't hire four generalists and hope they sort it out; you give each person one clear job and one person owns the outcome. The reviewer-agent stage is the same as having a second set of eyes before anything goes live — confident and wrong is the expensive kind of wrong. Thanks for including the cost-per-task tracking too. That's usually the first thing people skip, and the first place waste shows up.

Collapse
 
secondshiftdev profile image
SecondShiftDev •

Thanks, Steven. The packet is the piece I would steal first too. The definition of done is what stops an agent from calling something finished when it is not. Cost per task is the part I almost left out, and it turned out to be the earliest warning when a worker is stuck in a loop.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.