CCDV-P · Agent Fleet Operations for Software Delivery
Parallel agents, worktrees, decomposition and merge strategy
A library migration touches 300 files in a monorepo. A team launches ten coding agents at once, each with a slice, all in the same working directory. At the end, three agents overwrote others’ changes, two ran tests against a half-edited tree, and the result has to be untangled by hand. Parallelism was the right idea; the execution wasn’t.
When fan-out pays off
Parallel fan-out splits a task into parts that run at once. It pays off when the parts are independent and each carries substantial work: mechanical per-module migrations, adding tests across many packages, applying a repeatable refactor. It doesn’t pay off when parts depend on each other, because what you gain in parallel you lose in coordination, or when integrating costs more than doing. The more agents, the more token cost and the more results to review: the bottleneck shifts from generating to verifying (see the next lesson).
Isolation with worktrees
Two agents editing the same file tree collide. A git worktree gives each agent its own working directory and its own branch over the same repository. Each agent edits, runs tests and commits without seeing the others’ half-finished changes. Claude Code and the Agent SDK run fine inside a worktree; isolation also applies beyond files: ports, test databases and shared caches must be split per agent, or two agents running tests at once collide.
Task decomposition
Task decomposition defines what each agent gets. Criteria:
- clear boundaries: by module, package or directory, with as little file overlap as possible;
- a verifiable definition of done: the tests that must pass, the command that confirms it;
- sufficient but bounded context: the task, the conventions and the relevant files, not the whole repository;
- shared groundwork (a change to an interface everyone uses) is done first, in a prior task the others build on, not in parallel.
Merge and conflict strategy
Decide it before launching, not after:
- each agent delivers a small, focused branch or pull request, not a giant change;
- integrate one at a time and run the full suite after each integration, to catch semantic conflicts (not text conflicts: two changes that break something when combined);
- text conflicts are resolved by a person or an integrator agent, always with the tests as referee;
- if conflicts are frequent, the decomposition was wrong: rethink the boundaries instead of retrying the merge.
Fleet failures and their telemetry
Fleet telemetry lets you diagnose at the group level: rate of agents that finish, get stuck or exhaust their budget; cost and time per task; tests that pass on the agent’s branch but fail after integrating; files touched by more than one agent; retries and denied tools. Typical patterns: many agents fail on the same task (a commonly mis-described premise), costs spike on tasks where the agent over-explored (no definition of done) or failures appear only after integrating (dependencies between parts that seemed independent). You act on the common cause, not on each agent.
The usual traps
- Several agents in the same working directory.
- Parallelizing dependent tasks.
- Tasks with no verifiable definition of done.
- Integrating everything together at the end.
- Retrying each failed agent without looking for the common cause.
On the exam
For large independent tasks: fan-out with one worktree per agent, decomposition with clear boundaries, integration one at a time with tests, and telemetry to spot common patterns. If several agents’ output collides, the fix is isolation, not more instructions.
Quick question
A practice exam question on this domain. It counts towards your progress.
A team uses Claude Code agents to migrate 200 services in a monorepo from one logging library to another. They launched twenty agents at the same time, all working in the same checkout and committing to one branch. Within an hour, agents were overwriting each other's edits, shared files such as the lockfile and a central logging index were conflicting, and several pull requests mixed unrelated changes.
The work itself is highly parallelizable, since each service is mostly independent, and the team wants to keep the parallelism.
Which orchestration change best fixes the conflicts?