learn-from-mistake

learn-from-mistake is a skill for Codex from minghinmatthewlam/agent-guards. It costs 59 tokens per session (279 once invoked), scanned A, original, MIT.

A troubleshooting workflow that studies a specific mistake, improves the responsible code, tests, instructions, tools, or process, and then retries the task.

In plain words
What is it for?
Use it for postmortems, diagnosing agent failures, adding durable safeguards, and retrying the original task.
Why use it?
It helps prevent the same type of failure from happening again instead of only correcting one bad result.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it for postmortems, diagnosing agent failures, adding durable safeguards, and retrying the original task.

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

Made for: 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-mistake

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/minghinmatthewlam/agent-guards/learn-from-mistake"><img src="https://agentmods.dev/badge/skills/minghinmatthewlam/agent-guards/learn-from-mistake.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 279 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.00059 $0.00279
Opus 5.5 $0.00024 $0.00112
Sonnet 5.5 $0.00012 $0.00056
Haiku 4.5 $0.00006 $0.00028

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

Security

Grade A, and why

learn-from-mistake 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 11d 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-mistake/SKILL.md · 26 lines

What it actually says

Learn From Mistake

Fix both the immediate result and the system that made the mistake easy.

Diagnose

Inspect the real source, output, and failure observation—treat the agent's explanation as a hypothesis, not proof. Identify the owning cause:

  • Repository (misleading structure, weak types, missing checks) → repo-setup
  • Verification (wrong surface, weak proof, missing coverage) → create-verification-skill or maintain-verification-skill
  • Task boundary (missing context, access, or tools) → fix the boundary
  • Judgment (one-off with adequate setup) → fix the result without adding machinery

Prevent & Retry

Implement prevention in scope (prefer code/tooling over prose), prove it catches the failure class, then retry and verify the affected surface. Ask before changing global guidance or out-of-scope state.

Report

Use concisely: what failed, verified cause, prevention + proof, corrected result, and residual risk.

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. 11d ago Changed · -11 lines aa06a539e022
  2. 3mo ago Changed · -26 lines · -31 tokens per session 47befebfcca2
  3. 3mo ago First seen · 63 lines · 90 tokens per session scan A 8ce95ff9c284

Subscribe to this mod's changes

learn-from-mistake is a skill published in the GitHub repository minghinmatthewlam/agent-guards (46 stars, last pushed 6d ago), licensed MIT. It adds 59 tokens to every session and 279 once invoked, about $0.0002 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-30.

Related

learn-from-mistake compared with skills from other repositories

learn-from-mistake next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
learn-from-mistakeminghinmatthewlam/agent-guardsSkill466d agoMITA59Codex
systematic-debuggingopen-metadata/OpenMetadataSkill16ktodayApache-2.0A37Claude Code
log-error-digestzebbern/claude-code-guideSkill4.7kyesterdayMITA71Claude Code, Codex
observability-audit-sessionsIBM/mcp-context-forgeSkill4.9ktodayApache-2.0A64Claude Code, Codex
cwv-optimizeradobe/skillsSkill345todayApache-2.0A112Claude Code
performance-verificationvalkor-ai/loomSkill1.6k4d agoApache-2.0A45Claude Code, Codex
loop-engineeringhuytieu/COG-second-brainSkill1.6k3d agoMITA63Claude Code