Study FAQ
Which failures should a Claude workflow retry, repair, or escalate?
Also asked as 2
- When is it safe to retry a failed Claude API request?
- How should I distinguish transient Claude errors from validation or downstream failures?
Answer
Retry a plausibly temporary failure only within a finite attempt and elapsed-time budget. On the first-party Claude API, an overload (529) or retryable rate limit (429) can warrant backoff. Fix invalid input or request configuration before another attempt, route a failed evidence or policy check to repair or review, and resolve any uncertain downstream write before trying it again.
Inspect the error type and documented retry headers. When applicable, honor x-should-retry and retry-after. A 429 caused by a spend cap requires restored access, so repeated requests will keep failing until the cap condition changes. Account for SDK retries inside the overall budget. Log a stable application request ID across attempts, each API request ID when available, and the error or validation outcome.
For a failed client tool, send the matching tool_result with is_error: true so Claude can adjust its next decision, then apply the application’s recovery rules. A timeout after a write was sent leaves the outcome uncertain. Look up the downstream record using the stable operation identifier and reuse the application’s idempotency key only when the recovery policy permits another attempt.
Full explanation
Structured Outputs, Validation, Retry, and Batch Patterns
Study guide · CCAR-F
Read the full explanation