macOS / Storage

The hidden caches in ~/Library that nobody checks

Published Aug 8, 2026 · 6 min read · macoptimize

The pattern is always the same. Photos take 10GB, Applications take 20GB, Documents take 8GB, and the 256GB drive is somehow full. The missing 150GB is usually inside a folder macOS hides on purpose: ~/Library.

Getting there

In Finder, open the Go menu and hold the Option key, which reveals Library in the list. Or press Command Shift G and type ~/Library. Once you are there, sort by size. The keyboard shortcut is Command J to open view options, then tick Calculate all sizes, but be aware that sizing this folder can take a while on a large drive.

Terminal is faster and gives you numbers you can act on:

du -sh ~/Library/* 2>/dev/null | sort -hr | head -20

~/Library/Caches: the big one

Every app dumps temporary files here and few clean up properly. Browser site data, chat history thumbnails, streaming buffers and update downloads all live in this one directory.

du -sh ~/Library/Caches/* 2>/dev/null | sort -hr | head -10

On a Mac that has been in use for a year, 10GB to 40GB here is normal. Deleting the contents is safe. Every app rebuilds what it needs, and nothing in this folder is the only copy of anything.

~/Library/Application Support: measure, do not nuke

This directory looks like the cache folder but behaves differently. It holds real state: mail databases, browser profiles, save games, editor settings, licence files and device backups. Deleting it blindly costs you data.

du -sh ~/Library/Application\ Support/* 2>/dev/null | sort -hr | head -15

What is worth checking:

  • MobileSync/Backup: local iPhone backups, often 30GB to 80GB, sometimes for devices you no longer own.
  • Folders for apps you uninstalled: macOS does not remove these when you drag an app to the Trash.
  • Electron app data: desktop apps built on web technology often keep multiple gigabytes of cached assets here.

~/Library/Containers: where Docker hides

Sandboxed apps store data in per app containers. This is not a folder you should browse into and clean by hand, but it is worth knowing what lives there, because one entry can be enormous:

du -sh ~/Library/Containers/com.docker.docker 2>/dev/null

That single container holds Docker.raw, and a sparse file that has grown to 40GB or 60GB is extremely common. It is the number one cause of a Mac that reports huge System Data with no visible cause.

~/Library/Developer: build output

du -sh ~/Library/Developer/* 2>/dev/null | sort -hr

DerivedData, DeviceSupport, CoreSimulator and old archives. Everything here is either rebuildable or replaceable except the archives holding dSYMs for shipped builds.

~/Library/Group Containers and ~/Library/Mail

Group Containers holds shared data between apps from the same developer, and Mail keeps a local copy of every attachment you have ever received unless you have limited the download settings. Both are worth measuring, neither should be deleted wholesale.

du -sh ~/Library/"Group Containers" ~/Library/Mail 2>/dev/null
The folders to leave alone. ~/Library/Keychains holds your saved passwords, ~/Library/Preferences holds app settings, and ~/Library/Mobile Documents is your iCloud Drive content. Deleting any of these is either a security problem or a data loss problem, and none of them are big enough to be worth the risk.
See it before you delete it

macoptimize scans the Library subfolders as separate categories, so caches, developer output and containers are listed independently with their sizes. Oversized folders appear as single large blocks in the Analyze treemap, which is how you catch the one directory that grew to 40GB while you were not looking.

A workable routine

  1. Measure the top level of ~/Library and note the order.
  2. Clear caches first, since nothing is lost.
  3. Look for Application Support folders belonging to apps you have removed.
  4. Check device backups and decide which are still useful.
  5. Handle developer output using the dedicated guides for Xcode, Docker and Android.

What each folder inside ~/Library actually holds

FolderContentsTypical size
CachesRegenerable app data5GB to 40GB
Application SupportApp databases and profiles2GB to 60GB
ContainersSandboxed app data, including Docker5GB to 120GB
Group ContainersData shared between app families1GB to 20GB
DeveloperXcode build output and device support20GB to 120GB
LogsDiagnostic text files1GB to 10GB
MailMessage stores and attachments1GB to 30GB

The three folders to leave alone

  • Keychains. Credentials and certificates live here. Deleting the folder signs you out of everything and can lose local certificates you cannot reissue.
  • Mail. The folder is a database of messages, including ones your provider may no longer hold. Removing it can mean losing mail permanently, particularly for accounts configured as POP rather than IMAP.
  • Application Support for apps you still use. Photoshop scratch files, editor extensions, database clients and password managers all keep state here. It looks like cache, and it is not.

Clearing only what is old

Caches are usually worth keeping for the apps you use every day and worth deleting for everything else. Age is a good proxy:

find ~/Library/Caches -mindepth 1 -maxdepth 1 -type d -mtime +60 -exec du -sh {} + | sort -hr | head -25

Sixty days of inactivity means the app has not needed that data in two months. Review the list before deleting, since a few entries look unfamiliar but belong to system services that regenerate on their own, like com.apple.bird for iCloud Drive and CloudKit for iCloud sync.

What gets rebuilt, and when

Knowing the rebuild cost turns this from a scary operation into a routine one:

  • Caches rebuild the first time the app needs the data again, usually within one launch.
  • Developer build output rebuilds on the next build, which is the slowest item on the list.
  • Logs are not rebuilt at all, they simply start again from the current moment.
  • Containers rebuild when the app next runs, though a sandboxed app may ask you to sign in again.
Seeing this without guessing

macoptimize shows ~/Library/Caches and the other cache roots as separate groups in the Clean tab, each with the real size it measured on your machine. In our own scan Library came to 40.30 GB, which is the kind of number worth seeing before deciding what to keep.

FAQ

Why is the Library folder hidden?

Apple hides it to keep ordinary Finder navigation simple, since most of what is inside is not meant to be edited by hand. Press Shift Command Period in Finder to show hidden items, or use the Go menu and hold Option to reveal Library in the list.

Is it safe to delete the whole Caches folder?

It will not break macOS, and it will make the next few days slightly slower. Deleting everything at once also clears caches for apps that were running, which can leave them confused until restarted. Clearing folders that have not been touched in 30 to 60 days gets most of the space with none of the disruption.

Can I stop caches from growing back?

Not completely, since caching is how apps avoid repeating work. You can keep the growth flatter by clearing on a schedule, deleting apps you no longer use, and keeping an eye on the developer folders, which grow faster than anything else in Library.

Are Containers safe to delete?

Some are, many are not. A container holds a sandboxed app's data, which can include documents, preferences and logins. Deleting the container for an app you use means losing its state and signing in again. The one most people do clear is Docker's, since the disk image there is regenerable.

How much space can Library hold in total?

On a machine used for development, 60GB to 150GB is common, and most of it sits in Developer and Containers. On a machine used for office work, 10GB to 30GB is more typical, with Caches and Mail making up the bulk.

Or let it do the work

macoptimize scans the folders in this guide, shows the real sizes, and clears what you select. $20 one time, covers 2 Macs.