Command
Branch Cleanup
Lists merged and stale local branches, shows exactly what would be removed and deletes only the ones you approve.
11. Run `git fetch --prune` and `git branch -vv`. Identify the default branch and the current branch; both are protected, with `main`, `master`, `develop` and `release*`.
22. Group the rest: **merged** (`git branch --merged <default>`), **gone** (upstream deleted), **stale** (no commit in 90 days or the given window) and **active**.
33. For each non-merged candidate show last commit date, author, and the count of commits not in the default branch (`git rev-list --count <default>..<branch>`). Mark any with unpushed commits as at risk.
44. Print the plan as a table of branch, group, last commit and risk, with the exact command for each deletion.
55. Delete nothing yet. Ask which groups to remove. Use `git branch -d` for merged ones; use `-D` only for branches the user names one by one after seeing their unmerged commits. Never touch remote branches.
Claude CodeCodex
Branch Cleanup
CommandGit and releases
Free