Parallel Worktree Development
Git worktree parallel development workflow skill. Inspired by Boris Cherny's workflow and Claude Code Desktop features.
Operations
Create New Worktree
When user requests "create a new worktree", "start working on feature-xxx", etc.:
- Check if
.gitignorecontains.worktree/- If not, suggest adding it
- Confirm branch name (ask if not specified)
- Create worktree:
git worktree add .worktree/<branch> -b <branch> - Install dependencies and verify build:
cd .worktree/<branch> && pnpm install && pnpm build - On success, present the command to start a new terminal session:
cd .worktree/<branch> && claude
List Worktrees
When user requests "list worktrees", "show parallel sessions", etc.:
git worktree list
Format the output nicely and explain each worktree's branch and status.
Finish Worktree
When user requests "finish worktree", "merge this work", etc.:
- Check current branch
- If there are uncommitted changes, suggest committing
- Fetch latest main and rebase:
git fetch origin main git rebase origin/main - Checkout main and merge:
git checkout main git merge <branch> - Remove worktree:
git worktree remove .worktree/<branch>
Switch Worktree
When user requests "switch worktree", "move to feature-xxx", etc.:
- Check existing worktrees with
git worktree list - If the specified branch worktree exists:
- Present the command to navigate to that directory
- If it doesn't exist:
- Ask if user wants to create a new one
Important Rules
- Always check
.gitignorebefore creating worktrees - If build fails, report and stop
- Never use force delete (
--force) - Avoid direct work on main/master branches
- Recommend working in each worktree with an independent Claude session
Best Practices
Boris Cherny's Parallel Development Style
- Manage 3-5 worktrees simultaneously
- Number each terminal tab for easy management
- Assign independent tasks to each worktree
- Regularly merge main to prevent divergence
Recommended Structure
project/ # Main repository (design/review)
├── .worktree/
│ ├── feature-auth/ # Claude session #1
│ ├── feature-api/ # Claude session #2
│ └── bugfix-123/ # Claude session #3
Related Files
.worktreeinclude: Configuration for files to copy to worktrees.gitignore: Excludes.worktree/
Converted and distributed by TomeVault — claim your Tome and manage your conversions.