Operating note2 min read
Why macOS lies about disk space (and how Petal checks its maths)
APFS clones, hard links, and why I ended up testing a disk visualiser by deleting real files on a throwaway volume.
If you duplicate a 1 GB video in Finder, your Mac now shows two 1 GB files. Fair enough. Except on APFS they are sharing the exact same blocks on disk.
Delete one copy and your free space barely moves. Delete both and you get 1 GB back, once. Throw in hard links, local Time Machine snapshots, and macOS purgeable space, and most disk visualisers end up giving you numbers that are kind of useless when you’re actually trying to clear room.
That annoyance is basically why I built Petal.
Fast enough that you don’t go make a tea
Waiting thirty seconds for a progress bar before a disk app shows you anything is grim. Petal is written in Rust with GPUI (Zed’s GPU-rendered UI framework) and scans using macOS primitives like getattrlistbulk and openat.
Because of that, the sunburst chart draws itself while the scan is still running. Folders start muted and snap to full colour the moment their total settles, then fold cleanly into size order at the end. If sunbursts aren’t your thing, the exact same scan also flips into an icicle chart or a treemap.
Checking the maths against a real volume
Getting APFS accounting right by reading docs and guessing is a great way to be subtly wrong.
For Petal’s cleanup findings and its Collector (where you queue folders to delete), clones and hard links are counted once so the total matches what deleting them will actually free. To make sure I wasn’t fooling myself, the test suite spins up a throwaway APFS volume, writes real clones and hard links onto it, deletes them, and checks Petal’s prediction against the bytes macOS genuinely gives back.
It’s a bit obsessive, maybe, but if an app is telling you what to delete on your own Mac, it ought to be right.
Not everything big should go in the bin
The fastest way to make people uninstall a disk tool is to suggest deleting something important. Petal splits findings into three buckets instead of dumping a scary red list on you:
- Safe to delete — things that rebuild themselves, like Xcode build files.
- Review first — folders like Downloads, or unpacked Git data where Petal won’t touch
.gititself and just copies thegit gccommands for you to paste into Terminal. - Manage in app — stuff an app owns itself, like Docker’s disk image or Claude Code history. Petal explains why it’s big and never offers it for the Trash.
It’s free, open source, runs completely offline, and installs via Homebrew if you want to poke around your own disk: github.com/henrydennis/petal.