Free up disk space fast — find and delete node_modules, .venv, __pycache__, dist, build, target and other regenerable folders across all your projects. A safe, cross-stack, zero-dependency npkill alternative (dry-run by default).
Project description
🧹 disksweep
Reclaim gigabytes in seconds — clear the regenerable junk clogging your disk.
node_modules, .venv, __pycache__, .pytest_cache, dist, build, target, .next…
they pile up across every old project and quietly eat your SSD. disksweep finds them all,
shows how much space each is wasting, and lets you wipe them safely. Dry-run by default.
Zero dependencies.
Quick start
uvx disksweep # scan the current folder, show what's reclaimable
uvx disksweep ~/code -i # interactively pick what to delete
$ uvx disksweep ~/code
1 4.2 GB 2mo acme-api/node_modules
2 1.1 GB 3w ml-thing/.venv
3 512 MB 1w ml-thing/__pycache__
4 380 MB 1d storefront/.next
Reclaimable: 6.2 GB across 4 directories
Dry run — nothing deleted. Re-run with `-i` to choose, or `-d` to delete all.
Also available as the shorter
sweepcommand after install.
Install
uvx disksweep # run without installing (uv)
pipx install disksweep # or install the CLI globally
pip install disksweep # or into an environment
Why disksweep
- 🧯 Safe by design. Dry-run by default. Only deletes a curated allowlist of
regenerable directories. Never follows symlinks, never descends into
.git, and refuses to run at a drive root, your home folder, or its parent without--force. - 🎯 Cross-stack. Python (
.venv,__pycache__,.pytest_cache,.mypy_cache,.ruff_cache), JavaScript (node_modules,.next,.turbo), Rust (target) and more in one pass. - ⚡ Zero dependencies. Installs instantly; nothing to audit.
- 🤖 Scriptable.
--jsonand--yesmake it CI/automation friendly.
What it targets
By default (unambiguous, always-regenerable): node_modules, .venv, venv,
__pycache__, .pytest_cache, .mypy_cache, .ruff_cache, .next, .nuxt,
.svelte-kit, .turbo, .parcel-cache.
Add the heavier, occasionally hand-authored build dirs (dist, build, coverage,
target) with --aggressive, or pick your own with --include:
uvx disksweep --aggressive
uvx disksweep --include node_modules,.venv,target
Options
| Option | Description |
|---|---|
-i, --interactive |
Pick which directories to delete (e.g. 1,3-5, all, none) |
-d, --delete |
Delete everything found (asks to confirm) |
-y, --yes |
Skip the confirmation (use with --delete) |
-a, --aggressive |
Also target dist, build, coverage, target |
--older-than N |
Only include directories not modified in the last N days |
--include a,b |
Comma-separated directory names to target (overrides defaults) |
--json |
Output results as JSON; never deletes |
--force |
Allow running at a drive root / home directory |
Python API
from disksweep import scan, remove_all, human_size
found = scan("/path/to/code", older_than_days=30)
print("reclaimable:", human_size(sum(r["size"] for r in found)))
# remove_all(found) # when you're sure
FAQ
How do I delete all node_modules and pycache folders to free disk space?
Run uvx disksweep in any parent folder to list every regenerable dir with its size, then
uvx disksweep -d to delete them. They're rebuilt next time you run npm install /
pip install / your tests, so reclaiming the space is safe.
Is disksweep safe? Will it delete my source code?
No. It only removes directories whose name is on a curated allowlist of
always-regenerable folders. It's dry-run by default, never follows symlinks, and refuses to
run at a drive root, your home folder, or its parent. Ambiguous build dirs (dist, build,
target, coverage) are excluded unless you pass --aggressive.
How is disksweep different from npkill?
npkill focuses on node_modules. disksweep is a zero-dependency, cross-stack alternative
that also clears Python, Rust and framework caches, adds --older-than, a --json mode, and
stronger safety defaults. Same tool is on npm too (npx disksweep).
Also on npm
JavaScript-first? The same tool ships on npm — npx disksweep.
License
MIT — free for personal and commercial use.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file disksweep-1.0.0.tar.gz.
File metadata
- Download URL: disksweep-1.0.0.tar.gz
- Upload date:
- Size: 5.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
520ea669f80215e41142709cc62ff8cc184810f7ca1bda646fff89fc42262ffa
|
|
| MD5 |
13c895e6fa82efee10a19394b4fb47f6
|
|
| BLAKE2b-256 |
ca1a7bb5c1fb1ccf4dcea0e00456c36f7339e236ed229628d717de36a6553e90
|
File details
Details for the file disksweep-1.0.0-py3-none-any.whl.
File metadata
- Download URL: disksweep-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b9e396e2c4e48e5d73300595ebb621c1bd667549ce21d46e90c4715bb694a42
|
|
| MD5 |
4fc293cac03993d408756e4eb792df2a
|
|
| BLAKE2b-256 |
18e10b284c14ad17d9f14a6e142eab103f1be71a5e057d9ed638c29735ecb8c6
|