Help us improve
Share bugs, ideas, or general feedback.
From chronista-style
AI agent 自身の failure (loop / drift / max tool call / 環境ズレ) に対する構造化 self-debug。 capture → diagnose → contained recovery → introspection report の 4 phase で、 retry blind を防ぎ human escalation の前に agent が自己修正する。
npx claudepluginhub chronista-club/claude-plugin-chronista-style --plugin chronista-styleHow this skill is triggered — by the user, by Claude, or both
Slash command
/chronista-style:agent-introspectionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **「同じ tool を 3 回叩く前に、世界の状態を確認せよ。」**
Guides technical evaluation of code review feedback: read fully, restate for understanding, verify against codebase, respond with reasoning or pushback before implementing.
Share bugs, ideas, or general feedback.
「同じ tool を 3 回叩く前に、世界の状態を確認せよ。」
Core principle: agent が repeated failure に遭遇したとき、 blind retry は token を消費するだけで前進しない。 失敗を capture → diagnose → contained recovery の構造で扱い、推測ではなく観察で動く。
3 回失敗したら、 retry を止めて diagnose せよ
「もう 1 回試せば動くかも」は agent failure の anti-pattern 1 番。
AI agent (Claude Code session / VP Stand actor / VP worker lane / 自作 LLM agent) が次のような症状を見せたとき:
| ❌ agent-introspection を使うな | ✅ 代わりに |
|---|---|
| コード/システムのバグ調査 (test failure / production bug) | systematic-debugging |
| 完了前 deterministic 検証 (build/lint/test) | verification |
| code 変更後の機能検証 | verification |
| 設計判断の合議 | council |
| output の品質検証 | santa-method |
| 完全に runtime 制御不可な領域 (harness 自体の bug) | human escalation |
activate 対象:
activate しない:
verification の領域)Capture → Diagnose → Contain → Report
番号でなく名前で参照する。
retry 前に正確に失敗を記録する。 blind retry より先に必ず capture。
## Failure Capture
- Session / task:
- Goal in progress:
- Error:
- Last successful step:
- Last failed tool / command:
- Repeated pattern seen:
- Environment assumptions to verify:
何かを変える前に、 failure を既知 pattern に match する。
| Pattern | 推定 root cause | check |
|---|---|---|
| Max tool calls / 同 cmd 反復 | loop / 出口がない observer path | 直近 N 個の tool call を inspect |
| Context overflow / reasoning 劣化 | 無制限 note、 plan 重複、 oversize log | recent context の冗長性を確認 |
ECONNREFUSED / timeout | service 不在 or 不正 port | service health / URL / port を確認 |
429 / quota | retry storm or backoff 欠落 | call 頻度と spacing 確認 |
| 書き込み後 file 不在 / stale diff | race / 不正 cwd / branch drift | path / cwd / git status / 実 file 確認 |
| 修正後も test 失敗 | 仮説が wrong | 失敗 test 1 つに絞り bug 再導出 |
diagnosis surface を変える最小 actionを取る。 recovery 自体が cascade を引き起こさないように。
重要: 「reset agent state」「update harness config」のような harness が実際 enforce できない action を約束するな。 actual tool で実行できるものだけを claim せよ。
## Recovery Action
- Diagnosis chosen:
- Smallest action taken:
- Why this is safe:
- What evidence would prove the fix worked:
次の agent / human が読んで動ける形で報告する。 「I fixed it」だけは不十分。
## Agent Self-Debug Report
- Session / task:
- Failure:
- Root cause:
- Recovery action:
- Result: success | partial | blocked
- Token / time burn risk:
- Follow-up needed:
- Preventive change to encode later:
| ❌ 悪い pattern | ✅ 良い pattern |
|---|---|
| 同 action を 3 回 wording だけ変えて retry | capture → classify → 1 direct check → check の結果で plan 変更 |
| 失敗を黙って context に積む | capture を Report で永続化 |
| diagnose なしで retry storm | MAX 3 で escalate |
agent failure pattern は 再利用可能な instinct になりやすい。 memory に積極的に記録:
| 状況 | 記録方法 |
|---|---|
| 新しい failure pattern | category: learning, tag: [agent-failure, pattern-name] |
| 既知 pattern の再発 | 既存 memory に extends で reply / annotation |
| harness 改善のトリガー | category: design-decision, tag: [harness-evolution, agent-introspection] |
| 緊急 escalation | category: incident, tag: [urgent, agent-stuck] |
学びの形:
agent-harness 参照)Worker が autonomous で走っていて、同じ tool を反復し始めた:
wire_send で lead に「迷ってる、 confirmation 欲しい」 (autonomous の safety valve)VP の PP Stand actor が event を処理せず idle 化:
session が長くなり、 reasoning quality が落ちた感覚があるとき:
| ❌ 悪い | ✅ 良い |
|---|---|
| 失敗してすぐ blind retry | capture → diagnose → contain |
| diagnose なしで「reset agent state」claim | actual tool で実行できる action のみ |
| Report skip して「I fixed it」 | 必ず failure pattern + root cause + recovery + evidence |
| 同 reviewer / agent で fix loop | escalate to human (or fresh agent) |
| failure pattern を memory に残さない | learning category で pin、 instinct 化 |
| systematic-debugging と混同 | コードバグは systematic-debugging、 agent failure は agent-introspection |
| スキル | 役割 | agent-introspection との関係 |
|---|---|---|
systematic-debugging | コード/システムバグの根本原因調査 | 領域が異なる: agent-introspection = agent 自身の failure、 systematic-debugging = code/system のバグ |
agent-harness | harness 設計 | 補完: harness で予防、 introspection で検出 |
verification | 完了前 deterministic checks | verification は build/test、 introspection は agent 内部 |
council | 設計判断 | introspection の result を council にかける流れもある |
santa-method | output 検証 | santa は output、 introspection は agent process 自身 |
route | path 選択 | route で plot した path が走らなかったとき introspection |
逆に発火しないケース:
systematic-debugging 領域)council 領域)| Phase | 主な活動 | 完了条件 |
|---|---|---|
| Capture | 失敗 state を template に埋める | what / where / why が記述された |
| Diagnose | pattern table と match | root cause hypothesis 確立 |
| Contain | 最小 action で recovery | evidence で fix 確認 or escalate |
| Report | self-debug report 出力 | next agent / human が読んで動ける |
agent-introspection-debugging (Everything Claude Code)systematic-debugging (コード/システムバグ用、 領域が異なる)agent-harness, council, santa-method, verification