Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Claude prompt caching can miss in a long agent loop even when much of the prompt is unchanged: each cache breakpoint looks backward through at most 20 block positions, counting the breakpoint itself, for a cache entry that an earlier request actually wrote. If the conversation grows far enough between writes, the previous entry falls outside that window. Put a breakpoint at the end of the stable prefix, then add an intermediate breakpoint before loop growth pushes the earlier write out of reach.

What Claude’s 20-block lookback checks

Prompt caching works on a cumulative prefix: tool definitions, system content, and messages up to a block marked with cache_control. At that breakpoint, Claude can write the prefix as a cache entry. On a later request, it searches backward from the current breakpoint for a matching entry written by an earlier request. Anthropic documents a maximum lookback of 20 positions, including the current breakpoint. See Anthropic’s prompt caching documentation.

This is a bounded search for existing entries, not an automatic scan that discovers stable content and caches it. An unchanged prefix can therefore miss if no earlier request wrote a matching entry within the current breakpoint’s search range.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to count tool activity

On the Claude API, a consecutive run of tool_use blocks counts as one lookback position, and a consecutive run of tool_result blocks also counts as one. So multiple parallel tool calls represented as one consecutive run do not necessarily consume one position apiece. This counting detail is specific to the documented Claude API behavior; do not assume another platform counts blocks the same way.

#1 Best Overall
Sale
AMD RYZEN 7 9800X3D 8-Core, 16-Thread Desktop Processor
  • The world’s fastest gaming processor, built on AMD ‘Zen5’ technology and Next Gen 3D V-Cache.
  • 8 cores and 16 threads, delivering +~16% IPC uplift and great power efficiency
  • 96MB L3 cache with better thermal performance vs. previous gen and allowing higher clock speeds, up to 5.2GHz
  • Drop-in ready for proven Socket AM5 infrastructure
  • Cooler not included

Where the boundary falls

Anthropic’s example shows a cache entry written at block 15 missed from a later breakpoint at block 35: the search checks positions 35 through 16, so position 15 is just outside the window. A nearer breakpoint can establish a more recent entry with its own backward search window.

Why long agent loops lose cache hits

Each agent turn may append messages, tool calls, and results. If enough positions accumulate before the next cache write, the next breakpoint can end up 20 or more positions beyond the previous write. The lookup then stops before reaching that entry, regardless of how much earlier content remains unchanged.

Rank #2
Sale
AMD Ryzen 9 9950X3D 16-Core Processor
  • AMD Ryzen 9 9950X3D Gaming and Content Creation Processor
  • Max. Boost Clock : Up to 5.7 GHz; Base Clock: 4.3 GHz
  • Form Factor: Desktops , Boxed Processor
  • Architecture: Zen 5; Former Codename: Granite Ridge AM5

A different miss occurs when the breakpoint includes content that changes every request. The cache entry represents the entire prefix up to that breakpoint, so a changing timestamp or user message makes that prefix different. Looking backward does not create a separate entry for the stable blocks before the changing content. Anthropic advises placing the breakpoint at the end of the last stable block intended for reuse.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Automatic caching does not extend the 20-position search. It places a breakpoint on the last cacheable block and follows the same underlying lookback behavior. If the last cacheable block varies from request to request, explicit placement at the stable-prefix boundary may be needed.

Rank #3
Sale
AMD Ryzen 5 5500 6-Core, 12-Thread Unlocked Desktop Processor with Wraith Stealth Cooler
  • Can deliver fast 100 plus FPS performance in the world's most popular games, discrete graphics card required
  • 6 Cores and 12 processing threads, bundled with the AMD Wraith Stealth cooler
  • 4.2 GHz Max Boost, unlocked for overclocking, 19 MB cache, DDR4-3200 support
  • For the advanced Socket AM4 platform

How to keep a long loop within reach

  1. Put shared material first. Arrange relatively static tool definitions, system instructions, shared context, and examples before the changing per-request suffix.
  2. Mark the stable boundary. Place cache_control on the last block whose full prefix remains identical across the requests that should share a cache. Keep changing timestamps and incoming messages after that point when the intended reusable content comes before them.
  3. Estimate growth between writes. Count the positions that can accumulate during the longest expected agent turn. If the next breakpoint could be 20 or more positions past the last written entry, establish a nearer breakpoint early enough for that entry to be written before the long turn.
  4. Use multiple breakpoints for different change rates. A mostly static prompt prefix and a growing conversation may need separate breakpoints. Anthropic documents a maximum of four breakpoints.
  5. Check response usage. Inspect cache-read and cache-write usage in API responses. A read indicates reuse; a write indicates creation of an entry. This helps distinguish a cache miss from an unchanged prefix that was never written.

