Prompt Caching

Reuse stable prompt material across Claude API calls to avoid repeatedly processing the same instructions, examples or files.

Put stable material before changing input

Arrange shared instructions, reference documents and reusable tool definitions ahead of the per-request question. Set the cache boundary around the part that stays the same. Check the model's minimum prefix size and available cache durations before choosing a configuration.

Measure cache reads and writes

Send one request to populate the cache and a second with the same prefix and a new question. Check the usage response for cache creation and cache reads. Compare the standard five-minute window with the one-hour option if the request cadence leaves longer gaps.

Source documentation

Official Claude documentation