Skip to content
CW101
Generally availableOfficialConcept

Worktrees and parallel isolation

Git worktrees give each parallel Claude Code session its own checkout, which is what stops two agents editing the same files from fighting.

Last verified August 21, 2026 · 3 sources

Everything Claude Code offers for working in parallel — agent teams, agent view, multiple sessions — runs into the same wall: two agents editing one working directory will conflict.

A git worktree is the answer. Each session gets its own checkout of the same repository, on its own branch, in its own directory.

Why Anthropic documents this rather than assuming you know

Worktrees are an old git feature that most developers have never needed. Branch switching was always enough, because you were one person doing one thing.

Parallelism breaks that assumption. The moment three sessions are working simultaneously, “check out a different branch” is not available — they all need their files at once.

What it does not solve

  • Merge conflicts. Worktrees keep the work apart; combining it is still your problem, or an agent team’s.
  • Shared state outside the repository. One database, one dev server, one port. Isolation stops at the filesystem boundary.
  • Usage. Three sessions consume three sessions’ worth of your plan.
  • Security. A worktree is not a sandbox. For that, see sandbox environments and permissions.

When you do not need one

If your parallelism is subagents rather than sessions, you do not need worktrees. Subagents run inside one session against one working directory, and the lead agent serialises the edits. The distinction is in subagents vs agent teams.

Plan availability

Anything left blank is not documented publicly, not a claim that it is unavailable. Compare every feature at once in the availability matrix.

  • FreeNot available
  • ProIncluded
  • MaxIncluded
  • TeamIncluded
  • EnterpriseIncluded
  • APINot documented

Sources

  1. 01Run parallel sessions with worktreesOfficialcode.claude.com
  2. 02Orchestrate teams of Claude Code sessionsOfficialcode.claude.com
  3. 03Choose a sandbox environmentOfficialcode.claude.com

Page changelog

  1. VerifiedConfirmed as documented alongside agent teams and parallel sessions.

Start typing to search every entity in the reference.