using-git-worktrees

Create isolated git worktrees and run baseline tests in a separate directory.

1|Updated May 5, 2026
One-click install
npx skills add https://github.com/yashs33244/my-mac-claude --skill using-git-worktrees-yashs33244
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/yashs33244/my-mac-claude/tree/main/skills/superpowers/using-git-worktrees
Command: npx skills add https://github.com/yashs33244/my-mac-claude --skill using-git-worktrees-yashs33244

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents accidental changes to your current branch by ensuring feature work runs in an isolated git worktree, with clear detection and safe fallbacks.

Core Features & Use Cases

  • Isolation detection: Detects whether you are already in a linked worktree (and avoids creating nested worktrees).
  • Native-first workspace creation: Uses native platform worktree tools when available, falling back to git worktree add only when necessary.
  • Safe project hygiene: Verifies project-local worktree directories are git-ignored before creating them, and runs dependency setup and baseline tests in the new workspace.
  • Use Case: Starting an implementation plan for a change while keeping the original workspace untouched, so you can test and validate in a clean environment before proceeding.

Quick Start

Use the using-git-worktrees skill to set up an isolated workspace for your feature work and run a clean baseline test before implementation.

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I isolate feature work in a git worktree without affecting my current branch?

Git worktrees allow starting feature work in an isolated workspace, protecting the current branch from unintended changes by applying stepwise isolation detection and clean test verification in a separate directory.

What happens if git worktree creation is blocked or fails?

If native worktree creation is blocked, the system uses a sandbox fallback to recover safely, preferring native platform worktree tools first and only falling back to git worktree add when necessary.

Do I need to manually git-ignore the directory before creating a worktree?

No, you do not need to manually ignore it. The process verifies project-local worktree directories are git-ignored beforehand using git check-ignore to ensure safe project hygiene before creation.

Can I use git worktrees if I am already inside a linked worktree?

Yes, but it avoids creating nested worktrees. The isolation detection mechanism identifies if you are already in a linked worktree and prevents redundant workspace creation to maintain branch isolation.

What is the best way to run a clean test baseline before starting an implementation plan?

The best way is setting up an isolated git worktree, which runs automated dependency environment setup and clean test verification in the new workspace to establish a reliable baseline before implementation.