Skip to content
PKResources
Course outline

Agentic Engineering: the hands-on course · Module 5: Scaling up

Running several agents in parallel (branches, worktrees)

One agent at a time leaves you waiting. Several agents in isolated worktrees keep you busy, as long as the tasks don't overlap and your review can keep up.

Lesson 17 / 24 · ⏱ 8 min

Once your briefs are tight and your checks are fast, a single agent run stops needing you for long stretches. That’s when the obvious question shows up: why not run three?

You can. But parallel agents don’t multiply your output by three. They multiply it by however many diffs you can review well.

One repo, several working copies

Two agents editing the same folder will trample each other: one runs the tests while the other is halfway through a rename. Each agent needs its own working copy on its own branch.

Git worktrees are the cheapest way to get that. One repository, several checked-out directories, each on a different branch, sharing the same history.

Reposhared historyworktree A · feat/exportagent 1: CSV exportworktree B · fix/timezoneagent 2: date bugworktree C · chore/depsagent 3: dependency bumpyour reviewone diff at a timemain
Three agents, three worktrees, three branches. They work in parallel. They all come back through the same narrow gate: your review.

The setup I use

  1. 1

    One worktree per task

    Create a new worktree on a fresh branch for each agent task, in a sibling folder named after the task. Never point two agents at the same directory.

  2. 2

    Make each copy runnable

    Each worktree needs its own dependencies, env file and free ports. Script this once, or the agent will spend its first ten minutes fighting setup.

  3. 3

    Brief each agent separately

    Each run gets its own brief with its own acceptance criteria (lesson 3.2). Mention which files are off limits because another agent owns them.

  4. 4

    Review and merge one at a time

    Pick up whichever finishes first. Rebase the next branch on the updated main before you review it.

  5. 5

    Clean up

    Remove the worktree and delete the branch once merged or abandoned. Stale worktrees pile up fast.

Play: parallel or serial?

For each pair of tasks, decide whether you’d hand them to two agents at the same time.

🎮 Run in parallel or one after the other?

1 / 8 · Score: 0

Know your ceiling

I start people at two parallel agents, not five. Your limit is not the machine: it’s how many diffs you can review with real attention before quality drops (lesson 4.3).

✕ Parallel as a race

  • –Five agents launched, no brief longer than a line
  • –Tasks overlap in the same files
  • –Diffs pile up unreviewed for a day
  • –Merges rubber-stamped to clear the queue

✓ Parallel as a pipeline

  • +Two or three agents, each with a full brief
  • +Tasks chosen for zero overlap
  • +Each diff reviewed as soon as it lands
  • +Next batch starts once the queue is empty

Before you move on

✅ Key takeaways

0 / 4 completed