worktree-hygiene

Installation
SKILL.md

Worktree Hygiene

Related Skills: git for branch creation, staging, and commit messages. standalone-commits for reviewable units. pull-request for merge strategy.

Four harnesses (warp, codex, opencode, conductor) mint worktrees here and nothing reaps them, so they accumulate. The cure is to reap on close: when a branch lands, remove its worktree and delete the branch in the same motion. This skill is the safe procedure for doing that, one-off or as a periodic sweep.

The reap signal (and the trap)

"Branch merged" is not sufficient to reap. A merged branch routinely carries live uncommitted edits in its working tree; removing it with --force destroys that work. The real signal is:

reap = (branch fully contained in origin/main)  AND  (working tree clean OR only throwaway dirt)

Use git merge-base --is-ancestor <branch> origin/main for containment: if true, every commit on the branch is in origin/main, which is airtight even when the branch sits on a stacked base. git cherry origin/main <branch> shows unmerged commits (+ lines).

Audit procedure

Fetch first if origin/main is stale, then classify every worktree:

Installs
3
GitHub Stars
4.7K
First Seen
Jun 24, 2026
worktree-hygiene — epicenterhq/epicenter