using-git-worktrees

Creates isolated git worktrees for parallel development. Use when starting feature work needing isolation or working on multiple branches simultaneously. Not for simple branch switching or basic git operations.

⭐8stars🔀1forks📁View on GitHub🕐Updated Jan 3, 2026

When & Why to Use This Skill

This Claude skill streamlines parallel development by managing isolated Git worktrees. It allows developers to work on multiple features or bug fixes simultaneously within the same repository, eliminating the overhead of frequent context switching, stashing, or branch swapping while maintaining a clean and organized project structure.

Use Cases

  • Concurrent Task Management: Work on a long-term feature branch in one worktree while quickly addressing an urgent hotfix in another without losing your current progress or uncommitted changes.
  • Side-by-Side Comparison: Open different versions of the codebase in separate directories to compare implementations, perform complex manual merges, or conduct thorough code reviews.
  • Isolated Environment Testing: Run long-running test suites or build processes in a dedicated worktree while continuing active development in your primary workspace to maximize productivity.
nameusing-git-worktrees
descriptionCreates isolated git worktrees for parallel development. Use when starting feature work needing isolation or working on multiple branches simultaneously. Not for simple branch switching or basic git operations.

Git Worktrees

Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously.

Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace."

Quick Start

# Create worktree with new branch
git worktree add .worktrees/feature-auth -b feature/auth

# Create worktree from existing branch
git worktree add .worktrees/bugfix bugfix/issue-123

# List worktrees
git worktree list

# Remove worktree
git worktree remove .worktrees/feature-auth

Directory Selection

  1. Check existing: .worktrees/ or worktrees/
  2. Check CLAUDE.md for preference
  3. Ask user if neither exists

Safety Requirements

Before creating project-local worktree:

# Verify directory is in .gitignore
grep -q "^\.worktrees/$" .gitignore || grep -q "^worktrees/$" .gitignore

If NOT in .gitignore: Add it immediately and commit.

References