Skip to main content
skill CX Codex

debug-loop — Claude Code skill: hypotheses, not guessing

debug-loop — a skill for step-by-step debugging of errors through real commands, not simulations. Forms hypotheses, validates them against live data, identifies root cause, and only then fixes the code.

MIT 117 installs ★ 533 updated 2026-10-25

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add proffesor-for-testing/agentic-qe --skill debug-loop -a claude-code
Open on GitHub

What debug-loop does

debug-loop works in five phases. It first reproduces the bug by running the command that exposes it. Then it proposes a hypothesis about the cause and tests it with a real command: checking SQLite tables, dependency versions, or variable states. Each result either confirms the hypothesis or points to the next one. Only after identifying the root cause does the skill modify code—minimally, precisely.

After the fix, it runs the same command from phase one and verifies the output changed. Then it runs the full test suite to ensure nothing else broke. If tests fail, it fixes them before committing.

The skill refuses to guess or simulate: every output comes from an actual command run. If no root cause emerges after five hypotheses, it asks for your help rather than continuing blind.

What it helps with

  • identify the root cause of failing tests
  • trace logic when output doesn't match expectations
  • find where a wrong value originates in code or database
  • confirm a fix doesn't break other code paths
  • distinguish the real problem from its symptoms

Example prompts for the agent

  • Debug a falling test npm test -- users.test.js that shows the wrong record count
  • The backend returns 404 instead of data even though the endpoint exists—find out why
  • A database migration script hangs silently—figure out where it gets stuck

How to install debug-loop

1Skills CLI (Vercel)

npx skills add proffesor-for-testing/agentic-qe --skill debug-loop -a claude-code

2Manually: put the files in place

~/.claude/skills/debug-loop/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/debug-loop/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about debug-loop

How do I install debug-loop in Claude Code?

Run npx skills add proffesor-for-testing/agentic-qe --skill debug-loop -a claude-code, then open ~/.claude/skills/debug-loop/SKILL.md. Other editors use different commands: for Cursor, npx skills add proffesor-for-testing/agentic-qe --skill debug-loop -a cursor; for GitHub Copilot, gh skill install proffesor-for-testing/agentic-qe debug-loop.

What does debug-loop do?

It debugs errors through real commands and hypothesis testing. It reproduces the bug, checks database tables, dependency versions, and variable values as they actually exist, not theoretically. It finds the root cause before touching the code.

What happens if debug-loop can't narrow down the cause after five attempts?

It stops and asks you for help—details on where it's stuck, logs, extra context. That way it doesn't waste iterations guessing.

Source text

SKILL.md · MIT
---
name: debug-loop
description: "Use when debugging a failing test or runtime error with hypothesis-driven investigation, autonomous command validation, and systematic root cause elimination."
trust_tier: 0
domain: debugging
---

# Debug Loop

Autonomous hypothesis-driven debugging against real data. No guessing, no simulating.

## Arguments

- `<symptom>` — Description of the bug or unexpected behavior. If omitted, prompt the user.

## Phases

### Phase 1 — Reproduce
Run the exact command that shows the bug. Capture and display the REAL output. Confirm the bug is visible.

If the bug cannot be reproduced, stop and explain what was tried.

### Phase 2 — Hypothesize and Test (up to 5 iterations)
For each iteration:
1. State a specific hypothesis (e.g., "the query targets v2 tables but data is in v3 tables")
2. Run a REAL command to test it (e.g., `sqlite3 [db path] '.tables'` then `SELECT COUNT(*) FROM [table]`)
3. Record whether the hypothesis was confirmed or rejected
4. If rejected, form the next hypothesis based on what you learned

**Do NOT make code changes until you have a confirmed root cause.**

Important checks:
- Always check both v2 and v3 SQLite tables when data issues are suspected
- Check dependency versions (e.g., sqlite3 vs better-sqlite3)
- Check for hardcoded values that may have been missed

### Phase 3 — Fix
Make the minimal targeted fix. Explain:
- What the root cause was
- What you're changing and why
- What the blast radius is (which other code paths are affected)

Before applying, grep for ALL instances of the problematic pattern across the entire codebase.

### Phase 4 — Verify
Run the SAME reproduction command from Phase 1. The output must now show correct values. If it doesn't, go back to Phase 2.

Show before/after output comparison.

### Phase 5 — Regression
```bash
npm test
```
Run the full test suite. If tests fail, fix them before committing.

## Rules

- NEVER guess or simulate output — always run real commands
- NEVER make code changes before confirming root cause
- Always check for the pattern across the entire codebase, not just one file
- If blocked after 5 hypotheses, stop and ask the user for guidance

© proffesor-for-testing · MIT · proffesor-for-testing/agentic-qe

Similar skills

All skills for Code review and refactoring →

From the same set73

The whole set →
test-data-management The test-data-management skill creates test datasets, anonymizes PII, and keeps test records isolated. Use it for unit, integration, performance, and boundary testing. CX Codex +1 118installs iterative-loop iterative-loop runs continuous build-test-fix loops until pass criteria are met. Useful for test-driven feature development, bug fixing, and metric optimization. CX Codex +1 118installs shift-left-testing The shift-left-testing skill moves checks earlier in development: validate requirements, write tests before implementation, and run them in CI. Use it when introducing TDD or other early quality practices. CX Codex +1 117installs test-environment-management test-environment-management is a Claude Code skill for setting up test infrastructure and matching it to production. It covers environment setup, parity checks, and test infrastructure costs. CX Codex +1 117installs shift-right-testing shift-right-testing guides agents through production testing using feature flags, canary rollouts, and chaos experiments. Useful when setting up progressive delivery or tracking SLOs. CX Codex +1 115installs qe-contract-testing qe-contract-testing — a skill for verifying REST, GraphQL, and event-driven API contracts with schema validation. Detects incompatible changes and ensures APIs won't break downstream clients. CX Codex +1 115installs security-visual-testing security-visual-testing validates URLs, masks sensitive data on screenshots, and runs multi-viewport visual regression tests with WCAG accessibility audits. CX Codex +1 115installs enterprise-integration-testing Enterprise integration testing skill for SAP, middleware, and WMS setups. It coordinates cross-system checks across RFC, IDoc, OData, and ESB flows. CX Codex +1 113installs

Project sponsors

Companies that keep this analytics open