learn
Installation
SKILL.md
Learn From Mistake
Review the conversation to identify the most recent mistake or correction, then codify it as a rule in the appropriate CLAUDE.md.
Steps
-
Identify the mistake: Scan the conversation history for the most recent correction, mistake, or suboptimal behavior. Summarize what went wrong in one sentence.
-
Draft a rule: Write a concise, actionable rule that prevents this mistake in the future. The rule should be:
- Specific enough to be useful (not vague platitudes)
- Written as an imperative ("Do X" or "Never Y")
- One to two sentences max
-
Choose the right file: Determine which CLAUDE.md to update:
- Project CLAUDE.md (
./CLAUDE.md): for lessons specific to this project's codebase, conventions, or tooling - Global CLAUDE.md (
~/.claude/CLAUDE.md): for lessons that apply across all projects (general coding habits, communication style, workflow)
- Project CLAUDE.md (
-
Check for duplicates: Read the target CLAUDE.md and verify the rule doesn't already exist or overlap with an existing rule. If a related rule exists, refine it rather than adding a duplicate.