Claude Skill

self-improving-agent

Curate Claude Code's auto-memory into durable project knowledge. Analyze MEMORY.md for patterns, promote proven learnings to CLAUDE.md and .claude/rules/, extract recurring solutions into reusable skills. Use when: (1) reviewing what Claude has learned about your project, (2) gra

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Download kopp0510-claude-dd-skills_self-improving-agent-2636b36.zip · 41 KB

Install

skills CLI npx skills add https://github.com/kopp0510/claude-dd/tree/main/skills/self-improving-agent
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install kopp0510-claude-dd@llmmart
Git git clone https://github.com/kopp0510/claude-dd.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole kopp0510/claude-dd collection as a plugin from our marketplace. Git is the plain clone.

README

Self-Improving Agent

Auto-memory captures. This plugin curates.

A Claude Code plugin that turns auto-memory into a structured self-improvement loop. Analyze what Claude has learned, promote proven patterns to enforced rules, and extract recurring solutions into reusable skills.

Why

Claude Code's auto-memory (v2.1.32+) automatically records project patterns in MEMORY.md. But it has no judgment about what to keep, what to promote, or when entries go stale. This plugin adds the intelligence layer.

The difference:

  • MEMORY.md: "I noticed this project uses pnpm" (background note, truncated at 200 lines)
  • CLAUDE.md: "Use pnpm, not npm" (enforced instruction, loaded in full)

Promoting a pattern from memory to rules fundamentally changes how Claude treats it.

Commands

Command What it does
/self-improving-agent:review Analyze auto-memory — find promotion candidates, stale entries, health metrics
/self-improving-agent:promote Graduate a pattern from MEMORY.md → CLAUDE.md or .claude/rules/
/self-improving-agent:extract Turn a recurring pattern into a standalone reusable skill
/self-improving-agent:status Memory health dashboard — line counts, capacity, recommendations
/self-improving-agent:remember Explicitly save important knowledge to auto-memory

Install

Claude Code

/plugin marketplace add alirezarezvani/claude-skills
/plugin install self-improving-agent@claude-code-skills

How It Works

Claude discovers pattern → auto-memory (MEMORY.md)
         ↓
Pattern recurs 2-3x → /self-improving-agent:review flags it
         ↓
You approve → /self-improving-agent:promote graduates it to CLAUDE.md
         ↓
Pattern becomes enforced rule, memory entry removed
         ↓
Space freed for new learnings

What's Included

Component Count Description
Skills 5 review, promote, extract, status, remember
Agents 2 memory-analyst, skill-extractor
Hooks 1 PostToolUse error capture (zero overhead unless an error pattern matches the output text; there is no exit code in the hook input)
Reference docs 3 memory architecture, promotion rules, rules directory patterns
Templates 2 rule template, skill template

Design Principles

  1. Don't fight auto-memory — orchestrate it. Auto-memory captures. This plugin curates.
  2. No duplicate storage. Reads from ~/.claude/projects/ directly. No .learnings/ directory.
  3. Zero capture overhead. Auto-memory handles capture. The hook only fires when an error pattern matches the output text — not when the command fails, which it cannot see.
  4. Promotion = graduation. Moving a pattern from MEMORY.md to CLAUDE.md changes its priority.
  5. Respect the 200-line limit. Actively manages MEMORY.md capacity.

Platform Support

Platform Memory System Support
Claude Code Auto-memory (MEMORY.md) ✅ Full
GitHub Copilot copilot-instructions.md ⚠️ Manual

Credits

Inspired by pskoett/self-improving-agent — a structured learning loop for AI coding agents. This plugin builds on that concept by integrating natively with Claude Code's auto-memory system.

License

MIT — see LICENSE

Skill manifest

Self-Improving Agent

Auto-memory captures. This plugin curates.

Claude Code's auto-memory (v2.1.32+) automatically records project patterns, debugging insights, and your preferences in MEMORY.md. This plugin adds the intelligence layer: it analyzes what Claude has learned, promotes proven patterns into project rules, and extracts recurring solutions into reusable skills.

Quick Reference

