using-git-worktrees

Create isolated Git worktrees with baseline test validation.

14|3|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/lgbarn/devops-skills --skill using-git-worktrees-lgbarn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/lgbarn/devops-skills/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/lgbarn/devops-skills --skill using-git-worktrees-lgbarn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Isolate feature work by creating isolated Git worktrees so changes do not pollute the main workspace.

Core Features & Use Cases

  • Directory-prioritized worktree selection (prefers .worktrees, then worktrees, then global options) with safety checks.
  • Automatic directory preference via CLAUDE.md or explicit user prompts when ambiguity remains.
  • Safe creation workflow including git ignore verification and baseline test validation before proceeding.

Quick Start

Create an isolated Git worktree for your current project following the priority rules, verify the worktree is ignored by Git, and run the project setup.

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 a Git worktree for isolated feature development?

Creating a Git worktree involves checking existing directories (.worktrees or worktrees), reading CLAUDE.md for preferences, and prompting for a location. The process ensures worktrees are ignored by Git and baseline tests pass before use.

What is the best way to keep feature work isolated from my main workspace?

Using Git worktrees keeps feature work isolated from your main workspace. The system auto-detects the project name, creates a worktree with the correct branch, runs project setup, and reports a clean baseline ready for development.

Does the worktree creation workflow verify that tests pass before switching?

Yes, the worktree creation workflow includes safe creation steps like git ignore verification and baseline test validation. It ensures tests pass in the new worktree before proceeding with feature work.

Can I configure directory preferences for Git worktrees using CLAUDE.md?

Yes, you can configure directory preferences for Git worktrees using CLAUDE.md. The system prioritizes existing directories like .worktrees, then checks CLAUDE.md, and finally prompts the user when ambiguity remains.

How does the worktree setup handle project dependencies for common ecosystems?

The worktree setup runs project setup automatically for common ecosystems. It auto-detects the project name, creates the worktree with the correct branch, and executes the necessary setup commands to prepare the environment.

When should I use Git worktrees instead of cloning a repository?

Git worktrees are ideal when you need to isolate feature work without polluting the main workspace or cloning the entire repository. They provide a clean baseline by creating linked working trees with correct branches and verified ignored paths.