Dokumentationerreichbar
Anthropic, Prompt caching in Claude Code
code.claude.com (externe Seite)
Die Herstellerdokumentation zum Prompt Caching in Claude Code. Jede Anfrage schickt den ganzen Verlauf erneut, und der Anbieter liest den unveränderten Anfang aus dem Zwischenspeicher. Die Seite nennt, welche Handlungen diesen Speicher entwerten, etwa ein Modellwechsel oder das Verdichten, und was das Verdichten selbst kostet. Sie nennt außerdem die Lebensdauer: eine Stunde für das Hauptgespräch in einem Abo innerhalb der enthaltenen Nutzung, sonst fünf Minuten. Stand 10.10.2026.
geprüft 10.11.2026
Worauf sich diese Seite beruft, wörtlich, abgerufen am 10.10.2026:
The model doesn't remember anything between requests, so Claude Code re-sends the full context: the system prompt, your project context, every prior message and tool result, and your new message.
bestätigt 10.11.2026Without caching, the API would reprocess your full history on every turn.
bestätigt 10.11.2026The match is exact, so a change anywhere in the prefix recomputes everything after it.
bestätigt 10.11.2026Cached prefixes expire after a period of inactivity.
bestätigt 10.11.2026Each request that hits the cache resets the timer, so the cache stays warm as long as you keep working.
bestätigt 10.11.2026Unless you choose a TTL yourself, Claude Code requests the one-hour TTL only on a Claude subscription within your plan's included usage.
bestätigt 10.11.2026In Claude Code, the cache is effectively scoped to one machine and directory.
bestätigt 10.11.2026Rewinding truncates back to a prefix that is already cached, rather than building a new one as compaction does.
bestätigt 10.11.2026To turn idle compaction off, set idle
bestätigt 10.11.2026Compaction to false The request repeats your conversation’s system prompt, tools, and the history being summarized.
bestätigt 10.11.2026By design, this invalidates the conversation layer: the next request has a new, shorter history that doesn’t share a prefix with the old one.
bestätigt 10.11.2026It ends with a summarization instruction.
bestätigt 10.11.2026