Skip to content

Claude message threads let agent loops skip re-sending history

A new beta parameter on the Messages API keeps a conversation server-side, so each turn in a long agent loop sends only what changed.

Source: Anthropic

Anthropic launched message threads in beta for the Messages API on 2 November. Add "thread": {"type": "create"} to a normal request and the API stores that conversation, including Claude’s reply, under the response id. Every later turn sends only the new messages plus "thread": {"type": "continue", "previous_message_id": "<id>"}, instead of re-uploading and re-tokenising the whole exchange.

{
  "thread": { "type": "continue", "previous_message_id": "msg_01ABC" }
}

A thread is best-effort: it expires five minutes after its last request and is deleted within an hour of last use. A continue call after that returns a 404, so the app has to replay the full conversation into a new create request, which the SDK’s thread helper (Python, TypeScript, Go, Java, PHP, Ruby, C#) does automatically. The beta header is message-threads-2026-08-12. It works across the Claude API, Claude on AWS, Claude on Google Cloud and Microsoft Foundry, but it is not eligible for zero-data-retention, since contents sit encrypted in memory rather than nowhere at all.

Why it matters: in a long agent loop, every turn has normally meant re-sending and re-validating the entire history, so time to first token grows with the conversation. Threads keep that cost flat. The catch is threads are not storage: your application still has to keep its own copy of the conversation to survive a restart or an expired thread.

Share

Related reading

More from The Wire

All briefs