Replay Doctor: A Local CLI for Catching Silent Prompt-Cache Billing Leaks
Replay Doctor is a local command-line tool built to catch silent prompt-cache leaks in AI coding-agent workflows. A developer using the handle danielsaito posted it to Show HN, explaining that agent bills can spike with no warning or error in the logs. The post names two triggers: out-of-order request replay and an idle gap such as a 10-minute lunch break, both of which can cause a provider to re-bill the conversation at cold-write prices.

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.
This is for anyone running Claude Code, Cursor, or Codex agents against a metered API and watching the bill, not just the terminal. Replay Doctor, posted to Show HN by a developer using the handle danielsaito, is a local CLI built to catch one specific leak: prompt-cache expiry that silently re-bills your whole conversation at cold-write rates. Skip it if you don't use prompt caching at all, or if your workflow never leaves an agent session idle.
What changed and why it matters
The news hook here is narrow and checkable: a solo developer shipped a command-line tool, not a hosted dashboard, specifically to surface a billing failure mode that produces no error in the logs. The stated reason for building it is blunt — AI agent bills spike with no warning, and nothing in the console tells you why.
That matters because the failure is invisible by design. Prompt caching is supposed to save you money by reusing the provider's cached context instead of resending the full conversation history on every turn. When the cache silently expires, that savings mechanism flips into a cost spike, and you only find out when the invoice lands.
The detail
Prompt caching works on a time-to-live (TTL): as long as you keep hitting the same cached prefix inside that window, you pay reduced rates for repeated context. Replay Doctor exists because two ordinary coding-agent behaviors blow past that window without anyone noticing.
The first trigger is a client re-rendering requests out of order — a UI or agent loop that replays turns in a sequence the cache doesn't expect. The second is simpler: an idle gap. The tool's own example is a 10-minute lunch break. Step away, come back, and the TTL has already lapsed.
When that expiry happens, the provider doesn't reject the request or throw a warning. It re-bills the entire conversation history at cold-write prices and keeps going, per the tool's own Show HN description. The workflows named in that description cover three tools:
| Agent tool | Relies on prompt caching | Named trigger in the post |
|---|---|---|
| Claude Code | Yes | Out-of-order re-render, idle gap |
| Cursor | Yes | Out-of-order re-render, idle gap |
| Codex | Yes | Out-of-order re-render, idle gap |
Replay Doctor runs locally rather than as a hosted service, which means it reads your own session data instead of sending it anywhere. Best for: developers who already run one of these three tools long enough, or with enough idle time between turns, that a silent cold-write re-bill is plausible. Skip it if: your sessions are short, continuous, and never pause — the TTL expiry this tool hunts for needs a gap or a re-render to occur in the first place.
What it means for you
If you're running agent workflows in long sessions — leaving Claude Code or Cursor open across a lunch break, or driving Codex through a re-rendering client — the practical move is to stop treating the terminal as the only signal of cost. A tool that only checks logs for errors will miss this leak entirely, because by definition there is no error; checking the bill itself, or running a local CLI built for this exact gap, is the only way to catch it before the next invoice.
The infrastructure question that follows is where you run these long-lived agent sessions and whatever monitoring you put around them. A laptop that sleeps, suspends, or loses its network mid-session reproduces the exact idle-gap condition Replay Doctor is built to catch — which is a case for moving persistent agent workflows onto a machine that stays up on its own schedule, not yours. If you're weighing where that persistent box should live, See current pricing at the merchant to compare current droplet tiers and pricing before you commit a workflow to it.
If your actual bottleneck is the coding agent itself rather than the infrastructure under it, that's a separate decision, and worth making deliberately rather than by default.
None of this requires guessing at numbers. Replay Doctor's value is that it turns an invisible re-bill into a checkable line item, on your own machine, before it becomes a surprise. The decision in front of you isn't whether prompt-cache leaks are real — the mechanism is documented and named — it's whether your current setup, laptop included, gives that leak room to happen.
What this costs right now
DigitalOcean
The last check on this price fell outside our freshness window, so no figure is shown.
Check the current price at DigitalOceanPrices 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.