worktrees

Detect dangling commits and orphan branches in Git worktrees.

8|2|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/mikeparcewski/wicked-garden --skill worktrees-mikeparcewski
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktrees
Source: https://github.com/mikeparcewski/wicked-garden/tree/main/skills/worktrees
Command: npx skills add https://github.com/mikeparcewski/wicked-garden --skill worktrees-mikeparcewski

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git worktrees introduce subtle workflows and three recurring bugs: subagent dangling commits, orphan branches with unique work, and time-sensitive garbage that can be lost to git gc. This skill provides detection commands, salvage decision flow, and trust-but-verify rules to keep worktrees safe and auditable when running multi-agent isolation.

Core Features & Use Cases

  • Detect and classify worktree-related issues (dangling commits, orphan branches, dead objects) without disturbing main.
  • Provide a salvage workflow to extract plans or land changes safely, with explicit safety checks.
  • Verify subagent reports landed in main and prune safely when appropriate, with lineage tracking across sessions.

Quick Start

Run the salvage flow on suspect branches using the commands outlined in refs/recipes.md to classify and safely delete or preserve worktrees.

Frequently Asked Questions about worktrees

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

FAQPage Schema
How do I detect dangling commits in a git worktree?

You detect dangling commits in a git worktree by running specialized detection commands that classify worktree-related issues, including dead objects and orphan branches, without disturbing the main branch or disrupting ongoing development.

What's the best way to salvage orphan branches with unique work in git?

The best way to salvage orphan branches is to use a dedicated salvage decision flow that extracts plans or lands changes safely. This process includes explicit trust-but-verify checks to ensure no unique work is lost during the recovery operation.

Why does git gc remove time-sensitive garbage from worktrees?

Git gc removes time-sensitive garbage from worktrees because unreferenced objects become eligible for permanent deletion during routine cleanup. This skill addresses the issue by detecting vulnerable dead objects before automatic garbage collection permanently destroys them.

How do I verify subagent commits landed correctly in a multi-agent environment?

Verify subagent commits landed correctly by applying trust-but-verify checks with lineage tracking across sessions. This skill confirms subagent reports are successfully merged into main and safely prunes branches only when verification is complete.

Can I use git worktree isolation for subagents without losing commits?

Yes, you can use git worktree isolation for subagents without losing commits by applying detection commands and a salvage workflow. This ensures subagent commits land correctly in main while safely preserving or pruning branches with lineage tracking.