New features: - /learn:analyze now uses signal detection to save only valuable lessons - Explicit commands: "ține minte", "remember", "memorează" - Stated preferences: "întotdeauna", "always", "never" - Repeated corrections (2+ times) - Historical references: "cum am discutat", "as we discussed" - New /learn:cleanup command for memory hygiene - Scoring system for entry quality - Conservative mode with confirmation - Upgrade option to rewrite entries - SessionEnd hook shows reminder on /exit, /clear, Ctrl+D - Metadata tracking: source, confidence, reinforced, trigger Changes: - analyze.md: Added Pas 3.5 for signal detection - cleanup.md: New command for reviewing/deleting entries - hooks.json: Changed from Stop to SessionEnd - scripts/session-end-reminder.sh: New reminder script - Templates updated with metadata fields - Documentation updated for v2.1.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
139 lines
4.1 KiB
Markdown
139 lines
4.1 KiB
Markdown
# Claude Learn
|
|
|
|
A Claude Code plugin for capturing lessons learned during development sessions with **domain-based memory**, **selective saving**, and **memory hygiene**.
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
claude plugin install learn@romfast-plugins
|
|
```
|
|
|
|
## Commands
|
|
|
|
| Command | Description |
|
|
|---------|-------------|
|
|
| `/learn:analyze` | Analyze conversation and propose lessons (selective) |
|
|
| `/learn:status` | Show memory statistics by domain |
|
|
| `/learn:import <file>` | Import from another memory file |
|
|
| `/learn:reflect` | Consolidate and clean up memory |
|
|
| `/learn:cleanup` | Review and remove low-value entries |
|
|
|
|
## Features
|
|
|
|
### Domain-based Memory
|
|
- Organized by backend, frontend, database, testing, etc.
|
|
- Selective loading via `paths` frontmatter
|
|
- Automatic domain detection from files in conversation
|
|
|
|
### Selective Saving (v2.1.0)
|
|
|
|
The plugin now uses intelligent signal detection to save only valuable lessons:
|
|
|
|
**What Gets Saved (High Priority):**
|
|
- Explicit commands: "ține minte", "remember this", "memorează"
|
|
- Stated preferences: "întotdeauna fă X", "always do Y"
|
|
- Repeated corrections: Same issue corrected 2+ times
|
|
- Historical references: "cum am discutat", "as we discussed"
|
|
|
|
**What Gets Filtered Out:**
|
|
- One-time typo fixes
|
|
- Single-file specific bugs
|
|
- Import path corrections
|
|
- Hardcoded value adjustments
|
|
|
|
### Memory Hygiene (v2.1.0)
|
|
|
|
Each entry now tracks metadata for cleanup:
|
|
|
|
| Field | Description |
|
|
|-------|-------------|
|
|
| `source` | How it was captured: explicit, inferred, or repeated |
|
|
| `confidence` | Signal strength: high, medium, or low |
|
|
| `reinforced` | Times used in subsequent sessions |
|
|
| `trigger` | Original phrase that triggered saving |
|
|
|
|
Run `/learn:cleanup` periodically to review and remove low-value entries.
|
|
|
|
### SessionEnd Hook
|
|
|
|
When you exit a session (`/exit`, `/clear`, `Ctrl+D`), the plugin shows a reminder:
|
|
|
|
```
|
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
💡 Tip: Rulează /learn:analyze pentru a captura lecțiile din sesiune
|
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
```
|
|
|
|
**Note**: Requires Claude Code 2.0.50+ for `/clear` to trigger the hook.
|
|
|
|
## Plugin Structure
|
|
|
|
```
|
|
learn/
|
|
├── .claude-plugin/plugin.json
|
|
├── commands/
|
|
│ ├── analyze.md # Main analysis with signal detection
|
|
│ ├── cleanup.md # Memory hygiene command
|
|
│ ├── import.md # Import from other formats
|
|
│ ├── reflect.md # Cross-domain consolidation
|
|
│ └── status.md # Statistics display
|
|
├── hooks/hooks.json # SessionEnd hook config
|
|
├── scripts/
|
|
│ └── session-end-reminder.sh # Reminder script
|
|
├── rules/memory-format.md
|
|
├── templates/
|
|
│ ├── domain-memory.md
|
|
│ ├── domains-config.md
|
|
│ └── memory-entry.json
|
|
└── README.md
|
|
```
|
|
|
|
## Memory Format
|
|
|
|
Entries are saved with metadata:
|
|
|
|
```markdown
|
|
### API Response Format Standard
|
|
**Discovered**: 2025-01-06 (feature: user-api)
|
|
**Source**: explicit | **Confidence**: high | **Reinforced**: 3
|
|
**Trigger**: "ține minte să folosești acest format"
|
|
**Description**: All API responses must use {data, error, meta} structure
|
|
|
|
**Example** (`src/api/users.ts:45`):
|
|
```typescript
|
|
return { data: users, error: null, meta: { count: 10 } }
|
|
```
|
|
|
|
**Tags**: api, response, format
|
|
```
|
|
|
|
## Development
|
|
|
|
```bash
|
|
# Test the plugin
|
|
claude --plugin-dir ./plugins/learn
|
|
|
|
# Verify commands
|
|
/learn:status
|
|
/learn:analyze
|
|
/learn:cleanup --dry-run
|
|
```
|
|
|
|
## Changelog
|
|
|
|
### v2.1.0
|
|
- Added selective saving with signal detection
|
|
- Added `/learn:cleanup` command for memory hygiene
|
|
- Added metadata tracking (source, confidence, reinforced, trigger)
|
|
- Improved Stop hook with specific criteria
|
|
- Backward compatible with v2.0.0 entries
|
|
|
|
### v2.0.0
|
|
- Domain-based memory organization
|
|
- Selective loading via paths frontmatter
|
|
- Automatic domain detection
|
|
|
|
## License
|
|
|
|
MIT
|