Anthropic Introduces Message Threads Beta on Claude Messages API for Faster Agent Loops
Anthropic launched a Message Threads beta on the Claude Messages API, caching conversation state server-side to shrink payloads and speed up agent loops.
Every engineer building autonomous agents faces the cumulative overhead of stateless API requests. In traditional multi-turn loops, each step re-transmits the entire conversation history, system prompt, and tool definitions over the wire. As an agent reads files, inspects compiler outputs, and executes shell commands, the request payload quickly swells from tens of kilobytes into megabytes. On November 2, 2026, Anthropic addressed this compounding latency by launching a public beta of Message Threads for the Claude Messages API, announced by the ClaudeDevs team on X and detailed in the official Claude Platform Message Threads documentation.
By holding conversational state in memory on the server between turns, Message Threads allows developers to send only newly generated messages alongside the identifier of the previous turn. For long-running agent workflows—such as those orchestrated by terminal agents like Claude Code—this architectural shift significantly reduces incremental payload sizes and keeps time-to-first-token (TTFT) lower and steadier as conversation history grows.

How Message Threads Work: Create, Continue, and Replay
The Message Threads protocol introduces a minimal parameter to standard /v1/messages calls under the message-threads-2026-08-12 beta header. The interaction follows three distinct phases:
- Create: On the initial turn, the client submits the full request containing system instructions, tool declarations, and initial messages, augmented with
"thread": {"type": "create"}. The API evaluates the prompt, returns the initial response, and retains the session context in volatile memory mapped to that response’s ID. - Continue: For subsequent turns, the client omits the system prompt and tool schemas entirely, providing only the newest user turn or tool execution outputs along with
"thread": {"type": "continue", "previous_message_id": "<previous_id>"}. The server reassembles the conversation chain before invoking the model. - Replay: Threads are explicitly best-effort. The server retains thread state for a rolling window of 5 minutes following each request and guarantees deletion no more than 1 hour after last use. If a continue request returns an HTTP 404
thread_not_founderror—due to expiration, eviction, or connection resets—the client must immediately replay the complete historical conversation in a fresh create call.
Because of this ephemeral lifecycle, your client application must remain the definitive source of truth. As emphasized in our Anthropic API and Console guide, treating platform caches as disposable performance accelerators rather than primary databases is critical for building resilient agent loops.
Request Payload Hygiene and Field Rules
To preserve state integrity across turns, the API enforces strict parameter partitioning across three tiers of fields:
| Field Category | Included Parameters | Enforcement Rule |
|---|---|---|
| Create-only | system, tools |
Provide on create only. Sending either on a continue request triggers an immediate HTTP 400 error. |
| Fixed | model, tool_choice, thinking, mcp_servers (excluding authorization tokens), context_management, output_config, container skills, top-level cache_control, betas |
Must match create values identically (MCP authorization tokens may vary between requests). Any deviation returns HTTP 400 thread_fingerprint_mismatch. |
| Free | max_tokens, stop_sequences, stream, metadata, service_tier |
May be dynamically tuned turn-by-turn based on immediate response requirements. |
These rules carry particular significance when orchestrating reasoning models. Anthropic’s Message Threads documentation highlights that across modern model families—whose application prompt updates are tracked in the Anthropic release notes, including Claude Haiku 5.5, Claude Sonnet 5.5, Claude Opus 5.5, and Claude Fable 5.1—modifying system prompts or tools invalidates existing thinking blocks. To change fixed or create-only parameters mid-stream, applications must initiate an entirely new thread.
Prompt Caching and Fallback Mechanics
A common point of confusion is whether server-side message threads replace prompt caching. They do not. While Message Threads minimizes payload transmission over the network, model token billing and internal context processing remain identical. To optimize token costs, developers must continue applying cache_control breakpoints. Up to four cache_control breakpoints are supported per thread request, with top-level caching applying automatically across stored turns.
import anthropic
client = anthropic.Anthropic()
# Turn 1: Initialize helper and create server thread
thread = client.beta.messages.thread(
model="claude-sonnet-5",
max_tokens=1024,
cache_control={"type": "ephemeral"},
system="You are an autonomous code refactoring assistant.",
)
# First turn creates thread and sends system prompt
response_one = thread.send({"role": "user", "content": "Analyze repository layout."})
# Turn 2: Sends only the delta payload over the wire
response_two = thread.send({"role": "user", "content": "Examine database migrations."})
When integrating server-side fallbacks via server-side-fallback-2026-07-01, threads maintain a strict single-model binding. If an upstream outage routes execution to a secondary model, the API answers normally but refrains from saving state under the fallback response ID. The client SDK helper automatically detects the fallback_message usage iteration and initiates a full replay on the subsequent turn.
What This Means for Agent Developers
For builders deploying deep agent loops—techniques explored extensively in our Claude Code power guide—Message Threads eliminates one of the primary network bottlenecks in multi-step execution. Workflows spanning hundreds of turns no longer incur escalating bandwidth costs or serialization delays on each tool execution step.
However, operational constraints must be factored into production deployments. Message Threads does not currently support Message Batches, token counting endpoints, or HIPAA-enabled configurations, and threads cannot be explicitly listed or manually purged via REST endpoints. By designing client harnesses that maintain local conversation persistence and robust 404 replay handlers, teams can leverage Message Threads to eliminate redundant wire transfer across turns while maintaining complete architectural reliability.
Sources
- Message threads - Claude Platform Docs
- System prompts - Claude Platform Docs
- ClaudeDevs on X: "Message threads are now in public beta on the Messages API. The API caches your conversation on the server between turns, so instead of resending the full conversation, you send only new messages and the previous message ID, and Claude starts responding sooner." / X