Is it safe to delete ~/.cache on Mac?
Safe with care~/.cache
Mostly, but not in one go. What developer tools keep in ~/.cache on a Mac, what each costs to fetch again, and the clean commands for uv and Hugging Face.
Verdict: Safe with care. Everything in ~/.cache is meant to be re-creatable, so nothing personal is lost if it goes, but some of it is large downloads, such as AI models, that take a long time to fetch again. Clear it one tool at a time, using each tool's own clean command where it has one.
What lives in ~/.cache
Mac apps normally keep their caches in ~/Library/Caches. ~/.cache comes from the Linux world: the XDG Base Directory specification defines $XDG_CACHE_HOME as the place for "user-specific non-essential data files" and makes ~/.cache its default. Many command-line and developer tools follow that rule on macOS too, each in its own subfolder.
On the macOS 15.5 Mac we checked this on, ~/.cache came to 3.3 GB:
| Folder | Size | What it holds |
|---|---|---|
uv |
917 MB | Python packages and builds downloaded by uv |
huggingface |
671 MB | Models and datasets from the Hugging Face Hub |
prisma |
88 MB | Files downloaded by Prisma |
torch |
80 MB | Files downloaded by PyTorch |
Smaller folders belonged to the GitHub CLI, pkg and yt-dlp, and a few AI coding tools kept their own folders there too. Other common ones are puppeteer, which holds the browsers Puppeteer downloads, and yarn, which some Yarn 1 setups use.
What happens if you delete it
Each tool notices its cache is gone and downloads or rebuilds what it needs on next use. That is the whole point of a cache, but the cost varies a lot:
- Hugging Face models can each run to gigabytes. Deleting them means downloading them again before you can work, and you can't if you are offline. The Hugging Face cache guide notes that cached files are never deleted automatically, so old revisions pile up, which is why its own clean commands are worth using.
- uv fetches packages again, but its cache documentation warns that it is never safe to modify the cache directly, for example by removing a file or folder. Deleting parts of it while uv is running can break an install.
- Folders that are not really caches. Any tool can write here, and a few keep their own runtime or state in
~/.cache. Deleting one of those means the tool sets itself up again, or stops working until you reinstall it.
Nothing personal should live in ~/.cache, so there is rarely anything lost for good. Check unfamiliar folder names before you remove them.
How to check its size safely
This only reads, and lists each subfolder smallest first, so the biggest end up at the bottom:
du -sh ~/.cache/* 2>/dev/null | sort -h
In Finder, choose Go > Go to Folder, type ~/.cache and press Return. Choose View > as List, then View > Show View Options and tick Calculate all sizes to see each folder's size.
The safest way to get the space back
Work through the big folders one at a time:
- uv: run
uv cache pruneto remove unused entries. uv's docs call it safe to run periodically.uv cache cleanempties the cache completely but keeps the folder and its lock file, so other uv processes stay safe. - Hugging Face: run
hf cache lsto list cached models with their size and when you last used them. Remove one withhf cache rmfollowed by its ID, such asmodel/bert-base-cased, and runhf cache pruneto clear revisions nothing refers to and unfinished downloads. - Tools without a clean command, such as Puppeteer: quit anything using the tool, then move its folder to the Bin:
trash ~/.cache/puppeteer
The trash command comes with macOS 14 Sonoma and later. Puppeteer downloads its browser again the next time a project installs it.
- Use your tools as normal for a day, then empty the Bin.
Warning: rm -rf ~/.cache deletes everything at once, skipping the Bin, including model downloads that may take hours to fetch again, and it can break a tool that is running. Clear folders one by one instead.
What never to touch
- The whole folder in one go while tools are running.
- uv's cache by hand. Use
uv cache pruneoruv cache clean. - Folders you don't recognise, until you know which tool owns them.
~/.configand~/.local. They look similar, but under the same XDG rules they hold settings and installed tools, not caches.
Most Mac apps keep their caches in ~/Library/Caches instead, and Yarn users should also read the Yarn cache page. The guide to clearing caches on a Mac covers browsers and apps. If another hidden folder, ~/.claude, has grown large, see is it safe to delete the .claude folder.
How Headroom helps
Headroom's Clean scan lists two caches from ~/.cache under Developer caches once each passes 1 MB: Yarn and Puppeteer's browsers. They are ticked by default and deleted for good when you clean, because the tools fetch them again. It deliberately leaves the uv cache alone, because uv's documentation says never to modify it directly; use uv cache clean for that. Hugging Face models and everything else in ~/.cache are left alone too. The scan is free, and the $19 one-time licence clears what you tick. See the cleaner or download Headroom.
Questions
What is the ~/.cache folder on a Mac?
It is a cache folder used by command-line and developer tools that follow the Linux XDG convention, such as uv and Hugging Face. Mac apps usually keep their caches in ~/Library/Caches instead.
Can I delete ~/.cache/huggingface?
Yes, nothing personal is lost, but every model you use downloads again, which can take a long time. hf cache ls and hf cache rm let you remove only the models you no longer use.
How do I clear the uv cache?
Run uv cache prune to remove unused entries, or uv cache clean to empty it completely. uv's documentation says it is never safe to modify its cache directly, so avoid deleting files from it by hand.
Why is ~/.cache so big?
Usually because of large downloads such as AI models and Python packages. The Hugging Face cache, for one, never deletes cached files by itself, so old model versions build up.