Cross-session learning system that extracts insights from session transcripts and injects relevant past learnings at session start. Uses simple keyword matching for relevance. Complements DISCOVERIES.md/PATTERNS.md with structured YAML storage.
View on GitHub.claude/skills/session-learning/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/rysweet/amplihack/blob/main/.claude/skills/session-learning/SKILL.md -a claude-code --skill session-learningInstallation paths:
.claude/skills/session-learning/# Session Learning Skill
## Purpose
This skill provides cross-session learning by:
1. **Extracting** learnings from session transcripts at Stop hook
2. **Storing** learnings in structured YAML format (`.claude/data/learnings/`)
3. **Injecting** relevant past learnings at SessionStart based on task similarity
4. **Managing** learnings via `/amplihack:learnings` capability
## Design Philosophy
**Ruthlessly Simple Approach:**
- One YAML file per learning category (not per session)
- Simple keyword matching for relevance (no complex ML)
- Complements existing DISCOVERIES.md/PATTERNS.md - doesn't replace them
- Fail-safe: Never blocks session start or stop
## Learning Categories
Learnings are stored in five categories:
| Category | File | Purpose |
| ---------------- | ------------------- | ------------------------------------ |
| **errors** | `errors.yaml` | Error patterns and their solutions |
| **workflows** | `workflows.yaml` | Workflow insights and shortcuts |
| **tools** | `tools.yaml` | Tool usage patterns and gotchas |
| **architecture** | `architecture.yaml` | Design decisions and trade-offs |
| **debugging** | `debugging.yaml` | Debugging strategies and root causes |
## YAML Schema
Each learning file follows this structure:
```yaml
# .claude/data/learnings/errors.yaml
category: errors
last_updated: "2025-11-25T12:00:00Z"
learnings:
- id: "err-001"
created: "2025-11-25T12:00:00Z"
keywords:
- "import"
- "module not found"
- "circular dependency"
summary: "Circular imports cause 'module not found' errors"
insight: |
When module A imports from module B and module B imports from module A,
Python raises ImportError. Solution: Move shared code to a third module
or use lazy imports.
example: |
# Bad: circular import
# utils.py imports from models.py
# models.py imports from uti