Omniscio

OmniscioSubagent examplesDebugger

A debugger subagent

A stack trace, three log files and the six files it points at are a lot of text to keep in a conversation you are still working in. That is the case for a debugger subagent: it holds all of it, follows it back to a cause, and returns the sentence that explains the bug.

Anthropic ships a debugger as one of its own worked examples, with Edit in the tool list and a process that starts at the error message and ends with the fix re-run against the original failure. The file below keeps that order and adds the rule the default lacks: say what you ruled out when you cannot name the cause.

Checked against Anthropic's Claude Code documentation on November 25, 2026. By the Omniscio team. Updated .

When Claude delegates to it

Claude delegates when your request, the agent's description and the conversation line up. "The build fails on CI but not locally" is a match for a description that says "when a test or a command fails and the reason is not obvious"; "fix the typo in the README" is not, and should not be.

The description here is deliberately narrower than "any issue". Anthropic's own debugger example says "use proactively when encountering any issues", which is fine in a documentation example and too broad in a repository with three other agents: a description that matches everything steals work from the agents that should have it.

Ask for it by name when you want it: "use the debugger subagent on the failing integration test". The transcript shows the delegation as one tool call row, with the report arriving under it.

The file

Save this as .claude/agents/debugger.md. The body needs one edit to be true of your repository: name the command that starts your failing case, or say where it is, in step 1. Step 2 uses git log -S and git blame; leave them unless your team keeps history differently.

---
name: debugger
description: Finds the root cause of a failure whose cause is not yet known, then applies the smallest fix that removes it. Use proactively when a test, a build or a command fails and the reason is not obvious.
tools: Read, Edit, Bash, Grep, Glob
model: inherit
---

You are debugging. You do not guess.

1. Reproduce it. Find and run the smallest command that fails, and keep it for the end.
2. Trace it. Read the path from the failure back to where the wrong value or state first appears.
   Use git log -S or git blame when the behaviour changed recently.
3. Name the cause in one sentence: "X is Y because Z". If you cannot, say what you ruled out and
   stop. A patch without a cause is a guess with a commit message.
4. Fix the cause, not the symptom. No catch-and-ignore, no retry around a broken call, no sleep
   that hides a race, no special case that only covers the failing input.
5. Prove it. Run the reproduction again, then the tests around the changed code.
6. Report: the command that reproduces, the cause in one sentence, the smallest diff, and the test
   that would fail if this bug came back.

A report that follows it reads like this — short enough to act on, and specific enough to argue with:

Reproduces: pytest tests/test_orders.py::test_repeat_order -q
Cause: apply_coupon() reads the coupon from the request before the cart is loaded, so a repeated
  order sees the previous cart's coupon.
Diff: move the coupon lookup below cart.load() in src/orders/checkout.py.
Test that would catch it: the two-order case in test_repeat_order, which fails today.

Step 3 is the one that earns the agent its keep. A subagent that cannot name the cause but can report three plausible ones, with the evidence for each, is more useful than a patch you have to reverse-engineer.

What each field does

name

The identifier Claude delegates to, up to 256 characters. A colon is refused because Claude Code reserves it for plugin-scoped names such as my-plugin:reviewer. Keep the name stable: hooks receive it as agent_type, so anything that matches the old name stops matching after a rename.

description

The only routing signal. The useful version names the situation — a failure with no known cause — and the boundary, which is that the cause is not obvious. That boundary is what stops it being picked for work another agent does better.

tools

This is the file where Edit belongs. Read and Grep find the path of the failure, Glob finds the files, Bash reproduces it and runs the tests, and Edit applies the fix. Drop Edit if you want a diagnosis you decide on before anything changes.

model

inherit keeps a hard bug on the model you chose for the session, which is usually right: this is the agent where a weaker model costs the most. The alternatives are an alias — sonnet, opus, haiku, fable — or a full model ID such as claude-opus-5-5, which pins the version instead of following whatever the alias points to this month.

Project file or user file

