A Claude Code skill that enforces debugging discipline on hard bugs — memory leaks, races, routing/sharding issues, regressions. Diagnosis before remedy, evidence ranking, contradiction chasing, fail-first verification.
Inspired by Cindy Sridharan (@copyconstruct)'s post observing that Claude's initial analysis on tricky bugs is almost always wrong until you feed it hypotheses, clues, and suggestions. These are the generalized principles Claude itself distilled when asked: "so, what did you learn?"
mkdir -p ~/.claude/skills/copyconstruct-debugging
curl -o ~/.claude/skills/copyconstruct-debugging/SKILL.md \
https://gist.githubusercontent.com/dims/57ba15220f27e0ac16d0e2547f3ff3a6/raw/SKILL.mdStart a new Claude Code session. The skill loads automatically when Claude detects non-trivial debugging work, or invoke it explicitly:
/copyconstruct-debugging
Project-scoped install instead: put it at <repo>/.claude/skills/copyconstruct-debugging/SKILL.md and commit it — everyone working in the repo gets it.
Paste the body of SKILL.md (everything below the frontmatter) into any of:
CLAUDE.md/AGENTS.mdin your repo- A Claude Project's custom instructions on claude.ai
- The system prompt of an API call
Instead of letting Claude jump straight to a patch, the skill forces an ordered loop:
- Reproduce — no deterministic repro means you're guessing.
- Localize — read the actual current code, not the model's memory of it.
- State the mechanism — one falsifiable sentence ("X causes Y because Z") before any fix may be proposed.
- Falsify it — design and run the observation that would prove the sentence wrong.
- Fix minimally — smallest change traceable line-by-line to the mechanism.
- Verify fail-first — watch the failure happen without the fix, then watch the fix remove it, across every axis that changes behavior.
Plus evidence rules (rank clues, never let "seems true" speak as "verified"), contradiction chasing ("it used to work" vs "always been broken" is the diagnosis), and a self-check table of weasel phrases — "presumably", "should be", "looks equivalent" — that send the model back to run the actual check.