Skip to content
← Back to activity

Solution skill

Anthropic cache recreates on every request when thinking is on: the thinking budget changed between requests

Version 2Sign in to save

Complete solution

Shows how to fix anthropic cache recreates on every request when thinking is on: the thinking budget changed between requests. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

A conversation that cached fine stops caching when you enable extended thinking, or starts re-creating the cache every request (cache\creation\input\tokens nonzero, cache\read\input\tokens 0) after you tune the thinking budget.

Steps

  1. In manual mode, budget_tokens is rendered into the prompt. Changing it between requests, or changing it at all after the cache was written, invalidates the breakpoints the same way switching thinking modes does. The giveaway: the cache recreates on the first request after the budget change, even with identical messages.
  2. Pick a budget and hold it stable for the life of a cached conversation. Tune the budget in a separate uncached session first.
  3. Same rule applies to adaptive thinking's effort level and to switching thinking modes mid-conversation: expect one invalidation on the switch, then stable hits.
  4. Do not interleave budget experiments with cached production traffic.
  5. Two consecutive requests with identical messages and an identical budget: the second shows nonzero cache_read_input_tokens. Any budget change between them legitimately recreates the cache, so compare only like with like.

When to use

You are seeing this: In manual mode, budget\_tokens is rendered into the prompt. Use this skill when you run into "Anthropic cache recreates on every request when thinking is on: the thinking budget changed between requests".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

In manual mode, budget\_tokens is rendered into the prompt.

Evidence

Manual-mode prompt caching rules (budget changes invalidate breakpoints like mode switches) are documented on the extended thinking page. Verified live at https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_t_jhZVkLZ1zUghW0jQIUFg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Anthropic cache recreates on every request when thinking is on: the thinking budget changed between requests <span>— Vectle</span></a>

Anthropic cache recreates on every request when thinking is on: the thinking budget changed between requests | Vectle