Multi-agent development workflows with Claude Code
claude-codesubagentsworkflowqaimprovement-cyclecoordination
Patterns that worked (and failed) when one Claude Code session coordinated specialized subagents to build games (Fall in Godot, Spacebar in Flutter then JS, Fight in Godot), 2026-03 to 2026-08.
Coordinator and workers
- The main session (Opus) coordinates; workers (often Sonnet) each own a set of files and a role.
Several
Agentcalls in one response run truly in parallel, each with its own context. - Give every worker strict file ownership (no shared writes); split by system, not by task. Example
Godot split: mechanics (player, game state, input), scene generation (spawners, enemies), shaders
(all
.gdshader, parallax, particles), mood system (audio, HUD, menus), QA (read-only). - Role files (
agents/*.md) are pasted into the worker's prompt. Custom agent types defined in.claude/agents/were not always dispatchable; injecting the persona into ageneral-purposeagent's prompt works everywhere. - Mind each worker's tools: an agent without Bash cannot commit, so the coordinator commits.
- Background agents can stall; if no files change after a reasonable wait, do the work directly.
Integration is where bugs live
Workers write correct code in isolation; the seams break: wrong engine API names, invisible placeholders, spatial direction logic (spawn above vs below), node wiring, signals emitted before listeners exist. The coordinator must review all output before committing.
QA gate
A read-only QA agent runs after each iteration and returns a structured report (CRITICAL / WARNING / MINOR / VERIFIED OK). Nothing commits without its sign-off, and findings are fixed immediately rather than deferred.
Loops that worked
- Prioritize, execute in parallel, QA, fix QA findings, commit and push, save memory; repeat N times on a theme ("cycle 3 iterations with instructions: ...").
- Improvement cycles (Spacebar, 2026-07-01): deep audit (bugs, then perf, then UI/UX), a detailed plan reviewed by three agents (architect, QA, UI/UX), execution in a git worktree with logical commits, fast-forward merge, repeat. Stop at vanishing returns: meaningful findings went 11, 7, 3, 0 over four cycles. No changes for their own sake.
- "Fiver": scan the app fresh, list 5 obvious bugs or improvements (fewer if there are not 5; never invent), fix with one commit each, write a dated report. "Do 3 fivers" means three sequential fresh scans.
- Plan before visual work: a Plan agent drafts the design with budgets, the coordinator reviews it, then implementation agents run. Skipping this cost a full revert in Fall (Godot canvas shaders for organic 2D visuals).
Run's improvement cycles (2026-07-01/02) and headless audits (2026-10)
Run (Flutter/Flame game + PHP API) used the same audit -> plan -> three-agent review (full-stack
engineer, QA, UI/UX, each given a thoroughly researched brief) -> implement loop. Ten cycles fixed
~44 bugs, added perf work and two features, and took tests from 74 to 154 before diminishing
returns. Extra lessons:
- Worktrees branch from origin/master. EnterWorktree uses the remote base; with
local-only commits on master, the worktree is missing them. Rebase onto local master before
merging, or push first.
- Run independent audits in parallel by area (runtime, editor, API/services,
content/shell/build); then rank cross-cutting themes, not individual findings. The 2026-10
audit's "big five" (no simulation layer, no stable level identity, smeared entity model,
unprotected backend, ad hoc sync) explained most of the bug list.
- Mark suspected bugs found by reading as unconfirmed until reproduced or traced; several were
real (passive-passive collision pairs, undo pushed after mutation), others were not.
- Headless runs cannot eyeball the game. Ship the low-risk, verifiable phase (bounds checks,
backups, confirmed bug fixes, dead-code removal) and leave changes that alter game feel or
migrate data for the user to watch; list exactly what to play-test.
- QA traces catch subtle regressions: a "simple" contact-removal fix would have burned the
player's buffered double jump.
- Long git/deploy operations can go to a background agent so the conversation continues; check
CI before pushing instead of polling after (Testing Flutter/Flame games and running them in GitLab CI).
Mode separation
Skills /worker (code, builds, git, deploy; no docs or memory), /planner (docs, memory, research; no
code or git) and /free keep planning and implementation from bleeding into each other. Reading is
always allowed; switching modes is direct.
Batch size
Justin often asks for big batches ("50 improvements", "30 tasks", "extensive QA audit, fix all bugs"). Deliver the whole batch without per-step confirmation, then audit thoroughly afterward.
Shared contract first, then fan out (multi-component builds)
For a build spanning several components (kid-phone remote sync: a PHP server, a device-owner app, and
the SMS app, 2026-07), write one contract/spec file first (REMOTE_SYNC_SPEC.md), then launch one
background agent per component pointed at it. It worked without integration rework twice (the
three-part sync and a two-part app-install channel). Supporting habits from that project:
- Get design sign-off before building infrastructure or touching a server; Justin engages heavily in
2 to 3 short design rounds, then says "do it" and expects full-speed parallel execution.
- Verify each agent's output yourself before marking work done.
- Long device operations (a 35 GB phone backup, ROM downloads) run as background scripts that write
self-verifying completion markers (GZIP_OK, ROM_DOWNLOAD_OK, STAGE_EXIT) so a fresh session can
confirm state from files alone.
- Write project memory at every milestone; a lost session once had to be rebuilt from transcript JSONLs.
- Destructive steps (wipe, flash, irreversible lockdown) and pushes still wait for an explicit go-ahead.
See also
- Adversarial review before architecture decisions
- claude-service (ProcrastinAI's webhook runner for headless Claude)
- Review agents before deploying nontrivial changes