cd /news/large-language-models/why-95-cached-coding-and-security-ag… · home › topics › large-language-models › article
[ARTICLE · art-182663] src=dev.to ↗ pub= topic=large-language-models verified=true sentiment=· neutral

Why 95%-Cached Coding and Security Agents Pay 10x Less on Prefix Caching Than Uncached Sticker Prices

A developer measured a 14-minute Claude Code session and found that 96.5% of all input tokens were prefix cache hits, meaning cached-input pricing dominates the bill for multi-turn coding and security agents. Comparing two backends on the same 10M-input-token workload, the cache-optimized pricing came to $0.3825 versus $4.35 for uncached-focused pricing — more than an 11x swing — even though fresh-input prices differed by only 2.4x. The writeup recommends benchmarking real session costs with caching enabled rather than comparing uncached list prices.

recommendation

Benchmark agent session bills with prefix caching enabled instead of comparing uncached list prices, since cached input can dominate 96% of tokens.

more in playbook: Controlling LLM cost
by read1 min views2 publishedDec 6, 2026

When developers compare LLM APIs, almost everyone sorts by two columns: fresh input price and output price per 1M tokens. For one-shot chat prompts, that table works. For autonomous coding and pentest agents, it predicts the wrong winner almost every time.

In a multi-turn harness (Claude Code, Codex CLI, OpenCode, Strix, PentAGI), every step sends:

N Across a real 14-minute Claude Code session we measured and published (full token breakdown), 96.5% of all input tokens were prefix cache hits. Fresh input and generated output together were a small fraction of the total context processed.

Compare two backends serving 10M total input tokens (9.5M cached, 0.5M fresh) and 100K output tokens in a sustained tool loop:

Component Uncached-focused pricing ( $0.80 / $0.40 cached / $1.50 ) Cache-optimized pricing ( $0.33 / $0.009 cached / $1.32 )
Cached input ( 9.5M ) $3.80 $0.0855
Fresh input ( 0.5M ) $0.40 $0.1650
Output ( 0.1M ) $0.15 $0.1320
Session total $4.35 $0.3825

On the same workload, prefix cache read pricing swings the bill by more than 11x - even though the fresh-input prices only differed by 2.4x.

cache_salt in the gateway keeps cache hits high per tenant while guaranteeing zero cross-org KV reuse, paired with a hard 30-minute idle KV eviction timer. If you run authorized security harnesses or long-horizon coding agents on abliterated AI models, benchmark your actual session bill with cache hits turned on rather than comparing uncached list prices. You can inspect live agent-loop cost breakdowns with our agent cost calculator or read the Nodecode Cyber v1 specs.

── more in #large-language-models 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/why-95-cached-coding…] indexed:0 read:1min 2026-12-06 · —