Finds a bug's real cause before changing code using minimal reproductions, ranked hypotheses, one-variable experiments, and git/input bisection.
Ships in engineering-core. 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.
Never change code to fix a bug you cannot explain. Reproduce it, find the cause with evidence, and prove the fix with a test that failed before the fix and passes after it.
Not for: production outages where mitigation must come first (stabilize, then come back here), or performance work where nothing is actually wrong.
Capture the exact failure. Copy the full error message, stack trace, exit code, relevant log lines, and the exact command, request or steps that produced them. Write down expected vs actual behavior.
Read the whole stack trace. Include every Caused by: / inner exception / wrapped error. The top frame is often library code; the first frame in the project's own code is usually where to start. The line where an error surfaces is where a bad value was used, not necessarily where it was produced.
Reproduce it. Get a command that fails every time. Then shrink it: smallest input, fewest steps, a single test, for example:
pytest tests/test_orders.py::test_refund -xnpx vitest run src/cart.test.ts -t "applies discount"go test -run '^TestRefund$' ./ordersdotnet test --filter "FullyQualifiedName~RefundTests"If you cannot reproduce it, do not guess. Collect more data (step 7) or ask the user for environment details, logs and exact steps.
Check the boring causes first (table below). A large share of "impossible" bugs are stale builds, wrong branches, wrong config or a different dependency version.
Write ranked hypotheses. List 2-5 candidate causes. For each: evidence for, evidence against, and the cheapest experiment that would confirm or rule it out. Start with the one that is most likely and cheapest to test.
Experiment one variable at a time. Predict the result before running. If the result surprises you, your model of the system is wrong: update it before continuing. Revert experiments that did not help.
Narrow by bisection when the search space is large:
git bisect (automate it with git bisect run). See references/git-bisect.md.Instrument where you are blind. Add logs at boundaries with a unique prefix (e.g. DBG-1234), log types and lengths as well as values, use breakpoints and conditional breakpoints, or attach a tracer. See references/debugging-tools.md for per-language tools. Never log secrets or personal data.
State the root cause as a mechanism. "The cache key omits tenant_id, so tenant B reads tenant A's entry" — not "bug in cache.py". Keep asking "why?" until you reach something you can fix that prevents this class of bug, not just this instance.
Write a failing regression test at the lowest level that still shows the bug. Run it and confirm it fails for the right reason (the assertion you expect, not an import or setup error).
Fix the cause, then run the new test and the surrounding suite. Search the codebase for the same pattern (same call, same misuse) and fix or report the other places.
Clean up and report. Remove temporary instrumentation. Tell the user: symptom, root cause, evidence, fix, regression test, other places affected, and anything you could not verify.
| Assumption | How to verify |
|---|---|
| You are running the code you think you are | Add a temporary log line and confirm it prints. Check git status, git branch --show-current, git log -1. Rebuild. Check which binary or interpreter runs: which/command -v (POSIX), where (Windows), python -c "import sys; print(sys.executable)". |
| Dependency versions match | Read the lockfile. npm ls <pkg>, pip show <pkg>, go list -m all, mvn dependency:tree, ./gradlew dependencies, dotnet list package, cargo tree. |
| Config and env vars are what you expect | Print the effective config at startup (redacted). Check precedence: defaults, files, env vars, CLI flags, remote config. |
| Nothing is cached or stale | Clean build (delete build/output dirs), rebuild containers with --no-cache, clear package caches, browser cache, CDN, service worker, memoization layers. |
| The data is what you think | Query the actual record or message. Do not reason from what the data "should" be. |
| Time, timezone and locale | UTC vs local, DST transitions, month-end, leap days, locale-specific number and date parsing. |
| Network path | DNS resolution, proxies, TLS, which host and port is actually hit (curl -v). |
| Permissions and identity | File permissions, OS user, service account, IAM role, token scopes. |
If three fixes in a row have not worked, stop editing code. Each failed fix is evidence that your hypothesis is wrong.
| Symptom | Likely causes | Technique |
|---|---|---|
| Fails only under load or in parallel | Race condition, shared mutable state, pool exhaustion, missing lock or transaction | Repeat with parallelism: go test -race -count=100 ./..., pytest -n 8 (pytest-xdist) with --count=50 (pytest-repeat). Use race detectors: Go -race, ThreadSanitizer (-fsanitize=thread) for C/C++. |
| Depends on test order | State leaking between tests (globals, DB rows, env vars, singletons, mocks not reset) | Run in random order: pytest-randomly, jest --randomize, vitest --sequence.shuffle, go test -shuffle=on. Run the failing test alone, then with its neighbors. |
| Fails after hours or days | Memory, file handle, socket or connection leak; counter overflow; token or certificate expiry | Track resource counts over time; heap snapshots; check what expires. |
| Fails only in CI | Different OS, CPU count, timezone, locale, missing secrets, slower machine hitting timeouts, parallel jobs sharing resources | Diff the environments; run the CI container image locally; print env (redacted) in the CI job. |
| Disappears with logging or a debugger | Timing-sensitive race | Use low-overhead instrumentation (in-memory ring buffer dumped on failure), stress runs, race detectors. |
| Fails at certain times | Midnight, month or year boundaries, DST, leap years, cron overlap | Inject a clock and test with fixed times around the boundary. |
For an intermittent bug, "fixed" means the reproduction passes many repetitions (e.g. 100+ runs or a stress run) that previously failed at a known rate.
sleep to hide a race, raising a timeout. These move the bug, they do not remove it.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/engineering-core:root-cause-debuggingfrom engineering-core
npx claudepluginhub reddygopalkrishna/developer-agent-skills --plugin engineering-core14 skills in this plugin
/codebase-onboardingMaps an unfamiliar repository before changing it - stack, build/test/run commands, entry points, data flow, conventions and how changes ship - and writes a short map. Use when starting work in a repo you have not seen, when asked to explain how a codebase works, onboard to a project, find where something lives, or before a first change in a large or legacy codebase. Not for reviewing a specific diff./code-review-changesReviews code changes (a pull request, merge request or diff) like a senior engineer - finds real bugs, security holes, data risks and breaking changes, verifies each one, and reports it with file:line, a concrete failure scenario and a suggested fix. Use when asked to review a PR, merge request, diff, branch, staged changes or patch, or to check code before merging. Also covers responding to review comments on your own PR./dependency-upgradesOther plugins' skills for the same job