Skip to content
Skill

Debug hypothesis

Guides an agent through a hypothesis-driven loop for hard-to-find bugs

Debug hypothesis is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
233
Last commit
License
MIT
Listing updated

Similar skills

About Debug hypothesis

This skill sets up a four-phase debugging method for non-trivial bugs: observe the symptoms and reproduce them, form several candidate causes, run one small falsifying experiment at a time, and only then write a fix. The agent is told to record its reasoning in a DEBUG.md file so the investigation trail survives context compaction.

The skill includes hard rules that stop the agent from writing fix code before a hypothesis is supported, limit each experiment to five changed lines, and require reverting diagnostic code after each test. Each phase has exit criteria and a table of common excuses for skipping steps, which the agent is expected to check against.

No scripts are included; the skill is a single SKILL.md with instructions only, so it expects the agent to have access to the codebase, the ability to run the reproduction, and a way to write files.

When your agent uses it

Use when debugging any non-trivial bug — wrong output, crash, flaky test, performance regression, or "it works locally but not in CI." Forces a scientific-method loop (Observe → Hypothesize → Experiment → Conclude) so the agent stops guessing and starts reasoning. Prevents the

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (10 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the lich-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add LichAmnesia/lich-skills
/plugin install lich-skills@lich-skills

Or copy only this skill to ~/.claude/skills/debug-hypothesis:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/LichAmnesia/lich-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/debug-hypothesis &&
cp -R "$tmp/skills/debug-hypothesis" ~/.claude/skills/debug-hypothesis &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/debug-hypothesis inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/debug-hypothesis to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/LichAmnesia/lich-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/debug-hypothesis &&
cp -R "$tmp/skills/debug-hypothesis" ~/.agents/skills/debug-hypothesis &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/debug-hypothesis inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/debug-hypothesis to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/LichAmnesia/lich-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/debug-hypothesis &&
cp -R "$tmp/skills/debug-hypothesis" ~/.cursor/skills/debug-hypothesis &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/debug-hypothesis inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/LichAmnesia/lich-skills.git --path skills/debug-hypothesis

Or copy the folder to ~/.gemini/skills/debug-hypothesis yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/debug-hypothesis:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/LichAmnesia/lich-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/debug-hypothesis &&
cp -R "$tmp/skills/debug-hypothesis" ~/.copilot/skills/debug-hypothesis &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/debug-hypothesis inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/LichAmnesia/lich-skills.git

Then copy lich-skills/skills/debug-hypothesis into your agent's skills folder as debug-hypothesis. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Four-phase debug loop
Walks the agent through observe, hypothesize, experiment and conclude in order.
Hypothesis ranking
Requires three to five candidate causes, each with supporting and conflicting evidence.
Minimal experiments
Limits each test to one variable and at most five changed lines of diagnostic code.
DEBUG.md investigation log
Keeps observations, hypotheses, experiments and root cause in a persistent file.
Regression test requirement
Requires a failing-then-passing regression test alongside the confirmed fix.
Anti-bulldozer checks
Lists warning signs that the agent is pushing a wrong theory with repeated fixes.

Good for

  • Track down a flaky test that fails only sometimes
  • Investigate a performance regression with no obvious cause
  • Find why code works locally but fails in CI
  • Diagnose a crash after a previous fix did not hold
  • Work out why an API returns wrong output for some inputs

Debug hypothesis FAQ

When should I not use Debug hypothesis?

The skill says not to use it for typos, missing imports, syntax errors, build failures with an obvious single-line cause, compiler or linter messages that point to the problem, or when the root cause is already known and only the fix is needed.

Does Debug hypothesis change my code?

It asks the agent to write only diagnostic code such as logs, assertions or hardcoded values during experiments, revert it afterwards, and write production fix code only after the root cause is confirmed.

Where does the investigation get recorded?

Everything is written to a DEBUG.md file, with sections for observations, hypotheses, experiments, root cause and fix.

Does Debug hypothesis need any scripts or extra tools?

No scripts are included and no allowed tools are set. The instructions assume the agent can reproduce the bug, edit files and run tests.

How do I install Debug hypothesis in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/debug-hypothesis to use it in all your projects, or to .claude/skills/debug-hypothesis in one project. Or install the lich-skills plugin, which includes it: /plugin marketplace add LichAmnesia/lich-skills, then /plugin install lich-skills@lich-skills.

Does Debug hypothesis run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Debug hypothesis?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Debug hypothesis?

The closest alternatives to Debug hypothesis are Diagnostic reasoning, Interactive debugging, Diagnosing bugs, Principle fix root causes and Debug.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from LichAmnesia/lich-skills

  1. Loops a failing build, typecheck, lint or test until the check exits 0

    • Open source
    • 233 GitHub stars
    • Developer tools
  2. Guides the agent to build distinctive, polished frontend interfaces instead of generic

    • Open source
    • 233 GitHub stars
    • Design and media
  3. Gates new project ideas with memory checks and kill criteria before any work starts

    • Open source
    • 233 GitHub stars
    • Productivity
  4. Lets your agent pull GA4 reports and turn them into prioritized SEO and traffic fixes

    • Open source
    • 233 GitHub stars
    • Marketing and SEO
  5. Generates and edits images from text prompts using Google's Nano Banana 2 model

    • Open source
    • 233 GitHub stars
    • Design and media
  6. Routes an agent to the right lich-skill for each phase of its current task

    • Open source
    • 233 GitHub stars
    • Developer tools