Self improving agent
Curate Claude Code's auto-memory into durable project knowledge.
How to use it
Claude Code
- Run the line below. It pulls the whole folder into
~/.claude/skills/self-improving-agent, including the files SKILL.md points to. - Describe your job in plain words. Claude Code follows the skill from there.
npx degit alirezarezvani/claude-skills/engineering-team/self-improving-agent/skills/self-improving-agent#main ~/.claude/skills/self-improving-agentFor one project only, change the path to .claude/skills/self-improving-agent. This skill also uses MEMORY.md — copying SKILL.md alone won't be enough. See the folder on GitHub.
Claude (web or desktop app)
- On this page open ⋯ → Download .md.
- Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
- Pick the file and Save. Claude shows the name and description and runs a security scan.
- Check the skill is switched on.
- Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
- ChatGPT: make a Project and paste it into Instructions.
- Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
- Check which app you pasted it into — the steps above name the right one.
- Some skills need the paid tier of Claude or ChatGPT.
Paste into Claude, ChatGPT or Cursor.
Source of Self improving agent
Show the full text163 lines
| name | description |
|---|---|
| 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) 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 |
|---|---|
/si:memory-review |
Analyze MEMORY.md — find promotion candidates, stale entries, consolidation opportunities |
/si:promote |
Graduate a pattern from MEMORY.md → CLAUDE.md or .claude/rules/ |
/si:extract |
Turn a proven pattern into a standalone skill |
/si:memory-status |
Memory health dashboard — line counts, topic files, recommendations |
/si: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 │
├─────────────┴──────────────────┴────────────────────────┤
│ ↑ /si:promote ↑ /si:memory-review │
│ Self-Improving Agent (this plugin) │
│ ↓ /si:extract ↓ /si: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
OpenClaw
clawhub install self-improving-agent
Codex CLI
./scripts/codex-install.sh --skill self-improving-agent
Memory Architecture
Where things live
| File | Who writes | Scope | Loaded |
|---|---|---|---|
./CLAUDE.md |
You (+ /si: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 (+ /si:promote) |
Scoped rules | When matching files open |
The promotion lifecycle
1. Claude discovers pattern → auto-memory (MEMORY.md)
2. Pattern recurs 2-3x → /si:memory-review flags it as promotion candidate
3. You approve → /si: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 installorclawhub publish
Hooks
error-capture (PostToolUse → Bash)
Monitors command output for errors. When detected, appends a structured entry to auto-memory with:
- The command that failed
- Error output (truncated)
- Timestamp and context
- Suggested category
Token overhead: Zero on success. ~30 tokens only when an error is detected.
Platform Support
| Platform | Memory System | Plugin Works? |
|---|---|---|
| Claude Code | Auto-memory (MEMORY.md) | ✅ Full support |
| OpenClaw | workspace/MEMORY.md | ✅ Adapted (reads workspace memory) |
| Codex CLI | AGENTS.md | ✅ Adapted (reads AGENTS.md patterns) |
| GitHub Copilot | .github/copilot-instructions.md |
⚠️ Manual promotion only |
Related
- Claude Code Memory Docs
- pskoett/self-improving-agent — inspiration
- playwright-pro — sister plugin in this repo
| 1 | |
| 2 | name "self-improving-agent" |
| 3 | 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." |
| 4 | |
| 5 | |
| 6 | # Self-Improving Agent |
| 7 | |
| 8 | > Auto-memory captures. This plugin curates. |
| 9 | |
| 10 | 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. |
| 11 | |
| 12 | ## Quick Reference |
| 13 | |
| 14 | | Command | What it does | |
| 15 | |---------|-------------| |
| 16 | | `/si:memory-review` | Analyze MEMORY.md — find promotion candidates, stale entries, consolidation opportunities | |
| 17 | | `/si:promote` | Graduate a pattern from MEMORY.md → CLAUDE.md or `.claude/rules/` | |
| 18 | | `/si:extract` | Turn a proven pattern into a standalone skill | |
| 19 | | `/si:memory-status` | Memory health dashboard — line counts, topic files, recommendations | |
| 20 | | `/si:remember` | Explicitly save important knowledge to auto-memory | |
| 21 | |
| 22 | ## How It Fits Together |
| 23 | |
| 24 | |
| 25 | ┌─────────────────────────────────────────────────────────┐ |
| 26 | │ Claude Code Memory Stack │ |
| 27 | ├─────────────┬──────────────────┬────────────────────────┤ |
| 28 | │ CLAUDE.md │ Auto Memory │ Session Memory │ |
| 29 | │ (you write)│ (Claude writes)│ (Claude writes) │ |
| 30 | │ Rules & │ MEMORY.md │ Conversation logs │ |
| 31 | │ standards │ + topic files │ + continuity │ |
| 32 | │ Full load │ First 200 lines│ Contextual load │ |
| 33 | ├─────────────┴──────────────────┴────────────────────────┤ |
| 34 | │ ↑ /si:promote ↑ /si:memory-review │ |
| 35 | │ Self-Improving Agent (this plugin) │ |
| 36 | │ ↓ /si:extract ↓ /si:remember │ |
| 37 | ├─────────────────────────────────────────────────────────┤ |
| 38 | │ .claude/rules/ │ New Skills │ Error Logs │ |
| 39 | │ (scoped rules) │ (extracted) │ (auto-captured)│ |
| 40 | └─────────────────────────────────────────────────────────┘ |
| 41 | |
| 42 | |
| 43 | ## Installation |
| 44 | |
| 45 | ### Claude Code (Plugin) |
| 46 | |
| 47 | /plugin marketplace add alirezarezvani/claude-skills |
| 48 | /plugin install self-improving-agent@claude-code-skills |
| 49 | |
| 50 | |
| 51 | ### OpenClaw |
| 52 | |
| 53 | clawhub install self-improving-agent |
| 54 | |
| 55 | |
| 56 | ### Codex CLI |
| 57 | |
| 58 | ./scripts/codex-install.sh --skill self-improving-agent |
| 59 | |
| 60 | |
| 61 | ## Memory Architecture |
| 62 | |
| 63 | ### Where things live |
| 64 | |
| 65 | | File | Who writes | Scope | Loaded | |
| 66 | |------|-----------|-------|--------| |
| 67 | | `./CLAUDE.md` | You (+ `/si:promote`) | Project rules | Full file, every session | |
| 68 | | `~/.claude/CLAUDE.md` | You | Global preferences | Full file, every session | |
| 69 | | `~/.claude/projects/<path>/memory/MEMORY.md` | Claude (auto) | Project learnings | First 200 lines | |
| 70 | | `~/.claude/projects/<path>/memory/*.md` | Claude (overflow) | Topic-specific notes | On demand | |
| 71 | | `.claude/rules/*.md` | You (+ `/si:promote`) | Scoped rules | When matching files open | |
| 72 | |
| 73 | ### The promotion lifecycle |
| 74 | |
| 75 | |
| 76 | 1. Claude discovers pattern → auto-memory (MEMORY.md) |
| 77 | 2. Pattern recurs 2-3x → /si:memory-review flags it as promotion candidate |
| 78 | 3. You approve → /si:promote graduates it to CLAUDE.md or rules/ |
| 79 | 4. Pattern becomes an enforced rule, not just a note |
| 80 | 5. MEMORY.md entry removed → frees space for new learnings |
| 81 | |
| 82 | |
| 83 | ## Core Concepts |
| 84 | |
| 85 | ### Auto-memory is capture, not curation |
| 86 | |
| 87 | Auto-memory is excellent at recording what Claude learns. But it has no judgment about: |
| 88 | Which learnings are temporary vs. permanent |
| 89 | Which patterns should become enforced rules |
| 90 | When the 200-line limit is wasting space on stale entries |
| 91 | Which solutions are good enough to become reusable skills |
| 92 | |
| 93 | That's what this plugin does. |
| 94 | |
| 95 | ### Promotion = graduation |
| 96 | |
| 97 | 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: |
| 98 | |
| 99 | **MEMORY.md**: "I noticed this project uses pnpm" (background context) |
| 100 | **CLAUDE.md**: "Use pnpm, not npm" (enforced instruction) |
| 101 | |
| 102 | Promoted rules have higher priority and load in full (not truncated at 200 lines). |
| 103 | |
| 104 | ### Rules directory for scoped knowledge |
| 105 | |
| 106 | Not everything belongs in CLAUDE.md. Use `.claude/rules/` for patterns that only apply to specific file types: |
| 107 | |
| 108 | |
| 109 | # .claude/rules/api-testing.md |
| 110 | |
| 111 | paths: |
| 112 | - "src/api/**/*.test.ts" |
| 113 | - "tests/api/**/*" |
| 114 | |
| 115 | - Use supertest for API endpoint testing |
| 116 | - Mock external services with msw |
| 117 | - Always test error responses, not just happy paths |
| 118 | |
| 119 | |
| 120 | This loads only when Claude works with API test files — zero overhead otherwise. |
| 121 | |
| 122 | ## Agents |
| 123 | |
| 124 | ### memory-analyst |
| 125 | Analyzes MEMORY.md and topic files to identify: |
| 126 | Entries that recur across sessions (promotion candidates) |
| 127 | Stale entries referencing deleted files or old patterns |
| 128 | Related entries that should be consolidated |
| 129 | Gaps between what MEMORY.md knows and what CLAUDE.md enforces |
| 130 | |
| 131 | ### skill-extractor |
| 132 | Takes a proven pattern and generates a complete skill: |
| 133 | SKILL.md with proper frontmatter |
| 134 | Reference documentation |
| 135 | Examples and edge cases |
| 136 | Ready for `/plugin install` or `clawhub publish` |
| 137 | |
| 138 | ## Hooks |
| 139 | |
| 140 | ### error-capture (PostToolUse → Bash) |
| 141 | Monitors command output for errors. When detected, appends a structured entry to auto-memory with: |
| 142 | The command that failed |
| 143 | Error output (truncated) |
| 144 | Timestamp and context |
| 145 | Suggested category |
| 146 | |
| 147 | **Token overhead:** Zero on success. ~30 tokens only when an error is detected. |
| 148 | |
| 149 | ## Platform Support |
| 150 | |
| 151 | | Platform | Memory System | Plugin Works? | |
| 152 | |----------|--------------|---------------| |
| 153 | | Claude Code | Auto-memory (MEMORY.md) | ✅ Full support | |
| 154 | | OpenClaw | workspace/MEMORY.md | ✅ Adapted (reads workspace memory) | |
| 155 | | Codex CLI | AGENTS.md | ✅ Adapted (reads AGENTS.md patterns) | |
| 156 | | GitHub Copilot | `.github/copilot-instructions.md` | ⚠️ Manual promotion only | |
| 157 | |
| 158 | ## Related |
| 159 | |
| 160 | [Claude Code Memory Docs] |
| 161 | [pskoett/self-improving-agent] — inspiration |
| 162 | [playwright-pro] — sister plugin in this repo |
| 163 |
Discussion
Browse more free Claude skills or everything in Operations.