Study FAQ
How do I continue a Claude API response with pause_turn?
Also asked as 2
- What should my Claude API loop send after a server-tool turn pauses?
- How should I preserve state when continuing a paused Claude server-tool response?
Answer
For a Claude Messages API response with stop_reason: "pause_turn", preserve the earlier messages and append the returned content unchanged as an assistant message. Send another request with the same tools and no new user message after that assistant message. If the response includes a container, send its ID back to preserve the files used by that turn.
pause_turn means the server-tool loop paused at its iteration limit. It does not ask your application to execute a client tool or fabricate a result. A client-tool request instead uses stop_reason: "tool_use" and needs the corresponding client tool_result blocks before continuation.
A continued response can pause again. Retain every paused response in order: each continuation contains only the next part of the turn. Apply an application-defined continuation limit and deadline. If either expires while the response is still paused, retain the partial work and report the unresolved outcome. Once another stop reason arrives, handle that reason and check the task’s acceptance criteria.
Full explanation
Design and implement agentic loops for autonomous task execution
Learning material · CCAR-F
Read the full explanation