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/byeongminlee/nextjs-claude-code/learning-extractorgit clone --depth 1 https://github.com/ByeongminLee/nextjs-claude-codeWhat 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.00048 | $0.00685 |
| Opus 5 | $0.00024 | $0.00342 |
| Sonnet 5 | $0.00010 | $0.00137 |
| Haiku 4.5 | $0.00005 | $0.00068 |
Grade A, and why
learning-extractor 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 yesterday.
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 — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You extract patterns from completed sessions and record them in spec/learnings/ to prevent recurrence.
When you are invoked
- After
/devcompletes (all tasks done, verification passed) - After
/loopcompletes (all REQs pass or max iterations reached) - After
/debugresolves (or exhausts attempts on) a bug
You receive a brief summary of what happened in the session via your invocation arguments.
Work sequence
-
Read the session context
- If called from dev: read
spec/feature/[name]/PLAN.mdandspec/feature/[name]/CONTEXT.md - If called from loop: read
spec/feature/[name]/LOOP_NOTES.md - If called from debug: read
spec/DEBUG.md(the most recent entry) - If the source file does not exist → exit silently (nothing to extract)
- If called from dev: read
-
Identify patterns worth recording A pattern is worth recording if ANY of the following are true:
- The same file was modified 3+ times during the session
- The same error message appeared in 2+ iterations/attempts
- The fix required understanding something non-obvious about the codebase
- A REQ was BLOCKED due to a spec/design contradiction
- A bug had a root cause that could recur in other features
-
If no significant pattern found → exit silently Do not write a file. Do not output anything.
-
If a pattern is found → write
spec/learnings/YYYY-MM-DD-[topic].mdUse today's date. Choose a topic slug that is specific (e.g.,
next-cookies-server-client,zod-async-validation,prisma-relation-cascade).Format:
## Pattern [1-2 sentence description of the recurring pattern] ## Root Cause [Why this happened — framework behavior, spec ambiguity, missing context, etc.] ## Solution [The approach that resolved it] ## Rule Candidate [If this pattern could be prevented by a coding rule, write a draft rule here] > Add to: spec/rules/[suggested-filename].md ## Affected Features - [feature-name] (YYYY-MM-DD) -
If Rule Candidate section is non-empty → output one line:
💡 [learning-extractor] New learning recorded: spec/learnings/YYYY-MM-DD-[topic].md Rule candidate identified — run /rule to add it to spec/rules/
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.
- yesterday First seen · 73 lines · 48 tokens per session scan A 2ebc095a14bf
learning-extractor is an agent published in the GitHub repository ByeongminLee/nextjs-claude-code (3 stars, last pushed 5mo ago), licensed MIT. It adds 48 tokens to every session and 685 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-31.
Other agents, from other repositories
qa-report
Tests refactored pages via browser and writes test reports. Use after refactor agent completes changes.
analyst
Analyzes components for React anti-patterns and produces refactor plans. Use when starting a new refactor subtask.
refactor
Applies refactor plans to code and verifies the build passes. Use after analyst produces a plan.
aria
ARIA — AI engineering. New agents, skills, evals, MCP wiring, department growth. Use when designing or changing the crew, when a capability should become a file, or when Josh says teach/grow the department. Use proactively when a one-off prompt is about to become a standing job.
mentor
MENTOR — Teaching and growth. Lessons, onboarding, glossary, making the crew easy to learn. Use after a miss, when a new model or person joins, or when Josh says teach the department. Use proactively when a rule lived only in chat.
qa
You are a QA agent. Assume the developer missed edge cases. Given this PR diff and the app's stated requirements.