Command What it does
/self-improving-agent:review Analyze MEMORY.md — find promotion candidates, stale entries, consolidation opportunities
/self-improving-agent:promote Graduate a pattern from MEMORY.md → CLAUDE.md or .claude/rules/
/self-improving-agent:extract Turn a proven pattern into a standalone skill
/self-improving-agent:status Memory health dashboard — line counts, topic files, recommendations
/self-improving-agent:remember Explicitly save important knowledge to auto-memory

How It Fits Together

┌─────────────────────────────────────────────────────────┐
│                  Claude Code Memory Stack                │
├─────────────┬──────────────────┬────────────────────────┤
│  CLAUDE.md  │   Auto Memory    │   Session Memory       │
│  (you write)│   (Claude writes)│   (Claude writes)      │
│  Rules &    │   MEMORY.md      │   Conversation logs    │
│  standards  │   + topic files  │   + continuity         │
│  Full load  │   First 200 lines│   Contextual load      │
├─────────────┴──────────────────┴────────────────────────┤
│              ↑ /self-improving-agent:promote        ↑ /self-improving-agent:review          │
│         Self-Improving Agent (this plugin)               │
│              ↓ /self-improving-agent:extract    ↓ /self-improving-agent:remember            │
├─────────────────────────────────────────────────────────┤
│  .claude/rules/    │    New Skills    │   Error Logs     │
│  (scoped rules)    │    (extracted)   │   (auto-captured)│
└─────────────────────────────────────────────────────────┘

Installation

Claude Code (Plugin)

/plugin marketplace add alirezarezvani/claude-skills
/plugin install self-improving-agent@claude-code-skills

Memory Architecture

Where things live

File Who writes Scope Loaded
./CLAUDE.md You (+ /self-improving-agent:promote) Project rules Full file, every session
~/.claude/CLAUDE.md You Global preferences Full file, every session
~/.claude/projects/<path>/memory/MEMORY.md Claude (auto) Project learnings First 200 lines
~/.claude/projects/<path>/memory/*.md Claude (overflow) Topic-specific notes On demand
.claude/rules/*.md You (+ /self-improving-agent:promote) Scoped rules When matching files open

The promotion lifecycle

1. Claude discovers pattern → auto-memory (MEMORY.md)
2. Pattern recurs 2-3x → /self-improving-agent:review flags it as promotion candidate
3. You approve → /self-improving-agent:promote graduates it to CLAUDE.md or rules/
4. Pattern becomes an enforced rule, not just a note
5. MEMORY.md entry removed → frees space for new learnings

Core Concepts

Auto-memory is capture, not curation

Auto-memory is excellent at recording what Claude learns. But it has no judgment about:

  • Which learnings are temporary vs. permanent
  • Which patterns should become enforced rules
  • When the 200-line limit is wasting space on stale entries
  • Which solutions are good enough to become reusable skills

That's what this plugin does.

Promotion = graduation

When you promote a learning, it moves from Claude's scratchpad (MEMORY.md) to your project's rule system (CLAUDE.md or .claude/rules/). The difference matters:

  • MEMORY.md: "I noticed this project uses pnpm" (background context)
  • CLAUDE.md: "Use pnpm, not npm" (enforced instruction)

Promoted rules have higher priority and load in full (not truncated at 200 lines).

Rules directory for scoped knowledge

Not everything belongs in CLAUDE.md. Use .claude/rules/ for patterns that only apply to specific file types:

# .claude/rules/api-testing.md
---
paths:
  - "src/api/**/*.test.ts"
  - "tests/api/**/*"
---
- Use supertest for API endpoint testing
- Mock external services with msw
- Always test error responses, not just happy paths

This loads only when Claude works with API test files — zero overhead otherwise.

Agents

memory-analyst

Analyzes MEMORY.md and topic files to identify:

  • Entries that recur across sessions (promotion candidates)
  • Stale entries referencing deleted files or old patterns
  • Related entries that should be consolidated
  • Gaps between what MEMORY.md knows and what CLAUDE.md enforces

skill-extractor

Takes a proven pattern and generates a complete skill:

  • SKILL.md with proper frontmatter
  • Reference documentation
  • Examples and edge cases
  • Ready for /plugin install or clawhub publish

Hooks

error-capture (PostToolUse → Bash)

