Find what is eating disk space on macOS and free it safely — including the mysterious "System Data" category. Use when the user says their Mac is full, low on storage, asks "where's my disk space", "what is System Data", "clear System Data", "free up space", "clean my Mac", or wants to find large files/folders.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of mac-free-space?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/shukur93-mac-free-space)
---
name: mac-free-space
description: Find what is eating disk space on macOS and free it safely — including the mysterious "System Data" category. Use when the user says their Mac is full, low on storage, asks "where's my disk space", "what is System Data", "clear System Data", "free up space", "clean my Mac", or wants to find large files/folders.
---
# Mac Free Space
Goal: find where space went, explain it, and reclaim it **safely**. Always measure first, report, then delete only with the user's OK.
## Ground rules
- **Scan first, delete later.** Run `scripts/scan.sh` (read-only) and show a ranked table of findings with sizes before touching anything.
- **Ask before every deletion**, naming the exact path and size. Prefer moving to Trash (`mv … ~/.Trash/`) over `rm -rf` for user files. Caches/derived build data can be `rm -rf`'d after OK.
- **Never delete**: anything under `/System`, `/usr` (except `/usr/local` brew junk via brew), `/private/var/db`, `/private/var/vm` (swap/sleepimage — managed by macOS), `~/Library/Containers` or `~/Library/Group Containers` wholesale, `~/Library/Application Support` wholesale, `~/Library/Mobile Documents` (iCloud Drive), Photos/Music libraries, Keychains, Mail `V*` folders by hand.
- Don't disable SIP, Spotlight, or Time Machine to save space.
- `sudo` needs the user's password — give them the command to run themselves rather than typing passwords.
- Terminal/Claude may need **Full Disk Access** (System Settings → Privacy & Security → Full Disk Access) for accurate sizes of `~/Library` subfolders; "Operation not permitted" errors mean it's missing.
- **No "Mac cleaner" apps** (CleanMyMac-style "ScammyMcDiskCleaner" tools). If the user has one installed, recommend trashing it. Finding space needs nothing beyond Finder/Terminal.
- Scans only see the **current user's** home folder. Other accounts must be checked from those accounts (or via `sudo du` the user runs). Also check `/Users/Shared` — VMs often live there.
- If the user doesn't know what a big item is, **identify it and explain before suggesting deletion** — some things matter, some don't.
## Why "System Data" is huge
macOS lumps everything it can't classify into "System Data": Time Machine **local snapshots**, caches, logs, swap/sleepimage, Xcode & simulator data, Docker disk images, iOS device backups, app support data, VM disks, Messages attachments, purgeable space. The Storage bar graph (System Settings → General → Storage) is rough and often wrong. What counts: the drive's Finder **Get Info** numbers, `df`/`du`, and the Finder list view below.
## Finder method (no tools needed — teach the user this)
1. Finder → Go → Computer → double-click the boot disk ("Macintosh HD").
2. View → as List.
3. **Cmd+Shift+.** to show hidden files (press again when done to re-hide).
4. Click the **Size** column header so the arrow points down (largest first).
5. View → Show View Options → check **Calculate all sizes**.
6. Wait for sizes to fill in, then click the disclosure triangles on the biggest folders to drill down level by level until the space is found.
Terminal equivalent: `ncdu` or `du -xhd1 <dir> | sort -hr`.
## Workflow
1. **Baseline**: `df -h /` and `diskutil info / | grep -Ei "free|purgeable|container"`. Note free space.
2. **Scan**: `bash ~/.claude/skills/mac-free-space/scripts/scan.sh` (takes 1–3 min). Optional deeper top-level sweep: `sudo du -xhd1 / 2>/dev/null | sort -hr | head -20` (user runs it).
3. **Report** a ranked table: location, size, what it is, safe to remove? (Safe / Safe after OK / Review manually / Don't).
4. **Clean** the items the user approves, using the recipes below.
5. **Re-measure** with `df -h /` and report space reclaimed. Snapshots/purgeable may take a minute to show.
## Cleanup recipes (by typical size)
### Time Machine local snapshots (often tens of GB of "System Data")
```bash
tmutil listlocalsnapshots /
tmutil listlocalsnapshotdates /
# delete one: sudo tmutil deletelocalsnapshots <date e.g. 2026-11-14-101500>
# thin all as much as possible:
tmutil thinlocalsnapshots / 999999999999 4
```
Snapshots are purgeable; macOS frees them under pressure, but thinning gives space back now. Also check APFS snapshots: `diskutil apfs listSnapshots /`.
### Xcode / iOS dev
- `~/Library/Developer/Xcode/DerivedData` — safe to delete.
- `~/Library/Developer/Xcode/Archives` — old app archives; review (needed for dSYMs).
- `~/Library/Developer/Xcode/iOS DeviceSupport`, `watchOS DeviceSupport` — safe; re-downloads when device connects.
- Simulators: `xcrun simctl delete unavailable`; list runtimes `xcrun simctl runtime list`, delete old ones `xcrun simctl runtime delete <id>`, then `xcrun simctl delete unavailable`. Runtimes live in `/System/Library/AssetsV2` (counted as System Data) and are often the single biggest hog (can be 100 GB). Two runtimes with the same iOS version are **not necessarily duplicates**: check `xcrun simctl list runtimes`. One may be device-specific (e.g. `SimRuntime.iOS-27-2-iPhone19-4`), so ask which devices the user tests on before deleting.
- Before deleting dev caches, check `pgrep -lf "Xcode|GradleDaemon"`. Skip DeviceSupport if Xcode is running `-prepareDeviceSupport`. Stop an idle Gradle daemon with `gradle --stop` before deleting `~/.gradle/caches`. Keep `~/.gradle/wrapper` and `gradle.properties`, which may hold signing secrets.
- Write `rm -rf` targets as literal paths, never `"$VAR"/*`, which a safety check blocks. `~/Library/Developer/CoreSimulator/Caches` safe.
- `~/Library/Caches/com.apple.dt.Xcode` safe.
### Docker / VMs
- `~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw` — sparse file; shrink with `docker system prune -a --volumes` (ask: deletes images/volumes) or reduce disk limit in Docker settings.
- OrbStack: `~/.orbstack`; Colima: `~/.colima`; UTM/Parallels/VMware VMs in `~/Library/Containers/com.utmapp.UTM`, `~/Parallels`, `~/Virtual Machines.localized` — review only.
### Package manager / dev caches (safe; regenerate)
- Homebrew: `brew cleanup --prune=all` (also `brew autoremove`).
- npm `~/.npm` → `npm cache clean --force`; yarn `yarn cache clean`; pnpm `pnpm store prune`; bun `~/.bun/install/cache`.
- pip `pip cache purge`; `~/Library/Caches/pip`; uv `uv cache clean`; conda `conda clean -a`.
- Gradle `~/.gradle/caches`; Maven `~/.m2/repository`; CocoaPods `pod cache clean --all`, `~/Library/Caches/CocoaPods`; Carthage `~/Library/Caches/org.carthage.CarthageKit`.
- Rust `~/.cargo/registry`, Go `go clean -modcache`.
- Stale `node_modules`: `find ~ -name node_modules -type d -prune -mtime +60 2>/dev/null` — list, user chooses.
- Android: `~/.android/avd`, `~/Library/Android/sdk/system-images` — review.
### iOS/iPad backups
`~/Library/Application Support/MobileSync/Backup` — manage via Finder → device → Manage Backups (delete old ones there).
### User caches & logs
- `~/Library/Caches/*` — generally safe to delete contents (apps rebuild). Quit the app first. Biggest offenders usually browsers, Spotify, Slack, Adobe, JetBrains.
- `~/Library/Logs`, `/Library/Logs/DiagnosticReports` — safe.
- `/private/var/folders` — temp/caches; **don't delete by hand**. A reboot (or boot into **Safe Mode** once, then normal restart) makes macOS purge these and other caches — a well-known fix for bloated System Data.
### Messages, Mail, misc
- Messages attachments `~/Library/Messages/Attachments` — clean via System Settings → General → Storage → Messages (review large attachments), or Messages → Settings → Keep messages: 1 year.
- Mail downloads `~/Library/Containers/com.apple.mail/Data/Library/Mail Downloads` — safe.
- `~/Downloads` and `~/.Trash` — show biggest/oldest; empty Trash after OK.
- Old installers: `/Applications/Install macOS*.app` (~13 GB each) — safe after OK.
- iCloud Drive: enable "Optimize Mac Storage" so files go cloud-only; Photos → Settings → iCloud → Optimize Mac Storage.
- Mail server connection logs: `~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail` — safe; turn off Mail → Window → Connection Doctor → "Log Connection Activity".
- Apple TV / iTunes **TV show subscriptions that auto-download** episodes (`~/Movies/TV`) — delete watched ones, turn off auto-download in TV app settings.
- Apple Music/TV downloads, podcasts (`~/Library/Group Containers/*.com.apple.podcasts`) — remove via the app.
- Unused apps: list `/Applications` by size; leftover support files of uninstalled apps in `~/Library/Application Support/<App>` — review.
- Large files anywhere: `find ~ -xdev -type f -size +1G 2>/dev/null` (list only).
### Built-in tools to suggest
- System Settings → General → Storage → recommendations (Store in iCloud, Optimize Storage, Empty Trash automatically, Reduce Clutter).
- Finder method above is enough. Optional read-only visualizers (not cleaners): GrandPerspective, DaisyDisk, OmniDiskSweeper. Terminal: `ncdu` (`brew install ncdu`, then `ncdu ~` or `sudo ncdu -x /`).
## If space is still missing
- Missing space after full scan → almost always Time Machine local snapshots. Make a fresh Time Machine backup, then delete local snapshots (recipe above).
- Purgeable space shows as used in some tools; `diskutil info /` reveals it. Snapshots and iCloud cache are purgeable.
- Check other APFS volumes in the container: `diskutil apfs list` (e.g. a VM or extra volume eating space).
- Spotlight index bloat (rare): `sudo mdutil -E /` rebuilds it — only suggest if `/System/Volumes/Data/.Spotlight-V100` is huge.
- Last resort: reboot / Safe Mode boot, then re-check.