- Resolve hoarder-sync/data.json conflict (keep local timestamp) - Merge unique content from iCloud duplicate 2026-05-03 2.md into original - Delete iCloud duplicates: 2026-05-03 2.md, Pending Commands 2.md, network-topology 2.md - Add 2026-05-05 daily log and credentials note - Add git-worktrees wiki articles and concepts index entry Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.6 KiB
1.6 KiB
| tags | source | created | ||
|---|---|---|---|---|
|
3m-portal | 2026-05-05 |
Using Git Worktrees for Parallel Claude Development Sessions
When to use
Use git worktrees when you need to run multiple independent Claude sessions simultaneously on different branches without context switching or stashing work.
Prerequisites
- Git 2.7+
- A repository with multiple branches
- Multiple Claude sessions (or ability to open new ones)
Steps
-
Create a new worktree for your branch:
git worktree add ../path-to-worktree branch-name -
Navigate to the worktree directory:
cd ../path-to-worktree -
Start a new Claude session in this worktree directory
-
Each session works independently on its own branch without affecting others
-
When done, remove the worktree:
git worktree remove ../path-to-worktree
Key Configuration
- Main worktree location:
project-root/ - Secondary worktrees:
project-root-worktree-name/(sibling directories recommended) - Each worktree maintains its own git state, node_modules, and build artifacts
Gotchas
- Shared dependencies:
node_modulesand build caches are duplicated per worktree—can consume significant disk space - Long-running worktrees: Clean up finished worktrees promptly to avoid confusion
- Hotfix scenarios: Best practice is to always create worktrees for hotfix/feature branches, never work directly on main worktree
- Multiple branch work: If a branch has uncommitted changes,
git worktree addwill fail—commit or stash first
Source
Project: 3m-portal