Learn
Captures what you learned from a session into lessons.md before the context window closes. Formats it as a structured entry — mistake, root cause, rule — so it compounds across sessions.
How It Works
- End of a session: After a non-trivial problem or productive run
- Scan the session: Surface error fixes, workarounds, conventions — what actually happened
- Worth extracting?: Skip trivial typos · one-time outages · already-documented
- Categorize each pattern: pattern · anti-pattern · convention — tag by lang / framework / project
- Write to lessons.md: Mistake → root cause → rule → detection method
- Store to Akashic: mind_remember cross-project patterns for cold-start recall
- Confirm extracted patterns: Summary by category, each naming a specific lib / file / command
Invocation Triggers
/learncapture lessonsave what I learneddocument this patternupdate lessonsUse Cases
- Capture a debugging insight before you close the session
- Document a pattern that surprised you so it never surprises you again
- Escalate a repeated mistake to CLAUDE.md as a hard rule
The Problem
Sessions produce knowledge. A debugging insight, an architectural discovery, a pattern you nearly repeated — all of it is fresh and precise right now. By tomorrow, it's compressed into a vague memory. By next week, you're making the same mistake again. The cost of not writing it down isn't a single session. It's every future session where the same pattern resurfaces and nothing stops it.
What It Does
- 1Review what changed
Reads git diff and recently touched files to surface what actually happened — not what you planned to do, but what you actually did.
- 2Extract the non-obvious
Prompts for what was hard, what surprised you, and what you would do differently. Not what was built — why it was difficult.
- 3Format as a lessons.md entry
Writes a structured entry: mistake → root cause → rule. Optionally adds detection latency, detection method, and alerting gap for production-grade patterns.
- 4Escalation check
Evaluates whether the lesson is a one-time incident or a hard rule. Hard rules go into CLAUDE.md, not just lessons.md — they need to be enforced, not just documented.
What You Get / What It Doesn't Do
- A structured lessons.md entry in mistake → root cause → rule format
- Optional CLAUDE.md escalation if the lesson is a hard rule that needs enforcement
- A clean record of what this session cost you and what it taught you
- Write the lesson for you — it prompts, you confirm the draft
- Auto-run at session end — you trigger it intentionally
- Replace a full retro — use /weekly-retro for that
Tips
Compound learning comes from documenting wins too. "This worked because X" is as valuable as "this failed because Y."
If the same lesson appears twice in lessons.md, escalate it to CLAUDE.md. Repetition means it's a hard rule, not a pattern.
Specific rules are actionable. Vague summaries ("be more careful") are not. If you can't name the exact condition, keep thinking.
Get the Skill
Learn
The full SKILL.md — copy it into ~/.claude/skills/ and trigger it by name.
Commonly Used With
29 more production skills ready to install.