clean-worktrees

Installation
SKILL.md

Clean worktrees

Remove the current repository's stale worktrees in one pass, then report what was removed, what stayed, and why. Do not ask for confirmation along the way: safety comes from the narrow targets below, and anything that cannot be judged stays where it is.

Find the candidates

Fetch the remote first. The base is the branch the user names, otherwise the remote's advertised default branch. Read git worktree list --porcelain for registered worktrees. For folders that lost their registration, look only inside folders of the default checkout that also hold a registered linked worktree, such as .claude/worktrees/.

A worktree is a candidate when one of these holds:

Installs
5
GitHub Stars
3
First Seen
14 days ago