Your Mac is throwing the red Your disk is almost full banner, git status is failing with No space left on device, and the OS is starting to freeze between clicks. This is the point at which most people panic-delete something important. Do not. There is a specific order that recovers space quickly without breaking anything, and it fits in the time it takes to drink a coffee.
This is the routine we run when a machine hits 99% full. It assumes you are on macOS Sonoma or Sequoia, you have a developer's home folder, and you want to be back to a workable state in fifteen minutes rather than a "clean" state in three hours. Save the deep cleanup for the weekend.
Minute 0: stop making it worse
Before you touch anything, close the two apps that behave worst when the disk is full: any web browser (they write cache constantly) and any IDE that is auto-saving snapshots (Xcode, JetBrains, VS Code with Local History). Do not restart the Mac. A reboot on a disk at 99% can leave you in a login loop because the OS cannot write the swap file it needs to unpack the login session.
Open Activity Monitor and quit any download or backup that is in flight. A paused Time Machine backup is easier to resume than a corrupted one.
Minute 1: measure the starting line
Open About This Mac → More Info → Storage Settings and note the Available number. If you skip this step you will not know whether the routine worked. On a full disk this screen can take 30 seconds to render; do not click away.
In parallel, open Terminal and run:
df -h /
That gives you the honest number, unfiltered by the Storage screen's purgeable-space accounting.
Minute 2: empty the Trash
Right-click the Trash icon in the Dock and choose Empty Trash. If Finder complains that files are in use, hold Option while clicking Empty Trash — that skips the in-use check. If Finder still refuses, an app has a lock on one of the files; quit the likely suspect (usually a video player or an archiver) and try again.
On a disk that has been full for a while, this alone can recover several gigabytes, because the Trash has been silently accumulating deletions the OS could not fully process.
Minute 4: clear Xcode DerivedData
If you use Xcode, this is the single fastest recovery on a developer's Mac. In Terminal:
rm -rf ~/Library/Developer/Xcode/DerivedData/*
DerivedData holds intermediate build products. Xcode rebuilds them the next time you compile. Deleting the contents is safe. On a machine that has not been cleaned in six months, 20 to 80 GB is normal.
While you are there, delete simulators for iOS versions you no longer target:
xcrun simctl delete unavailable
That removes only the simulator disk images for OS versions that are not installed. It does not touch simulators for currently installed runtimes.
Minute 6: clear browser caches
Your browser cache is the second largest ephemeral hoard on most Macs. For Chrome and Chromium-based browsers (Arc, Brave, Edge), the cache lives at ~/Library/Caches/Google/Chrome/Default/Cache and similar per-profile paths. For Safari, it is inside ~/Library/Containers/com.apple.Safari/Data/Library/Caches.
The safest way to clear it is from the browser itself: Settings → Privacy → Clear Browsing Data → Cached images and files. Choose All time. Do not tick Cookies unless you are prepared to sign back in everywhere.
If the browser will not open because the disk is too full, remove the cache folder from Terminal:
rm -rf ~/Library/Caches/Google/Chrome/Default/Cache
The browser will recreate an empty cache on next launch.
Minute 8: look for the actual culprit
Now you have enough breathing room to inspect. Run this from your home folder:
du -sh ~/* 2>/dev/null | sort -h
That prints every top-level folder in your home directory with a human-readable size, sorted smallest to largest. The last few lines tell you where the space is. For most people the surprises are one of:
- A giant
Downloadsfolder full of unopened DMGs - A
Moviesfolder with old screen recordings - A
Libraryfolder dominated by an application cache - A project folder containing multiple
node_modulesortargetdirectories
You are not deleting anything yet. You are just finding out where to point the next command.
Minute 10: reclaim the largest known offender
Depending on what du showed you, run the appropriate command. A few common ones:
- Docker Desktop virtual disk: open Docker Desktop → Troubleshoot → Clean / Purge data. The
Docker.rawfile can be 50 GB even when Docker is idle. - Node caches:
pnpm store pruneandnpm cache verifyremove unreferenced entries from the pnpm and npm caches. - Homebrew downloads:
brew cleanup --prune=allremoves every cached formula download. - iOS backups:
open ~/Library/Application\ Support/MobileSync/Backup/and delete backups for devices you no longer own. Each is 5-15 GB.
Pick one, not all. You have four minutes left.
Minute 13: remove APFS snapshots holding purgeable space
If Finder still shows the disk as fuller than df says, macOS is holding local Time Machine snapshots. List them:
tmutil listlocalsnapshots /
Delete the oldest with:
sudo tmutil deletelocalsnapshots 2026-09-04-081500
Substitute the actual date-time string from the list output. macOS will make new snapshots on the next Time Machine cycle; the old ones were only held in case you needed to roll back.
Minute 15: verify and stop
Open Storage Settings again and compare Available to your starting number. On a disk that started at 99%, you should now be at 90-95% or better. That is enough to reopen your browser, run your build, and think clearly.
Do not keep going. The emergency is over. The rest of the cleanup — Downloads triage, Movies archive, deep dive into Application Support — is a Sunday-afternoon project, not a fifteen-minute one. Trying to do it now, on a stressed disk with a stressed brain, is how important files get deleted.
What to do this weekend
Once you have space, set two habits so this does not happen again. First, keep ~/Downloads empty by moving anything you want to keep into a project folder within a week. Second, add a monthly calendar reminder to run rm -rf ~/Library/Developer/Xcode/DerivedData/* and brew cleanup --prune=all. Those two commands alone would have prevented most of today's emergency.
Where VolumeLens comes in
We built VolumeLens for exactly the moment when du -sh ~/* tells you the space is in ~/Library but you do not want to cd five levels deep to find out which app hoarded it. It draws your disk as a visual map: the biggest thing is the biggest cell, one click takes you inside it. Every cleanup action is Move to Trash after review, so nothing is deleted without your consent.
The scan, browse, and cleanup features are free. Insights recognises the usual Mac storage hoards — DerivedData, Docker.raw, node_modules, the caches this article mentioned — and explains each one. Try it the next time you want to skip the fifteen-minute routine entirely.