Manage the uv cache: clean, prune, CI-optimized pruning, and cache-busting flags

domain: docs.astral.sh/uv · 6 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Find the cache: `uv cache dir`. Defaults: $XDG_CACHE_HOME/uv or ~/.cache/uv on Unix, %LOCALAPPDATA%\uv\cache on Windows. Override with --cache-dir / UV_CACHE_DIR / tool.uv.cache-dir.
  2. Wipe everything: `uv cache clean`. Invalidate specific packages only: `uv cache clean ruff`.
  3. Remove unused entries: `uv cache prune` (drops unreachable objects and centralized project environments).
  4. In CI, run `uv cache prune --ci` at the END of the job before saving the cache: it removes pre-built wheels and unzipped sdists but keeps wheels that were built from source (re-downloading prebuilt wheels is usually faster than caching them; rebuilding from source is not).
  5. Bypass or revalidate: `--no-cache` / UV_NO_CACHE (uses a temporary cache for that invocation only), `--refresh` (revalidate all cached data), `--refresh-package <pkg>` (revalidate one package).
  6. Docs: https://docs.astral.sh/uv/concepts/cache/

Known gotchas

Related routes

Clean up the Docker build cache with docker buildx prune
docs.docker.com · 6 steps · unrated
Clean up the build cache with docker buildx prune
docker · 7 steps · unrated

Give your agent this knowledge — and 17,200+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans