The ~/.cache folder on a Mac: what's safe to delete

What the hidden ~/.cache folder in your Mac's home folder is, how to see what's in it, which tools fill it, and why deleting all of it at once can cost you work.

Short answer

~/.cache is a hidden folder in your home folder where command-line tools keep files they can download or build again. It's the Linux convention, so tools like uv, Hugging Face and Puppeteer use it on a Mac, while Mac apps use ~/Library/Caches. Most of it is safe to delete, folder by folder. Don't delete all of it at once: on my Mac it held 25 GB, and 18.4 GB of that wasn't cache at all but working copies of code, 8 with uncommitted changes.

If you'd rather use an app, see Mac cleaners for developers, and which ones delete to the Trash.

A Finder window showing a home folder with seven folders, and an eighth hidden folder named .cache holding 25 GB

What ~/.cache is

Finder hides every file and folder whose name starts with a dot, so most people never see this one. It sits next to Desktop and Documents in your home folder.

The name comes from the XDG Base Directory specification, a convention from Linux. It says programs should keep "user-specific non-essential (cached) data" in the folder named by $XDG_CACHE_HOME, and in ~/.cache when that isn't set. Many command-line tools are written for Linux first and keep the same layout on a Mac.

So a Mac ends up with two cache folders:

Two cache folders compared: ~/Library/Caches for Mac apps and ~/.cache for command-line tools

~/Library/Caches~/.cache
ConventionmacOSLinux (XDG)
Who writes thereMac apps, plus Homebrew, pip, Playwrightuv, Hugging Face, PyTorch, Prisma, pre-commit, Puppeteer
Hidden in FinderYes (the Library folder is hidden)Yes (dot folder)
Emptied by macOSNoNo

See what's in yours

These only read, so they're safe to run:

