diagnose-loop

diagnose-loop is a skill for Claude Code from ivy00johns/Skill-Madness. It costs 125 tokens per session (1,591 once invoked), scanned A, original, MIT.

A structured method for finding hard-to-reproduce bugs, flaky tests, and performance slowdowns by first creating a quick, repeatable pass-or-fail test.

In plain words
What is it for?
Use it to investigate intermittent failures, tests that sometimes pass and sometimes fail, performance regressions, and bugs that are difficult to reproduce.
Why use it?
It replaces guesswork and repeated manual checking with clear feedback, making it easier to tell whether a suspected cause is correct.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the skill-madness plugin — 56 skills shipped together

Good fit Use it to investigate intermittent failures, tests that sometimes pass and sometimes fail, performance regressions, and bugs that are difficult to reproduce.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ivy00johns/skill-madness/diagnose-loop
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.

Any agent
npx skills add ivy00johns/Skill-Madness --skill diagnose-loop
Clone the repo
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness

Made for: Claude Code.

Or install skill-madness, the plugin that ships this one along with the rest of its 56 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for diagnose-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/ivy00johns/skill-madness/diagnose-loop.svg)](https://agentmods.dev/skills/ivy00johns/skill-madness/diagnose-loop)
Your own site
<a href="https://agentmods.dev/skills/ivy00johns/skill-madness/diagnose-loop"><img src="https://agentmods.dev/badge/skills/ivy00johns/skill-madness/diagnose-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 125 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,591 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00125 $0.01591
Opus 5 $0.00063 $0.00796
Sonnet 5 $0.00025 $0.00318
Haiku 4.5 $0.00013 $0.00159

Measured 8d ago against content hash fc9b5acbb2d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

diagnose-loop scanned grade A with 1 finding 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 8d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/hitl-loop.template.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

3. **`curl` / HTTP request that reproduces** — for API and webhook bugs; capture as a shell script so it replays in one line.
skills/workflows/diagnose-loop/SKILL.md · 87 lines

How it starts

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

Diagnose Loop

Tradeoff caveat. This skill biases toward thoroughness over speed. For trivial bugs with obvious causes (typos, off-by-one, a missing import the stack trace already points at), skip phases and just fix it. For everything else — flaky tests, performance regressions, "it works on my machine," intermittent failures, anything you've stared at for more than 15 minutes — the discipline is the point. Adapted from mattpocock's diagnose pattern.

diagnose-loop vs systematic-debugging. The plugin skill superpowers:systematic-debugging is the general "form a hypothesis before you touch a fix" discipline for any bug or unexpected behavior. Reach for diagnose-loop (this skill) specifically when the payoff is in building a fast, deterministic, binary feedback loop first — flaky tests, performance regressions, hard-to-reproduce or intermittent failures. For a straightforward bug where you just need disciplined hypothesizing, superpowers:systematic-debugging is the lighter fit.

Phase 1 — Build a feedback loop (THE SKILL)

Spend disproportionate effort here. Be aggressive. Be creative. Refuse to give up.

Every later phase mechanically consumes Phase 1's output. A fast deterministic loop turns hypothesizing into a binary search; a slow or noisy loop turns it into guessing. Building the loop is the work — the rest is bookkeeping.

A good loop has three properties: it runs in seconds, it returns a binary pass/fail signal, and it fails for the same reason every time. Optimize for those before doing anything else.

Ten ranked ways to construct a loop

In order of cost — pick the cheapest one that actually reproduces the bug.

  1. Existing failing test — cheapest possible signal; the harness already exists.
  2. New failing test that captures the bug — write the assertion, watch it fail, then start.
  3. curl / HTTP request that reproduces — for API and webhook bugs; capture as a shell script so it replays in one line.
  4. CLI command + diff against known-good output — golden-file testing for any tool that emits text.
  5. Headless browser script (Playwright/Puppeteer) for UI bugs — compose with the playwright skill.
  6. Trace/log replay — when the bug only happens in production, dump the request and replay it locally.
  7. Throwaway harness script in the repo's language — a 20-line file that imports the buggy module and exercises it directly.
  8. Property-based / fuzz test — when the bug is data-dependent and you don't yet know which input triggers it.
  9. git bisect — when the bug is recent and a known-good commit exists; the loop is the bisect script.
  10. Differential testing against a reference implementation — for parser, compiler, or protocol bugs where "correct" is defined elsewhere.

Read the full file on GitHub · 87 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 87 lines · 125 tokens per session scan A fc9b5acbb2d7

Subscribe to this mod's changes

diagnose-loop is a skill published in the GitHub repository ivy00johns/Skill-Madness (11 stars, last pushed today), licensed MIT. It adds 125 tokens to every session and 1,591 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). 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

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

systematic-debugging

Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.

open-metadata/OpenMetadata · 37 tokens

diagnose

Trace from a reproduced symptom to the source code that causes it. Pin the specific file and approximate line, rate confidence in the cause and clarity of the fix independently, and always propose a concrete fix.

emdash-cms/emdash · 43 tokens

repro-admin

Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.

emdash-cms/emdash · 48 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

zebbern/claude-code-guide · 71 tokens

byted-util-volcengine-detect-retry

An orchestration workflow for Volcengine Cloud Detect, a service that checks websites or network endpoints from test locations.

bytedance/agentkit-samples · 101 tokens