DEV Community

Yeferson Guarin
Yeferson Guarin

Posted on

Sweeft: reclaim the gigabytes your dev tools quietly eat (and how I finally built it with Claude Code)

Every developer's disk is slowly being eaten alive.

node_modules here, a forgotten bin/obj there, a .gradle cache that somehow grew to a gigabyte, an .iso you downloaded eight months ago "just in case." Multiply that across dozens of projects and old folders, and one day your drive is full and you have no idea where it all went.

I got tired of hunting it down by hand, so I built Sweeft — a small, fast, cross-platform tool (CLI and GUI) that finds this stuff and helps you reclaim the space safely.

Sweep the cruft. — a Jeffersoft tool. MIT-licensed, single native binary, no runtime required.

An idea I'd carried for a long time

Here's the honest backstory: for years I kept losing time manually going project by project, deleting folders to free up space. And for just as long I'd had the idea of building a tool to do that intelligently — but I never made the time. Company work always pulled me away, and "I'll build it someday" stayed a someday.

What changed is that today we have tools powerful enough to close that gap between idea and shipped. I sat down with Claude Code, turned the vague idea in my head into a real plan, and then we executed it. That's how Sweeft was born.

I'll be transparent about my three reasons for building it:

  1. A real need — I genuinely wanted my disk space back.
  2. Curiosity — I wanted to push on what an AI coding agent like Claude Code can actually do on a real, end-to-end project.
  3. To give something back — I wanted to hand the community a tool that might be useful. Use it, fork it, change whatever you want, and if it helps you, drop a ⭐ on the repo.

Install

# macOS / Linux
brew install jeffaristi92/tap/sweeft

# Windows
scoop bucket add sweeft https://github.com/jeffaristi92/scoop-bucket
scoop install sweeft

# Any OS with the .NET SDK
dotnet tool install -g Sweeft
Enter fullscreen mode Exit fullscreen mode

Or grab a single native binary from the releases page.

What makes it more than rm -rf node_modules

Deleting build folders is easy. Deleting them without shooting yourself in the foot is the interesting part. That's where Sweeft spends its effort.

1. See where your space actually went

sweeft ~/projects --top 10
Enter fullscreen mode Exit fullscreen mode
   3.2 GB  ████████████████████   79%  ZeroOne/
 302 MB    ██                      7%  AppRecetas/
 118 MB    █                       3%  api-workers/
 ...
Enter fullscreen mode Exit fullscreen mode

The GUI takes this further with an interactive treemap — rectangles sized by disk usage, double-click to drill in. It's the "where did my space go?" view, read-only, it never deletes anything.

2. Clean regenerable folders — carefully

Sweeft knows the usual suspects (node_modules, bin, obj, .vs, target, .gradle, __pycache__, dist, build, virtualenvs…) and reports them sorted by size. By default it sends everything to the Recycle Bin (recoverable), asks before deleting, and refuses unattended permanent deletion unless you explicitly pass --force.

3. It's Git-aware

This is my favorite safety feature. Sweeft detects the Git repo each item belongs to and checks whether it has uncommitted changes. Those items get flagged and are not pre-selected — so you never wipe a build/ folder in a project you're mid-way through.

4. --stale: don't touch what you're working on

sweeft ~/projects --stale 90d
Enter fullscreen mode Exit fullscreen mode

This only cleans regenerable folders of projects you haven't touched in 90 days. The project you're coding on today? Untouched. The prototype you abandoned last spring? Fair game.

5. --global: the caches nobody ever cleans

sweeft --global
Enter fullscreen mode Exit fullscreen mode

npm, NuGet, pip, Gradle, Maven, Cargo, Go… their global caches grow forever. On my machine:

  npm cache ............. 14.46 GB
  NuGet packages ......... 9.48 GB
  pip / pnpm / Gradle .... ~3 GB
  ────────────────────────────────
  Total reclaimable ..... 27.49 GB
Enter fullscreen mode Exit fullscreen mode

27 GB I didn't know I could get back. All rebuildable on demand.

6. An interactive terminal picker

