Dynamic Tool Adjustments for Long AI Conversations
Modify active tools mid-chat without losing prompt cache.
Apply the `mid-conversation-tool-changes` beta header to dynamically update the tools available to Claude during a session without restarting.
The Scenario
You are in the middle of a complex data analysis session and realize you need to give Claude access to a specific API tool it didn't have at the start of the chat.
Before & after
If you needed to add a new tool (like a calculator) halfway through a chat, you had to restart the session or send the full history again, costing 2–5 minutes and extra tokens.
Pass the new beta header to modify the toolset mid-stream, allowing the model to adapt to new information without clearing its short-term memory. Total time: 2 minutes.
The Prompt
// Example of adding a new tool while maintaining conversation cache
client.beta.messages.create({
model: "claude-opus-5",
headers: { "anthropic-beta": "mid-conversation-tool-changes-2026-07-01" },
tools: [
// [ADD_OR_REMOVE_TOOLS_HERE]
],
messages: [/* [EXISTING_CONVERSATION_HISTORY] */]
});The 'mid-conversation-tool-changes' beta allows you to add or remove tools between turns while preserving the prompt cache, saving both latency and model costs.
Source
Claude Platform release notes - Claude Platform Docs"add or remove tools between turns of a conversation while preserving the prompt cache."
