using-git-worktrees · git:20260507.56f011d · 2026-05-07 · sha256 930e1dea882d5c57

using-git-worktrees git:20260507.56f011dA

Immutable. This exact content is served forever at /api/v1/blob/930e1dea882d5c57.

---
name: using-git-worktrees
description: Use when starting feature work that needs isolation from current workspace or before executing implementation plans.
graph:
  domains: [domain:software-engineering]

---

# Using Git Worktrees

## Overview

Create isolated workspaces sharing the same repository. Systematic directory selection + safety verification.

**Core principle:** Isolated workspace before implementation.

## Process

1. Check existing directories (.worktrees/ or worktrees/)
2. Verify directory is gitignored
3. Create worktree with new branch
4. Run project setup (auto-detect npm/cargo/pip/go)
5. Verify clean test baseline
6. Report ready

## Safety

- Always verify worktree directory is gitignored
- Always run baseline tests
- Report failures before proceeding

## Agents Used

- Process agents referenced in `superpowers-workflow.js`

## Tool Use

Referenced by `executing-plans` and `subagent-driven-development` processes.