Skip to content

Using Git Worktrees

执行类

Use before starting feature work that needs isolation from current workspace, or before executing an implementation plan.

Quick Start

Understand in 30 Seconds

Create isolated git workspaces sharing the same repository, allowing simultaneous work on multiple branches.

When to Use

  • Starting feature work that needs isolation
  • Before executing implementation plan
  • Need to switch between branches without losing context

Complete Guide

Directory Selection Process

  1. Check Existing Directories

    bash
    ls -d .worktrees 2>/dev/null
    ls -d worktrees 2>/dev/null
  2. Check CLAUDE.md - Look for preference settings

  3. Ask User - If no directory exists

Safety Validation

Must verify directory is ignored before creating worktree:

bash
git check-ignore -q .worktrees

Creation Steps

  1. Detect project name
  2. Create Worktree
  3. Run project setup
  4. Verify clean baseline

Follow-up Skills