using-git-worktrees

Create isolated git worktrees for feature branches with setup and test verification.

2|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Clay-HHK/claude-config --skill using-git-worktrees-clay-hhk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/Clay-HHK/claude-config/tree/main/skills/superpowers/using-git-worktrees
Command: npx skills add https://github.com/Clay-HHK/claude-config --skill using-git-worktrees-clay-hhk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers create an isolated workspace for feature development so changes do not contaminate the current working tree and prevents accidental tracking of worktree files in the repository.

Core Features & Use Cases

  • Safe directory selection and prioritization: Prefers .worktrees then worktrees, respects CLAUDE.md preferences, and prompts the user when location is ambiguous.
  • Safety verification: Verifies project-local directories are git-ignored and, if not, adds the ignore entry and commits the change to prevent accidental commits.
  • Automated creation and setup: Creates a new branch worktree at the chosen location, runs project setup commands (npm install, cargo build, pip/poetry, go mod) and executes tests to confirm a clean baseline.
  • Use Case: Start a feature branch in an isolated workspace, run dependency installs and tests, and only then begin implementation to avoid mixing changes with the main working tree.

Quick Start

Use the using-git-worktrees skill to create an isolated worktree for branch feature/auth in a project-local .worktrees directory after verifying it is git-ignored and running project setup and tests.

Frequently Asked Questions about using-git-worktrees

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an isolated git worktree for feature branch work?

To create an isolated git worktree, the skill selects a project-local directory, verifies it is git-ignored, creates a new branch worktree, runs project setup commands, and executes tests to confirm a clean baseline before you begin implementation.

What is git worktree workspace isolation and when do I need it?

Git worktree workspace isolation creates separate working directories for different branches, preventing cross-branch workspace contamination. You need it when running parallel branches or starting feature work to avoid mixing changes with your main working tree.

How do I prevent git worktree directories from being accidentally committed to my repository?

To prevent accidental commits of worktree files, the skill verifies that project-local worktree directories are listed in gitignore. If the directory is not ignored, it automatically adds the ignore entry and commits the safety change.

Can I run project setup and test validation automatically after creating a git worktree?

Yes, you can run project setup and test validation automatically. After creating a new branch worktree, the skill runs dependency installations like npm install or cargo build and executes tests to verify a clean baseline before development begins.

Does git worktree creation work with different project setup tools like npm, cargo, and pip?

Git worktree creation works with multiple project setup tools. The skill automatically detects and runs appropriate setup commands including npm install, cargo build, pip or poetry installations, and go mod commands to prepare the isolated workspace environment.

What is the best way to manage directory selection when creating multiple git worktrees?

The best way to manage directory selection for git worktrees is using prioritized locations. The skill prefers a .worktrees directory, then a worktrees directory, respects CLAUDE.md preferences, and prompts the user when the location is ambiguous.