using-git-worktrees

Create isolated git worktrees with ignored directories and validated test baselines.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git workflows that require working on multiple branches simultaneously risk workspace contamination, accidental commits, and fragile branch switching; this skill provides a reproducible way to create isolated worktrees and enforce safety checks so implementation work begins from a clean baseline.

Core Features & Use Cases

  • Directory selection with priority: Detects and prefers .worktrees over worktrees, checks CLAUDE.md for configured preferences, and prompts the user when no preference exists.
  • Safety verification and remediation: Ensures project-local worktree directories are git-ignored, can add and commit .gitignore entries when missing, and prevents accidental tracking of worktree contents.
  • Automated creation and setup: Creates branch-backed worktrees, auto-runs dependency installs and builds based on common project files (package.json, Cargo.toml, pyproject.toml, go.mod), and runs tests to verify a clean baseline before proceeding.
  • Use case: Start isolated feature work for Node, Python, Go, or Rust projects to implement changes without switching or contaminating your primary workspace.

Quick Start

Use the using-git-worktrees skill to create a verified, ignored project-local worktree for branch feature/auth, run the project's setup, and validate that tests pass before starting 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 create an isolated git worktree to prevent workspace contamination?

To create an isolated git worktree, use this skill to verify or create a worktrees directory, ensure the location is git-ignored, create the branch-backed worktree, run project setup commands, and validate a clean test baseline before starting implementation.

How do I keep my git worktrees directory from being accidentally tracked in version control?

To keep your git worktrees directory from being accidentally tracked, this skill verifies project-local worktree locations are git-ignored, automatically adding and committing .gitignore entries when missing to prevent accidental tracking of worktree contents.

Can I automate dependency installation when setting up git worktrees for Node, Python, Go, or Rust projects?

Yes, you can automate dependency installation for git worktrees. This skill auto-runs dependency installs and builds by detecting common project files like package.json, Cargo.toml, pyproject.toml, and go.mod during the worktree creation process.

What is the best way to run parallel git branches without switching or contaminating my primary workspace?

The best way to run parallel git branches without contaminating your workspace is creating isolated git worktrees. This skill establishes branch-backed worktrees in project-local directories, enforcing safety checks so implementation work begins from a clean baseline.

Does setting up a new git worktree run tests to verify a clean baseline before starting feature work?

Yes, setting up a new git worktree runs tests to verify a clean baseline. After creating the branch-backed worktree and auto-running project setup commands, this skill validates that tests pass before proceeding with implementation.

How does directory selection work when creating multiple git worktrees in a local repository?

Directory selection for git worktrees prioritizes detecting a .worktrees directory over a standard worktrees directory, checks CLAUDE.md for configured preferences, and prompts the user when no preference exists to ensure safe project-local isolation.