Session 07

Orchestration·and subagents

Program
Agentic engineering
With
Arndt Voges
From
Arndt Voges Consulting
Where
Remote

Several agents at once

OrchestrationHands onClose

50 min orchestration, 25 min hands on, the rest together

0:00
Orchestration
0:50
Break
0:55
In the session·start one ultracode run on your own repo before you leave
1:20
Homework, close
1:30
End

PSA: Opus 5.5 and Claude Code write tests aggressively on their own now.
That can work against you.

Treat writing tests as seriously as writing code, and spend as much thinking on them. Do not let the model do that thinking for you.

Feedback I hear from dev and QA

AI review

“It always finds something, and half of it is irrelevant.”

What I would do> Review PR #87 against its ticket and our REVIEW.md. Have three agents try to refute each finding, and post only what survives.

Tickets

“What should a ticket look like, so an agent can build from it?”

What I would do> Take ticket #114, run a spike to gather all details necessary, and interview me in depth about the exact goal and scope so we can refine it together. Then save the edits to Jira.

Big tasks

“On big tasks it ends up fixing its own fixes.”

What I would do> Stop fixing. Write a plan that splits this into independent pieces, each with its tests first, then build each piece with a fresh agent and verify it separately.

Where we are

  1. 01Core concepts
  2. 02Preparing the codebase for agents
  3. 03Writing a good spec
  4. 04Feedback loops
  5. 05Workflow integration and code review
  6. 06Claude Code in depth
  7. 07TodayOrchestration and subagents
  8. 08Claude Code alternatives, your system anywhere, and what the future holds“Why Claude Code this entire time?”
One tool, several agents. Everything so far is the precondition.

You helped Claude operate autonomously.
Today you learn to run dozens of Claudes …

… while you are in a meeting.… while you are at lunch.… while you are asleep.… when a ticket comes in.… from your 📱.

What we cover today

Subagentfan outSpec/workflows
ultracodeWorkflow
Agent teamgateWalk away/batch
ContractWorktreeVerifier

Three parts, then you start a run

Part one · Fundamentals

The ladder from one Claude to dozens, and what each step adds.

Part two · Getting started

My workflow in five steps and a gate, and how to start it this week.

Part three · In Claude Code

Each step on screen, my workflow under the hood, and a live run.

Hands on

You start one ultracode run on your own repository before you leave.

Part one

Thefundamentals

Five steps from one Claude to dozens, each built on the one before.

The ladder: from one Claude to dozens

StepWhat it isIts strength
One sessionOne Claude, one context window, you steering.Full control over every step.
/batchOne change split across parallel agents, each in its own worktree.Many independent edits at once, one pull request each.
SubagentsHelpers with their own context, called by Claude.A clean main session, roles built for one job, work in parallel.
WorkflowsA script Claude writes that runs dozens of subagents.A plan that cannot drift, checked findings, a run you can repeat.
Agent teamsPeer agents with one task list who message each other.Parts that have to agree while they are being built.
Each step answers the limit of the one before. Climb only as far as the task needs.

One session one Claude, one context, you steering

YOU steer every step prompt answer ONE SESSION one Claude, one context window the reading: files, searches, logs the work Everything it reads stays in the window. One agent works one step at a time. Reading crowds out the work, and one agent only goes so fast.
Pros
  • You see and steer every step.
  • Nothing to set up.
Cons
  • Everything it reads fills the one window.
  • One agent works one step at a time.
  • Does not scale with your ambitions.

Subagent a helper with its own context

MAIN SESSION your conversation system prompt, CLAUDE.md, your task, one page back from the subagent Plenty of room left. SUBAGENT its own context, one narrow job reads 50 files, runs 20 searches all of it stays here Nearly full, and that is fine. the task one page The search results never enter your conversation.
Pros
  • A fresh context, built for one job.
  • Several at once, and your session stays clean.
Cons
  • They don't talk to each other.*
  • The plan lives in Claude's head, turn by turn.
  • At dozens of helpers, nobody checks their work.

* Not as peers. A subagent can start or resume another one, but each reports back to whoever called it.

Workflow the plan, written as code

THE SCRIPT written by Claude phase('Find') parallel(areas) phase('Verify') parallel(findings) phase('Merge') The plan, fixed up front. FIND one agent per area cart vouchers tax returns VERIFY three skeptics each finding 1: 3 checks finding 2: 3 checks finding 3: 3 checks finding 4: 3 checks MERGE only what survived one report The same subagents as before. The plan now lives in code.
Pros
  • The plan is code, so it cannot drift and it runs again.
  • With a verify step, agents check each other first.
Cons
  • The plan is fixed before the run starts.
  • Agents cannot work things out with each other.

What if Claude wrote that script
for every task you give it?

It takes one word.You write no script.Dozens of agents run it.
🤯

Of course you can … enter:

Ultracode

One word, and Claude plans
a workflow for the task.

Type ultracode in a prompt for one task, or /effort ultracode for every substantive task in the session. You decide where it is switched on. On Pro, switch on Dynamic workflows in /config first.

Ultracode under the hood, explained like you are five

A recipe first

Claude first writes down who does what, and who checks it.

Many cooks

Helpers cook in the background while you keep working.

Nobody waits

Each dish moves on when it is ready, not when the slowest cook is done.

The same form

Every helper reports on the same form, so the answers can be compared.

Only the dish

The notes stay in the kitchen; you only see the finished dish.

By default Claude uses fewer than 10 helpers. Ask for more in your prompt when the job is big.

Ultracode's phases: each one is its own workflow

1 Understand

Readers map the parts of the code the task touches, in parallel.

2 Design

Several agents draft approaches, and judges score them.

3 Build

One agent per piece, each in its own worktree when they edit files at the same time.

4 Review

Finders look for problems, and three skeptics try to refute each finding.

5 Check

A critic asks what is missing, and finders run until nothing new turns up.

The highlighted stages are adversarial. Agents try to prove other agents wrong.

Why ultracode is a leap

Scale

Dozens of agents when you ask

The default aims for fewer than 10; a sweep or a migration can ask for more.

Trust

Checked before you see it

With a verify step in the script, independent agents try to refute each finding first.

Focus

You stay out of the weeds

The plan and every intermediate result live in the script, not in your conversation.

Repeatable

The plan is a file

Save a good run as a command and the team reruns it by name. A paused run resumes.

Until now, you were the orchestrator. With ultracode, you review the plan and the result.

Agent team peers with one task list

LEAD your session, sets up the team API-DEV builds the endpoint UI-DEV builds the form TEST-WRITER writes the contract tests messages messages SHARED TASK LIST ✔ contract agreed ■ endpoint ■ form □ wire them up
Pros
  • Teammates settle open questions with each other.
  • Parts that must agree are built together.
Cons
  • Experimental, and off by default.
  • One shared checkout, so you split the files yourself.

Why agent teams are a leap

Debugging

Rival theories

Each teammate chases a different cause and tries to disprove the others, so nobody settles on the first idea.

Cross-layer

Parts that must agree

API, form and tests each have an owner, and the owners settle the interface between themselves.

Review

Several lenses at once

Security, performance and test coverage each get a full reviewer, and the reviewers compare notes.

Teams need CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 and a request. Ultracode never starts one. Start with three to five teammates on a review or a bug hunt.

Workflow or team: what changes for your team

A workflow (ultracode)An agent team
Talking to itAsk Claude for status any time; it reads each agent's result as it lands.Talk to the lead, or open any teammate and talk to it directly.
Changing courseClaude stops the run, edits the script and relaunches; finished agents are reused.The lead replans turn by turn, and it may do the work itself or drop the team.
Reaching one agentNot possible: messaging a running agent starts a second copy of it.Possible, but a busy teammate reads it after its turn, unless you interrupt it.
Shared filesAgents get their own worktree only if asked; otherwise they share the checkout.Teammates share one checkout, so give each its own files or they overwrite.
Ready todayOn all paid plans and in claude -p.Experimental and interactive only; resume does not bring teammates back.
My advice: try ultracode first. Reach for a team only when agents must argue while they build.

Part two

Gettingstarted

The workflow I use every day, in steps your team can copy this week.

I decide everything that can be decided before any code exists.
Then many agents build against a contract, and nothing counts until an independent agent checked it.

