macOS Β· single binary Β· reversible

Find the dead weight in your cargo hold.

A personalized, reversible disk-cleanup CLI for macOS. It finds your reclaimable bloat, pressure-tests every candidate against live disk state, and stages it in a 7-day airlock β€” so nothing is permanently deleted until you say so. Drivable by humans and agents.

91 declarative rules code-signed + notarized no cloud Β· no telemetry Β· no sudo
~ β€” diskspace
$ brew install tymrtn/diskspace/diskspace
$ diskspace scan # survey the hold
$ diskspace detect # rank by yield Γ— confidence
$ diskspace doctor --need 20G
βœ“ 22.4 GB reclaimed Β· reversible Β· logged
$

The core idea

Some bytes come back on their own. Some don't. Treat them differently.

Every dev Mac hoards hundreds of GB. Blunt cleaners nuke it all and pray. diskspace knows which bytes regenerate for free and which carry consequences β€” and it routes them through different doors. Every rule declares its own recovery story.

↩ comes back automatically

Free to reclaim

Caches and build artifacts rebuild or re-download on demand. Reclaiming them costs you a few seconds later, nothing more.

  • Xcode DerivedData Β· node_modules
  • Homebrew / npm / cargo / pip caches
  • browser + on-device AI model stores
  • Docker volumes Β· build output
βœ• does not come back

Handle with care

Downloads, project state, and anything irreversible get the slow lane β€” pressure-tested, airlocked, never silently deleted.

  • old DMGs & installers in ~/Downloads
  • local project state & databases
  • files you actually opened recently
  • anything your profile marks never-touch

The trust model

You can trust it without watching it.

Confidence is just a sort key. The pressure-test is the real safety boundary β€” if a candidate fails it, the action is blocked no matter how big the win. And the default path is always reversible.

01

scan

Parallel walk. Local bytes only β€” iCloud/Dropbox online-only files skipped.

02

detect

91 rules rank candidates by yield Γ— confidence.

03

check

4-validator pressure-test. Fails loudly. The hard boundary.

04

airlock ↩

Reversible hold for 7 days. Restore or undo anytime.

05

purge

Permanent β€” and only ever a deliberate, separate step.

↩ restore / undo reverses any airlocked move  Β·  no global --force β€” bypassing safety is per-item and must be retyped by hand.
/ pressure-test

Four validators, every time

A candidate only moves if it survives all four:

  • re-stat β€” size unchanged since detect
  • liveness β€” no open handles, no writes <24h
  • policy β€” not in your never-touch list
  • recency β€” no recent git activity nearby
/ airlock

Reversible by default

Below the high-confidence floor, everything goes to ~/.diskspace/airlock/ first, with a manifest and a 7-day window. Restore is always one command away.

/ receipts

Honest accounting

Every action is logged with the real df delta β€” never a fictional number. A same-volume move says so; it doesn't pretend to free space until you purge.

{"command":"airlock", "rule_id":"chrome-cache",
 "actually_freed":114765824, "reversible":true,
 "undo_cmd":"diskspace restore chrome-cache-b97…"}

Built for agents too

Safe to auto-invoke. Same binary humans use.

When a build dies with No space left on device, an agent can recover the disk and retry β€” unattended β€” precisely because the airlock and pressure-test make it safe where a blunt rm -rf would not be. Every command speaks --json and honors a stable exit-code contract.

agent β€” headless recovery
# build just failed: ENOSPC
$ diskspace doctor --need 20G --yes --json
{
"actually_freed": 24117248512,
"reversible": true,
"items": [ …14 redownloadable caches… ]
} # exit 0 β†’ re-run the build
0success β€” space freed, proceed
1no candidates β€” nothing safe to free
2pressure-test failed β€” stop, don't force
3policy blocked β€” path is never-touch
127unknown error β€” inspect, don't retry blindly

Get it

One binary. Two minutes.

Homebrew

$ brew install tymrtn/diskspace/diskspace

The recommended path. Tap + formula maintained for every release.

Cargo

$ cargo install diskspace-cli

The package is diskspace-cli; the installed binary is still diskspace.

Binary release

$ curl -L …/diskspace-universal

Universal macOS binary, code-signed + notarized.