Skip to main content
The Human Bit

Concept guide · How AI works

Why asking an AI the same thing twice can be cheaper.

A model re-reads your whole instruction every time you send it. If the start of the request is identical to last time, the provider can reuse the work it already did on that part instead of charging you to read it again. That reuse is called prompt caching.

Put the stable part first. Put the part that changes last.

What it actually is

Anthropic's documentation says caching a repeated prefix "significantly reduces processing time and costs for repetitive tasks or prompts with consistent elements." The order is the catch. The docs state that "the cache follows the hierarchy: tools, then system, then messages. Changes at each level invalidate that level and all subsequent levels."

In plain terms: the fixed instructions and reference material near the top can be reused, but edit something near the top and everything after it has to be paid for and read again.

A normal example

You run a support assistant with a long fixed block: your tone, your refund policy and two example replies. The only thing that changes each time is the customer's message. Put the fixed block first and the customer's message last, and the fixed block is the same on every request, so it can be reused.

The proof: run the same prefix twice

On the API (the direct software connection to a model, the layer beneath a chat app) you can see this directly. A response splits the input it read into three counts: fresh input tokens, tokens written into the cache, and tokens read back from the cache. The first call writes the cache. A second identical call reads it back, so the reused part shows up as a cache read rather than a full charge.

First call: creates the cache. Second identical call: reads the cache. Edit the top: the cache is thrown away and rebuilt.

Try it now

Order a repeated task, then break it on purpose
  1. Take a task you run often with a long fixed instruction.
  2. Send it twice completely unchanged and note the cost or speed of each.
  3. Now change one word right at the top and send it a third time.
Check: The second identical run should be cheaper or faster than the first. The run you edited at the top should not be. If editing the end still costs full price, your stable part is not really at the top.

The decision this gives you

Structure any reusable prompt so the stable material comes first, in the order tools, then system instructions, then the conversation, and the thing that changes each time comes last. That single ordering choice is most of the saving.

Common mistake

Putting today's date, a timestamp or the customer's changing message at the top of a reusable instruction. Anything that changes near the front invalidates the cache on every request, so you pay full price and never get the saving.

The human bit

Caching changes what you pay, not whether the answer is right. The documentation is blunt about it: a cached prefix "still occupies the context window," and caching "changes what you pay for those tokens, not whether they count." A cheaper repeat still needs the same check as the first one.

Where this stops being exact

Cache lifetimes and rules differ by provider. Anthropic's cache has "a 5-minute lifetime" by default, with "a 1-hour cache duration at additional cost," and a minimum length before anything is cached at all, for example 1,024 tokens on Claude Sonnet 5. Most of this is a developer concern. In a normal chat app it happens invisibly, and the ordering habit is what carries over.

Official source

The cache lengths and lifetimes above were checked against Anthropic's documentation on 19 August 2026.

Use this in the product

The Human Bit Weekly

The useful changes, not every launch.

One short issue every Monday. What changed, what it means for your work, and the part that stays yours.

The Human Bit records when and how consent was given. Subscription is confirmed only after the email provider accepts the request.