Skills
Prompt Cache Maximization: Static-Content-First Structure for 90% Input Token Cost Reduction
Anthropic's prompt caching API (requires ≥1024 tokens) charges 0.1x for cache reads vs 1.0x for fresh input — up to 90% savings and 80% latency reduction. The structural rule is non-negotiable: place all stable content (system prompt, instructions, few-shot examples, tool schemas) at the beginning of the prompt, and all volatile content (user input, session-specific data, dynamic values) at the end. Cache hits only work on exact prefix matches, so any volatile content inserted before stable sections destroys the cache hit entirely — a common implementation mistake in multi-turn agent systems.
Source
↳ Follow the thread