diskreap
v0.1.0
Published
Reclaim disk space from build artifacts & dependency caches (node_modules, .venv, target, .next, __pycache__ …) across every language in one scan. Zero dependencies, no install.
Maintainers
Readme
diskreap
Reclaim disk space from build artifacts and dependency caches — across every
language, in one scan. node_modules, .venv, target, .next,
__pycache__, .gradle, dist/build, and more — diskreap finds them all,
shows you what's eating your disk, and deletes only what a single command can
rebuild. Zero dependencies, nothing to install.
# See what's reclaimable under the current directory:
npx diskreap
# Reclaim it (asks first):
npx diskreap clean ~/codeWhy
Every project you've ever touched left a node_modules or a target/ behind.
Across a ~/code folder with dozens of repos, that's easily tens of gigabytes
of stuff you never think about — until the disk fills up.
The existing tools each cover one corner: npkill is node_modules-only,
kondo needs a Rust toolchain to install. diskreap is one zero-dependency
command that runs instantly with npx (or pip/pipx — there's a twin
Python package), reaches every ecosystem at once, and refuses to touch
anything that isn't safely regenerable.
What it reclaims
| Directory | Kind | Comes back via |
|-----------|------|----------------|
| node_modules | Node deps | npm install |
| .venv · venv | Python venv | python -m venv |
| __pycache__ · .pytest_cache · .mypy_cache · .ruff_cache | Python caches | auto |
| .next · .nuxt · .svelte-kit · .turbo · .parcel-cache | JS build/cache | rebuild |
| target (beside Cargo.toml/pom.xml) | Rust/Maven build | cargo/mvn build |
| .gradle | Gradle cache | gradle build |
| vendor (beside composer.json/go.mod) | PHP/Go deps | composer/go install |
| dist · build (beside a project manifest) | Build output | rebuild |
| .terraform · Pods | Terraform / CocoaPods | init / pod install |
Safety by design: generic names like target, dist, build, vendor
are only ever matched when a sibling project file proves their origin — a bare
build/ folder of your own files is never touched. Symlinks are never followed,
and clean always asks before deleting (unless you pass --yes).
Usage
diskreap [path] # scan (default: current dir)
diskreap scan ~/code # explicit scan
diskreap clean ~/code # delete (confirms first)Scan
diskreap scan ~/code
#
# /Users/you/code
#
# 412 MB Node deps webapp/node_modules · 3w ago
# 1.2 GB Rust/Maven build scanner/target · 5d ago
# 88 MB Python venv ml-notes/.venv · 2mo ago
# ────────────────────────────────────────────────────
# total reclaimable: 1.7 GB across 12 dir(s)Filters
diskreap scan ~/code --min 100MB # ignore the small fry
diskreap scan ~/code --older 30d # only stuff untouched for a month
diskreap scan ~/code --only node_modules,target
diskreap scan ~/code --json # machine-readableClean
diskreap clean ~/code --dry-run # preview exactly what would go
diskreap clean ~/code --older 60d # reap only long-idle projects
diskreap clean ~/code --yes # no prompt (scripts / CI)clean accepts the same --min / --older / --only filters as scan, so
you can scope a sweep precisely before committing to it.
Exit codes
| Code | Meaning |
|------|---------|
| 0 | ok (scan complete, or clean finished) |
| 2 | error (bad args, or a deletion failed) |
Size & duration formats
Sizes: 500K · 10MB · 1.5G (binary units). Durations: 12h · 30d ·
2w (a bare number means days).
Also available for Python
pip install diskreap (or pipx run diskreap) — same tool, same flags, same
output. See diskreap-py.
License
MIT
