🛠️ SelfImprovingエージェント
Claude Codeがプロジェクトで学んだことを分析し
📺 まず動画で見る(YouTube)
▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
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.
🇯🇵 日本人クリエイター向け解説
Claude Codeがプロジェクトで学んだことを分析し
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o self-improving-agent.zip https://jpskill.com/download/4682.zip && unzip -o self-improving-agent.zip && rm self-improving-agent.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/4682.zip -OutFile "$d\self-improving-agent.zip"; Expand-Archive "$d\self-improving-agent.zip" -DestinationPath $d -Force; ri "$d\self-improving-agent.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
self-improving-agent.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
self-improving-agentフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-18
- 同梱ファイル
- 2
💬 こう話しかけるだけ — サンプルプロンプト
- › Self Improving Agent を使って、最小構成のサンプルコードを示して
- › Self Improving Agent の主な使い方と注意点を教えて
- › Self Improving Agent を既存プロジェクトに組み込む方法を教えて
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] self-improving-agent
自己改善エージェント
自動メモリーがキャプチャし、このプラグインがキュレーションします。
Claude Code の自動メモリー (v2.1.32+) は、プロジェクトのパターン、デバッグの洞察、およびあなたの好みを MEMORY.md に自動的に記録します。このプラグインは、その上にインテリジェンス層を追加します。Claude が学習した内容を分析し、実績のあるパターンをプロジェクトルールに昇格させ、繰り返し現れるソリューションを再利用可能なスキルとして抽出します。
クイックリファレンス
| コマンド | 動作内容 |
|---|---|
/si:review |
MEMORY.md を分析し、昇格候補、古いエントリ、統合の機会を見つけます |
/si:promote |
MEMORY.md から CLAUDE.md または .claude/rules/ にパターンを昇格させます |
/si:extract |
実績のあるパターンをスタンドアロンのスキルに変換します |
/si:status |
メモリー健全性ダッシュボード — 行数、トピックファイル、推奨事項 |
/si:remember |
重要な知識を自動メモリーに明示的に保存します |
仕組み
┌─────────────────────────────────────────────────────────┐
│ 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)│
└─────────────────────────────────────────────────────────┘
インストール
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
メモリーアーキテクチャ
ファイルの場所
| ファイル | 記述者 | スコープ | ロードされるタイミング |
|---|---|---|---|
./CLAUDE.md |
あなた (+ /si:promote) |
プロジェクトルール | 全ファイル、すべてのセッション |
~/.claude/CLAUDE.md |
あなた | グローバル設定 | 全ファイル、すべてのセッション |
~/.claude/projects/<path>/memory/MEMORY.md |
Claude (自動) | プロジェクトの学習内容 | 最初の200行 |
~/.claude/projects/<path>/memory/*.md |
Claude (オーバーフロー) | トピック固有のメモ | オンデマンド |
.claude/rules/*.md |
あなた (+ /si:promote) |
スコープ付きルール | 一致するファイルが開かれたとき |
昇格のライフサイクル
1. Claude がパターンを発見 → 自動メモリー (MEMORY.md)
2. パターンが2〜3回繰り返される → /si:review が昇格候補としてフラグを立てる
3. あなたが承認 → /si:promote が CLAUDE.md または rules/ に昇格させる
4. パターンが単なるメモではなく、強制ルールとなる
5. MEMORY.md のエントリが削除される → 新しい学習のためのスペースが解放される
コアコンセプト
自動メモリーはキャプチャであり、キュレーションではない
自動メモリーは、Claude が学習したことを記録するのに優れています。しかし、以下のことについては判断しません。
- どの学習が一時的で、どれが永続的か
- どのパターンが強制ルールになるべきか
- 200行の制限が古いエントリでスペースを浪費しているとき
- どのソリューションが再利用可能なスキルになるのに十分優れているか
それがこのプラグインの役割です。
昇格 = 卒業
学習を昇格させると、Claude のスクラッチパッド (MEMORY.md) からプロジェクトのルールシステム (CLAUDE.md または .claude/rules/) に移動します。この違いは重要です。
- MEMORY.md: 「このプロジェクトは pnpm を使っていることに気づきました」(背景情報)
- CLAUDE.md: 「npm ではなく pnpm を使用してください」(強制的な指示)
昇格されたルールは優先度が高く、完全にロードされます(200行で切り捨てられません)。
スコープ付き知識のためのルールディレクトリ
すべてが CLAUDE.md に属するわけではありません。特定のファイルタイプにのみ適用されるパターンには、.claude/rules/ を使用してください。
# .claude/rules/api-testing.md
---
paths:
- "src/api/**/*.test.ts"
- "tests/api/**/*"
---
- APIエンドポイントのテストにはsupertestを使用してください
- 外部サービスはmswでモックしてください
- ハッピーパスだけでなく、常にエラー応答もテストしてください
これは、Claude が API テストファイルを扱うときにのみロードされ、それ以外ではオーバーヘッドはゼロです。
エージェント
memory-analyst
MEMORY.md とトピックファイルを分析して、以下を特定します。
- セッション間で繰り返されるエントリ(昇格候補)
- 削除されたファイルや古いパターンを参照する古いエントリ
- 統合すべき関連エントリ
- MEMORY.md が知っていることと CLAUDE.md が強制することの間のギャップ
skill-extractor
実績のあるパターンを受け取り、完全なスキルを生成します。
- 適切なフロントマターを持つ SKILL.md
- リファレンスドキュメント
- 例とエッジケース
/plugin installまたはclawhub publishの準備ができています
フック
error-capture (PostToolUse → Bash)
コマンド出力を監視してエラーを検出します。エラーが検出されると、構造化されたエントリを自動メモリーに追加します。
- 失敗したコマンド
- エラー出力(切り捨て済み)
- タイムスタンプとコンテキスト
- 推奨されるカテゴリ
トークンオーバーヘッド: 成功時はゼロ。エラーが検出された場合のみ約30トークン。
プラットフォームサポート
| プラットフォーム | メモリーシステム | プラグインは動作しますか? |
|---|---|---|
| Claude Code | 自動メモリー (MEMORY.md) | ✅ 完全サポート |
| OpenClaw | workspace/MEMORY.md | ✅ 適応済み (ワークスペースメモリーを読み込みます) |
| Codex CLI | AGENTS.md | ✅ 適応済み (AGENTS.md パターンを読み込みます) |
| GitHub Copilot | .github/copilot-instructions.md |
⚠️ 手動昇格のみ |
関連
- Claude Code Memory Docs
- pskoett/self-improving-agent — インスピレーション
- playwright-pro — このリポジトリの姉妹プラグイン
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
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-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: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
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (7,025 bytes)
- 📎 README.md (3,368 bytes)