debug-loop
Skill4 starsChanged 2 days agoMITView on GitHub
One tight loop for a hard bug: reproduce it, pin it with a test that fails, narrow it by halving (git bisect, input halving, toggling), keep a written hypothesis log, fix the cause, keep the test as a guard and strip the debug noise. Use for a bug you can reproduce: "it worked yesterday", "find the commit that broke it", "bisect this", "this test fails and I don't know why", or a fix that didn't stick. For a long open-ended diagnosis (no reliable repro yet, slowdowns, intermittent failures), use `diagnosing-bugs`; for flaky tests, `flaky-test`.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- proffesor-for-testing/agentic-qetheir own version, first seen Oct 25, 2026
- archiforge/agent-crafttheir own version, first seen Oct 20, 2026
- tyroneross/claude-code-debuggertheir own version, first seen Sep 7, 2026
- bt2go/claude-skillstheir own version, first seen Aug 1, 2026
- creoaurea-devlab/agentic-skillstheir own version, first seen Mar 18, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- proffesor-for-testing/agentic-qe★ 524same name
- creoaurea-devlab/agentic-skills★ 4same name
- tyroneross/claude-code-debugger★ 2same name
- archiforge/agent-craft★ 0same name
- bt2go/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository50 other files it gives its agents.
- agent-writingSkill
- arenaSkill
- blast-radiusSkill
- bun-playwright-runner-selectionSkill
- cinematic-shotSkill
- clean-ui-shotSkill
- codebase-designSkill
- dep-upgradeSkill
- diagnosing-bugsSkill
- discoverSkill
- domain-modelingSkill
- earshotSkill
- eval-judgeSkill
- flaky-testSkill
- grillingSkill
- grillSkill
- idea-scoutSkill
- improve-codebase-architectureSkill
- interrogateSkill
- make-mediaSkill
- migrate-to-rustSkill
- migration-planSkill
- multi-agent-windows-hazardsSkill
- perf-loopSkill
- postmortemSkill
- prototypeSkill
- prSkill
- real-soundSkill
- recallSkill
- release-notesSkill
- repo-mapSkill
- researchSkill
- retroSkill
- secure-diffSkill
- sellSkill
- subagent-report-recoverySkill
- tasteSkill
- taste-skillSkill
- tddSkill
- teachSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- wayfinderSkill
- weeklySkill
- windows-bash-backslash-halvingSkill
- wizardSkill
- writing-for-agentsSkill
- ycSkill
- ystack-upgradeSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 8 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Write down the one command that shows the bug: a test, a script, a curl, a CLI call with a saved input.
- Distinctive: line 32
No reproduction, no theories.
- Distinctive: line 39
Run it and confirm it fails for the right reason: read the failure message.
- Distinctive: line 58
Before each experiment, write one line.
- Distinctive: line 80
Remove every debug print, temporary log, stub, commented-out block and scratch file you added.
- Distinctive: line 81
Run git bisect reset if you bisected.
- Distinctive: line 95
No fix before a red reproduction.
- Distinctive: line 97
If three hypotheses in a row are wrong, step back to step 3 and halve on a different axis.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Debug loop
Hard bugs are lost by guessing. Every step here turns a guess into a run with a yes/no answer.
When it applies
- The cause isn't obvious after reading the error and the code it points to.
- A first fix didn't hold, or the bug comes and goes.
- Something broke between two known states: a commit, a version, a config, a data set.
Skip it when the error names the line and the fix is plain. Fix that directly and run the test.
The loop
1. Reproduce: one command, red
Write down the one command that shows the bug: a test, a script, a curl, a CLI call with a saved input. Run it and see the failure yourself. It must check the user's exact symptom, not "it ran". Make it fast and give the same answer every run: pin the clock, seed randomness, use a temp dir.
No reproduction, no theories. If you can't build one, stop and say what you tried and what you need (logs, an input file, access to the environment where it fails).
2. Pin it as a test
Turn the reproduction into a test in the project's own test suite, at the lowest level that still shows the bug. If the project has no tests, add one file using the language's built-in test runner. Run it and confirm it fails for the right reason: read the failure message.
3. Narrow by halving
Cut the search space in half each step. Pick whichever axis applies:
- History: it fails at B and worked at some older commit A. Check out A and run your command
first to confirm it passes. Then run
git bisect start B Aandgit bisect run <your command>. The command must exit 0 on good, 1 on bad, 125 to skip a commit that can't be tested. Keep the command outside the repo so checkouts don't move it. If a hook or policy blocksbisect run, step throughgit bisect good/git bisect badby hand. - Input: a big input fails. Delete half; still fails? Keep that half. Repeat to a minimal input.
- Code path: comment out, stub or early-return half of the suspect steps. Toggle flags, config keys, dependencies (pin the old version) one at a time.
- Environment: works here, fails there. List every difference (versions, env vars, OS, data) and move them across one at a time.
4. Keep a hypothesis log
Before each experiment, write one line. A bisect counts as an experiment too. Keep the log in the chat or a scratch file:
# | Hypothesis | Test | Result
1 | cache returns stale entry | disable cache, rerun repro | still fails -> not cache
2 | off-by-one in page loop at :88 | log i and len at :88 | i == len on last page -> CONFIRMEDOne variable per experiment. A result you didn't predict is information: write it down before you move on. Never test two ideas in one run.
5. Fix the cause, then prove it
Fix the confirmed cause, not the symptom. The edit that confirmed the hypothesis is not always the
right fix: if reverting a bad commit or restoring the old logic is cleaner, do that. Run the pinned
test: it now passes. Undo the fix once and watch the test fail, so you know it guards this exact
bug: save it with git diff > <scratch>/fix.patch, revert the file, run, then
git apply <scratch>/fix.patch. Then run the wider suite, if there is one.
6. Clean up
Remove every debug print, temporary log, stub, commented-out block and scratch file you added.
Run git bisect reset if you bisected. Check git status and git diff: only the fix and the
guard test remain (a new test file shows in git status, not in git diff).
Report
Symptom: <one line> Repro: <command>
Cause: <one or two lines, file:line>
Fix: <what changed> Guard: <test name(s)> (fail without the fix, pass with it)
Log: <the hypothesis table>Rules
- No fix before a red reproduction.
- One change per experiment; write the hypothesis before running it.
- If three hypotheses in a row are wrong, step back to step 3 and halve on a different axis.
- A bug that "went away" without a confirmed cause is not fixed. Say so.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

