# Separate Claude Code sessions with Git worktrees

> Give parallel sessions separate files and branches while keeping their shared repository history.

Source: https://fullbytedeveloper.com/blog/claude-code-parallel-worktree-sessions
Keyword: TREE
Published: 2026-11-05

Claude Code's worktree docs describe separate working folders and branches for parallel sessions [1]. Use one per task when two sessions would otherwise edit the same files.

## Start the first isolated session

From your Git repository, use the documented example [1].

```bash
claude --worktree feature-auth
```

You should see a worktree at `.claude/worktrees/feature-auth` on branch `worktree-feature-auth` [1]. In another terminal, use a different worktree name for the second task.

## Keep generated worktrees out of status

Add this entry to your existing ignore file, preserving its other entries [1].

```text title=".gitignore"
.claude/worktrees/
```

## Copy only the ignored files you need

A fresh checkout lacks untracked environment files. The documented `.worktreeinclude` mechanism copies files only when they match its patterns and are also Git-ignored [1].

**Warning:** this creates additional copies of your local environment files. Include secrets only when the isolated task needs them.

```text title=".worktreeinclude"
.env
.env.local
```

## Review work before cleanup

The docs say Claude prompts about keeping or removing a worktree when it contains changes or commits. Keep any work you still need [1]. Separate worktrees isolate file edits; they are not a substitute for reviewing the combined changes before merging.

## Sources

1. [Claude Code docs: worktrees](https://code.claude.com/docs/en/worktrees)

## Original posts

- [Instagram reel](https://www.instagram.com/reel/De_YOeaiEdX/)
- [TikTok video](https://www.tiktok.com/@fullbytedeveloper/video/7701254417286335751)
- [YouTube Short](https://www.youtube.com/shorts/myP8nBNE-dY)
- [Facebook reel](https://www.facebook.com/reel/4590651997917714)
- [Threads post](https://www.threads.com/@fullbytedeveloper/post/De_YOXhj9D-)
