DEV Community

Cover image for 5 Hidden Folders Eating Your Mac's Storage (And How to Safely Reclaim 100GB+)
Sarmad Hussain
Sarmad Hussain

Posted on

5 Hidden Folders Eating Your Mac's Storage (And How to Safely Reclaim 100GB+)

You sit down to build a new feature or pull a container image, and macOS interrupts you with a familiar nightmare:

⚠️ "Your disk is almost full"

You open System Settings → General → Storage, hoping for clear answers. Instead, macOS presents an enormous, opaque bar:

[ ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ]
System Data: 138.4 GB
Enter fullscreen mode Exit fullscreen mode

Where did 140 GB vanish? Your Documents folder is only 15 GB, and your Applications take 25 GB.

The culprit is hidden inside Unix directories that macOS excludes from user categories and dumps into generic "System Data." If your mac storage full alert is firing, here is a technical breakdown of the 5 hidden folders silently consuming your Mac's storage, the Terminal commands to audit them, and how to safely reclaim 100GB+ without breaking your development workflow.


The 5 Hidden Storage Killers at a Glance

Directory Typical Size What Lives There Safe to Purge?
~/Library/Caches 15 GB – 45 GB App, browser, & Electron framework caches ✅ Yes (App-by-app)
~/Library/Developer/Xcode/DerivedData 20 GB – 70 GB Build artifacts, index symbols, module caches ✅ Yes (Xcode regenerates)
~/Library/Group Containers/group.net.whatsapp.WhatsApp.shared 10 GB – 40 GB Cached media, video duplicates, voice notes ⚠️ Yes (Keep SQLite DB)
~/.gradle/caches 10 GB – 35 GB JVM/Android build transforms & stale jars ✅ Yes (Stop daemon first)
~/Library/Containers/com.docker.docker/Data 30 GB – 80 GB Docker Desktop Linux VM disk (Docker.raw) ⚠️ Yes (Via Docker CLI)

1. ~/Library/Caches: The App Landfill

What creates it?

Every macOS application stores discardable cache files in ~/Library/Caches/<bundle-identifier>. This includes browsers (Chrome, Safari), development editors (VS Code, Cursor), Electron apps (Slack, Discord, Spotify), and system frameworks.

Why it grows

While apps should prune old files, they rarely do. Slack caches media from channels you haven't opened in years; Spotify keeps gigs of cached streams; and VS Code accumulates language server indexes. Worse, when you drag an application to the Trash, its directory inside ~/Library/Caches remains behind forever.

Inspect its size

Audit the 10 largest cache hogs in Terminal:

