{"slug": "anthropic-mid-conversation-tool-changes-no-cache-bust", "title": "Anthropic Mid-Conversation Tool Changes: No Cache Bust", "summary": "Anthropic released a beta feature for the Claude API on July 1, 2026, allowing developers to add or remove tools mid-conversation without invalidating the prompt cache, which can reduce input costs by up to 90%. The feature uses new content block types `tool_addition` and `tool_removal` in system messages and requires the `mid-conversation-tool-changes-2026-07-01` beta header, supporting models including Claude Fable 5, Mythos 5, Opus 4.8, and Opus 5. This enables progressive tool disclosure patterns that previously caused full cache busts, with one team reporting an 85% reduction in per-request token usage by switching to lazy-loaded tools.", "body_md": "Anthropic just fixed one of the more quietly painful constraints in the Claude API: you can now add or remove tools mid-conversation without invalidating your prompt cache. The feature is in beta as of July 2026, and if you’re building multi-step agents, it changes how you should think about tool architecture.\n\n## The Cache Problem Nobody Talked About Enough\n\nPrompt caching in the Claude API saves up to 90% on input costs — cache reads run at 10% of the base token price. For long-running agents with substantial context, that difference is real money. But the cache has always had a hard constraint: the prefix order is fixed at **tools → system → messages**, and modifying anything near the root invalidates everything below it.\n\nIn practice, that meant changing your tool list mid-conversation was effectively banned for cache-conscious applications. Add a new tool? Full cache bust. You’d pay base price again, plus the write premium on the re-cached content. The workarounds were bad: either front-load every possible tool at conversation start (bloating context with capabilities the agent might never use), or accept the cost hit every time tools changed.\n\nOne team’s numbers illustrate the scale of the problem: switching from a full MCP tool library loaded at context start to lazy-loaded tools dropped per-request token usage from 77,000 to 8,700 — an 85% reduction. But without cache-safe tool changes, that lazy-loading pattern would still break caching the moment a new tool needed to surface.\n\n## What the Beta Adds\n\nMid-conversation tool changes work through two new content block types — `tool_addition`\n\nand `tool_removal`\n\n— that appear in the `content`\n\narray of a `role: \"system\"`\n\nmessage. You can mix these with regular `text`\n\nblocks in the same message.\n\nThe implementation has a specific structure. You declare *all* your tools upfront in the top-level `tools`\n\narray, but mark ones that shouldn’t be active yet with `deferLoading: true`\n\n. This tells the API: the definition exists, but don’t surface this capability in the current context window. When you want to add a tool mid-conversation, a system message with a `tool_addition`\n\nblock referencing that tool name activates it from that point forward — without touching the prefix that the cache is keyed on.\n\n```\n# 1. Declare ALL tools upfront — deferred ones won't load into context yet\ntools = [\n    {\"name\": \"search_docs\", \"deferLoading\": False, ...},      # active from start\n    {\"name\": \"database_write\", \"deferLoading\": True, ...},    # deferred — not yet visible\n    {\"name\": \"run_tests\", \"deferLoading\": True, ...},         # deferred — not yet visible\n]\n\n# 2. Mid-conversation: add database_write via a system message\nmid_turn_system = {\n    \"role\": \"system\",\n    \"content\": [\n        {\"type\": \"text\", \"text\": \"The user has approved the plan. You may now write to the database.\"},\n        {\"type\": \"tool_addition\", \"tool\": {\"type\": \"tool_reference\", \"name\": \"database_write\"}}\n    ]\n}\n\n# 3. Include beta header in your API request\nheaders = {\"anthropic-beta\": \"mid-conversation-tool-changes-2026-07-01\"}\n```\n\nTo opt in, include the beta header `mid-conversation-tool-changes-2026-07-01`\n\nin your API requests. Supported models are Claude Fable 5, Mythos 5, Opus 4.8, and Opus 5. The Anthropic Python SDK added the `MidConversationSystemBlockParam`\n\ntype in [v0.105.0](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md).\n\n## The Pattern This Enables\n\nProgressive tool disclosure isn’t a new idea — it’s how the best-designed agent systems already work conceptually. The problem was that the API didn’t support it without paying a cache penalty. Now it does.\n\n**Phase 1 — Exploration:** Agent starts with read-only tools (search, file inspection, database reads). It builds a plan.**Phase 2 — Execution:** Once the plan is approved, add the write tool.`database_query`\n\nbecomes`database_write`\n\n. The file reader gets write access.**Phase 3 — Verification:** Swap execution tools for test and deployment tools. Remove write access; add the ability to run tests and trigger CI.\n\nThis isn’t just about token efficiency. It’s a legitimate approach to agent security. Giving an agent access to a write operation before it’s in the write phase isn’t just wasteful — it’s a risk. Mid-conversation tool *removal* is equally important as addition: you can revoke capabilities the agent no longer needs. This maps cleanly to [how Anthropic’s own prompt caching documentation](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) frames cache-aware design — structure your context so that the stable parts come first.\n\n## Caveats Worth Knowing\n\nIt’s a beta, so behavior may change. A few specific things to check before building on this:\n\n**The Vercel AI SDK issue:** There’s an [open bug (vercel/ai #10018)](https://github.com/vercel/ai/issues/10018) where custom `anthropic-beta`\n\nheaders get silently dropped due to overwrite behavior in the SDK middleware. If you’re using Vercel AI SDK, verify your beta headers are actually reaching the API before assuming the feature is active.\n\n**deferLoading is required:** Tools you intend to add mid-conversation must be declared with `deferLoading: true`\n\nin the initial request. You can’t introduce a new tool definition mid-stream — plan your full tool inventory at conversation initialization.\n\n**Tool redefinition:** If you need to change a tool’s *schema* (not just add or remove it), the process is: remove the old definition at the end of one request, then carry the conversation forward with the updated definition in `tools`\n\non the next request. Mid-stream schema edits aren’t supported.\n\n## Why This Matters Now\n\nClaude Workbench retires August 17. The experimental prompt tools API goes with it. Anthropic is consolidating everything onto the production API, and the production API is getting meaningfully better — fast. Mid-conversation tool changes is the kind of feature that sounds like a footnote in the [API release notes](https://docs.anthropic.com/en/release-notes/api) but restructures how serious agent systems get built.\n\nIf your current agent architecture front-loads tools to avoid cache issues, it’s worth rebuilding around this pattern. The result is cleaner code, lower token costs, and meaningfully better security posture for your agent. Full documentation is in the [mid-conversation system messages guide](https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages) on the Claude platform docs.", "url": "https://wpnews.pro/news/anthropic-mid-conversation-tool-changes-no-cache-bust", "canonical_source": "https://byteiota.com/anthropic-mid-conversation-tool-changes-no-cache-bust/", "published_at": "2026-07-29 15:10:51+00:00", "updated_at": "2026-07-29 15:54:25.566203+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-products", "developer-tools"], "entities": ["Anthropic", "Claude API", "Claude Fable 5", "Mythos 5", "Opus 4.8", "Opus 5", "Anthropic Python SDK"], "alternates": {"html": "https://wpnews.pro/news/anthropic-mid-conversation-tool-changes-no-cache-bust", "markdown": "https://wpnews.pro/news/anthropic-mid-conversation-tool-changes-no-cache-bust.md", "text": "https://wpnews.pro/news/anthropic-mid-conversation-tool-changes-no-cache-bust.txt", "jsonld": "https://wpnews.pro/news/anthropic-mid-conversation-tool-changes-no-cache-bust.jsonld"}}