self-learn
Skill4 starsChanged 7 months agoMITView on GitHub
Accumulate technical patterns learned during sessions and manage auto-generated skills — self-improvement commands for Claude Code
6 other projects use a version of this.
Adopted by
Most recently taken up by
- nurmdrafi/pi-nativetheir own version, first seen Nov 1, 2026
- Moriarty33/jb-kaizentheir own version, first seen Oct 20, 2026
- dongnguyenvie/bashcut-agent-kittheir own version, first seen Oct 13, 2026
- kun66126/claude-skillstheir own version, first seen Oct 8, 2026
- valpere/session-indexertheir own version, first seen Jul 12, 2026
- Pratiyush/llm-wikitheir own version, first seen Jun 14, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- Pratiyush/llm-wiki★ 383same name
- valpere/session-indexer★ 42same name
- dongnguyenvie/bashcut-agent-kit★ 6same name
- nurmdrafi/pi-native★ 4same name
- Moriarty33/jb-kaizen★ 1same name
- kun66126/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 4 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
Create/update memory files
- Distinctive: line 35
Check conflicts with existing memory → propose updates if conflicts found
- Distinctive: line 37
If the session used a new external service CLI/API pattern: → Check if a reference memory exists for that service → If not, propose …
- Very specific: line 40
General principle: Ask "If this task happens again, is there a guide to reference?" If not, propose creating one.
- Very specific: line 41
If not, propose creating one.
- Distinctive: line 78
If issues found, propose fixes/deletions (user approval required)
- Very specific: line 121
If matched: hit_count += 1, update last_seen, add memory to evidence
- Very specific: line 122
If new pattern: register as new candidate with hit_count: 1
- Very specific: line 123
When hit_count ≥ 5: status: "ready" → prompt user "Want to make this a skill?"
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
self-learn — Claude Code Self-Improvement Engine
Scope: Technical/implementation-level learning only — code patterns, debugging solutions, tool usage, user technical preferences. Product/business learning (channel performance, pricing conversions, marketing patterns) is out of scope — consider a separate system or portfolio docs for that.
Companion rule: See
~/.claude/rules/memory-first.mdfor the proactive recall workflow. That rule teaches Claude to Glob/Read memories automatically on every vague user prompt — so stored preferences and solutions surface without being asked for.
Commands
/self-learn (default)
Scan the current session, extract what was learned, and save it.
Execution steps:
- Summarize session work (git diff + conversation context)
- Classify into four categories:
- pattern: Successful technical approaches →
~/.claude/memory/pattern_*.md - troubleshoot: Resolved errors/bugs →
~/.claude/memory/troubleshoot_*.md - feedback: User preferences/corrections →
~/.claude/memory/feedback_*.md - skill_candidate: Repeated patterns → propose skill extraction
- pattern: Successful technical approaches →
- Show each item to the user and get approve/reject/edit
- Save approved items:
- Create/update memory files
- Append to
~/.claude/self-improvement/LEARNINGS.jsonl - Update
~/.claude/self-improvement/SKILLS_TRACKER.json
- Check conflicts with existing memory → propose updates if conflicts found
- Reference guide update detection:
- If the session used a new external service CLI/API pattern: → Check if a reference memory exists for that service → If not, propose creating one
- General principle: Ask "If this task happens again, is there a guide to reference?"
If not, propose creating one. Unlike technical patterns (
pattern_*), guides (reference_*) should contain step-by-step recipes.
LEARNINGS.jsonl format:
{"ts":"2026-01-12T14:00:00Z","project":"my-app","category":"pattern","title":"NestJS guard pattern","memory_file":"pattern_nestjs_guard.md","verified":true}
{"ts":"2026-01-12T14:00:00Z","project":"my-app","category":"troubleshoot","title":"Expo SDK build error","memory_file":"troubleshoot_expo_sdk_build.md","verified":true}Update
memory_index.json— every save/update/delete of a memory file MUST keep the index in sync:- On new memory: add entry with
description,type,keywords,created,last_accessed(=created),hit_count(=0),projects - On memory update: refresh
descriptionandkeywords, bumplast_accessed, incrementhit_count - On memory delete: remove entry
- On memory read/reference during the session: bump
last_accessedandhit_count
Keywords extraction: detect tech stacks and domain tokens in body (nextjs, nestjs, expo, prisma, react-native, typescript, tailwind, vercel, docker, ios, android, sqlite, postgres, redis, etc.). If none detected, leave empty — the file is still grep-able as fallback.
The index enables O(1) session-start preload for large memory collections. Without it, grep-based fallback still works but scales poorly past ~500 files.
- On new memory: add entry with
/self-learn:scan
List detected learning candidates without saving them (preview only).
Execution steps:
- Analyze current session's work patterns
- Output candidates by category
- Prompt: "Run
/self-learnto save them"
/self-learn:audit
Health check for existing memory and skills.
Execution steps:
- Scan all of
~/.claude/memory/ - Check for:
- Stale: Memory references files/functions that no longer exist
- Conflict: Two memories contradict each other (e.g., A says "use X", B says "don't use X")
- Duplicate: Same content saved under different filenames
- Unused skills:
usage_count=0and older than 30 days
- If issues found, propose fixes/deletions (user approval required)
- Update
SKILLS_TRACKER.json
/self-learn:stats
Accumulation dashboard.
Output:
📊 Self-Improvement Stats
─────────────────────────
Learnings: 42 (pattern: 15, troubleshoot: 20, feedback: 7)
Auto Skills: 3 (active: 2, unused: 1)
Last Learn: 2026-01-12
Last Audit: 2026-01-10
Memory Files: 28 (global) + 5 (project)
Top Categories:
Next.js ████████░░ 8
NestJS ██████░░░░ 6
Expo █████░░░░░ 5Skill Candidate System (persists across sessions)
Skill candidates are stored in the candidates array of SKILLS_TRACKER.json and accumulate across sessions.
Candidate lifecycle
detected → candidate (hit_count accumulates) → ready (hit_count ≥ 5) → user approves → skill created
→ user rejects → dismissedRegistration triggers (any one)
- Same technical task repeated 2+ times across different projects
- User signals like "I'll probably do this often", "Doing this again"
- 3+ troubleshoot memories in the same category
- On
/self-learn, pattern analysis of LEARNINGS.jsonl detects a match
Accumulation rules
- On
/self-learn, match current session work against existing candidates - If matched:
hit_count += 1, updatelast_seen, add memory toevidence - If new pattern: register as new candidate with
hit_count: 1 - When
hit_count ≥ 5:status: "ready"→ prompt user "Want to make this a skill?"
SKILLS_TRACKER.json candidate schema
{
"candidates": [
{
"id": "kebab-case-id",
"title": "Skill candidate title",
"description": "One-line description",
"evidence": ["related_memory_file.md", "..."],
"hit_count": 3,
"first_seen": "2026-01-07",
"last_seen": "2026-01-14",
"status": "candidate | ready | dismissed | already_skill",
"projects": ["project1", "project2"]
}
]
}/self-learn:candidates
View candidates + manual promote/reject.
Output:
🔧 Skill Candidates
─────────────────────────
ID Hits Status Projects
────────────────────────────────────────────────────
html-mockup-pipeline 5 ★ ready app1, app2, app3
external-service-setup 4 candidate app1, app4Manual operations:
- "Create html-mockup-pipeline as a skill" → generate skill
- "Reject external-service-setup" → status: "dismissed"
- "Add new candidate: XYZ" → manual candidate registration
/self-learn:calibration
Per-domain accuracy dashboard + manual adjustment of calibration.json.
Output:
🎯 Calibration Dashboard
─────────────────────────
Domain Correct Wrong Accuracy Confidence
─────────────────────────────────────────────────
nestjs 12 1 92.3% ██████████ HIGH
tailwind 10 0 100.0% ██████████ HIGH
nextjs 15 3 83.3% █████████░ HIGH
prisma 8 2 80.0% █████████░ HIGH
typescript 6 2 75.0% ████████░░ MED
expo 4 5 44.4% █████░░░░░ LOW ⚠️
ios_native 1 3 25.0% ███░░░░░░░ LOW ⚠️
Total events: 67 | Last updated: 2026-01-12Manual adjustments:
- User says "Reset expo accuracy" → reset correct/wrong for that domain
- User says "That was my mistake, remove from calibration" → most recent wrong -1
Classification guidelines
| Signal | Category | Storage location |
| "This API pattern was clean" | technical pattern | ~/.claude/memory/pattern_*.md |
| "Solved this build error" | technical troubleshoot | ~/.claude/memory/troubleshoot_*.md |
| "Don't do it this way" (code) | technical feedback | ~/.claude/memory/feedback_*.md |
| Product ops, marketing, conversions | out of scope | Use a separate system |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

