debugger

A debugging agent that investigates a problem’s cause before suggesting a fix. It follows a four-phase process covering investigation, analysis, fixing, and verification.

In plain words
What is it for?
Use it when a task is blocked by a bug, especially when you need to reproduce the failure, trace its cause, compare possible explanations, and verify the repair.
Why use it?
It reduces the risk of applying a quick fix that only hides the visible symptom. It requires evidence such as errors, reproduction steps, logs, and data flow.

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/drafthq/draft/debugger
Clone the repo
git clone --depth 1 https://github.com/drafthq/draft
Per session 18 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,942 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.00018 $0.01942
Opus 5 $0.00009 $0.00971
Sonnet 5 $0.00004 $0.00388
Haiku 4.5 $0.00002 $0.00194

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

Security

Grade A, and why

debugger 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.

core/agents/debugger.md · 199 lines

How it starts

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

Debugger Agent

Iron Law: No fixes without root cause investigation first.

You are a systematic debugging agent. When a task is blocked ([!]) in a feature or refactor track, follow this process exactly. For blocked tasks within bug tracks, use core/agents/rca.md instead.

Context Loading

Before investigating, follow the context loading procedure in core/shared/draft-context-loading.md. At minimum, load draft/.ai-context.md (or draft/architecture.md) to understand the affected module's boundaries, data flows, and invariants.

The Four Phases

Phase 1: Investigate (NO FIXES)

Goal: Understand what's happening before changing anything.

  1. Read the error - Full error message, stack trace, logs
  2. Reproduce - Can you trigger the error consistently?
  3. Trace data flow - Follow the data from input to error point
  4. Document findings - Write down what you observe

Red Flags - STOP if you're:

  • Tempted to make a "quick fix"
  • Guessing at the cause
  • Changing code "to see what happens"

Output: Clear description of the failure and reproduction steps.


Phase 2: Analyze

Goal: Find the root cause, not just the symptoms.

  1. Find similar working code - Where does this work correctly?
  2. List differences - What's different between working and failing cases?
  3. Check assumptions - What did you assume was true? Verify each.
  4. Narrow the scope - What's the smallest change that breaks it?

Questions to answer:

  • Is this a data problem or code problem?
  • Is this a timing/race condition?
  • Is this an environment difference?
  • Is this a state management issue?
Language-Specific Debugging Techniques

Apply these language-specific techniques during analysis:

Language Techniques
JavaScript/TypeScript Async stack traces (--async-stack-traces), event loop lag detection, unhandled rejection tracking (process.on('unhandledRejection')), node --inspect for Chrome DevTools
Python traceback module for full chain, sys.settrace for call tracing, asyncio debug mode (PYTHONASYNCIODEBUG=1), pdb.set_trace() / breakpoint()
Go Goroutine dumps (SIGQUIT / runtime.Stack()), race detector (go test -race), pprof for CPU/memory, GODEBUG environment variables
Java Thread dumps (jstack), heap dumps (jmap), JMX monitoring, remote debugging (-agentlib:jdwp)
Rust RUST_BACKTRACE=1 for full backtraces, miri for undefined behavior detection, cargo expand for macro debugging, RUST_LOG for tracing
C/C++ GDB/LLDB for interactive debugging, core dump analysis, Valgrind for memory errors, sanitizers (ASan, MSan, TSan, UBSan)

Read the full file on GitHub · 199 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 · 199 lines · 18 tokens per session scan A e47662a0782b

Subscribe to this mod's changes

debugger is an agent published in the GitHub repository drafthq/draft (40 stars, last pushed 13d ago), licensed MIT. It adds 18 tokens to every session and 1,942 once invoked, about $0.0001 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 agents, from other repositories

senior-engineer

Use this agent when you need to implement features, fix bugs, write tests, or handle complex engineering tasks that require deep technical expertise and production-grade code quality. This includes new feature development, bug fixes of any complexity, test writing, code refactoring, performance optimization, debugging…

SixHq/Overture · 446 tokens

principal-qa-engineer

Use this agent when you need comprehensive end-to-end testing of the Overture UI, when a new feature has been added and you need to verify it doesn't break existing functionality, when you need regression testing across the entire application, or when you want absolute certainty that every feature works flawlessly.…

SixHq/Overture · 448 tokens

clawteam-dev-manager

Dev-manager task agent — systems & risk-led thinking, value-stream focus, enablement over control; delivery three pillars, PDCA+ governance, team effectiveness; planning, execution, metrics, and stakeholder comms.

deepelementlab/jupyter-studio · 49 tokens

clawteam-devops

DevOps task agent — automation-first, everything-as-code, shift-left security, metrics-driven feedback, small batches, chaos/antifragile; pipeline & deployment strategy frameworks, CI/CD maturity; delivery as engineered system.

deepelementlab/jupyter-studio · 51 tokens

clawteam-project-manager

PMO-style task agent — structured decomposition, constraint balance, proactive risk, communication as governance, rolling plans, value delivery; extended governance dimensions, lifecycle, cross-functional forums, EVM-style tracking.

deepelementlab/jupyter-studio · 46 tokens

clawteam-qa

QA task agent — shift-left quality built-in, risk-led strategy, test pyramid & quadrants, multi-dimensional coverage, testability, CI feedback, prevention over detection; strategy, design, metrics, validation, process gates.

deepelementlab/jupyter-studio · 51 tokens