# Claude Learn A Claude Code plugin for capturing lessons learned during development sessions. ## Features - **Automatic Detection**: Stop hook suggests capturing lessons after significant sessions - **Pattern & Gotcha Tracking**: Structured format for reusable solutions and problems to avoid - **Import Support**: Bring in existing memories from other formats - **Reflection Tools**: Consolidate and promote patterns to CLAUDE.md ## Installation ### Option 1: Marketplace (Recommended) Add to your `~/.claude/settings.json`: ```json { "plugin-marketplaces": [ "git@gitea.romfast.ro:romfast/claude-learn.git" ] } ``` Then install: ```bash claude plugin install learn@romfast-tools ``` ### Option 2: Direct from Git ```bash git clone git@gitea.romfast.ro:romfast/claude-learn.git claude --plugin-dir /path/to/claude-learn/plugin ``` ## Commands | Command | Description | |---------|-------------| | `/learn:analyze` | Analyze conversation and propose lessons | | `/learn:analyze auto` | Auto-detect all categories | | `/learn:analyze patterns` | Focus on patterns only | | `/learn:analyze gotchas` | Focus on gotchas only | | `/learn:import ` | Import from another memory file | | `/learn:reflect` | Consolidate and clean up memory | | `/learn:status` | Show memory statistics | ## Usage Flow ``` 1. Work normally with Claude Code ↓ 2. Claude finishes a significant response ↓ 3. Stop Hook analyzes (15s) ↓ 4. "💡 Run /learn:analyze to capture lessons" ↓ 5. User: /learn:analyze ↓ 6. Claude lists proposals (patterns, gotchas) ↓ 7. User selects: [1, 3, all, none] ↓ 8. Claude updates .claude/rules/claude-learn-memory.md ↓ 9. Periodically: /learn:reflect for consolidation ``` ## Memory File Format The plugin creates and maintains `.claude/rules/claude-learn-memory.md` with this structure: ```markdown # Claude Learn Memory ## Patterns ### Pattern Title **Discovered**: 2025-01-06 (feature: user-dashboard) **Description**: What the pattern does and when to use it **Example** (`src/components/Dashboard.vue:45-52`): \```vue \``` **Tags**: vue, components, dashboard --- ## Gotchas ### Gotcha Title **Discovered**: 2025-01-06 (feature: api-integration) **Problem**: What went wrong **Solution**: How to fix it **Tags**: api, axios, error-handling --- ## Memory Statistics - **Total Patterns**: 5 - **Total Gotchas**: 3 - **Last Session**: 2025-01-06 - **Sessions Recorded**: 8 ``` ## Importing Existing Memories If you have an existing memory file (e.g., from auto-build plugin): ```bash /learn:import .claude/rules/auto-build-memory.md ``` Supported formats: - Markdown with `## Patterns` and `## Gotchas` sections - JSON with `{patterns: [], gotchas: []}` structure ## License MIT