self-improving-agent
Curation layer for Claude Code auto-memory that promotes learnings to enforced rules and skills.
- CCM score
- 68 of 100
- version
- 2.14.11
- GitHub stars
- 30.6K
Own this plugin? Claim it
What it does
- Adds the
/si:memory-review,/si:promote,/si:extract,/si:memory-status, and/si:remembercommands plus thememory-analystandskill-extractoragents - Reviews MEMORY.md to flag promotion candidates, stale entries, and duplicates before any pruning happens
- Moves a proven pattern into CLAUDE.md or
.claude/rules/so it is enforced rather than kept as a background note - Includes an optional UserPromptSubmit hook that suggests matching skills and stays silent on prompts it does not match
Curate auto-memory, promote learnings to CLAUDE.md and rules, extract patterns into skills. Ships 5 slash commands (/si:memory-review, /si:promote, /si:extract, /si:memory-status, /si:remember) and 2 sub-agents (memory-analyst, skill-extractor).
Add marketplace
/plugin marketplace add alirezarezvani/claude-skillsRun it inside Claude Code once, then install the plugin below.
Install
/plugin install self-improving-agent@claude-code-skillsRun it inside Claude Code after adding the marketplace.
Files
Discovered from source/si:extract — Create Skills from Patterns
Transforms a recurring pattern or debugging solution into a standalone, portable skill that can be installed in any project.
Usage
/si:extract <pattern description> # Interactive extraction
/si:extract <pattern> --name docker-m1-fixes # Specify skill name
/si:extract <pattern> --output ./skills/ # Custom output directory
/si:extract <pattern> --dry-run # Preview without creating files
When to Extract
A learning qualifies for skill extraction when ANY of these are true:
| Criterion | Signal |
|---|---|
| Recurring | Same issue across 2+ projects |
| Non-obvious | Required real debugging to discover |
| Broadly applicable | Not tied to one specific codebase |
| Complex solution | Multi-step fix that's easy to forget |
| User-flagged | "Save this as a skill", "I want to reuse this" |
Workflow
Step 1: Identify the pattern
Read the user's description. Search auto-memory for related entries:
MEMORY_DIR="$HOME/.claude/projects/$(pwd | sed 's|/|%2F|g; s|%2F|/|; s|^/||')/memory"
grep -rni "<keywords>" "$MEMORY_DIR/"
If found in auto-memory, use those entries as source material. If not, use the user's description directly.
Step 2: Determine skill scope
Ask (max 2 questions):
- "What problem does this solve?" (if not clear)
- "Should this include code examples?" (if applicable)
Step 3: Generate skill name
Rules for naming:
- Lowercase, hyphens between words
- Descriptive but concise (2-4 words)
- Examples:
docker-m1-fixes,api-timeout-patterns,pnpm-workspace-setup
Reserved fragments — must NOT appear in the skill name:
claudeanthropic
For skills about Claude Code itself, use the cc- prefix instead:
- ❌
claude-code-settings→ ✅cc-settings - ❌
claude-code-maintenance→ ✅cc-maintenance - ❌
claude-mcp-tools→ ✅cc-mcp-tools - ❌
claude-plugin-development→ ✅cc-plugin-development
Before writing the skill directory, check the proposed name against this list.
If a reserved fragment is present, transform it (drop the fragment or replace
the claude*/anthropic* prefix with cc-) and confirm with the user.
Step 4: Create the skill files
Spawn the skill-extractor agent for the actual file generation.
The agent creates:
<skill-name>/
├── SKILL.md # Main skill file with frontmatter
├── README.md # Human-readable overview
└── reference/ # (optional) Supporting documentation
└── examples.md # Concrete examples and edge cases
Step 5: SKILL.md structure
The generated SKILL.md must follow this format:
---
name: "skill-name"
description: "<one-line description>. Use when: <trigger conditions>."
---
# <Skill Title>
> One-line summary of what this skill solves.
## Quick Reference
| Problem | Solution |
|---------|----------|
| {{problem 1}} | {{solution 1}} |
| {{problem 2}} | {{solution 2}} |
## The Problem
{{2-3 sentences explaining what goes wrong and why it's non-obvious.}}
## Solutions
### Option 1: {{Name}} (Recommended)
{{Step-by-step with code examples.}}
### Option 2: {{Alternative}}
{{For when Option 1 doesn't apply.}}
## Trade-offs
| Approach | Pros | Cons |
|----------|------|------|
| Option 1 | {{pros}} | {{cons}} |
| Option 2 | {{pros}} | {{cons}} |
## Edge Cases
- {{edge case 1 and how to handle it}}
- {{edge case 2 and how to handle it}}
Step 6: Quality gates
Before finalizing, verify:
- SKILL.md has valid YAML frontmatter with
nameanddescription -
namematches the folder name (lowercase, hyphens) -
namedoes NOT contain reserved fragmentsclaudeoranthropic(usecc-prefix for Claude Code skills) - Description includes "Use when:" trigger conditions
- Solutions are self-contained (no external context needed)
- Code examples are complete and copy-pasteable
- No project-specific hardcoded values (paths, URLs, credentials)
- No unnecessary dependencies
Step 7: Report
✅ Skill extracted: {{skill-name}}
Files created:
{{path}}/SKILL.md ({{lines}} lines)
{{path}}/README.md ({{lines}} lines)
{{path}}/reference/examples.md ({{lines}} lines)
Install: /plugin install (copy to your skills directory)
Publish: clawhub publish {{path}}
Source: MEMORY.md entries at lines {{n, m, ...}} (retained — the skill is portable, the memory is project-specific)
Examples
Extracting a debugging pattern
/si:extract "Fix for Docker builds failing on Apple Silicon with platform mismatch"
Creates docker-m1-fixes/SKILL.md with:
- The platform mismatch error message
- Three solutions (build flag, Dockerfile, docker-compose)
- Trade-offs table
- Performance note about Rosetta 2 emulation
Extracting a workflow pattern
/si:extract "Always regenerate TypeScript API client after modifying OpenAPI spec"
Creates api-client-regen/SKILL.md with:
- Why manual regen is needed
- The exact command sequence
- CI integration snippet
- Common failure modes
Tips
- Extract patterns that would save time in a different project
- Keep skills focused — one problem per skill
- Include the error messages people would search for
- Test the skill by reading it without the original context — does it make sense?
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 |
|---|---|
/si:memory-review | Analyze auto-memory — find promotion candidates, stale entries, health metrics |
/si:promote | Graduate a pattern from MEMORY.md → CLAUDE.md or .claude/rules/ |
/si:extract | Turn a recurring pattern into a standalone reusable skill |
/si:memory-status | Memory health dashboard — line counts, capacity, recommendations |
/si:remember | Explicitly save important knowledge to auto-memory |
Skill hints (UserPromptSubmit hook)
Some skills in this plugin rarely load on their own: in our trigger evals the model answered prompts squarely in their scope without opening them. The plugin ships a small hook, hooks/skill_router.py, that reads each prompt and, when it clearly matches one of these skills, adds one line telling Claude which skill fits: si:remember.
It is quiet by design. It prints nothing on prompts that don't match, suggests at most one skill per prompt and each skill at most once per session, skips prompts that start with /, never blocks a prompt and makes no network or model calls. The patterns live in hooks/skill_routes.json. Turn it off with SKILL_ROUTER=0 (all plugins) or SKILL_ROUTER_SI=0 (this plugin only).
Install
Claude Code
/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
How It Works
Claude discovers pattern → auto-memory (MEMORY.md)
↓
Pattern recurs 2-3x → /si:memory-review flags it
↓
You approve → /si: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 on success) |
| Reference docs | 3 | memory architecture, promotion rules, rules directory patterns |
| Templates | 2 | rule template, skill template |
Design Principles
- Don't fight auto-memory — orchestrate it. Auto-memory captures. This plugin curates.
- No duplicate storage. Reads from
~/.claude/projects/directly. No.learnings/directory. - Zero capture overhead. Auto-memory handles capture. Hook only fires on errors.
- Promotion = graduation. Moving a pattern from MEMORY.md to CLAUDE.md changes its priority.
- Respect the 200-line limit. Actively manages MEMORY.md capacity.
Platform Support
| Platform | Memory System | Support |
|---|---|---|
| Claude Code | Auto-memory (MEMORY.md) | ✅ Full |
| OpenClaw | workspace/MEMORY.md | ✅ Adapted |
| Codex CLI | AGENTS.md | ✅ Adapted |
| 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
Details
- Marketplace
- alirezarezvani/claude-skills
- Source
- engineering-team/self-improving-agent
- Author
- Alireza Rezvani
- Category
- Development
- Keywords
- memory, auto-memory, self-improvement, learning
- Listed since
- Apr 7, 2026
More from alirezarezvani/claude-skills
All 121- skill-retrov2.14.6
- skillopt-sleepv2.14.5
- slo-architectv2.14.5
- snowflake-developmentv2.14.5
- spinning-up-deep-rlv2.14.6
- statistical-analystv2.14.12
- support-opsv2.14.14
- swedish-mentorv2.14.5
- syllabusv2.14.6
- terraform-patternsv2.14.6
- universal-scraping-architectv2.14.9
- video-content-strategistv2.14.5
- video-studiov2.14.14
- vpe-advisorv2.14.5
- weekly-reviewv2.14.5
- workflow-builderv2.14.5
- write-a-skillv2.14.9
- youtube-fullv2.14.5
- zero-hallucination-coderv2.14.5
- a11y-auditv2.14.5
- access-lifecyclev2.14.5
- aeov2.14.6
- agent-harnessv2.14.11
- agent-launcher-skillsv2.14.5
Similar to self-improving-agent
More Memory & Contextself-improving-agentSkillalirezarezvani/claude-skills1.1K installsCurates Claude Code's auto-memory into permanent rules, lessons, and reusable skills with memory health checks.
skillopt-sleepPluginalirezarezvani/claude-skills30.6K starsNightly offline self-evolution for this repo's Claude agent: harvests past Claude Code sessions (read-only), mines recurring tasks, replays them offline on your
CludeMCP serversebbsssss23 starsPortable agent memory with hybrid recall, decay, and export, stored locally or hosted.
customaize-agentPluginNeoLabHQ/context-engineering-kit1.9K starsCommands and skills for writing and refining commands, hooks, skills for Claude Code, includes Anthropic Best Practices and Agent Persuasion Principles that can