using-git-worktrees

Creates isolated git worktrees with directory selection, ignore verification, and baseline test validation.

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/ByronWilliamsCPA/plugin --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/plugin/tree/main/plugins/wff-code/skills/using-git-worktrees
Command: npx skills add https://github.com/ByronWilliamsCPA/plugin --skill using-git-worktrees-byronwilliamscpa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on multiple branches or running parallel agent sessions in a single checkout causes branch switching friction, staging races, and lost work. This Skill sets up isolated git worktrees so each feature or session gets its own working directory sharing one repository. ## Core Features & Use Cases - Systematic directory selection: Follows a priority order of existing .worktrees/ or worktrees/ directories, then CLAUDE.md preferences, then asks the user. - Safety verification: Confirms project-local worktree directories are gitignored before creation, and auto-detects project setup (npm, cargo, uv, poetry, pip, go) plus runs baseline tests. - Multi-session and recovery guidance: Covers worktree-per-actor isolation for concurrent agents, recovering vanished branches by checking origin/main, handling gitignored deliverables, and targeting correct absolute paths across worktrees. - Use Case: Before implementing an approved feature plan, create an isolated worktree at .worktrees/feature-auth, install dependencies, verify tests pass, and develop without disturbing the main checkout. ## Quick Start Use the using-git-worktrees skill to set up an isolated workspace for my new feature branch and verify the test baseline passes.

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 a new feature branch?▼

Run git worktree add with a target path and -b flag for the new branch, such as git worktree add .worktrees/auth -b feature/auth. Verify the directory is gitignored first, then install dependencies and run the project test suite to confirm a clean baseline.

Where should git worktrees be stored in a project?▼

Prefer an existing .worktrees directory, then worktrees, then any preference stated in CLAUDE.md, and otherwise ask the user. Project-local directories must be gitignored; a global location like ~/.config/superpowers/worktrees needs no ignore check.

Can multiple agents work on the same repo concurrently?▼

Yes, but each session must use its own git worktree because the index and working tree are per-worktree state. Sharing one working tree causes staged changes to interleave across sessions and lose work.

What should I do when a worktree or branch disappears mid-session?▼

Run git fetch and inspect origin/main for your changes matched by subject and content before reconstructing anything. In multi-actor repos, vanished local state often means the work was already merged, and blind reconstruction creates duplicate pull requests.

Why does git stash pop lose my git rm --cached changes?▼

git stash restores the working tree but drops pure index-only changes on pop, so staged deletions from git rm --cached silently revert to tracked. Use git stash --keep-index, run hooks directly, or test in a separate worktree instead.