worktree-manager

Create, list, clean, and diagnose Git worktrees under .claude/worktrees.

10|3|Updated Mar 7, 2026
One-click install
npx skills add https://github.com/Cynthia1070711/PHYCOOL_Tools --skill worktree-manager-cynthia1070711
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree-manager
Source: https://github.com/Cynthia1070711/PHYCOOL_Tools/tree/main/config-templates/claude/skills/worktree-manager
Command: npx skills add https://github.com/Cynthia1070711/PHYCOOL_Tools --skill worktree-manager-cynthia1070711

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing multiple Git worktrees for parallel development often leads to orphaned folders, stale registrations, and inconsistent states between Git's records and the actual filesystem. This Skill provides a complete operational guide for creating, listing, cleaning, and diagnosing worktrees without triggering unwanted GitHub authentication. ## Core Features & Use Cases - Create Worktrees: Add new worktrees based on the current HEAD with story-based branch naming, supporting batch creation for multi-agent parallel scenarios. - Orphan and Ghost Detection: Compare git-registered worktrees against actual folders to identify orphans (folder exists, not registered) and ghosts (registered, folder missing). - Smart Cleanup: Automatically choose the correct removal method (git worktree remove, rm -rf, or git worktree prune) based on the detected state, plus bulk clean-all with a structured report. - Health Diagnosis: Check .gitignore coverage, orphan branches, disk usage, and uncommitted changes across all worktrees. - Use Case: You are running three parallel agents on stories ba-3, ba-6, and ba-9. Use this Skill to batch-create their worktrees, then later run clean-all to remove everything and verify only the main directory remains. ## Quick Start Ask the AI to create a new worktree named ba-3 and then list all worktrees to verify it was registered correctly.

Frequently Asked Questions about worktree-manager

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Git worktree without triggering GitHub authentication?

Run git worktree add with a local path and HEAD as the base, for example git worktree add .claude/worktrees/<name> -b story/<name> HEAD. This avoids remote fetch operations that trigger authentication prompts.

How to clean up orphaned Git worktree folders?

Compare git worktree list output against the actual folders in .claude/worktrees. For folders not registered with Git, remove them with rm -rf; for registered entries with missing folders, run git worktree prune.

Why does git worktree remove fail with uncommitted changes?

Git refuses to remove a worktree containing uncommitted modifications as a safety measure. Use the --force flag with git worktree remove to delete the worktree and its registration despite pending changes.

Can I create multiple Git worktrees at once for parallel agents?

Yes, run multiple git worktree add commands sequentially, each with a unique name and branch such as story/ba-3, story/ba-6, and story/ba-9. Each worktree gets an independent staging area while sharing the same .git object store.

What happens if the branch name already exists when adding a worktree?

The -b flag fails when the branch already exists. Omit -b and reference the existing branch directly: git worktree add .claude/worktrees/<name> story/<name>.