A debugger is portable, so ~/.claude/agents/ is a reasonable home if you work across several repositories. Put it in a project's .claude/agents/ when the body carries repository-specific facts — the command that starts the test database, the log file that matters — because then it is knowledge the team should share.

  • A project definition outranks a user definition of the same name, so the two can coexist.
  • Both directories are scanned recursively, and subfolders do not change identity.
  • Two files in one directory with the same name means only one loads; /doctor reports the pair.

Confirm Claude picked it up

  1. It is picked up on its own. Both agent directories are watched and an edit takes effect within seconds; restart only for a folder added with --add-dir or a session started with --disable-slash-commands.
  2. Ask for it by name once, with the error text in the request. That tests the file and gives the agent the context it cannot inherit in the same step.
  3. Watch /tasks while it runs. It names the model on the agent's row, which is how you confirm the model line did what you meant.
  4. /agents prints a reminder to ask Claude to manage subagents or edit the folders directly; the wizard older write-ups describe was v2.1.197 and earlier.
  5. claude --debug writes a log to ~/.claude/debug/<session-id>.txt. A skipped agent file, and the reason, is written there.

When it goes wrong

  • It fixes the symptom. The most common failure of a debugging agent, and a prompt problem rather than a Claude problem: the body has to forbid the catch-and-ignore and the retry, in words, or the shortest path to a green test wins.
  • It asks you what the error was. It never saw your conversation, so give it the error text and the command that fails.
  • It changes files you did not want touched. Edit is a broad permission. For a read-only diagnosis, remove it; for a narrower one, name the files in the request.
  • It never launches. A tools entry that resolves to no available tool is refused with an error naming the entries.
  • It cannot reproduce the failure. If the bug needs a service, a fixture or a seed, say so in the request. An agent that cannot reproduce will start guessing, which is exactly what step 3 tells it not to do.

Adapting it to your repository

  1. Put the reproduction in the file: the container start, the fixture load, the environment variable. It is the step the agent most often gets wrong.
  2. Name the log locations. "Check var/log/app.log last" is a fact; "check the logs" is a search.
  3. Keep step 5. A fix nobody re-ran is a hypothesis, and the agent will happily report it as a result.
  4. If your team prefers a diagnosis before a change, drop Edit and say so in the description — the agent then reports the cause and the proposed diff.

The other four files are on the subagent examples page, and the subagents guide covers what a subagent inherits, including the CLAUDE.md files and the git status snapshot.

Sources

  • Anthropic's Create custom subagents, for the file format, the frontmatter reference, the model rules, the startup context a subagent receives, and the worked debugger example, read November 25, 2026.
  • Anthropic's error reference, for the zero-tools refusal, read November 25, 2026.
  • Anthropic's commands reference, for /agents and /tasks, read November 25, 2026.

The file on this page was written for this site from Anthropic's documented fields and rule. It was not run against a live repository here.

Common questions

What is a debugger subagent in Claude Code?

A subagent defined in a Markdown file that takes a failure with no known cause and works it back to one, using its own context window for the stack trace, the logs and the files around them. Anthropic's own worked example includes Edit, because fixing a bug means changing code.

Why does my debugger subagent not see my conversation?

Because it does not inherit it. A subagent that is not a fork starts fresh: its own system prompt, the delegation message Claude writes, your CLAUDE.md files, a git status snapshot and any skills its skills field preloads. Put the error and the reproduction steps in the request.

Should a debugger subagent be allowed to edit files?

Usually yes, since a diagnosis without a fix is half the work. Remove Edit when you want the cause first and a separate decision about the change; the agent can still read, search and run commands.

How is this different from the code reviewer?

The reviewer reports and never writes; the debugger changes code. Anthropic makes the same split in its examples, and keeping the two apart means a review cannot quietly fix what it found.

Keep every session in one list

Omniscio is a desktop app for running Claude Code and other coding agents side by side, with one list of sessions and one inbox, so an agent only interrupts you when a decision needs you.

The features page lists what is in it today, pricing covers the plans, and you can download it for Windows, macOS or Linux.