Skip to content
Swap Tools Mid-Chat on Claude Opus 5, Keep the Cache — ContentBuffer guide

Swap Tools Mid-Chat on Claude Opus 5, Keep the Cache

K
Kodetra Technologies··12 min read Advanced

Summary

Add or drop Claude Opus 5 tools between turns without invalidating your prompt cache.

Anthropic shipped Claude Opus 5 on July 24, 2026, and within days it took the top spot on the Artificial Analysis Intelligence Index and Agentic Index at the same $5/$25 per-million-token price as Opus 4.8. The headline was the intelligence jump, but the release also carried a quieter change that matters a lot if you build agents: a new beta called mid-conversation tool changes.

Here is the problem it solves. In a long agentic session you often want to change which tools the model can reach. You start an agent with read-only tools, then unlock write tools once it has passed a check. Or you hide ten rarely-used tools until the task actually needs them. The obvious way is to edit the tools array between turns. On the Claude API that is the single most expensive thing you can do to a cached conversation, because tools sits at the very front of the hashed request prefix. Change one byte there and you invalidate the prompt cache for the entire conversation behind it.

Keep reading — it's free

Enter your email to keep reading — plus the best of AI & tech, daily. Free, forever.

Also get
or

Already a member? Sign in

Comments

Subscribe to join the conversation...

Be the first to comment