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.
npx skills add giacomogaglione/claude-awesome-stack --skill ml-debuggit clone --depth 1 https://github.com/giacomogaglione/claude-awesome-stackWrote 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.
[](https://agentmods.dev/skills/giacomogaglione/claude-awesome-stack/ml-debug)<a href="https://agentmods.dev/skills/giacomogaglione/claude-awesome-stack/ml-debug"><img src="https://agentmods.dev/badge/skills/giacomogaglione/claude-awesome-stack/ml-debug.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00038 | $0.00642 |
| Opus 5 | $0.00019 | $0.00321 |
| Sonnet 5 | $0.00008 | $0.00128 |
| Haiku 4.5 | $0.00004 | $0.00064 |
Grade A, and why
ml-debug 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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ML Debugging Skill
When debugging an ML issue, work through these checks in order. Stop at the first check that reveals the problem.
1. Shape Verification
Trace tensor shapes through the computation:
- Print shapes at every function boundary:
print(f"input: {x.shape}, output: {y.shape}") - Verify batch dimension is preserved through all operations
- Check that reshape/view operations don't silently permute data
- Verify attention mask shapes match query/key dimensions
2. Dtype and Device Checks
Look for silent type/device mismatches:
- Print
tensor.dtypeandtensor.deviceat suspicious points - Check for float32/float64 mixing (common in loss computation)
- Verify all tensors in an operation are on the same device
- Check for integer overflow in index operations
3. NaN/Inf Propagation
Trace where NaN or Inf first appears:
- Insert
assert not torch.isnan(x).any(), f"NaN at {name}"after each operation - Enable anomaly detection:
torch.autograd.set_detect_anomaly(True) - Check for division by zero in normalization layers
- Check for log(0) or log(negative) in loss functions
- Check for extremely large values before softmax
4. Gradient Flow
Diagnose vanishing or exploding gradients:
- Print gradient norms:
torch.nn.utils.clip_grad_norm_(model.parameters(), max_norm=1.0) - Check if any parameter has
requires_grad=Falseunintentionally - Check for dead ReLU units (all-zero activations)
- Verify loss is connected to all trainable parameters
5. Data Pipeline
Check if the issue is in the data, not the model:
- Verify labels match inputs (visualize a few samples)
- Check for data leakage between train/val/test
- Verify normalization statistics (mean, std) are computed on training set only
- Check class imbalance
- Verify data augmentation isn't corrupting labels
6. Common Library Gotchas
PyTorch
model.eval()vsmodel.train()-- affects dropout and batchnormtorch.no_grad()must wrap inference codeloss.backward()accumulates gradients -- calloptimizer.zero_grad()firstDataLoaderwithnum_workers > 0can hide errors in worker processes
What ships with it
1 file 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.
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.
- 8d ago First seen · 74 lines · 38 tokens per session scan A 3a421436bb38
ml-debug is a skill published in the GitHub repository giacomogaglione/claude-awesome-stack (2 stars, last pushed 6mo ago), licensed MIT. It adds 38 tokens to every session and 642 once invoked, about $0.0002 per session on Opus 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.
Other skills, from other repositories
llm-api-call-error-wrapper-checks
Guidelines and instructions for LLM API call error wrapper checks.
thinking-scientific-method
When a symptom has several plausible causes, rank falsifiable hypotheses and run the cheapest discriminating observation first; prefer least-assumptive survivors only after evidence fit.
thinking-five-whys-plus
When a fault is localized and the proximate cause is known but the systemic root is not, chain evidence-linked whys with a counterfactual stop and a countermeasure.
thinking-map-territory
When a claim, doc, test, metric, or assumption conflicts with observed behavior, stop theorizing from the map and verify the live code or data; let territory overrule.
Vizra ADK Memory System
Implement persistent memory, session context, and vector memory (RAG) for AI agents.
foundation-models
On-device LLM integration using Apple's Foundation Models framework. Use when implementing AI text generation, structured output, or tool calling.