Is It Safe to Delete ~/Library/Caches on a Mac? How to Clear Cache Safely
DEV Community

Is It Safe to Delete ~/Library/Caches on a Mac? How to Clear Cache Safely

Yes - most subfolders inside ~/Library/Caches are safe to delete on a Mac, as long as you quit running apps first, remove only the contents inside (never the Caches folder itself), and skip Apple system caches and sensitive tool data.

Apps automatically recreate their cache files the next time you open them, so the only normal side effect is a slightly slower first launch or re-downloading cached assets.

What you should not touch are macOS's system-wide /Library/Caches and /System/Library/Caches folders - macOS manages those itself. Also keep expectations realistic: clearing cache reclaims disk space, not RAM or CPU performance; in fact, rebuilding caches can briefly use a little extra disk and network activity right after cleanup.

On one developer Mac we measured using CleanBit's scan engine, general App Caches inside ~/Library/Caches held 5.42 GB across 65 items, Chrome Disk Cache (~/Library/Caches/Google/Chrome) held 4.37 GB, and dedicated developer caches living under ~/Library/Caches added over 1.2 GB more (including 575 MB for Swift Package Manager, 379.7 MB of Homebrew downloads, 261.7 MB of pip cache, and 24.1 MB of pnpm metadata).

Even so, ~/Library/Caches was only a slice of the 124.29 GB scanned on that machine - far smaller than iOS DeviceSupport (24.1 GB du), CoreSimulator/Devices (43.0 GB du), Xcode DerivedData (15.3 GB du), and old node_modules folders (66.3 GB du). Always measure first so you know whether caches are actually where your storage went.

Check How Much Space ~/Library/Caches Uses

Before deleting anything, check the total size of your user cache folder and see which individual apps are taking the most space:

