agentleFS
DAYLAB-HQDAYLAB-HQ/claude-self-learn/skills/self-learn/SKILL.md

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

  • Other versions6 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 6

    1. Pratiyush/llm-wiki★ 383same name
    2. valpere/session-indexer★ 42same name
    3. dongnguyenvie/bashcut-agent-kit★ 6same name
    4. nurmdrafi/pi-native★ 4same name
    5. Moriarty33/jb-kaizen★ 1same name
    6. 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
  1. Distinctive:

    Create/update memory files

    line 32
  2. Distinctive:

    Check conflicts with existing memory → propose updates if conflicts found

    line 35
  3. Distinctive:

    If the session used a new external service CLI/API pattern: → Check if a reference memory exists for that service → If not, propose …

    line 37
  4. Very specific:

    General principle: Ask "If this task happens again, is there a guide to reference?" If not, propose creating one.

    line 40
  5. Very specific:

    If not, propose creating one.

    line 41
  6. Distinctive:

    If issues found, propose fixes/deletions (user approval required)

    line 78
  7. Very specific:

    If matched: hit_count += 1, update last_seen, add memory to evidence

    line 121
  8. Very specific:

    If new pattern: register as new candidate with hit_count: 1

    line 122
  9. Very specific:

    When hit_count ≥ 5: status: "ready" → prompt user "Want to make this a skill?"

    line 123

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.md for 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:

  1. Summarize session work (git diff + conversation context)
  2. 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
  3. Show each item to the user and get approve/reject/edit
  4. Save approved items:
    • Create/update memory files
    • Append to ~/.claude/self-improvement/LEARNINGS.jsonl
    • Update ~/.claude/self-improvement/SKILLS_TRACKER.json
  5. Check conflicts with existing memory → propose updates if conflicts found
  6. 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}
  1. 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 description and keywords, bump last_accessed, increment hit_count
    • On memory delete: remove entry
    • On memory read/reference during the session: bump last_accessed and hit_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.

/self-learn:scan

List detected learning candidates without saving them (preview only).

Execution steps:

  1. Analyze current session's work patterns
  2. Output candidates by category
  3. Prompt: "Run /self-learn to save them"

/self-learn:audit

Health check for existing memory and skills.

Execution steps:

  1. Scan all of ~/.claude/memory/
  2. 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=0 and older than 30 days
  3. If issues found, propose fixes/deletions (user approval required)
  4. 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         █████░░░░░ 5

Skill 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  → dismissed

Registration 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

  1. On /self-learn, match current session work against existing candidates
  2. If matched: hit_count += 1, update last_seen, add memory to evidence
  3. If new pattern: register as new candidate with hit_count: 1
  4. 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, app4

Manual 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-12

Manual 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

SignalCategoryStorage 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, conversionsout of scopeUse a separate system

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.