What Is the .cache Folder on a Mac, and Is It Safe to Delete?
~/.cache~/.cache/*Yes, the .cache folder in your home directory is safe to delete. It holds scratch data for command-line tools, and every tool that uses it rebuilds its own piece on the next run. The folder is hidden, which is why you probably found it through a disk scanner rather than Finder. If it has grown large, usually because of machine learning models or downloaded browser builds, you can clear it without losing anything permanent.
What it is
~/.cache is the Linux world's version of ~/Library/Caches. On Linux, a convention called the XDG Base Directory spec tells command-line programs to keep regenerable data in ~/.cache, and many cross-platform tools keep following that convention when they run on a Mac instead of switching to Apple's location. So while your native Mac apps cache under ~/Library/Caches, a second cache pile builds up here, fed by package managers, ML libraries, and headless browser tools. Each tool gets its own subfolder: ~/.cache/huggingface for downloaded Hugging Face models, ~/.cache/torch for PyTorch weights, ~/.cache/puppeteer for the Chromium builds Puppeteer downloads, ~/.cache/pre-commit for git hook environments, and so on.
The folder grows because the things stored here are big and nobody cleans up. A single ML model file can run to several gigabytes, a headless browser tool keeps a full browser binary for every version it has ever fetched, and package managers keep every archive they download. On a Mac used for development or anything touching AI tooling, ~/.cache can quietly reach tens of gigabytes. The saving grace is that everything inside is a copy of something the tool can download again or a build artifact it can produce again. Nothing original lives here.
Is it safe to delete?
Yes. Nothing in ~/.cache is your data. Deleting it loses no documents, no settings, and no installed software; what you give up is time and bandwidth. Each tool rebuilds its cache the next time you use it, and for the heavy items that means re-downloading. If you delete ~/.cache/huggingface, the next script that loads a model downloads the whole thing again before it runs, often a multi-gigabyte wait for modern models. That is the entire downside.
You can also be selective instead of clearing the whole thing. Every subfolder inside ~/.cache belongs to exactly one tool, so it's reasonable to trash the subfolders of tools you no longer use and leave the ones you rely on daily. If a name means nothing to you, it almost certainly belongs to a tool you tried once and forgot. Diskmack identifies ~/.cache and its per-tool subfolders automatically and cleans them the safe way.
How to check its size
In Finder: In Finder, press Command-Shift-G (or choose Go > Go to Folder), type ~/.cache and press Return. The folder is hidden, but Go to Folder opens it anyway. Press Command-A to select everything inside, then Command-Option-I to open the Inspector and see the combined size. To make hidden items visible in your home folder generally, press Command-Shift-Period.
In Terminal:
du -sh ~/.cacheThe ~ expands to your home folder automatically, and the path has no spaces, so no quotes are needed. To see which tool is hogging the space, run du -sh ~/.cache/* and read the per-subfolder sizes.
How to clean it
- Stop anything that might be writing to a cache right now: a running training script, a test suite driving a headless browser, an active install in a terminal.
- In Finder, press Command-Shift-G, type ~/.cache and press Return.
- To clear everything, press Command-A to select the contents, then Command-Delete to move them to the Trash. To be selective, trash only the subfolders of tools you no longer use.
- Leave the .cache folder itself in place. Tools recreate their subfolders as needed, and keeping the folder avoids permission oddities.
- Empty the Trash to actually reclaim the space.
If Finder refuses to delete a file because it's in use, some tool is still running. Skip that item and catch it on the next pass.
Will it come back?
It comes back, one tool at a time. Each program rebuilds its subfolder the next time you run it: small caches reappear within seconds, and the big ones (model weights, browser binaries) return the next time a tool needs to download them, which costs a visible wait rather than happening silently. Subfolders that belonged to tools you've uninstalled stay gone forever, which is why clearing ~/.cache on a machine with old experiments on it often frees space that never comes back.
Common questions
Why can't I see the .cache folder in Finder?
Any file or folder whose name starts with a period is hidden on macOS. Press Command-Shift-Period in Finder to toggle hidden items on and off, or skip the toggle and use Go > Go to Folder with the path ~/.cache.
Isn't the Mac cache folder ~/Library/Caches? Why do I have both?
Both exist and they don't overlap. Native Mac apps follow Apple's convention and cache in ~/Library/Caches. Cross-platform command-line tools often follow the Linux convention instead and cache in ~/.cache. If you use developer or AI tools, you'll accumulate both, and both are safe to clear.
Can I delete just one subfolder inside ~/.cache?
Yes. Each subfolder belongs to a single tool, so deleting ~/.cache/puppeteer only affects Puppeteer, and this is the right move when one tool owns most of the space. One wrinkle with Puppeteer specifically: it fetches its browser when the package is installed, not when it runs, so you'd bring it back with npx puppeteer browsers install chrome or by reinstalling. Most tools here rebuild on their own the next time they run.
Will deleting ~/.cache break my Python or Node setup?
No. Installed packages, virtual environments, and project code don't live here; only downloaded archives and other regenerable data do. The worst case is that the next install or model load is slower because the tool has to fetch things again.
Related folders
- Can You Delete the Library Caches Folder on a Mac?
- Is the Hugging Face cache safe to delete? What's inside ~/.cache/huggingface
- How to Clear the pip Cache on Your Mac (and Why It's Safe to Delete)
- Can I delete the .npm folder on my Mac? Yes, it's safe
- How to clear the Homebrew cache on your Mac (yes, it's safe to delete)
- Is It Safe to Delete the uv Cache (~/.cache/uv) on a Mac?