From kernel
Systematic debugging methodology using Zeller's scientific method: reproduce, hypothesize, isolate via binary search, fix root cause, and add regression tests.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kernel:debugThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<skill id="debug">
REPRODUCE — get specific before touching code.
HYPOTHESIZE — list 3 causes before pursuing any.
ISOLATE — binary search, O(log n) not O(n).
git bisect between known-good and known-bad commit. ~10 tests for 1000 commits.ROOT CAUSE — the error line is the FAILURE. The DEFECT is upstream.
FIX — root cause, not symptom.
<cognitive_biases> Seek DISCONFIRMING evidence first. Ask: "What would I see if my hypothesis were WRONG?" Read ALL output before investigating. List 3 causes before pursuing any. Past patterns are hypotheses, not conclusions. Check AgentDB but test them. 15 min with no evidence for hypothesis → abandon it. Write what you tested, move on. Re-run the EXACT original failing case. "Seems to work" is not evidence. </cognitive_biases>
<anti_patterns> Random changes until it works. Even if it works, you don't know why. Fragile. Change something, don't test original case, declare victory. Bug returns. Null check at crash instead of asking why null. Real defect is upstream. Logging everywhere. Use binary search first, then targeted logging. It's almost never the library. Check your usage first. Asking Claude to "investigate" without scope. Claude reads hundreds of files, filling context before doing anything useful. Scope investigations narrowly ("look at src/auth only") or use a subagent — the summary returns, the file reads don't. </anti_patterns>
<when_stuck>
Esc+Esc or /rewind restores code to a pre-bug checkpoint without losing conversation context. Checkpoints survive terminal closes.claude --verbose for hard-to-reproduce bugs — shows tool calls, thinking steps, and execution paths in real time. Catches silent failures and misparsed outputs. cat error.log | claude or npm run build 2>&1 | claude — pipe terminal output directly instead of copy-pasting. Claude receives full fidelity output without truncation or formatting artifacts. npm test -- --watch <file> or pytest -x stops on first failure. Lets the test suite do the reproduction work.
</when_stuck><parallel_debug_strategy> Competing hypothesis agents: for bugs with 3+ plausible causes, spawn one agent per hypothesis with fresh context. Each reports: evidence_for | evidence_against | confidence (0-1). Coroner agent synthesizes. Fresh context catches what a long session anchors past. When stuck >30 min, spawn fresh agent with ONLY: exact input, expected vs actual, relevant code section. Trial segmentation: when debugging multi-agent or long-running systems, break the execution trace into segments and analyze each independently. Shorter segments → cleaner causal attribution. Full traces cause spurious correlations that obscure root cause. One segment = one causal claim. See: skills/debug/reference/debug-research.md — Parallel Debug Strategy. </parallel_debug_strategy>
<agentic_debugging>
git log --oneline -20, then git bisect.git status / git diff for interrupted-state partial writes before assuming canonical version.<persistent_truth_file>
Create _meta/context/DEBUG.md at session start. Update throughout. Claude reads it before each attempt.
Prevents circular re-investigation across context compression boundaries.
Template fields: Problem Statement · What We Know · Approaches Tried (with failure reason) · Current Hypothesis · Next Steps. Full template: skills/debug/reference/debug-research.md — Persistent Investigation File. </persistent_truth_file>
<on_complete> agentdb write-end '{"skill":"debug","bug":"","root_cause":"<what_broke>","fix":"<what_fixed>","test":"<regression_test_name>","learned":"<pattern_for_future>"}'
Always record debugging learnings. They prevent repeat investigation. </on_complete>
npx claudepluginhub ariaxhan/kernel-claude --plugin kernelForces a scientific-method loop (Observe → Hypothesize → Experiment → Conclude) to debug non-trivial bugs. Prevents guessing by ensuring evidence before fixes.
Disciplined methodology to isolate bugs through hypothesis-driven testing. Form hypotheses, test them with minimal changes, narrow scope systematically. Use when bugs are unclear or reproduce intermittently.
Enforces systematic root cause investigation for bugs, test failures, and unexpected behavior through four phases: investigation, pattern analysis, hypothesis testing, and implementation.