dev-cleaner clean
- Finds build outputs and caches under the current folder.
- Lets you pick from a keyboard list, then shows a summary.
- Moves them to the trash when you press Enter.
Dev Cleaner finds target/, .next/, __pycache__/ and friends,
shows why each one matched, and moves what you pick to a trash you can undo.
cargo install dev-cleaner
dev-cleaner clean
That's it. Nothing moves until you confirm, and dev-cleaner undo brings it back.
$ dev-cleaner clean Scanning for cleanable directories... 4 cleanable directories found [x] Rust api/target 180.00 MB [x] Node.js web/.next 64.00 MB [x] Node.js web/dist 24.00 MB [x] Python ml/.pytest_cache 6.00 MB Space toggle | a all | / search | Enter confirm Execution summary Selected: 4 (274.00 MB) Mode: trash (undoable) Cleaning completed! Moved to trash: 274.00 MB Undo: dev-cleaner undo
How it works
dev-cleaner clean
dev-cleaner undo
Changed your mind? Restores the last batch exactly where it was.
Just looking? dev-cleaner scan lists findings without changing anything.
Prefer a full-screen UI? dev-cleaner tui.
Why it's safe to run
Ripgrep-style parallel traversal finds candidates first, then sizes them in parallel. Only top-level targets are reported, never nested duplicates.
Cleanups land in a trash batch. Undo restores it; purge frees the space.
Every finding names the built-in, custom, gitignore or heuristic rule behind it.
Dependencies like node_modules and gitignore discoveries stay hidden unless you opt in.
Same engine everywhere, including a native SwiftUI app (build from source).
Safety by design
.dev-cleaner-keep are skipped.--explain shows the source, category, risk and confidence of each path.{
"project_type": "Rust",
"category": "build",
"risk_level": "medium",
"confidence": "high",
"matched_rule": { "source": "builtin", "pattern": "target" },
"cleanable_dir": "/Users/you/acme/api/target",
"size": 188743680,
"in_use": false,
"protected": false,
"recent": false
}
Works with Mole
Mole handles system-wide cleanup: app caches, uninstall leftovers, System Data, installers. Dev Cleaner focuses on the build output inside your workspaces, with every removal explained and undoable. Run both.
mo clean
--explain shows the rule, risk and confidence behind each pathrecommend --cleanup 10GB for scriptsdev-cleaner clean ~/code
Mole is an independent project by tw93. Dev Cleaner isn't affiliated with it, we just like it.
Reference
dev-cleaner cleanFind, pick, move to trash.dev-cleaner clean --dry-runPreview without changing anything.dev-cleaner undoRestore the latest trash batch.dev-cleaner tuiFull-screen interactive mode.dev-cleaner plan -o plan.jsonWrite a reviewable JSON plan.dev-cleaner apply plan.jsonApply a plan to the trash.dev-cleaner recommend --cleanup 10GBPlan for a space goal.dev-cleaner trash gc --keep-days 7Free space from older batches.