Keep your repositories light.
Finds the branches, worktrees and generated folders you no longer need, shows why each one is safe to remove,
and lets you undo anything for 30 days.
Website · Guides · Download · Install guide · How it stays safe · Build from source · Roadmap
If you work in many repositories, especially with AI coding agents, the leftovers pile up quietly: merged branches nobody
deleted, worktrees from agents that finished days ago, a node_modules in every copy. Cleaning them by hand means
checking each one, and one wrong force delete loses work.
Lopper does the checking for you.
Stuck on cannot delete branch used by worktree? The guide
shows the safe order to fix it by hand, with real git output. For every branch, worktree and generated folder it shows a verdict and the git
evidence behind it, you review a list, and everything it removes can be restored.
|
Branches and worktrees |
Agents |
|
Disk |
History and undo |
|
Only on this Mac |
Rules, offer only |
|
Command line |
Built for the Mac |
|
|
|
|
|
Nothing here is ever removed. |
Lopper's one job is to never remove work that exists nowhere else.
| It will | Only when |
|---|---|
| Offer a branch as safe | git confirms its commits are already in the default branch, or a pull request merged them (with the GitHub CLI) |
| Offer a worktree as safe | it has no uncommitted changes and no commits that exist nowhere else |
| Clear a generated folder | it is git-ignored, it is not a symlink, and it is checked again right before it moves to the Trash |
| Remove anything at all | you reviewed the list and confirmed it |
| Delete for good | it is something Lopper itself moved to the Trash, and you asked for it |
Every removal can be undone for 30 days from History. Rules only ever suggest. About 780 automated tests back this (see how it is checked), many of them against real git repositories created on the fly, because mocking git would hide exactly the cases that lose work.
Download. Get the DMG from Releases and drag Lopper to Applications.
brew install --cask zawalid/lopper/lopper # or with HomebrewmacOS blocks the first launch because Lopper is not signed with an Apple Developer ID. Open it once, then go to System Settings, Privacy & Security, Open Anyway (the same applies after a Homebrew install). The steps, updating and uninstalling are in the install guide.
Requirements: macOS 14 or later, and git (xcode-select --install). The GitHub CLI
(gh) is optional and adds pull request based merge detection.
The same engine is available in the terminal as lop, sharing the app's folders and undo history:
brew install zawalid/lopper/lop
lop scan # what can be removed, repository by repository
lop why feature/old-2 # the git evidence for one branch
lop clean # review the plan, confirm, remove; undo with `lop undo --last`
lop agents # worktrees left by Claude Code, Cursor, Codex and Conductor
lop risk # work that exists only on this Mac: unpushed commits, stashes, uncommitted changes
lop diagnostics # a report to paste into a bug report; nothing is sentEvery command has --json for scripts and AI agents. See the command line guide.
- Open Lopper. Pick your project folders from the suggestions, or let it search your Mac.
- Read the overview. One number says how much you can reclaim; the list shows where it is.
- Review and clean. Look at the list, uncheck anything you want to keep, confirm.
- Undo if you change your mind. The toast offers it straight away, and History keeps it for 30 days.
You need Xcode 16 or later and XcodeGen.
git clone https://github.com/Zawalid/Lopper.git
cd Lopper
scripts/dev.sh # build a Debug app and open it; add --watch to relaunch on save
swift test # engine tests
cd App && xcodegen generate && xcodebuild test -project Lopper.xcodeproj -scheme Lopper -destination 'platform=macOS'Try it on throwaway data instead of your own repositories:
scripts/demo-world/build.sh ~/LopperDemo
scripts/demo-world/run.shSources/Lopper |
the engine, no UI: scanning, classification, cleaning, undo |
Tests/LopperTests |
engine tests, using real git repositories |
App/LopperApp |
the SwiftUI app |
scripts |
dev loop, release, demo world |
docs |
development, releasing, settings file, roadmap |
Can it delete my unmerged work?
No. A branch or worktree holding commits that exist nowhere else is never offered as safe. If Lopper cannot prove something is merged, it shows "needs a look" and lets you decide. Even then, removed branches are restorable from History at their exact commit.
Does it send anything anywhere?
No. There is no account, no analytics and no crash reporting. Lopper only runs git (and gh, if you have it) on your
machine, and reads the folders you chose.
The one exception is update checks, which are off until you turn them on in Settings, General. Then Lopper asks GitHub once a day for a small file that says whether a newer version exists, shows you what is new, and installs nothing until you press Install Update. See docs/updates.md.
If something goes wrong, Settings, About, Diagnostics shows the report a bug report would contain, with repository and branch names left out unless you include them. You copy or save it yourself; Lopper never sends it.
Why does macOS warn me on the first launch?
The app is not signed with an Apple Developer ID, so macOS Gatekeeper blocks it the first time. Open it, then choose Open Anyway in System Settings, Privacy & Security; you only do this once. The install guide has the steps. Lopper is open source, so you can read it or build it yourself.
Which AI tools does it understand?
Claude Code, Cursor, Codex and Conductor worktrees are recognized by their layout, with the tool shown next to each one. Worktrees from other tools are still handled as ordinary git worktrees.
Where does it keep its data?
In ~/Library/Application Support/Lopper: your settings as a readable JSON file and the undo log. See the
settings file format.
Remote branch cleanup, stash cleanup, GitLab and Bitbucket merge detection and in-app updates are next. The full list is in the roadmap.
Issues and pull requests are welcome. Read CONTRIBUTING.md first; changes to anything that removes things need tests that prove the safety rules still hold. For security problems see SECURITY.md.
Made by Walid Zakan · GitHub · X