Reference / Fix an error
Mac says "Your startup disk is almost full" — what to delete
Reclaim 20+ GB safely · reversible
macOS only warns once you're nearly out. Most of the weight on a dev Mac is caches and build output that come back on their own — safe to clear. Here's what's safe and what to keep.
30-second triage
See how full you are and what's safe to clear:
$ df -h / # confirm free space
$ diskspace scan # annotate what's there
$ diskspace detect # biggest safe wins firstWhat's usually eating it
Each links to a plain verdict — does it come back if you delete it?
Is it safe to delete ~/Library/Developer/Xcode/DerivedData on a Mac?~/Library/Developer/Xcode/DerivedDataSafe to deleteIs it safe to delete node_modules folders on a Mac?**/node_modulesSafe to deleteIs it safe to delete ~/Library/Caches/Homebrew on a Mac?~/Library/Caches/HomebrewSafe to deleteIs it safe to delete ~/Downloads/*.dmg on a Mac?~/Downloads/*.dmgSafe to deleteIs it safe to delete ~/.npm/_cacache on a Mac?~/.npm/_cacacheSafe to delete
The one-command fix
diskspace frees exactly what you need, pressure-tests every candidate against live disk state, and stages it reversibly — so an agent or a human can run it without fear.
$ brew install tymrtn/diskspace/diskspace
$ diskspace doctor --need 20G --yes # scan → pressure-test → free