CleanMate

All guides · macOS · Updated

Mac: which ~/Library folders are safe to delete, and which hold your data

A folder-by-folder map of ~/Library: Caches and Logs rebuild themselves, while Application Support, Containers, Keychains, Mail and Messages are your data — with a table of what you can delete and what to leave alone.

Download for macOS — free and open source

CleanMate Space Lens on a Mac, showing the folders of the home folder by sizeCleanMate Space Lens on a Mac, showing the folders of the home folder by size

If you only want to clear caches, follow how to clear the cache on a Mac instead. This guide answers a different question: you have opened ~/Library, found a big folder, and want to know whether deleting it loses anything. Every app keeps its caches, its data and its settings here. Some folders rebuild themselves; others are your mail, your messages and your passwords.

Find the big folders

Finder hides ~/Library. Open it with Go › Go to Folder… (⇧⌘G) and type ~/Library, or hold Option in the Go menu. Terminal is faster at sizes:

du -sh ~/Library/* 2>/dev/null | sort -h | tail -12             # its biggest folders

If a line says “Operation not permitted”, give Terminal Full Disk Access — see Full Disk Access on macOS; without it the totals look too small. If Storage settings blames System Data and ~/Library does not explain it, read “System Data” on a Mac takes tens of GB and purgeable space and Time Machine snapshots.

What lives in ~/Library

Photos keeps its library in ~/Pictures/Photos Library.photoslibrary, not in ~/Library; see the Photos library taking up space.

Clearing ~/Library/Caches safely

Quit the app, then delete its folder; it starts with an empty one next time:

du -sh ~/Library/Caches/com.spotify.client
rm -r ~/Library/Caches/com.spotify.client     # after quitting Spotify

Don’t delete all of ~/Library/Caches in one go while you’re logged in. Running apps keep files open there, and a few folders are not plain caches: com.apple.bird and CloudKit hold iCloud sync state (a wipe forces a full re-sync), com.apple.nsurlsessiond holds downloads still in progress, and pypoetry/virtualenvs holds Poetry’s environments. The step-by-step for every kind of cache, browsers and chat apps included, is in how to clear the cache on a Mac.

A cleared cache refills as you use your apps. That is normal: if the space vanishes again within days, the real cause is elsewhere in the table below.

/Library/Caches and /System

/Library/Caches (no tilde) is shared by all users and changing it needs admin rights. It is usually small, macOS manages it, and a mistyped sudo rm there can damage the system, so look with du but don’t wipe it. /System/Library/Caches and everything under /System are protected by System Integrity Protection: macOS won’t let you change them, and you don’t need to.

The same goes for /private/var/folders: it holds each user’s temporary files and some system caches. Don’t delete it by hand; a restart empties its temporary part.

Safe to delete, or not

Folder What it is Safe to delete?
~/Library/Caches/<app> the app’s cache Yes, with the app closed
~/Library/Containers/<app>/Data/Library/Caches a sandboxed app’s cache Yes, with the app closed
~/Library/Logs, Logs/DiagnosticReports logs and crash reports Yes
~/Library/Developer/Xcode/DerivedData Xcode build products Yes, Xcode rebuilds them
~/Library/Application Support/<app> the app’s data Only for an app you removed
~/Library/Containers, Group Containers (the rest) documents and settings of sandboxed apps No
~/Library/Keychains passwords and certificates Never
~/Library/Mail, ~/Library/Messages your mail and messages No — clean them from Mail and Messages
~/Library/Mobile Documents, ~/Library/CloudStorage iCloud Drive and cloud sync folders No — remove downloads from Finder instead
~/Pictures/Photos Library.photoslibrary your photos No — delete photos inside Photos
/Library/Caches caches shared by all users Leave it
/System, /private/var/folders macOS itself and temporary files Never by hand

For Mail and Messages, see Mail attachments and Messages taking up space. For the data of apps you already deleted, see uninstalling apps completely.

How CleanMate does it

CleanMate 1.12 (see all macOS features) only works inside your user account, with no admin password and no helper, and it never touches Keychains, Mail, Messages, Photos, Documents or iCloud Drive.

From Terminal, cleanmate space ~/Library prints the same sizes as Space Lens, and cleanmate scan shows what Smart Scan would clean; both change nothing. The icon cache and Quick Look’s thumbnails are caches too, but they are rebuilt with commands, not by deleting folders: see fixing wrong icons and blank Quick Look previews. More in the cleanmate command and AI agents. Download CleanMate.

FAQ

Is it safe to delete ~/Library/Caches? Folder by folder, with the app closed, yes: apps rebuild their caches. Deleting the whole folder while logged in can break iCloud sync and running apps, so don’t do it in one command.

Why does Finder show the disk almost empty while Storage says it’s full? Finder doesn’t show ~/Library, other users’ folders, local snapshots or purgeable space. du -sh ~/Library/* and sudo du -xhd 1 /System/Volumes/Data show where the space is.

Can I delete ~/Library/Containers? No. Each container is a sandboxed app’s whole data: documents, settings, sometimes the only copy. Only Data/Library/Caches inside a container is cache.

Will deleting caches speed up my Mac? Rarely. It frees space; the apps are a little slower while they rebuild the cache. Clear caches when you need the space, not as routine maintenance.

What about /Library/Caches? It belongs to the system and all users, it is usually small, and changing it needs admin rights. Leave it to macOS.

Comparing free CleanMyMac alternatives? See CleanMate, Pearcleaner, AppCleaner and OnyX side by side.

Weighing OnyX against CleanMate? See what each one does, feature by feature.

Looking for a free CCleaner for Mac alternative? See how CleanMate compares, feature by feature.

Looking for an AppCleaner alternative? See how CleanMate’s Uninstaller compares.

Looking for a Pearcleaner alternative that is still updated? See how CleanMate compares.

Skip the commands

Open source — star it on GitHub: CleanMate for macOS

How CleanMate decides what is safe to remove →