In this article I’ll tell you why I decided to build my own Mac cleaner, how the app works, which technical problems I ran into, and how I used Claude throughout the whole development.
Motivation
I’m a developer and I work on several projects in different languages and stacks at the same time. And my MacBook has only a 512 GB SSD. Lately, especially with AI tools spreading and the amount of software I use growing, running out of space became a real problem. Again and again I had 100 GB free one day and only 5 GB a couple of days later. And it was completely unclear where it went.
After talking to colleagues, I realised the problem was far from mine alone. Many of them had run into the same thing, so I decided to find out where exactly the space goes and why existing tools don’t always help.
The first thing that surprised me was the size of the caches apps pile up. For example, WebStorm had a cache of more than 20 gigabytes on my Mac, and it held projects I hadn’t opened in a long time. Homebrew, npm and other developer tools pile up caches too. Part of this data hasn’t been used for ages, but it keeps taking space that could be useful for current projects.
The second observation was about the apps themselves. For example, WebStorm updates regularly, but the data of previous versions isn’t always removed automatically. Over time these leftovers can take several gigabytes.
Another example is Xcode. I did mobile development a couple of years ago, and found that simulator data from back then was still on the disk, taking about 4 GB.
A separate story is Ollama, which I installed to experiment with local LLMs. The downloaded models took more than 30 GB, and I didn’t notice that at first. Maybe newer versions of the app show this better.
All this made me look at my own projects. The disk held dozens of repositories I hadn’t come back to for half a year or more. And each of them kept taking space: node_modules, Cargo caches, Python virtual environments and other dependencies never went away.
It became clear that I needed a good Mac cleaner. But the existing ones turned out to have several serious problems.
Price — many of them are paid. I don’t mind paying for quality software, but for a utility that gets access to almost the whole file system, I’d like to be able to check what exactly it does. I tried one of the popular paid utilities, and it found only about 25% of the data I wanted to clean. That wasn’t enough.
Privacy — some free ones didn’t suit me either: they talked to external servers, for example to check for updates or to send telemetry. I wanted a fully local tool that doesn’t touch the network at all.
Safety — cleaning a file system is a potentially dangerous operation, so it needs special care. You have to act like a surgeon: precisely, predictably and with minimal risk of error. While googling different tools, I came across this thread: issue In one of these discussions I found a case where an open-source utility deleted a user’s data with no way to recover it. After that I was even more convinced that safe deletion had to be one of the top priorities.
Understanding — when I used paid tools, I didn’t understand what was taking the space (an Others tab of 100 GB explains nothing). Besides, I lacked transparency: it was unclear which files took the space, what exactly would be removed and how safe that was.
Given these problems, I decided to write my own.
Goals
Before starting development, I set the goals my app had to follow:
Free and open source. No paid features, subscriptions or ads. The source code is open and licensed under MIT or Apache-2.0.
Fully local. The app must not send user data to external servers, use telemetry or check for updates on its own. Everything happens locally.
Safe deletion. The user must understand the consequences of every action. For that, every finding is classified by risk level:
- Safe — comes back by itself (logs, DerivedData).
- Low — caches and temporary data that can usually be removed safely.
- Medium — developer tools’ data that may be needed again, but can usually be restored.
- High — user files and data whose removal can lead to permanent loss. The risk level is set by the kind of data and the consequences of removing it, not only by the size or age of the files. Before anything is removed, the user must be able to review the list of selected files and confirm the operation. By default the app doesn’t delete files permanently, it moves them to the macOS Trash. That way the data can be restored if the user removed something important by accident.
Understanding — everything we can describe, we must explain to the user in plain language. No 100 GB Others sections.
Once the goals were set, I started development…
Building it
I chose TypeScript + Rust for the app.
TypeScript handles the user interface, and Rust handles the file system and the heavy scanning work.
The main reason for this choice is performance. The app has to walk big file trees, analyse the metadata of thousands and millions of files, and do it with minimal resources. Rust also gives better control over memory use and convenient ways to work with system resources safely.
I built this architecture:
The app is split into four layers:
UI — the user interface.
Core Engine — the core of the app, which runs the scan and processes the results.
Scan Modules — independent modules, each responsible for one category of data: npm, Homebrew, IDE caches and so on.
OS Layer — an abstraction for working with the operating system and the file system.
This approach lets me extend the app independently of its other parts. For example, to add a search for Python pip caches, it’s enough to write a new module that works through the existing contracts.
And if Windows support is ever needed, a separate OS Layer can be written without rewriting the whole business logic.
The algorithm is one parallel walk for all modules:
One walk for everyone. Modules don’t read the disk themselves. Each one declares up front what it looks for (for example, node_modules or ~/Library/Caches/*). The Engine does one parallel walk of the file system and gives each module only the entries that match its rules. The modules process what they get and produce their own findings.
One call per folder. Each folder is read with the macOS system call getattrlistbulk. It returns names, sizes, modification times and hard link counts at once, without a separate stat for every file.
Honest size. The app counts how much will actually be freed. This avoids counting data twice when several files point to the same physical data or share APFS blocks.
A compact tree. To avoid keeping every file’s metadata in memory, the app keeps folders and large files, and folds small files into totals per folder. The finished tree is saved to a cache on disk.
Rescans. macOS keeps a journal of changed folders (FSEvents). Fresher asks it what changed since last time and re-reads only those folders. If nothing changed, a rescan takes half a second. If the journal can’t be trusted, it does a full scan.
Development
From the very start I set strict code quality requirements: lint rules, unit and E2E tests, and automatic checks before every commit.
I separated the dev version from prod right away: in dev you can pass arguments to emulate different situations.
For safe development I built my own Sandbox environment.
It’s a separate folder inside the project that imitates the structure of the macOS file system. It lets me test scanning and removing files without touching real user data.
The Sandbox has:
a home folder home/ with its own Trash home/.Trash;
Applications/ and System/Applications/;
temporary folders private/tmp and private/var/folders/;
a folder with the app’s own data.
For each module I can create test scenarios: for example, generate large files, create caches or imitate old project dependencies.
In dev mode the app works only with the Sandbox and has no access to real user data. This lets me safely check both single modules and full E2E scenarios. On top of that, I built a second testing mode — working with the real macOS file system.
In this mode the app runs a full scan but doesn’t actually remove anything. Instead, it writes to a log the list of files the user chose to clean and that the app would have moved to the Trash.
This lets me check how the app behaves on real data without risking it.
To test the removal itself, I also made it possible to work with the real macOS Trash. This lets me test moving files and putting them back at the operating system level.
Developing with Claude
This is already my fifth project built with AI. Over that time I’ve settled on a workflow I want to share.
First of all, I set up strict lint rules, test coverage and Git hooks. This creates a basic quality loop: the agent can make mistakes, but most obvious problems are caught by the automatic checks before the code reaches the main branch.
An important role is played by CLAUDE.md — the main document with instructions and project context for the agent. I split it into a few key sections:
Read first — a list of documents the agent must study before starting work. This holds the project’s basic context: architecture, technical constraints, conventions and key decisions.
Important — critical development rules the agent must follow when working with the code and the project.
Cost Saving Rules — instructions that cut token use: for example, don’t re-read documentation without need, use existing tools and avoid extra operations.
Planning — probably the most important section. I use Spec-Driven Development, so planning becomes the basis of development. A plan has to take into account the architecture, constraints, dependencies and the expected result. In effect it’s the single source of truth for implementing a task.
Planning. When writing a plan, it works best to use the Given / When / Then template. You describe what you have now, what you want to do and what you want to get.
For planning and development I use the Superpowers plugin. It adds extra stages to the workflow: working out the requirements, planning, implementation and review.
Yes, this makes tasks take longer and use more tokens, but it gives better control over the process and a result that matches the original requirements.
Release
Once I had the scope of the first release, tested everything not only with E2E scenarios but also by hand, and ran tests on my friends’ machines, I was ready to release.
It didn’t go without surprises. To distribute the app beyond my own computer, I needed an Apple developer signature.
I had never released my own macOS software before, so I didn’t know this requires the Apple Developer Program, which costs $99 a year.
Setting up the account took almost a whole day, and configuring signing and wiring it into CI/CD took more time.
After an extra security audit with Claude and final testing, I released the first version of Fresher. Now I’m collecting feedback from users and planning the app’s further development.
My goal is to make a truly useful tool for developers who, like me, keep running out of disk space.
If you have ideas about what Fresher is missing, which features it should have or how the existing ones could be improved, I’ll be very glad to hear your feedback!
Site: https://getfresher.app/





Top comments (4)
the stale repos part hit home, after 16 years of PHP and JS my disk is basically a graveyard of node_modules and vendor folders lol. one thing I'd add to the list is Docker Desktop, the Docker.raw disk image just keeps growing and doesn't shrink by itself even after you prune images, imo is the biggest silent one for web devs. Composer cache gets kinda big too if you jump between a lot of Laravel projects. how do you decide a project is stale tho? last git commit, or the mtime of node_modules itself?
Ha, 16 years of PHP and JS is a serious graveyard. Mine isn't much better.
Docker - yes, 100%. Fresher already looks at it, but on purpose it doesn't delete anything there. It reads what the running Docker says it uses and shows the Docker.raw file next to that: its max size, how much of the Mac's disk it really takes, and how much is actually used inside. That gap is exactly what you describe - you prune, the space inside is freed, but the Mac doesn't get it back until Docker hands it back. For build cache, images, stopped containers and volumes it shows the command to run, plus how risky each one is (volumes are the scary one, they can hold the only copy of a database). I'd rather you press enter on docker ... prune yourself than have a cleaner reach inside Docker.
Composer cache and vendor next to composer.json - fair point, neither is there yet. vendor is already on my list of more project types, I'll add the Composer cache too. Thanks!
On stale - it's neither of those exactly. It never runs git. A project's "last activity" is the newest change time of the project's own folders, with node_modules and .git left out, plus the folder where git keeps the branches. So a commit, a new file or a branch switch makes the project "alive". The default is a year, and you can set anything from 30 days to 10 years. On top of that, if node_modules itself was touched recently (you ran npm install last week), it's left alone even when the project looks old. Monorepos count as one project: if anything inside is active, the whole thing stays.
The honest limit is that editing a file in place doesn't change the folder's time, so a project where you only tweak existing files can look older than it really is. That's why everything goes to the Trash, and you see the list before anything moves.
makes sense, leaving Docker prune to the user is the right call imo, volumes are exactly where ppl lose a db by accident. and newest change time of the project's own folders without node_modules and .git is smarter than what I was thinking, a fresh npm install wouldn't make an old project look alive. gonna try it on my graveyard lol
An open-source Mac cleaner has one big advantage: people can read what it is about to delete. What does Fresher show before it removes anything? You asked what is missing: on testmybuild.app, which I run, builders try each other's apps, Mac included, and write honest feedback.