Pages12345678910111213141516171819
Explained comic · 19 pages

The Swarm: Parallel Coding Agents in Git Worktrees

View the original source Rayyan Zahid · Michalis Vasileiadis · Eric Mockler · Devinder Sodhi
Read it as a flipbook → Read the annotated summary →

A workshop deck from Vibe Coding Nights #49 explaining how to run multiple AI coding agents in parallel using git worktrees, giving each agent an isolated working directory that shares one object store. It covers the conductor pattern, worktree isolation limits, and a fan-out/fan-in playbook with measured failure modes.

Page One
KEY IDEA

Isolation, not more agents, is what makes parallel coding agents safe.

Key idea & notes ▾ WHY THIS MATTERS

Without isolation, parallel agents corrupt each other's work in ways that pass silently and reach production.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page Two
KEY IDEA

One agent is slow because it is a single-server queue, not a slow model.

Key idea & notes ▾ WHY THIS MATTERS

Recognizing the real bottleneck tells you to change scheduling, not chase a faster model.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page Three
KEY IDEA

One working tree is one shared mutable surface, and parallel edits race.

Key idea & notes ▾ WHY THIS MATTERS

The failure arrives as corrupted work, not an error, so you must prevent it structurally.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page Four
KEY IDEA

The conductor's only products are the plan and the merge.

Key idea & notes ▾ WHY THIS MATTERS

Keeping the orchestrator out of the code preserves the one global-view role that cannot be isolated.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page Five
KEY IDEA

Worktrees give N working directories backed by one shared object store.

Key idea & notes ▾ WHY THIS MATTERS

You get real parallelism cheaply, without re-cloning history for each agent.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page Six
KEY IDEA

Shared config races silently corrupt the commit author field.

Key idea & notes ▾ WHY THIS MATTERS

Wrong authorship destroys your only record of which agent did what, and it fails without an error.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page Seven
KEY IDEA

Four commands stand up N isolated arenas cheaply.

Key idea & notes ▾ WHY THIS MATTERS

Cheap isolation is what makes fanning work out across many agents practical.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page Eight
KEY IDEA

Fan-out is cheap; fan-in is where the real work lives.

Key idea & notes ▾ WHY THIS MATTERS

Budget your effort for merging, because that is where the swarm's cost concentrates.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page Nine
KEY IDEA

Removing a worktree can follow a link outward and delete real data.

Key idea & notes ▾ WHY THIS MATTERS

The cheap-swarm trick can quietly destroy files that were never in the worktree.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page Ten
KEY IDEA

Running a plan before teaching it catches failures that pass silently.

Key idea & notes ▾ WHY THIS MATTERS

A short rehearsal prevents silent bugs from reaching every learner's machine.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page 11
KEY IDEA

Pick tasks with disjoint files; overlapping ones are really one task.

Key idea & notes ▾ WHY THIS MATTERS

Independence at this step is what determines whether the whole night is cheap or expensive.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page 12
KEY IDEA

Set agent identity via env vars per process, never shared config.

Key idea & notes ▾ WHY THIS MATTERS

Per-process identity fixes the silent authorship race and lets you audit each agent's work.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page 13
KEY IDEA

Poll the fleet's status but never help by editing code.

Key idea & notes ▾ WHY THIS MATTERS

Editing collapses your global oversight into just another isolated worker's blind spot.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page 14
KEY IDEA

Merge serially with --no-ff so each conflict is traceable.

Key idea & notes ▾ WHY THIS MATTERS

Serial fan-in preserves attribution and pins every conflict to a single responsible branch.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page 15
KEY IDEA

Keep both intents; catch clean-merging semantic conflicts with tests.

Key idea & notes ▾ WHY THIS MATTERS

Semantic conflicts pass every merge check and only tests after the last merge reveal them.

SOURCE Read the source LEARN MORE arxiv.org
Page 16
KEY IDEA

Unlink internal links before removing a worktree, and keep -d.

Key idea & notes ▾ WHY THIS MATTERS

The command order is the only thing between routine cleanup and irreversible data loss.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page 17
KEY IDEA

Fan out only work that shares no write surface; humans gate split and merge.

Key idea & notes ▾ WHY THIS MATTERS

Measured trials show fanning out can slow you down 39 percent when tasks overlap.

SOURCE Read the source LEARN MORE arxiv.org
Page 18
KEY IDEA

You leave with a conductor, an isolation map, a fan-in playbook, and a test.

Key idea & notes ▾ WHY THIS MATTERS

These four artifacts turn a single-agent queue into a repeatable parallel workflow.

SOURCE Read the source LEARN MORE vibecodingnights.com
Page 19
KEY IDEA

Real isolation, disjoint splits, and human-gated fan-in make swarms work.

Key idea & notes ▾ WHY THIS MATTERS

Getting these right converts a slow single-agent queue into safe, auditable parallel progress.

SOURCE Read the source LEARN MORE vibecodingnights.com
Share to LinkedIn Share to X Share to Bluesky