/problem-solving:problem-solvingfrom problem-solving
Finds the root cause of a software failure (a flaky or CI-only test, unexpected behavior, an unexplained error, a performance regression) by building a red-capable feedback loop and testing competing hypotheses. Also picks an algorithm when constraints are unclear. Use for "debug this", "why is this failing/slow?", "it got slower after the deploy".
Ships in problem-solving. 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; scripts run unread.
Establish why an observed outcome differs from the required one, or pick an algorithm when the constraints make the right approach uncertain. Own the diagnosis through evidence, then make the smallest justified correction.
Not for routine implementation with a known approach (coding), general planning (planning), measured autonomous experiment loops (experiment-loop, if installed), or ESP-IDF firmware crashes and resets (esp-idf, if installed).
You will show commands, outputs and captured artifacts. Replace every secret with <REDACTED> before showing it. Build loops that read credentials from environment variables, so the secret stays out of what you print. Captured requests carry auth headers and cookies, so quote only the lines that carry the signal.
Observe the discrepancy. Record the desired and actual behavior, affected inputs, timing, impact, and the material environment, version, and deployment facts. Note recent code, config, dependency, and deployment changes (git log, git diff against the last known good state). Separate facts from interpretations. Read the relevant contract, callers, tests, config, and logs before touching code; if the project has a GLOSSARY.md or ADRs for the area, read them too. In an indexed repo, search_graph, trace_path and get_code_snippet (codebase-memory MCP) find callers and data flow faster than grep.
Build a red-capable signal. This gate decides everything after it. Find or build the narrowest unattended check that distinguishes the reported outcome from the required one: a focused test, a minimal command with fixture data, a trace replay, a controlled request, or a benchmark or profiler run. Read references/feedback-loops.md for ten ways to build one and how to tighten it. The gate passes only when you can name one command that you have already run (show the invocation and its redacted output) and that is:
${CLAUDE_SKILL_DIR}/scripts/hitl-loop.template.sh (see the reference).If you catch yourself reading code to build a theory before this command exists, stop: jumping to a hypothesis is the failure this gate prevents. If you can't build a safe reproduction, don't claim a cause or ship a speculative fix. Ask for the smallest missing artifact or access, or get approval for bounded temporary instrumentation.
Reproduce and minimize. Confirm the loop shows the failure the user described, not a nearby different one, and capture the exact symptom so later steps can verify the fix. Then remove inputs, setup, dependencies, and steps one at a time, rerunning after each. Done when every remaining element is load-bearing: removing any one makes the loop go green. Contrast the failing case with the nearest passing case when one exists (git bisect run is often the cheapest contrast for a regression).
Model the relevant system. Trace data, control, state, and error flow across the smallest affected boundary. Identify ownership, preconditions, invariants, side effects, ordering, concurrency and lifecycle edges, and external contracts. Prefer direct evidence from source, tests, logs, traces, metrics, and query plans. Treat a code smell as a lead, not proof.
Write two to five competing, falsifiable causes. Rank them. For each, state the prediction ("if X is the cause, changing Y makes the bug disappear") and the smallest reversible probe that separates it from the others. A hypothesis with no prediction is a vibe; sharpen or drop it. When the user is present, show the ranked list before probing, because they may know a recent deploy touched one of them; don't wait on an answer. Read references/hypotheses.md when the causes span several layers or the evidence is mixed. Don't bundle probes or change production behavior to make a theory fit.
| Hypothesis | Prediction | Discriminating, reversible probe | Result |
|---|---|---|---|
Probe one variable at a time. Prefer a debugger or REPL, then targeted logs at the boundaries that separate hypotheses; never "log everything and grep". Rerun the signal after each material probe. Tag temporary instrumentation with a unique prefix (for example [DEBUG-a4f2]) so one search removes it. For a performance problem, measure instead of logging: read references/performance.md.
Name the root cause and correction boundary. State the smallest condition that explains the reproduced symptom and why the evidence rules out the nearest alternatives. Correct it at the owner of that condition. Leave out cleanup, redesign, and unmeasured optimization. Use coding for implementation mechanics and unit-testing for the regression test.
A read-only caller (such as the debugger agent) stops after step 7 and returns the proposed fix and regression test instead of applying them: skip steps 8 and 9 except the repro check, and edit or commit nothing.
Implement after evidence. Turn the minimized repro into a regression test at a seam that exercises the real bug pattern, and watch it fail before the fix. If you forced the red by mutating code or a fixture, diff against a pristine copy to prove the mutation landed. If the only available seam is too shallow to replicate the chain that triggered the bug, don't write a falsely reassuring test there: report the missing seam as a finding. Apply one coherent change. If the fix invalidates the diagnosis, revert it and return to the hypotheses rather than stacking fixes. Use mistake-proof (if installed) to sweep for other instances of the same defect.
Verify, clean up, and stop. Before declaring done:
[DEBUG-...] tag is gone (grep the prefix), throwaway harnesses are deleted, and the diff has no fixture contamination or unrelated changes.When the result is partial or blocked, the evidence is mixed, or the user asked only for a reproduction, read references/closeout.md to label what it proves and where the evidence came from.
When the uncertainty is algorithmic rather than a defect:
Escalate rather than guess when:
Report the desired and actual behavior, the signal and its result, the minimized conditions, rejected and remaining hypotheses, the root-cause evidence (or why it isn't established), and the smallest next decision or artifact needed. Never label a workaround, a correlation, or an unrelated passing test as the root cause.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adminhead/claude-plugins --plugin problem-solving