---
name: diagnose
description: Root-cause a failing or wrong empirical result with a disciplined reproduce → minimise → hypothesise → instrument → fix loop, instead of guessing-and-poking. Use when the user says "why is my regression wrong", "this number changed", "my script errors out", "the result won't reproduce", "debug this", "this estimate looks wrong", or "it worked yesterday". Tuned for research code (R/Stata/Python): type coercion, NA/merge blow-ups, factor levels, clustering/SE choices, weighting, collinearity/convergence, seeds, package-version drift. Use `--no-fix` to localize the root cause without editing shared or load-bearing files.
---
<!-- Generated by scripts/sync-agent-skills.py from .claude/skills/diagnose/SKILL.md. Do not edit: change the source and re-run the script. -->

# diagnose

This skill's instructions live in [`.claude/skills/diagnose/SKILL.md`](../../../.claude/skills/diagnose/SKILL.md).
Read that file now and follow it, with the files it points to. Read [`AGENTS.md`](../../../AGENTS.md)
first if you have not already.

It was written for Claude Code. Running it from Codex, Antigravity or another agent:

- **Arguments.** Where it says `$ARGUMENTS`, use what the user asked for.
- **Claude Code agents.** Where a step hands work to an agent in `.claude/agents/` (through the
  `Agent` or `Task` tool), read that agent's file and do the step yourself after the main work.
  Tell the user the step was not an independent review: the same agent did both.
- **Claude Code settings.** `allowed-tools`, `model`, `effort`, `argument-hint` and
  `disable-model-invocation` in the source's frontmatter configure Claude Code. Ignore them.
- **Guards.** Claude Code's guard hooks do not run for you. Follow the rules in `AGENTS.md`
  yourself; the git pre-commit gate and CI still apply to your commits.
