Practical audit

Cache Debt Cleanup Checklist

Measure, decide, then clean. Default paths and each tool's own commands come from its documentation. Measurement commands such as du and the SQL query are this site's.

0 of 32steps done

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.

Read-onlyDownload, read, then run (macOS or Linux)
curl -fsSLO https://www.cacheddebt.com/cache-debt-audit.sh
less cache-debt-audit.sh
bash cache-debt-audit.sh

Add --json for scripts and AI agents, or --tsv for spreadsheets. Then score what it finds with the Cache Debt Score.

What 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

Model cacheDisk only0/3

Downloaded model and dataset files, including every older revision. Nothing is deleted automatically.[5]

SystemDefault location
Linux and macOS~/.cache/huggingface/hub
OverrideHF_HOME or HF_HUB_CACHE

Suggested threshold

Review when the cache passes 20 GB or holds models no current project loads.

Read-onlyList cached repos and sizes
hf cache ls
SafeRemove files no cached repo uses
hf cache prune
Re-downloadRemove a whole repo
hf cache rm <repo>

The next run that loads this model downloads the full weights again.

Ollama

Model cacheDisk only0/2

Pulled model weights for local inference.[6]

SystemDefault location
macOS~/.ollama/models
Linux/usr/share/ollama/.ollama/models
WindowsC:\Users\%username%\.ollama\models
OverrideOLLAMA_MODELS

Suggested threshold

Review models not run in the last 30 days.

Read-onlyList models and sizes
ollama ls
Re-downloadRemove one model
ollama rm <model>

Pulling it again downloads the full weights.

PyTorch Hub

Model cacheDisk only0/2

Repositories and checkpoints fetched through torch.hub.[12]

SystemDefault location
Linux and macOS~/.cache/torch/hub
OverrideTORCH_HOME

Suggested threshold

PyTorch documents no cleanup command. Delete a checkpoint only after confirming no code loads it.

Read-onlyMeasure checkpoints
du -sh ~/.cache/torch/hub/checkpoints/*

Docker

Container stateData loss0/3

Images, stopped containers, build cache, and volumes left by services that no longer run.[7][8]

SystemDefault location
AllManaged by the Docker daemon

Suggested threshold

Review any volume with no running container that uses it.

Read-onlyShow disk use by type
docker system df -v
SafeRemove build cache
docker builder prune

Later builds recreate the layers they need.

DestructiveRemove stopped containers, dangling images, unused networks, and build cache
docker system prune

Keeps volumes, but deletes stopped containers along with any files written inside them.

DestructiveAlso remove all unused images and anonymous volumes
docker system prune -a --volumes

Volumes hold databases and model stores. Deleted volume data does not come back.

pip

Package cacheDisk only0/1

Downloaded index pages and locally built wheels.[9]

SystemDefault location
Linux~/.cache/pip
AnyRun pip cache dir to print it

Suggested threshold

Disk cost only. Clear when space is tight.

Read-onlyShow size and location
pip cache info
SafeRemove everything
pip cache purge

Packages download again on the next install.

npm

Package cacheDisk only0/1

Content-addressed package tarballs shared across projects.[10]

SystemDefault 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.

Read-onlyMeasure the cache
du -sh "$(npm config get cache)"
SafeVerify and garbage collect
npm cache verify

Removes only data npm no longer needs.

uv

Package cacheDisk only0/2

Python package archives and built wheels, including entries from older uv versions.[11]

SystemDefault location
Linux and macOS~/.cache/uv

Suggested threshold

Run uv cache prune on a schedule.

Read-onlyFind and measure the cache
du -sh "$(uv cache dir)"
SafeRemove unused entries
uv cache prune

Documented as safe to run periodically.

SafeRemove all entries
uv cache clean

Packages download again on the next install.

Playwright browsers

Test artifactsDisk only0/2

Browser builds for end-to-end tests. Playwright removes versions no installation needs, but only for browsers it installed.[13]

SystemDefault location
Linux~/.cache/ms-playwright
macOS~/Library/Caches/ms-playwright
Windows%USERPROFILE%\AppData\Local\ms-playwright
OverridePLAYWRIGHT_BROWSERS_PATH

Suggested threshold

Review any browser build the current Playwright version does not expect.

Read-onlyList installed browser builds
ls "${PLAYWRIGHT_BROWSERS_PATH:-$HOME/.cache/ms-playwright}"
Re-downloadRemove browsers for this installation
npx playwright uninstall

Run npx playwright install before the next test run.

Re-downloadRemove browsers for every installation
npx playwright uninstall --all

Claude Code transcripts

Agent stateSecurity0/3

Full session transcripts in plaintext, including every tool result, plus auto memory files per project.[14][15]

SystemDefault location
All~/.claude/projects/<project>/

Suggested threshold

Set cleanupPeriodDays to match your retention policy. Auto memory files are not swept by it.

Read-onlyMeasure transcripts per project
du -sh ~/.claude/projects/*
Read-onlyPreview what purging one project deletes
claude purge <project-path> --dry-run
DestructiveDelete one project’s local state
claude 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

Retrieval stateOutput quality0/5

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.

Read-onlyCount stale, orphaned, and old-model vectors
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

InstructionsOutput quality0/4

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

Policy0/4

Cleanup without an owner and a schedule grows back. Write the rule down where your team tracks operational work.

Delete with evidence, not instinct.

Score what you found