One breakpoint or several?

Approach When it fits Trade-off
One breakpoint at the stable prefix The prefix is stable and loop growth between cache writes stays within the 20-position lookback. Simpler placement, but a long turn can move the next breakpoint beyond the prior entry’s reach.
Multiple breakpoints Different prompt sections change at different rates, or the conversation can grow enough to outdistance an earlier write. Can preserve nearer lookup points, within Anthropic’s documented maximum of four breakpoints.

The choice is about prompt structure and growth, not a separate fee for each breakpoint: Anthropic says costs follow cached content and cache operations. Whether automatic caching is available also depends on the target model and platform.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Cache lifetime, cost, and platform limits

Anthropic documents a five-minute default cache lifetime and an optional one-hour duration at additional cost. Its standard rate examples list five-minute cache writes at 25% above base input price and cache reads at 10% of base input price. These are relative rates, not dollar estimates; actual charges vary by model, platform, and current price schedule. Check Anthropic’s current documentation and pricing before making a cost estimate.

Rank #4
Sale
AMD Ryzen™ 5 9600X 6-Core, 12-Thread Unlocked Desktop Processor
  • Pure gaming performance with smooth 100+ FPS in the world's most popular games
  • 6 Cores and 12 processing threads, based on AMD "Zen 5" architecture
  • 5.4 GHz Max Boost, unlocked for overclocking, 38 MB cache, DDR5-5600 support
  • For the state-of-the-art Socket AM5 platform, can support PCIe 5.0 on select motherboards
  • Cooler not included

Anthropic also notes that its legacy Amazon Bedrock integration for Opus 4.6 and earlier does not support top-level automatic caching; that integration requires explicit cache breakpoints. Feature availability can change, so check the current platform feature matrix for the specific model and deployment rather than generalizing from another endpoint.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

SaleBestseller No. 1
AMD RYZEN 7 9800X3D 8-Core, 16-Thread Desktop Processor
AMD RYZEN 7 9800X3D 8-Core, 16-Thread Desktop Processor
8 cores and 16 threads, delivering +~16% IPC uplift and great power efficiency; Drop-in ready for proven Socket AM5 infrastructure
$444.00
SaleBestseller No. 2
AMD Ryzen 9 9950X3D 16-Core Processor
AMD Ryzen 9 9950X3D 16-Core Processor
AMD Ryzen 9 9950X3D Gaming and Content Creation Processor; Max. Boost Clock : Up to 5.7 GHz; Base Clock: 4.3 GHz
$664.98
SaleBestseller No. 3
AMD Ryzen 5 5500 6-Core, 12-Thread Unlocked Desktop Processor with Wraith Stealth Cooler
AMD Ryzen 5 5500 6-Core, 12-Thread Unlocked Desktop Processor with Wraith Stealth Cooler
6 Cores and 12 processing threads, bundled with the AMD Wraith Stealth cooler; 4.2 GHz Max Boost, unlocked for overclocking, 19 MB cache, DDR4-3200 support
$87.95
SaleBestseller No. 4
AMD Ryzen™ 5 9600X 6-Core, 12-Thread Unlocked Desktop Processor
AMD Ryzen™ 5 9600X 6-Core, 12-Thread Unlocked Desktop Processor
Pure gaming performance with smooth 100+ FPS in the world's most popular games; 6 Cores and 12 processing threads, based on AMD "Zen 5" architecture
$177.99
SaleBestseller No. 5
AMD Ryzen 7 7800X3D 8-Core, 16-Thread Desktop Processor
AMD Ryzen 7 7800X3D 8-Core, 16-Thread Desktop Processor
Ryzen 7 product line processor for better usability and increased efficiency; 5 nm process technology for reliable performance with maximum productivity
$348.00
Best Value
Sale
AMD Ryzen 7 7800X3D 8-Core, 16-Thread Desktop Processor
  • Processor provides dependable and fast execution of tasks with maximum efficiency.Graphics Frequency : 2200 MHZ.Number of CPU Cores : 8. Maximum Operating Temperature (Tjmax) : 89°C.
  • Ryzen 7 product line processor for better usability and increased efficiency
  • 5 nm process technology for reliable performance with maximum productivity
  • Octa-core (8 Core) processor core allows multitasking with great reliability and fast processing speed
  • 8 MB L2 plus 96 MB L3 cache memory provides excellent hit rate in short access time enabling improved system performance

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.