Agent Orchestrators vs Parallel Sessions with Worktrees

Fazm Team··2 min read

Agent Orchestrators vs Parallel Sessions with Worktrees

There are two main patterns for running multiple AI agents on coding tasks. Agent orchestrators try to coordinate agents within a shared workspace. Parallel sessions with git worktrees give each agent its own isolated copy of the codebase. After trying both extensively, worktrees win by a wide margin.

The Orchestrator Problem

Agent orchestrators sound elegant. One coordinator agent breaks down the task, assigns subtasks to worker agents, and merges the results. In practice, the coordinator becomes a bottleneck. It needs to understand the entire codebase to make good task assignments. It needs to resolve conflicts when two agents edit the same file. It spends more tokens on coordination than the workers spend on actual coding.

The coordination overhead grows quadratically with the number of agents. Two agents need one coordination channel. Five agents need ten. The orchestrator drowns in conflict resolution.

Why Worktrees Win

Git worktrees give each agent a real, isolated copy of the codebase. Agent A works in worktree-a, Agent B works in worktree-b. They cannot step on each other because they are literally working on different file systems. No coordination needed during execution.

Merging happens after each agent finishes, using standard git merge tools that developers already understand. Conflicts are resolved once, in a controlled way, rather than continuously during development.

The Practical Setup

Run each agent in a separate tmux pane, each pointing to its own worktree. Give each agent a focused task with clear boundaries. Let them run in parallel without any awareness of each other. Review and merge the results.

This pattern scales linearly. Adding a sixth agent is exactly as complex as adding the second one. No orchestrator to update, no coordination protocol to extend.

When Orchestrators Make Sense

Orchestrators work for non-coding tasks where agents need real-time coordination - like research tasks where one agent's findings inform another's search direction. But for code changes, isolation beats coordination every time.

More on This Topic

Fazm is an open source macOS AI agent. Open source on GitHub.

Related Posts