WispAgents

Worktrash — Git skill for Claude Code

Git community

The git worktrees your coding agents left behind: see what they hold and what they cost on disk, remove the ones that hold nothing.

How to install Worktrash

This entry records only its repository, not the path inside it, so there is no exact command to give. Open WispAgents/worktrash and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Worktrash does

The git worktrees your coding agents left behind: see what they hold and what they cost on disk, remove the ones that hold nothing. Branches always stay.

Alternatives in Git

  • Clean Worktrees (Automatic) — Automatically remove all worktrees for branches merged into master 25.5k ★
  • Worktree Rm — Remove a git worktree and optionally delete its branch 387 ★
  • Drive Acquisition — Work GitHub issues that drive acquisition — verify relevance, close stale ones, fan out at most two engineer a 324 ★

README

worktrash

**The git worktrees your coding agents left behind.**

Claude Code, Codex, Cursor and friends work in git worktrees: one checkout per task, each with its own `node_modules` and build output. The task ends, the folder stays. A few weeks later you have hundreds of them.

`worktrash` finds every worktree on your machine, tells you what each one still holds and how much disk it uses, and removes the ones that hold nothing. **Branches always stay**, so no commit is ever lost.

$ worktrash
    SIZE   IDLE            STATE                                 PATH
  110 MB     2d  will go  PR #695 merged                        ~/code/app-channels-share
   75 MB     2d  will go  merged                                ~/code/app-grid
   30 MB    40h  will go  64 commits not pushed (branch kept)   ~/code/app-fix2
   29 MB    41h  will go  clean                                 /tmp/app-750
   …
+ 167 kept (hold work, in use, open PR, or another tool's). --all lists them.

445 worktrees in 35 repos use 8.0 GB. 278 of them (1.4 GB) hold nothing and can go. 43 more are already gone from disk.
run `worktrash --clean` to remove them. branches stay.

That's a real run on one of our machines (folder names shortened). Run it on yours: what's your number?

Install

Download a binary for macOS, Linux or Windows from the [latest release](https://github.com/WispAgents/worktrash/releases/latest), or build it with Rust:

cargo install --git https://github.com/WispAgents/worktrash

One binary, no dependencies, needs `git` on your PATH. `gh` is optional: when it's installed and signed in, pull requests are read from GitHub too.

Use

worktrash                 # scan your home folder, list what can go
worktrash ~/code          # scan somewhere else
worktrash --all           # list every worktree, kept ones too, with why
worktrash --clean         # remove the ones marked "will go" (asks first)
worktrash --clean --yes --branches   # no question; also d