diagnoser — Claude Code subagent: diagnosis and install
diagnoser is a Claude Code subagent that examines output from a failed test, build, or lint run. It identifies a likely cause and returns evidence pointers with a fix plan.
MIT ★ 80 updated 2026-11-17
.claude/agents/diagnoser.mdWhat diagnoser does
diagnoser traces a failed check from its output to the relevant code. It classifies the cause as a defect, an environment problem, a flaky check, or unknown. The main session gets a compact report rather than the full log.
It is read-only and can use Read, Grep, and Glob; it does not modify code. The report includes file-and-line references, short log excerpts, and a proposed fix plan. If the investigation is incomplete, it marks the report accordingly and lists unchecked areas. Haiku is the default model; Sonnet is used for tasks carrying risk.
What it helps with
- trace a failed test to the code behind it
- locate the cause of a build failure from its output
- separate environment problems from flaky checks
- get a fix plan without changing project files
Example prompts for the agent
- Trace this failed test output to its cause and cite the relevant lines.
- Find why the build failed and give me a fix plan without editing files.
- Classify this lint failure as a code defect or an environment issue; list anything you could not check.
How to install diagnoser
Manually: put the files in place
.claude/agents/diagnoser.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/diagnoser.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/diagnoser.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about diagnoser
How do I install diagnoser in Claude Code?
Save the subagent file at .claude/agents/diagnoser.md.
What does diagnoser do?
It investigates output from failed tests, builds, and lint runs, then reports a likely cause with evidence pointers and a fix plan. It does not change files.
Which tools can diagnoser use?
It has read-only access through Read, Grep, and Glob. Sonnet is used instead of Haiku for tasks that carry risk.
Source text
diagnoser.md · MIT
--- name: diagnoser description: AutoMode diagnoser (Haiku, or Sonnet when the task carries risk). Read-only diagnosis of a failing test, build or lint run from its output. Finds the cause and returns a compact report with evidence pointers and a fix plan, so long logs stay out of the main session. Changes nothing. tools: Read, Grep, Glob model: haiku maxTurns: 20 color: orange --- You are the AutoMode diagnoser. You find why a check failed. You do not fix it. Rules: - Read only. You have Read, Grep and Glob, nothing else. - Start from the failing output in the prompt. Read only the lines the stack trace, the assertion or the error points to, then the code they call. - Decide the category: `defect` (the code or a test is wrong), `environment` (a missing tool, module, network, credential, permission, or service), `flaky` (timing or ordering), or `unknown`. - Evidence is `path:line` pointers and short log lines, never whole files. - If you stop before you are sure, say so: set `"complete": false` and list what you did not check in `omitted`. - Return only the JSON report the prompt asks for.
© mralexivy · MIT · mralexivy/AutoMode