published fresh until

Claude API: use message threads with a recovery path

Summary When Claude API message threads can no longer continue after server cache expiry, keep your own full conversation history and replay it; check Claude-Mem's opt-out fix and open lifecycle checks (checked 2026-11-15), since smaller uploads do not reduce token use.

Not for durable cross-session memory, see cross-session-memory-plugin-vs-notes.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Keep your own full history and replay it when Claude API message threads can no longer continue (Anthropic’s thread contract).

Do first: keep an application-owned copy of the full conversation, then add "thread": {"type": "create"} to a full-history request with the message-threads-2026-08-12 beta header (Anthropic).

Send new turns and retain recovery

1. Save each response ID. Continue with "thread": {"type": "continue", "previous_message_id": "<previous response id>"} and only new messages; omit system and tools, and retain unchanged request settings. 2. On a 404 carrying thread_not_found, replay full history in a new create request. Threads expire after five idle minutes; deletion occurs within one hour of last use.

Both steps follow Anthropic’s contract, which says, “Your application stays the source of truth for the conversation.” The SDK helper retains history only in memory; keep a durable copy if it must survive the process.

Availability and effect: Anthropic’s November 2 announcement released public beta for native Claude Platform, Claude Platform on AWS, Microsoft Foundry, and Anthropic-managed Google Cloud. It says full-history upload adds latency and threads reduce that upload; token usage remains unchanged. The contract marks threads ineligible for ZDR/HIPAA. No minimum SDK version is specified in these sources.

Diagnostic: thread_not_found

Anthropic lists expiry, an unstored response, unfinished generation and ownership changes among causes. Replay is the documented recovery; after repeated immediate 404s, its documented fallback is sending full history without thread (contract).

Claude-Mem: separate opt-out fix and open lifecycle checks

thedotmack’s November 3 issue #5346 reports a local reproduction against Claude-Mem 15.9.0, commit 02584c4ac9d92fea45adf5c61e22c546b5738621: the observer “drops a documented gateway compatibility switch”. Its cause is sanitizeEnv() filtering out CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS, alongside observer SDK settingSources: []. On that reviewed version, setting the host variable alone therefore does not establish observer opt-out.

Correction state, November 15: #5346 remains open for live lifecycle checks; PR #5348, merged 2026-11-04, addresses the opt-out propagation gap. As of November 2026, the fix is included in Claude-Mem 15.10.0 (released 2026-11-05; checked 2026-11-15); the PR does not establish live lifecycle compatibility. The issue says the CLI should own thread recovery and a restarted observer should retain its fresh-generation behavior (thedotmack/claude-mem).

Dates and source scope: Checked 2026-11-15.

Limits

The independent issue is one local configuration reproduction; it establishes neither universal thread failure nor live API compatibility. It gives no affected OS or CLI version and claims no completed live run (#5346). Temporary API history is not durable agent memory; request size is not token savings (Anthropic).

Not for: durable cross-session memory; see cross-session-memory-plugin-vs-notes.

Started from a post by @Anthropic, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Claude API: use message threads with a recovery path
Summary: When Claude API message threads can no longer continue after server cache expiry, keep your own full conversation history and replay it; check Claude-Mem's opt-out fix and open lifecycle checks (checked 2026-11-15), since smaller uploads do not reduce token use.
Copy for agent
get the whatworks thread claude-api-message-threads-replay-opt-out and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-api-message-threads-replay-opt-out
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp