top | item 46509688

Show HN: Yeet – CLI tool to find and reclaim disk space

4 points| sohanmanju | 1 month ago |github.com

I kept running out of disk space and never knew where it all went. Paid apps exist for this, but paying $10-30 just to see what's eating your disk felt wrong. So I built an open-source alternative. Yeet finds stale coding projects (detects by package.json, pyproject.toml, Cargo.toml, etc.), scans for large files, clears caches (browsers, npm, pip, cargo, Docker, Homebrew - 60+ locations), cleans up Xcode on macOS (simulator runtimes are sneaky - 5-10 GB each), and has an interactive disk explorer with vim keybindings. Technical bits: uses native du instead of Python's os.walk for ~5x faster size calculation, parallel scanning with ThreadPoolExecutor, and moves to trash by default so you can recover mistakes. Had a fun bug where sparse files (VM disk images) showed 16 TB instead of actual size. Install: pip install git+https://github.com/sohanmanju/yeet.git (or uv tool install if you use uv). Requires Python 3.10+. Works on macOS, Linux, Windows. MIT licensed. Found about 40 GB on my machine I didn't need.

3 comments

order

vishwasnavadak|1 month ago

Always wanted something like this since npkill was only limited to node_modules and I had to create different aliases to clear docker images and xcode caches every now and then.

dmarwicke|1 month ago

how does this decide what's safe to delete? i've nuked docker caches before and broken builds in annoying ways

sohanmanju|1 month ago

Fair point, yeet doesn't really decide what's safe. It just scans a hardcoded list of known cache locations and lets you pick what to delete. The assumption is that these are "caches" that can be regenerated, but you're right that some are more painful than others. For Docker specifically, we include paths like /var/lib/docker which is pretty aggressive, that's images, build cache, and volumes. Probably shouldn't be in there since `docker system prune handles` that way better. Good feedback, will tighten up what we scan for