---
title: "Parallel agents in separate worktrees pattern for AI agents | Agentic Pattern Language"
description: "Run several agents at once, each in its own checkout, then review and merge each one. Sourced from Cursor, Anthropic, and OpenAI."
url: https://agenticpatternlanguage.com/patterns/parallel-agents-in-worktrees/
---

30 [People and agents](https://agenticpatternlanguage.com/#people-and-agents)

# Parallel agents in separate worktrees

Run several agents at once, each in its own checkout, then review and merge each one.

SW JV Cursor, Anthropic, OpenAI, Simon Willison, Jesse Vincent

[How to read this](https://agenticpatternlanguage.com/notation/)

## Part of

* [Parallelization](https://agenticpatternlanguage.com/patterns/parallelization/)

## Alternatives

* [Asynchronous coding agent](https://agenticpatternlanguage.com/patterns/background-agent/)

## 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.

Anthropic [Best practices for Claude Code](https://code.claude.com/docs/en/best-practices)

> Use worktrees when you want to start several agents on the same repo without conflicts.

Cursor [Worktrees](https://cursor.com/docs/configuration/worktrees)

## 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.

Anthropic [Run parallel sessions with worktrees](https://code.claude.com/docs/en/worktrees)

> Worktrees let Agent work in isolated Git checkouts. Each task gets its own files, dependencies, and changes while your main checkout stays untouched.

Cursor [Worktrees](https://cursor.com/docs/configuration/worktrees)

> Worktrees let Codex run multiple independent chats in the same project without interfering with each other.

OpenAI [Worktrees](https://developers.openai.com/codex/app/worktrees)

## 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.

JV Jesse Vincent [How I'm using coding agents in September, 2025](https://blog.fsck.com/2025/10/05/how-im-using-coding-agents-in-september-2025/) Oct 5, 2025

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

SW Simon Willison [Embracing the parallel coding agent lifestyle](https://simonwillison.net/2025/Oct/5/parallel-coding-agents/) Oct 5, 2025

Cursor

> Cursor automatically creates and manages git worktrees for parallel agents.

Cursor [Best practices for coding with agents](https://cursor.com/blog/agent-best-practices) Jan 9, 2026

## 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.

SW Simon Willison [Embracing the parallel coding agent lifestyle](https://simonwillison.net/2025/Oct/5/parallel-coding-agents/) Oct 5, 2025

> A worktree is a fresh checkout, which means gitignored files like .env aren’t there and dependencies aren’t installed.

Anthropic [Best practices for Claude Code](https://code.claude.com/docs/en/best-practices)

> 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.

OpenAI [Worktrees](https://developers.openai.com/codex/app/worktrees)

## Sources

1. [Best practices for coding with agents](https://cursor.com/blog/agent-best-practices) Lee Robinson, Cursor, Jan 9, 2026
2. [Run parallel sessions with worktrees](https://code.claude.com/docs/en/worktrees) Anthropic
3. [Worktrees](https://cursor.com/docs/configuration/worktrees) Cursor
4. [Worktrees](https://developers.openai.com/codex/app/worktrees) OpenAI
5. [Best practices for Claude Code](https://code.claude.com/docs/en/best-practices) Anthropic
6. [Embracing the parallel coding agent lifestyle](https://simonwillison.net/2025/Oct/5/parallel-coding-agents/) Simon Willison, Oct 5, 2025
7. [How I'm using coding agents in September, 2025](https://blog.fsck.com/2025/10/05/how-im-using-coding-agents-in-september-2025/) Jesse Vincent, Oct 5, 2025

Added Nov 14, 2026
