Learning resourcesReviewed · Anthropic

Change tools or instructions without failing the prefix check

This Claude guide teaches API developers to change tools and instructions during a conversation, but keeping earlier reasoning normally requires preserving prior inputs exactly. It explains message ordering, tool changes, conversation storage, compaction, and the handling of sensitive content.

Researched 25 Nov 2026

In short.

This Claude guide helps developers maintain conversations through tool and instruction changes, with the catch that earlier reasoning depends on the exact history that produced it. It provides practical rules for replaying assistant responses, appending updates, resuming conversations, and avoiding changes introduced by serializers or gateways. Its model support and protocol behavior are documentation claims; operational compatibility, performance, and costs are not established by execution results.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete supplied page at [https://platform.claude.com/docs/en/build-with-claude/preserved-thinking/change-tools-or-instructions.md], including its feature metadata, examples, technical caveats, privacy guidance, and gateway requirements. Linked pages are excluded. Full platform availability, fallback continuation rules, compaction conditions, and some request schemas depend on those excluded references. Nothing was executed; runtime behavior, compatibility, performance, and costs remain unverified. The supplied capture contains documentation and inline examples, with no separate library files or redistribution licence established.

The overview

Identity

A focused page in Claude's preserved-thinking documentation, available at [https://platform.claude.com/docs/en/build-with-claude/preserved-thinking/change-tools-or-instructions]. The supplied source was acquired from [https://platform.claude.com/docs/en/build-with-claude/preserved-thinking/change-tools-or-instructions.md].

It teaches developers how to update an existing conversation while retaining earlier thinking blocks. Its material consists of protocol explanations, failure cases, and illustrative JSON message structures.

Assessment

The guide is particularly useful for applications that resume saved conversations, accept instructions during tool execution, or connect additional tools after a conversation starts. It identifies subtle integration failures, including dropping apparently empty thinking blocks, changing a tool description, and moving a system message into the top-level system field.

It is a practical reference for managing conversation state. A complete implementation also needs details from linked documentation, including platform-specific feature availability and full compaction conditions; those pages are outside the supplied evidence.

Users

The main audience is developers building Claude applications and agents, together with maintainers of SDKs, proxies, gateways, and conversation-storage systems. Teams changing prompts or tools in deployed applications have a specific reason to read it because existing conversations can depend on earlier configurations.

Beginners need familiarity with JSON, message roles, tool calls, and tool results. Experienced developers can use its edge cases to inspect serialization, streaming, deployment changes, and conversation recovery.

Capabilities

The page explains how to append operator instructions and environment updates, add or remove tools, disable tools for one request, send temporary reminders, and save, resume, or fork conversations. It also distinguishes API-generated compaction from summaries or cuts made by application code.

It covers defensive handling of editable files and stored memory: material the user would not expect Claude to trust should enter through tool_result blocks, including its first version. It also describes removing secrets and injected text, preserving files supplied by URL, and passing protocol fields through gateways.

Using it

Requirements

The page identifies Claude Fable 5.2, Claude Mythos 5.2, Claude Fable 5.1, Claude Mythos 5.1, Claude Opus 5.5, Claude Sonnet 5.5, and Claude Haiku 5.5 as models with preserved thinking. These names and support claims come from the supplied documentation.

Its metadata marks support stable for the Claude API, Amazon Bedrock, Amazon Bedrock through bedrock-runtime, Claude Platform on AWS, Anthropic-managed and Google-managed Claude Models on Google Cloud, and Microsoft Foundry. Availability of particular system-message features and beta headers requires the linked platform matrix.

Following the guide requires a client that retains complete messages, block order, signatures, and the configuration used by each conversation. Several features require named beta headers, so stable feature metadata does not establish that every described request shape works on every listed platform.

Mechanism

Preserved thinking is earlier model reasoning returned in thinking blocks. The guide describes a prefix check that depends on the inputs preceding those blocks remaining compatible with their original history. Changing earlier messages, system content, or active tool definitions can invalidate later thinking.

The prescribed pattern is to keep existing inputs unchanged and append updates. Complete assistant content arrays must be replayed in order, including thinking blocks with empty text: according to the page, their signature contains encrypted reasoning. Serializers and stream parsers can break this by filtering, reordering, merging, or splitting blocks.

Deferred tools remain outside the relevant context and prefix check until referenced. After a deferred tool becomes visible, changing it affects preserved thinking. Switching defer_loading on or off also counts as changing tools.

Setup

The documented starting pattern is to build the top-level system value and initial message once, retain the original tools configuration, and store complete requests and responses. Later environment changes belong in new text blocks. Operator instructions belong in appended role: system messages after the newest user message, including a user message carrying tool results. Incorrect placement can produce a 400 error.

For later tool changes, the page uses tool_addition and tool_removal blocks. Defining a newly discovered tool or one whose schema changes directly in a tool_addition block requires inline-tools-2026-09-15. On platforms without that header, append the tool definition to tools with defer_loading: true, then offer it by name in a system-message tool_addition block using mid-conversation-tool-changes-2026-07-01. Offering a previously declared deferred tool by name can use that header or mid-conversation-tool-changes-2026-07-01. Late MCP connector additions require both inline-tools-2026-09-15 and mcp-client-2026-09-15, subject to platform support.

A temporary reminder uses clear_at: next_user_message with mid-conversation-system-clear-at-2026-08-21. Cleared reminders still remain in stored messages. Tool-loop placement has additional restrictions: pending server-tool results or programmatic tool calling can require a user message containing only tool_result blocks.

Example

Consider a coding assistant whose current branch changes to release-2. The page illustrates placing an environment-update text block in the next user message, followed by a separate text block requesting another test run. Any tool results precede those text blocks. The application stores that complete message and sends it unchanged on later requests.

For a one-request pause in tool use, the documented setting is tool_choice: {"type":"none"}, while the tools array stays unchanged. These examples describe request construction; they provide no execution results.

Assessment & evidence

Limitations

Preserving thinking does not guarantee instruction compliance. The page explicitly recommends enforcing restrictions such as read-only access in the code that runs tools. It also documents model-specific instruction-handling caveats, including user text placed in system messages after tool results.

Editing history remains consequential. Application-written summaries and cuts require removing affected thinking or requesting drop_block. Omitting thinking from the middle can invalidate later blocks, and an open tool call requires returning that turn's thinking. Fallback responses have separate continuation rules described elsewhere.

Privacy removal needs stronger handling: the guide says to remove sensitive text from every message and summary that repeats it, then delete affected thinking and redacted_thinking blocks from stored history. drop_block alone is insufficient because it leaves those blocks in storage. No runtime validation of these behaviors is supplied.

Reasoning

The central engineering tradeoff is continuity versus freedom to rewrite history. Keeping earlier inputs intact supports continued use of their associated reasoning; changing those inputs requires explicit recovery or loss of that reasoning.

A practical implication is that deployed applications need configuration versions associated with individual conversations. The page warns that both a release and an append-only storage fix can change an existing conversation. It advises retaining the system and tools values from that conversation's last successful request, using updated defaults for new conversations, and appending necessary safety changes to existing ones.

Alternatives

The page offers alternatives within Claude's conversation protocol. API-generated on-demand compaction can retain recent thinking under documented conditions. An application-written summary or manual history cut instead requires removing affected thinking or requesting drop_block, with the earlier reasoning then unavailable.

Context editing is the documented option for clearing older tool results and images. For mutable files supplied by URL, the guide recommends retaining the original content through file_id or base64; a replacement signed URL is acceptable when it resolves to identical bytes. The evidence contains no comparison with other providers or frameworks.

Evidence

The evidence consists of the complete documentation page supplied as selected-page.txt from [https://platform.claude.com/docs/en/build-with-claude/preserved-thinking/change-tools-or-instructions.md]. Its source revision is sha256:8f4d70f53d6ed32c30c5f1844b70e8205eb38d0ea9c6bf8e53a108797ce3bc86.

The page supports explanations of request construction and documented failure modes. Its JSON snippets are illustrative. It supplies no benchmark measurements or results establishing application compatibility. Linked pages are excluded, so their detailed rules are not independently established here.

Access & freshness

Costs

The page provides no API prices, feature charges, token-accounting figures, latency measurements, or quantified savings from retaining reasoning. Actual operating costs and the cost difference between preserving and discarding thinking are unknown from this evidence.

Rights

The supplied page contains no explicit licence or redistribution terms for its prose or JSON examples. Permission to redistribute the captured documentation or reuse its examples is not established. API service terms are also outside the supplied evidence.

Freshness

The supplied copy was captured on 2026-11-25 at 01:54:22.437 UTC. No publication date or last-updated date is given.

Dates inside beta-header names identify the documented header variants; they do not establish when the article was published. Model support, platform availability, and request behavior beyond this captured version remain unverified.

Actions

For an integration, first inspect whether storage, serializers, stream parsers, and gateways preserve complete content arrays, empty thinking blocks, signatures, message order, and input_transformations. Retain system and tool configurations with saved conversations, and confirm platform-specific header support before implementing tool changes.

The page recommends checking prefix behavior with prefix_mismatch_behavior set to error. A useful validation plan would cover instruction placement after tool results, deferred-tool changes, resume and fork behavior, compaction, and sensitive-content deletion. Gateways should pass anthropic-beta and thinking.block_binding through together and disclose recovery from a prefix error to callers. These are proposed implementation checks; their results are unknown.

Evidence for this report

selected-page.txtselected · checked 2026-11-25