git-clean-worktrees
Installation
SKILL.md
Clean Worktrees
Systematically find and remove git worktrees whose work is already on the main branch. The core problem this solves: worktrees created during feature work persist after the branch is merged, showing "modified" files that are actually already committed — creating confusion about what's merged and what isn't.
Why This Happens
Worktrees are created for isolation during feature work. When the branch
gets merged (squash-merge, regular merge, or cherry-pick), the worktree
doesn't disappear. It still has the branch checked out, and git status
inside it shows modifications relative to the worktree's HEAD — but those
changes are already on main. The worktree is stale but looks active.