Chapters
← Claude Code 101

Execution: running a multi-agent build

Turn an approved plan into shipped code with TDD, a diagnosis loop, and parallel subagents merged behind acceptance gates.

You will learn

  • The constraint under it all. Agents measurably degrade as the context window fills, so work is cut to fit the smart zone
  • Why I run user-invoked skills from mattpocock/skills instead of auto-firing collections like superpowers
  • Why the smallest unit of execution is a vertical tracer-bullet slice, not a horizontal layer
  • How to run red-green-refactor so tests describe behavior, and how to build a feedback loop first when something breaks
  • How an orchestrator doc dispatches waves of parallel subagents in git worktrees, merged behind acceptance gates

Planning is done. You have a broken into , and the grilling has already happened. That's why the plan doc exists. This chapter turns that doc into merged, tested code without losing the thread across five agents working at once. Jargon arrives fast here, so dotted terms like explain themselves on hover, or on tap on a phone.

The claim underneath everything here is measurable. Across 29 days I logged 241 sessions and roughly 1,470 hours of agent runtime, shipping +109k / −9.5k lines with 88% of classified tasks mostly or fully achieved. About 24% of messages were across parallel Claude sessions. None of that works without the discipline below. Volume without gates is just a faster way to make a mess.

Why break work down at all#

Everything in this chapter is downstream of one fact: an agent gets less capable as its fills, long before the window is actually full. Matt Pocock, whose workflow this track borrows heavily, calls the early stretch the smart zone and everything after it the dumb zone, a framing he credits to Dex Horthy of HumanLayer. Roughly the first 40% of the window is sharp; after that, confusion and mistakes creep in.1 In his AI coding workshop he puts the practical marker around 100k no matter how big the advertised window is: "It starts to just get dumber."2 His written definition hedges the number, not the effect: the dumb zone "commonly begins around 125K-150K tokens — though this is debated."3

The boundary is debated; the cliff is corroborated. Chroma's Context Rot study measured 18 frontier models and found accuracy degrades, unevenly, as input grows even on tasks the same models ace with short input.4 Anthropic's own engineering guidance describes an "attention budget" that every token in the window draws against.5 And Pocock's recovery rule is the line worth memorizing: "You recover by removing context, not adding more."3

That is the entire logic of breaking work down. Slices are small so one agent can plan, build, and test a slice while staying deep in its smart zone. exist so heavy reading happens in someone else's window and comes back as a summary. Docs carry memory between sessions, which is chapter 3's whole subject. And gates exist so you can stop, merge, and restart fresh instead of nursing one long, degrading conversation.

The toolkit: skills you call, not skills that fire#

The workflow runs on . Mine come from mattpocock/skills, the same library behind the grilling in the previous chapter: and to reach shared understanding, to lock it into a spec, to cut the spec into tracer-bullet , and during the build. One install and they show up as slash commands.

What makes this set distinctive isn't any individual skill. It's that every one is user-invoked: nothing happens until you type the slash command. The best-known alternative, Jesse Vincent's superpowers, takes the opposite bet.7 A session-start hook teaches Claude to search the skill library itself and to use any skill it judges relevant, so the brainstorm-plan-implement process engages on its own the moment you describe a task.

Auto-firing has real advantages. The process runs even when you forget to ask for it, it's uniform across a team, and superpowers is impressively built: the bootstrap costs under 2k tokens and the skills are adversarially pressure-tested. The costs are the mirror image. Ceremony fires whether or not the task deserves it, so a two-line fix can summon a planning interview. And when a session goes sideways, it's hard to tell which auto-loaded skill steered it there. Pocock's version of that critique is aimed at process-owning frameworks like GSD, BMAD, and Spec-Kit rather than at superpowers, but it's the same trade: they "take away your control and make bugs in the process hard to resolve."8

I stay on the user-invoked side because it keeps the process legible. I decide when a task deserves the full grill → spec → tickets treatment and when it's a two-minute edit. When output goes strange, I know exactly which skill was in play. And because I reach for each skill deliberately, the method sticks: I'm learning a workflow, not riding one. The rest of this chapter is that workflow's execution half.

Slice, don't layer#

The unit of execution is a vertical : one thin path through the whole stack that actually runs, not a horizontal layer you finish before starting the next. A slice is sized for one agent, small enough to finish well inside the smart zone. Write one test, make it pass, repeat, and let each test respond to what the last one taught you.

The anti-pattern is writing every test first and then all the implementation. Tests written in bulk verify imagined behavior. They test the shape of your data structures instead of what a user can do, and they pass while real behavior breaks.

markdown
WRONG (horizontal):
  RED:   test1, test2, test3, test4, test5
  GREEN: impl1, impl2, impl3, impl4, impl5

RIGHT (vertical):
  RED → GREEN: test1 → impl1
  RED → GREEN: test2 → impl2
  RED → GREEN: test3 → impl3

Red, green, refactor#

Good tests exercise real code paths through public interfaces. A test named user can checkout with valid cart tells you what capability exists, and it survives a refactor because it doesn't care how the code is structured internally. If renaming a private function breaks a test, that test was coupled to implementation. Treat it as a warning sign, not a passing grade.

The loop each slice runs:

bash
# 1. RED: write the test, run it, watch it fail for the right reason
npm test -- cart.checkout.test.ts

# 2. GREEN: write the minimum code to pass
npm test -- cart.checkout.test.ts

# 3. REFACTOR: clean up with the test as a safety net
npm test

# 4. Confirm the whole suite is still green before declaring the slice done
npm test

A subagent executing a slice gets told, verbatim: write the slice's tests, run them to confirm they fail correctly, implement, get them green, refactor, and run the tests one more time before reporting back.

