Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
You run one by typing its /name in Claude Code.
2 cautions to review before installing
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
raphael は、セッション中の失敗兆候を infection record として蓄積し、再発防止の「抗体」を次回以降の該当ツール実行時だけ注入する Claude Code プラグインです。
通常時に常駐する指示ファイルを増やさず、PreToolUse フックで抗体の正規表現が一致したときだけ予防指示を additionalContext として注入します。検知と注入は Node.js の決定的処理であり、Anthropic API や API キーは使用しません。
フックとスクリプトは Node.js で動作します。node が PATH 上にあり、バージョンが 22 以上である必要があります。
Claude Code 本体はネイティブバイナリで配布され Node.js を同梱しないため、未導入の場合は別途インストールしてください。
Claude Code で Marketplace を追加します。
/plugin marketplace add https://github.com/Amatsuka-kobo/amatsuka-claude-plugins
Marketplace から raphael をインストールします。
/plugin raphael
プロジェクト単位またはユーザー単位で導入する場合はスコープを指定します。
/plugin raphael --scope project
/plugin raphael --scope user
インストールまたはフック設定の更新後は、Claude Code のセッションを再起動してフックを反映してください。
.gitignore の設定raphael のプロジェクトデータはプロジェクトルートの .raphael/ に保存されます。利用プロジェクトの .gitignore には次を追加することを推奨します。
.raphael/infections/
.raphael/state.json
.raphael/stats.json
.raphael/commands.jsonl
.raphael/log/
.claude/raphael.local.md
.raphael/infections/ には失敗したコマンドやユーザープロンプトの抜粋が保存されます。secret redaction は best-effort であり、機密情報が残らないことを保証しません。infections/ はコミットしないでください。
一方、.raphael/antibodies/ は再発防止ルールの共有資産です。ignore せず、内容を確認したうえでコミットすることを推奨します。raphael は .gitignore を自動変更しません。
PostToolUse、PostToolUseFailure、UserPromptSubmit フックが、コマンド失敗、連続失敗、ユーザー差し戻し、編集チャーンを検知して infection record に記録します。Stop フックは未蒸留かつ未解決の再発キーの種類数が既定の 3 以上になった場合、抗体を作成・更新する専用サブエージェントの起動を促します。PreToolUse フックは active または confirmed の抗体を評価し、マッチしたものだけを注入します。1 回に注入する抗体数は既定で最大 3 件です。抗体は .raphael/antibodies/<id>.md の Markdown + YAML frontmatter です。frontmatter は発火条件、本文は発火時に注入する予防指示です。
---
id: ab-2026-0724-001
created: 2026-07-24
source: manual
trigger:
event: PreToolUse
tool: Bash
pattern: "pnpm\\s+test"
scope: "src/**"
status: active
expires: 2026-08-23
---
テストを実行する前に、対象パッケージと既知の失敗条件を確認すること。
scope は Edit と Write のプロジェクト相対 POSIX パスにだけ適用され、Bash では無視されます。抗体ファイルを手書きで更新する代わりに、管理 CLI を使用して frontmatter の整合性を保ってください。
設定ファイルはプロジェクトの .claude/raphael.local.md です。存在しない場合、または個別の値が不正な場合は、その値だけ組み込み既定値を使います。設定は flat frontmatter の許可済み key のみを読み取ります。
以下は全設定 key と既定値を含むテンプレートです。
---
detect_command_failure: true
detect_retry_loop: true
detect_user_rejection: true
detect_edit_churn: true
retry_threshold: 3
edit_churn_threshold: 3
distill_threshold: 3
default_expiry_days: 30
max_injections: 3
rejection_patterns: []
benign_exit1_commands: []
benign_exit1_extended: true
breadth_max_ratio: 10
breadth_min_corpus: 50
miss_window_minutes: 30
ineffective_min_fired: 10
ineffective_miss_ratio: 50
antibodies_git_policy: commit
---
| Key | 既定値 | 説明 |
|---|---|---|
detect_command_failure | true | Bash の失敗を検知する |
detect_retry_loop | true | 同じ正規化済みコマンドの連続失敗を検知する |
detect_user_rejection | true | ユーザー差し戻し語を検知する |
detect_edit_churn | true | 同じファイルの重なる編集を検知する |
retry_threshold | 3 | リトライループとみなす連続失敗回数。2–10 |
edit_churn_threshold | 3 | 編集チャーンとみなす重なる編集回数。2–10 |
distill_threshold | 3 | 蒸留の通知を出す未解決の再発キーの種類数。1–100 |
default_expiry_days | 30 | 抗体の既定有効日数。1–365 |
max_injections | 3 | 1 回のツール実行で注入する抗体数。1–10 |
rejection_patterns | [] | 組み込みの日英差し戻し語彙へ追加する正規表現の JSON 配列 |
benign_exit1_commands | [] | exit code 1 を失敗扱いしないコマンド接頭辞の JSON 配列 |
benign_exit1_extended | true | テスト・lint・型検査ランナー等の拡張 benign 判定を有効にする |
breadth_max_ratio | 10 | trigger の広さ検査で許容する一致率の上限(整数 1–100、百分率) |
breadth_min_corpus | 50 | 広さ検査を行うために必要な母集団の最小件数(整数 1–5000) |
miss_window_minutes | 30 | 注入後の失敗を miss と突き合わせる時間窓(分、整数 1–1440) |
ineffective_min_fired | 10 | ineffective 判定に必要な最小発火回数(整数 1–1000) |
ineffective_miss_ratio | 50 | ineffective 判定の miss 比率閾値(整数 1–100、百分率) |
antibodies_git_policy | commit | 抗体の Git 方針。commit または ignore |
rejection_patterns は組み込み語彙を置換せず、追加します。たとえば、日本語と英語の追加語彙は次のように指定します。
---
rejection_patterns: ["(?:期待と違う|それは違います)", "\\bplease (?:revert|undo) this\\b"]
---
正規表現として不正な追加パターンは、そのパターンだけを無視します。
benign_exit1_commands は、exit code が 1 の場合だけ組み込み除外リストに追加されます。たとえば pnpm lint の exit 1 を無害として扱う場合は、次のように指定します。
---
benign_exit1_commands: ["pnpm lint"]
---
組み込みの基本 benign exit-1 コマンドは grep、rg、git grep、diff、git diff --quiet、cmp、test、[ です。benign_exit1_extended: true(既定)では、vitest、jest、mocha、pytest、biome、eslint、prettier、tsc と、test、lint、typecheck、check の script を拡張リストとして扱います。拡張リストは exit code 1 と 2 の両方に適用されます。false にすると拡張リストと正規化を無効にできます。
拡張リストの比較では、複合コマンドの最後のセグメント、環境変数代入、npx / pnpm dlx、pnpm/npm/yarn の option・exec・run、実行ファイルの basename を順に正規化します。接頭辞比較は直後が空白または終端であることを要求するため、pnpm test は pnpm test:unit に一致しません。このため、pnpm test は pnpm test:unit に一致しません。
stats 分離への移行は必須ではありませんが、強く推奨します。次の順で実行してください。
npx claudepluginhub amatsuka-kobo/amatsuka-claude-plugins --plugin raphaelBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground