using-git-worktrees

Create isolated git worktrees with automatic setup and safety checks.

6|1|Updated Nov 8, 2025
One-click install
npx skills add https://github.com/LEEI1337/phantom-neural-cortex --skill using-git-worktrees-leei1337
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/LEEI1337/phantom-neural-cortex/tree/main/.claude/skills/using-git-worktrees
Command: npx skills add https://github.com/LEEI1337/phantom-neural-cortex --skill using-git-worktrees-leei1337

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the problem of managing multiple, isolated development contexts within a single Git repository. It prevents accidental commits, ensures clean baselines for new features, and streamlines the setup of new development environments, saving time and reducing complexity when switching between tasks or branches.

Core Features & Use Cases

  • Isolated Workspaces: Create separate, clean directories for feature work without affecting your main repository.
  • Smart Directory Selection: Automatically or interactively determines the best location for new worktrees, respecting project conventions.
  • Safety Verification: Ensures .gitignore is correctly configured to prevent accidental commits of worktree contents.
  • Automated Setup: Detects project type (Node.js, Rust, Python, Go) and runs npm install, cargo build, pip install, etc., automatically.
  • Use Case: Before starting a new feature, use this skill to create a fresh, isolated environment, ensuring your changes are contained and won't interfere with other ongoing work.

Quick Start

Use the using-git-worktrees skill to set up an isolated workspace for my new 'auth' feature.

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 isolated Git worktrees for separate feature branches?

Git worktrees let you create isolated directories for different branches without switching contexts in your main workspace. Use the using-git-worktrees skill to automatically set up a clean environment, run project setup commands, and verify your .gitignore configuration—keeping feature work safely separated.

What's the best way to manage multiple development contexts in one repository?

Worktrees solve this by creating separate, independent checkouts of different branches. The skill detects your project type (Node.js, Rust, Python, Go), runs baseline setup automatically, and places worktrees in project-local or global locations based on your project conventions.

Can I prevent accidental commits when working across multiple feature branches?

Yes. Isolated worktrees keep each branch's changes confined to its own directory. The skill verifies .gitignore is configured correctly so worktree contents won't leak into commits, and baseline tests confirm your environment is ready before you start.

Do I need to manually set up dependencies for each new worktree?

No. The skill auto-detects your project setup (npm install, cargo build, pip install, or Go module commands) and runs it automatically when creating a worktree, so each environment is ready immediately.

Where should worktrees be stored in my project?

The skill intelligently chooses between project-local locations (.worktrees or worktrees directory) and global storage (~/.config/superpowers/worktrees) by checking CLAUDE.md preferences and your project structure, then prompts you to confirm.

Why use Git worktrees instead of just switching branches in one workspace?

Worktrees let you work on multiple branches simultaneously without rebuilding dependencies or losing uncommitted changes. Each worktree is independent, so you avoid merge conflicts, keep baselines clean, and switch contexts instantly.