Surgical Developer Disk Hygiene, Artifact Cleaner & Git-Aware Cache Vacuum in Rust
Every developer's machine silently runs out of gigabytes due to forgotten build artifacts across dozens of clones:
- Rust:
target/directories (500 MB β 8 GB per workspace). - Node.js:
node_modules/,.next/,.turbo/(1 GB β 10 GB per monorepo). - Python:
.venv/,__pycache__/,.mypy_cache/,.pytest_cache/. - Java / Gradle:
.gradle/,build/.
Standard tools are inadequate:
ncdu/duare blind to developer semantics and take minutes traversing millions of internal git objects.docker system prunedoes not touch project workspaces.cargo-sweeponly cleans Cargo.npkillonly cleans Node.
dev-scrub is a high-speed, multi-ecosystem CLI vacuum that inspects Git project recency, groups artifacts by toolchain, and safely reclaims 10β100+ GB of disk space without touching source code.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β dev-scrub scan [PATH] β
ββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ
β Parallel Work-Stealing Walker β
β β’ Skip .git internals (saves 90% of I/O) β
β β’ Detect: target, node_modules, .venv, etc. β
β β’ Subtree Pruning: Stop descending at roots β
ββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ
β Git Activity Classifier β
β β’ Active (< 7 days since last commit) β
β β’ Stale (7 - 30 days) β
β β’ DORMANT (> 30 days β οΈ -> Prime Target) β
ββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Safety Invariant Guard β
β β’ Never delete /, /root, /home β
β β’ Never delete src/, .git/, or source code (.rs, .py, .ts) β
β β’ Whitelist matching: only recognized artifact directories β
ββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
βΌ
[ Dry-Run Simulation or Force Vacuum ]
Unlike generic disk analyzers that scan deep inside every sub-package, dev-scrub prunes directory traversal the instant an artifact root (target/, node_modules/) is recognized. It calculates directory weight without scanning child dependencies, achieving speeds of 100,000+ files per second.
Every detected artifact is matched with its parent project's Git commit log (.git/logs/HEAD). Projects are classified into:
Active(< 7d)Stale(7β30d)Dormant(> 30d): Highlights repositories you haven't touched in over a month so you can safely purge gigabytes without interrupting active workflows.
- Non-Destructive by Default: Running
dev-scrub cleandefaults to a non-destructive dry-run simulation unless--forceis explicitly provided. - Root & Source Protection: Enforces canonical path verification to ensure system roots, home roots, and source trees (
src/,.git/,.rs,.py,.js) can never be targeted.
$ dev-scrub scan /root/work
β‘ dev-scrub: Scanning '/root/work' for reclaimable developer artifacts...
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π§Ή DEV-SCRUB: DISK HYGIENE REPORT FOR /root/work β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π¦ [RECLAIMABLE ARTIFACT BREAKDOWN]
β’ Node.js (node_modules/) -> 14.69 GB across 20 project(s)
β’ Rust (target/) -> 426.40 MB across 1 project(s)
β’ Python (.venv/cache) -> 0.10 MB across 10 project(s)
π [HEAVIEST ARTIFACT DIRECTORIES]
-----------------------------------------------------------------------------
PROJECT TYPE SIZE INACTIVITY PATH
-----------------------------------------------------------------------------
kimi-code Node.js (nod... 9.12 GB 1d ago ...work/kimi-code/node_modules
kimi-code Node.js (nod... 2.07 GB n/a ...apps/kimi-code/node_modules
vscode Node.js (nod... 931.1 MB n/a ...de/apps/vscode/node_modules
node-sdk Node.js (nod... 682.9 MB n/a ...kages/node-sdk/node_modules
acp-server Node.js (nod... 542.3 MB n/a ...ges/acp-server/node_modules
klient Node.js (nod... 433.7 MB n/a ...ackages/klient/node_modules
dev-scrub Rust (target/) 426.4 MB 0d ago /root/work/dev-scrub/target
kap-server Node.js (nod... 328.7 MB n/a ...ges/kap-server/node_modules
===============================================================================
π TOTAL RECLAIMABLE SPACE: 15.10 GB (15464.7 MB) across 31 directories
β‘ Scan duration: 15.93 s (scanned 1,520,636 files)
===============================================================================
dev-scrub scan /path/to/projectsdev-scrub clean /path/to/projectsdev-scrub clean /path/to/projects --older-than 14 --forcedev-scrub scan /path/to/projects --jsonLicensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.