cleanup-dangling-worktrees
Installation
SKILL.md
Cleanup Dangling Worktrees
Overview
Git worktrees accumulate over time as features are developed and merged. This skill safely cleans up worktrees that are no longer needed because their associated feature PRs have been merged.
Core principle: Only remove a worktree if its feature PR is CONFIRMED merged. Never remove active development worktrees.
Safety Rules
A worktree is ONLY considered dangling if ALL of these are true:
- The worktree's branch has an associated PR
- That PR has been MERGED (not just closed)
- The worktree has no uncommitted changes
- The worktree has no unpushed commits
NEVER remove a worktree if: