Claude Code: /fork Sessions Now Get Their Own Worktree

Claude CodeView original changelog

Claude Code 2.1.221 changed sessions created with /fork to create a new git worktree of their own instead of continuing to work inside the original session's checkout. Forked sessions and their parent no longer share a working directory, so parallel work in each session can no longer collide on the same files.


Forked Sessions Get Real Isolation

Claude Code 2.1.221 changed how /fork behaves: a forked session now creates its own git worktree rather than continuing to operate inside the original session's existing checkout. Previously, forking a session for parallel exploration meant both the parent and the fork were reading and writing the same working directory, which made it possible for edits from one session to interfere with the other.

Why the Old Behavior Was a Problem

/fork exists so a developer can branch off a session to try a different approach without losing the original conversation. But if both the original and the forked session share one checkout, any file edit made in either session is immediately visible to the other, and running commands in parallel could produce inconsistent or conflicting results. That undermines the entire point of forking, which is to explore alternatives independently.

What Changes Now

With this update, a forked session gets a separate worktree, giving it its own working directory backed by the same repository. Edits, test runs, and Bash commands in the fork no longer affect the parent session's files, and vice versa. This mirrors how Claude Code already isolates other background and parallel session types, closing a gap where /fork specifically had not received the same treatment.

Why It Matters

This is a correctness fix as much as a workflow improvement: developers using /fork to compare two implementation approaches side by side can now trust that each session's changes stay contained to that session, rather than needing to manually manage file conflicts between a session and its fork.


Mentioned onLinkLink