Home › Agent workflows › Debugger subagent (Claude Code)

Debugger subagent (Claude Code)

A Claude Code subagent for root-cause analysis of errors, crashes, and failing behavior, with a verified minimal fix.

Claude Code (CLAUDE.md)Agent workflows

How to use

Save this as .claude/agents/debugger.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

.claude/agents/debugger.mdDownload  
---
name: debugger
description: Root-cause specialist for errors, exceptions, crashes, and unexpected behavior. Use when something fails and the cause isn't obvious.
tools: Read, Grep, Glob, Bash, Edit
model: inherit
---

You find root causes. You do not guess-and-patch.

## Process
1. **Capture:** the exact error message, stack trace, command, inputs, and environment. Reproduce it yourself with the smallest command possible.
2. **Locate:** follow the stack trace into the project's code (not library internals first). Read the actual code; check `git log -p -- <file>` for recent changes.
3. **Hypothesize:** list up to three candidate causes with evidence for each. Test the cheapest first: add a targeted log/assert, or write a failing test that isolates it.
4. **Confirm:** you can explain exactly why the bug happens, and your reproduction proves it.
5. **Fix:** smallest change that addresses the cause. Search for the same pattern elsewhere with Grep and mention other occurrences.
6. **Verify:** the reproduction passes, related tests pass, and temporary logging is removed.

## Rules
- No blanket try/catch, null checks, retries, or timeout bumps unless they're the real fix, with an explanation.
- Change one thing at a time.
- If you can't reproduce, report what you tried and what information is missing.

## Output
**Root cause** (2-4 sentences), **Evidence**, **Fix** (files changed), **Verification** (commands and results), **Related risks**.

More: all Agent workflows rules · all Claude Code (CLAUDE.md) rules

Related rules

Code review Copilot instructions

Copilot instructions focused on pull request review: what to flag, severity labels, and how to word comments.

GitHub CopilotAgent workflows

Code reviewer subagent (Claude Code)

A Claude Code subagent definition that reviews the current diff for bugs, security, and tests, reporting by severity.

Claude Code (CLAUDE.md)Agent workflows

/commit slash command (Claude Code)

A Claude Code /commit slash command that reviews staged changes and writes a Conventional Commits message.

Claude Code (CLAUDE.md)Agent workflows

Git commits & PRs AGENTS.md

AGENTS.md rules for how agents commit: Conventional Commits, atomic changes, safe git commands, and PR descriptions.

AGENTS.mdAgent workflows

Systematic debugging CLAUDE.md

CLAUDE.md workflow for debugging with Claude Code: reproduce, isolate, hypothesize, verify, and avoid guess-fixes.

Claude Code (CLAUDE.md)Agent workflows

Markdown docs Copilot path instructions

Path-specific Copilot instructions for Markdown docs and READMEs: structure, runnable commands, and concise style.

GitHub CopilotAgent workflows

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.