Debug: Evidence-Before-Action ML Diagnosis
Forces a probe → hypothesis → smoke → control → claim discipline when an ML training run fails, diverges, OOMs, hangs, or looks slow.
Dev & CodingIntermediate★ 371⑂ 32AI score 8/10Last updated: Jul 3, 2026
What it does
Stops the assistant from asserting a plausible-sounding cause and "fixing" it. Instead it enforces five steps:
- Cheap probes:
ps auxfor live/zombie processes,dmesgandjournalctlfor oom-kills, hardware and NFS errors,nvidia-smifor real GPU utilization and memory,df -h/du -shfor disk, the last few hundred log lines, plus checkpoint timestamps and sizes. - A labeled hypothesis, stated as a hypothesis with the alternatives not yet ruled out.
- A smoke run to confirm or refute cheaply:
batch_size=1for one step, a synthetic in-memory dataset, forward-only ineval(),lr=0, or single-GPU to implicate DDP/NCCL. - Controls: change exactly one variable at a time (AMP, gradient checkpointing, torch.compile, worker count) to narrow the mechanism.
- Cause claim only once evidence stacks up, citing the exact tool output; otherwise say "I don't yet know" and propose the next probe.
Who it's for
- ML researchers and engineers training with PyTorch, torchrun, or accelerate on Linux GPU boxes
- Anyone whose overnight cluster jobs die and who ends up guessing from logs
- Teams who want agents to justify diagnoses with real tool output instead of speculative patches
Examples
- "My run vanished after 3 hours" → correlate dmesg oom-kill entries with the last checkpoint write time to separate a kernel OOM from an external kill.
- "Loss went to NaN" → smoke with
lr=0; if it still explodes, the loss function, not the optimizer, is broken. - "GPU util is 0 but it says training" → check process state and GPU stats for dataloader blocking, then run a control changing only worker count.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/fcakyon/phd-skills/HEAD/plugin/skills/debug/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the plugin/skills/debug folder from the GitHub repo fcakyon/phd-skills into my ~/.claude/skills/fcakyon-debug/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/fcakyon/phd-skills.git && mkdir -p ~/.claude/skills && cp -r phd-skills/plugin/skills/debug ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo:
git clone https://github.com/fcakyon/phd-skills.git - Create the skills directory:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r phd-skills/plugin/skills/debug ~/.claude/skills/ - Verify it landed:
ls ~/.claude/skills/debug/SKILL.md - Restart Claude Code and ask something like "debug why this training run is diverging" to trigger it.
- Note: probes such as
nvidia-smianddmesgonly make sense on a Linux machine with NVIDIA GPUs, so run Claude Code on the training host for best results.
View source on GitHub ↗License: MIT