Prompt Caching in Agent Workloads: a 99.2% Hit Rate Across 26,000 LLM Calls

Doforu Team
2026/11/15

The model re-reads about 1,000 tokens per call

A Doforu install running continuously for seven days made 26,732 model calls and consumed 3.27 billion input tokens. Per call: the model arrived with roughly 122,000 tokens of conversation history and tool output, and actually re-read 1,035 of them.

The other 99.2% came straight from the provider's prefix cache. Billed at cache-miss rates, the same work would have cost 35× more on the input side.

None of this is a constructed benchmark. It is what one machine recorded over seven days, one row per request, with the rows still sitting in a local database. Three things follow: where the number comes from, why it lands above the published range, and when you will not get it.

The numbers

Daily input tokens and cache hit rate

Figure 1: each day's input tokens, split into cache hits (blue) and re-computed tokens (orange). The orange is almost invisible because it averages 0.8% across the week. The green line is that day's hit rate, on the right axis.

MetricValue
LLM calls26,732
Input tokens3.27 billion
Served from cache3.24 billion
Re-computed27.7 million
Output tokens13.1 million
Cache hit rate99.2%
Average input per call~122,000 tokens
Average re-read per call~1,035 tokens

Doforu Settings → Usage, last 7 days

Figure 2: where the chart above comes from — the usage panel in the app, untouched.

The window is 2026-11-08 through 2026-11-15 — the default seven-day view in Settings → Usage. Snapshot taken 2026-11-15 16:40, the same moment as the screenshots above. The database keeps growing, so your own query will return slightly larger totals; the ratios will not move.

One clarification: 99.2% is weighted by input tokens. It does not mean 99.2% of requests hit, and it does not mean the model only used the remaining 0.8% of context.

The installation's first night (108 setup calls) is excluded: it is an eighth the size of the lightest subsequent day, which makes it a cold-start sample rather than a steady-state one.

How this compares

SourceWorkloadHit rateCost reduction
Lumer et al., arXiv:2601.06007DeepResearch Bench, 500+ sessionsnot reported41–80%
ProjectDiscovery (Neo)multi-step security audits7% → 84%59%
Derivai (Amy)production support agent85.8%77% (input)
This measurementlocal desktop agent, 7 days99.2%97% (input)

Those columns are not measured the same way: arXiv and ProjectDiscovery report total cost, Derivai and this article report input cost only. Treat it as a trend, not an A/B test.

And the trend is steep. 85.8% saves 77%; 99.2% saves 97%. Thirteen more points of hit rate nearly doubles the saving — which tells you the saving is not a linear function of the hit rate.

Why the gap is this wide

Two multipliers decide what you save, not one.

First, how much cheaper a hit is than a miss. DeepSeek-V4.1-Flash prices cached input at $0.003 per million tokens against $0.15 for a miss — a factor of 50. Anthropic's cache-read price is 0.10× the standard rate, a factor of 10. At the same 99% hit rate, settling at 1/50 versus 1/10 is the difference between 97% and 90% off your input bill.

Second, whether writing to the cache costs extra. Anthropic's caching is explicit: you mark the range with cache_control, and the request that writes that range pays a premium — 1.25× for a 5-minute cache, 2.0× for an hour. An agent loop appends on every turn, so it writes on every turn, and that premium is paid continuously. It buys a 0.10× read rate; net of the two, less of the discount reaches your invoice. DeepSeek's cache is automatic with no write surcharge, so the full 50× gap lands on the bill.

Third, whether your agent loop is cache-shaped by construction. The first two factors are not Doforu's doing. This one is at least partly a design choice. An agent loop appends; it does not rewrite history. The system prompt and tool definitions are byte-identical from call 1 to call 26,732, which is why the first call of a long session already hits 97.9% — not because that session wrote the cache, but because earlier sessions had already written the shared prefix.