I make the product decisions and say go once. Claude makes the engineering decisions and writes them down.

The workflow: five steps and a gate

1 Spec

Write what you build and what is out of scope, with acceptance criteria.

2 Interview

Claude surveys the code, then asks you only the product questions.

3 Plan

A workflow writes the engineering plan, and critics attack it before any code exists.

4 Go

You read the defaults and the test plan. Nothing is built before your go.

5 Build

A contract freezes the shared interfaces and the failing tests; then builders work in parallel, each with its own verifier.

Then the gate, one command that runs every check, decides the release. Your time goes into steps 1, 2 and 4.

Steps 4 and 5 are yours

4 Go

Read the test plan

Every acceptance criterion has a test, and each test would fail if the feature were wrong.

5 Contract

Own the failing tests

They are committed before any builder starts. They are the definition of done.

Gate

Decide what to integrate into your test suite

My preference is everything. The gate runs the whole suite before every release.

You move from testing after the build to defining done before it.

Start this week, without any plugin

claude
> ultracode: survey the code that specs/07.md touches, then
  interview me: product questions only, your recommendation first

> ultracode: write the engineering plan under the spec, with a test
  for every acceptance criterion, and have critics attack it

  # read the plan, change what you disagree with, then:
> go. ultracode: tests first from the plan, then build in parallel,
  give each builder its own files, and have an independent
  agent verify each part
Each prompt starts a workflow you can watch in /workflows. The interview and your go happen in the conversation between them.

What your repo needs first

✓CLAUDE.md

Commands and safety rules

How to run every test, and what agents must never do, such as commit or read secrets.

✓specs/

One file per feature

Each spec has a status: draft, ready, building or done.

?Tests

A suite every agent can run

One command, fast enough that every agent runs it in full.

You built the first two in sessions 02 and 03. The plugin offers to add what is missing.

Then make it repeatable: the plugin

claude
/plugin marketplace add arndtvoges/rocky-plugins
/plugin install spec-to-ship@rocky-plugins

> here is spec 07, let's build it
It is one skill: the method written down, read step by step. Claude adapts its workflow templates to each spec, and refuses to run without the Workflow tool.

Part three

Using it inClaude Code

Each step in practice: the commands, and what it looks like.

How to think about subagents (1/2): roles

architect

Checks a plan against the design before any code.

code-reviewer

Reads the diff with fresh eyes and the review rules.

security-reviewer

Looks for secrets, injection and missing permission checks.

test-engineer

Turns the acceptance criteria into tests.

tech-writer

Keeps the docs and the changelog in step with the code.

design-reviewer

Compares the build against the Figma design.

This maps traditional engineering roles. Each has its own context, tools and instructions, like a colleague with one job.

How to think about subagents (2/2): tasks

ticket-refiner

Turns a rough ticket into a spec with acceptance criteria.

dependency-updater

Bumps one dependency and fixes what breaks.

migration-planner

Plans a schema or API change across services.

incident-triager

Collects logs, recent changes and likely causes.

coverage-auditor

Finds the code paths no test reaches.

release-notes-writer

Writes the notes from the merged pull requests.

This maps the tasks an engineering org has to do. Recurring work becomes a subagent the whole team calls by name.

Write these subagents

test-writer

Writes tests from the acceptance criteria and never reads the implementation.

breaker

Tries to break the change and reports how, without editing the code.

explorer

Clicks through the app in a browser; in my epic, it caught an undersized button.

Your test heuristics become their instructions. That is how QA scales to dozens of agents.

Custom subagents

.claude/agents/checkout-reviewer.md
---
name: checkout-reviewer
description: Reviews changes under src/checkout/ against our rules
tools: Read, Grep, Glob
model: opus
---
Review the diff against docs/standards/checkout.md.
Report only findings that affect correctness or the spec.
Only name and description are required. Read, Grep and Glob keep this reviewer read-only.

Subagents at work: the reading stays out of your session

~/shop · claudeIllustrative
> review my voucher change before I open the PR
● I will have the checkout reviewer read the diff while Explore finds every caller.
● checkout-reviewer(Review the voucher diff against our rules)
⎿ Done (14 tool uses · 38.2k tokens · 1m 12s)
● Explore(Find every caller of applyVoucher)
⎿ Done (23 tool uses · 51.7k tokens · 48s)
 
