Do I have to turn prompt caching on?
It depends on the provider. Some cache automatically for long prompts, and others need you to mark cache points in the request. Coding agents usually handle this for you.
Reusing the already processed start of a prompt across requests so repeated context is cheaper and faster.
Prompt caching is a feature where the AI provider saves the processed form of the beginning of a prompt, so that later requests starting with the exact same text can skip reprocessing it. Cached input tokens are billed at a steep discount, and responses start faster. It works on the prefix: the system prompt, tool definitions, instruction files and earlier conversation that stay the same from turn to turn. Caches expire after a period, often minutes to an hour depending on the provider and settings, and any change near the start of the prompt breaks the match for everything after it.
Agents re-send a large, mostly unchanged context on every turn, so caching can cut input costs dramatically in long sessions. It also explains a practical rule: keep stable content, such as an instructions file, at the start and unchanged during a session, and put changing content at the end. Editing your CLAUDE.md mid-session can invalidate the cache for the rest of the context.
An agent sends a 20,000-token prefix of system prompt, tools and AGENTS.md on each of 15 turns. Without caching, that prefix is billed in full 15 times. With caching, it is billed at the full rate once, or a little more to write the cache, and at a fraction of the price on the remaining turns. Responses also start sooner, because the provider skips re-reading that prefix.
Prompt caching does not store your answers or reuse previous replies. The model still generates a fresh response each time. Only the work of reading the identical prefix is reused.
All 28 terms are in the AI glossary. For models side by side, see frontier vs open-weight.
It depends on the provider. Some cache automatically for long prompts, and others need you to mark cache points in the request. Coding agents usually handle this for you.
Usually because something near the start of the prompt changed, such as a timestamp, a reordered tool list or an edited instructions file, or because the cache expired between requests.
Cached data is held by the provider for the cache lifetime under their data policy, much like the prompt itself. Check the provider documentation if retention matters to you.