failure-mode-capture

failure-mode-capture is a skill for Claude Code, Codex from sjarmak/coding-agent-workflows. It costs 92 tokens per session (943 once invoked), scanned A, original, MIT.

A workflow for recording lessons from bugs or near-misses in AGENTS.md, a file that gives coding agents project instructions.

In plain words
What is it for?
Use it after a bug, regression, near-miss, or code review when a reusable prevention should be added to the project’s instructions.
Why use it?
It helps prevent an agent from repeating a known mistake and avoids adding duplicate or overly specific rules.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Good fit Use it after a bug, regression, near-miss, or code review when a reusable prevention should be added to the project’s instructions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sjarmak/coding-agent-workflows/failure-mode-capture
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 sjarmak/coding-agent-workflows --skill failure-mode-capture
Clone the repo
git clone --depth 1 https://github.com/sjarmak/coding-agent-workflows

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 failure-mode-capture

README.md
[![agentmods](https://agentmods.dev/badge/skills/sjarmak/coding-agent-workflows/failure-mode-capture/github.svg)](https://agentmods.dev/skills/sjarmak/coding-agent-workflows/failure-mode-capture)
Your own site
<a href="https://agentmods.dev/skills/sjarmak/coding-agent-workflows/failure-mode-capture"><img src="https://agentmods.dev/badge/skills/sjarmak/coding-agent-workflows/failure-mode-capture/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 failure-mode-capture

Your own site · 80×15
<a href="https://agentmods.dev/skills/sjarmak/coding-agent-workflows/failure-mode-capture"><img src="https://agentmods.dev/badge/skills/sjarmak/coding-agent-workflows/failure-mode-capture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 943 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.00092 $0.00943
Opus 5.5 $0.00037 $0.00377
Sonnet 5.5 $0.00018 $0.00189
Haiku 4.5 $0.00009 $0.00094

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

Security

Grade A, and why

failure-mode-capture 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 3mo 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.

source/skills/failure-mode-capture/SKILL.md · 85 lines

How it starts

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

Failure-Mode Capture

Turn a real incident into a one-line prevention in AGENTS.md, so the next agent doesn't repeat it. This is how the failure-mode layer accumulates — deliberately, one verified lesson at a time, not by dumping everything that ever went wrong.

Read context-layering first: AGENTS.md owns project-wide preventions; area-only lessons go in that area's COMPASS.md; host/session habits stay in memory.

When to use

  • Right after a bug, regression, or near-miss whose cause generalizes
  • The user says "capture this" / "don't let this happen again" / "add a guardrail"
  • A code review surfaces a repeated mistake worth encoding once

ZFC boundary

  • Mechanism: read AGENTS.md and the memory files, run the similarity scan, count lines against the budget, write the entry.
  • Model: decide whether the lesson generalizes, which layer it belongs in, whether it duplicates an existing entry, and how to phrase the prevention.

How it works

1. Phrase the prevention (model)

One line: the action to avoid, then the consequence it prevents. Concrete and checkable.

Don't run migrations against the read replica — it has no write grant and fails silently mid-batch.

If you can't name a concrete consequence, it's not a failure-mode prevention — it's a style preference, and belongs in the bundle or a code review, not here.

2. Decide the layer (model)

  • Generalizes across the repo → AGENTS.md failure-mode log.
  • Specific to one area → that area's COMPASS.md "Failure modes seen here".
  • A local command or personal habit → memory, not here.

3. Dedup guard against memory (mechanism + model)

First, if CLAUDE.md is a symlink to AGENTS.md (a single-source project per context-layering), there is no separate memory layer — the dedup is moot and you simply append to the one file. Otherwise, scan CLAUDE.md and any instinct store for an overlapping fact (mechanical similarity flag over the candidate text). If a match surfaces:

Read the full file on GitHub · 85 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. 3mo ago First seen · 85 lines · 92 tokens per session scan A c5dfd56938cf

Subscribe to this mod's changes

failure-mode-capture is a skill published in the GitHub repository sjarmak/coding-agent-workflows (7 stars, last pushed 2d ago), licensed MIT. It adds 92 tokens to every session and 943 once invoked, about $0.0004 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-08-31.

Related

failure-mode-capture compared with skills from other repositories

failure-mode-capture next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
failure-mode-capturesjarmak/coding-agent-workflowsSkill72d agoMITA92Claude Code, Codex
cloud-operator-share-contextgoogle/skillsSkill25ktodayApache-2.0A140Claude Code, Codex
bopomofo-rescuemxyhi/ok-skillsSkill5189d agoApache-2.0A332Claude Code
braincoco-research/cocoSkill323yesterdayApache-2.0A53Claude Code, Codex
context-window-engineerroedyrustam/vibes-plugSkill1293d agoMITA38Cursor
route-lessonstobihagemann/turboSkill428yesterdayMITB41Claude Code
neural-memoryRune-kit/runeSkill96yesterdayMITA54Claude Code