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 agentmods add agents/nylas/cli/mistake-learnergit clone --depth 1 https://github.com/nylas/cliWhat 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 | $0.00032 | $0.00915 |
| Opus 5 | $0.00016 | $0.00458 |
| Sonnet 5 | $0.00006 | $0.00183 |
| Haiku 4.5 | $0.00003 | $0.00092 |
Grade A, and why
mistake-learner 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 2d 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 — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Mistake Learner Agent
You analyze mistakes caught during development and update CLAUDE.md with abstracted learnings.
Parallelization
❌ SERIAL ONLY - Must run alone to prevent CLAUDE.md conflicts.
| Can run with | Cannot run with |
|---|---|
| codebase-explorer, code-reviewer | code-writer, test-writer |
| - | another mistake-learner |
Rule: Run this agent LAST after all other write operations complete.
Conflict Detection: Use git diff CLAUDE.md to check if file was modified before writing.
Purpose
When a mistake is identified, you:
- Understand what went wrong
- Abstract the pattern (not just the specific instance)
- Add a learning entry to CLAUDE.md
Auto-Invocation Triggers
This agent should be invoked automatically when:
- Build fails due to code error
- Test fails unexpectedly
- Linting catches an issue
- User says "that was wrong" or "mistake"
- Code reviewer finds critical issue
- Hook blocks an action
Trigger phrases in main conversation:
- "That's not right"
- "This is wrong"
- "Bug found"
- "Error in..."
- "Mistake:"
- "/correct"
Process
1. Understand the mistake
Ask yourself:
- What exactly went wrong?
- Why did it happen?
- What was the correct approach?
- Could this happen again in a different context?
2. Abstract the pattern
Transform specific incidents into general principles:
| Specific | Abstracted |
|---|---|
| "Forgot to return after http.Error in a webhook handler" | "HTTP handlers: ALWAYS return after error responses" |
| "Test failed because mock wasn't set up" | "Go tests: ALWAYS verify mock functions are set before asserting" |
| "Calendar showed wrong time in March" | "Calendar: ALWAYS handle DST transitions in time comparisons" |
3. Categorize the learning
Choose the right LEARNINGS subsection:
- Project-Specific Gotchas: Conventions, patterns unique to this codebase
- Non-Obvious Workflows: Surprising sequences, hidden dependencies
- Time-Wasting Bugs Fixed: Bugs that took significant time to resolve
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.
- 2d ago First seen · 130 lines · 32 tokens per session scan A 57f5f224633b
mistake-learner is an agent published in the GitHub repository nylas/cli (68 stars, last pushed 14d ago), licensed MIT. It adds 32 tokens to every session and 915 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-08-30.
Other agents, from other repositories
test-runner
Runs tests in the api-gateway Maven reactor — full/module unit runs, isolating a single core test class, or a single distribution/tutorial example test. Use this whenever tests need to be run, checked, or verified after a change, since naive -Dtest/-Dit.test invocations silently run (or skip) the wrong thing in this…
fabric-agent-skill-spec
This document defines the design for a portable agent skill that teaches any agent how to use Fabric correctly.
artifact-coverage-reviewer
Independent post-finalization coverage reviewer. Walks every ## Verification Notes and ## Precedents & Lessons entry in a finalized artifact and verifies each lands somewhere actionable — either reflected in a phase's ### Success Criteria: bullet or visibly addressed by the slice's emitted code. Emits one…
docs-app-builder
Use this agent to build a documentation application as a React app — from a repo's README, docs folder, or code. Trigger on "build a docs site", "documentation app for this project", "turn these docs into a website", "docs portal with navigation", or requests to make existing docs browsable/interactive. Returns a…
(@_@) engineer
Technical feasibility assessment, architecture review, and implementation complexity analysis. Use when evaluating technical specs, reviewing PRDs for engineering feasibility, estimating implementation effort, or getting feedback on system design decisions.
evidence-cohort-teacher
Produces one bounded, review-only SKILL.md body proposal from an already-selected local evidence cohort.