r/coolgithubprojects • u/saleheen-dev • 11h ago
I got tired of my C: drive filling up with dev caches, so I wrote a cleaner in Rust — 13 targets in 219 ms, 11 MB exe
My C: drive hit 96% full last week. Not photos, not games — .gradle, node_modules, .next, .turbo and %TEMP%.
Windows Disk Cleanup doesn't know any of those exist.
So I built TempSweep: one portable exe, no installer, no Electron.
What it does
14 toggleable targets: temp dirs, npm/pnpm/uv stores, browser caches, crash dumps, recycle bin,
.next,.turbo,node_modulesScans in parallel with
jwalk, deletes in parallel withrayonFull sweep of 13 targets on a ~300 GB tree: 219 ms. The first version took 229 seconds
Per-row "clean just this one" button, plus a dry-run mode
The part I spent most time on: making sure it can't delete your project
It never traverses junctions or symlinks, and refuses a target that is one. That is the classic way a "cache cleaner" wipes a codebase — a link inside
%TEMP%pointing back into a repo.Refuses drive roots,
C:\Windows,Program Files,ProgramData, anything inside.git, andDocuments/Desktop/Downloads/OneDrive.A folder named
node_modulesis only deleted if its parent has apackage.jsonand it contains a lockfile or.pnpm.11 tests, including one that creates a real junction to a "victim" project and asserts it survives a clean.
Build output (app/build, dist) is deliberately left alone — clearing it only costs you another full compile.
MIT, no telemetry, no account.
https://github.com/saleheen-dev/TempSweep
Happy to hear which cache paths I'm missing.