Pattern extraction framework for learning from sessions. This skill captures valuable patterns discovered during work sessions including error resolutions, user corrections, workarounds, debugging techniques, and project-specific patterns. Triggers on Stop hook, end of session, "save learnings", "extract patterns", or when explicitly asked to capture knowledge from the current session. Outputs learned skills to ~/.claude/skills/learned/.
Extract patterns from sessions and save them as structured skill files that future sessions can consult by trigger match. This is the layer above Claude Code's auto-memory: memory captures facts and preferences about you and your projects; continuous-learning captures reusable problem-solving patterns that need more structure than a memory entry can carry.
Claude Code has a built-in memory system (~/.claude/projects/.../memory/) that captures user, feedback, project, and reference memories — short, typed entries loaded into every future conversation's context. Use that for:
This skill handles the things auto-memory doesn't:
~/.claude/skills/learned/, discoverable as portable skills across projects and machines.Rule of thumb: a one-line fact goes in memory. A reproducible fix-recipe or debugging playbook goes here.
Automatic triggers:
references/hook-setup.md.Manual triggers:
Signal phrases to watch for:
Each pattern gets classified into one of five types. Full YAML templates and extraction criteria for each → references/pattern-types.md. Detailed examples → references/examples.md. Brief summary:
Scan the session for these learning signals:
Apply the extraction threshold to filter noise:
Include if:
Exclude if:
Configurable threshold — tune via ~/.claude/config/learning.yaml:
extraction:
threshold: 0.7 # 0.0-1.0, higher = more selective
min_investigation_steps: 3 # Minimum complexity for extraction
require_root_cause: true # Must understand why, not just what
max_patterns_per_session: 10 # Prevent noise
For each pattern that passes threshold:
references/pattern-types.md). Pattern-body fields only — the surrounding file wrapper (metadata, usage:, confidence:, tags:) lives in references/storage-format.md.confidence: block, not the pattern body).Before saving, check for existing similar patterns:
1. Load existing patterns from ~/.claude/skills/learned/
2. For each candidate:
a. Search for patterns with similar triggers
b. Search for patterns in same category/context
c. Calculate similarity score
3. If similarity > 0.8:
a. Merge — combine insights, increment times_applied
b. Update — if new pattern is more complete, replace
4. If similarity < 0.8: save as new pattern
Similarity by type: error patterns compare error-message patterns; user corrections compare original/corrected approaches; workarounds compare limitations+solutions; debugging compares problem classes; project-specific compares project+category.
Write the pattern file and update the index. Full file layout, naming, and schema → references/storage-format.md.
Patterns that score ≥ the threshold get saved.
| Indicator | Weight | |---|---| | Non-obvious solution (answer wasn't in first search result) | High | | Time investment (took significant debugging time) | High | | Root-cause depth (understanding goes beyond symptoms) | High | | Recurrence likelihood (likely to encounter again) | High | | Transferability (applies beyond immediate context) | Medium | | Specificity (clear trigger conditions) | Medium | | Actionability (concrete steps, not abstract advice) | Medium |
quality_score = (
non_obvious * 0.20 +
time_investment * 0.15 +
root_cause_depth * 0.20 +
recurrence * 0.20 +
transferability * 0.10 +
specificity * 0.10 +
actionability * 0.05
)
# Save if quality_score >= threshold (default 0.7)
Effective capture:
useState stale closure in event handler" > "React bug".Avoiding anti-patterns:
Pattern hygiene:
With context-saver: when context-saver runs at session end, it can include a "Patterns Discovered This Session" section pointing into ~/.claude/skills/learned/.
With brainstorm: learned patterns can inform brainstorming sessions — surface relevant patterns when discussing technical approaches, reference past workarounds when evaluating options.
With future sessions: at session start, patterns are loaded and available for automatic matching when similar errors occur, explicit recall ("what did we learn about X?"), and pattern suggestions during debugging.
references/pattern-types.md — Full YAML templates and extraction criteria for all five pattern typesreferences/examples.md — Complete worked examples, one per pattern typereferences/storage-format.md — Directory layout, file naming, skill file schema, index file structure, lifecyclereferences/hook-setup.md — Stop hook configuration, options, lifecycle integration, testingGoogle Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs.
Manage Apple Notes via the `memo` CLI on macOS (create, view, edit, delete, search, move, and export notes). Use when a user asks OpenClaw to add a note, list notes, search notes, or manage note folders.
Work with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli.
Use when you need to control Slack from OpenClaw via the slack tool, including reacting to messages or pinning/unpinning items in Slack channels or DMs.
Manage Apple Reminders via remindctl CLI (list, add, edit, complete, delete). Supports lists, date filters, and JSON/plain output.
Manage Trello boards, lists, and cards via the Trello REST API.
Category:productivity