diagnose

diagnose is a skill for Claude Code from wenhaochai/claude-plugins. It costs 53 tokens per session (891 once invoked), scanned A, original, MIT.

A one-pass performance diagnosis for a PyTorch job, using its contract, measurements, and profiling data. It identifies the biggest time sink, proposes one fix, and defines a number to check whether the fix preserves correctness.

In plain words
What is it for?
Use it to establish a baseline for speed, memory, and correctness, find the main bottleneck, and hand back one evidence-based improvement to try.
Why use it?
It avoids spending a whole optimization cycle on several issues when the user wants one measured answer quickly.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions Claude Code.

Part of the who-ate-my-flops plugin — 9 skills shipped together

Good fit Use it to establish a baseline for speed, memory, and correctness, find the main bottleneck, and hand back one evidence-based improvement to try.

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

Made for: Claude Code.

Or install who-ate-my-flops, the plugin that ships this one along with the rest of its 9 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

README.md
[![agentmods](https://agentmods.dev/badge/skills/wenhaochai/claude-plugins/diagnose/github.svg)](https://agentmods.dev/skills/wenhaochai/claude-plugins/diagnose)
Your own site
<a href="https://agentmods.dev/skills/wenhaochai/claude-plugins/diagnose"><img src="https://agentmods.dev/badge/skills/wenhaochai/claude-plugins/diagnose/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/wenhaochai/claude-plugins/diagnose"><img src="https://agentmods.dev/badge/skills/wenhaochai/claude-plugins/diagnose.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 891 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.00053 $0.00891
Opus 5.5 $0.00021 $0.00356
Sonnet 5.5 $0.00011 $0.00178
Haiku 4.5 $0.00005 $0.00089

Measured 17d ago against content hash 79ac5928af7a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

diagnose 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 17d 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.

who-ate-my-flops/skills/diagnose/SKILL.md · 84 lines

How it starts

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

diagnose is a sequence of steps. Work through them one at a time and mark each one done as you go.

It stops after one finding, one fix and the measurement that proves it. The user chose this over optimize because they want an answer in an hour rather than a branch in a day, and a second finding they did not ask for costs them that hour.

Step 1: setup

Use the setup-baseline skill. It builds the worktree and the workspace, has extract-computation-graph write records/computation_graph.json and records/execution_schedule.json, then measures the base commit for speed, memory and correctness, profiles it in full with torch-profile, and records it with workspace.py add --verdict base. A workspace left in that shape is one optimize can pick up later without profiling the base again.

The tolerance it derives is what step 3 reads the fix against. Without it a fix has no number for whether the job still computes the same thing.

Do not arm anything. The registry and the Claude Code watchdog keep a campaign turning for hours, and this is one pass. They belong to optimize.

Step 2: the one finding

setup-baseline left the traces under commits/<base sha>/trace/, the rendered views beside them and the diagnosis at commits/<base sha>/report.md. This step reads them and picks one.

Read all five views before naming anything. "The largest" is a claim about the other four, so ranking them is what earns it.

Take the top finding by what it costs in wall clock: the part not already hidden behind other work, multiplied by its repeat count from records/computation_graph.json. Do not rank by kernel time. A collective that is fully hidden costs nothing, and a 2 ms stall on every one of forty blocks outranks a 60 ms one-off.

The finding carries everything torch-profile's ③ asks for. The code_anchor and the cost ceiling are the two the user reads first.

Step 3: the one fix

Pick the fix by optimize's Tradeoffs: architecture, breadth, memory, precision.

Then prove it, on the same benchmark script and the same node:

Read the full file on GitHub · 84 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. 17d ago First seen · 84 lines · 53 tokens per session scan A 79ac5928af7a

Subscribe to this mod's changes

diagnose is a skill published in the GitHub repository wenhaochai/claude-plugins (17 stars, last pushed 2d ago), licensed MIT. It adds 53 tokens to every session and 891 once invoked, about $0.0002 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-10-01.

Related

Other skills, from other repositories

trace

Evidence-driven tracing lane that orchestrates competing tracer hypotheses in Claude built-in team mode.

Yeachan-Heo/oh-my-claudecode · 18 tokens

smiles-validation

Strict SMILES validation, structural comparison, and modification verification. Catches invalid LLM-generated molecules.

synthetic-sciences/openscience · 24 tokens

nonlinear-solvers

Select and configure nonlinear solvers for f(x)=0 or min F(x). Use for Newton methods, quasi-Newton (BFGS, L-BFGS), Broyden, Anderson acceleration, diagnosing convergence issues, choosing line search vs trust region, and analyzing Jacobian quality.

beita6969/ScienceClaw · 63 tokens

linear-solvers

Select and configure linear solvers for systems Ax=b in dense and sparse problems. Use when choosing direct vs iterative methods, diagnosing convergence issues, estimating conditioning, selecting preconditioners, or debugging stagnation in GMRES/CG/BiCGSTAB.

beita6969/ScienceClaw · 55 tokens

numerical-stability

Analyze and enforce numerical stability for time-dependent PDE simulations. Use when selecting time steps, choosing explicit/implicit schemes, diagnosing numerical blow-up, checking CFL/Fourier criteria, von Neumann analysis, matrix conditioning, or detecting stiffness in advection/diffusion/reaction problems.

beita6969/ScienceClaw · 61 tokens

social-physics-filter

Unified boundary enforcement, interpersonal diagnostic, and relational audit engine. Absorbs 40 psychology + 2 social protocols and all relationship case studies.

winstonkoh87/Athena-Public · 34 tokens