# Is it safe to delete uv’s cache?

Is it safe to delete? · Package caches · Updated 21 November 2026. By Mohit Nippanikar, who makes SiftMac.

## The short answer

- **Yes, with uv’s commands.** uv’s docs call the cache disposable, but say never to remove files or folders inside it by hand. `uv cache prune` and `uv cache clean` are the way.
- **What it costs you:** the next `uv sync` or `uv pip install` downloads and builds again, so it’s slower and needs the network.
- **Does it come back?** Yes, as soon as uv installs anything.
- SiftMac’s verdict: Rebuilds

## 1. What uv caches

uv caches answers from package indexes, downloaded wheels and source distributions, wheels it built itself, and the unpacked files it installs from. Installing into an environment then comes down to placing files from the cache, which keeps repeat installs fast.

On a Mac, uv’s default link mode is `clone`, copy-on-write on APFS. Files in each `.venv` start out sharing their blocks with the cache, so environments stay intact when you clear it, and the two don’t take double the space while both exist.

- Not in the cache: Pythons from `uv python install`, kept in `~/.local/share/uv/python`, and tools from `uv tool install`, in `~/.local/share/uv/tools`.
- If you set the link mode to `symlink`, environments point into the cache instead, and uv warns that `uv cache clean` would then break every installed package.

## 2. Where it is

```
~/.cache/uv
```

uv follows the XDG folder conventions on macOS too, so the cache is `~/.cache/uv` unless `XDG_CACHE_HOME`, `UV_CACHE_DIR` or the `cache-dir` setting moves it. Ask uv to be sure:

```
uv cache dir
```

## 3. How big it gets

Every package version your projects installed stays until you prune or clean, so the cache grows with each project and each upgrade. uv reports its own size:

```
uv cache size -H
```

Because of the clones, a full cache and full environments together use less space than their two sizes added up.

## 4. How to clear it

Two commands, from gentle to complete:

- `uv cache prune` removes unused entries, such as ones left by earlier uv versions, and the centralized project environments uv keeps there, which it recreates when needed. uv’s docs say it’s safe to run periodically.
- `uv cache clean` removes every entry. `uv cache clean <package>`, for example `uv cache clean ruff`, removes only that package’s entries.

```
uv cache prune
uv cache clean
```

Run them while no other uv command is working. uv locks the cache while it changes it and waits up to five minutes for other uv processes; `--force` skips that wait, and is only safe when nothing else is using the cache.

## 5. What happens afterwards

- Existing `.venv` folders keep working, because their files are clones rather than links into the cache, unless you chose symlink mode.
- The next `uv sync`, `uv run` or `uv pip install` downloads again, and packages without a wheel for your Mac are built again.
- `uv.lock` keeps every version the same.
- Tools you run with `uvx` are fetched again the first time you use them.

## Questions

### Can I delete ~/.cache/uv in Finder?

Use `uv cache clean` instead. uv’s docs say it’s never safe to modify the cache directly, for example by removing a file or folder inside it, while the command respects uv’s lock on it.

### What’s the difference between uv cache prune and uv cache clean?

Prune keeps what’s still useful and drops the rest; clean removes everything, or everything for one package. For CI, `uv cache prune --ci` removes pre-built wheels and unzipped source distributions but keeps wheels built from source, the slow part to recreate.

### Does clearing uv’s cache remove the Pythons uv installed?

No. They live in `~/.local/share/uv/python`; remove versions you no longer need with `uv python uninstall`.

### Will my virtual environments break?

Not with uv’s default clone mode on a Mac: each environment’s files are independent copies that just started out sharing blocks. Environments made with the symlink link mode are the exception.

## How SiftMac handles it

SiftMac doesn’t clear `~/.cache/uv`; its space map shows how big `~/.cache` is and notes that the tool caches in it download again, and `uv cache clean` does the clearing. When Developer files lists an old project’s `.venv`, the size shown leaves out blocks the environment still shares with uv’s cache. A `uv` folder in `~/Library/Caches`, if your Mac has one, is cleared with App caches and skipped while `uv` is running.

Download: https://siftmac.com/SiftMac.dmg (scanning is free, and so is the first 2 GB of cleaning).

## Sources

- [uv docs: Caching](https://docs.astral.sh/uv/concepts/cache/)
- [uv docs: Storage (cache, Python and tool folders)](https://docs.astral.sh/uv/reference/storage/)
- [uv docs: command-line reference (uv cache, --link-mode)](https://docs.astral.sh/uv/reference/cli/)

## Related

- [Is it safe to delete a Python virtual environment (.venv)?](https://siftmac.com/safe-to-delete/python-venv)
- [Is it safe to delete ~/Library/Caches/pip?](https://siftmac.com/safe-to-delete/pip-cache)
- [Is it safe to delete __pycache__ folders?](https://siftmac.com/safe-to-delete/pycache)
- [Is it safe to delete conda’s pkgs folder and old environments?](https://siftmac.com/safe-to-delete/conda-packages)
- [Xcode DerivedData, node_modules and Docker: what’s safe to delete on a developer’s Mac](https://siftmac.com/guides/developer-files-on-mac)

Canonical: https://siftmac.com/safe-to-delete/uv-cache
