self-improving-agent — Claude Code skill: what it does, install
Curates Claude Code auto-memory from MEMORY.md, promotes proven patterns to CLAUDE.md, and extracts reusable skills from recurring solutions.
/plugin marketplace add alirezarezvani/claude-skills
/plugin install self-improving-agent@claude-code-skillsWhat self-improving-agent does
Claude Code auto-memory logs project patterns and insights into MEMORY.md. Only the first 200 lines load into context. This plugin inspects those notes. The /si:memory-review command spots stale entries and promotion candidates, while /si:promote moves validated instructions into ./CLAUDE.md or scoped .claude/rules/ files.
The tool ships with a memory-analyst agent, a skill-extractor that turns recurring patterns into full SKILL.md packages, and an error-capture hook. The hook listens to Bash tool outputs after errors occur. It appends context and takes roughly 30 tokens only when a command fails.
Install this plugin when working on large repositories where the 200-line memory fills up fast. Small one-off scripts do not need it.
What it helps with
- review stale entries and free space in the 200-line
MEMORY.mdlimit - promote proven patterns from auto-memory to
CLAUDE.mdor.claude/rules/ - extract repeated debugging solutions into standalone skill files
- log terminal command errors directly into auto-memory with zero overhead on success
Example prompts for the agent
- /si:memory-review
- /si:promote
- /si:extract
How to install self-improving-agent
1Plugin marketplace
/plugin marketplace add alirezarezvani/claude-skills/plugin install self-improving-agent@claude-code-skillsThis installs the whole self-improving-agent plugin with all its skills
2Skills CLI (Vercel)
npx skills add alirezarezvani/claude-skills --skill self-improving-agent -a claude-code3Manually: put the files in place
~/.claude/skills/self-improving-agent/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/self-improving-agent/
Manually: put the files in place
.agents/skills/self-improving-agent/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/self-improving-agent/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install alirezarezvani/claude-skills self-improving-agent2Manually: put the files in place
.github/skills/self-improving-agent/SKILL.mdPlatform CLI
gemini skills install https://github.com/alirezarezvani/claude-skills --path engineering-team/self-improving-agent/skills/self-improving-agentManually: put the files in place
.devin/skills/self-improving-agent/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set349
The whole set →Similar
Questions about self-improving-agent
How to install self-improving-agent in Claude Code?
Run /plugin marketplace add alirezarezvani/claude-skills and then install it with /plugin install self-improving-agent@claude-code-skills.
What does self-improving-agent do?
It curates notes in MEMORY.md, turns recurring habits into project rules, and packages proven workflows into new skills.
Why graduate patterns from MEMORY.md to CLAUDE.md?
MEMORY.md serves as a scratchpad where only the first 200 lines load. Moving instructions to CLAUDE.md or .claude/rules/ guarantees full loading and enforces them as strict project rules.
Source text
SKILL.md · MIT
--- 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 | |---------|-------------| | `/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 ```bash clawhub install self-improving-agent ``` ### Codex CLI ```bash ./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: ```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, 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](https://code.claude.com/docs/en/memory) - [pskoett/self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent) — inspiration - [playwright-pro](engineering-team/playwright-pro/) — sister plugin in this repo
© Alireza Rezvani · MIT · alirezarezvani/claude-skills