| name | clade-reliability-patterns |
| description | Build fault-tolerant Claude integrations — retries, circuit breakers,
Use when working with reliability-patterns patterns.
fallbacks, timeouts, and graceful degradation.
Trigger with "anthropic reliability", "claude fault tolerance",
"anthropic circuit breaker", "claude fallback".
|
| allowed-tools | Read, Write, Edit |
| version | 1.0.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","anthropic","claude","reliability","resilience"] |
| compatibility | Designed for Claude Code |
Anthropic Reliability Patterns
Overview
Build fault-tolerant Claude integrations with built-in SDK retries, model fallback chains (Sonnet → Haiku), circuit breakers to avoid hammering a failing API, graceful degradation with cached/static responses, and per-request timeout configuration.
Built-In SDK Retries
The SDK retries 429 (rate limit) and 529 (overloaded) automatically:
const client = new Anthropic({
maxRetries: 3,
timeout: 120_000,
});
Model Fallback Chain
const FALLBACK_CHAIN = ['claude-sonnet-4-20250514', 'claude-haiku-4-5-20251001'];
async function callWithFallback(params: Anthropic.MessageCreateParams) {
for (const model of FALLBACK_CHAIN) {
try {
return await client.messages.create({ ...params, model });
} catch (err) {
if (err instanceof Anthropic.APIError && err.status >= 500) {
console.warn(`${model} failed (${err.status}), trying next...`);
continue;
}
err;
}
}
();
}