learn-from-failure

learn-from-failure is a skill for Claude Code, Codex from wrg32786/aigent-os. It costs 0 tokens per session (781 once invoked), scanned A, original, MIT.

A failure-analysis workflow that turns a development or operations failure into a reusable record. It classifies the failure, checks whether it has happened before, and creates an artifact to help prevent repetition.

In plain words
What is it for?
Use it after failures to record the cause, compare it with known failure patterns, and create a preventive checklist or other durable guidance.
Why use it?
It reduces repeated mistakes by preserving what went wrong and how to recognize it next time. It can distinguish problems caused by routing, verification, tools, knowledge, or authority.

Skill for Claude CodeCodex

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

Good fit Use it after failures to record the cause, compare it with known failure patterns, and create a preventive checklist or other durable guidance.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wrg32786/aigent-os/learn-from-failure
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 wrg32786/aigent-os --skill learn-from-failure
Clone the repo
git clone --depth 1 https://github.com/wrg32786/aigent-os

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 learn-from-failure

README.md
[![agentmods](https://agentmods.dev/badge/skills/wrg32786/aigent-os/learn-from-failure/github.svg)](https://agentmods.dev/skills/wrg32786/aigent-os/learn-from-failure)
Your own site
<a href="https://agentmods.dev/skills/wrg32786/aigent-os/learn-from-failure"><img src="https://agentmods.dev/badge/skills/wrg32786/aigent-os/learn-from-failure/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 learn-from-failure

Your own site · 80×15
<a href="https://agentmods.dev/skills/wrg32786/aigent-os/learn-from-failure"><img src="https://agentmods.dev/badge/skills/wrg32786/aigent-os/learn-from-failure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 781 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

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 →

  • medium Excessive Agency · line 22
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.00000 $0.00781
Opus 5 $0.00000 $0.00391
Sonnet 5 $0.00000 $0.00156
Haiku 4.5 $0.00000 $0.00078

Measured 7d ago against content hash 78451ac18e14, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

learn-from-failure 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 7d 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/learn-from-failure/SKILL.md · 82 lines

How it starts

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

/learn-from-failure — Convert failure to reusable artifact

When a failure occurs, classify it, check for repetition, and produce a durable artifact that prevents recurrence.

Trigger

/learn-from-failure or /learn-from-failure <failure description>

Caddy auto-surfaces on: "same issue", "happened again", "recurring", "third time", "keeps happening"

Flow

1. Identify failure

  • If argument provided: use it
  • If no argument: ask "What failed?"

2. Classify failure mode

Mode Description Example
routing Task sent to wrong agent/model/tool Opus used for a read-only task
verification Output accepted without checking data flow Video "looked fine" but spec was wrong
tool Tool unavailable, broken API, wrong usage Gmail MCP auth expired
knowledge Agent lacked domain knowledge Didn't know SDK v6 changed type strings
authority Agent acted outside delegation zone the AIgent made a Level 3 decision

3. Check for repetition

Read $AIGENT_VAULT/memory/FAILURE_MODES.md. Search for Pattern lines matching the current failure's root cause.

  • 0-1 prior occurrences: Phase 1 — log and monitor
  • 2+ occurrences: Phase 2 — mandatory artifact. A log entry is not enough.
  • 3+ occurrences: The prior artifact failed. Diagnose why and fix or replace it.

4. Log to FAILURE_MODES.md

Append a new entry following the existing format:

## {YYYY-MM-DD} — {short symptom name}

**Symptom:** {what went wrong, user-visible}
**Verified cause:** {exact mechanism}
**Fix:** {what was done}
**Layer:** {which system layer}
**Pattern:** {one-line category — this is the load-bearing piece for repetition detection}

5. Determine artifact type

Failure mode Artifact Target
routing Caddy trigger or hook .claude/hooks/ or .claude/skill-index.json
verification Checklist item in doctrine Relevant doctrine note
tool SKILL_GAPS entry + skill spec memory/SKILL_GAPS.md
knowledge Vault note or memory candidate concepts/ or memory/
authority Flag to the operator aigent_authority_matrix.md

Read the full file on GitHub · 82 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. 7d ago First seen · 82 lines · 0 tokens per session scan A 78451ac18e14

Subscribe to this mod's changes

learn-from-failure is a skill published in the GitHub repository wrg32786/aigent-os (18 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 781 tokens. 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-01.