Field guide

Examples of Cache Debt

Ten places retained AI state outlives its usefulness, grouped by what it costs you.

Ten examples with cleanup actions

01Security

Agent transcripts

Agent tools write every tool result to plaintext transcripts on disk, including files and secrets the agent read.[15]

Cleanup Set a retention period, purge finished projects, and rotate credentials an agent saw.Commands

02Security

Credentials in saved context

API keys and tokens pasted into a session stay in its history and memory files after the task ends.[15]

Cleanup Search retained context for key patterns, delete matches, and rotate the keys.Commands

03Data loss

Orphaned Docker volumes

Volumes outlive the services that created them, and a routine prune keeps them by default.[7]

Cleanup Match each volume to a running container before removing it. Never run a volume prune blind.Commands

04Output quality

Embeddings from an old model

Vectors from different embedding models are not comparable, so a half-finished migration degrades retrieval without an error.[4]

Cleanup Store the model ID on every vector and re-embed or delete mismatches.Commands

05Output quality

Embeddings of changed documents

A vector keeps representing a source after the source is edited or deleted.

Cleanup Store a content hash per vector and compare it with the current source.Commands

06Output quality

Carried-forward context

Old instructions and history ride along into new tasks, and longer inputs lower model performance.[2]

Cleanup Summarize what still matters, drop the rest, and start new tasks with fresh context.Commands

07Output quality

Unused prompt versions

Superseded prompts stay loaded by a service nobody remembers, so behavior differs between environments.

Cleanup Version every prompt, map its consumers, and delete versions nothing loads.Commands

08Disk

Old model revisions

Hugging Face keeps every downloaded revision. Nothing in the cache is deleted automatically.[5]

Cleanup List repos by size and prune revisions no project loads.Commands

09Disk

Stale browser builds

Browser builds installed outside Playwright's own manager stay after the project upgrades. We measured 920 MB of one.[13]

Cleanup Compare installed builds with the version your project pins, then uninstall the rest.Commands

10Disk

Package caches

npm, pip, and uv caches grow with every experiment. npm states clearing them is only for reclaiming space.[10]

Cleanup Measure them, and prune on a schedule when disk is tight.Commands

Main cost names what each example damages while it stays. To decide what to fix first on your own systems, use the Cache Debt Score.