clade-reliability-patterns

Featured

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".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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: ```typescript const client = new Anthropic({ maxRetries: 3, // default: 2 timeout: 120_000, // 2 minutes }); ``` ## Model Fallback Chain ```typescript 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; } throw err; // Don't retry client errors (4xx) } } throw new Error('All models failed'); } ``` ## Circuit Breaker ```typescript class ClaudeCircuitBreaker { private failures = 0; private lastFailure = 0; private readonly threshold = 5; private readonly resetMs = 60_000; async call(params: Anthropic.MessageCreateParams) { if (this.failures >= this.threshold && Date.now() - this.lastFailure < this.resetMs) { throw new Error('Circuit open — Claude API unavaila...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category