Replay Doctor: A Local CLI Tool for Catching Silent AI Prompt Cache Leaks
Replay Doctor is a local CLI tool that finds silent prompt cache leaks in AI agent workflows built on Claude Code, Cursor, or Codex. Its creator built it after watching AI agent bills spike with no warning in the logs, because an expired cache triggers a full re-bill at cold-write prices instead of cached rates. This guide explains the mechanism behind the leak, who should run the tool, and what to check in your plan before the next invoice arrives.

Disclosure: this article contains affiliate links. If you buy through them we may earn a commission at no additional cost to you. Our recommendations are based on the evidence recorded alongside this article, and prices were verified on the date shown.
If you run Claude Code, Cursor, or Codex against usage-based billing, a new local CLI called Replay Doctor is worth fifteen minutes today. It exists to catch one specific, checkable failure: a prompt cache that silently expires and re-bills your whole conversation at cold-write prices, with nothing in the logs to flag it.
What changed and why it matters
The news hook here is a Show HN post for Replay Doctor, a local CLI tool built to find silent prompt cache leaks in AI agent workflows. Its creator, danielsaito, built it after watching AI agent bills spike with no warning or error appearing anywhere in the logs — the kind of problem you only notice once the invoice arrives.
That matters specifically for teams built on Claude Code, Cursor, or Codex, because all three lean on prompt caching to keep costs down. Prompt caching works by reusing previously processed context instead of reprocessing it from scratch. When that mechanism quietly breaks, the cost savings it was supposed to deliver disappear, and nothing in a standard log file tells you it happened.
The detail
Here's the mechanism Replay Doctor is built to catch. Prompt caches run on a TTL — a time-to-live window. Two common situations can push a conversation past that window: a client re-rendering requests out of order, or an engineer simply stepping away, for example for a 10-minute lunch. Either one can cause the cache to expire mid-conversation.
When the cache expires, the AI provider doesn't partially re-bill or warn you — it quietly re-bills the entire conversation history at cold-write prices instead of the cheaper cached rate. No error surfaces in the application logs. The conversation keeps working normally from the user's point of view; only the bill changes.
| Trigger | What happens to the bill | Where it shows up |
|---|---|---|
| Out-of-order re-renders | Cache TTL expires mid-conversation | Nowhere — no error in logs |
| Idle time (e.g., a 10-minute break) | Cache TTL expires | Full conversation history re-billed at cold-write rates |
Replay Doctor runs as a local CLI rather than a hosted service, which matters if your conversation histories include anything you don't want leaving your machine. It's a diagnostic tool: it surfaces where and when a leak happened, not a billing dashboard and not a negotiation with your provider.
Best for: teams already running Claude Code, Cursor, or Codex at volume, where usage-based billing makes a silent cache leak expensive to ignore.
Skip it if: you're not using prompt caching at all, or you're on a flat-rate plan where cold-write re-billing isn't a line item that moves.
What it means for you
Finding a leak with Replay Doctor tells you where your bill is bleeding — it doesn't change what you're being charged per token, cached or cold. That's a separate decision, and it's the one worth making next: is your current AI tooling plan structured in a way that makes this failure mode expensive, or does it already account for it?
See current plans and pricing at See current pricing at the merchant before you decide whether to stay on usage-based billing or move to a structure where a TTL expiry doesn't silently cost you a full re-bill.
The decision in front of you isn't whether prompt caching is worth using — it clearly is, which is why three major coding tools depend on it. It's whether you're going to keep finding these leaks after the invoice arrives, or check your plan and pricing now, while the fix is still a configuration change instead of a line-item dispute.
What this costs right now
Vercel
The last check on this price fell outside our freshness window, so no figure is shown.
Check the current price at VercelPrices move. We print the figure we read and the moment we read it, and suppress anything older than its window rather than guess at the current number.