resilience-patterns

resilience-patterns is a skill for Claude Code from claude-dev-suite/claude-dev-suite. It costs 113 tokens per session (1,159 once invoked), scanned A, original, MIT.

A collection of patterns for keeping applications working when services fail or respond slowly. It includes retries, time limits, circuit breakers, fallbacks, health checks, and bulkheads, which isolate failures between parts of a system.

In plain words
What is it for?
Use it when building APIs, background jobs, or distributed applications that call unreliable services.
Why use it?
It reduces outages and long waits caused by temporary network errors, overloaded services, or unavailable dependencies.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it when building APIs, background jobs, or distributed applications that call unreliable services.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/claude-dev-suite/claude-dev-suite/resilience-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add claude-dev-suite/claude-dev-suite --skill resilience-patterns
Clone the repo
git clone --depth 1 https://github.com/claude-dev-suite/claude-dev-suite

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for resilience-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/claude-dev-suite/claude-dev-suite/resilience-patterns/github.svg)](https://agentmods.dev/skills/claude-dev-suite/claude-dev-suite/resilience-patterns)
Your own site
<a href="https://agentmods.dev/skills/claude-dev-suite/claude-dev-suite/resilience-patterns"><img src="https://agentmods.dev/badge/skills/claude-dev-suite/claude-dev-suite/resilience-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for resilience-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/claude-dev-suite/claude-dev-suite/resilience-patterns"><img src="https://agentmods.dev/badge/skills/claude-dev-suite/claude-dev-suite/resilience-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,159 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00113 $0.01159
Opus 5.5 $0.00045 $0.00464
Sonnet 5.5 $0.00023 $0.00232
Haiku 4.5 $0.00011 $0.00116

Measured 1mo ago against content hash f13e465ef25a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

resilience-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/best-practices/resilience-patterns/SKILL.md · 171 lines

How it starts

The opening of the file, as written. The whole thing — 171 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Resilience Patterns

Retry with Exponential Backoff

async function withRetry<T>(
  fn: () => Promise<T>,
  maxRetries = 3,
  baseDelay = 1000,
): Promise<T> {
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    try {
      return await fn();
    } catch (error) {
      if (attempt === maxRetries) throw error;
      if (!isRetryable(error)) throw error;
      const delay = baseDelay * Math.pow(2, attempt) + Math.random() * 1000;
      await new Promise((r) => setTimeout(r, delay));
    }
  }
  throw new Error('Unreachable');
}

function isRetryable(error: unknown): boolean {
  if (error instanceof Error && 'status' in error) {
    const status = (error as { status: number }).status;
    return status === 429 || status >= 500;
  }
  return true;
}

Circuit Breaker

class CircuitBreaker {
  private failures = 0;
  private lastFailure = 0;
  private state: 'closed' | 'open' | 'half-open' = 'closed';

  constructor(
    private threshold = 5,
    private resetTimeout = 30000,
  ) {}

  async execute<T>(fn: () => Promise<T>, fallback?: () => T): Promise<T> {
    if (this.state === 'open') {
      if (Date.now() - this.lastFailure > this.resetTimeout) {
        this.state = 'half-open';
      } else {
        if (fallback) return fallback();
        throw new Error('Circuit breaker is open');
      }
    }

    try {
      const result = await fn();
      this.onSuccess();
      return result;
    } catch (error) {
      this.onFailure();
      if (fallback) return fallback();
      throw error;
    }
  }

  private onSuccess() { this.failures = 0; this.state = 'closed'; }
  private onFailure() {
    this.failures++;
    this.lastFailure = Date.now();
    if (this.failures >= this.threshold) this.state = 'open';
  }
}

// Usage
const breaker = new CircuitBreaker(5, 30000);
const result = await breaker.execute(
  () => externalApi.call(),
  () => cachedResult, // fallback
);

resilience4j (Java/Spring)

@CircuitBreaker(name = "paymentService", fallbackMethod = "paymentFallback")
@Retry(name = "paymentService")
@TimeLimiter(name = "paymentService")
public CompletableFuture<Payment> processPayment(Order order) {
    return CompletableFuture.supplyAsync(() -> paymentClient.charge(order));
}

public CompletableFuture<Payment> paymentFallback(Order order, Throwable t) {
    return CompletableFuture.completedFuture(Payment.pending(order.getId()));
}

Read the full file on GitHub · 171 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 171 lines · 113 tokens per session scan A f13e465ef25a

Subscribe to this mod's changes

resilience-patterns is a skill published in the GitHub repository claude-dev-suite/claude-dev-suite (42 stars, last pushed 5d ago), licensed MIT. It adds 113 tokens to every session and 1,159 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.