Practical audit
Measure first
The audit script measures every cache on this page in one pass. It only reads file sizes and dates. It never deletes, prunes, or opens file contents.
curl -fsSLO https://www.cacheddebt.com/cache-debt-audit.sh
less cache-debt-audit.sh
bash cache-debt-audit.shWhat each command label means
Read-only changes nothing. Safe deletes only what the tool recreates on its own. Re-download deletes files a later step downloads again. Destructive deletes data nothing recreates: get explicit approval from the data's owner first.
Hugging Face Hub
Downloaded model and dataset files, including every older revision. Nothing is deleted automatically.[5]
| System | Default location |
|---|---|
| Linux and macOS | ~/.cache/huggingface/hub |
| Override | HF_HOME or HF_HUB_CACHE |
Suggested threshold
Review when the cache passes 20 GB or holds models no current project loads.
hf cache lshf cache prunehf cache rm <repo>The next run that loads this model downloads the full weights again.
Ollama
Pulled model weights for local inference.[6]
| System | Default location |
|---|---|
| macOS | ~/.ollama/models |
| Linux | /usr/share/ollama/.ollama/models |
| Windows | C:\Users\%username%\.ollama\models |
| Override | OLLAMA_MODELS |
Suggested threshold
Review models not run in the last 30 days.
ollama lsollama rm <model>Pulling it again downloads the full weights.
PyTorch Hub
Repositories and checkpoints fetched through torch.hub.[12]
| System | Default location |
|---|---|
| Linux and macOS | ~/.cache/torch/hub |
| Override | TORCH_HOME |
Suggested threshold
PyTorch documents no cleanup command. Delete a checkpoint only after confirming no code loads it.
du -sh ~/.cache/torch/hub/checkpoints/*Docker
Images, stopped containers, build cache, and volumes left by services that no longer run.[7][8]
| System | Default location |
|---|---|
| All | Managed by the Docker daemon |
Suggested threshold
Review any volume with no running container that uses it.
docker system df -vdocker builder pruneLater builds recreate the layers they need.
docker system pruneKeeps volumes, but deletes stopped containers along with any files written inside them.
docker system prune -a --volumesVolumes hold databases and model stores. Deleted volume data does not come back.
pip
Downloaded index pages and locally built wheels.[9]
| System | Default location |
|---|---|
| Linux | ~/.cache/pip |
| Any | Run pip cache dir to print it |
Suggested threshold
Disk cost only. Clear when space is tight.
pip cache infopip cache purgePackages download again on the next install.
npm
Content-addressed package tarballs shared across projects.[10]
| System | Default location |
|---|---|
| macOS and Linux | ~/.npm/_cacache |
| Windows | %LocalAppData%\npm-cache |
Suggested threshold
Disk cost only. npm states clearing the cache is never needed except to reclaim space.
du -sh "$(npm config get cache)"npm cache verifyRemoves only data npm no longer needs.
uv
Python package archives and built wheels, including entries from older uv versions.[11]
| System | Default location |
|---|---|
| Linux and macOS | ~/.cache/uv |
Suggested threshold
Run uv cache prune on a schedule.
du -sh "$(uv cache dir)"uv cache pruneDocumented as safe to run periodically.
uv cache cleanPackages download again on the next install.
Playwright browsers
Browser builds for end-to-end tests. Playwright removes versions no installation needs, but only for browsers it installed.[13]
| System | Default location |
|---|---|
| Linux | ~/.cache/ms-playwright |
| macOS | ~/Library/Caches/ms-playwright |
| Windows | %USERPROFILE%\AppData\Local\ms-playwright |
| Override | PLAYWRIGHT_BROWSERS_PATH |
Suggested threshold
Review any browser build the current Playwright version does not expect.
ls "${PLAYWRIGHT_BROWSERS_PATH:-$HOME/.cache/ms-playwright}"npx playwright uninstallRun npx playwright install before the next test run.
npx playwright uninstall --allClaude Code transcripts
Full session transcripts in plaintext, including every tool result, plus auto memory files per project.[14][15]
| System | Default location |
|---|---|
| All | ~/.claude/projects/<project>/ |
Suggested threshold
Set cleanupPeriodDays to match your retention policy. Auto memory files are not swept by it.
du -sh ~/.claude/projects/*claude purge <project-path> --dry-runclaude purge <project-path>Deletes transcripts and auto memory for the project, after a confirmation prompt. They cannot be recovered. Omit the path to pick a project from a list.
Vector indexes and embeddings
A vector stays in the index after its source changes, and vectors from different embedding models are not comparable.[4] Neither problem shows up as an error. Retrieval quality drops without a signal.
Store four fields with every vector, then one query finds all three kinds of stale vector. Adapt the table and column names to your store.
SELECT
count(*) FILTER (WHERE s.id IS NULL) AS orphaned,
count(*) FILTER (WHERE e.source_hash <> s.content_hash) AS stale,
count(*) FILTER (WHERE e.model <> 'current-model-id') AS old_model
FROM embeddings e
LEFT JOIN documents s ON s.id = e.source_id;Store source_hash as a hash of the exact chunk text you embedded, so any edit to the source changes it.
Prompts and saved context
Longer inputs lower model performance,[2] and models use information in the middle of a long context less reliably than information at the start or end.[3] Old instructions carried forward cost tokens and compete with current ones.
Retention rules
Cleanup without an owner and a schedule grows back. Write the rule down where your team tracks operational work.