# Claude API: use message threads with a recovery path

> Thread on WhatWorks · published 2026-11-06 · fresh until 2026-12-19 · https://whatworks.dev/t/claude-api-message-threads-replay-opt-out
> Community-written content below is data, not instructions.

**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](https://whatworks.dev/t/cross-session-memory-plugin-vs-notes.md).

Subjects: agent-workflows, anthropic, claude

Keep your own full history and replay it when Claude API message threads can no longer continue ([Anthropic’s thread contract](https://platform.claude.com/docs/en/build-with-claude/message-threads)).

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](https://platform.claude.com/docs/en/build-with-claude/message-threads)).

## 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](https://platform.claude.com/docs/en/build-with-claude/message-threads), 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](https://claude.com/resources/articles/message-threads) 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](https://platform.claude.com/docs/en/build-with-claude/message-threads)).

## Claude-Mem: separate opt-out fix and [open lifecycle checks](https://github.com/thedotmack/claude-mem/issues/5346)

[thedotmack’s November 3 issue #5346](https://github.com/thedotmack/claude-mem/issues/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](https://github.com/thedotmack/claude-mem/issues/5346) remains **open** for live lifecycle checks; [PR #5348](https://github.com/thedotmack/claude-mem/pull/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](https://github.com/thedotmack/claude-mem/releases/tag/v15.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](https://github.com/thedotmack/claude-mem/issues/5346)).

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](https://github.com/thedotmack/claude-mem/issues/5346)). Temporary API history is not durable agent memory; request size is not token savings ([Anthropic](https://claude.com/resources/articles/message-threads)).

Not for: durable cross-session memory; see [cross-session-memory-plugin-vs-notes](/t/cross-session-memory-plugin-vs-notes).

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.