diagnosing-bugs

diagnosing-bugs is a skill for Claude Code, Codex from aethrox/doctrine. It costs 83 tokens per session (1,223 once invoked), scanned A, original, MIT.

A step-by-step method for finding the cause of software failures. It starts by understanding the normal system behavior, reproducing the failure, narrowing the search, and changing one thing at a time.

In plain words
What is it for?
Use it to investigate errors, crashes, failing tests, and unexpected behavior, while recording findings and removing secrets from logs or shared debugging material.
Why use it?
It replaces guesswork with evidence and keeps experiments understandable. It also requires checking that the original failure is fixed before declaring the work complete.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the doctrine plugin — 33 skills shipped together

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 skills/aethrox/doctrine/diagnosing-bugs
Any agent
npx skills add aethrox/doctrine --skill diagnosing-bugs
Clone the repo
git clone --depth 1 https://github.com/aethrox/doctrine

Made for: Claude Code, Codex.

Or install doctrine, the plugin that ships this one along with the rest of its 33 skills.

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 diagnosing-bugs

README.md
[![agentmods](https://agentmods.dev/badge/skills/aethrox/doctrine/diagnosing-bugs.svg)](https://agentmods.dev/skills/aethrox/doctrine/diagnosing-bugs)
Your own site
<a href="https://agentmods.dev/skills/aethrox/doctrine/diagnosing-bugs"><img src="https://agentmods.dev/badge/skills/aethrox/doctrine/diagnosing-bugs.svg" alt="Measured on agentmods" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,223 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.1 $0.00083 $0.01223
Opus 5 $0.00042 $0.00611
Sonnet 5 $0.00017 $0.00245
Haiku 4.5 $0.00008 $0.00122

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

Security

Grade A, and why

diagnosing-bugs 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 6d 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.

skills/diagnosing-bugs/SKILL.md · 58 lines

How it starts

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

Diagnosing Bugs

Debugging is not guessing with extra steps; it's a search problem, and a search problem has a systematic solution: understand the space you're searching, reproduce the failure on demand, shrink the search space by half at a time, and change exactly one thing per experiment so cause and effect stay unambiguous. Every rule below traces back to Agans' Debugging: The 9 Indispensable Rules; treat them as a sequence, not a menu to pick from.

Redact secrets before showing any command, log, or captured artifact: same discipline as secure-coding's Phase 3: replace credentials with <REDACTED>, quote only the lines carrying real signal from anything with auth headers or full payloads.

Rule 1: Understand the system

Before touching anything, know the normal path the failing code should take: read CONTEXT.md or equivalent domain docs if they exist, trace the flow from entry point to the point of failure, and know what "correct" looks like well enough to recognize it. A theory formed without this is a guess with the system's real shape substituted by an assumed one.

Rule 2: Make it fail, then look before you theorize

Reproduce on demand first. A bug that only happens "sometimes, somewhere in prod" isn't diagnosable yet; build the smallest repeatable trigger: a failing test, a script, a request replayed against a dev instance. For a flaky/non-deterministic failure, the goal isn't a clean 100% repro but a high enough reproduction rate to observe: loop it, add stress, narrow timing windows, until it fails often enough to study.

Then look, don't theorize. With a reproducible failure in hand, inspect the actual evidence (logs, state, a debugger breakpoint) before forming a hypothesis. A theory built by staring at code without first looking at what the system actually did is the single most common way to burn time chasing the wrong cause.

Rule 3: Divide and conquer

Shrink the suspect region by bisecting it, not by scanning it linearly:

Read the full file on GitHub · 58 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 6d ago First seen · 58 lines · 83 tokens per session scan A afdcb7f70093

Subscribe to this mod's changes

diagnosing-bugs is a skill published in the GitHub repository aethrox/doctrine (18 stars, last pushed 25d ago), licensed MIT. It adds 83 tokens to every session and 1,223 once invoked, about $0.0004 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 skills, from other repositories

chrome-devtools-cli

Use this skill to write shell scripts or run shell commands to automate tasks in the browser or otherwise use Chrome DevTools via CLI.

ChromeDevTools/chrome-devtools-mcp · 31 tokens

a11y-debugging

Uses Chrome DevTools MCP for accessibility (a11y) debugging and auditing based on web.dev guidelines. Use when testing semantic HTML, ARIA labels, focus states, keyboard navigation, tap targets, and color contrast.

ChromeDevTools/chrome-devtools-mcp · 50 tokens

chrome-devtools

Uses Chrome DevTools via MCP for efficient debugging, troubleshooting and browser automation. Use when debugging web pages, automating browser interactions, analyzing performance, or inspecting network requests. This skill does not apply to --slim mode (MCP configuration).

ChromeDevTools/chrome-devtools-mcp · 55 tokens

n8n-error-handling

Wire n8n error handling so failures are loud, structured, and recoverable. Use when building any webhook/API workflow, a scheduled or unattended workflow, or any path where a silent failure would drop user-visible work — and whenever the user mentions error handling, onError, continueErrorOutput, error…

czlonkowski/n8n-mcp · 128 tokens

n8n-validation-expert

Interpret validation errors and guide fixing them. Use when encountering validation errors, validation warnings, false positives, operator structure issues, or need help understanding validation results. Also use when asking about validation profiles, error types, the validation loop process, or auto-fix capabilities.…

czlonkowski/n8n-mcp · 91 tokens

agentcore-investigation

Investigate Bedrock AgentCore runtime sessions via CloudWatch Logs Insights — resolve session/trace IDs, query OTEL spans, filter noise, build timelines. Use when debugging AgentCore agent sessions, tracing tool calls, or analyzing latency.

awslabs/mcp · 52 tokens