du -sh ~/Library/Caches/* 2>/dev/null | sort -hr | head -n 10
Enter fullscreen mode Exit fullscreen mode

How to clean it safely

Never run rm -rf ~/Library/Caches/* with open apps, which can corrupt running cache databases. Instead, close the target app and purge its folder:

# Chrome cache
rm -rf ~/Library/Caches/Google/Chrome/*

# Slack cache
rm -rf ~/Library/Caches/com.tinyspeck.slackmacgap/*

# Spotify audio cache
rm -rf ~/Library/Caches/com.spotify.client/Data/*
Enter fullscreen mode Exit fullscreen mode

💡 Tip: Purging caches won't log you out—user sessions and preferences live in ~/Library/Application Support.


2. ~/Library/Developer/Xcode/DerivedData: The Build Artifact Monster

What creates it?

Whenever you compile iOS, macOS, watchOS, or Swift packages—or run React Native and Flutter projects invoking native compilers—Xcode writes intermediate build objects, module caches, and index files into DerivedData.

Why it grows

Xcode retains separate build artifacts for every branch, configuration, and project workspace. If you worked on a client project months ago, its 15GB compilation footprint remains indefinitely. Xcode provides no automatic expiration policy.

Inspect its size

du -sh ~/Library/Developer/Xcode/DerivedData 2>/dev/null
Enter fullscreen mode Exit fullscreen mode

On active developer machines, this folder routinely swells past 40 GB.

How to clean it safely

DerivedData contains purely ephemeral build artifacts and indexes. Purging it is completely safe:

rm -rf ~/Library/Developer/Xcode/DerivedData/*
Enter fullscreen mode Exit fullscreen mode

Your next build will re-index symbols and compile clean binaries, immediately reclaiming tens of gigabytes.


3. WhatsApp Desktop Shared Media: The Secret Video Mirror

What creates it?

WhatsApp Desktop uses macOS App Group containers to share data across its sandboxed helper processes and notification services:
~/Library/Group Containers/group.net.whatsapp.WhatsApp.shared

Why it grows

Every video, voice memo, GIF, and PDF shared across your personal chats and work groups is stored in this directory. Even if you clear media on your phone, WhatsApp Desktop often keeps local duplicates on your Mac.

Inspect its size

du -sh ~/Library/Group\ Containers/group.net.whatsapp.WhatsApp.shared 2>/dev/null
Enter fullscreen mode Exit fullscreen mode

How to clean it safely

⚠️ CAUTION: Do not wipe the entire folder. It contains ChatStorage.sqlite, which houses your message history and encryption keys!

Instead, purge only media payloads older than 30 days or larger than 10MB:

# Inspect media size
du -sh ~/Library/Group\ Containers/group.net.whatsapp.WhatsApp.shared/Message/Media 2>/dev/null

# Safely prune video files larger than 10MB while keeping chat history intact
find ~/Library/Group\ Containers/group.net.whatsapp.WhatsApp.shared/Message/Media -type f -size +10M -delete
Enter fullscreen mode Exit fullscreen mode

4. ~/.gradle/caches: The Multi-Gigabyte JVM Reservoir

What creates it?

If you build Android, React Native, Kotlin, or backend Spring apps, Gradle stores downloaded dependencies (JARs, AARs) and compiler transform outputs inside ~/.gradle/caches.

Why it grows

Gradle preserves dependency resolutions across every wrapper version you've ever compiled. When libraries update, previous versions remain on disk indefinitely.

Inspect its size

du -sh ~/.gradle/caches 2>/dev/null
Enter fullscreen mode Exit fullscreen mode

How to clean it safely

Stop running background daemons first to unlock active files:

# 1. Stop background daemons
./gradlew --stop 2>/dev/null || pkill -f gradle

# 2. Flush cached dependencies and daemons
rm -rf ~/.gradle/caches/*
rm -rf ~/.gradle/daemon/*
Enter fullscreen mode Exit fullscreen mode

Gradle will re-download only the exact dependencies needed on your next build.


5. ~/Library/Containers/com.docker.docker/Data: The Runaway VM Disk

What creates it?

Because macOS runs the Darwin kernel, Docker Desktop spins up a lightweight Linux VM via Apple's Virtualization.framework. All images, containers, and volumes reside inside a single virtual disk file (Docker.raw).

Why it grows

Docker.raw is an APFS sparse file. As you pull images and build layers, it expands. However, when you delete images or stop containers, APFS does not automatically reclaim unused space, leaving a bloated virtual disk on your Mac SSD.

Inspect its size

du -sh ~/Library/Containers/com.docker.docker/Data 2>/dev/null
Enter fullscreen mode Exit fullscreen mode

How to clean it safely

Avoid rm -rf directly on the disk image while Docker runs. Instead, prune unused Docker objects cleanly:

# 1. Check Docker disk utilization
docker system df

# 2. Prune unused containers, networks, dangling images, and build cache
docker system prune -a --volumes --force
Enter fullscreen mode Exit fullscreen mode

If Docker.raw remains oversized, open Docker Desktop Settings → Resources → Virtual disk limit and adjust the ceiling to trim the allocated sparse file.


Reclaimed Space Summary

Cleaning these five targets produces massive storage gains:

1. User Caches (Slack, Chrome, Spotify): ~15 GB
2. Xcode DerivedData:                    ~40 GB
3. WhatsApp Cached Media:                ~15 GB
4. Gradle Build Caches:                  ~12 GB
5. Docker VM Prune:                      ~25 GB
------------------------------------------------
TOTAL ESTIMATED RECLAIMED SPACE:        ~107 GB
Enter fullscreen mode Exit fullscreen mode

Automating Storage Hygiene with Dusty

Manual terminal maintenance works, but remembering paths, avoiding destructive deletions, and crawling directories manually every few weeks is tedious.

That's why we created Dusty — an AI-powered macOS storage cleaner engineered specifically for developers and power users.

Dusty macOS Storage Cleaner

Why Developers Use Dusty:

  • Google Gemini AI File Explanations: Wondering what an obscure 8GB folder in ~/Library/Caches does? Dusty uses Gemini AI to analyze file headers and explain in plain English what created it and whether it's safe to delete.
  • Developer Bloat Scanner: Scans for orphaned node_modules, Xcode DerivedData, Gradle artifacts, and Docker overlays across your entire disk in seconds.
  • Surgical WhatsApp Cleaner: Reclaims heavy media while protecting your SQLite message database.
  • Trash-First Safety: Files are never erased permanently on first pass; they move safely to the macOS Trash for instant restoration.
  • Pay Once, Own Forever: No recurring $40/year subscriptions. Just a $9.99 lifetime license (with a 24-hour free trial).

Install Dusty in seconds via Homebrew:

brew install sarmadhussainch/dusty/dusty
Enter fullscreen mode Exit fullscreen mode

Or download the universal binary at dustystorage.com.


Keep Your SSD Healthy

When an APFS SSD dips below 10-15% available storage, wear leveling slows down and swap memory stalls. Running a quick audit on these five hidden folders guarantees your Mac stays fast and responsive.

💬 What is the largest hidden folder you've uncovered on your Mac? Share your findings and favorite cleanup tricks in the comments!

Top comments (0)