Claude

Claude API adds message threads in beta for long conversations

Published · By Editorial team promptdonuts.com

Anthropic added message threads to the Messages API as a beta. The API keeps the conversation on the server, so after the first call each request sends only the new messages. Anthropic says this gives smaller requests and a lower time to first token in long conversations and agent loops. You turn it on with the beta header message-threads-2026-08-12. A thread expires 5 minutes after its last request, and it is deleted no more than 1 hour after its last use. It is available on the Claude API, Claude Platform on AWS, Claude Models on Google Cloud and Claude in Microsoft Foundry.

Why it matters: If you build agents or long chats on Claude, your system prompt and early turns no longer travel with every call, so keep them stable and put new instructions in the new message. Plan for the 5 minute expiry: if a thread may sit idle, be ready to resend the full history.

Try this

Claude

Plan a Claude thread-based agent loop

I am building an agent loop on the Claude Messages API that will use message threads, where the server keeps the conversation and each request sends only new messages. My task: [TASK DESCRIPTION]. Expected number of turns: [NUMBER OF TURNS]. Typical pause between turns: [PAUSE LENGTH]. Do three things: 1. Split my instructions into a stable system prompt and short per-turn messages. 2. Write the first message and two example follow-up messages that only add new information. 3. List what my code must do when a thread has expired after sitting idle, so it can rebuild the conversation.

Sources: Anthropic: Claude Platform release notes

Guide: Prompt engineering: how it works, with prompts to copy

MORE AI NEWS

ALL NEWS