pause_turn and server-side tools
Server-side tools run their own sampling loop. When it hits its limit you get a pause, not an error.
3 min read · Lesson 2 of 12 in this domain
Server-side tools such as web search run their own loop inside a single API call — Claude searches, reads, searches again, all before you get a response. That inner loop has an iteration cap so a runaway search cannot spin forever on Anthropic's side. When it hits the cap the response comes back mid-thought, and the signal for that is pause_turn. It is not an error and nothing has gone wrong; the work is simply incomplete and the server is offering to carry on.
- Server-side tools (web search, web fetch, code execution) run on Anthropic infrastructure — you declare them and results arrive as content blocks in the same response.
- That server-side loop has a default iteration limit. Reaching it returns
stop_reason: "pause_turn". - To resume: re-send the user message plus the paused assistant response. The server detects the trailing server-tool block and continues.
- Do not append a "Continue." user message — it is unnecessary and pollutes the conversation.
- Set a
max_continuationsceiling (e.g. 5) so a pathological turn cannot loop forever. - Note the SDK tool runners do not auto-resume a pause — a paused turn ends the runner and is returned as the final message, silently truncated.
if response.stop_reason == "pause_turn":
messages = [
{"role": "user", "content": user_query},
{"role": "assistant", "content": response.content},
]
response = client.messages.create(
model="claude-opus-5", messages=messages, tools=tools
)
"Restart from scratch" and "increase max_tokens" both look reasonable. Restarting discards completed server-side work; max_tokens exhaustion is a different stop reason entirely.
stop_reason is pause_turn. What does it mean?
pause_turn is not a failure. Re-send the conversation including the paused assistant turn and the server continues.
How do you resume a paused turn?
The API detects the trailing server-tool block and resumes on its own. An extra 'Continue.' turn is explicitly unnecessary.
Practise this domain with 27%%-weighted questions in the study app.
Open in study appSource: Claude Docs — Handling stop reasons · Independent study aid, not affiliated with or endorsed by Anthropic.