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.
npx skills add alexmond/alexmskills --skill learn-on-failuregit clone --depth 1 https://github.com/alexmond/alexmskillsWrote 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.
[](https://agentmods.dev/skills/alexmond/alexmskills/learn-on-failure)<a href="https://agentmods.dev/skills/alexmond/alexmskills/learn-on-failure"><img src="https://agentmods.dev/badge/skills/alexmond/alexmskills/learn-on-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.
<a href="https://agentmods.dev/skills/alexmond/alexmskills/learn-on-failure"><img src="https://agentmods.dev/badge/skills/alexmond/alexmskills/learn-on-failure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00100 | $0.00968 |
| Opus 5 | $0.00050 | $0.00484 |
| Sonnet 5 | $0.00020 | $0.00194 |
| Haiku 4.5 | $0.00010 | $0.00097 |
Grade A, and why
learn-on-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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Save a learning to project memory
Try it:
/learn-on-failure:learn-on-failure testing "BCrypt accepts $2a$ but not $2y$ hashes"— or just say "remember this: ...". Mostly it fires automatically after a multi-cycle fix.
$ARGUMENTS
Locate the project memory directory
Claude Code keeps per-project memory at ~/.claude/projects/<project-slug>/memory/, where
<project-slug> is derived from the current project's absolute path. Do not hardcode a path —
the active project's memory directory is provided in the session's memory/system context. Use that
path. Within it:
MEMORY.mdis the index.- Topic files (e.g.
dependencies.md,testing.md,debugging.md) hold detailed, subject-specific notes.
If the memory directory or MEMORY.md does not yet exist, create them.
Determine the learning
If triggered automatically (multi-cycle resolution), synthesise the learning from the conversation:
- What was the root cause of the extra cycle(s)?
- What assumption or gap in knowledge caused the first attempt to fail?
- What is the correct approach / API / behaviour?
- What should be checked first next time to avoid the same detour?
If triggered by the user, record exactly what they stated in $ARGUMENTS.
Steps
-
Read the current
MEMORY.mdindex in the project's memory directory. -
Check whether a relevant topic file already exists in that same directory. If so, read it too.
-
Decide where to write:
- Short, self-contained insight that fits an existing
MEMORY.mdsection → add it there (keep file ≤ 200 lines). - Detailed or topic-specific learning → append to or create a dedicated topic file, then add/update a one-line
reference in
MEMORY.md.
- Short, self-contained insight that fits an existing
-
Write in concise, actionable form:
- Bullet points, not prose.
- Lead with what to do / what to check, follow with why.
- If it supersedes an existing note, update or remove the old one.
-
Confirm to the user what was saved and where (one line is enough).
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.
- 10d ago First seen · 92 lines · 100 tokens per session scan A 46cd6648da3f
learn-on-failure is a skill published in the GitHub repository alexmond/alexmskills (6 stars, last pushed 2d ago), licensed MIT. It adds 100 tokens to every session and 968 once invoked, about $0.0005 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-08-31.
Other skills, from other repositories
continuous-learning-v2
Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.
context-engineering
Manage, optimize, and debug Claude Code context windows. Use this skill whenever the user mentions context limits, context window, autocompaction, compaction firing, context rot, losing context mid-session, session degradation, running out of tokens, /compact, CLAUDEAUTOCOMPACTPCTOVERRIDE, context compression…
memory-persistence
Implement cross-session memory, persistent agent knowledge, and session continuity for Claude Code. Use this skill whenever the user wants Claude to remember things between sessions, asks how to avoid re-explaining context each day, wants to build a memory system for an agent, mentions CLAUDE.md memory, session files…
hive.note-taking
Maintain a free-form scratchpad of decisions, extracted values, and open questions so context pruning doesn't lose anything you still need.
security-compliance
Guides security professionals in implementing defense-in-depth security architectures, achieving compliance with industry frameworks (SOC2, ISO27001, GDPR, HIPAA), conducting threat modeling and risk assessments, managing security operations and incident response, and embedding security throughout the SDLC.
stride-analysis-patterns
Apply STRIDE methodology to systematically identify threats. Use when analyzing system security, conducting threat modeling sessions, or creating security documentation.