# Diagnose loop

> Diagnose loop is an open-source agent skill for developer tools. Guides the agent to build a fast pass/fail reproduction before diagnosing hard bugs. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ivy00johns/Skill-Madness/tree/main/skills/workflows/diagnose-loop
- **Repository:** https://github.com/ivy00johns/skill-madness
- **GitHub stars:** 12
- **License:** MIT
- **Skill name:** diagnose-loop
- **Collection:** https://github.com/ivy00johns/Skill-Madness
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

Diagnose Loop is a structured debugging workflow for bugs that resist quick fixes, such as flaky tests, performance regressions and intermittent failures. Its central idea is to construct a fast, deterministic, binary feedback loop before any investigation, then run the later phases against that signal. The skill ranks ten ways to build such a loop, from an existing failing test up to a human-in-the-loop bash harness, and advises picking the cheapest one that reproduces the bug. It also covers raising the reproduction rate of intermittent failures by tightening the test surface, running tests in parallel and stressing the system.

The remaining phases walk the agent through reproducing the user's exact failure, generating three to five ranked falsifiable hypotheses for the user to review, and testing them one variable at a time. Debug output is tagged with a unique token so it can be removed in one search. The fix is expected to come with a regression test at the smallest observable seam, and cleanup ends by rerunning the original loop against the pre-fix and post-fix commits.

The skill includes a bash helper template and reference documents for recipes and hypothesis format. It lists Read, Write, Edit, Bash, Grep and Glob as its allowed tools, and it suggests pairing with the Playwright skill for browser-based bugs. It is MIT licensed.

## When your agent uses it

> Disciplined bug diagnosis whose core is building a fast, deterministic pass/fail reproduction first; the later phases run on that signal. Use for hard bugs, flaky tests or performance regressions. Trigger on "diagnose this", "debug this", "why is this broken", "it sometimes fails", "this test is flaky", "I can't reproduce it".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs shell scripts](https://github.com/ivy00johns/Skill-Madness/tree/HEAD/skills/workflows/diagnose-loop)
- [Asks for: Read, Write, Edit, Bash, Grep, Glob](https://github.com/ivy00johns/Skill-Madness/blob/HEAD/skills/workflows/diagnose-loop/SKILL.md)
- [No network calls found in its scripts](https://github.com/ivy00johns/Skill-Madness/tree/HEAD/skills/workflows/diagnose-loop)
- [License: MIT](https://github.com/ivy00johns/Skill-Madness/tree/HEAD/skills/workflows/diagnose-loop)

## Features

- **Feedback loop construction:** Ranks ten methods for building a fast, deterministic pass/fail signal and picks the cheapest one that reproduces the bug.
- **Flaky bug stabilization:** Raises the reproduction rate of intermittent failures through narrower tests, parallel runs and deliberate system stress.
- **Ranked hypothesis testing:** Produces three to five falsifiable hypotheses for user review and tests them one variable at a time.
- **Tagged debug instrumentation:** Marks every temporary log or breakpoint with a unique token so cleanup is a single search.
- **Regression test guidance:** Places regression tests at the smallest observable seam and flags missing seams as architectural issues.
- **Post-fix verification:** Reruns the original loop on pre-fix and post-fix commits and records the root cause in the commit message.

## Good for

- Track down a test that passes locally but fails intermittently in CI
- Investigate a performance regression that appeared after a recent change
- Debug a bug that only happens in production by replaying the request locally
- Reproduce a UI rendering issue in a visible Playwright browser
- Find the commit that introduced a bug using git bisect

## Install

### Claude Code

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

```sh
/plugin marketplace add ivy00johns/Skill-Madness
/plugin install skill-madness@skill-madness
```

Or copy only this skill to `~/.claude/skills/diagnose-loop`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/diagnose-loop &&
cp -R "$tmp/skills/workflows/diagnose-loop" ~/.claude/skills/diagnose-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/diagnose-loop` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/diagnose-loop` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/diagnose-loop &&
cp -R "$tmp/skills/workflows/diagnose-loop" ~/.agents/skills/diagnose-loop &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/diagnose-loop` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/diagnose-loop` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/diagnose-loop &&
cp -R "$tmp/skills/workflows/diagnose-loop" ~/.cursor/skills/diagnose-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/diagnose-loop` inside it instead.

### Gemini CLI

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

```sh
gemini skills install https://github.com/ivy00johns/Skill-Madness.git --path skills/workflows/diagnose-loop
```

Or copy the folder to `~/.gemini/skills/diagnose-loop` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/diagnose-loop`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/diagnose-loop &&
cp -R "$tmp/skills/workflows/diagnose-loop" ~/.copilot/skills/diagnose-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/diagnose-loop` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git
```

Then copy `Skill-Madness/skills/workflows/diagnose-loop` into your agent's skills folder as `diagnose-loop`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Which tools does the skill need?

It lists Read, Write, Edit, Bash, Grep and Glob as allowed tools, and its loop recipes rely mainly on Bash and the repository's test tooling.

### When should I skip Diagnose loop?

For trivial bugs with obvious causes, such as typos or a missing import the stack trace already points at, the skill says to just fix them. It is meant for flaky tests, performance regressions and bugs that take more than about 15 minutes to understand.

### How does Diagnose loop differ from systematic-debugging?

The skill recommends systematic-debugging for straightforward bugs that only need disciplined hypothesizing. It is aimed at cases where building a fast, deterministic feedback loop is the main payoff.

### Does Diagnose loop work with Playwright?

Yes, the skill suggests composing with the playwright skill and running browser scripts with headless set to false for UI bugs.

### How do I install Diagnose loop in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/diagnose-loop to use it in all your projects, or to .claude/skills/diagnose-loop in one project. Or install the skill-madness plugin, which includes it: /plugin marketplace add ivy00johns/Skill-Madness, then /plugin install skill-madness@skill-madness.

### Does Diagnose loop run scripts?

Yes. It runs shell scripts. No network calls were found in its 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 Diagnose loop?

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 Diagnose loop?

The closest alternatives to Diagnose loop are Diagnosing bugs, Debug, Debug issue, Debug hypothesis and Debug.

## Where this comes from

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

## Alternatives

- [Diagnosing bugs](https://ai-powered.com/skills/diagnosing-bugs): Diagnosing bugs is an open-source agent skill for developer tools.
- [Debug](https://ai-powered.com/skills/debug-evist0): Debug is an open-source agent skill for developer tools.
- [Debug issue](https://ai-powered.com/skills/debug-issue): Debug issue is an open-source agent skill for developer tools.
- [Debug hypothesis](https://ai-powered.com/skills/debug-hypothesis): Debug hypothesis is an open-source agent skill for developer tools.
- [Debug](https://ai-powered.com/skills/debug-tansuasici): Debug is an open-source agent skill for developer tools.
- [Debugging](https://ai-powered.com/skills/debugging): Debugging is an open-source agent skill for developer tools.
- [Systematic Debugging](https://ai-powered.com/skills/systematic-debugging-joaoariedi): Systematic Debugging is an open-source agent skill for developer tools.
- [Debugging and error recovery](https://ai-powered.com/skills/debugging-and-error-recovery): Debugging and error recovery is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/diagnose-loop
