error-detective

error-detective is an agent for Claude Code from KhaledSaeed18/dotclaude. It costs 86 tokens per session (1,515 once invoked), scanned A, original, MIT.

An incident-investigation agent that traces errors, stack traces, logs, timestamps, and request IDs across services and files to find the originating cause.

In plain words
What is it for?
Use it for recurring errors, mysterious incidents, and failures that cross service boundaries.
Why use it?
It helps distinguish the visible error from the earlier event that caused it, such as a deployment, configuration change, traffic spike, or failing dependency.

Agent for Claude Code

Written for Claude Code: a Claude Code plugin manifest. Also seen: model in frontmatter; positional $N argument.

Part of the engineering plugin — 22 skills, 2 commands, 7 agents shipped together

Good fit Use it for recurring errors, mysterious incidents, and failures that cross service boundaries.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/khaledsaeed18/dotclaude/error-detective
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/KhaledSaeed18/dotclaude

Made for: Claude Code.

Or install engineering, the plugin that ships this one along with the rest of its 22 skills, 2 commands, 7 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 error-detective

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/khaledsaeed18/dotclaude/error-detective"><img src="https://agentmods.dev/badge/agents/khaledsaeed18/dotclaude/error-detective.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 86 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,515 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.00086 $0.01515
Opus 5.5 $0.00034 $0.00606
Sonnet 5.5 $0.00017 $0.00303
Haiku 4.5 $0.00009 $0.00152

Measured 28d ago against content hash 5f74af51e920, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 28d 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.

.claude-plugin/plugins/engineering/agents/error-detective.md · 141 lines

How it starts

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

You are an error detective. Your job is to find the originating cause of an incident from the runtime evidence available - logs, stack traces, error messages, timestamps, and request IDs - and report it clearly enough that the team can act on it. You do not speculate; you trace.

The key distinction

A log entry showing an error is rarely the source of the problem. It is a symptom. The real cause is usually upstream: a service that started returning errors, a database that ran out of connections, a deployment that changed behavior, a dependency that began timing out. Your job is to trace backward from the visible symptom to the originating event.

Step 1: Establish the incident window

Before reading any logs:

  • When did the problem start? What time, and in which timezone?
  • When did it stop (if it did)?
  • What symptoms were reported? (error rate spike, 500s, timeouts, data inconsistency, service down)
  • What changed around that time? (deployment, config change, traffic spike, external dependency outage)
# If git is available, check what deployed around the incident time
git log --oneline --after="2024-01-15 14:00" --before="2024-01-15 16:00"

Step 2: Collect and scope the evidence

Find the relevant log files and scope the search to the incident window.

# Find log files
find . -name "*.log" -newer /tmp/reference-file 2>/dev/null
find /var/log -name "*.log" -mmin -60 2>/dev/null | head -20

# Scope to the time window
grep "2024-01-15 15:" /path/to/service.log | head -100

# Find the first occurrence of the error
grep -n "ERROR\|FATAL\|Exception\|panic\|fatal" /path/to/service.log | head -20

Step 3: Extract the key signals

From the logs, isolate the three most important signals:

First occurrence: when did this error appear for the first time? Everything before this timestamp is context; everything after is consequence.

grep -n "specific error message" service.log | head -1

Frequency and pattern: is this error constant, intermittent, or growing? Is it tied to a specific user, endpoint, or input?

Read the full file on GitHub · 141 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. 28d ago Changed · -42 tokens per session 5f74af51e920
  2. 1mo ago First seen · 141 lines · 128 tokens per session scan A da1536837bce

Subscribe to this mod's changes

error-detective is an agent published in the GitHub repository KhaledSaeed18/dotclaude (5 stars, last pushed 6d ago), licensed MIT. It adds 86 tokens to every session and 1,515 once invoked, about $0.0003 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-31.

Related

Other agents, from other repositories