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

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

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.

agentmods
npx agentmods add skills/congbao/failure-memory/record-agent-failure
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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00048 $0.00809
Opus 5 $0.00024 $0.00404
Sonnet 5 $0.00010 $0.00162
Haiku 4.5 $0.00005 $0.00081

Measured 3d ago against content hash 7a1862632489, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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. 3d 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 3d ago), licensed MIT. It adds 48 tokens to every session and 809 once invoked, about $0.0002 per session on Opus 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

Other skills, from other repositories

memory-curation

When you have read / processed a workspace asset in this session and learned something durable about it, write a memory page so future sessions benefit. Maintain the workspace wiki's hierarchical structure as it grows.

Prismer-AI/PrismerCloud · 46 tokens

memory

Persist and retrieve agent memory across sessions — write durable notes, read by path, recall via semantic search, list/delete, and consolidate. Use whenever the user asks to remember/forget something, when you need to look up past decisions or context, or when episodic state matters beyond the current turn. Executes…

Prismer-AI/PrismerCloud · 76 tokens

recall

Recall this repository's OwnMem local memory before changing code, and keep it healthy. Use when a repository contains .ownmem/, when past debugging lessons could apply ("have we hit this before", "why is it done this way"), or when the user mentions ownmem, project memory, or recalling across sessions.

grpcer/ownmem · 66 tokens

dashboard

Open OwnMem Console, the local dashboard for this repository's memory. Use when the user asks to open the dashboard, see memory metrics, check adoption or recall quality, or set up the optional embedding lane. Requires a repository initialized with the dashboard layer.

grpcer/ownmem · 53 tokens

init

Install or update OwnMem in the current repository. Use when the user asks to set up OwnMem, add local project memory for coding agents, or refresh an existing OwnMem installation after a version bump.

grpcer/ownmem · 43 tokens

docmancer

Work from the same local memory as every other coding agent on this machine. Recall prior decisions, preferences, instructions, and project conventions that Claude Code, Codex, Cursor, and other agents wrote here, with cited sources, fully local. Also searches a separate local technical-documentation index.

docmancer/docmancer · 62 tokens