Diagnoses stalled or cross-system failures and wrong, NaN, nondeterministic, or unexpectedly slow scientific results through falsifiable hypotheses across distinct fault classes, with evidence-cited verdicts before any fix. Not for designing benchmarks or pre-registered experiments; use experiment-protocol.
Ships in scientific-debugging. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Debug by falsification, not by trying fixes. A fix attempted before a confirmed diagnosis is an experiment run without a hypothesis; when it "works" you have learned nothing, and when it does not you have contaminated the evidence.
Anti-trigger: if the failure is a typo, a missing import, or an error message that names its own cause, fix it directly and skip this workflow. The loop below is for failures that survived the first obvious fix.
/skill scientific-debugging <failure description>
Everything after the skill name is the failure report: the observed wrong
behavior and whatever has already been tried. There is no operator in a
headless run without an --answers file: ask_user is not registered, so any call is refused as an
unregistered tool rather than answered. If the goal,
a fault-class split, or a ranking call is ambiguous, state your best reading
in Step 1 or Step 3 and proceed; never stall a step waiting for confirmation.
The Loop below is the plan; do not open a task list for it. tasks sits
outside this skill's tool surface and any call to it is refused.
Shell rules for every bash call: one command per call, plain and direct.
Never use $(...) or backticks; they trigger an approval gate that ends a
headless run. This skill has no write/edit tool. The structured-
investigation file in the Tiers section below is written with a bash
heredoc (cat > file <<'EOF' ... EOF), never through an edit tool that
isn't in this skill's surface.
Hypotheses must span at least two distinct classes. Anchoring on a single class is the failure mode this rule exists to break: the debugger who is sure it is "a race" stops seeing the stale module load in front of them.
| Class | Typical suspects |
|---|---|
| numerics | accumulation order, mixed precision, tolerance misuse, fastmath |
| data | format or layout drift, HDF5/NetCDF/Zarr metadata, units, corruption |
| concurrency | races, MPI collective mismatch, nondeterministic reduction order |
| environment | modules, compiler flags, library versions, scheduler context |
| resources | memory pressure, filesystem quirks, quota, node differences |
| regression | a recent change; bisect the history instead of staring at code |
Quick diagnosis (default): the loop above, state held in conversation, time-boxed at fifteen minutes of investigation. If the box expires without a CONFIRMED verdict, escalate. Say that you are escalating; do not silently keep poking.
Structured investigation: write an investigation file (for example
INVESTIGATION.md or .pancode/investigation-<slug>.md via bash heredoc since
this skill does not edit code) containing the goal, baseline measurements of
the failing behavior, and one experiment per hypothesis with its verdict
condition committed before the experiment runs. Update verdicts as evidence
arrives. The file is the state; the conversation is commentary.
The fix commit should cite the confirming observation, e.g. "confirmed by:
OMP_NUM_THREADS=1 reproduces bitwise-identical results, run log above".
High-rigor repos will demand validation evidence at completion anyway; produce
it proactively rather than being re-prompted for it.
Report: "the advection test fails: a few results are off by about 1e-4."
pytest tests/test_advection.py passes against the pinned reference
within its stated tolerance on a clean checkout, on two consecutive runs.pytest (cost: 1 min).pip freeze/module list matches the reference
environment pin. Test: diff environments (cost: 2 min).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/scientific-debugging:scientific-debuggingfrom scientific-debugging
npx claudepluginhub panstudio/pancode --plugin scientific-debugging