The instructive case is ProjectDiscovery's climb from 7% to 84%: the default is bad. Dynamic content leaking into the cacheable range, or tool definitions that vary slightly per request, will silently destroy the prefix on any provider. The arXiv evaluation adds the mirror-image warning — caching everything indiscriminately can make time-to-first-token worse.

What it costs

Line itemTokensRateCost
Cached input3,243.9 M$0.003/M$9.73
Re-read input27.7 M$0.15/M$4.15
Output13.1 M$0.60/M$7.84
Total$21.72

26,732 calls over seven days cost $21.72 — about $3 a day, or $0.0008 per call.

Without caching, the input side alone would be $491. The saving is $477, or 97%.

One structural detail worth absorbing: output is 0.4% of token volume but 36% of spend, because nobody caches output. Caching compresses the part that gets expensive as history grows; it does nothing for the part that gets expensive as work grows. A longer session gets cheaper per turn. Doing more work still costs more.

When you will not see this

Short sessions. A first call has nothing to reuse beyond the system prompt; the rate sits near 0%. If you only ask an agent a couple of questions, you will never see 99%.

A mutated prefix. Editing the system prompt, switching models mid-task, or changing tool definitions invalidates everything after the change. This is the most common and most expensive trap — next section has a real one.

A large one-off injection. Reading a 50,000-token file into context spikes that turn's billing. In this dataset more than nine in ten calls kept re-reads under 2,000 tokens.

A provider that reports nothing. Self-hosted vLLM and some regional providers return no cache fields, and then there is no number to compute. Doforu shows — rather than 0% in that case, because "not reported" and "genuinely zero hits" are different problems.

A trap we walked into

One failure is worth telling in full, because it took the hit rate from 98.8% to 0.0%.

Doforu assembles its skills list into the system prompt, and that list used to be recomputed every 60 seconds. So installing or removing a skill mid-session added or removed an entire block from the system prompt — which meant everything after that block had to be recomputed. On the bill it looks like the provider fell over. It was us editing our own prefix.

The fix freezes the list per session, releasing it only at session end and at context compaction.

For anyone building an agent: when your hit rate collapses toward zero, check whether something is dynamically rewriting the system segment before you blame the provider.

Why the data being local matters

This write-up is possible because the numbers live on the machine: usage_records in agent.db, with hit, miss and output as separate columns rather than a pre-computed percentage.

That is also the practical difference between a local agent and a cloud one. Model calls go through your own API key and you pay the provider directly — we take no cut. Sessions, files, tool output and usage rows stay on your disk; our servers never see your code. If you want to dispute these numbers, you can open the table and check.

A cloud agent cannot offer that. Not for lack of engineering, but because its usage data lives on its servers and you only get the summary it chooses to show.

Checking it yourself

Two places show the same data:

  • Settings → Usage — hit rate, cached tokens, per-day stacked chart, recomputed per period.
  • The bottom-bar token readout — live hit rate for the current session, green above 90%.

For the raw rows, any SQLite client will do:

SELECT
  COUNT(*) AS calls,
  ROUND(100.0 * SUM(cache_hit_tokens)
        / (SUM(cache_hit_tokens) + SUM(cache_miss_tokens)), 2) AS hit_rate_pct
FROM usage_records;

Limits

One user, one machine, one model, one week. Enough to show the mechanism works under real load; not enough to give you a universal figure.

Every row is DeepSeek-V4.1-Flash at off-peak prices (peak doubles the rates — dollars change, ratios do not). Anthropic and OpenAI price and implement caching differently, and the yield will be lower there; the two sections above put numbers on how much lower.

Which means the useful question is not "is 97% real" but "which of these am I". If you plan to run agents on DeepSeek, 97% is what you can get. If you are mostly on Claude, expect the 85–90% band — still worth designing your prefix carefully, just do not budget on 97%.

If you want to check, install it, run for a day, and open the usage panel. The number you get will be yours, and it has nothing to do with this article.