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 commands/smicolon/ai-kit/failure-addgit clone --depth 1 https://github.com/smicolon/ai-kitWrote 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/commands/smicolon/ai-kit/failure-add)<a href="https://agentmods.dev/commands/smicolon/ai-kit/failure-add"><img src="https://agentmods.dev/badge/commands/smicolon/ai-kit/failure-add.svg" alt="Measured on agentmods" height="20"></a>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 | $0.00016 | $0.00661 |
| Opus 5 | $0.00008 | $0.00331 |
| Sonnet 5 | $0.00003 | $0.00132 |
| Haiku 4.5 | $0.00002 | $0.00066 |
Grade A, and why
failure-add 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.
How it starts
The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Add Failure to Log
Record a mistake to prevent repeating it in future sessions.
Steps
-
Parse the user's input to understand the failure:
- What was the context?
- What was the mistake?
- What is the correct approach?
-
Determine failure type:
- Pattern Mistake: Recurring pattern violation (imports, naming, structure)
- Failed Approach: An approach that doesn't work
-
Determine category (ask if unclear):
imports- Wrong import patternssecurity- Missing security checkstesting- Wrong test approachesarchitecture- Structural mistakesconventions- Code style violations
-
Check if failure log exists at
.claude/failure-log.local.md:- If not, create it with the template below
- If yes, read existing content
-
Add the new failure entry:
- Update
last_updatedtimestamp in frontmatter - Add entry under appropriate section (Pattern Mistakes or Failed Approaches)
- Place newest entries first
- Update
-
Confirm the failure was logged with a brief summary
Template for New File
---
enabled: true
last_updated: [CURRENT_ISO_TIMESTAMP]
---
# Failure Log
This log tracks mistakes to prevent repeating them across sessions.
## Pattern Mistakes
[NEW_ENTRY_HERE]
## Failed Approaches
_No failed approaches logged yet._
Entry Format
For Pattern Mistakes
### [YYYY-MM-DD] Brief descriptive title
**Context:** What was being done when the mistake occurred
**Mistake:** The specific error or violation
**Correct:** The correct approach to use instead
**Category:** [category]
For Failed Approaches
### [YYYY-MM-DD] Brief descriptive title
**Context:** What was being attempted
**What failed:** Why the approach didn't work
**Better approach:** What works instead
**Category:** [category]
Examples
User says: "Log that I used relative imports in Django"
Entry created:
### [2026-01-01] Used relative imports in Django service
**Context:** Writing business logic in user service
**Mistake:** Used `from .models import User` relative import
**Correct:** Use `import users.models as _users_models` with alias pattern
**Category:** imports
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.
- 3d ago First seen · 107 lines · 16 tokens per session scan A 4062a06fc190
failure-add is a command published in the GitHub repository smicolon/ai-kit (6 stars, last pushed today), licensed MIT. It adds 16 tokens to every session and 661 once invoked, about $0.0001 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 commands, from other repositories
security-review
CWE 기반 보안 검토 + STRIDE 위협 모델링 (v6 - effort:max 강제).
auto-browse
Auto-browse — learn, optimize, and graduate browser operations or web data-mining workflows.
version
Display current guide and Claude Code versions.
diff-docs
Compare official Anthropic docs baseline vs current snapshot (no network — instant).
analyst
Use when performing local analyst review before pushing PR changes. Assesses code quality, impact analysis, and maintainability.
docs-review
Phase 4 of documenting-projects: Quality gate with 8 measurable criteria and iteration. Triggers: '/docs-review', invoked by documenting-projects orchestrator.