● Two findings, both from the reviewer:
1. A 100 % voucher plus free shipping makes the total -0.01 €.
2. No test covers a voucher on a reduced item.
Explore found four callers; only the cart and the checkout need the fix.
The subagents read 90,000 tokens. Your session gets back two findings and one sentence.

You type ultracode, Claude writes the workflow

~/shop · claude
> ultracode: audit src/checkout/ for every way a voucher can make a total negative

// Claude writes voucher-audit.js and starts it:
phase('Find')     // six agents, one per area      ⋯ 3 lines
phase('Verify')   // three skeptics per finding    ⋯ 3 lines
phase('Report')   // one agent writes it up        ⋯ 1 line
You read it, you do not write it. Once it works, save it, and the team runs it by name.

Then you watch it in /workflows

~/shop · claudeIllustrative
voucher-audit Every way a voucher makes a total negative9/25 agents · 6m 41s
Phases
1 Find 6/6
❯ 2 Verify 3/18
3 Report 0/1
Verify · 18 agents
● verify:stacked-vouchers #1Sonnet 5.5 · 41.2k tokrefuted
● verify:stacked-vouchers #2Sonnet 5.5 · 38.9k tokconfirmed
● verify:stacked-vouchers #3Sonnet 5.5 · 44.0k tokconfirmed
● verify:return-after-voucher #1Sonnet 5.5 · 22.4k tok1m 03s
● verify:return-after-voucher #2Sonnet 5.5 · 19.7k tok58s
… 13 more
↑↓ select · enter drill in · f filter · p pause · x stop · s save as command
Six finders, then three skeptics per finding. Two of three confirm the stacked-voucher bug, so it goes into the report.

Worktrees: one folder and one branch per agent

~/shop · zshIllustrative
~/shop $ claude -w voucher-fix
✻ Claude Code .claude/worktrees/voucher-fix · branch worktree-voucher-fix
> fix the stacked-voucher finding from the audit, test first
● Wrote vouchers.test.ts: one new test, red.
● Changed vouchers.ts: the new test is green, 212 of 212 pass.
> /exit
Worktree voucher-fix has 2 changed files. ❯ Keep Remove
Resume with: claude --worktree voucher-fix --resume
~/shop $ git worktree list
~/shopa1b2c3d [main]
~/shop/.claude/worktrees/voucher-fixe4f5a6b [worktree-voucher-fix]
Files git ignores are not in a new worktree. List .env.local in .worktreeinclude and they are copied in.

/batch: one change, many worktrees

~/shop · claudeIllustrative
> /batch move every price format in src/ to formatPrice()
● Researched 214 files. The plan: 12 independent units, one per folder.
checkout · cart · wishlist · account · returns · search · … 6 more
Run 12 background agents, one worktree each? ❯ Yes No
 
✔ checkout9 filestests passPR #4812
✔ cart7 filestests passPR #4813
✔ wishlist4 filestests passPR #4814
✻ account6 filesrunning the tests
✗ returns5 files2 tests fail, fixing
… 6 more · 3 of 12 done
A built-in skill for one change: Claude splits it and you approve the plan. One background subagent per unit works in its own worktree.

Agent teams: teammates who talk to each other

~/shop · claudeIllustrative
> build voucher redemption as a team: one for the API, one for the form, one for the tests
● Team voucher-redeem: api-dev, ui-dev, test-writer
● Tasks (2 of 5 done)
✔ Agree on the voucher contract
✔ Contract tests in place, all red
■ POST /vouchers/redeem · api-dev
■ Voucher field in the checkout form · ui-dev
□ Wire the form to the API · blocked
❯ api-devWriting POST /vouchers/redeem
ui-devAsked api-dev: is an expired voucher 409 or 422?
test-writeridle
↑↓ select · enter open · x stop
Enter opens a teammate so you can talk to it directly. Ctrl+T toggles the task list, and x stops a teammate.

The right model for each job

