News

Claude API: change effort mid-conversation without breaking the prompt cache

A beta feature in the Claude API lets you lower or raise effort mid-conversation with a system message, keeping the prompt cache intact. Here is how it works and where it fails.

Oliver · FoxAI World4 min read
18
Oliver sits behind a laptop beside the Anthropic name and a diagram of messages, gears and a database.Effort, cache intact

Conceptual cover created with AI.

Picture an agent loop that plans a database migration at high effort. The hard thinking is done; the next request only asks for a one-line summary. Dropping to low effort sounds like an easy saving, but in the Claude API that switch has long carried a hidden price: a change to the top-level effort value can invalidate all or part of the prompt cache, and the whole conversation gets processed again.

What changed

Anthropic now documents a beta feature called per-message effort. Effort is the setting that controls how many tokens Claude spends on a reply, from low to max. Instead of changing that value at the top of the request, you add a message with role: "system", empty content and the new level in output_config.effort to the messages list. You also send the beta header mid-conversation-output-config-2026-07-01 and leave the top-level value as it was.

Oliver reaches for a control dial beside his laptop, with message icons, a locked database, coins and the Anthropic name nearby.
AI-generated conceptual illustration.

Why the cache broke before

Prompt caching stores the parts of a request that were already processed, so a follow-up that only appends new turns is cheaper. According to Anthropic’s effort documentation, the top-level effort value shapes the rendered prompt. Change it, and cached prefixes from earlier turns may no longer match. The per-message approach leaves everything before the new message untouched, so the cached prefix still matches.

Which models and platforms support it

The documentation lists Claude Fable 5.2, Mythos 5.2, Fable 5.1, Mythos 5.1, Opus 5.5, Opus 5, Sonnet 5.5 and Haiku 5.5. The feature is in beta on the Claude API and, depending on the model, on Amazon Bedrock, Claude Platform on AWS, Google Cloud and Microsoft Foundry. It is not available in Managed Agents, where you set effort for a session through a model override instead.

There are limits. Without the beta header, the extra field returns a 400 error. Models without per-message support, such as Claude Fable 5, also return a 400 error. On Sonnet 5.5 with between_tools thinking and on Haiku 5.5 with thinking disabled, effort cannot change mid-conversation; adaptive thinking is the documented route there.

When the new level applies

Position matters. Placed directly after a user turn with new input, the message changes the effort of the reply to that turn. Anywhere else, the new level starts at the next user turn with new input. A user turn that holds only tool results does not count. The level stays until a later message changes it.

The documentation is strict about one more thing: put the message after everything already sent and keep it there on later requests. Do not insert it earlier or remove it later. On models with preserved thinking, that invalidates thinking blocks in the following assistant turns.

What about the system prompt?

The same idea covers instructions. Anthropic’s cost guide for Claude Platform recommends adding a system instruction as a message mid-conversation instead of editing the system prompt, because that preserves the cache. The guide also notes that the default cache lifetime is 5 minutes and that writing to the cache costs 1.25 times the normal input price, or 2 times for a 1-hour cache.

Our assessment

First, isolate the change. Per-message effort does not make the model cheaper per token; it removes a penalty you paid for adjusting effort at the wrong layer. That matters most in long agent sessions where a few hard steps sit between many routine ones. Our inference, not a documented promise: the saving depends on how much of your prompt is cacheable and how often you switch. Anthropic’s guide points to cache hit rates and the Console’s cache diagnostics as the check, and to compaction as a natural moment to change effort, since the cache is rewritten anyway. Because the feature is still beta, test it on your own evals before relying on it.

Ask AI about this article

Opens in a new tab with the question filled in.

Sources and research

Written by FoxAI World. The cover and illustrations are AI-generated conceptual artwork.

Your favourites

This list stays in this browser on your device. No account is needed, and other visitors cannot see it.

Use a story’s bookmark button to add your first favourite.