ml-debugging

ml-debugging is a skill for Claude Code, Codex from param087/agent-ml-skills. It costs 44 tokens per session (703 once invoked), scanned A, original, MIT.

A step-by-step guide for finding why a machine-learning model trains badly or produces suspicious results. It separates problems in the data, training process, and ability to generalise to new data.

In plain words
What is it for?
Use it to test whether a model can overfit one batch, diagnose data and label wiring, investigate unstable optimisation, and find leakage or generalisation problems.
Why use it?
It provides a systematic way to investigate NaN losses, stuck training, implausibly high scores, or differences between training and validation results.

Skill for Claude CodeCodex

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

Good fit Use it to test whether a model can overfit one batch, diagnose data and label wiring, investigate unstable optimisation, and find leakage or generalisation problems.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/param087/agent-ml-skills/ml-debugging"><img src="https://agentmods.dev/badge/skills/param087/agent-ml-skills/ml-debugging.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 703 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.00044 $0.00703
Opus 5.5 $0.00018 $0.00281
Sonnet 5.5 $0.00009 $0.00141
Haiku 4.5 $0.00004 $0.00070

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

Security

Grade A, and why

ml-debugging 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 2mo 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/ml-debugging/SKILL.md · 70 lines

How it starts

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

ML Debugging

Overview

ML bugs are usually silent — the code runs, but the model is wrong. Debug systematically by isolating which layer is broken: data, optimization, or generalization. Form a hypothesis, test it with the cheapest possible experiment, then move on.

When to use

  • Loss is NaN/Inf or stuck.
  • Metrics are implausibly high (leakage) or stuck at chance.
  • Train/val curves diverge.

First move: can it overfit one batch?

The fastest sanity check in ML. Take a single small batch and train until loss ≈ 0.

x, y = next(iter(train_loader))
for _ in range(200):
    optimizer.zero_grad()
    loss = criterion(model(x), y)
    loss.backward(); optimizer.step()
print(loss.item())  # should approach 0
  • Can't overfit one batch → bug in model/loss/labels/data wiring (not capacity).
  • Overfits one batch but not the dataset → optimization or regularization issue.

Symptom → cause decision tree

Symptom Likely cause Fix
Loss = NaN LR too high; log(0); /0; bad input scaling Lower LR, clip grads, add eps, normalize inputs
Loss flat at start LR too low; dead ReLUs; wrong loss Raise LR; check init; verify loss/target shapes
Train great, val terrible Overfitting or leakage Regularize/augment; audit for leakage
Val better than train Leakage; val too easy; dropout-at-train artifact Re-check split; inspect val set
Metric implausibly high Target leakage Hunt leaked features (see EDA skill)
Stuck at chance Labels misaligned; data not shuffled; LR off Verify label mapping; shuffle; sweep LR

Leakage hunt (when results are "too good")

  1. Any feature with |corr| ≈ 1.0 to target?
  2. Is preprocessing fit before the split?
  3. Do rows from one entity span train and test? (use GroupKFold)
  4. Time series shuffled? (must be chronological)
  5. Is a post-outcome column (e.g., refund_issued) used to predict the outcome?

Optimization checklist

  • Normalize/standardize inputs.
  • Sweep LR over [1e-5 ... 1e-1] (log scale) — wrong LR causes most failures.
  • Add gradient clipping for RNNs/transformers.
  • Check for NaNs in inputs/targets before training.
  • Verify loss matches task (CE for classification logits, not MSE).

Read the full file on GitHub · 70 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. 2mo ago First seen · 70 lines · 44 tokens per session scan A 235366ddab71

Subscribe to this mod's changes

ml-debugging is a skill published in the GitHub repository param087/agent-ml-skills (13 stars, last pushed 5mo ago), licensed MIT. It adds 44 tokens to every session and 703 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-08-31.

Related

ml-debugging compared with skills from other repositories

ml-debugging next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ml-debuggingparam087/agent-ml-skillsSkill135mo agoMITA44Claude Code, Codex
spark-optimizationwshobson/agentsSkill42kyesterdayMITA37Claude Code
solr-querygriddynamics/rosettaSkill370yesterdayApache-2.0A27Claude Code, Codex
agent-pytorch-build-resolverKunanonJ/ai-skills-hubSkill51mo agoMITA53Claude Code, Codex
llm-debuggerpatricio0312rev/skillsSkill639mo agoMITA62Claude Code, Codex
ai-tracing-requestslebsral/DSPy-Programming-not-prompting-LMs-skillsSkill124mo agononeA171Claude Code
dspy-assertionslebsral/DSPy-Programming-not-prompting-LMs-skillsSkill124mo agononeA133Claude Code