using-git-worktrees

Create isolated git worktrees with gitignore verification and baseline tests.

Updated Nov 24, 2025
One-click install
npx skills add https://github.com/ByronWilliamsCPA/.claude --skill using-git-worktrees-byronwilliamscpa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/ByronWilliamsCPA/.claude/tree/main/.claude/skills/using-git-worktrees
Command: npx skills add https://github.com/ByronWilliamsCPA/.claude --skill using-git-worktrees-byronwilliamscpa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Working on multiple git branches simultaneously often requires constant switching between branches, which risks losing uncommitted work and creates conflicts when multiple people or AI agents need to work on the same repository at the same time. This Skill eliminates that friction by enabling safe, isolated workspaces that share the same repository data.

Core Features & Use Cases

  • Smart worktree directory selection: Automatically prioritizes existing project-local .worktrees/ folders, respects CLAUDE.md project preferences, or prompts the user for their preferred location.
  • Built-in safety guardrails: Verifies worktree directories are gitignored to prevent accidental commits of isolated work, and runs baseline tests to confirm the new workspace starts in a clean state.
  • Edge case handling: Includes workflows for recovering vanished worktrees, managing gitignored deliverables that don't live in version control, and ensuring safe parallel work across multiple AI agent sessions.
  • Use Case: A developer can work on a new authentication feature in an isolated worktree while keeping their main workspace stable for urgent bug fixes, or multiple AI agents can collaborate on separate repository tasks without overwriting each other's changes.

Quick Start

Use the using-git-worktrees skill to set up an isolated workspace for your new feature branch with automatic safety checks and 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 use git worktrees for parallel feature development without disrupting my main workspace?

Git worktrees create isolated workspaces sharing the same repository data, enabling parallel feature development without constant branch switching or risking uncommitted work in your main workspace.

What is the best way to run multiple AI agent sessions on the same repository safely?

Git worktrees isolate parallel AI agent sessions into separate working directories, preventing multiple actors from overwriting each other's changes while collaborating on the same repository simultaneously.

How do I prevent my git worktree directory from being accidentally committed to version control?

Verify your worktree directory is listed in gitignore before creation. This Skill includes built-in safety guardrails that check gitignore status to prevent accidental commits of isolated worktree folders.

Can I automatically run baseline tests when setting up a new git worktree?

Yes, this Skill runs baseline test validation after setting up project dependencies in the new worktree, confirming the isolated workspace starts in a clean and functional state before development begins.

How do I recover from a vanished local git worktree state?

This Skill includes edge case handling workflows specifically designed to recover vanished local worktree state, restoring your isolated development environment when worktree directories unexpectedly disappear.

Does git worktree creation respect project-specific directory preferences?

Yes, worktree creation prioritizes existing project-local .worktrees/ folders, respects CLAUDE.md project preferences, or prompts you for a preferred location to ensure project-conformant directory selection.