$Using Git Worktrees

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

Views:
Rating:
Tags
#git#worktrees#isolation#workflow#branching
Version
1.0.0
Category
Development
License
MIT
Created
2025-12-07
Source
path: skills/using-git-worktrees
Install
clawd add obra/using-git-worktrees

Using Git Worktrees

Overview

Git worktrees create isolated workspaces within a single repository, allowing you to work on multiple branches simultaneously without switching contexts or managing multiple clones. This skill provides a systematic approach to setting up git worktrees with proper directory selection and safety verification.

When to Use

Use this skill when:

  • Starting feature work that needs isolation from your current workspace
  • Before executing implementation plans where you need a clean, isolated environment
  • Working on multiple branches in parallel without context switching
  • You need baseline tests to pass before beginning work

Key Features

  • Smart directory selection - Follows a priority order to determine where to create worktrees
  • Safety verification - Ensures .gitignore is properly configured for project-local worktrees
  • Auto-detection - Automatically detects and runs appropriate setup commands (npm, cargo, pip, poetry, go)
  • Baseline verification - Runs tests to ensure the worktree starts in a clean state
  • Integration - Designed to work with other skills like brainstorming and plan execution

Core Principle

Systematic directory selection + safety verification = reliable isolation.