I Was Tired of Losing Disk Space to node_modules - So I Built ArtifactSweep

rust dev.to

Being a developer, we all create many projects for learning, work, and experiments.

Over time my machine started filling up — not with source code, but with generated junk:

  • node_modules
  • target
  • dist / build
  • framework caches like .next, .angular, .nuxt
  • and more of the same across every cloned repo

Every few months I would hunt folders manually, delete something, free a few GB, then the same problem would come back.

Only learning about “clean your disk” tips doesn’t help much. Building something for the problem does.

So I ended up building ArtifactSweep — a small open-source tool for this everyday developer issue.

The real problem

As developers we regenerate these folders all the time:

npm install
cargo build
ng build
Enter fullscreen mode Exit fullscreen mode

They are not our source of truth. But they sit on the SSD for months.

The painful part is not only size. It is:

  1. Finding them across many project roots
  2. Knowing how big they are before delete
  3. Not deleting the wrong folder by mistake

I wanted something that could:

  • Scan a folder tree
  • Show sizes
  • Let me clean with more control
  • Work on my day-to-day machines (Windows, Linux, Mac)

Step 1: Start with a CLI

I started with the command line first.

Why CLI?

  • Fast to build and test
  • Fits terminal-first workflow
  • Easy to script and share

The CLI is called sweep.

Basic usage:

# Safe: only list junk under a path
sweep scan .

# Preview deletes
sweep clean . --dry-run

# Delete
sweep clean .
Enter fullscreen mode Exit fullscreen mode

On one of my project folders alone, it reclaimed nearly 5 GB.

That was enough validation: this is not a fake problem. Every active developer hits it.

Step 2: Then came the desktop app

CLI is great when you already know the path and trust dry-run.

But sometimes I wanted to:

  • See a list of folders and sizes
  • Filter by type
  • Confirm before delete
  • Click through without remembering flags

So I added a desktop app on top of the same idea (same cleanup job, different UI).

Flow is simple:

  1. Choose folder
  2. Scan
  3. Review results (and filters if needed)
  4. Clean with confirmation

If you like GUIs for this kind of cleanup, the desktop app is friendlier.

If you live in the terminal, keep using sweep.

You don’t need two different products in your head. One tool family: ArtifactSweep.

Open source for developers

This is a day-to-day issue, not a rare edge case.

So I open-sourced it under MIT.

  • You can download the ArtifactSweep tool from here

After install:

  1. Open a new terminal (important on Windows for PATH)
  2. Run sweep --help
  3. Or open the ArtifactSweep desktop app

Optional: standalone sweep-* binaries if you only want the CLI.

What it looks for

Folders matched by name, for example:

  • JS/TS: node_modules, dist, .next, .angular, …
  • Rust: target
  • Python: __pycache__
  • Other common caches (you will see them after a scan)

It does not walk inside a matched junk folder looking for more junk names. Keep the list review before you clean — some names like bin / build can appear in real projects too.

Why I’m sharing this

I built ArtifactSweep because I needed it.

Then I polished it enough that other developers can use it without setting up a full toolchain just to free disk space.

If you face the same “where did my free space go?” moment every few months, try it from the links above.

If it saves you disk space or time, you can support the work.

That’s it. You can also share your opinion on improving it further. Feel free to raise an issue on GitHub.

Happy cleaning, and keep building.

Source: dev.to

arrow_back Back to Tutorials