Archive / Audit before you optimize: a read-only check on what your AI agents cost

Audit before you optimize: a read-only check on what your AI agents cost

A two-part audit prompt that gathers real usage numbers first, waits for your go-ahead, then suggests fixes without changing anything.

For: Solo founders

Topics: Agent management

Why I wrote it

Most of my agents pay per call. Prompt caching, where the provider reuses the unchanging start of a prompt at a lower price, could cut that bill. I didn't want an agent changing settings across all my bots on a hunch.

So I asked for an audit that only reads, split in two, with a gate in the middle.

What makes it work

"Read only" comes first, with the one file it may write named exactly.

It may never print an API key or token.

It collects real numbers from the logs before it diagnoses anything.

Part 2 runs only after I type the word "proceed". Even then, it recommends and doesn't change.

The prompt

Prompt

Task: read-only audit of prompt caching across [my agents]. Do not change anything. No config edits, no schedule changes, no restarts, no installs. Do not print API keys or tokens anywhere. The only file you may write is one report at [path to report file]. PART 1 List every agent and the model it uses. From the logs, pull real usage numbers for each one, including cache reads and cache writes. Then stop and wait. Do not start Part 2 until I type "proceed". PART 2 (only after "proceed") For each agent, check: 1. Compare two calls in one run. If cache reads are above 0 on the second, caching is on. 2. Fixed material (tools, standing instructions) comes first and changing material comes last. A timestamp at the top breaks the cache on every call. 3. Each model's minimum prompt size for caching, from the provider's current documentation. A small prompt may never cache. 4. Whether tools, thinking or effort settings change partway through a run. 5. Whether a longer cache is wasted on an agent that only wakes once a day. Write a ranked list of fixes with the evidence for each. Change nothing.

How to use it

Fill in where your agents live and where the report should go. Run Part 1 and read the numbers yourself before typing "proceed". Sometimes the numbers already show caching is working and you can stop there.

Make the changes from the ranked list one at a time, and run Part 1 again afterwards to see if the numbers moved.

Use it for: Checking whether agents you pay for per call are wasting money, before anyone touches a setting.

Back to the archive