Paths my agents may never delete
A CLAUDE.md block that keeps cleanup agents away from model stores, keys and evidence.
The problem
Ask an agent to free up disk space and it finds the biggest folders nobody has touched in weeks. On a machine where agents do real work, some of those are the folders that matter most: local model caches, keys, the evidence a report links to. The agent has no way to know which ones, so the instructions have to say.
The prompt
## Disk cleanup: never delete these paths
Before any cleanup, dedupe, garbage collection or "reclaim space" task, read this section.
Never delete, move or "archive" these, without exception, even if they look stale or huge:
- `~/models/`: pinned local model files. Re-downloading takes hours and breaks running jobs.
- `~/.ollama/models`: the Ollama model store.
- `~/.cache/huggingface`: model weights in use by training and eval runs.
- `~/secrets/` and any `*.key`, `*.pem` or `*.age` file: keys. Loss is unrecoverable.
- `~/projects/app/.data/`: the product's local database and evidence.
Anything else you may delete only when it is verifiably safe:
1. Nothing is using it right now (check with `lsof +D <dir>` and the running processes).
2. No document, report or ticket cites a file inside it.
3. You write a manifest of what you deleted (path, size, why) before deleting.
Measure free space with `df -h`, never `du`. Report space reclaimed as the change in `df`.
A restart, logout or OS update wipes `/tmp`, `/private/tmp` and `$TMPDIR`. Before one, copy anything you
will cite later to durable storage and check the copy.How to use it
- Paste the block at the top of
~/.claude/CLAUDE.mdto cover every project, or into one repo'sCLAUDE.mdorAGENTS.md. - Replace the example paths with yours: model files, keys, local databases and anything a running job reads.
- Tell your agents where durable output goes, so evidence never lives only in
/tmp. - Score every cleanup by the change in
df, and keep the manifest of what it deleted.
Where it came from
On September 29 I asked an agent to free up disk space. By its own measure it did a good job: it found big folders that hadn't been touched in weeks and deleted them. Two of them were my local model caches, and a live run that was reading from them broke in the middle.
On October 21 a restart wiped /private/tmp, and with it evidence files I had cited in a report.
Neither agent did anything unreasonable. Nothing had told them which big, quiet folders mattered. Now the top of my global CLAUDE.md does, and every agent reads it before any cleanup.
Why df: du tells you how big a folder looks, and df tells you how much free space the disk has. On a Mac those can be far apart, because cloned files share blocks, local snapshots keep deleted data alive and an open file keeps its space until the process exits. An agent that scores itself with du can delete a lot and reclaim almost nothing.
Excellent checks agent work the same way: it looks where the work landed and shows you the evidence. excellent.so