Skip to content

Systematic debugging

by obra

A four-phase method that makes the agent find the root cause of a bug, test one hypothesis at a time, and fix it with a failing test first.

Systematic debugging is one of the skills in Jesse Vincent’s Superpowers collection. It stops an agent from guessing at fixes. Faced with a failing test, a broken build or odd behaviour, the agent first investigates the root cause, compares the failing case with a working one, tests one hypothesis at a time, and only then fixes the problem, starting with a test that fails.

After three failed fixes it is told to stop and question the design rather than try a fourth. Supporting guides cover tracing a bug back through the call stack, adding validation at several layers, and replacing fixed sleeps with waiting for a condition. A small bundled shell script finds which test leaves stray files or state behind.

The script runs your local test command only; nothing in the skill uses the network.

What it is good for

  • Track down a flaky test instead of adding retries
  • Find the real cause of a bug before changing code
  • Identify which test pollutes shared state for the others

Install

  1. Run this in a terminal. It adds the skill to Claude Code for every project:

    tmp=$(mktemp -d) && git -C "$tmp" init -q && git -C "$tmp" fetch -q --depth 1 https://github.com/obra/superpowers 22f0b463e7a5e579904dd6211a520321035526f7 && git -C "$tmp" checkout -q FETCH_HEAD && rm -rf "$tmp/.git" && mkdir -p ~/.claude/skills && rm -rf ~/.claude/skills/systematic-debugging && mv "$tmp/skills/systematic-debugging" ~/.claude/skills/systematic-debugging && rm -rf "$tmp"
  2. Start a new Claude Code session. The agent uses the skill when a request matches it, or you can ask for it by name.

  3. To share it with your team, put the folder in .claude/skills/ inside the repository instead and commit it.

Read the source on GitHub · MIT license · Reviewed by Whenever on 2026-11-20

Browse more skills

Your first workflow is one sentence away.

One workflow free. No card. Weekly AI-building limits.