DEV Community

Cover image for What's actually safe to delete on a Mac? A traffic-light guide
MagioApps
MagioApps

Posted on Edited on Originally published at Medium

What's actually safe to delete on a Mac? A traffic-light guide

"Storage almost full." It always shows up at a bad moment: halfway through a macOS update, mid-export, or the night before a flight when you want to download a few films. Then comes the hard part. You open Finder, find a folder called Library, and wonder which of these thousands of files you can remove without breaking something.

Here is a simple way to think about it, borrowed from the street corner: a traffic light.

  • Green (safe): files that apps rebuild by themselves. Deleting them costs you, at most, a little re-downloading or rebuilding.
  • Amber (your call): files only you can judge. Nothing breaks if you delete them, but you might lose something you wanted.
  • Red (don't touch): files that hold your data, your passwords or your history.

Everything below applies to macOS 11 Big Sur and later on Apple silicon Macs.

Step 0: look before you delete

Guessing is how people delete the wrong thing. Start by seeing where the space actually goes.

  • macOS 13 Ventura and later: Apple menu > System Settings > General > Storage.
  • macOS 11 and 12: Apple menu > About This Mac > Storage > Manage.

You'll see categories such as Applications, Documents, Photos and the vague "System Data". Apple's own recommendations on that screen (Store in iCloud, Optimize Storage, Empty Trash Automatically, Reduce Clutter) are a sensible first stop.

If you're comfortable in Terminal, du gives a quick, read-only answer. Nothing is changed:

# Your home folders by size, biggest last
du -sh ~/* 2>/dev/null | sort -h

# Hidden folders too (.npm, .cargo, .docker and friends)
du -sh ~/.[!.]* 2>/dev/null | sort -h
Enter fullscreen mode Exit fullscreen mode

Terminal can't read some protected folders unless you've given it Full Disk Access, so a few numbers may be missing. That's fine for a first look.

Green: safe to delete (nothing breaks)

Nothing in this group breaks an app or loses your work. What it costs differs, though: some of it rebuilds offline in seconds, some needs a re-download, and some (logs) doesn't come back at all. Each item below says which.

Your caches: ~/Library/Caches

Apps keep temporary data here so they can load things faster next time: thumbnails, downloaded updates, web content. Deleting a cache is safe because the app rebuilds it. What you pay is time: some caches are rebuilt locally from data already on your Mac, others are downloaded again, so expect a slower first launch and some network use, and clear them before a flight rather than during one.

Two rules apply:

  1. Quit the app first. Pulling a cache out from under a running app can confuse it.
  2. Delete the folders inside, not ~/Library/Caches itself.

To get there: in Finder, choose Go > Go to Folder (Shift-Command-G) and type ~/Library/Caches. Sort by size and move the biggest app folders to the Trash.

Leave /Library/Caches and /System/Library/Caches alone. Those belong to the system, not to you.

If the free space doesn't go up: macOS may be keeping the deleted data in local Time Machine snapshots for a while. You can see them, read-only, with:

tmutil listlocalsnapshots /
Enter fullscreen mode Exit fullscreen mode

macOS removes these snapshots by itself when it needs the room, so the space comes back without you doing anything.

Logs: ~/Library/Logs

Text records of what apps did. They're the one green item that doesn't come back: delete them and nothing breaks, but the history is gone. So if you're chasing a crash or have a support ticket open, keep the logs for that app until it's solved. Otherwise they're safe to remove. They're usually small, though a misbehaving app can let them grow.

Old installers

The .dmg and .pkg files sitting in Downloads after you've installed the app are just copies. Once the app is in Applications, the installer can go. The same goes for an old "Install macOS ..." app left in Applications after an upgrade: it can take many gigabytes, and you can download it again from Apple if you ever need it.

Developer build files

If you write code, this is often where the biggest wins hide: Xcode's DerivedData, node_modules folders, and package caches for npm and Cargo. All of them can be rebuilt from your source code and lockfiles, as long as you still have network access to the package registry (including any private one) and the tools for native modules. Don't clear them right before working offline. We'll cover them in detail in a later article.

The Trash

Obvious, often forgotten: files in the Trash still use space until you empty it.

Amber: your call

Nothing here is dangerous to the system. It's dangerous to you, because only you know what matters.

Downloads and Desktop

Often the biggest pile on a Mac, and impossible to judge automatically. In Finder, switch to List view (Command-2), open View > Show View Options and tick "Calculate all sizes", then click the Size column. Decide file by file.

Documents

Same approach. To find big files anywhere, open a Finder search (Command-F), click the + button, choose "Other…", and add "File Size" as a criterion, for example "is greater than 1 GB".

iPhone and iPad backups

Local device backups live in ~/Library/Application Support/MobileSync/Backup and can be large. Don't delete folders there by hand. Instead, connect the device, select it in the Finder sidebar, and use Manage Backups on the General tab. Make sure you have a newer backup (local or iCloud) before removing an old one.

Virtual machines

VM disk images can take tens of gigabytes. Delete one and its whole operating system and files go with it. Keep the ones you still use.

Xcode Archives

Archives of apps you've shipped contain the debug symbols you need to read crash reports. Keep the archives for versions people are still running.

Red: don't touch

These folders hold things you can't rebuild. If you want to shrink them, do it from inside the app that owns them, never by deleting files in Finder.

  • Photos Library (~/Pictures/Photos Library.photoslibrary): never open it and delete things inside. Use the Photos app, or turn on iCloud Photos with "Optimize Mac Storage".
  • Mail (~/Library/Mail) and Messages (~/Library/Messages): delete big attachments and old conversations inside the apps. In Messages, Settings > General > Keep messages (Preferences > General on macOS 11 and 12) lets you choose 30 days or 1 year instead of Forever.
  • Keychains (~/Library/Keychains): your saved passwords and certificates.
  • iCloud Drive: deleting a file here deletes it on every device that syncs it.
  • ~/.ssh: your SSH keys. Lose them and you may lose access to servers.
  • .git folders inside projects: your project's entire history.
  • ~/Library as a whole: it also holds app settings and data. Clean specific folders inside it, never the whole thing.

Habits that prevent regret

  1. Move to Trash, don't rm -rf. The Trash is your undo button until you empty it.
  2. Quit apps before clearing their caches.
  3. Have a backup. If Time Machine is running, a mistake is an inconvenience, not a disaster.
  4. Don't chase "System Data" blindly. Part of it is local Time Machine snapshots and other space that macOS frees by itself when it needs room.
  5. Be wary of anything that promises speed. Deleting files gives you disk space. It's not a turbo button, whatever a pop-up says.

Where Ample fits

We built Ample, a native Mac disk cleaner, around exactly this traffic light, instead of a big "Clean everything" button.

Ample scans your home folder read-only and sorts every folder into three groups:

  • Critical (red): Keychains, Photos Library, Mail, Messages, iCloud Drive, .ssh, .git. Never touched.
  • Important (amber): Documents, Downloads, Desktop, iPhone backups, virtual machines, Xcode Archives. Shown to you, never removed for you.
  • Safe (green): ~/Library/Caches, logs, DerivedData, node_modules, npm and Cargo caches, old installers.

Only green can ever be cleaned. Even then, nothing disappears straight away: items move to a quarantine first, you can Undo at any time, and you purge them when you're sure. Each item is re-checked right before it's touched. Ample doesn't follow links, leave your home folder, cross to other disks or walk cloud folders.

Your files never leave your Mac. There's no account, no cloud and no analytics in the app, and it works without Full Disk Access (it simply skips protected folders).

The free version scans as often as you like and tells you how much space you could free up. Cleaning with quarantine and Undo, the Space Map, Large Files and the Tools are in Pro, which is $10 once, no subscription. Ample needs macOS 11 or later on an Apple silicon Mac; Intel Macs aren't supported yet.

The short version

  • Green: caches, logs, old installers, build files. Delete after quitting the app. Keep logs you're using to debug something.
  • Amber: Downloads, Desktop, Documents, device backups, VMs, archives. Look first, then decide.
  • Red: Photos, Mail, Messages, Keychains, iCloud Drive, .ssh, .git. Leave them alone, or manage them from their own apps.

Want to see your own traffic light? Download Ample free and see how much space you can get back in about a minute.

Top comments (4)

Collapse
 
diskbee profile image
DiskBee(NTFS for Mac) •

One boundary worth adding to the cache section: APFS local snapshots are not rebuildable cache data. They can retain blocks after files are deleted, so a cleanup pass may not immediately free the space shown in Finder. You can inspect them with:

tmutil listlocalsnapshots /
Enter fullscreen mode Exit fullscreen mode

Also, ‘rebuildable’ does not always mean ‘immediately rebuildable offline.’ A Spotlight index can be regenerated locally, but some application caches may require a network fetch or the original app state. It would help to separate those two cases before treating all cache directories as equivalent.

Collapse
 
magioapps profile image
MagioApps •

Good catch, thanks. Snapshots only got a passing mention under "Habits", so I've added a note to the cache section: you can delete gigabytes and not see the space come back until macOS thins its local snapshots, with tmutil listlocalsnapshots / as the quick check. Agreed on offline vs network rebuilds too, the article now says which caches cost a re-download.

Collapse
 
diskbee profile image
DiskBee(NTFS for Mac) •

I would separate “rebuildable” from “disposable” in the green group. Logs do not come back on their own; deleting one may be harmless for the app but still destroy the only evidence for an ongoing crash investigation. node_modules is usually rebuildable, but only if the source, lockfile, package registry access and any native build prerequisites are still available. Neither is a reason to keep everything forever, but the real cost is different: cache removal spends rebuild time, while log removal spends diagnostic history. That distinction would make the traffic light safer without making it more complicated.

Collapse
 
magioapps profile image
MagioApps •

That's a useful distinction, and I've updated the article with it. Logs are now called out as the one green item that doesn't come back (keep them while you're debugging), and the build-files section notes that node_modules only rebuilds cleanly with registry access and the native build tools. It's also part of why Ample moves cleaned items to a quarantine with Undo instead of deleting them straight away.