safe-debug — Claude Code skill: what it does, how to install
Conservative failure diagnosis for deep learning research: narrows down root causes and drafts minimal patches without touching code without approval.
npx skills add lllllllama/RigorPilot-Skills --skill safe-debug -a claude-codeWhat safe-debug does
The safe-debug skill enforces conservative troubleshooting for deep learning research projects. When training crashes with a CUDA OOM, checkpoint load failure, shape mismatch, or NaN loss, the agent avoids speculative code changes. It diagnoses the local root cause first and documents findings in the debug_outputs/ directory.
The workflow produces debug_outputs/DIAGNOSIS.md, debug_outputs/PATCH_PLAN.md, and debug_outputs/status.json. Code remains untouched by default. If a fix is required, the agent formulates the smallest possible patch and demands explicit user confirmation before applying it. For medium or high-risk edits, it mandates savepoints or git branches.
The core boundary states that a debug fix does not count as a research contribution. If a modification affects experiment comparability or scientific validity, the agent flags it explicitly. The skill is strictly scoped to debugging: broad repo walkthroughs, refactoring, and speculative adaptations are forbidden.
What it helps with
- Diagnose CUDA OOM and checkpoint loading failures
- Trace tensor shape mismatches and NaN loss occurrences
- Generate structured analysis in
debug_outputs/DIAGNOSIS.md - Prevent unapproved agent modifications to repository files
- Separate debugging bugfixes from research contributions
Example prompts for the agent
- Training crashed with a CUDA out of memory error, analyze the traceback with safe-debug without editing files
- I got a shape mismatch during tensor operations, identify the root cause and write
debug_outputs/PATCH_PLAN.md - Loss became NaN at step 400, run safe-debug to diagnose the calculation failure
How to install safe-debug
1Skills CLI (Vercel)
npx skills add lllllllama/RigorPilot-Skills --skill safe-debug -a claude-code2Manually: put the files in place
~/.claude/skills/safe-debug/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/safe-debug/
1Skills CLI (Vercel)
npx skills add lllllllama/RigorPilot-Skills --skill safe-debug -a codex2Manually: put the files in place
.agents/skills/safe-debug/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add lllllllama/RigorPilot-Skills --skill safe-debug -a cursor2Manually: put the files in place
.cursor/skills/safe-debug/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install lllllllama/RigorPilot-Skills safe-debug2Manually: put the files in place
.github/skills/safe-debug/SKILL.md1Skills CLI (Vercel)
npx skills add lllllllama/RigorPilot-Skills --skill safe-debug -a gemini-cli2Platform CLI
gemini skills install https://github.com/lllllllama/RigorPilot-Skills --path skills/safe-debugManually: put the files in place
.devin/skills/safe-debug/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add lllllllama/RigorPilot-Skills --skill safe-debug -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about safe-debug
How to install safe-debug in Claude Code?
Run npx skills add lllllllama/RigorPilot-Skills --skill safe-debug -a claude-code. Alternatively, place the file directly at ~/.claude/skills/safe-debug/SKILL.md.
What does safe-debug do?
It guides the agent through disciplined deep learning diagnostics without automatic file edits. The skill enforces explicit human approval for any proposed patch and records outputs in debug_outputs/.
When should you not use safe-debug?
Do not apply it for repository walkthroughs, speculative experimentation, or broad readability refactoring. It is built strictly for concrete training and inference failures.
Source text
SKILL.md · MIT
--- name: safe-debug description: Rigor Debug / Rigor Audit skill for deep learning research work. Use when the user pastes a traceback, terminal error, CUDA OOM, checkpoint load failure, shape mismatch, NaN loss symptom, or training failure and wants conservative diagnosis before any patching, with debug fixes clearly separated from research contributions. Do not use for broad refactoring, speculative adaptation, automatic exploratory patching, or general repository familiarization. --- # safe-debug Use this as the Rigor Debug / Rigor Audit skill. The installed slug remains `safe-debug` for compatibility. Use the shared operating principles in `../ai-research-reproduction/references/agent-operating-principles.md`; this skill should guide conservative diagnosis without blocking the model from finding the local root cause. ## When to apply - The user provides a traceback, terminal error, or concrete training or inference failure symptom. - The user wants diagnosis, root-cause narrowing, and minimal patch suggestions before code is changed. - The user wants a safe debug flow with explicit human approval before mutation. ## When not to apply - When the user wants a broad repository walkthrough without an active failure. - When the task is speculative experimentation or code adaptation. - When the user is asking for a large refactor or readability rewrite. ## Clear boundaries - Diagnose first. - Do not modify repository code by default. - If a patch is needed, propose the smallest fix and require explicit approval first. - Escalate savepoint or branch creation before medium-risk or high-risk changes. - A debug fix is not automatically a research contribution; if it changes experiment meaning or comparability, say so explicitly. ## Output expectations - `debug_outputs/DIAGNOSIS.md` - `debug_outputs/PATCH_PLAN.md` - `debug_outputs/status.json` ## Notes Use `references/debug-policy.md`, `../ai-research-reproduction/references/research-rigor-principles.md`, and the shared `../ai-research-reproduction/references/research-pitfall-checklist.md`.
© lllllllama · MIT · lllllllama/RigorPilot-Skills