The problem
Developers accumulate dozens of stale local git branches and cleaning them up requires manually running git log --merged, inspecting each branch, and issuing git branch -d repeatedly — there is no fast interactive way to review and bulk-delete branches in one pass.
If you've hit this before, you know how it goes — you run git branch, see 40+ branches, and start manually checking which ones are merged before issuing git branch -d one at a time.
As a solution, I created branch-cleaner
Interactively browse and delete stale git branches with arrow keys — see merge status, age, and last commit at a glance
It's zero-dependency Node.js, so you can run it immediately without installing anything:
npx branch-cleaner
What you see:
branch-cleaner UP/DOWN navigate d mark Enter delete r refresh q quit
feat/auth-refactor 42d merged add JWT refresh logic
fix/login-redirect 38d merged redirect after oauth callback
feat/payment-v2 15d unmerged WIP: stripe webhook handler
main (current) 0d merged release v2.4.1
2 branches marked for deletion. Press Enter to confirm.
Deleted 2 branches.
How it works
Pure Node.js using child_process.execSync to call git branch -v --sort=-committerdate and git branch --merged, then renders a live arrow-key-navigable list with ANSI escape codes and raw terminal mode — zero dependencies.
Why I built it
Found this recurring complaint on r/git and r/webdev — developers with long-running projects end up with 30-60 local branches after a few months and the git branch -d workflow is tedious. Tools like git-branch-pruner exist on npm but they batch-delete without showing you what you are removing. An interactive TUI where you can see merge status and age side-by-side before confirming fills this gap cleanly.
Try it
npx branch-cleaner --help
Part of µ micro — one new developer tool, shipped every day. All tools are zero-dependency Node.js and run instantly with npx.
Top comments (0)