Is It Safe to Delete the uv Cache (~/.cache/uv) on a Mac?
~/.cache/uvYes, you can delete the uv cache at ~/.cache/uv without breaking anything. It only holds downloaded and built Python packages, and uv rebuilds it on your next sync or install. The official command is uv cache clean. The only cost is that your next install re-downloads whatever your projects actually use.
What it is
uv is Astral's fast Python package manager, from the same team that makes Ruff. Every wheel it downloads and every package it builds from source lands in ~/.cache/uv, so the next install can pull from disk instead of the network. That cache is the reason a second uv sync in a project finishes in seconds.
The cache is global and shared across every project on your Mac, and it grows with each new package version you touch. Ordinary web projects keep it modest, but ML and data science work inflates it quickly: packages like torch and tensorflow ship large wheels, and the cache keeps a copy of every version you have ever installed. A few months of active Python work can quietly leave several gigabytes here.
Is it safe to delete?
Deleting it is safe. The cache contains no project code, no settings, and no virtual environments, just copies of packages that uv can fetch again. Your existing environments keep working too: on a Mac, uv installs by cloning files out of the cache (copy-on-write on APFS), so each environment holds its own copy and never notices the cache is gone.
The tradeoff is speed, not safety. After you clear the cache, the next uv sync or uv add in each project re-downloads what it needs, which takes longer and uses bandwidth. On a slow connection with heavy dependencies that can be a noticeable wait. Diskmack identifies ~/.cache/uv automatically and cleans it the safe way.
How to check its size
In Finder: In Finder, choose Go > Go to Folder (or press Cmd+Shift+G), type ~/.cache/uv and press Return. The .cache folder is hidden, but Go to Folder opens it anyway. Select the uv folder and press Cmd+I to see its size.
In Terminal:
du -sh ~/.cache/uvHow to clean it
- Open Finder and choose Go > Go to Folder, or press Cmd+Shift+G.
- Type ~/.cache and press Return.
- Find the folder named uv and drag it to the Trash.
- Empty the Trash to reclaim the space.
The official way: this tool ships its own cleanup command, which handles locks and indexes correctly.
uv cache cleanIf you want a lighter touch, uv cache prune removes only unused entries, like leftovers from older uv versions, and keeps the rest warm. Either way, uv recreates the folder on its next run.
Will it come back?
Yes, and by design. The cache exists to make installs fast, so uv starts refilling it the moment you run uv sync, uv add, or uv pip install again. Expect it to climb back toward its old size within a few weeks of normal Python work. Clearing it is a space reclaim you repeat when the disk gets tight, not a permanent fix. If it balloons often, an occasional uv cache prune clears out stale entries without dumping everything.
Common questions
Will clearing the uv cache break my virtual environments?
No. On a Mac, uv clones package files from the cache into each environment (copy-on-write on APFS), so every environment owns its own copy of the files. Your venvs keep working; only future installs have to re-download.
What's the difference between uv cache clean and uv cache prune?
uv cache clean wipes the whole cache (or one package, like uv cache clean numpy). uv cache prune is gentler: it removes only unused entries, like ones left behind by older versions of uv. Use clean to reclaim maximum space, prune for routine upkeep.
Does this delete the Python versions uv installed?
No. uv-managed Python interpreters live under ~/.local/share/uv, not in the cache. Clearing ~/.cache/uv leaves them untouched. Remove old interpreters with uv python uninstall if you want that space back too.
How big does the uv cache usually get?
It depends entirely on what you install. A few small projects might keep it under a gigabyte, while ML work with torch, tensorflow, or other large scientific packages can push it to several gigabytes or more. Run du -sh ~/.cache/uv to see your actual number.
Related folders
- How to Clear the pip Cache on Your Mac (and Why It's Safe to Delete)
- Can I Delete the venv Folder? Yes, With One Check First
- Can I delete __pycache__? Yes, it's safe on every Mac
- Is the Hugging Face cache safe to delete? What's inside ~/.cache/huggingface
- The conda pkgs folder is huge. Is it safe to delete?
- Can I delete .ruff_cache? Yes, it's safe