using-git-worktrees

Create isolated git worktrees with safety checks and project setup.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/HTRamsey/claude-config --skill using-git-worktrees-htramsey
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/HTRamsey/claude-config/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/HTRamsey/claude-config --skill using-git-worktrees-htramsey

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you start feature work in isolated git worktrees to keep your main workspace clean and avoid polluting the repository.

Core Features & Use Cases

  • Directory prioritization: Reuses existing hidden or visible worktree directories when present.
  • Safety verification: Checks .gitignore to prevent accidental commits of worktree contents.
  • Flexible location: Falls back to global storage if project-local options are unavailable.
  • Project setup and baseline verification: Auto-installs dependencies and verifies a clean baseline when a new worktree is created.

Quick Start

command example: Create a new worktree for feature-X: git worktree add .worktrees/feature-X -b feature-X cd .worktrees/feature-X

Auto-detect and install project dependencies if needed

Frequently Asked Questions about using-git-worktrees

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

FAQPage Schema
How do I set up isolated git worktrees for parallel feature development?

Git worktrees create isolated branches in separate directories, letting you develop multiple features simultaneously without switching contexts in your main workspace. Use `git worktree add .worktrees/feature-name -b feature-name` to create a new worktree, then navigate into it and run project setup commands.

Can I use git worktrees to avoid polluting my main workspace?

Yes. Worktrees isolate feature work in dedicated directories so your primary checkout stays clean. The Skill enforces .gitignore safety checks to prevent accidental commits and auto-detects project dependencies to set up each worktree with a clean baseline.

What happens when I create a new git worktree—do I need to install dependencies manually?

No. The Skill auto-detects your project's build tooling (npm, cargo, pip, poetry, go) and installs dependencies automatically. It then runs baseline tests to verify the worktree is ready for development.

Where should I store my git worktrees in the project directory?

The Skill prioritizes `.worktrees` or `worktrees` directories if they exist, checks your CLAUDE.md preferences next, then falls back to global storage. Reusing existing worktree directories avoids duplication and keeps your repository organized.

Do git worktrees work with all project types and dependency managers?

Git worktrees work with any git repository. The Skill supports npm, cargo, pip, poetry, and go for automatic dependency installation. If your project uses a different tooling, you can still create worktrees manually and run setup commands yourself.

Why should I check .gitignore when using git worktrees?

Worktree directories must be in .gitignore to prevent accidental commits of worktree contents into version control. The Skill verifies this safety check automatically before creating a new worktree.