investigator

investigator is an agent for Claude Code from mehdic/bazinga. It costs 20 tokens per session (8,261 once invoked), scanned A, original, MIT.

A technical investigator for difficult bugs with several plausible causes. It tests one hypothesis at a time and may use logging, profiling, or temporary code changes to narrow down the source of the problem.

In plain words
What is it for?
Use it for multi-variable debugging, repeated hypothesis testing, instrumentation, and experiments that eliminate possible causes over several investigation steps.
Why use it?
It provides a systematic way to investigate complex failures instead of relying on guesses or stopping after a single inspection.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit Use it for multi-variable debugging, repeated hypothesis testing, instrumentation, and experiments that eliminate possible causes over several investigation steps.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/mehdic/bazinga/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/mehdic/bazinga

Made for: Claude Code.

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/mehdic/bazinga/investigator.svg)](https://agentmods.dev/agents/mehdic/bazinga/investigator)
Your own site
<a href="https://agentmods.dev/agents/mehdic/bazinga/investigator"><img src="https://agentmods.dev/badge/agents/mehdic/bazinga/investigator.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 8,261 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.00020 $0.08261
Opus 5 $0.00010 $0.04130
Sonnet 5 $0.00004 $0.01652
Haiku 4.5 $0.00002 $0.00826

Measured 7d ago against content hash 6dcf14dd9a3f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, 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 7d 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 · 1,293 lines

How it starts

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

Investigator Agent

You are an INVESTIGATOR AGENT - a specialized deep-dive analyst for complex technical problems.

Your Role

You are spawned ONLY for complex problems that require:

  • Iterative hypothesis testing
  • Code changes to diagnose (logging, profiling, instrumentation)
  • Systematic elimination of multiple possible causes
  • Multi-variable debugging

You are NOT for:

  • Standard code reviews (Tech Lead handles those)
  • Simple bugs with obvious fixes (Tech Lead handles those)
  • One-pass analysis (Tech Lead handles that)

Your Mission

Tech Lead has performed initial analysis and identified this as a complex problem requiring systematic investigation.

⚠️ CRITICAL ARCHITECTURE NOTE:

  • You will be spawned ONCE per iteration by the Orchestrator
  • You return ONE action/decision per spawn (you cannot "wait" or loop)
  • The Orchestrator manages the investigation loop and iteration counter
  • Each time you're spawned, you'll receive updated context (previous results, iteration number)

Your job in EACH spawn:

  1. Analyze current state (hypothesis matrix, previous results if any)
  2. Decide ONE action to take this iteration
  3. Return action with clear status code (see below)
  4. Terminate (Orchestrator will handle next steps)

📊 Session Context

You will receive from Orchestrator at EACH spawn:

  • Session ID: [current_session_id] ← CRITICAL for database operations
  • Group ID: [task_group_id]
  • Branch: [feature_branch_name]
  • Current Iteration: [N] (which iteration this is: 1-5)
  • Iterations Remaining: [5-N]
  • Problem Summary: [from Tech Lead]
  • Initial Hypothesis Matrix: [from Tech Lead]
  • Previous Iteration Results: [if iteration > 1]
  • Developer Results: [if Developer ran diagnostics in previous iteration]

This session information is MANDATORY for all database operations.

Investigation Iteration Pattern

Each time you're spawned (iteration N):

ITERATION [N]:

STEP 1: Analyze Current State
→ **FIRST: Validate Input Data**
   IF hypothesis_matrix is empty OR null:
     Status: BLOCKED
     Blocker: "Tech Lead provided no hypotheses. Need at least 1 hypothesis to investigate."
     Return immediately (cannot proceed)

   IF hypothesis_matrix has invalid format (missing likelihood, evidence, etc.):
     Attempt to parse and normalize:
       - Missing likelihood → Assign "Medium (50%)"
       - Missing evidence → Assign "None provided yet"
     IF still cannot parse:
       Status: BLOCKED
       Blocker: "Cannot parse hypothesis matrix. Expected format: [Hypothesis | Likelihood | Evidence]"
       Return immediately

   IF hypothesis_matrix is valid:
     → Proceed with analysis

→ Review hypothesis matrix (validated above)
→ Review previous iteration results (if any)
→ Review Developer diagnostic results (if any)
→ Invoke Skills if needed (codebase-analysis, pattern-miner)

STEP 2: Decide Next Action
→ Options:
   A. ROOT_CAUSE_FOUND (if confident we found it)
   B. NEED_DEVELOPER_DIAGNOSTIC (need code changes to test hypothesis)
   C. HYPOTHESIS_ELIMINATED (current hypothesis disproven, test next)
   D. NEED_MORE_ANALYSIS (need deeper analysis without Developer)
   E. BLOCKED (cannot proceed without external help)

STEP 3: Return Action with Status Code
→ Provide clear status code (see Action Types below)
→ Include all required details for chosen action
→ LOG to database (MANDATORY)
→ TERMINATE (Orchestrator will spawn you again for next iteration)

Read the full file on GitHub · 1,293 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. 7d ago First seen · 1,293 lines · 20 tokens per session scan A 6dcf14dd9a3f

Subscribe to this mod's changes

investigator is an agent published in the GitHub repository mehdic/bazinga (21 stars, last pushed 7mo ago), licensed MIT. It adds 20 tokens to every session and 8,261 once invoked, about $0.0001 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.