myth/acc
Log in
EN

Guide

Git worktrees for Claude Code: run parallel sessions without collisions

One checkout per session prevents file overwrites, though ports and services stay shared.

Claude Code behavior from Anthropic’s docs, checked 26 October 2026.

The short answer

A git worktree gives each Claude Code session its own folder and branch while sharing one repo history, preventing edit collisions. Use claude --worktree <name> or git worktree add. Worktrees isolate files only: ports, local databases and merge conflicts remain shared.

Three ways to get a worktree

  1. Let Claude Code create it

    Creates .claude/worktrees/<name>/ on branch worktree-<name> (needs at least one commit).

    claude --worktree feature-auth
  2. Create it with git

    Add a sibling folder on a new branch, then launch Claude Code inside it.

    git worktree add -b feature-auth ../myapp-auth origin/main
    cd ../myapp-auth && claude
  3. Use agent view

    In a git repo, claude agents automatically places each background session in its own worktree.

  4. Clean up after merging

    Remove the checkout folder and delete the branch.

    git worktree list
    git worktree remove ../myapp-auth
    git branch -d feature-auth

What a worktree does not isolate

Ports

Two dev servers still compete for the same port.

Databases and services

Local databases, caches and queues remain shared across checkouts.

Untracked files

Fresh worktrees lack .env and installed dependencies. Use .worktreeinclude to have Claude Code copy gitignored files.

Merge conflicts

Overlapping branch edits still conflict at merge time.

Worktrees on a myth/acc canvas

myth/acc does not auto-create worktrees. Create them with git or Claude Code, then open each worktree folder as its own project. Both the jail and per-turn undo follow each checkout independently.

Running agents in parallel

Questions, answered

How many worktrees can I run?

No hard cap. Your review bandwidth, machine resources and plan limits set the practical ceiling.

Do I need worktrees for every agent?

Only when multiple agents edit the same repository at the same time.

Does myth/acc make a worktree for each agent?

No. Create worktrees with git or Claude Code and open each folder as a project.

Does undo work in a worktree?

Yes. Each worktree is a normal git checkout with independent snapshots and undo.

Sources

Facts on this page were checked on . Products change: check the vendor’s own page before you decide.

Give each agent a desk of its own.

Try the real canvas with live demo agents. No account needed.