DiskInsight / Guides

How to free up disk space on a Mac

The practical, developer-tested guide to getting gigabytes back — without ever trusting your files to the cloud.

Your Mac's "Storage" tab shows three optimistic colors and nothing to click. The System Data bucket swallows everything else. This guide covers the exact things that actually eat space on a developer machine, where they live, and how to reclaim them safely.

1. Take the safe 5-minute wins first

Before touching anything permanent, do the moves that can't go wrong:

  • Empty the Trash. Obvious, but do it first. The Trash is a gift; sudo rm -rf is a sin.
  • Clear user caches (~/Library/Caches). Safe to clear when the app that owns them is quit.
  • Check Downloads and Desktop for the 9 GB DMG or installer you forgot.
  • Prune old Time Machine local snapshots: tmutil listlocalsnapshots /, delete with tmutil deletelocalsnapshots /.

The developer wins below are where the biggest space actually lives — a full-DiskInsight scan of a real 228.3 GB drive found 68.2 GB of recoverable dev caches in one pass — but the five-minute list above is safe for anyone.

2. Clear Xcode DerivedData first

On most dev machines this is the single biggest win. DerivedData grows with every build — debug symbols, module caches, link files — and old projects are never cleaned up automatically. Routinely 20–60 GB of build artifacts on a machine that's been used for iOS or macOS development.

~/Library/Developer/Xcode/DerivedData

You can rm -rf everything inside it; Xcode just builds slower the next time. A scanner is the honest way to see the top offenders before you delete.

3. Prune package manager caches

  • npm: npm cache clean --force, or delete ~/.npm/_cacache
  • Homebrew: brew cleanup --prune=all removes old formulae and cached downloads
  • CocoaPods: pod cache clean --all and ~/.cocoapods
  • Rust: ~/.cargo registry caches
  • Go: go clean -cache, or trim ~/Library/Caches/go-build

Note: Homebrew and Docker are the two DiskInsight's Dev Cache Cleaner deliberately leaves alone — those stay manual. The rest are automated by the tool too; the commands above are just handy when you want to nudge a single tool by hand.

4. Clear iOS simulator runtimes

Every simulator you've ever booted lives under ~/Library/Developer/CoreSimulator/Devices, multi-GB each. Machine dictionaries of simulators accumulate even after you stop using the SDK versions they belong to.

5. Reclaim Docker's reserved space

Docker's disk usage doesn't go down when you delete containers. Prune in layers: docker system prune -a, then docker builder prune -a. On Apple Silicon the backing file can stay large until you use Settings → Resources → Disk image size to shrink it.

6. Find duplicates and orphans

Big downloads often exist in Downloads and Documents. Old apps leave Application Support, Containers and Caches behind after you drag them to the Trash. A content-addressable duplicate finder and an app uninstaller that knows these paths catches both — locally, never uploading a path.

7. Let a disk analyzer show you the real map

The fastest way to free space is to see the space. DiskInsight scans a folder, your home directory, or the whole Mac and renders an interactive treemap, an age map, top sizes and more — then lets you stage anything to the Trash for review before anything happens.

What not to do

  • Don't buy a subscription cleaner that "vacuums" on sight. You don't need a $40/year app to move files to the Trash.
  • Don't nuke node_modules blindly — you might need that old project next month.
  • Don't empty caches for running apps (Spotlight, Mail, Photos) without quitting them.
  • Don't delete System Data wholesale. See what's inside it first, then clear it deliberately.
FAQ

Frequently asked

Why do developers run out of disk space so fast?

Long-lived dev machines accumulate gigabytes almost invisibly: Xcode DerivedData, iOS simulators, npm/pnpm/Yarn caches, Docker images and build layers, CocoaPods, Gradle, go-build and Homebrew duplicates. None of them show up as a single obvious folder.

Where is Xcode DerivedData and why is it so big?

DerivedData lives in ~/Library/Developer/Xcode/DerivedData. Xcode rebuilds it constantly, and stale objects from old projects can easily exceed 20–50 GB. It's safe to clear whenever you can afford a slightly slower next build.

What about Docker disk usage?

Docker accumulates stopped containers, dangling images and build cache layers. On a Mac much of it lives in a sparse Docker.raw bundle, so the space stays reserved even after you delete containers — you need to prune the build cache and images.

Is it safe to delete caches?

Almost always, yes. Caches are regenerated on demand. DiskInsight only ever moves things to the macOS Trash (never permanent deletion in the background), so you can review exactly what will be removed first.

More guides

Keep going

See exactly where your space went

One-time license. Local scanning. No account, no cloud, no catch.