Guide
What you get: A debugger that reproduces a failure, finds the root cause, applies the smallest fix and reports symptom, cause and fix. Best for Developers who have a reproducible bug or failing check and want the cause fixed rather than the symptom patched..
Before you start
- A way to reproduce the bug (a failing test, script or command)
- Claude Code with .claude/agents/ (or Codex with .codex/agents/)
- Permission for the agent to run the reproduction command and edit files
- Fill in project_name
Worked example (Oct 17, 2026, Claude Code 2.1.296; Codex 0.151.0 (gpt-5.6-sol))
Input
Planted bug in src/lib/money.ts: formatCents builds "$" + dollars + "." + (cents % 100) without zero-padding. scripts/check-money.mjs fails 3 of 4 cases (1005 -> "$10.5", 7 -> "$0.7", 100000 -> "$1,000.0"). Request: "Use the debugger subagent to fix this: `node scripts/check-money.mjs` fails because formatCents prints wrong amounts."
Result
Claude Code: the debugger subagent ran the check first, explained that cents below 10 were never padded to two digits, and changed one line to `String(rest).padStart(2, "0")`. It also flagged that negative amounts are still wrong (-1005 gives "$-11.-5"). Codex: the debugger agent made the same one-line fix (`rest.toString().padStart(2, "0")`). Verification: I re-ran `node scripts/check-money.mjs` in both copies: "all checks passed" (4/4), and only src/lib/money.ts changed.
Test project: fresh create-next-app (Next.js 16.4.2, TypeScript), Node 24.14.1. Blanks filled with project_name = "demo-app (Next.js 16 + TypeScript)". Claude Code: body saved as .claude/agents/<name>.md, run headless with `claude -p "Use the <name> subagent to ..." --permission-mode acceptEdits`. Codex: converted to .codex/agents/<name>.toml (name, description, developer_instructions) and run with `codex exec -m gpt-5.6-sol -s workspace-write "Use the <name> agent to ..."`. Subagent use was confirmed from Claude Code's stream-json log (Agent call with subagent_type) and from Codex session logs (spawn_agent with agent_type, and the agent's instructions present in the child session). Claude Code allowed tools: Bash(node *), Bash(git diff *), Bash(git status *). Neither tool added a new regression test (template step 4); the existing check script already covered the bug and the project has no test runner. After this test step 4 says what to do when the project has no test runner.
How to check it worked
- Re-run the failing command yourself and confirm it now passes
- Read the diff: the change should be small and in the code, not in the test's expected values
- Check the report explains the cause in plain words, not just the fix
Common problems
- In a project without a test runner it may skip the 'add a test' step
- Edge cases outside the reproduction (here, negative amounts) can stay broken; read the 'what else might be affected' part
- If shell commands are not allowed it cannot reproduce the bug first
Log in to join the discussion.