subagentcontext

.com context management

← all concepts

When prompt caching is most useful

prompt_caching ctx_prompt_caching_when_useful
description
Prompt caching pays off most when the same large prefix (system prompt, tool schema, long reference document, or few-shot examples) is reused across many requests in a short time window, such as a multi-turn agent session or a batch of requests over the same document.
how it works

Each cached prefix has a limited time-to-live; if requests reusing that prefix keep arriving before it expires, subsequent requests keep getting the caching benefit; if too much time passes between requests, the cache entry expires and the next request pays full cost to reprocess and re-cache it.

source note

General usage pattern consistent with docs/docs/platform.claude.com/docs/en/build-with-claude/prompt-caching.md.

provenance

created 2026-07-02 08:27:03 · JSON