angry-diagnose

angry-diagnose is a command for Claude Code from Custos/angry-ralph. It costs 25 tokens per session (1,171 once invoked), scanned C, original, MIT.

A command for investigating bugs by comparing possible causes and proving them with failing tests before changing the code. TDD, or test-driven development, means using tests to guide the fix.

In plain words
What is it for?
It helps diagnose errors from descriptions, logs, stack traces, and source files; generate and test several hypotheses; and implement a fix after the evidence is checked.
Why use it?
It reduces guesswork by testing competing explanations for a symptom instead of immediately choosing one suspected cause.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the angry-ralph plugin — 1 skill, 8 commands, 1 agent, 2 hooks shipped together

Good fit It helps diagnose errors from descriptions, logs, stack traces, and source files; generate and test several hypotheses; and implement a fix after the evidence is checked.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Custos/angry-ralph
Claude Code
/plugin install angry-ralph

Made for: Claude Code.

Or install angry-ralph, the plugin that ships this one along with the rest of its 1 skill, 8 commands, 1 agent, 2 hooks.

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 angry-diagnose

README.md
[![agentmods](https://agentmods.dev/badge/commands/custos/angry-ralph/angry-diagnose.svg)](https://agentmods.dev/commands/custos/angry-ralph/angry-diagnose)
Your own site
<a href="https://agentmods.dev/commands/custos/angry-ralph/angry-diagnose"><img src="https://agentmods.dev/badge/commands/custos/angry-ralph/angry-diagnose.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 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,171 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00025 $0.01171
Opus 5 $0.00013 $0.00585
Sonnet 5 $0.00005 $0.00234
Haiku 4.5 $0.00003 $0.00117

Measured 8d ago against content hash ecc047f60975, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade C, and why

angry-diagnose scanned grade C with 1 finding 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 8d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

If start fresh: `rm -rf .ralph-state/ .planning/diagnosis/` and continue.
commands/angry-diagnose.md · 123 lines

How it starts

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

/angry-diagnose Command

Adversarial bug investigation pipeline. Generates competing hypotheses for a bug's root cause using external LLMs, then systematically proves/disproves each hypothesis via failing tests before implementing the fix.

1. Argument Parsing

Parse the invocation arguments:

  • @file references (optional, multiple) -- Error logs, stack traces, suspect source files as context.
  • Prompt text (required) -- Description of the problem/symptom.
  • --auto (optional) -- Skip clarifying questions, auto-accept findings, test all hypotheses.
  • --max-hypotheses N (optional, default: 5) -- Maximum number of hypotheses to generate.
  • --help (optional) -- Print command reference and exit.

--help Output

If --help is passed, print the following and stop:

angry-diagnose — Adversarial bug diagnosis with differential diagnosis and hypothesis-driven TDD.

Usage:
  /angry-diagnose [@context-files...] "problem description" [--auto] [--max-hypotheses N]

Examples:
  /angry-diagnose "the API returns 500 on large payloads"
  /angry-diagnose @error.log "users can't login after password reset"
  /angry-diagnose @src/auth.ts @error.log "this middleware leaks sessions"

Options:
  --auto                Skip questions, auto-accept findings, test all hypotheses.
  --max-hypotheses N    Max competing hypotheses to generate (default: 5).

Phases:
  1. INVESTIGATE    Gather context, build case file, interview user.
  2. DIAGNOSE       Generate competing hypotheses via external LLMs (differential diagnosis).
  3. FIX            Prove/disprove hypotheses via diagnostic tests, fix confirmed root cause.
  4. VERIFY         Mechanical gates + adversarial verification of the fix.

State: .ralph-state/ (gitignored)
Artifacts: .planning/diagnosis/ (gitignored)

If no prompt text is provided and --help is not passed, report the error and display the help text.

2. Environment Validation

Run via the Bash tool:

bash ${CLAUDE_PLUGIN_ROOT}/scripts/checks/validate-env.sh

Read the full file on GitHub · 123 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. 8d ago First seen · 123 lines · 25 tokens per session scan C ecc047f60975

Subscribe to this mod's changes

angry-diagnose is a command published in the GitHub repository Custos/angry-ralph (5 stars, last pushed 6mo ago), licensed MIT. It adds 25 tokens to every session and 1,171 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.