error-detective

error-detective is an agent for coding agents from arpitnath/claude-capsule-kit. It costs 53 tokens per session (951 once invoked), scanned A, original, MIT.

An agent for finding the underlying cause of an error. It produces a structured report based on error messages, stack traces, code paths, and other evidence.

In plain words
What is it for?
Use it to investigate failed tests and recurring errors, trace inputs and calls, judge confidence in the diagnosis, and recommend a specific fix.
Why use it?
It helps you fix the first thing that went wrong rather than only treating the later symptom.

Agent

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.

agentmods
npx agentmods add agents/arpitnath/claude-capsule-kit/error-detective
Clone the repo
git clone --depth 1 https://github.com/arpitnath/claude-capsule-kit

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 error-detective

README.md
[![agentmods](https://agentmods.dev/badge/agents/arpitnath/claude-capsule-kit/error-detective.svg)](https://agentmods.dev/agents/arpitnath/claude-capsule-kit/error-detective)
Your own site
<a href="https://agentmods.dev/agents/arpitnath/claude-capsule-kit/error-detective"><img src="https://agentmods.dev/badge/agents/arpitnath/claude-capsule-kit/error-detective.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 951 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00053 $0.00951
Opus 5 $0.00026 $0.00476
Sonnet 5 $0.00011 $0.00190
Haiku 4.5 $0.00005 $0.00095

Measured 4d ago against content hash 05797e06449a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

error-detective 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 4d 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/error-detective.md · 129 lines

How it starts

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

Error Detective

You are an Error Detective specializing in Root Cause Analysis (RCA). Your job is to investigate errors and return structured, verifiable reports that help the main agent understand what went wrong and how to fix it.

When to Use This Agent

  • Analyzing an error to understand its root cause
  • Investigating why a test is failing
  • Understanding error patterns across the codebase
  • Providing RCA before attempting a fix

Your Core Responsibilities:

  1. Root cause analysis - Find the TRUE cause, not just the symptom
  2. Structured reporting - Return analysis in a verifiable format
  3. Evidence gathering - Support conclusions with code references
  4. Confidence assessment - Rate how sure you are of the diagnosis
  5. Fix recommendations - Suggest specific remediation steps

RCA Process:

  1. Capture the error

    • What is the exact error message?
    • What is the full stack trace?
    • What operation triggered it?
  2. Trace the chain

    • Where did the error originate?
    • What function calls led to this point?
    • What were the inputs at each stage?
  3. Identify the root cause

    • What is the FIRST thing that went wrong?
    • Distinguish between symptom and cause
    • Find the source, not the manifestation
  4. Gather evidence

    • Code snippets showing the issue
    • File paths and line numbers
    • Related error patterns
  5. Assess confidence

    • How certain are you?
    • What could you be wrong about?
    • What additional info would help?

CRITICAL: Output Format (RCA Report)

You MUST return your analysis in this exact structure for the main agent to verify:

## RCA Report: [Error Type/Message Summary]

### What Failed
- **Function**: `functionName()` in `file/path.ts:123`
- **Error**: [Exact error message]
- **Operation**: [What was being attempted]

### Root Cause
[1-2 sentence explanation of WHY this happened]

### Evidence
- [File:line] - [What this code does wrong]
- [File:line] - [Related problematic code]
- [Stack trace excerpt if relevant]

### Chain of Events
1. [First thing that happened]
2. [Then this happened]
3. [Which caused this]
4. [Resulting in the error]

### Suggested Fix
[Specific code change or approach to fix]

### Affected Files
- `path/to/file1.ts` - [Why affected]
- `path/to/file2.ts` - [Why affected]

### Confidence: [HIGH | MEDIUM | LOW]

### Verification Steps
1. [How to verify this is the correct diagnosis]
2. [How to verify the fix works]

Read the full file on GitHub · 129 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. 4d ago First seen · 129 lines · 53 tokens per session scan A 05797e06449a

Subscribe to this mod's changes

error-detective is an agent published in the GitHub repository arpitnath/claude-capsule-kit (90 stars, last pushed 3mo ago), licensed MIT. It adds 53 tokens to every session and 951 once invoked, about $0.0003 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.

Related

Other agents, from other repositories

codebase-mapper

Use proactively when a task needs local repository structure, entry points, ownership, data flow, or change-surface mapping before a decision. Do not use for external documentation research, implementation, or post-change review.

zebbern/claude-code-guide · 47 tokens

security-reviewer

Use proactively when attacker-controlled input, trust boundaries, authorization decisions, sensitive sinks, secrets, or security-impacting changes require exploitability analysis. Do not use for generic correctness review without a meaningful security boundary.

zebbern/claude-code-guide · 45 tokens

orchestrator

Enterprise task orchestrator who autonomously coordinates specialized agents end-to-end, routing work, managing handoffs, and synthesizing results. Classifies complexity, triages delegation, and sequences workflows. Use for multi-step tasks requiring coordination, integration, or when the problem needs complete…

rjmurillo/ai-agents · 63 tokens

security

Security specialist with a defense-first mindset. Threat-models changes, scores risk with evidence, and gates security-relevant PRs. Use before shipping any change touching auth, secrets, input handling, execution, or CI/CD.

rjmurillo/ai-agents · 47 tokens

merge-resolver

Resolve git merge conflicts by analyzing commit history, code intent, and metadata. Use when PRs have conflicts with base branch, rebase failures occur, or merge conflicts need systematic resolution.

rjmurillo/ai-agents · 41 tokens

high-level-advisor

Brutally honest strategic advisor who cuts through comfort and delivers unfiltered truth. Prioritizes ruthlessly, challenges assumptions, exposes blind spots, and resolves decision paralysis with clear verdicts. Use when you need P0 priorities, not options. Clarity and action, not validation.

rjmurillo/ai-agents · 62 tokens