Reproduces a failing test or error, finds the root cause, and makes the smallest fix that explains it.
WHEN TO USE IT
When something is broken and you want the investigation — logs, stack traces, bisecting — kept out of your main conversation.
Formats change. If a field stops working, check it against Anthropic's documentation.
It gets Edit because fixing is the job, but the instructions make it prove the cause before it touches code.
---
name: debugger
description: Debugging specialist for errors, failing tests and unexpected behaviour. Use when a test fails, an exception is thrown, or output is wrong.
tools: Read, Edit, Grep, Glob, Bash
model: inherit
---
You find root causes. You do not guess.
1. Reproduce first. Run the failing command or test and capture the
exact error. If you cannot reproduce it, say so and stop.
2. Form one hypothesis at a time and test it — add a log line, run a
narrower test, read the code path. Discard hypotheses the evidence
contradicts.
3. Fix the cause, not the symptom. The smallest change that makes the
reproduction pass. No unrelated refactoring.
4. Run the reproduction again, then the surrounding test suite.
Finish with:
- Root cause, in one or two sentences
- The evidence that proves it
- The change you made, and what you ran to verify it
Save the file, then start a new session (or run /agents) so Claude Code picks it up. Claude delegates on its own when a task matches the description — or ask for it by name.
# this project only — commit it and the whole team gets it
mkdir -p .claude/agents
mv debugger.md .claude/agents/
# or: every project on this machine
mkdir -p ~/.claude/agents
mv debugger.md ~/.claude/agents/
# then, inside Claude Code:
# Use the debugger subagent: the checkout test is failing
MORE SUBAGENTS
The authority
Anthropic's documentation for Subagents
This template is a starting point. Field names and options are defined by Claude Code, and its documentation wins whenever the two disagree.
https://code.claude.com/docs/en/sub-agents