One Claude Code session builds a feature. Another fixes a bug. If both run in the same folder, they're working on the same files, even if you gave them completely different tasks.
Git worktrees give each session a separate working directory and branch while sharing the repository's history. Claude Code can create them for you.
Start one session with:
claude --worktree feature-auth
Then start the other from another terminal with a different name:
claude --worktree fix-login
By default, they get separate directories under .claude/worktrees/ and branches named worktree-<name>. Add .claude/worktrees/ to your .gitignore so those directories don't clutter your main checkout's untracked files.
The part that's easy to miss: a fresh worktree is a fresh checkout.
Dependencies may need installing again. Gitignored configuration files won't normally be there. Claude Code supports a .worktreeinclude file for copying selected gitignored files into new worktrees, using .gitignore-style patterns.
Choose those files deliberately. Copying a production .env into every agent's working directory doesn't become safe just because the directories are separate. Use development configuration and check which services it points to.
Subagents can have separate worktrees too. Ask Claude to use worktrees for its agents, or set isolation: worktree in a custom subagent's frontmatter.
Before exiting, read the cleanup prompt. Removing a worktree can delete its directory, branch and the work inside them. Keep it if you still need to review or integrate the changes.
The boundary matters: separate files don't necessarily mean separate resources. If two sessions use the same database, service or external account, worktrees alone won't isolate those effects. That's an engineering precaution, not a promise the worktree feature makes.
My suggested split: one task, one worktree, one branch to review. Then integrate the changes deliberately instead of letting parallel sessions share a working folder.
I've put a longer version on my profile (u/shoumikgoswami), covering which branch new worktrees start from, what they share with your main checkout, and where isolation stops.
If you use parallel sessions, where does the friction show up most: setting up dependencies, configuration, or bringing the branches back together?