circuit-breaker

circuit-breaker is a skill for Claude Code, Codex from vibeeval/vibecosystem. It costs 51 tokens per session (2,096 once invoked), scanned B, original, MIT.

A circuit-breaker pattern for software agents that stops repeatedly failing work, waits for a cooldown period, and then tests whether the agent can recover.

In plain words
What is it for?
Use it to define failure thresholds, cooldowns, recovery tests, fallback behavior, and agent state transitions.
Why use it?
It prevents endless retry loops, cascading failures, and wasted computation when the same task keeps failing.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths.

Good fit Use it to define failure thresholds, cooldowns, recovery tests, fallback behavior, and agent state transitions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vibeeval/vibecosystem/circuit-breaker
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 vibeeval/vibecosystem --skill circuit-breaker
Clone the repo
git clone --depth 1 https://github.com/vibeeval/vibecosystem

Made for: Claude Code, Codex.

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 circuit-breaker

README.md
[![agentmods](https://agentmods.dev/badge/skills/vibeeval/vibecosystem/circuit-breaker/github.svg)](https://agentmods.dev/skills/vibeeval/vibecosystem/circuit-breaker)
Your own site
<a href="https://agentmods.dev/skills/vibeeval/vibecosystem/circuit-breaker"><img src="https://agentmods.dev/badge/skills/vibeeval/vibecosystem/circuit-breaker/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 circuit-breaker

Your own site · 80×15
<a href="https://agentmods.dev/skills/vibeeval/vibecosystem/circuit-breaker"><img src="https://agentmods.dev/badge/skills/vibeeval/vibecosystem/circuit-breaker.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,096 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Agent Snooping · line 195
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
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.00051 $0.02096
Opus 5 $0.00026 $0.01048
Sonnet 5 $0.00010 $0.00419
Haiku 4.5 $0.00005 $0.00210

Measured 5d ago against content hash 2b8ce0663141, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

circuit-breaker scanned grade B with 1 finding 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 5d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat ~/.claude/canavar/skill-matrix.json | \
skills/circuit-breaker/SKILL.md · 258 lines

How it starts

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

Circuit Breaker for Agents

Agent'lar da servisler gibi basarisiz olabilir. Ayni hatayi tekrar tekrar denemek token israf eder ve sorunu cozmez. Circuit breaker bunu onler.

3 Durum

CLOSED (Normal)
  Agent calisir, hatalar sayilir.
  Hata esigi asilirsa → OPEN'a gec.

OPEN (Devre Kesik)
  Agent CALISTIRILMAZ.
  Cooldown suresi boyunca bekle.
  Cooldown bitince → HALF-OPEN'a gec.

HALF-OPEN (Test)
  Tek bir istek gonder.
  Basarili → CLOSED'a don.
  Basarisiz → OPEN'a geri don (cooldown uzat).
     basarili          hata esigi
  ┌──────────┐      ┌───────────┐
  │          │      │           │
  ▼          │      ▼           │
CLOSED ──────┼── OPEN ────── HALF-OPEN
  ▲          │      │           │
  │          │      │           │
  └──────────┘      └───────────┘
     normal          cooldown bitti

Konfigrasyon

interface CircuitBreakerConfig {
  failureThreshold: number    // Kac hata sonrasi OPEN (default: 3)
  cooldownMs: number          // OPEN'da bekleme suresi (default: 60000 = 1 dk)
  halfOpenMaxAttempts: number // HALF-OPEN'da max deneme (default: 1)
  resetAfterMs: number        // Hata sayacini sifirla (default: 300000 = 5 dk)
  onOpen?: () => void         // OPEN'a gecince cagrilir
  onClose?: () => void        // CLOSED'a donunce cagrilir
}

const DEFAULT_CONFIG: CircuitBreakerConfig = {
  failureThreshold: 3,
  cooldownMs: 60000,
  halfOpenMaxAttempts: 1,
  resetAfterMs: 300000,
}

Uygulama

Agent Seviyesinde

class AgentCircuitBreaker {
  private state: 'CLOSED' | 'OPEN' | 'HALF-OPEN' = 'CLOSED'
  private failures = 0
  private lastFailureTime = 0
  private config: CircuitBreakerConfig

  constructor(private agentName: string, config?: Partial<CircuitBreakerConfig>) {
    this.config = { ...DEFAULT_CONFIG, ...config }
  }

  canExecute(): boolean {
    if (this.state === 'CLOSED') return true

    if (this.state === 'OPEN') {
      const elapsed = Date.now() - this.lastFailureTime
      if (elapsed >= this.config.cooldownMs) {
        this.state = 'HALF-OPEN'
        return true
      }
      return false
    }

    // HALF-OPEN: tek denemeye izin ver
    return true
  }

  recordSuccess(): void {
    this.failures = 0
    if (this.state === 'HALF-OPEN') {
      this.state = 'CLOSED'
      this.config.onClose?.()
    }
  }

  recordFailure(): void {
    this.failures++
    this.lastFailureTime = Date.now()

    if (this.state === 'HALF-OPEN') {
      this.state = 'OPEN'
      return
    }

    if (this.failures >= this.config.failureThreshold) {
      this.state = 'OPEN'
      this.config.onOpen?.()
    }
  }

  getStatus(): { state: string; failures: number; agent: string } {
    return { state: this.state, failures: this.failures, agent: this.agentName }
  }
}

Read the full file on GitHub · 258 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. 5d ago First seen · 258 lines · 51 tokens per session scan B 2b8ce0663141

Subscribe to this mod's changes

circuit-breaker is a skill published in the GitHub repository vibeeval/vibecosystem (529 stars, last pushed 1mo ago), licensed MIT. It adds 51 tokens to every session and 2,096 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.