nazax.com

Claude Code Orchestrator Pattern: One Hub, Many Builders

NAZAX · Last updated

The Claude Code orchestrator pattern is simple to state: one agent plans and dispatches, and other agents build. Running it well takes more than that sentence, so this article covers what the hub does, what goes into a brief, and where the pattern breaks. Our whole method rests on it.

What the hub does

The hub has four jobs: plan, dispatch, try and decide. It does not write feature code. A hub that builds fills its context with diffs and loses track of the plan, so anything that ends in a pull request goes to a builder.

The steps

  1. Read what exists. Start from the repository’s plan files, the open pull requests and the worktrees already in flight. Do not plan from memory.
  2. Split the goal into stages named for what they achieve. Each stage holds pieces that stand alone: they share no files, and none needs another’s result. If two pieces need each other, they are one piece.
  3. Ask the person only what the code and the rules cannot settle. Product choices, contracts and anything about production. Ask in one message, with a recommendation and the exact words to reply with for each question.
  4. Dispatch each piece with a brief (below).
  5. Pick the right kind of helper. A separate session suits a piece that ends in its own pull request or runs for a long time. A subagent suits a piece whose result you need in this turn, such as research, a script or a review.
  6. Try what comes back. Run the change on localhost, then record an ok, or send it back with the cause and a way to reproduce it.
  7. Hand finished work to one shipping step. Neither the hub nor the builders push. One shipping step turns landed changes into a pull request and merges it when CI, the review and the try all agree.

The brief

Most failures start with a thin brief. Ours has the same parts every time:

Task: add an empty state to the export dialog.
Why: users with no data see a blank panel.
Done when: the dialog shows the new text and a unit test covers it.
Area: src/export/ only. Do not touch the shared theme file.
Rules: use the editor tool, no scripted rewrites. Run quick checks
  for what you touched, nothing else. Get a review from a different
  model than yours. Never push.
Report: send me the URL and the steps to try it.

Why, done-when and area do the most work. “Why” lets the builder make sensible small decisions. “Done when” stops it from stopping early or going on forever. “Area” is the collision guard, and it is also how we keep builders in their own git worktrees without stepping on each other.

Limits that matter

At most four builders at once. Each builder session may run a dev server, and the laptop has a fixed amount of memory. The hub also has to try each result, and trying is the hub’s slow step.

One owner per branch. Only the builder that owns a branch commits there.

Nothing new goes to a running builder. A new ask gets its own small branch. Extra scope sent to a builder in progress is how a clean change turns into a tangled one.

Checks run in cheap subagents. The hub keeps its model for planning and the verdict. A fast, inexpensive model runs the test suite and returns a table; the hub reads the rows. Choosing which model runs what is its own topic.

What goes wrong

The brief is vague, so the builder widens the scope. The fix is almost always a sharper “area” and “done when”, not a smarter model.

Two builders edit the same file. The hub should name shared files in the briefs. Lockfiles, configuration and generated files are the usual ones.

The hub starts building. It happens when a task looks small. Resist it, or the plan goes stale while the hub is busy with a diff.

The approval gets relayed. Merging to production, publishing and credentials need a yes from the person, given in the session that will do the work. A hub cannot pass that approval to a builder; the permission check refuses it. Design the flow so the session that acts is the session that asks.

The hub trusts a “done”. A builder saying a change works is not evidence. The try on localhost and a review by a different model are.

When not to use it

For one small change in one file, a single session is faster. The pattern costs a plan, briefs and a try for every piece, and it pays back only when the pieces are independent and can run side by side. If you cannot split the work into pieces that share no files, do it in one session and use the pattern for the next, bigger task.

Questions

What is the Claude Code orchestrator pattern?

It is a way of running several Claude Code agents where one agent, the hub, plans the work and hands independent pieces to builder agents with written briefs. The hub tries the results and decides what happens next, while the builders write the code. The hub itself does not build features.

How many builder agents should one orchestrator run?

We cap it at four at once, and queue the rest. The limit comes from two places: the memory of the laptop that runs the sessions, and the hub's own capacity to try and judge what comes back. More builders mostly produce a backlog of unreviewed changes.

Should the orchestrator agent write code itself?

No, not feature code. Every diff it writes fills the context it needs for planning, and a hub that is busy building stops coordinating. It may run small scripts and tries, but anything that ends in a pull request goes to a builder with a brief.