diagnose-loop

diagnose-loop is a skill for Claude Code, Codex from tmusser/ai-engineering-skills. It costs 17 tokens per session (589 once invoked), scanned A, original, MIT.

A systematic debugging workflow for command failures, incorrect behavior, test regressions, or output that differs from the specification.

In plain words
What is it for?
Use it to investigate a failure, apply a focused correction, add a regression check when possible, and rerun the original and relevant tests.
Why use it?
It prevents guesswork by requiring the failure to be reproduced, its cause to be identified, and the smallest fix to be verified.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to investigate a failure, apply a focused correction, add a regression check when possible, and rerun the original and relevant tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmusser/ai-engineering-skills/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 tmusser/ai-engineering-skills --skill diagnose-loop
Clone the repo
git clone --depth 1 https://github.com/tmusser/ai-engineering-skills

Made for: Claude Code, Codex.

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/tmusser/ai-engineering-skills/diagnose-loop/github.svg)](https://agentmods.dev/skills/tmusser/ai-engineering-skills/diagnose-loop)
Your own site
<a href="https://agentmods.dev/skills/tmusser/ai-engineering-skills/diagnose-loop"><img src="https://agentmods.dev/badge/skills/tmusser/ai-engineering-skills/diagnose-loop/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for diagnose-loop

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmusser/ai-engineering-skills/diagnose-loop"><img src="https://agentmods.dev/badge/skills/tmusser/ai-engineering-skills/diagnose-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 589 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00017 $0.00589
Opus 5.5 $0.00007 $0.00236
Sonnet 5.5 $0.00003 $0.00118
Haiku 4.5 $0.00002 $0.00059

Measured 1mo ago against content hash c04a70b54a57, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

diagnose-loop 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 1mo 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/diagnose-loop/SKILL.md · 61 lines

How it starts

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

Diagnose Loop

Purpose

Debug failures systematically.

When to use

Use when a command fails, behavior is wrong, a test regresses, or output does not match the spec.

Inputs

  • Failure report
  • Exact command or reproduction case
  • Recent changes
  • Logs, traces, or output

Workflow

  1. Freeze feature work.
  2. Reproduce the failure.
  3. Identify the exact failing command or case.
  4. List hypotheses.
  5. Instrument minimally.
  6. Name one active hypothesis and the observation that would falsify it; apply the smallest fix that tests it.
  7. Add a regression check if possible.
  8. Rerun the original failing command.
  9. Rerun relevant verification. An improved signal is not completion; the original failure and compatibility checks must pass.
  10. Before a second repair attempt, count the initial attempt and define the retry contract: fixed input/evaluator identities, acceptance threshold, total attempt limit, consecutive no-progress limit, revert rule, ledger location, and review trigger. If incomplete, stop with REVIEW_REQUIRED; the initial bounded diagnosis does not require a separate loop artifact.
  11. Record each started attempt, including failed commands and interrupted attempts: hypothesis, artifact state, evidence, outcome, and consumed budget. Change the next hypothesis only when the evidence supports it. Unchanged or worse results and tool errors consume the no-progress budget; improvement does not reset the total budget.
  12. Stop at acceptance, either budget limit, an unresolved interruption, or a scope/permission/evaluator change. Preserve the best known state and the failed attempt's evidence; revert only edits owned by this attempt, never unrelated user work. Reconcile uncertain external effects before retrying.
  13. On resume, carry forward the same loop identity, ledger, input/evaluator identities, consumed budget, and stop reason. A fresh session or subtask does not grant new attempts. Renew a spent budget or change the evaluator only through an explicit contract revision; preserve the prior ledger.

Read the full file on GitHub · 61 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. 1mo ago Changed · +8 lines · +9 tokens per session c04a70b54a57
  2. 1mo ago First seen · 53 lines · 8 tokens per session scan A b25c65d3200d

Subscribe to this mod's changes

diagnose-loop is a skill published in the GitHub repository tmusser/ai-engineering-skills (6 stars, last pushed 5d ago), licensed MIT. It adds 17 tokens to every session and 589 once invoked, about $0.0001 per session on Opus 5.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-31.

Related

Other skills, from other repositories

bug-diagnosis

Use this skill to systematically diagnose the root cause of a bug before attempting a fix. Activates when a bug is reported, a test is failing, or unexpected behavior is observed. Prevents guess-and-check debugging that introduces additional bugs while chasing symptoms.

karthikrshet/aiskills · 60 tokens

doca-flow

DOCA Flow packet steering on NVIDIA NICs/DPUs, linked into a C application: match/action pipes, ports, representors, forwarding, hairpin, counters. Trigger on packet steering, classifier, rule-matching, representor, hairpin or 5-tuple-to-queue questions even when "DOCA Flow" is not named. Also covers pipe validation…

NVIDIA/skills · 224 tokens

compute-sanitizer-diagnose-cuda-bugs

Detect and diagnose CUDA correctness bugs with NVIDIA Compute Sanitizer. Routes GPU memory errors, shared-memory data races, uninitialized-memory reads, and synchronization/barrier bugs to the right sub-tool (memcheck, racecheck, initcheck, synccheck) and explains how to build, run, and read the report. Use when…

NVIDIA/skills · 213 tokens

doca-debug

Use this skill when the user is debugging any DOCA symptom — a build that won't compile, a link step that can't resolve a doca symbol, a runtime call returning DOCAERROR, a silent service or tool, or a stack trace / valgrind / core dump — and needs the layered ladder (install → version → build → link → runtime →…

NVIDIA/skills · 233 tokens

mcore-create-issue

Investigate a failing GitHub Actions run or job and create a GitHub issue for the failure.

NVIDIA/skills · 26 tokens

doca-dpa-hl-tracer

Use this skill when the user runs docadpahltracer to capture/decode DPA-side traces at the programming-events layer (kernel entry/exit, sync points, comm primitive calls, RDMA WR submission, completion drain) — picking TRACE vs CRIT, tuning the JSON config (file-size limits + filesizelimitpolicy, thread…

NVIDIA/skills · 242 tokens