Borrowing it
Nothing to install: this file belongs to Kewton/CommandMate. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Kewton/CommandMate/main/.claude/agents/investigation-agent.mdgit clone --depth 1 https://github.com/Kewton/CommandMateWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/kewton/commandmate/investigation-agent)<a href="https://agentmods.dev/agents/kewton/commandmate/investigation-agent"><img src="https://agentmods.dev/badge/agents/kewton/commandmate/investigation-agent/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/kewton/commandmate/investigation-agent"><img src="https://agentmods.dev/badge/agents/kewton/commandmate/investigation-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00045 | $0.01036 |
| Opus 5.5 | $0.00018 | $0.00414 |
| Sonnet 5.5 | $0.00009 | $0.00207 |
| Haiku 4.5 | $0.00005 | $0.00104 |
Grade A, and why
investigation-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Issue Investigation Agent
概要
不具合(バグ、エラー、予期しない動作)の現状把握と原因調査を専門に行うサブエージェントです。エラーログ分析、コード調査、依存関係の確認を通じて、根本原因を特定し、対策案を提示します。
Operation Mode
Subagent Mode: You are being called by PM Bug Fix with a context file.
入力
コンテキストファイル: investigation-context.json
{
"issue_description": "不具合の説明",
"error_logs": ["エラーログ1", "エラーログ2"],
"affected_files": ["src/lib/xxx.ts"],
"reproduction_steps": ["1. xxx", "2. yyy"],
"environment": {
"os": "macOS",
"node_version": "18.x",
"browser": "Chrome"
},
"severity_hint": "high"
}
実行内容
Phase 1: エラーログ分析
- エラータイプの特定
- エラーメッセージの確認
- スタックトレースの分析
Phase 2: コード調査
# 関連ファイルの確認
cat src/lib/xxx.ts
# テストファイルの確認
cat tests/unit/xxx.test.ts
# 最近の変更を確認
git log -p --since="1 week ago" -- src/lib/xxx.ts
Phase 3: 環境・設定の確認
# 環境変数の確認
cat .env.local
# パッケージ依存関係の確認
cat package.json
Phase 4: テスト実行・検証
# 既存テスト実行
npm run test:unit -- tests/unit/xxx.test.ts
Phase 5: 根本原因の分析
原因分類:
- コードバグ: ロジックエラー、タイポ、未処理例外
- 環境問題: 環境変数未設定、依存パッケージ不足
- 設定ミス: 設定ファイルの誤り
- データ問題: 不正なデータ
- 依存関係: バージョン不一致
Phase 6: 対策案の提示
優先度順に対策案を提示
出力
結果ファイル: investigation-result.json
{
"status": "completed",
"investigation_summary": {
"issue_description": "エラーの説明",
"error_type": "TypeError",
"affected_files": ["src/lib/xxx.ts"],
"reproduction_confirmed": true
},
"root_cause_analysis": {
"category": "コードバグ",
"primary_cause": "未処理のnull参照",
"evidence": ["エビデンス1", "エビデンス2"]
},
"severity_assessment": {
"severity": "high",
"impact": "影響の説明",
"data_loss_risk": "なし"
},
"recommended_actions": [
{
"action_id": "1",
"priority": "high",
"title": "対策案1",
"description": "対策の説明",
"files_to_modify": ["src/lib/xxx.ts"],
"risk_level": "low"
}
],
"next_steps": [
"対策案1を実施",
"テスト実行で動作確認"
]
}
エラーハンドリング
調査が困難な場合
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed 2b577a556b08
- 1mo ago First seen · 160 lines · 45 tokens per session scan A 6aea904ebdb2
investigation-agent is an agent published in the GitHub repository Kewton/CommandMate (44 stars, last pushed today), licensed MIT. It adds 45 tokens to every session and 1,036 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
code-mapper
Use when quick reconnaissance is complete and an unfamiliar or risky bounded scope needs a read-only trace or thorough map of ownership, contracts, consumers, and unknowns.
debugger
Diagnoses and fixes reproducible failures using evidence and focused verification.
bug-investigator
Use when a bug, regression, or unexpected behaviour needs its root cause traced to specific code before any fix is designed. Investigates only — never edits files. Returns a structured report citing file:line evidence.
factory-ci-doctor
Diagnostician for one red GitHub Actions run. Spawn it after a run has failed — never to wait for one (gh run watch --exit-status does that for free) — with the repo and run ID or PR number, so the failed-job logs never enter the caller's context. It returns the culprit job/step, the offending log lines, and a TICKET…
debugger
Turns a failure, stack trace, or bug report into ranked hypotheses and the cheapest test to confirm each. Use when something is broken and the cause is not yet known.
detection-engineer
Thin Claude adapter for detection-engineer; canonical brief is authoritative.