Lab · Intermediate · 75 min
Three Agents in Parallel on Git Worktrees
Split a small milestone into three independent tasks, run one agent per worktree at the same time, and review three PRs — measuring wall-clock time against doing them one by one.
Cursor · Claude Code · OpenAI Codex
Show all 4 stepsHide list
Step 1 of 4
Lab brief
Goal
Three merged PRs from parallel agents with no file collisions, plus a note on where review became the bottleneck.
Failure mode
Three agents in one checkout overwrite each other's edits, fight over the dev-server port, and produce a tangled diff nobody can review.
Staff move
Parallelize only independent, specified tasks; isolate each in its own worktree and port; keep PRs small so review keeps up.
Step 2 of 4
1. Split the work
- Pick a milestone with three tasks that touch different files (for example: a new API endpoint, a UI badge, docs)
- Write a 5-line spec per task with acceptance criteria
- Check for shared files; if two tasks touch the same module, run them sequentially instead
Step 3 of 4
2. Create worktrees and launch
git worktree add ../app-api -b feat/api-endpoint git worktree add ../app-badge -b feat/ui-badge git worktree add ../app-docs -b docs/endpoint # one terminal (or editor window) per worktree cd ../app-api && PORT=3001 <start your agent with spec 1> cd ../app-badge && PORT=3002 <start your agent with spec 2> cd ../app-docs && <start your agent with spec 3>
Cursor and the Codex app can manage worktrees for parallel agents for you; cloud agents are another option when the tasks do not need your local environment.
Step 4 of 4
3. Review and measure
- Review each PR with a clean-context reviewer first, then yourself
- Record wall-clock time vs your estimate for doing the three serially
- Clean up: git worktree remove ../app-docs after merge
Stretch
Best-of-N: run the hardest task in two extra worktrees with different models and keep the best diff.