debug-agent

A step-by-step method for finding the underlying cause of bugs, errors, and unexpected software behaviour. It starts by creating a small, repeatable test that shows the problem.

In plain words
What is it for?
Use it to investigate failing tests, changed behaviour, local-versus-production differences, unclear error messages, and incorrect output.
Why use it?
Without a reliable way to reproduce a failure, debugging often turns into guesses or fixes that only hide the symptom. The method gathers the error details and context before code is changed.

Skill for Claude CodeCodex

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/chandrudp29/skillhub/debug-agent
Any agent
npx skills add chandrudp29/skillhub --skill debug-agent
Clone the repo
git clone --depth 1 https://github.com/chandrudp29/skillhub

Made for: Claude Code, Codex.

Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 966 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.00034 $0.00966
Opus 5 $0.00017 $0.00483
Sonnet 5 $0.00007 $0.00193
Haiku 4.5 $0.00003 $0.00097

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

Security

Grade A, and why

debug-agent 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.

skills/debug-agent/SKILL.md · 98 lines

How it starts

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

Debug Agent

A discipline for finding root causes — not symptoms. Skips phases only when explicitly justified.

When to Use

  • "This is throwing an error I don't understand"
  • "This worked yesterday, now it doesn't"
  • "The output is wrong but I don't know why"
  • "It works locally but fails in production/CI"

Phase 1 — Build a feedback loop

This is the skill. Without a reproducible signal, everything else is guessing.

Build the tightest possible pass/fail test that exercises the bug:

  1. Failing unit/integration test
  2. CLI command with fixture input that shows the wrong output
  3. Curl / HTTP request that triggers the error
  4. Minimal script that reproduces the problem

The loop is ready when you can run one command and see the bug reliably.

If you can't reproduce it: ask the user for logs, a stack trace, environment details, or a way to access the failing environment. Do not hypothesize without a loop.

Phase 2 — Gather context

Before touching code, collect:

  • Full error message and stack trace (not "it says something about null")
  • When it started failing (specific commit? deploy? dependency update?)
  • Environment (OS, runtime version, env vars, cloud vs local)
  • What changed recently (git log --oneline -20, recent dep updates)
  • What's expected vs what's happening (exact expected output vs actual)

Run git bisect if it worked in a known past commit — narrows root cause in minutes.

Phase 3 — Hypothesize before touching code

Generate 3–5 ranked hypotheses. Each must be falsifiable:

"If [X] is the cause, then [changing Y] will make the bug disappear."

Show the ranked list before testing. Prevents anchoring on the first idea.

Common root cause categories (check in this order):

  1. Input data is different from what's expected (null, wrong type, wrong encoding)
  2. State from a previous operation is leaking (shared mutable state, unclosed connections)
  3. Async/concurrency issue (race condition, missing await, callback ordering)
  4. Environment difference (different versions, missing env var, path issue)
  5. Off-by-one / boundary condition
  6. Third-party API changed behavior (silent breaking change)

Read the full file on GitHub · 98 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. 2d ago First seen · 98 lines · 34 tokens per session scan A d883215b5fbe

Subscribe to this mod's changes

debug-agent is a skill published in the GitHub repository chandrudp29/skillhub (13 stars, last pushed 2mo ago), licensed MIT. It adds 34 tokens to every session and 966 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-30.