快速判断
整理Claude Code的自动记忆为持久化的项目知识。分析MEMORY.md中的模式,将经过验证的学习内容提升到CLAUDE.md和.claude/rules/中,提取重复出现的解决方案作为可重用的技能。使用场景:(1) 回顾Claude对您的项目的了解,(2) 将一种模式从笔记升级为强制执行的规则,(3) 将调试解决方案转化为技能,(4) 检查记忆健康状况和容量。
适合任务
- 按 ModelScope 收录说明完成平台、开发或工作流任务。
- 通过下载包离线保存 Skill 内容。
- 结合下载量、访问量和喜欢数评估优先级。
输入与输出
输入:任务目标、上下文材料、平台信息、文件路径、约束条件或需要处理的内容。
输出:按 Skill 说明生成的文档、代码、检查结果、计划、建议或操作步骤。
示例任务
- 使用 "self-improving-agent" 帮我完成当前任务,并先确认必要上下文。
- 根据 "self-improving-agent" 的说明,列出操作步骤和风险检查点。
安装方式
- 下载本站提供的 Skill ZIP 并解压。
- 把解压后的 Skill 目录放入当前 AI 工具支持的
skills目录。 - 如需在线查看原始内容,可打开 GitHub 的
SKILL.md。
在线原始地址:modelscope-alirezarezvani-self-improving-agent/SKILL.md
风险边界
使用前请检查权限、外部依赖和要处理的数据类型。第三方平台数据、支付、部署、账号和密钥相关内容应先核对官方说明。
SKILL.md 文档介绍
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: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: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: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-skillsOpenClaw
clawhub install self-improving-agentCodex CLI
./scripts/codex-install.sh --skill self-improving-agentMemory 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: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 learningsCore 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 pathsThis 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](../playwright-pro/) — sister plugin in this repo