Blog · Analysis
How a minimal harness hits a 99.93% cache hit rate
August 14, 2026 · dshbase
The cheapest way to run DeepSeek isn't just a cheap model — it's a harness that reuses the work the model already did. Community measurements of the open-source agent Pi showed a 99.93% prefix-cache hit rate.
The cost driver
A coding agent re-sends the system prompt, tool definitions, history, and code on every step. Automatic prefix caching reuses the computed prefix if the start of the request is unchanged. The cache hit rate is the share of tokens reused — higher is cheaper.
Why caching is fragile
Add a timestamp, reorder a tool, or rewrite earlier content and the cache misses. Cache-friendly harnesses keep the request prefix stable.
Pi's recipe
Pi gives the model just four tools by default (read, write, edit, run) with everything else opt-in, and sessions append rather than rewrite. Reported result: ~99.93% hit rate, roughly ¥19 per 1B tokens with caching vs ¥900+ without.
The 7x gap
A Composio benchmark ran DeepSeek V4 Flash across 8 harnesses: Pi ~$0.028 per successful task (cheapest), Claude Code ~$0.195 (nearly 7x). Same model, different harness, very different bill.
Takeaway
- Minimal tool sets + append-only sessions = the biggest levers for cache hits.
- DSH aligns: small active surface, everything-as-plugin, PTC keeps intermediate data out of context.