← Skills Library
Intelligence

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

Learn · Workflow
Mine the session for reusable patterns before context closes.
TriggerEnd of a session · After a non-trivial problem or productive run
1
Scan the session
Surface error fixes, workarounds, conventions — what actually happened
2
Worth extracting?GATE
Skip trivial typos · one-time outages · already-documented
failTrivial / one-off → nothing to capture
3
Categorize each pattern
pattern · anti-pattern · convention — tag by lang / framework / project
4
Write to lessons.md
Mistake → root cause → rule → detection method
5
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
  1. End of a session: After a non-trivial problem or productive run
  2. Scan the session: Surface error fixes, workarounds, conventions — what actually happened
  3. Worth extracting?: Skip trivial typos · one-time outages · already-documented
  4. Categorize each pattern: pattern · anti-pattern · convention — tag by lang / framework / project
  5. Write to lessons.md: Mistake → root cause → rule → detection method
  6. Store to Akashic: mind_remember cross-project patterns for cold-start recall
  7. Confirm extracted patterns: Summary by category, each naming a specific lib / file / command
ↆ download card

Invocation Triggers

/learncapture lessonsave what I learneddocument this patternupdate lessons

Use 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

  1. 1
    Review 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.

  2. 2
    Extract 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.

  3. 3
    Format 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.

  4. 4
    Escalation 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

What you get
  • 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
What it doesn't do
  • 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

Run at every break, not just failures

Compound learning comes from documenting wins too. "This worked because X" is as valuable as "this failed because Y."

Escalate repeats immediately

If the same lesson appears twice in lessons.md, escalate it to CLAUDE.md. Repetition means it's a hard rule, not a pattern.

One lesson per entry

Specific rules are actionable. Vague summaries ("be more careful") are not. If you can't name the exact condition, keep thinking.

Get the Skill

Free DownloadFREE

Learn

The full SKILL.md — copy it into ~/.claude/skills/ and trigger it by name.

Commonly Used With

Skills Library

29 more production skills ready to install.

Browse All Skills