lopper

Find Git worktrees, check their status and disk usage, and remove the ones you no longer need.

install

curl -fsSL https://raw.githubusercontent.com/shinokamix/lopper/main/install.sh | sh
irm https://raw.githubusercontent.com/shinokamix/lopper/main/install.ps1 | iex
go install github.com/shinokamix/lopper/apps/lopper/cmd/lopper@latest

why lopper

A task ends, but its worktree stays on disk. Dependencies and build output, such as node_modules, .venv, and target/, can take up gigabytes across unused worktrees.

Git lists worktrees one repository at a time. Checking each repository leaves you to work out which worktrees you still need.

lopper brings worktrees into one list, grouped by repository. You can compare their sizes, check their status, and select the ones to remove. Purple marks worktrees whose changes are merged.

commands

lopper              # open the interactive UI
lopper ~/code       # scan a specific directory
lopper scan --json  # print scan results as JSON
lopper rm ../wt     # remove a worktree if safe
lopper update       # update to the latest release

faq

Does it delete my branches?

No. lopper removes the worktree directory, but keeps the branch and its commits. You can check out the branch again later.

How does it decide what's safe to remove?

lopper checks for merged changes and uncommitted work. It recognizes merged changes even after a squash merge, rebase, or cherry-pick. In the interactive UI, you must confirm a warning before removing an unsafe worktree. With lopper rm, you must use --force. lopper treats locked worktrees and worktrees that Git cannot check as unsafe.

What is the base branch?

The base branch is the branch that lopper checks your changes against. lopper uses the branch that origin/HEAD points to. If origin/HEAD is missing, lopper looks for main, then master.

Why do worktrees take up so much space?

A worktree can contain dependencies and build output, such as node_modules, .venv, or target/. These files take up space even if Git ignores them. Removing the worktree directory frees that space.

Does it find worktrees created by coding agents?

Yes. lopper scans your home and temporary directories, including worktrees created by coding agents. To scan a specific directory, run lopper ~/code.

Does it use the network?

lopper checks GitHub for new releases in the background. To disable the check, set LOPPER_NO_UPDATE_CHECK=1.