Parallel agents in separate worktrees
Run several agents at once, each in its own checkout, then review and merge each one.
Cursor, Anthropic, OpenAI, Simon Willison, Jesse Vincent
The problem
Several agents editing one checkout at the same time collide.
When you have separate pieces of work going at once, give each its own checkout so the edits can’t collide.
Use worktrees when you want to start several agents on the same repo without conflicts.
Therefore
Running each Claude Code session in its own worktree gives it a separate copy of the files to edit, so one session can build a feature while a second fixes a bug.
Worktrees let Agent work in isolated Git checkouts. Each task gets its own files, dependencies, and changes while your main checkout stays untouched.
Worktrees let Codex run multiple independent chats in the same project without interfering with each other.
In use
Jesse Vincent
When I want to start a new task on an existing project, I try to always use a git worktree to isolate that work from other tasks.
Simon Willison
I haven’t adopted git worktrees yet: if I want to run two agents in isolation against the same repo I do a fresh checkout
Cursor
Cursor automatically creates and manages git worktrees for parallel agents.
Where it breaks
Review becomes the bottleneck, a fresh checkout lacks ignored files and dependencies, and a branch lives in one checkout at a time.
AI-generated code needs to be reviewed, which means the natural bottleneck on all of this is how fast I can review the results.
A worktree is a fresh checkout, which means gitignored files like .env aren’t there and dependencies aren’t installed.
If you check out a branch on a worktree, you can’t check it out in your local checkout at the same time, and vice versa.
Sources
- Best practices for coding with agentsLee Robinson, Cursor, Jan 9, 2026
- Run parallel sessions with worktreesAnthropic
- WorktreesCursor
- WorktreesOpenAI
- Best practices for Claude CodeAnthropic
- Embracing the parallel coding agent lifestyleSimon Willison, Oct 5, 2025
- How I'm using coding agents in September, 2025Jesse Vincent, Oct 5, 2025
Added Nov 14, 2026