Zero dead time—work on multiple branches simultaneously with git worktrees
Parallel worktrees enable you to work on multiple branches simultaneously without switching context. While one session runs tests or builds, start working on something else in a separate worktree.
[Main Branch] ├─ Make changes ├─ Run tests (2 minutes) ⏳ ← You wait ├─ Tests fail ├─ Fix issue ├─ Run tests again (2 minutes) ⏳ ← You wait again └─ Finally doneTotal time: Active work (10 min) + Dead time (4 min) = 14 minutes
# Create worktree for feature branchgit worktree add ../project-feat feature-branch# Create worktree for new branchgit worktree add ../project-exp -b experiment# List all worktreesgit worktree list
Then open the new directory in a separate editor window.
# Try 3 approaches simultaneouslygit worktree add ../project-graphql -b experiment/graphqlgit worktree add ../project-rest -b experiment/restgit worktree add ../project-grpc -b experiment/grpc# Open each in separate terminal/editor# Let Claude explore each approach in parallel# Compare results after 30 minutes
# 9:00 AM - Start tests in main branchcd ~/projectnpm test # 5 minute test suite# 9:00 AM - Immediately start feature workgit worktree add ../project-webhooks -b feature/webhookscd ../project-webhooksclaude# > "Build webhook support"# 9:05 AM - Tests finish in main branch# (Terminal 1 shows results)# 9:05 AM - Feature work continues uninterrupted# (Terminal 2 still working on webhooks)# Result: 5 minutes of parallel progress instead of 5 minutes waiting
Example: Comparing Approaches
# Try 3 different approaches to same featuregit worktree add ../approach-1 -b exp/graphqlgit worktree add ../approach-2 -b exp/restgit worktree add ../approach-3 -b exp/grpc# Terminal 1: GraphQL approachcd ../approach-1claude "implement GraphQL API"# Terminal 2: REST approach cd ../approach-2claude "implement REST API"# Terminal 3: gRPC approachcd ../approach-3claude "implement gRPC API"# 1 hour later: compare all three# Keep the best one, delete the other worktreesgit worktree remove ../approach-1git worktree remove ../approach-3git branch -d exp/graphql exp/grpc