investigate-first — Claude Code skill: diagnose before editing
The skill keeps the agent in diagnosis mode: gather evidence, rank hypotheses, name the cause. Only then does it touch code.
npx skills add JuliusBrussee/caveman --skill investigate-first -a claude-codeWhat investigate-first does
Most agent debugging starts with a guess and a patch. This one starts with evidence. The agent keeps the observed symptom apart from its inferred cause, then walks the input path, state transitions, module ownership boundaries and the failure output itself.
Hypotheses get ranked by how much evidence backs them and how cheaply each can be falsified. Exploration stops once a single mechanism explains everything you saw, or once the exact blocker is named — no drifting around the codebase afterwards. The report is cause plus proof. No fix unless the task authorizes implementation, which is the part that saves you from a confident edit in the wrong file.
Install is one command: npx skills add JuliusBrussee/caveman --skill investigate-first -a codex, and you swap the -a flag for Cursor, Copilot, Gemini CLI or OpenCode. You get a single SKILL.md with the protocol, nothing else to wire up. Worth it on repos large enough that a stack trace stops pointing at a file. For a typo in one line, a plain prompt is quicker.
What it helps with
- pin down an intermittently failing test
- trace a performance regression back to a dependency bump
- separate the symptom you can see from the cause the agent assumes
- get a written cause and proof before anyone edits product code
- cut off an open-ended investigation once the blocker is named
Example prompts for the agent
- Find out why `checkout.spec.ts` fails only on CI. Don't change any code yet.
- Investigate the latency jump on `/api/orders` and show the evidence behind each hypothesis
- We keep seeing `ECONNRESET` in the logs — run the investigation and falsify the cheap hypotheses first
How to install investigate-first
1Skills CLI (Vercel)
npx skills add JuliusBrussee/caveman --skill investigate-first -a claude-code2Manually: put the files in place
~/.claude/skills/investigate-first/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/investigate-first/
1Skills CLI (Vercel)
npx skills add JuliusBrussee/caveman --skill investigate-first -a codex2Manually: put the files in place
.agents/skills/investigate-first/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add JuliusBrussee/caveman --skill investigate-first -a cursor2Manually: put the files in place
.cursor/skills/investigate-first/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install JuliusBrussee/caveman investigate-first2Manually: put the files in place
.github/skills/investigate-first/SKILL.md1Skills CLI (Vercel)
npx skills add JuliusBrussee/caveman --skill investigate-first -a gemini-cli2Platform CLI
gemini skills install https://github.com/JuliusBrussee/caveman --path skills/investigate-firstManually: put the files in place
.devin/skills/investigate-first/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add JuliusBrussee/caveman --skill investigate-first -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set22
The whole set →Similar
Questions about investigate-first
How do I install investigate-first in Claude Code?
Run npx skills add JuliusBrussee/caveman --skill investigate-first -a claude-code. The skill lands at ~/.claude/skills/investigate-first/SKILL.md.
What does investigate-first do?
It sets the order of work for a failure: evidence first, hypotheses ranked, cause named. The agent makes no fix unless the task authorizes implementation.
Which failures is it meant for?
Unknown causes, intermittent behaviour and performance regressions. The cases where you cannot point at a line yet.
Source text
SKILL.md · Apache-2.0
--- name: investigate-first description: Diagnose ambiguous failures before editing. Use for unknown causes, intermittent behavior, performance regressions, or investigations needing evidence-ranked hypotheses. --- # Investigate first Gather evidence before changing product code. - Separate observed symptom from inferred cause. - Trace inputs, state transitions, ownership boundaries, and failure output. - Rank hypotheses by evidence and cheap falsification value. - Do not edit until one credible mechanism explains evidence. - Stop exploration when evidence is sufficient to name cause or exact blocker. Report cause and proof. Make no fix unless task authorizes implementation.
© JuliusBrussee · Apache-2.0 · JuliusBrussee/caveman