← ClaudeAtlas

cleanuplisted

Remove what shipping left behind — local and remote branches whose pull request merged, worktrees for those branches, and ignored residue a move stranded, such as a __pycache__ that git mv could not see. Every deletion is verified against the forge first, and anything unmerged or unexplained is reported rather than removed. Use when asked to clean up, tidy the repo, delete merged branches, remove stale branches, prune the remote branches, clear out old worktrees, 清理一下, 清掉合并过的分支, 删掉没用的分支, 清理远程分支, 收拾一下仓库. Not for discarding uncommitted work, resetting a branch, or removing untracked files you have not been shown.
Misoto22/skills · ★ 0 · AI & Automation · score 76
Install: claude install-skill Misoto22/skills
# Cleanup Remove what shipping left behind. Nothing else. Read [shared/git.md](shared/git.md) first — in particular that a rebase or squash merge rewrites commits, so `git branch --merged` does not list a branch that landed. Every deletion here is verified against the forge, never against git alone. **Default to `--dry-run` reasoning even without the flag: list everything, then delete.** With no scope flag, all four passes run. With any of `--branches`, `--remote`, `--worktrees`, `--residue`, only those. `--no-remote` drops the remote pass and keeps the rest — for a fork you cannot push to, or when you only want the local side tidied. ## 0. Inventory, before deleting anything ```bash git fetch --prune git branch -vv git worktree list git status --porcelain git ls-remote --heads origin ``` `git fetch --prune` only deletes local `origin/*` tracking refs. It does not touch a single branch on the remote, which is why the remote list is read separately — a branch missing from `git branch -vv` may still be sitting on the forge. Print one table. Nothing is removed until it is printed: > **Cleanup `<repo>` → `<base>`** > > | Kind | Name | Finding | Action | > |---|---|---|---| > | branch | `<name>` | merged #12 · unmerged: N commits · no PR, contained in base | delete · keep: reason | > | remote | `<name>` | merged #12 · open #22 · no PR | delete · keep: reason | > | worktree | `<path>` | clean, branch merged · dirty: N files | remove · keep: reason | > | residue | `<path>` |