Monitors command output for errors. When detected, returns a short reminder to Claude (via hookSpecificOutput.additionalContext) containing the matched error pattern and a truncated context snippet, suggesting /self-improving-agent:remember to save the solution. It does not write to auto-memory itself — saving stays an explicit decision.

Token overhead: Zero unless an error pattern matches; ~40 tokens when one does. This is text matching on the command's output, not exit status — the hook input carries no exit code field, so a command that succeeded while printing failed or error: also fires.

Platform Support

Platform Memory System Plugin Works?
Claude Code Auto-memory (MEMORY.md) ✅ Full support
GitHub Copilot .github/copilot-instructions.md ⚠️ Manual promotion only

Related

Files (claude-dd)
  • .claude-plugin
    • plugin.json 341 B
      Loading…
  • agents
    • memory-analyst.md 2.9 KB
      Loading…
    • skill-extractor.md 3 KB
      Loading…
  • hooks
    • CLAUDE.md 6.7 KB
      Loading…
    • error-capture.sh 5.5 KB
      Loading…
    • hooks.json 292 B
      Loading…
    • test-error-capture.sh 9 KB
      Loading…
  • reference
    • memory-architecture.md 4.8 KB
      Loading…
    • promotion-rules.md 3.2 KB
      Loading…
    • rules-directory-patterns.md 3.4 KB
      Loading…
  • skills
    • extract
      • SKILL.md 5.7 KB
        Loading…
    • promote
      • SKILL.md 4.9 KB
        Loading…
    • remember
      • SKILL.md 3.6 KB
        Loading…
    • review
      • SKILL.md 4.7 KB
        Loading…
    • status
      • SKILL.md 4.5 KB
        Loading…
  • templates
    • rule-template.md 240 B
      Loading…
    • skill-template.md 873 B
      Loading…
  • CLAUDE.md 5.6 KB
    Loading…
  • LICENSE 1 KB · in bundle
  • README.md 3.4 KB
    # Self-Improving Agent
    
    > Auto-memory captures. This plugin curates.
    
    A Claude Code plugin that turns auto-memory into a structured self-improvement loop. Analyze what Claude has learned, promote proven patterns to enforced rules, and extract recurring solutions into reusable skills.
    
    ## Why
    
    Claude Code's auto-memory (v2.1.32+) automatically records project patterns in `MEMORY.md`. But it has no judgment about what to keep, what to promote, or when entries go stale. This plugin adds the intelligence layer.
    
    **The difference:**
    - **MEMORY.md**: "I noticed this project uses pnpm" (background note, truncated at 200 lines)
    - **CLAUDE.md**: "Use pnpm, not npm" (enforced instruction, loaded in full)
    
    Promoting a pattern from memory to rules fundamentally changes how Claude treats it.
    
    ## Commands
    
    | Command | What it does |
    |---------|-------------|
    | `/self-improving-agent:review` | Analyze auto-memory — find promotion candidates, stale entries, health metrics |
    | `/self-improving-agent:promote` | Graduate a pattern from MEMORY.md → CLAUDE.md or `.claude/rules/` |
    | `/self-improving-agent:extract` | Turn a recurring pattern into a standalone reusable skill |
    | `/self-improving-agent:status` | Memory health dashboard — line counts, capacity, recommendations |
    | `/self-improving-agent:remember` | Explicitly save important knowledge to auto-memory |
    
    ## Install
    
    ### Claude Code
    ```
    /plugin marketplace add alirezarezvani/claude-skills
    /plugin install self-improving-agent@claude-code-skills
    ```
    
    ## How It Works
    
    ```
    Claude discovers pattern → auto-memory (MEMORY.md)
             ↓
    Pattern recurs 2-3x → /self-improving-agent:review flags it
             ↓
    You approve → /self-improving-agent:promote graduates it to CLAUDE.md
             ↓
    Pattern becomes enforced rule, memory entry removed
             ↓
    Space freed for new learnings
    ```
    
    ## What's Included
    
    | Component | Count | Description |
    |-----------|-------|-------------|
    | Skills | 5 | review, promote, extract, status, remember |
    | Agents | 2 | memory-analyst, skill-extractor |
    | Hooks | 1 | PostToolUse error capture (zero overhead unless an error pattern matches the output text; there is no exit code in the hook input) |
    | Reference docs | 3 | memory architecture, promotion rules, rules directory patterns |
    | Templates | 2 | rule template, skill template |
    
    ## Design Principles
    
    1. **Don't fight auto-memory — orchestrate it.** Auto-memory captures. This plugin curates.
    2. **No duplicate storage.** Reads from `~/.claude/projects/` directly. No `.learnings/` directory.
    3. **Zero capture overhead.** Auto-memory handles capture. The hook only fires when an error
       pattern matches the output text — not when the command fails, which it cannot see.
    4. **Promotion = graduation.** Moving a pattern from MEMORY.md to CLAUDE.md changes its priority.
    5. **Respect the 200-line limit.** Actively manages MEMORY.md capacity.
    
    ## Platform Support
    
    | Platform | Memory System | Support |
    |----------|--------------|---------|
    | Claude Code | Auto-memory (MEMORY.md) | ✅ Full |
    | GitHub Copilot | copilot-instructions.md | ⚠️ Manual |
    
    ## Credits
    
    Inspired by [pskoett/self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent) — a structured learning loop for AI coding agents. This plugin builds on that concept by integrating natively with Claude Code's auto-memory system.
    
    ## License
    
    MIT — see [LICENSE](LICENSE)
    
  • settings.json 930 B
    Loading…
  • SKILL.md 7.1 KB
    ---
    name: self-improving-agent
    description: "Curate Claude Code's auto-memory into durable project knowledge. Analyze MEMORY.md for patterns, promote proven learnings to CLAUDE.md and .claude/rules/, extract recurring solutions into reusable skills. Use when: (1) reviewing what Claude has learned about your project, (2) graduating a pattern from notes to enforced rules, (3) turning a debugging solution into a skill, (4) checking memory health and capacity."
    ---
    
    # Self-Improving Agent
    
    > Auto-memory captures. This plugin curates.
    
    Claude Code's auto-memory (v2.1.32+) automatically records project patterns, debugging insights, and your preferences in `MEMORY.md`. This plugin adds the intelligence layer: it analyzes what Claude has learned, promotes proven patterns into project rules, and extracts recurring solutions into reusable skills.
    
    ## Quick Reference
    
    | Command | What it does |
    |---------|-------------|
    | `/self-improving-agent:review` | Analyze MEMORY.md — find promotion candidates, stale entries, consolidation opportunities |
    | `/self-improving-agent:promote` | Graduate a pattern from MEMORY.md → CLAUDE.md or `.claude/rules/` |
    | `/self-improving-agent:extract` | Turn a proven pattern into a standalone skill |
    | `/self-improving-agent:status` | Memory health dashboard — line counts, topic files, recommendations |
    | `/self-improving-agent:remember` | Explicitly save important knowledge to auto-memory |
    
    ## How It Fits Together
    
    ```
    ┌─────────────────────────────────────────────────────────┐
    │                  Claude Code Memory Stack                │
    ├─────────────┬──────────────────┬────────────────────────┤
    │  CLAUDE.md  │   Auto Memory    │   Session Memory       │
    │  (you write)│   (Claude writes)│   (Claude writes)      │
    │  Rules &    │   MEMORY.md      │   Conversation logs    │
    │  standards  │   + topic files  │   + continuity         │
    │  Full load  │   First 200 lines│   Contextual load      │
    ├─────────────┴──────────────────┴────────────────────────┤
    │              ↑ /self-improving-agent:promote        ↑ /self-improving-agent:review          │
    │         Self-Improving Agent (this plugin)               │
    │              ↓ /self-improving-agent:extract    ↓ /self-improving-agent:remember            │
    ├─────────────────────────────────────────────────────────┤
    │  .claude/rules/    │    New Skills    │   Error Logs     │
    │  (scoped rules)    │    (extracted)   │   (auto-captured)│
    └─────────────────────────────────────────────────────────┘
    ```
    
    ## Installation
    
    ### Claude Code (Plugin)
    ```
    /plugin marketplace add alirezarezvani/claude-skills
    /plugin install self-improving-agent@claude-code-skills
    ```
    
    ## Memory Architecture
    
    ### Where things live
    
    | File | Who writes | Scope | Loaded |
    |------|-----------|-------|--------|
    | `./CLAUDE.md` | You (+ `/self-improving-agent:promote`) | Project rules | Full file, every session |
    | `~/.claude/CLAUDE.md` | You | Global preferences | Full file, every session |
    | `~/.claude/projects/<path>/memory/MEMORY.md` | Claude (auto) | Project learnings | First 200 lines |
    | `~/.claude/projects/<path>/memory/*.md` | Claude (overflow) | Topic-specific notes | On demand |
    | `.claude/rules/*.md` | You (+ `/self-improving-agent:promote`) | Scoped rules | When matching files open |
    
    ### The promotion lifecycle
    
    ```
    1. Claude discovers pattern → auto-memory (MEMORY.md)
    2. Pattern recurs 2-3x → /self-improving-agent:review flags it as promotion candidate
    3. You approve → /self-improving-agent:promote graduates it to CLAUDE.md or rules/
    4. Pattern becomes an enforced rule, not just a note
    5. MEMORY.md entry removed → frees space for new learnings
    ```
    
    ## Core Concepts
    
    ### Auto-memory is capture, not curation
    
    Auto-memory is excellent at recording what Claude learns. But it has no judgment about:
    - Which learnings are temporary vs. permanent
    - Which patterns should become enforced rules
    - When the 200-line limit is wasting space on stale entries
    - Which solutions are good enough to become reusable skills
    
    That's what this plugin does.
    
    ### Promotion = graduation
    
    When you promote a learning, it moves from Claude's scratchpad (MEMORY.md) to your project's rule system (CLAUDE.md or `.claude/rules/`). The difference matters:
    
    - **MEMORY.md**: "I noticed this project uses pnpm" (background context)
    - **CLAUDE.md**: "Use pnpm, not npm" (enforced instruction)
    
    Promoted rules have higher priority and load in full (not truncated at 200 lines).
    
    ### Rules directory for scoped knowledge
    
    Not everything belongs in CLAUDE.md. Use `.claude/rules/` for patterns that only apply to specific file types:
    
    ```yaml
    # .claude/rules/api-testing.md
    ---
    paths:
      - "src/api/**/*.test.ts"
      - "tests/api/**/*"
    ---
    - Use supertest for API endpoint testing
    - Mock external services with msw
    - Always test error responses, not just happy paths
    ```
    
    This loads only when Claude works with API test files — zero overhead otherwise.
    
    ## Agents
    
    ### memory-analyst
    Analyzes MEMORY.md and topic files to identify:
    - Entries that recur across sessions (promotion candidates)
    - Stale entries referencing deleted files or old patterns
    - Related entries that should be consolidated
    - Gaps between what MEMORY.md knows and what CLAUDE.md enforces
    
    ### skill-extractor
    Takes a proven pattern and generates a complete skill:
    - SKILL.md with proper frontmatter
    - Reference documentation
    - Examples and edge cases
    - Ready for `/plugin install` or `clawhub publish`
    
    ## Hooks
    
    ### error-capture (PostToolUse → Bash)
    Monitors command output for errors. When detected, returns a short reminder to Claude
    (via `hookSpecificOutput.additionalContext`) containing the matched error pattern and a
    truncated context snippet, suggesting `/self-improving-agent:remember` to save the
    solution. It does not write to auto-memory itself — saving stays an explicit decision.
    
    **Token overhead:** Zero unless an error pattern matches; ~40 tokens when one does.
    This is text matching on the command's output, **not** exit status — the hook input carries
    no exit code field, so a command that succeeded while printing `failed` or `error:` also fires.
    
    ## Platform Support
    
    | Platform | Memory System | Plugin Works? |
    |----------|--------------|---------------|
    | Claude Code | Auto-memory (MEMORY.md) | ✅ Full support |
    | GitHub Copilot | `.github/copilot-instructions.md` | ⚠️ Manual promotion only |
    
    ## Related
    
    - [Claude Code Memory Docs](https://code.claude.com/docs/en/memory)
    - [pskoett/self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent) — inspiration
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.