Grain.
How it works

From "System Data" to every byte, named.

A fast engine written in Rust reads your disk, and a native Mac app explains what it found. Here's what happens from the moment you open Grain, and why you can trust each step.

What happens when you open it

It maps the whole disk

Grain walks every folder at once, reading only names, sizes and dates in bulk from macOS. It never opens a file. On an M1 Mac, 2.3 million files take about 24 seconds. The result is saved, so next time Grain opens instantly and catches up on what changed in seconds.

It makes the numbers add up

Grain matches its totals against System Settings' own labels: the APFS container and its volumes, local Time Machine snapshots, purgeable space, and anything it can't attribute, which it shows as such instead of hiding. If its numbers differ from System Settings, it tells you why.

It names everything

Every file gets a category (Apps, Photos, Developer, System Data and so on), the app it belongs to, and a safety level: Safe, Review, Managed by macOS, or Protected. The map shows it three ways: by type, by app and by age.

It suggests, with reasons

Suggestions rank what you could free. Each one says what the item is, what removing it does, whether it comes back and how sure Grain is. Personal files are spotted on your Mac and never selected for you. When you press Keep or Not now, Grain learns what matters to you.

It cleans through the Trash

Nothing is deleted. Items move to the Trash the way Finder moves them, so Put Back works, and every cleanup is written down with Undo. The four checks before anything moves are on the Security page.

It keeps watching, quietly

macOS tells Grain which folders changed, so the map stays current without rescanning. Grain keeps a history of how your disk grows, learns your normal week, and tells you when something jumps, like a runaway cache. In the menu bar it uses about 1.8% of the CPU.

want to see it? the demo on the home page runs right in your browser

The cleanup rules are readable

Grain doesn't guess what junk is. Its rules are plain text files, one per family: Xcode, Docker, caches, package managers, simulators, virtual machines and more. Each rule says what it matches, how safe it is, what removing it does, whether it comes back and what stays. Every rule has a test, and anyone can read them or suggest a better one.

# rules/caches.toml
[[rule]]
id = "caches.app_caches"
title = "App caches"
safety = "safe"
explanation = "Files apps keep to start and load faster; each app makes them again as it needs them."
consequence = "Apps may open a little slower the first time, while they rebuild their caches."
comes_back = "automatically"
stays = "The apps themselves, your settings, your documents and your sign-ins"
action = "trash"
match = { path_glob = "~/Library/Caches/*", not_macos = true }
read all the rules: rules/

What it's made of

Two halves, each doing what it's best at, joined by a small bridge.

Grain.app, in SwiftUI

Everything you see: the map, inspector, Suggestions, Junk, Duplicates, Storage Health, Growth, Live activity and the menu bar. And everything that needs Apple's frameworks: watching for changes, the Trash, Quick Look, Vision and notifications.

joined by UniFFI, one small universal library

The engine, in Rust

Anything that touches many files or needs speed: the parallel disk walk, the index and its compressed snapshot, accounting, categories, the treemap layout, search, the rules, duplicates, history and Storage Health.

the same engine also runs

grain, the command line

Every number the app shows, for scripts, with --json on every command.

It's built without an Xcode project: Swift Package Manager, Cargo and a few scripts. the full layout is in the README

How fast

Measured on an M1 Mac with 8 GB of memory. The method, and the numbers that didn't flatter us, are written up in the repository.

WhatMeasured
Map the whole disk2.28 million files, 190 GB, in about 24 s, using about 281 MB of memory at its peak
Open againInstantly, from the saved snapshot, then catches up in seconds
Take in a burst of changes across 1,000 folders36 ms
In the menu barAbout 1.8% CPU on average, 0% most of the time
With the window openAbout 8% CPU on average
Draw a map of 2,000 blocksAbout 3 ms
read the measurements: docs/m4-results.md

The command line

The grain tool runs the same engine, so a script sees exactly what you'd see. Every command takes --json.

grain scan          # map a folder or the whole disk
grain accounting    # the disk, matched to System Settings
grain junk          # what the rules found, by safety
grain dupes         # identical files and folders
grain suggestions   # what you could free, with reasons
grain health        # anything unusual this week

It isn't in the download yet. Build it from the code with make build; setting up takes a few minutes.

See it on your own disk.