debug-hypothesis

A structured method for investigating difficult software bugs using four stages: observe, form a possible explanation, test it, and draw a conclusion. It requires evidence for the cause before a fix is written.

In plain words
What is it for?
Use it for non-trivial failures, recurring bugs, flaky tests, performance regressions, environment differences, and debugging attempts that have already failed.
Why use it?
It prevents repeated guessing when software crashes, gives wrong results, behaves differently in CI, or becomes slower. The method is meant for unclear bugs rather than obvious typos or compiler messages.

Skill for Claude CodeCodex

Part of the lich-skills plugin — 12 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lichamnesia/lich-skills/debug-hypothesis
Any agent
npx skills add LichAmnesia/lich-skills --skill debug-hypothesis
Clone the repo
git clone --depth 1 https://github.com/LichAmnesia/lich-skills

Made for: Claude Code, Codex.

Or install lich-skills, the plugin that ships this one along with the rest of its 12 skills.

Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,430 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00064 $0.02430
Opus 5 $0.00032 $0.01215
Sonnet 5 $0.00013 $0.00486
Haiku 4.5 $0.00006 $0.00243

Measured 3d ago against content hash 9899921a454b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug-hypothesis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/debug-hypothesis/SKILL.md · 236 lines

How it starts

The opening of the file, as written. The whole thing — 236 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Hypothesis-Driven Debugging

A four-phase loop that turns debugging from "try random fixes and hope" into a disciplined investigation. Each phase has a goal, hard rules, and a rationalization table for the excuses an agent will invent to skip it.

The core principle: you may not write a fix until you have evidence that your hypothesis is correct. Guessing is not debugging.

When to Use

  • A test fails and the cause is not immediately obvious
  • The same bug has been "fixed" twice and came back
  • The agent tried a fix that didn't work — stop it from trying another
  • A crash or error message you haven't seen before
  • Performance regression with no obvious culprit
  • Behavior differs between environments (local vs CI, dev vs prod)
  • The agent is stuck in a loop, applying the same wrong fix

When NOT to Use

  • Typos, missing imports, or syntax errors — just fix them
  • Build failures with an obvious single-line cause
  • Compiler/linter messages that tell you exactly what and where
  • You already know the root cause and just need to write the fix

If the bug survived one fix attempt, switch to this skill immediately.

The Debug Loop

  OBSERVE  ──▶  HYPOTHESIZE  ──▶  EXPERIMENT  ──▶  CONCLUDE
     │              │                  │               │
     ▼              ▼                  ▼               ▼
  Gather          List 3-5         One minimal       Root cause
  symptoms,       possible         test per          confirmed
  reproduce       causes +         hypothesis,       or loop
  reliably        evidence         max 5 lines       back
     │              │                  │               │
     └──────────────┴──────────────────┴───────────────┘
              write everything to DEBUG.md

Hard rules:

  1. Everything gets written to DEBUG.md. Context compaction will eat your reasoning if it only lives in the conversation.
  2. You may not write fix code during Observe, Hypothesize, or Experiment.
  3. You may not skip Hypothesize. "I think I know what it is" is a hypothesis — write it down and test it like the others.
  4. Each experiment changes at most 5 lines. If your experiment needs more, your hypothesis is too vague — split it.

Read the full file on GitHub · 236 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 236 lines · 64 tokens per session scan A 9899921a454b

Subscribe to this mod's changes

debug-hypothesis is a skill published in the GitHub repository LichAmnesia/lich-skills (233 stars, last pushed 2mo ago), licensed MIT. It adds 64 tokens to every session and 2,430 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

meta-tags-optimizer

Optimize title tags, meta descriptions, Open Graph, and Twitter cards for maximum click-through rate. Generates multiple A/B test variations with character counting and SERP preview. Use when asked to "optimize title tag", "write meta description", "improve CTR", "Open Graph tags", "fix my meta tags", "social media…

nowork-studio/notfair-plugin · 91 tokens

schema-markup-generator

Generate JSON-LD structured data markup for rich results in Google Search. Supports FAQ, HowTo, Article, Product, LocalBusiness, and multi-type schemas. Validates against Google requirements and provides implementation guidance. Use when asked to "add schema markup", "generate structured data", "JSON-LD", "rich…

nowork-studio/notfair-plugin · 99 tokens

shopify-hydrogen

Hydrogen storefront implementation cookbooks. Some of the available recipes are: B2B Commerce, Bundles, Combined Listings, Custom Cart Method, Dynamic Content with Metaobjects, Express Server, Google Tag Manager Integration, Infinite Scroll, Legacy Customer Account Flow, Markets, Partytown + Google Tag Manager…

Shopify/Shopify-AI-Toolkit · 106 tokens

google-ads-audit

Google Ads account audit and business context setup. Run this first — it gathers business information, analyzes account health, and saves context that all other ads skills reuse. Trigger on "audit my ads", "ads audit", "set up my ads", "onboard", "account overview", "how's my account", "ads health check", "what should…

nowork-studio/notfair-plugin · 114 tokens

sitemap-audit

XML sitemap audit — find and fix the sitemap problems that quietly waste crawl budget and slow indexing. Discovers the sitemap (robots.txt, /sitemap.xml, sitemap index), validates structure and size limits, and cross-checks the URLs it lists against reality: non-200 / redirected / noindex / canonicalized-away URLs…

nowork-studio/notfair-plugin · 229 tokens

paid-ads-linkedin

Audit, diagnose, plan, and safely operate connected LinkedIn Ads accounts through the NotFair MCP, with an export-based fallback. Use for LinkedIn advertising, sponsored content, lead-generation forms, job-title or company targeting, campaign groups, creatives, conversions, lead quality, budgets, bids, or approved…

nowork-studio/notfair-plugin · 72 tokens