Self improving agent

Curate Claude Code's auto-memory into durable project knowledge.

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/self-improving-agent, including the files SKILL.md points to.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit alirezarezvani/claude-skills/engineering-team/self-improving-agent/skills/self-improving-agent#main ~/.claude/skills/self-improving-agent

For 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)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. 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.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of Self improving agent

Show the full text163 lines
namedescription
self-improving-agentCurate 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 install or clawhub 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
1---
2name: "self-improving-agent"
3description: "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 
10Claude 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```bash
53clawhub install self-improving-agent
54```
55 
56### Codex CLI
57```bash
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```
761. Claude discovers pattern → auto-memory (MEMORY.md)
772. Pattern recurs 2-3x → /si:memory-review flags it as promotion candidate
783. You approve → /si:promote graduates it to CLAUDE.md or rules/
794. Pattern becomes an enforced rule, not just a note
805. MEMORY.md entry removed → frees space for new learnings
81```
82 
83## Core Concepts
84 
85### Auto-memory is capture, not curation
86 
87Auto-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 
93That's what this plugin does.
94 
95### Promotion = graduation
96 
97When 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 
102Promoted rules have higher priority and load in full (not truncated at 200 lines).
103 
104### Rules directory for scoped knowledge
105 
106Not everything belongs in CLAUDE.md. Use `.claude/rules/` for patterns that only apply to specific file types:
107 
108```yaml
109# .claude/rules/api-testing.md
110---
111paths:
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 
120This loads only when Claude works with API test files — zero overhead otherwise.
121 
122## Agents
123 
124### memory-analyst
125Analyzes 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
132Takes 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)
141Monitors 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](https://code.claude.com/docs/en/memory)
161- [pskoett/self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent) — inspiration
162- [playwright-pro](engineering-team/playwright-pro/) — sister plugin in this repo
163 

Discussion

Alternatives

Also in Notes & knowledgeSee all 58 in Operations →