Worktrash — Git skill for Claude Code
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
Related Skills
Spoilheap
See what your coding agents left on disk (Codex, Claude Code, OpenCode, Gemini CLI, Cline): worktrees, session
Prune Worktrees
Remove git worktrees whose PR has merged, to recover disk (dry-run first)
Branchit
Create a new branch and git worktree. Always branches from main unless told otherwise. Flags a dirty tree; ign
Overnight Receipts
For developers who let Claude Code run unattended, it reads the session logs already on disk plus git branches
Auto Merge
Turn on auto-merge for a PR only once all review threads are resolved, CI is fully green, and it's approved —
Legion Lens
Activate LENS — Legion's Principal Code Reviewer with 20 years of expertise. LENS can block any merge. LENS re
Related Agents
Half Fix
Review angle "half-fix & consistency" of the user's §6 adversarial-review gate — hunts the sins tests cannot s
Git Workflow Master
Use for git hygiene: branches, worktrees, commit messages in the repository's convention, rebases, cherry-pick
Branch Janitor
Post-merge cleanup agent — after the human confirms a PR/branch merge, removes stale agent worktrees, deletes