Skip to content
Skills Library
AI & agents · Building & coding

clade-reliability-patterns

/clade-reliability-patterns

Build fault-tolerant Claude integrations \u2014 retries, circuit breakers,\n\ Use when working with reliability-patterns patterns.\nfallbacks, timeouts, and graceful\ \ degradation.\nTrigger with \"anthropic reliability\", \"claude fault tolerance\"\ ,\n\"anthropic circuit breaker\", \"claude fallback\".\n

Licence
MIT
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Build fault-tolerant Claude integrations \u2014 retries, circuit breakers,\n\ Use when working with reliability-patterns patterns.\nfallbacks, timeouts, and graceful\ \ degradation.\nTrigger with \"anthropic reliability\", \"claude fault tolerance\"\ ,\n\"anthropic circuit breaker\", \"claude fallback\".\n

Triggers from the description

anthropic reliability\claude fault tolerance\anthropic circuit breaker\claude fallback\
Original author description

Build fault-tolerant Claude integrations \u2014 retries, circuit breakers,\n\ Use when working with reliability-patterns patterns.\nfallbacks, timeouts, and graceful\ \ degradation.\nTrigger with \"anthropic reliability\", \"claude fault tolerance\"\ ,\n\"anthropic circuit breaker\", \"claude fallback\".\n

How it works

  1. Overview
  2. Built-In SDK Retries
  3. Model Fallback Chain
  4. Circuit Breaker
  5. Graceful Degradation
  6. Timeout Handling
  7. Output
  8. Error Handling
  9. Examples
  10. Resources
Original SKILL.md headings · 145 lines, 495 words
SKILL.md preview
---
name: clade-reliability-patterns
description: "Build fault-tolerant Claude integrations \u2014 retries, circuit breakers,\n\
  Use when working with reliability-patterns patterns.\nfallbacks, timeouts, and graceful\
  \ degradation.\nTrigger with \"anthropic reliability\", \"claude fault tolerance\"\
  ,\n\"anthropic circuit breaker\", \"claude fallback\".\n"
allowed-tools: Read, Write, Edit
version: 1.1.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:

```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 unavailable');
    }

    try {
      const result = await client.messages.create(params);
      this.failures = 0;
      return result;
    } catch (err) {
      if (err instanceof Anthropic.APIError && err.status >= 500) {
        this.failures++;
        this.lastFailure = Date.now();
      }
      throw err;
    }
  }
}
```

## Graceful Degradation

```typescript
async function getResponse(userInput: string): Promise<string> {
  try {
    const message = await client.messages.create({
      model: 'claude-sonnet-4-20250514',
      max_tokens: 1024,
      messages: [{ role: 'user', content: userInput }],
    });
    return message.content[0].text;
  } catch (err) {
    // Return cached/static response instead of failing
    console.error('Claude unavailable, using fallback');
    return "I'm temporarily unable to process your request. Please try again shortly.";
  }
}
```

## Timeout Handling

```typescript
const client = new Anthropic({
  timeout: 30_000, // 30s for most requests
});

// Override per-request for long-running tasks
const message = await client.messages.create(params, {
  timeout: 120_000, // 2 minutes for complex prompts
});
```

## Output

- SDK configured with appropriate `maxRetries` and `timeout`
- Model fallback chain automatically trying cheaper models on failure
- Circuit breaker preventing cascading failures during outages
- Graceful degradation returning static responses when Claude is unavailable

## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| API Error | Check error type and status code | See `clade-common-errors` |

## Examples

See Built-In SDK Retries, Model Fallback Chain, Circuit Breaker class, Graceful Degradation handler, and Timeout Handling above.

## Resources

- [Error Types](https://platform.claude.com/docs/en/api/errors)
- SDK Retries

## Next Steps

See `clade-policy-guardrails` for content safety patterns.

## Prerequisites

- Completed `clade-install-auth`
- Production Claude integration requiring high availability
- Understanding of fault tolerance patterns (retries, circuit breakers)

## Instructions

### Step 1: Review the patterns below

Each section contains production-ready code examples. Copy and adapt them to your use case.

### Step 2: Apply to your codebase

Integrate the patterns that match your requirements. Test each change individually.

### Step 3: Verify

Run your test suite to confirm the integration works correctly.
Files in this package (2)
  • SKILL.md 4 KB
  • references/one-pager.md 2 KB

Versions

The database has no other skills named clade-reliability-patterns.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 75b0c9375895 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100customerio-reliability-patterns
    Implement Customer.io reliability and fault-tolerance patterns. Use when building circuit breakers, fallback queues, idempotency, or graceful degradation for Customer.io integrations. Trigger: "customer.io reliability", "customer.io resilience", "customer.io circuit breaker",…
  • 100exa-reliability-patterns
    Implement Exa reliability patterns including circuit breakers, idempotency, and graceful degradation. Use when building fault-tolerant Exa integrations, implementing retry strategies, or adding resilience to production Exa services. Trigger with phrases like "exa reliability",…
  • 100vercel-reliability-patterns
    Implement reliability patterns for Vercel deployments including circuit breakers, retry logic, and graceful degradation. Use when building fault-tolerant serverless functions, implementing retry strategies, or adding resilience to production Vercel services. Trigger with phrases…
  • 100clay-reliability-patterns
    Implement Clay reliability patterns including circuit breakers, idempotency, and graceful degradation. Use when building fault-tolerant Clay integrations, implementing retry strategies, or adding resilience to production Clay services. Trigger with phrases like "clay…
  • 100reliability
    This skill should be used when designing, planning, implementing, or reviewing any non-trivial change, or when the user asks to "add retries", "add error handling", "add circuit breaker", "handle failures" — enforces graceful degradation, proper error handling, retry strategies,…
  • 100resilience-patterns
    Build fault-tolerant systems with circuit breakers, retries with backoff, bulkheads, timeouts, and graceful degradation. Covers distributed system failure modes and recovery strategies. Triggers on reliability engineering, fault tolerance, or distributed system resilience requests.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.