prevent-recurrence

prevent-recurrence is a skill for Claude Code from closedloop-ai/claude-plugins. It costs 116 tokens per session (2,003 once invoked), scanned A, original, Apache-2.0.

A bug-fixing procedure for mistakes or repeated error patterns that fixes the current problem and adds checks to help prevent the same class of mistake from returning.

In plain words
What is it for?
It is for investigating repeated agent mistakes, addressing accepted code-review findings, reproducing bugs, and adding a test or other guard where practical.
Why use it?
Fixing one bug alone may leave the underlying pattern in place, allowing the same failure to happen again.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Part of the closedloop-core plugin — 10 skills shipped together

Good fit It is for investigating repeated agent mistakes, addressing accepted code-review findings, reproducing bugs, and adding a test or other guard where practical.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/closedloop-ai/claude-plugins/prevent-recurrence
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 closedloop-ai/claude-plugins --skill prevent-recurrence
Clone the repo
git clone --depth 1 https://github.com/closedloop-ai/claude-plugins

Made for: Claude Code.

Or install closedloop-core, the plugin that ships this one along with the rest of its 10 skills.

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 prevent-recurrence

README.md
[![agentmods](https://agentmods.dev/badge/skills/closedloop-ai/claude-plugins/prevent-recurrence/github.svg)](https://agentmods.dev/skills/closedloop-ai/claude-plugins/prevent-recurrence)
Your own site
<a href="https://agentmods.dev/skills/closedloop-ai/claude-plugins/prevent-recurrence"><img src="https://agentmods.dev/badge/skills/closedloop-ai/claude-plugins/prevent-recurrence/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 prevent-recurrence

Your own site · 80×15
<a href="https://agentmods.dev/skills/closedloop-ai/claude-plugins/prevent-recurrence"><img src="https://agentmods.dev/badge/skills/closedloop-ai/claude-plugins/prevent-recurrence.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 116 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,003 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.
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.00116 $0.02003
Opus 5.5 $0.00046 $0.00801
Sonnet 5.5 $0.00023 $0.00401
Haiku 4.5 $0.00012 $0.00200

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

Security

Grade A, and why

prevent-recurrence 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 4d 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.

plugins/closedloop-core/skills/prevent-recurrence/SKILL.md · 149 lines

How it starts

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

Prevent Recurrence

A fixed instance is not a fixed mistake. Use this procedure whenever a bug or an accepted review finding was caused by an agent's mistake, or by a pattern agents keep repeating, so the same class of mistake cannot come back unnoticed. It works in any repository and any workflow; it assumes nothing about the repository beyond what you find in step 3.

Skip it for ordinary feature work, rejected review findings, and failures with no mistake behind them (an outage, a flaky runner) unless they expose a missing guard.

1. Fix the instance

  1. Reproduce the failure. Where a test is practical, write one at the observable surface (public function, route, CLI, rendered output) that fails on the current code, then fix the code and watch it pass. If no test is practical (prose, config, a one-off migration), say why in the closeout.
  2. Write the mistake as a class in one sentence: "did X when Y, causing Z". The class sentence, not the instance, drives the rest of this procedure.

2. Find the class

  1. Search the codebase for the same shape: the same call, import, literal, pattern, or missing pairing; parallel implementations of the same behavior (a twin path for retries, recovery, another platform, another plugin); and code written from the same template. Use text search plus any code-intelligence tool the session has (callers, importers, symbol search).
  2. Fix the other instances in the same change when they are small and in the same area. Otherwise list each one with its path for the follow-up in step 6.
  3. Keep the search commands. They go in the closeout so a reviewer can rerun them, and a search that found every instance with few false positives is often the start of a static check in step 4.

3. Learn the repository's own mechanisms

Find what exists before choosing a prevention; never assume a mechanism.

  • Read the root and nearest AGENTS.md and CLAUDE.md (or equivalent) files for the changed paths, plus contributing and testing docs. Note any rule that already covers this mistake; if one exists, step 5 applies.
  • Find the lint configuration and any custom rules, source-gate or policy scripts, allowlists and baselines, and what CI actually runs (workflow files, package scripts, Makefile, justfile).
  • Learn the test conventions: where tests live, how they are named, and whether guard or contract tests already exist (tests that scan source files or iterate a registry are the usual home for a new guard).
  • Read review checklists, PR templates, and review prompt packs if the repository has them. If a review already classified the finding's prevention (for example a workflow-code-review automation status), start from that classification and verify it against what you found.

Read the full file on GitHub · 149 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 149 lines · 116 tokens per session scan A f5a14bb74db1

Subscribe to this mod's changes

prevent-recurrence is a skill published in the GitHub repository closedloop-ai/claude-plugins (122 stars, last pushed today), licensed Apache-2.0. It adds 116 tokens to every session and 2,003 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-10-10.

Related

Other skills, from other repositories