# Total size of your user cache folder (read-only)
du -sh ~/Library/Caches
# Top 20 largest folders inside ~/Library/Caches
du -sh ~/Library/Caches/* 2> /dev/null | sort -h | tail -20

If you also use web browsers with profile-level caches or developer tools that store caches outside ~/Library/Caches, you can inspect them read-only too:

du -sh \
  ~/Library/Caches/Google/Chrome \
  ~/Library/Caches/Firefox \
  ~/Library/Caches/Homebrew/downloads \
  ~/Library/Caches/pip \
  ~/Library/Caches/org.swift.swiftpm \
  ~/Library/Caches/Yarn 2> /dev/null

Note: du reports total disk usage for a directory, not how much is safe to remove blindly. Some tools place virtual environments, downloaded browser binaries, or Apple system databases inside ~/Library/Caches, so always inspect folder names before deleting.

~/Library/Caches vs. /Library/Caches: What Is Safe and What to Leave Alone

  • ~/Library/Caches/<third-party app> - App thumbnails, HTTP/image caches, updater downloads. Usually yes (quit the app first). App rebuilds the cache on next launch; first launch may feel slightly slower.
  • Browser caches (~/Library/Caches/Google/Chrome, Firefox, com.apple.Safari, plus profile Cache / Code Cache) - Cached web pages, scripts, images, and shader caches. Yes (quit the browser first). Websites re-download assets on next visit; cookies, history, bookmarks, and passwords stay intact.
  • Developer caches in ~/Library/Caches (Homebrew/downloads, pip, Yarn, org.swift.swiftpm, CocoaPods, go-build) - Downloaded package archives and build intermediates. Yes (when no build or install is running). Package managers re-download archives next time you install or rebuild.
  • Risky subfolders inside ~/Library/Caches (com.apple.FontRegistry*, com.apple.spotlight*, CloudKit*, com.apple.finder, pypoetry/virtualenvs*, ms-playwright*, pnpm/dlx*, JetBrains*) - macOS system indexes/databases, Python virtualenvs, Playwright browser runtimes, IDE indexes. No - skip these. Deleting them can break font rendering, Finder/CloudKit sync, local Python virtualenvs, or test runners until rebuilt/reinstalled.
  • ~/Library/Containers/<bundle-id>/Data/Library/Caches - Caches of sandboxed Mac App Store apps. Usually yes (quit the app first). Sandboxed app regenerates its cache on next launch.
  • /Library/Caches (root Library) - System-wide caches shared across all user accounts and daemons. Leave alone. Requires admin privileges and can cause glitches in shared services; macOS prunes these itself.
  • /System/Library/Caches - Core macOS operating system caches (SIP-protected). Never touch. Protected by System Integrity Protection; attempting to modify it risks system instability.

How to Clear Cache on a Mac Manually

You do not need any third-party app to clear ~/Library/Caches safely. Follow this conservative sequence instead of wiping the whole folder at once.

Step 1: Quit all running apps first

Deleting cache files while an app holds open file handles or writes to a SQLite cache database can cause the app to crash, lose transient state, or keep disk space occupied until the process exits. Quit your browsers, editors, chat apps, and Xcode (Command + Q) before cleaning.

Step 2: Inspect and clear specific folders in Finder

Open Finder and press Shift + Command + G (Go to Folder). Type ~/Library/Caches and press Return. Switch to List view (Command + 2) and sort by Size (enable Calculate all sizes via Command + J if sizes are blank).

Select specific large third-party app cache folders whose apps are not running - skipping com.apple.* folders, password managers, cloud sync apps, IDEs, and anything you do not recognize. Press Command + Delete to move those folders to the Trash (never delete the parent ~/Library/Caches folder itself).

Relaunch your apps to verify everything opens normally, then empty the Trash to reclaim the disk space.

Step 3: Clear browser caches safely

  • Safari: Open Safari → Settings → Advanced, check Show features for web developers, then press Option + Command + E (or click Develop → Empty Caches). This clears web cache without removing cookies, history, or passwords.
  • Chrome / Brave / Edge / Arc: Open Delete Browsing Data, check only Cached images and files (leave Cookies and Passwords unchecked), and confirm.
  • Firefox: Go to Settings → Privacy & Security → Cookies and Site Data → Clear Data, and check only Temporary cached files and pages.

Step 4: Clean developer caches with their official commands

When large folders inside ~/Library/Caches belong to developer tools, their built-in cleanup commands are safer than rm -rf:

# Clean old Homebrew download caches
brew cleanup --prune=all
# Purge pip's HTTP and wheel cache
pip cache purge
# Remove unused pnpm store packages (do not delete ~/Library/pnpm/store manually)
pnpm store prune

Warning: Avoid running rm -rf ~/Library/Caches/* blindly. Wildcard deletion hits caches of currently running apps and background services, wipes Apple subsystem caches like com.apple.FontRegistry, CloudKit, and com.apple.finder, and can accidentally destroy Poetry virtual environments (pypoetry/virtualenvs), Playwright browsers (ms-playwright), or JetBrains caches stored inside ~/Library/Caches. Always target specific verified folders - or move them to the Trash first.

What If ~/Library/Caches Is Only a Few Gigabytes?

On many Macs - especially developer or AI-coding machines - ~/Library/Caches is not the main reason storage is full. If your disk is still tight after checking caches, check our dedicated guides on whether Xcode DerivedData is safe to delete, cleaning iOS DeviceSupport and Xcode Simulators, finding and deleting old node_modules folders, removing leftover Claude Code git worktrees, and tracking down Claude Code, Cursor, and Codex disk space.

How CleanBit Handles ~/Library/Caches

I'm the developer of CleanBit, a sandboxed Mac App Store disk space cleaner for macOS 15+ (v1.0.1 now supports 9 languages and per-group Smart Scan cleaning). Because blind wildcard cleaning inside ~/Library/Caches causes unnecessary breakage, CleanBit applies multiple guardrails before anything can be removed:

  • Running-app blocking (checked twice): CleanBit checks currently running apps during scanning and locks their caches so they cannot be selected - then re-checks running apps again immediately before deleting each individual item, along with verifying the file path, symlink target, and file identity.
  • Protected Apple & third-party bundle lists: CleanBit refuses to delete the ~/Library/Caches folder itself, automatically skips com.apple.* and macOS subsystem prefixes (FontRegistry, Spotlight, CloudKit, Finder, Keychain, and more), excludes sensitive tool paths (pypoetry/virtualenvs, ms-playwright, pnpm/dlx, JetBrains), and skips over 300 protected third-party app bundle patterns during broad cache sweeps.
  • Dedicated rules with no double-counting: Browser caches (Safari, Chrome, Edge, Brave, Arc, Vivaldi, Firefox - without touching cookies, history, or passwords) and developer caches (Xcode, Homebrew, pip, Yarn, SwiftPM, CocoaPods, Go) are handled by their own specific rules so nothing is counted twice.
  • Sandboxed App Caches (~/Library/Containers): If you optionally grant Full Disk Access, CleanBit can also inspect Data/Library/Caches and Data/tmp inside sandboxed app containers after verifying each container's containermanagerd metadata matches its bundle ID.
  • Clear deletion control & honest sandbox limits: Recommended caches are deleted permanently by default so disk space returns right away (or you can switch Recommended items to move to Trash in Settings), while Review items always move to the Trash. Because CleanBit runs inside Apple's App Sandbox with no root privileges and no background helper daemon, it never touches /Library/Caches, /System/Library/Caches, /private/tmp, APFS local snapshots, or iCloud Drive synced files.

Scanning and your first 2 cleans are free on the Mac App Store (with monthly, yearly, or one-time lifetime options).

Originally published at getcleanbit.app/guides/is-it-safe-to-delete-library-caches-mac/. Written by the CleanBit developer with AI assistance; all measurements were taken on a real developer Mac.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.