Skip to content
ZawalidPublic

About

A native macOS app and CLI that finds the git branches, worktrees and generated folders you no longer need, shows why each is safe to remove, and undoes anything for 30 days.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Lopper

Lopper

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.

Release CI License macOS 14+ Swift 6

Website  ·  Guides  ·  Download  ·  Install guide  ·  How it stays safe  ·  Build from source  ·  Roadmap


Lopper overview: 453.7 MB ready to reclaim, with the repositories that hold the most

Why

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.

Features

Branches and worktrees
Merged branches and finished worktrees are marked safe, each with the evidence: already in the default branch, merged through a pull request, remote branch deleted. Anything that holds work found nowhere else is protected or flagged.

Agents
Worktrees left behind by Claude Code, Cursor, Codex and Conductor: how old they are, whether they hold unmerged or uncommitted work, and which are finished and can be reclaimed in one step.

Disk
Generated folders (node_modules, build output, caches) by project, by kind, or as a map, plus developer caches outside your projects. Clearing moves to the Trash; reinstalling is optional.

History and undo
Every removal is logged with the reason it was safe. Restore one item or a whole cleanup within 30 days; branches come back at their exact commit.

Only on this Mac
Unpushed commits, uncommitted changes in worktrees, stashes and half-done rebases: the work that has no copy anywhere else, listed so you can back it up. It never removes or pushes anything.

Rules, offer only
"Branches merged more than 14 days ago", "projects untouched for 60 days". Rules suggest, a weekly digest reminds you, and nothing is ever removed without you confirming a list.

Command line
lop runs the same engine in the terminal, with --json for scripts and AI agents, and shares your folders and undo history with the app.

Built for the Mac
Native SwiftUI, a menu bar popover, a command palette (Command-K), onboarding that finds your project folders, light and dark appearance. No account, no analytics, and it goes online only if you turn on update checks.


A repository: every branch and worktree with its verdict, and the evidence behind it Agents: worktrees left behind by Claude Code, Cursor, Codex and Conductor
Disk map: generated folders and developer caches sized by bytes History: every removal, why it was safe, and how long it can be restored
Only on this Mac: unpushed commits, uncommitted changes and stashes by repository, with one row open to show its commits

Nothing here is ever removed.
This page lists the work that exists only on your Mac, most at risk first. Filter it, search it, and open a row to see the commits or files inside, with a copyable git push for each branch. Lopper reads it and never pushes for you.

How it stays safe

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.

Install

Download. Get the DMG from Releases and drag Lopper to Applications.

brew install --cask zawalid/lopper/lopper    # or with Homebrew

macOS 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.

Command line

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 sent

Every command has --json for scripts and AI agents. See the command line guide.

Quick start

  1. Open Lopper. Pick your project folders from the suggestions, or let it search your Mac.
  2. Read the overview. One number says how much you can reclaim; the list shows where it is.
  3. Review and clean. Look at the list, uncheck anything you want to keep, confirm.
  4. Undo if you change your mind. The toast offers it straight away, and History keeps it for 30 days.

Build from source

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.sh
Sources/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

FAQ

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.

Roadmap

Remote branch cleanup, stash cleanup, GitLab and Bitbucket merge detection and in-app updates are next. The full list is in the roadmap.

Contributing

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.

Author

Made by Walid Zakan  ·  GitHub  ·  X

License

MIT

About

A native macOS app and CLI that finds the git branches, worktrees and generated folders you no longer need, shows why each is safe to remove, and undoes anything for 30 days.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages