/learning - Extract Session Insight
Capture a single sentence of hard-won advice from the current session and add it to .claude/rules/learnings.md.
When to Use
Use /learning after completing a task where:
- •You ran around in circles before finding the right approach
- •You were corrected after going down the wrong path
- •You discovered something non-obvious about the codebase
- •A pattern or anti-pattern became clear only in hindsight
Either the user OR Claude can initiate this command.
Instructions
- •
Reflect on the session: What would have saved time if you knew it before starting?
- •
Distill to ONE sentence: The learning must be:
- •Actionable (tells future-you what to DO or CHECK)
- •Specific (references actual code patterns, files, or concepts)
- •Contextual (briefly notes what task revealed this insight)
- •
Categorize the learning under the appropriate section in
.claude/rules/learnings.md:- •Data & Type Semantics
- •UI & Component Patterns
- •Parser & Enhancement System
- •Testing & Debugging
- •Git & Workflow
- •(Create new sections if needed)
- •
Format: Add as a bullet point with the insight in bold, followed by explanation and issue/context reference:
markdown- **The insight in bold** - additional context explaining why this matters. *(Issue #XX: brief description of what revealed this)*
- •
Read the existing file first to avoid duplicates and maintain consistent style.
- •
Append the new learning to the appropriate section using the Edit tool.
- •
Confirm what was added by showing the user the new entry.
Example Output
After a session fixing a bug where modifiers weren't displaying correctly:
Added to
.claude/rules/learnings.mdunder "UI & Component Patterns":
- •Always check if a component uses raw
modifier.valuevs calculated values from formulas - static values in JSON (likevalue: 0) may be placeholders for dynamic formulas that needcalculateDynamicValue(). (Issue #95: Rage Up showed +0 instead of calculated 2×Strength)