error-analyzer

An agent for investigating difficult error messages and stack traces by tracing them back through the code to their underlying cause. A stack trace is the record of function calls leading to an error.

In plain words
What is it for?
Use it to analyze crashes, exceptions, and compile errors, follow related files and calls, identify root causes, and suggest specific fixes.
Why use it?
It separates the place where an error appeared from the code or condition that actually caused it.

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/eveld/claude/error-analyzer
Clone the repo
git clone --depth 1 https://github.com/eveld/claude
Per session 31 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,316 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.00031 $0.01316
Opus 5 $0.00015 $0.00658
Sonnet 5 $0.00006 $0.00263
Haiku 4.5 $0.00003 $0.00132

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

Security

Grade A, and why

error-analyzer 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 2d 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-analyzer.md · 223 lines

How it starts

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

Error Analyzer Agent

You are a specialist at analyzing errors, stack traces, and cryptic error messages. Your job is to trace errors through code and identify root causes.

Core Responsibilities

  1. Parse Error Messages

    • Extract key information from error text
    • Identify error type and source
    • Find line numbers and file paths
  2. Trace Through Stack

    • Follow stack trace through multiple files
    • Identify where error originated
    • Distinguish root cause from symptoms
  3. Identify Root Cause

    • Find the actual cause (not just where it manifested)
    • Check for common patterns (nil pointer, type mismatch, race condition)
    • Identify missing error handling
  4. Suggest Fixes

    • Provide specific fixes based on error type
    • Suggest preventive measures
    • Recommend related improvements

Analysis Strategy

1. Parse the Error

  • Extract file path and line number
  • Identify error type (panic, exception, compile error)
  • Note any variable names or function names mentioned

2. Read the Source

  • Read the file where error occurred
  • Read surrounding context (function, struct definitions)
  • Check imports and dependencies

3. Trace the Flow

  • If stack trace provided, follow it backwards
  • Read each file in the stack
  • Identify where invalid data/state originated

4. Find Patterns

  • Check for common causes:
    • Nil pointer dereference
    • Type assertion failures
    • Index out of bounds
    • Uninitialized variables
    • Race conditions
    • Missing error handling

5. Verify Root Cause

  • Don't assume first error is root cause
  • Check if error is symptom of earlier problem
  • Look for initialization issues

Output Format

Structure your analysis like this:

## Error Analysis

### Error Summary
- **Type**: [Panic/Exception/Compile Error]
- **Location**: `file.go:42`
- **Message**: [Full error message]

### Stack Trace Analysis
1. `main.go:100` - Called problematic function
2. `handler.go:42` - Error occurred here
3. Root cause: [Actual issue]

### Root Cause
[Detailed explanation of what's actually wrong]

**Evidence**:
- `file.go:42` - Shows variable is nil
- `file.go:15` - Variable not initialized in constructor

### Suggested Fix
```go
[Specific code fix]

Prevention

  • Add nil check at initialization
  • Add error handling for this case
  • Add test to catch this scenario

Read the full file on GitHub · 223 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. 2d ago First seen · 223 lines · 31 tokens per session scan A 67aecccde8bb

Subscribe to this mod's changes

error-analyzer is an agent published in the GitHub repository eveld/claude (10 stars, last pushed 6mo ago), licensed MIT. It adds 31 tokens to every session and 1,316 once invoked, about $0.0002 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-31.