Worktrees: real parallel work
Two sessions in one directory edit the same files and ruin each other's afternoon. A worktree gives each one its own directory.
A git worktree is a second working directory for the same repository, on its own branch, sharing the history and the remote. Lesson 9 said a session belongs to a directory, so two directories mean two sessions that cannot collide.
claude --worktreeIt creates a worktree and a branch, then starts the session inside it.
From there it is an ordinary session. It has its own files, its own branch, and its own conversation. Merging is git, exactly as it would be for a colleague.
Which kind of parallel you want
| Tool | Splits | Use when |
|---|---|---|
| Subagents | Context, inside one session | A side task whose output you do not want |
| Worktrees | Files, across directories | Two changes that would touch the same code |
| Agent view | Whole sessions, across a machine | Several independent jobs to check on later |
| Agent teams | Sessions that talk to each other | Work that has to be coordinated. Experimental |
Most people need the first two. Reach for a worktree the moment you catch yourself waiting for one task to finish before starting an unrelated one.
.env, do not come along by default, which is the usual reason a fresh worktree cannot run your tests. A .worktreeinclude file lists what should be copied across, and a new worktree still needs its dependencies installed like any fresh checkout.- Start
claude --worktreefor a small change and finish it there. - Run
git worktree listafterwards and see what exists.
Little by little, you're building something great.