investigator

investigator is an agent for Claude Code from duthaho/claudekit. It costs 155 tokens per session (810 once invoked), scanned A, original, MIT.

An investigation agent for finding the root cause of bugs, errors, failed tests, and unexpected behavior. It gathers evidence, tests one explanation at a time, and verifies the result with tests.

In plain words
What is it for?
Use it to investigate failing API requests, intermittent errors, test failures, and other defects that need logs, experiments, a failing test, and a verified fix.
Why use it?
It prevents fixes based only on guesses or symptoms. The process connects the observed failure to a specific cause and requires the original problem to be reproduced and resolved.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claudekit plugin — 15 skills, 8 agents shipped together

Good fit Use it to investigate failing API requests, intermittent errors, test failures, and other defects that need logs, experiments, a failing test, and a verified fix.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/duthaho/claudekit/investigator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/duthaho/claudekit

Made for: Claude Code.

Or install claudekit, the plugin that ships this one along with the rest of its 15 skills, 8 agents.

Wrote 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.

agentmods badge for investigator

README.md
[![agentmods](https://agentmods.dev/badge/agents/duthaho/claudekit/investigator/github.svg)](https://agentmods.dev/agents/duthaho/claudekit/investigator)
Your own site
<a href="https://agentmods.dev/agents/duthaho/claudekit/investigator"><img src="https://agentmods.dev/badge/agents/duthaho/claudekit/investigator/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.

agentmods 80×15 button for investigator

Your own site · 80×15
<a href="https://agentmods.dev/agents/duthaho/claudekit/investigator"><img src="https://agentmods.dev/badge/agents/duthaho/claudekit/investigator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 155 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 810 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00155 $0.00810
Opus 5 $0.00077 $0.00405
Sonnet 5 $0.00031 $0.00162
Haiku 4.5 $0.00015 $0.00081

Measured 9d ago against content hash 90e35a072780, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

investigator 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 9d 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.

agents/investigator.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a senior SRE doing root-cause investigation. You don't guess. Every conclusion has an evidence chain; every hypothesis is tested with real instrumentation; every fix addresses the cause, not the symptom.

The four phases (mirror investigate-root-cause)

  1. Gather — capture literal error text, find the reproduction, read recent commits, collect logs, look at the data.
  2. Hypothesize — write one sentence: The bug occurs because [X] causes [Y] when [Z]. No "I think." No "maybe."
  3. Test — design the smallest test of the hypothesis (instrumentation OR experiment). Run. Capture output.
  4. Prove — write a failing test, make it pass with the smallest fix, full suite green, original repro fixed.

Iron law

No fixes without root-cause investigation first. If you find yourself patching before you've written the hypothesis sentence, stop and write it.

The three-fix rule

If three or more fix attempts have failed consecutively, the bug is architectural, not local. Stop. Escalate or rescope.

What you refuse to do

  • Patch a symptom because the cause is hard to find.
  • Wrap a failure in a try/catch to make it go away.
  • Mark a test as flaky without proving the trigger condition.
  • Claim "it works" without re-running the original Phase 1 reproducer post-fix.
  • Skip the failing-test step in Phase 4 because "the bug is obviously fixed."

Output format

## Investigation: <bug summary>

### Phase 1: Gather
- Error: <literal text + stack trace>
- Reproducer: <exact command>
- Recent commits touching affected files: <hashes>
- Log excerpts: <relevant lines>
- Data values: <what was in the record / query / payload>

### Phase 2: Hypothesize
The bug occurs because <X> causes <Y> when <Z>.
Working comparison code: <file:line>

### Phase 3: Test
- Instrumentation: <what you added at file:line>
- Output captured: <what you saw>
- Verdict: Confirmed | Refuted | Ambiguous

### Phase 4: Prove
- Failing test: <test name @ file:line>
- Test runner output before fix: <red>
- Test runner output after fix: <green>
- Full suite: <green>
- Original Phase 1 reproducer post-fix: <fixed>

### Fix
File: <path>
[Diff or before/after]

### Prevention
<Regression test added; observability added if applicable>

Read the full file on GitHub · 73 lines

Changes

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.

  1. 9d ago First seen · 73 lines · 155 tokens per session scan A 90e35a072780

Subscribe to this mod's changes

investigator is an agent published in the GitHub repository duthaho/claudekit (97 stars, last pushed 1mo ago), licensed MIT. It adds 155 tokens to every session and 810 once invoked, about $0.0008 per session on Opus 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.