record-agent-failure

record-agent-failure is a skill for Claude Code, Codex from CongBao/failure-memory. It costs 48 tokens per session (809 once invoked), scanned A, original, MIT.

A skill for recording a prior agent result as a failure only when there is evidence of a mismatch, cause, impact, and prevention step.

In plain words
What is it for?
Use it after a user challenges an outcome, reports a recurring problem, or explicitly asks the agent to learn from a failure.
Why use it?
It prevents changed requirements or ordinary refinements from being treated as agent mistakes, while preserving useful lessons from real failures.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the failure-memory plugin — 2 skills, 2 hooks shipped together

Good fit Use it after a user challenges an outcome, reports a recurring problem, or explicitly asks the agent to learn from a failure.

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

Made for: Claude Code, Codex.

Or install failure-memory, the plugin that ships this one along with the rest of its 2 skills, 2 hooks.

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 record-agent-failure

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/congbao/failure-memory/record-agent-failure"><img src="https://agentmods.dev/badge/skills/congbao/failure-memory/record-agent-failure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 809 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.00048 $0.00809
Opus 5.5 $0.00019 $0.00324
Sonnet 5.5 $0.00010 $0.00162
Haiku 4.5 $0.00005 $0.00081

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

Security

Grade A, and why

record-agent-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 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.

skills/record-agent-failure/SKILL.md · 67 lines

What it actually says

Record Agent Failure

When triggered, make one fast evidence-based classification and call remember_failure once. The tool performs pattern reuse and generalization matching; do not recall lessons or manually compare the store first.

Use these classifications:

  • requirement_update, requirement_clarification, preference_update, or ordinary_refinement: the feedback is new work, not a failure.
  • real_failure: a prior invariant, inspectable mismatch, material impact or recurrence risk, controllable cause, and durable prevention are evidenced.
  • mixed: put only the prior-invariant mismatch in failure_portion; keep new work out of memory.
  • insufficient_evidence or uncertain: chronology or required evidence is missing.

Non-failures and uncertain cases use only compact qualification evidence:

{"summary":"compact chronology","classification":"requirement_update"}

For a real or mixed failure, send expectation (invariant, source, evidence), observed (outcome, impact, optional recurrence_risk), cause (layer, failure_mode, component, evidence, recommended_change, verification, optional diagnosis_state, repair_surface, confidence), and lesson (rule, prevention, verification, optional title, applicability, counterexamples).

Find the deepest evidenced controllable cause. layer is one of: skill_instruction, agent_instruction, project_instruction, system_instruction, hook_policy, plugin_manifest, tool_contract, application_logic, adapter_runtime, schema_migration, test_evaluation_gap, harness_limitation, model_behavior, external_dependency, or unknown. failure_mode is one of: missing, ambiguous, conflicting, not_loaded, not_triggered, ignored, incorrectly_implemented, insufficient_validation, uninspectable, or unknown.

Use diagnosis_state=confirmed only for directly supported causes; supported_hypothesis for the best evidence-bounded inference; otherwise unknown. Set repair_surface to the durable instruction, prompt, hook, contract, adapter, implementation, schema, test, or process location that should prevent recurrence. Never invent a root cause merely to record the incident.

If the user identifies an existing lesson_version_id as a requirement change, call report_memory_outcome once with target_type=lesson, outcome=false_positive, source=explicit_user, evidence_kind=user_feedback, and a compact evidence_code instead of recording another failure.

One correction retry is allowed only when the tool returns retryable: true with correction.allowed_values, or the transport rejects a field before execution. If the response includes capture_event_id, copy it to correction_of_capture_event_id; a pre-execution rejection has no capture ID, so omit that field. Correct only the named field. Numeric 0..1 is accepted for confidence. Never retry a non-retryable response, timeout, cancellation, connection loss, or ambiguous error. Never make a third call.

Only when the named tool is absent before invocation, pass the identical JSON once to failure-memory remember. Do not fall back after a tool failure.

Exclude raw prompts, transcripts, secrets, personal data, and unnecessary paths. Briefly report the returned status. A semantic match is only a proposal; history is never silently merged or deleted.

Files

What ships with it

4 files 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. 3mo ago First seen · 67 lines · 48 tokens per session scan A 7a1862632489

Subscribe to this mod's changes

record-agent-failure is a skill published in the GitHub repository CongBao/failure-memory (0 stars, last pushed 3mo ago), licensed MIT. It adds 48 tokens to every session and 809 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-09-01.

Related

record-agent-failure compared with skills from other repositories

record-agent-failure next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
record-agent-failureCongBao/failure-memorySkill03mo agoMITA48Claude Code, Codex
memoryPrismer-AI/PrismerCloudSkill1.4k1mo agoMITA122Claude Code, Codex
memory-dreamPrismer-AI/PrismerCloudSkill1.4k1mo agoMITA133Claude Code, Codex
conversation-compactionPrismer-AI/PrismerCloudSkill1.4k1mo agoMITA139Claude Code, Codex
memory-evolutionnhadaututtheky/neural-memorySkill246yesterdayMITA42Claude Code
memory-auditnhadaututtheky/neural-memorySkill246yesterdayMITA39Claude Code
neural-memorynhadaututtheky/neural-memorySkill246yesterdayMITA125Claude Code