Tidy
Answers one question honestly: what state is this repository actually in? It reports by default, and never deletes anything unrecoverable.
Long-running work leaves residue — a branch merged three weeks ago, a worktree for a fix that shipped, a stash nobody remembers making, a commit that was never pushed.
When to run it
At the start of a session, to avoid the single most expensive mistake in multi-branch work: doing an hour of work in the wrong branch or the wrong worktree.
At the end of a session, to clear branches whose upstream is gone and worktrees whose work has landed, so the next session starts from a clean read.
What it looks at
- Branches that are merged, or whose upstream has been deleted.
- Worktrees that are stale, or whose branch no longer exists.
- Stashes, with enough context to judge whether they still matter.
- Uncommitted and unpushed work.
Report first, clean second
The default is a report. Cleaning happens only when you ask, and only for items that are confirmed and reversible.
The distinction matters more than it sounds. A merged branch is safe to delete because its commits are reachable from the branch it merged into. A stash is not, because nothing else points at it — so a tool that treats both as "clutter" is one command away from destroying work.
Heads — unpushed commits and stashes are the two kinds of residue that exist in exactly one place. Tidy surfaces them rather than removing them, because the only safe answer is the one you give deliberately.
Why start-of-session matters most
Wrong-branch work is expensive in a way that's disproportionate to how obvious the mistake looks afterwards. You don't discover it while working — you discover it at commit time, when the fix is either a careful cherry-pick or an hour redone.
Checking takes seconds, and it's the cheapest insurance in the set.
Next: Everyday use.