There is a universal truth in mobile development: disk space is finite, and build artifacts are infinite.

Recently, I hit that dreaded "Disk Space Low" notification. As a developer with dozens of Flutter prototypes, client projects, and half-finished experiments sitting on my hard drive, I knew exactly who the culprit was.

The Old Workflow: The Filelight Hunt

My usual routine for cleaning up disk space was a manual, visual hunt. I use Filelight, which is a fantastic tool for visualizing disk usage. It displays your file system as a segmented ring chart, making it immediately obvious which folders are hogging space.

I would open Filelight and watch the scan complete. Then, I’d see them: the massive, dark wedges representing the build/ and .dart_tool/ directories inside my Flutter projects.

The process looked like this:

  1. Click into a huge directory in Filelight.
  2. Realize it's an old project I haven't touched in six months.
  3. Right-click, select "Open Terminal Here."
  4. Type flutter clean.
  5. Wait.
  6. Repeat for the next 40 projects.

It was tedious. It was slow. And frankly, it was a waste of time. I found myself skipping folders just because I didn't want to open another terminal window.

The Problem: Build Artifacts

Flutter is great, but it caches everything. Between the compiled binaries in build/ (APKs, IPAs, Runner apps) and the cache in .dart_tool/, a simple "Hello World" project can balloon into hundreds of megabytes after a few runs.

I didn't want to delete the projects—I still need the code—but I didn't need the compiled artifacts for an app I worked on in 2022.

The Solution: fluttercleaner

I realized I was acting like a robot, performing a loop that a script could do in seconds. So, I opened up VS Code and wrote a simple tool in Go.

I called it fluttercleaner.

The logic is simple:

  1. Recursively walk through every folder in my projects directory.
  2. Look for a pubspec.yaml file (the hallmark of a Flutter project).
  3. If found, execute flutter clean in that directory.
  4. Move on to the next one.

I chose Go because it’s incredibly fast at filesystem traversal and compiles into a single, portable binary. I didn't need a heavy runtime environment; I just needed a fast, compiled tool I could drop into any folder.

The Result: 30GB Reclaimed

I built the tool, moved it to my root ~/Development folder, and ran it.

The terminal scrolled past at lightning speed, finding projects I had completely forgotten about.

  • Found project at: .../prototypes/login_test -> CLEANED
  • Found project at: .../client/v1_backup -> CLEANED

When the dust settled, I checked my available disk space.

I got 30GB back.

Thirty gigabytes of cached builds, old APKs, and intermediate files, gone in about 15 seconds.

Conclusion

Sometimes, we get so used to our tools (like Filelight) that we forget we can build our own. Visualizing the problem was the first step, but automation was the solution.

If you have a folder full of dormant Flutter projects, stop opening terminals manually. Script it, clean it, and enjoy the free space.

Check out the code for fluttercleaner on my GitHub [https://github.com/SarahRoseLives/fluttercleaner].