salvage
Installation
SKILL.md
Salvage
Salvage is recovery first and disposal second. The job is to find work that exists in exactly one place, get it somewhere safe, and only then clear away what is provably redundant.
Run it in that order or not at all. A cleanup that deletes before it rescues is how a week of work disappears, and the reflog does not cover the two worst cases: uncommitted changes in a worktree you remove, and a branch whose commits were never pushed anywhere.
What actually gets lost
Worst first. This ordering is your rescue order when time is short.
- Uncommitted changes in a removed worktree. Nothing records them. No reflog, no recovery.
- A detached HEAD carrying commits. Reachable from no ref, so the next
gctakes it. - Stash entries. Reachable but invisible, and one mistyped
git stash clearfrom gone. - Unpushed commits. Reflog holds them ~90 days, on one machine.
- A branch deleted while unmerged. Same window, but nobody looks - the name is gone too.
Three buckets
Every worktree, branch and stash lands in exactly one. Anything you cannot place goes in the first bucket, not the last.