Git worktrees are the right tool for parallel agents

GitAI-native developmentdeveloper workflow

When I run more than one coding agent at once, they used to fight over the same working directory. One would stage a file mid-edit while the other was still reading it. Branch switching made it worse.

The fix was git worktrees. One repo, many checked-out branches, each in its own folder:

git worktree add ../feat-auth feature/auth
git worktree add ../fix-parser fix/parser-bug

Each agent gets a real directory with its own working tree and its own branch. They share the same object store, so it is cheap, and there is zero risk of one agent’s uncommitted changes bleeding into another’s diff. When the branch merges, git worktree remove ../feat-auth and it is gone.

The mental shift: a branch is not a place you visit by switching, it is a place you can stand in simultaneously. Once you stop treating the working directory as a single global cursor, running work in parallel stops being scary. This is now the first thing I set up before handing any multi-track task to agents.