When it breaks, build the loop first#

The hard part of debugging isn't the fix. It's having a fast, , agent-runnable pass/fail signal for the bug. With one, bisection and hypothesis-testing are mechanical. Without one, no amount of staring at code will save you.

So before touching the suspected code, build a loop: a failing test at whatever seam reaches the bug, a curl script against the dev server, a headless Playwright script that drives the UI and asserts on the DOM, or a replay of a captured payload through the code path in isolation. Then make it faster, sharper, and more deterministic. A 2-second deterministic loop is a debugging superpower. A 30-second flaky one is barely better than nothing. For a UI regression, lets the agent drive the real browser and verify the fix in-band rather than claiming success from a diff.

Only after the loop reliably reproduces the failure the user described do you hypothesise and fix. A nearby failure is the wrong bug, and the wrong bug gets the wrong fix.

Dispatch waves of parallel agents#

Once slices are independent, they run in parallel. The coordination lives in an , a markdown file holding the cross-slice dispatch graph, the rules every subagent follows, and a live status table. The orchestrator doesn't write feature code. It writes the dispatch plan, watches tasks complete, resolves conflicts, and integrates.

Independent slices are spawned as a : several subagents in one message so they run concurrently, each in its own so their checkouts never collide.

bash
# Each slice gets an isolated checkout. This is what makes a wave safe.
git worktree add ../wt-A1 -b slice/A1-worker-scaffold
git worktree add ../wt-A4 -b slice/A4-ask-ui
git worktree add ../wt-B1 -b slice/B1-push-contract

Every subagent's prompt carries the same rules block:

markdown
You are executing one slice of a larger plan.

- Read your slice's section in the plan doc end-to-end before doing anything.
- Apply TDD: write the failing tests, implement, get them green, refactor.
- Stay strictly within your slice's file list. If you need to touch a file
  outside it, STOP and report — do not expand scope.
- Leave a one-paragraph status note (commit SHA, tests added, surprises).
- Do not merge. Do not delete worktrees. Do not push to main.

Gates between waves#

You don't promote from one wave to the next on vibes. Every wave ends at an : before Wave N+1 starts, every Wave N branch is merged, npm test is green on main, the deploy dry-run passes, and each slice has left its status note. If a gate fails, you fix forward by spawning a follow-up slice before dispatching more work.

Merge order matters: integrate lowest-conflict-first. Shared infrastructure and frozen contracts land before the slices that consume them, and the second slice to touch a known hotspot rebases rather than fighting a conflict. Conflict-prone files (a config envelope, the home page, a shared nav) get flagged in the orchestrator doc up front, with the first slice laying down the full structure, commented placeholders included, so later slices only fill it in.

Here's what a wave handoff actually sounds like:

claude code — session
Wave 1 is five slices: A1 worker scaffold, A2 embeddings, A4 UI, A5
citation popper, B1 push contract. Spawn them.
Spawning 5 subagents in worktrees (single message, concurrent)…
A5 citation-popper: 12 tests green, branch slice/A5-popper
B1 push-contract: contract frozen, 8 tests, slice/B1-contract
A4 ask-ui-mocked: mocked backend, deep-link works, slice/A4-ui
A2 embeddings-build: chunker + client, slice/A2-embeddings
A1 worker-scaffold: /api/health up, wrangler envelope, slice/A1
Merging lowest-conflict-first: A5 → B1 → A4 → A2 → A1
Running gates: npm test … 160 passed. cf:deploy:dry … clean.
Gates green. Dispatch Wave 2.

Every one of those green checks is a claim you verify at the diff, not a claim you trust. My reads run roughly 1:1 with edits for a reason. Move fast because the gates, not your optimism, are what say a slice is done.

Footnotes#

  1. Matt Pocock, "Why the Anthropic Ralph Plugin Sucks," AI Hero, January 2026. Smart zone: "First 40% of context — sharp, capable." Dumb zone: the rest. https://www.aihero.dev/why-the-anthropic-ralph-plugin-sucks

  2. Matt Pocock, "Full Walkthrough: Workflow for AI Coding," AI Engineer workshop, April 2026. https://www.youtube.com/watch?v=-QFHIoCo-Ko

  3. "Smart zone," Dictionary of AI Coding, Matt Pocock. https://github.com/mattpocock/dictionary-of-ai-coding 2

  4. Kelly Hong et al., "Context Rot: How Increasing Input Tokens Impacts LLM Performance," Chroma Research, July 2025. https://research.trychroma.com/context-rot

  5. "Effective context engineering for AI agents," Anthropic Engineering, September 2025. https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents

  6. mattpocock/skills v1.1.0 release notes, July 8, 2026. https://github.com/mattpocock/skills/releases/tag/v1.1.0

  7. Jesse Vincent, "Superpowers: How I'm using coding agents in October 2025," October 9, 2025. https://blog.fsck.com/2025/10/09/superpowers/

  8. mattpocock/skills README, "Skills for Real Engineers." https://github.com/mattpocock/skills

Recap

  • Agents get measurably dumber as their context fills. The dumb zone starts somewhere past 100k tokens, so every practice here keeps each working context small and fresh.
  • Skills you invoke beat skills that fire themselves. Process applies when you choose, and misbehavior stays attributable to the skill that caused it.
  • Execute in vertical tracer-bullet slices, not horizontal layers. One thin path that runs, then the next.
  • Run red-green-refactor one test at a time so tests describe behavior through public interfaces and survive refactors.
  • When something breaks, build a fast deterministic pass/fail loop before touching the suspected code.
  • Dispatch independent slices as a wave of parallel subagents in git worktrees, and gate every wave: merge lowest-conflict-first, get the suite green, verify at the diff.