How to Clear macOS System Data Safely (Xcode, Docker & APFS Guide)
macOS “System Data” (formerly Other) is a catch-all category for every file Spotlight cannot classify as an App, Document, Photo, or Media file. On developer and power-user Macs, 85% of System Data bloat comes from five specific paths: ~/Library/Caches, ~/Library/Developer/Xcode/DerivedData, ~/Library/Developer/CoreSimulator, Docker Desktop's Docker.raw VM image, and hidden APFS local snapshots. You can reclaim 40–150 GB in under 60 seconds using either the targeted Terminal commands below or StorageSage's BSD fts_open System Data Engine with full Finder Put-Back undo protection.
Where macOS System Data Actually Hides
Never run blind rm -rf ~/Library/* commands—doing so destroys macOS Keychains, iCloud CloudDocs sync databases, and app licenses. Target only verified cache and build directories:
| Filesystem Path | Typical Bloat | Safety Profile | What Lives Inside |
|---|---|---|---|
| ~/Library/Developer/Xcode/DerivedData | 15 GB – 95 GB | 100% Safe (Rebuilt on next build) | Intermediate clang/swiftc build products, module caches, and indexing stores. |
| ~/Library/Developer/CoreSimulator/Devices | 12 GB – 80 GB | Safe for unavailable/old iOS runtimes | Full iOS, watchOS, and visionOS simulator filesystem images. |
| ~/Library/Containers/com.docker.docker/Data/vms/0/data | 20 GB – 120 GB | Safe via Docker prune (re-pulls images) | Sparse APFS virtual machine disk image (Docker.raw) holding Linux containers and volumes. |
| ~/Library/Caches/* | 8 GB – 45 GB | Safe per-app cache eviction | Chromium/WebKit media caches, Spotify offline audio chunks, Homebrew bottles, and pip wheels. |
| /Volumes/com.apple.TimeMachine.localsnapshots | 10 GB – 90 GB | Safe via tmutil thinlocalsnapshots | Copy-on-write APFS filesystem checkpoints retained after Time Machine runs or OS updates. |
| ~/Library/Application Support/MobileSync/Backup | 25 GB – 160 GB | Review before deleting (iPhone/iPad backups) | Unencrypted or encrypted local Finder backups of iOS devices. |
4 Steps to Clear System Data Safely
1. Measure physical APFS disk allocation in ~/Library/Caches
Standard Finder folder sizing struggles with sparse files and hard links. Check the top space consumers inside ~/Library/Caches using physical block counts:
du -sh ~/Library/Caches/* 2>/dev/null | sort -hr | head -n 15
StorageSage shortcut: Open the System Data tab in StorageSage—our lock-free SystemDataEngine scans ~/Library/Caches, ~/Library/Logs, and ~/Library/Containers in 0.18 seconds using st_blocks * 512 physical APFS byte attribution.
2. Purge Xcode DerivedData, DeviceSupport & Unavailable Simulators
If you have ever installed Xcode, compiler artifacts and old iOS simulator images are almost certainly your #1 System Data offender:
# Remove all Xcode DerivedData (rebuilds automatically on next compile) rm -rf ~/Library/Developer/Xcode/DerivedData/* # Delete iOS/watchOS Simulator runtimes no longer supported by your current Xcode xcrun simctl delete unavailable
Read our dedicated deep-dive: How to Clean Xcode DerivedData, iOS Simulators & SwiftPM Caches.
3. Reclaim Multi-Stack Package & Container Caches (npm, pnpm, Cargo, Gradle, Docker)
Package managers silently retain every tarball and wheel ever downloaded inside hidden dotfiles that macOS counts as System Data:
npm cache clean --force pnpm store prune brew cleanup --prune=all docker system prune -a --volumes
Why StorageSage is safer for node_modules & .build: StorageSage's DeveloperCleanEngine checks whether a Git repository has uncommitted changes or was modified recently before flagging node_modules, target/, .build/, or .venv/.
4. Thin Hidden APFS Local Snapshots
Even after you empty the Trash, APFS Copy-on-Write local snapshots continue holding deleted blocks on disk until macOS purges them:
# List all local APFS snapshots on the root volume tmutil listlocalsnapshots / # Request macOS to thin up to 20 GB of purgeable local snapshots immediately tmutil thinlocalsnapshots / 20000000000 4
Read the complete APFS guide: How to Find and Delete Hidden APFS Local Snapshots on macOS.
Clean System Data in 0.18s with Full Finder Put-Back Undo
Unlike terminal rm -rf scripts or bloated background cleaners, StorageSage is a native 3.8 MB Swift + SwiftUI macOS utility. Every cleanup action defaults to Move to Trash and records a cryptographic SHA-256 entry in a local AuditLog so you can restore any item to its original path with one click.
brew install --cask storagesage