Cache price beats input price for coding agents: one Sonnet miss costs as much as 25 hits

zitoliv · reddit · 2026-11-03

An agent resends the whole session every turn — 100K context over 50 turns means 5M input tokens, almost all repeated history. So the cache read price and hit rate, not the headline input price, determine your bill:

Common miss causes: switching providers mid-session (cache only hits where it was written), idle timeouts (5 min default on Anthropic's API, 1h in parts of Claude Code subscriptions), and editing anything early in the prompt (system prompt, AGENTS.md), which forces full-price re-reads of everything after it.

Advice: pin your provider, keep sessions short, keep the prompt start stable. An accompanying chart visualizes accumulated cacheable history and per-model costs using official Nov 2026 API prices.

Original post →

More from coding & agent

coding & agent channel →