Skip to content
Concept

Prompt caching

Prompt caching — Concept. description: Prefill reuse mechanism via prefix matching · role: Decisive pricing variable for agentic traffic, which resends the same context at every step

Cached tokens cost 10 percent of the normal price. Lance Martin, developer advocate at Anthropic, traces why that matters to a property of the Claude messages API: it is stateless. An agent looping over actions repackages its history, tool descriptions and instructions every turn, so without caching it pays full price for context it has already paid for. Caching computes the prefill once and reuses it when a prefix matches exactly, down to the character.

The Claude Code team at Anthropic treats this as architecture rather than optimization: a change anywhere in the prefix invalidates everything after it. Their system prompt runs static content and tools first, then CLAUDE.MD, then session context, then messages. A timestamp, a non-deterministic tool order, or one added tool breaks the chain. Switching model mid-session is out too, hence subagents with a handoff message. Plan mode adds EnterPlanMode and ExitPlanMode as extra tools instead of swapping in read-only ones, and tool search keeps unused MCP tools as stubs with defer_loading: true.

Peter Walker, who heads analytics at OpenRouter, dates agents becoming the largest source of tokens to 6 February 2026 and puts the cache rate of recent models at 88 percent. GPT-5.6 bills cache writes at 1.25 times and keeps reads at minus 90 percent, on agentic cycles where reads outnumber writes roughly 153 to 1. @peakji of Manus calls cache hit rate the most important metric for a production AI agent; the Claude Code team watches it like uptime, with alerts and declared incidents.

Type
Concept
description
Prefill reuse mechanism via prefix matching
role
Decisive pricing variable for agentic traffic, which resends the same context at every step
relations
5
Cited in
2 fiches

Neighborhood

Claude Code recalcul du prefill GPT-5.6 coût par token du tr… Coût d'entrée

← is based on

Claude Code TECHNOLOGIE high confidence timeless Source ↗

→ reduces

recalcul du prefill CONCEPT high confidence timeless Source ↗
coût par token du trafic agentique CONCEPT high confidence timeless Source ↗
Coût d'entrée CONCEPT high confidence timeless Source ↗

← uses

GPT-5.6 TECHNOLOGIE high confidence timeless Source ↗

Cited in (2)