CertPrep
Domain 8 · Lesson 8.1 · 6 min read

Parallel Coding Agents

Exam skillParallel Agent Orchestration for Engineering Work

Evaluating parallel fan-out patterns for large engineering tasks, including parallel agents on isolated worktrees, task decomposition, and merge and conflict strategy, and diagnosing fleet-level failure modes from fleet telemetry.

Fan large engineering work out to parallel coding agents on isolated worktrees, decompose it so branches rarely conflict, land shared changes first, resolve conflicts with both intents in view, pace the fleet to review capacity, and read fleet telemetry for shared failure causes.

What you need to know

Coding agents make it cheap to start many streams of work at once. Throughput then depends on three things: whether the streams interfere with each other, whether their branches merge cleanly, and whether review keeps up. The exam tests each of those, plus reading fleet telemetry for failures that look random one agent at a time.

Sessions and subagents

A parallel session is a separate Claude Code instance working its own task, usually in its own worktree. A subagent is a helper inside one session, with its own context and tools, for jobs such as exploration or verification. Parallel sessions raise the number of tasks in flight; subagents keep each session focused.

Isolation with worktrees

Six sessions in one checkout overwrite each other's edits, and tests see files change mid-run. A worktree gives each session its own checkout on its own branch (claude --worktree <name>), and the branches are merged afterward through normal review. Worktrees start from the repository, so git-ignored files a session needs (a local environment file) are missing; list them in .worktreeinclude to copy them in, rather than committing secrets.

Decomposition that merges cleanly

PracticeWhy
Give each task its own set of files, such as one service per taskIndependent file sets rarely conflict
Land shared changes first (a library wrapper, a common interface) in one taskParallel tasks build on one version instead of each editing it
Keep tasks that share files in one session, one after anotherCoupled edits conflict when split
Start every task from the current mainA stale base spreads the same failure across many branches

Random grouping can put coupled code in different tasks. Letting every agent edit shared code "and resolve differences at the end" guarantees conflicts.

Resolving conflicts

When two branches change the same file in different ways, resolve it in one session that reads both branches' intent, then run the full tests. Accepting whichever branch merged first can silently break the other feature; re-running tasks until one avoids the file does not resolve conflicting requirements.

Pace the fleet to review

Generation can outpace review. If 300 pull requests a week sit longer and longer while approval rates hold, review capacity is the bottleneck, and adding agents makes the queue longer. Limit sessions per engineer to what they can review properly (two or three is a sensible start), pace fan-out to the review rate, and scale verification and AI review (lesson 8.2).

Fleet telemetry

MetricReveals
CI failures per agent pull request, grouped by failing test and base commitShared causes, such as a stale base or a broken shared test
Rework rate after review, by task typeKinds of task the fleet handles poorly
Time to merge versus approval rateWhether review is the bottleneck
Concurrent sessions per engineer, with reworkWhether parallelism is still paying

In the exam

Parallel-agent items describe a fan-out and its result: collisions, conflicts, a cluster of CI failures, a growing review queue. Choose isolation, a better decomposition, a fresh base, conflict resolution with both intents, or pacing to review. Distractors serialize everything, add more agents, give sessions different instructions, share a branch, disable failing tests or switch the fleet to a bigger model.

Check your understanding

Question 1

Six parallel sessions in one checkout overwrite each other's edits. What is the best fix?

Show answer

Answer: B. Separate working trees stop collisions while keeping the parallelism.

Question 2

15 of 40 agent pull requests fail the same test, and all their branches predate a fix to it. What is the failure mode?

Show answer

Answer: A. The shared cause is the starting commit, visible only when failures are grouped by base.

Question 3

Median time to merge for agent pull requests rose from one day to six, with approval rates unchanged. What is supported?

Show answer

Answer: C. Waiting grows while quality holds, so throughput is limited by review, not generation.

Apply it: Plan Riverbend's next 40-agent migration

Exercise · about 25 minCase: Riverbend Software

Riverbend's platform team must move 220 services to a new configuration library. Last time, 40 parallel agents produced 40 pull requests in a day, 15 failed CI on a test whose fix had just landed, and agent pull requests took 4.5 days to merge on average.

  1. Decompose the work, including what lands first.
  2. Set up isolation and starting points for each agent.
  3. Choose the fan-out pace, and justify it from the review data.
  4. Name the fleet metrics you will watch during the migration.
Check your work
Show model answer

1. Decomposition. First, one task adds the new library's shared wrapper and migration helper and merges it. Then one task per service (or per small group of services that share files), each touching only that service's directory.

2. Isolation. Each agent runs in its own worktree on a branch named for its service, created from main after the wrapper merges; .worktreeinclude copies the local test configuration. Before opening a pull request, each agent rebases onto current main and runs the service's tests.

3. Pace. Owning teams review their services. With agent PRs taking 4.5 days to merge today, the platform team releases 25 tasks a day, matched to the reviewers' throughput, and adds more only while median time to merge stays under two days.

4. Metrics. CI failures grouped by failing test and base commit (shared causes), rework rate after review per service type, median time to merge against approval rate, and the number of open agent pull requests per owning team.

Key termsGit worktree

Sources