sweeft ~/projects --tui
Enter fullscreen mode Exit fullscreen mode

Arrow keys, space to toggle, Enter to clean. Regenerable items pre-checked, dirty-repo items flagged. And there's a full WPF GUI on Windows with a scan/stop button, per-type toggles, and that treemap.

Under the hood (the fun part)

A few things I enjoyed building:

  • .NET 8 + NativeAOT. The CLI ships as a single ~3.5 MB native binary — instant startup, no runtime to install. The trick was making JSON AOT-safe with source generators instead of reflection.
  • One shared Core. The scan engine, models, Git detection and deletion live in a Core library reused by both the CLI and the GUI. Write once, two front-ends.
  • A real security bug I had to defend against. Sweeft runs git status inside repositories it discovers — and a hostile repo can set core.fsmonitor to an arbitrary command that Git executes on status. Scanning a downloaded project could run code. Fix: resolve git by absolute path and run it with -c core.fsmonitor= and GIT_CONFIG_NOSYSTEM, so a malicious repo config can't execute anything.
  • Keyless publishing. Releases are automated on Git tags: GitHub Actions cross-compiles native binaries for Windows, Linux, and both macOS architectures, publishes the GitHub Release, and pushes the .NET tool to NuGet via Trusted Publishing (OIDC) — no long-lived API key stored anywhere. Homebrew and Scoop manifests update themselves.
  • Cross-compiling macOS on CI. The scarce macOS-Intel runners kept blocking releases, so the Apple-Silicon runner now cross-compiles both macOS binaries. Reliable, and I still ship an Intel build.

Building it with an AI agent — the process

Since one of my goals was to test how far an AI coding agent can go on a real project, here's an honest account of how the work actually went. It wasn't "type a prompt, get an app." It was a back-and-forth where I made the calls and Claude Code did the heavy lifting — and, importantly, it hit real-world walls and had to work through them:

  • Plan first, then execute. We started from architecture decisions (a shared Core reused by a CLI, with a GUI to come later), not from code. Having that skeleton made everything after it faster.
  • Iterative, in vertical slices. CLI scanner → WPF GUI → Git-awareness → shared config → then the features (--stale, --global, disk-usage treemap, the TUI). Each landed as a working, tested slice.
  • A security review that found a real bug. I asked for a security pass, and it surfaced the git core.fsmonitor remote-code-execution vector above — then proved it with an actual exploit (a repo that dropped a marker file when scanned) and confirmed the fix blocked it. That's the moment I stopped treating this like a toy.
  • Real friction, real fixes. My antivirus (McAfee) quarantined the unsigned native binary; a macOS-Intel CI runner sat stuck in a queue for 90+ minutes and blocked a release; re-tagging once rebuilt the binaries with new hashes and broke the Homebrew/Scoop manifests. None of these are things you plan for — we diagnosed and solved each one.
  • The boring-but-crucial 80%. Cross-platform line endings, an MIT license, CI, four distribution channels, OIDC publishing, self-updating package manifests, English-only docs, a rename/rebrand to "Sweeft." The kind of scaffolding that usually never gets done on a side project — this time it did.

My honest takeaway: the agent didn't replace the engineering judgment (naming, trade-offs, "ship the Intel build too," "don't ship a self-hosted runner on a public repo," what to prioritize). It removed the friction that kept this idea in my backlog for years. That's the part that felt new.

Roadmap

It's early (v1.1.0) and open source — contributions welcome. On the list: a duplicate-file finder, sweeft doctor, shell completions, a cleanup history/undo, and code signing to keep antivirus engines happy with the unsigned native binary.

Try it — and make it yours

👉 github.com/jeffaristi92/Sweeft

I built this out of a real need, out of curiosity about what these tools can do, and to put something useful in the community's hands. So: use it, fork it, change whatever you want, open issues and PRs. If it frees up a few gigabytes for you, a ⭐ on the repo would genuinely make my day.

What's the biggest space hog hiding on your dev machine? Run sweeft --global and tell me in the comments 👇

Top comments (0)