Tidy, Seven Months Later: Never Let It Fill Up
In April I wrote about Tidy and Offload: two small Go tools, one to understand what's taking space on a machine and one to move the stuff that doesn't belong there. I ended with a roadmap and the word "giddy."
In October I wrote The end of web apps: native apps for one platform, wished into being by dictation, no tickets or scrum, software that looks after itself. Tidy is the most concrete example I have of that shape, so this is the update on both.
First, what happened to the roadmap.
- Finish the TUI browser. Half.
tidy tuiexists and works over SSH. It's still read-only. - Add the Collector. No. The footer of the TUI still says
Collector: coming next — this browser is read-only for now. - Smarter candidates. No.
tidy candidatesis the same as it was. - Offload plans. No.
tidy offloadstill creates and starts anoffloadjob. That's all it does. - Verification before cleanup. No.
- Public repos. No. Tidy is still private.
One out of six, generously.
And I don't mind, because the disk on my laptop kept filling up, and none of those six things would have stopped it.
The real problem
My April problem was a Mac mini with a Photos library on it that had no business being there. That's a one-time problem. You find it, you move it, you're done.
My actual problem turned out to be a MacBook Pro that does a lot of building. Xcode, simulators, Docker, node_modules in every repo, agents running builds around the clock. What piles up there is regenerable data, all day, every day. DerivedData. Simulator clones. Build cache. /tmp.
None of that needs a Collector. Nobody needs to look at it. It needs to go away on its own, safely, before it's a problem.
So the question changed from "what's using space and does it belong here?" to:
How do I never think about disk space again?
v1 was slow
The first thing I found when I tried to use Tidy every day: v1 was way too slow to run every day.
tidy stat ~ 334 s
tidy scan ~ >40 minutes, killedThe scan walked my home folder in 699 seconds, then started hashing every single file to find duplicates. Six and a half million files. It was 0.6% through the hashing when I killed it.
That's the kind of design that seems reasonable in a spec. Hash everything, dedupe is free later. Then you meet a real home folder.
So the walker got rewritten:
getattrlistbulk(2)instead ofreaddirpluslstaton every file. One syscall returns names, types, sizes, allocated sizes, inodes and mtimes for a batch of around 500 entries. That alone took a full walk from 190 s to 36.5 s.- Parallel readers. Two per CPU, each with a private stack, stealing from a shared queue when idle.
- Stuck-folder detection. A folder that stops making progress for 15 seconds (hello, dead network mount) gets skipped. A huge folder that's still returning entries doesn't.
- FSEvents. The result gets cached, and the next run asks macOS which folders changed since then and only re-reads those.
- No hashing in scan.
tidy dedupehashes only files whose size matches another file's, first 64 KB plus the tail, and a full SHA-256 only when those collide too.
The numbers on this Mac (6.9 million files and folders, ~380 GB in the home folder):
du -skx ~ 142–154 s
tidy top --fresh ~ 36.5–39.0 s
tidy top ~ (repeat run) 3.8 s
tidy scan ~ (first scan) 82.5 s4x faster than du on a full walk. 40x on a repeat run. And it gives you the whole breakdown, where du gives you one number.
It also counts what's actually on disk: allocated blocks, not file length. Docker.raw is a sparse file that claims to be enormous. APFS clones share blocks. If you add up logical sizes you get a number that's just wrong. Tidy reported 395.8 GB for my home folder; du -skx said 394.5 GB a few minutes later.
I didn't hit my target, by the way. I wanted a cold walk of the home folder well under 30 seconds. It's 37. The profile says the time is almost all kernel time inside APFS: 4 seconds of user CPU against 180–250 seconds of system CPU spread over 18 cores. fd, which only lists names and gets no sizes, takes 21–27 seconds on the same tree. I tried searchfs(2) to get around per-folder reads entirely. It didn't finish in 150 seconds. I stopped there.
My favorite bug
After the rewrite, rescanning / was slower than scanning it the first time. 388 seconds for the rescan.
The rescan is supposed to be the fast path. It compares each folder's listing fingerprint with the stored one and skips anything unchanged.
The catalog stores each folder's subtree as a range of row ids, and / is the one folder whose root row fell inside its own range. Tidy treated that as a catalog left over from v1 and rewrote all 8.6 million rows. Every time.
One test later (TestRescanOfSlashSkipsUnchangedDirs), the rescan takes 106 seconds.
Cleaning, carefully
Fast scanning was only the prerequisite. The point was tidy clean.
tidy clean deletes regenerable data, by policy. Xcode DerivedData untouched for 7 days. DeviceSupport for all but the newest two OS versions. Docker images and build cache past their age limits. brew cleanup, npm cache clean when the cache is over 2 GB, uv cache prune over 1 GB. Old files in $TMPDIR. Trash older than 30 days. node_modules in projects nobody has touched in 60 days.
Where a tool has its own cleanup command, Tidy uses it instead of deleting files. Every cleaner plans first; a shared engine executes the plan and refuses anything outside that cleaner's own directory. Every action goes into ~/Library/Logs/tidy/actions.jsonl with the path and the bytes freed.
Some things are never touched: Documents, Desktop, Pictures, Movies, Music, ~/.ssh, Xcode Archives, iPhone backups, Docker volumes, and anything a program has open.
That last rule, "anything a program has open," turned out to be the hard one. Three bugs from the git log:
Spotlight held everything open. The in-use check uses lsof. Spotlight's indexers have files open all over the disk, all the time, so projects looked in use when nobody was using them. Fix: ignore Spotlight. And ignore Tidy itself.
Scanners held everything open. A directory handle from something walking the tree isn't someone using the project. Fix: count open files and working directories, not directory handles.
Deleting node_modules made projects look recent. A project's age was based on the newest thing inside it. Delete a nested node_modules and the parent folder's mtime updates, and now the project looks like it was touched today. Fix: project age counts files only, in the top level and in src/, app/, lib/ and friends.
None of these show up in a spec either. They show up the first night it runs unattended.
Autopilot
tidy autopilot install writes a launchd agent. It runs at login, daily at 04:00, and checks every six hours, at low priority.
One pass:
- Measure free space.
- Run the default cleaners. If free space is under 75 GB, also run the aggressive tier.
- If it's still under 40 GB after cleaning, send me one Telegram message and a macOS notification: how much was cleaned and the ten biggest space users.
Then nothing until it's back over 50 GB, when I get a single "back to healthy." Otherwise it's silent.
I only want to hear about it when cleaning wasn't enough. Every other case is the tool doing its job.
The first real-world bug: launchd runs had no window to show macOS's privacy prompts, so the first time a scheduled run touched a protected folder (Music caches, of all things), it just hung. Unattended runs now never read privacy-protected folders.
Here's the tail of tidy history from this week:
WHEN MODE FREED FREE AFTER ACTIONS BY CLEANER
2026-11-23 04:00 autopilot 7.2 GB 244.4 GB 4 dev 298 MB, docker 69 KB, xcode 6.9 GB
2026-11-24 04:00 autopilot 15.3 GB 192.7 GB 11 dev 597 MB, docker 69 KB, tmp 676 KB, xcode 14.7 GB
2026-11-25 04:00 autopilot 13.1 GB 150.7 GB 72 dev 673 MB, docker 482 MB, tmp 3 MB, xcode 12.0 GB
2026-11-26 04:00 autopilot 33.2 GB 120.0 GB 13 dev 2.8 GB, docker 482 MB, tmp 328 KB, xcode 30.0 GB
2026-11-27 03:04 autopilot 5.0 GB 143.2 GB 4399 dev 188 MB, docker 482 MB, tmp 1.8 GB, xcode 2.6 GB33 GB on a Wednesday night, 30 of it Xcode. Since it was installed at the end of October: 51 runs, 297.7 GB freed. The 40 GB alert has never fired.
Simulators
Look at that xcode column. Most of what Tidy cleans on this machine is Xcode, and most of the Xcode is simulators.
In mid-November free space dropped to 92 GB. Every simulator keeps the apps and data of every test run, and parallel testing leaves clones behind. So the xcode cleaner got a budget: while all simulators together are over 30 GB, erase the least recently used ones that haven't been touched in the last day. The simulator stays; its contents get reset. Parallel-testing clones idle for a day get deleted. A manual clean that day freed 46.5 GB, all of it Xcode.
The same digging turned up a second problem that has nothing to do with disk. Simulators left running each hold several GB of RAM, and nothing ever shuts them down. So there's now tidy sims, which lists what's running and for how long, and tidy sims shutdown. Autopilot raises a warning when three or more are running or any has been up for more than a day.
tidy paths
The other new piece is tidy paths: a list of outside paths Tidy should watch or delete, kept in ~/.config/tidy/paths.toml and read on every run.
tidy paths add "~/Library/Caches/com.todesktop.*" --mode once --reason "Cursor was uninstalled"
tidy paths add ~/.cache/sometool --mode clean --older-than 30dreport sizes a path, clean deletes it every pass, and once deletes it and drops the entry. Pointing Tidy at something new is a line of data, not a rebuild.
This exists so another tool can feed it. A separate Mac-doctor agent finds leftovers from uninstalled apps, I approve them, and they land in the list. One finds and proposes, the other deletes. The same safety rules apply: never the home folder itself, ~/Library itself, Documents, iCloud Drive, Mail, Photos, anything outside home or anything reached through a symlink to any of those. A refused path gets one plain sentence back:
Refused: ~/Documents/old is inside ~/Documents, which Tidy never deletes.About "terminal-native"
In April I put "terminal-native" on the list of things I loved about this approach. I also liked that Go cross-compiles, and v1 built for five targets.
Both of those aged. The fast parts of Tidy are macOS only now: getattrlistbulk, FSEvents, APFS allocated sizes, xcrun simctl, launchd. That's the single-platform point from October. Write for one operating system, its latest version, and use everything it gives you. The portable readdir-and-lstat walk was 5x slower on the same tree.
And Tidy now has a menu bar app.
It's a small native SwiftUI app: free space in the menu bar, amber under 75 GB, red under 40. A dropdown with the last cleanup, the ten biggest folders, a Clean now button and an autopilot pause switch.
It has no logic of its own. It calls tidy autopilot status --json, tidy top --json, tidy clean --json and tidy history --json, and draws what comes back. The JSON keys are only ever added, never renamed, so the app and the CLI can move independently.
So I was half right. The engine is still a Go binary that runs over SSH, in launchd, in a script. But a tool that runs itself doesn't need me in a terminal. It needs a number I can glance at, and the menu bar is where I glance.
What changed
The April post was about building small personal tools through conversation with an agent. That part held. Almost every change since October started as a complaint: the disk is full again, the rescan is slower than the scan, the simulators are eating my RAM. Each one became a fix or a feature. No sprint, no estimate, no backlog.
What changed is what I wanted the tool to be. In April I wanted a better way to look at my disk. Seven months later, I want to never look at it.
That's the October idea in a small, real package. A native app for one platform, built by talking, that does its own chore on a schedule and only speaks up when it needs me.
I don't think about disk space anymore.
Tidy is listed on elier.ai/apps with the other apps I've built this way.