Terminal
$ du -sh ~/.cache
$ du -sh ~/.cache/* | sort -h | tail

To open it in Finder instead, press Command + Shift + Period in your home folder to show hidden files, or choose Go › Go to Folder and type ~/.cache.

Here's mine on 11 November 2026:

Terminal
$ du -sh ~/.cache
#  25G  ~/.cache

Bar chart of a 25 GB ~/.cache folder: 18.4 GB from an in-house tool, 5.6 GB from uv, the rest under 1 GB

32 items, and two of them were 97% of it:

FolderSizeWhat it is
an in-house tool's folder18.4 GBWorking copies of code. Not a cache
uv5.6 GBPython packages uv downloaded
another tool's working copies437 MBAlso not a cache
chroma, torch289 MBAI model files
prisma62 MBPrisma's database engines
the other 2538 MBShell prompt, editor and CLI caches

Not everything in ~/.cache is a cache

This is the part that matters before you delete anything. The convention says "non-essential", but nothing enforces it. Any script can write to ~/.cache, and some use it as a scratch folder.

My 18.4 GB folder belonged to a tool that checks out copies of a code repository to work in. I counted 65 git checkouts inside ~/.cache, and 8 of them had changes that were never committed. rm -rf ~/.cache would have deleted that work with no Trash to get it back from.

This finds git checkouts with uncommitted changes anywhere in the folder. It only reads:

Terminal
$ find ~/.cache -maxdepth 4 -name .git -prune 2>/dev/null | while read g; do
$   d=$(dirname "$g")
$   [ -n "$(git -C "$d" status --porcelain 2>/dev/null)" ] && echo "uncommitted: $d"
$ done
Check first

A folder you don't recognise in ~/.cache isn't safe just because of where it is. Look inside, and find out which tool made it, before it goes.

What's safe to delete, tool by tool

Use the tool's own command when it has one. It knows which files are still in use.

FolderClear it withComes back?
~/.cache/uvuv cache prune (unused entries) or uv cache clean (all)Yes, on the next install
~/.cache/huggingfacehf cache commands, see deleting AI modelsOnly if downloaded again
~/.cache/torchDelete hub/checkpointsYes, on next use
~/.cache/pre-commitpre-commit gc or pre-commit cleanYes, on the next run
~/.cache/prismaDelete the folderYes, on the next prisma generate
~/.cache/puppeteerDelete the folderNo. Run npx puppeteer browsers install chrome
~/.cache/codex-runtimes, chrome-devtools-mcpSee AI coding tools disk spaceYes
Shell and editor caches (p10k-*, nvim, fish, gitstatus)Leave them. They're tinyYes
Safe

uv cache prune is the gentle one: it removes only entries nothing refers to any more. uv cache clean removes everything, and uv downloads packages again the next time you install.

One thing about uv's size: on a Mac, uv doesn't copy packages into each .venv, it clones them from the cache, so the files share disk space. Deleting the cache frees less than du reports while those environments exist. The Python disk space guide explains how to measure it.

For anything that's left, move it to the Trash instead of using rm, so you can put it back:

Terminal
$ mv ~/.cache/some-folder ~/.Trash/

What not to do

  • Don't run rm -rf ~/.cache. It's the usual advice, and it's fine on a machine where every tool follows the rules. You can't know that without looking.
  • Don't delete it while tools are running. A package install or a model download in progress will fail.
  • Don't expect macOS to do it. Storage settings has no row for this folder, and nothing empties it.

Old items are the easy wins. This lists what hasn't changed in 90 days:

Terminal
$ find ~/.cache -mindepth 1 -maxdepth 1 -mtime +90

On my Mac that was 7 of the 32.

Shedi reads ~/.cache tool by toolShedi lists the folders it knows there, each with what it is and whether it comes back: uv, Hugging Face and LM Studio models, Puppeteer's browsers, Codex runtimes and Chrome DevTools MCP. Puppeteer starts unselected because it doesn't come back by itself. Folders Shedi doesn't recognise are left alone, and what you remove goes to the Trash.
Get Shedi

For the other cache folder, see every developer cache on macOS. To see where the rest of your disk went, System Data huge on Mac? is the place to start.

Sources

  • Measured on this Mac on 11 November 2026 (macOS 26.5.1, uv 0.11.17): du on ~/.cache and each item in it, a count of git checkouts and of those with uncommitted changes, and find -mtime +90. Nothing was deleted.
  • XDG Base Directory Specification (freedesktop.org): $XDG_CACHE_HOME and its default, $HOME/.cache.
  • uv cache prune --help and uv cache clean --help, run locally; uv cache dir prints ~/.cache/uv.
  • pre-commit's documentation for pre-commit gc and pre-commit clean.
  • Shedi's rules for uv, Hugging Face, LM Studio, Puppeteer, Codex runtimes and Chrome DevTools MCP.

Questions

What is the .cache folder on a Mac?

A hidden folder in your home folder where command-line tools keep downloads and other files they can make again. It follows a Linux convention (XDG), so tools like uv, Hugging Face, PyTorch, Prisma, pre-commit and Puppeteer use it on a Mac too. Mac apps use ~/Library/Caches instead.

Can I delete the .cache folder on my Mac?

Most of it, but not blindly. Real caches such as ~/.cache/uv download again when needed. But tools also put things there that aren't caches. On my Mac, 18.4 GB of the 25 GB was a tool's working copies of code, and 8 of them had uncommitted changes. Look inside first and delete folder by folder.

How do I see the .cache folder in Finder?

Open your home folder and press Command + Shift + Period to show hidden files, or choose Go › Go to Folder and type ~/.cache.

What is the difference between ~/.cache and ~/Library/Caches?

~/Library/Caches is the macOS location, used by Mac apps and by some tools that follow Apple's layout, like Homebrew and pip. ~/.cache is the Linux location, used by command-line tools that follow the XDG convention. Both are hidden in Finder, and macOS empties neither on its own.

Why is ~/.cache so big?

Usually one or two tools. Python's uv keeps every package version it has downloaded, AI libraries keep model files, and browser automation tools keep whole browsers. Run du -sh ~/.cache/* | sort -h | tail to see which.

Does macOS clean ~/.cache automatically?

No. Nothing in macOS empties it, and each tool decides for itself whether to prune. Most don't.