JobSettingWhy
Advisor/advisor opusA cheaper main model asks Opus at the hard decisions.
Subagentmodel: haiku in its frontmatterSearch and summaries do not need the big model.
Workflow agentsName the model in your promptOtherwise dozens of agents run on your session model.
Effort/effort, or effort: in a skillLow for the many, high for the one hard turn.
Dozens of Claudes means dozens of bills. Put the expensive model where the decisions are.

Check in on a long run

/remote-control

The same session on your phone or in a browser. Subagents and workflows stay in sync.

Push

A notification when a long task finishes or needs a decision from you.

Every session

Turn on Enable Remote Control for all sessions in /config.

Sleep

If the laptop sleeps, it reconnects when the laptop wakes up.

The session still runs on your laptop. On Team and Enterprise, an Owner switches it on first.

My workflow under the hood

StepIn spec-to-ship
SubagentsEvery reader, writer, critic, builder, verifier and fixer.
WorkflowsThe skill tells Claude when to run one; six templates are its starting points.
PipelinesEach workstream moves through build, verify and fix on its own, without waiting for the others.
SchemasReports and verdicts come back structured, so a fix loop runs only on blockers and majors.
WorktreesNot used: one shared tree, disjoint file ownership, and agents never commit.
Agent teamsNot used: the contract and the ownership table settle the questions before anyone builds.
This is the workflow-or-team table in practice. Where a contract settles the questions up front, a workflow does the job.

What it looks like: three workstreams at once

~/app · claudeIllustrative
● Workflow(Build: parallel workstreams, each tests first, build, verify, fix)
⎿ Running in background · /workflows to monitor and save
build-workstreams each: tests first, build, verify, fix twice at most7 agents · 41m
Phases
❯ 1 Workstreams
7 agents
Workstreams
● WS-A:buildbackend · 18 tests red, then greendone
● WS-A:verify1re-ran the full suitepass
● WS-B:buildAI · 9 tests red, then greendone
● WS-B:verify1scratch tests for races4m 12s
● WS-C:buildfrontend · 14 tests red, then greendone
● WS-C:verify1phone width, light and dark2 majors
● WS-C:fix1touch targets, overflow2m 40s
↑↓ select · enter drill in · f filter · p pause · x stop · s save as command
Each workstream moves on its own. The frontend is in its first fix round while the AI verifier is still checking.

One real epic my time and Claude's time

2 INTERVIEW 3 PLAN 4 GO 5 BUILD ME CLAUDE four answers go plan and critics 90 min contract 50 min backend AI frontend integration, five lenses 2.4 h survey in parallel, 65 min gate Claude's blocks are to scale. Step 1, the spec, came from the PM.
Approach: my workflow combined with ultracode.

Claude time!

Where orchestration stops paying

Review time

It grows faster than the time saved

Five pull requests that nobody has time to review are worse than one.

Dependencies

The tasks were not independent

Parallel agents on tangled work produce parallel guesses.

Tokens

Cost multiplies with every agent

Size the run on one folder first, then widen it.

Switch ultracode on for work that splits into independent, specified tasks. Leave it off for tangled work.
In the session

Start a run before you leave.

Every team · your own repo · one ultracode run · check it on your phone tonight

your repo, before you leave
claude --rc

> ultracode: survey the code that specs/<yours>.md touches,
  list the product questions, and verify each finding
Example homework, to be tailored to your team

Homework: three tasks

Team build

One ticket, three prompts

Pick up the run you started today and take the ticket through the other two prompts. Bring the /workflows screen and your review time.

Experiment

One subagent for your team

Write a read-only reviewer with your team's review rules, and bring two diffs it reviewed.

Cross-team

Install and break

Install spec-to-ship, run it on a small spec, and report what broke.

Do all three. They should not take you much time, because the 🤖 does the work. That's the point!

Your homework variant: swap the second card.

Write the verifier your builders have to get past. Point it at one real pull request and bring what it caught.

One more thing: your workflow, in your pocket

/remote-control

Remote Control on a phone, showing a running workflow with its Build and Verify phases
Did you get this approved?

Next session, the last one:
Claude Code alternatives.

Arndt Voges Consulting · hello@arndtvoges.com · arndtvoges.com

<stop>