using-git-worktrees

Create isolated git worktrees with directory selection and test verification.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many development tasks require an isolated workspace so feature work does not interfere with the primary working tree; this Skill standardizes creating and verifying git worktrees to prevent accidental commits, environment contamination, and ambiguous directory locations.

Core Features & Use Cases

  • Deterministic directory selection: preferrs .worktrees, falls back to worktrees, reads CLAUDE.md preferences, or prompts the user.
  • Safety verification: ensures project-local worktree directories are listed in .gitignore and commits the fix if missing.
  • Automated setup and baseline checks: auto-detects toolchains (Node, Rust, Python, Go), runs appropriate dependency setup, and verifies a clean test baseline before confirming readiness.
  • Use Case: Start feature development on a new branch while running the main workspace and CI tests independently to avoid cross-contamination.

Quick Start

Create a new worktree for branch feature/auth in the preferred worktrees directory, ensure the directory is added to .gitignore and committed, run the project's dependency install, and verify tests pass before proceeding.

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 for feature development without contaminating my main workspace?

You create an isolated git worktree by using deterministic directory selection rules, verifying .gitignore entries, auto-detecting toolchain setup commands, and running baseline tests to ensure a clean environment.

What is the best way to manage parallel development branches using git worktrees?

Git worktrees allow you to run parallel development by creating isolated directories for separate feature branches, preventing cross-contamination between your primary working tree and new implementation tasks.

How does git worktree isolation prevent accidental commits and environment contamination?

Git worktree isolation prevents accidental commits and environment contamination by standardizing directory locations and enforcing .gitignore verification, ensuring project-local worktree paths are properly ignored and committed before development begins.

Does git worktree creation work with Node, Rust, Python, and Go project toolchains?

Yes, git worktree creation auto-detects Node, Rust, Python, and Go toolchains, automatically running the appropriate dependency setup commands and verifying a clean test baseline before confirming environment readiness.

Why do I need to verify .gitignore before creating a project-local git worktree?

You need to verify .gitignore before creating a project-local git worktree to prevent the isolated directory from being tracked by version control, and this Skill automatically commits the fix if the entry is missing.

When should I not use a git worktree for branching and testing?

You should avoid git worktrees when your project lacks clear directory selection preferences or when automated toolchain detection and baseline test verification are unavailable, as these safety checks are required for a clean environment.