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 agentmods add skills/frgfm/torch-scan/torchscannpx skills add frgfm/torch-scan --skill torchscangit clone --depth 1 https://github.com/frgfm/torch-scanWrote 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/frgfm/torch-scan/torchscan)<a href="https://agentmods.dev/skills/frgfm/torch-scan/torchscan"><img src="https://agentmods.dev/badge/skills/frgfm/torch-scan/torchscan.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.00056 | $0.00556 |
| Opus 5 | $0.00028 | $0.00278 |
| Sonnet 5 | $0.00011 | $0.00111 |
| Haiku 4.5 | $0.00006 | $0.00056 |
Grade A, and why
torchscan 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 5d 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.
What it actually says
TorchScan
Use the smallest API that answers the request:
crawl_module(...): JSON-serializable module report.summary(...): printed table plus the same report.measure_flops(workload): operator FLOPs for one zero-argument workload call.measure_peak_memory(workload, device=...): backend-specific PyTorch peak memory.compare_reports(before, after): pure same-schema comparison.
Workflow
- Reuse the project's model and representative inputs. Do not download weights without permission.
- Prefer
argsandkwargsfor real calls; useinput_shapeonly for simple synthetic tensors. - Use
strict=Truewhen incomplete module metrics must stop automation. - Serialize the report directly. Never parse the
summarytable. - Check every metric's
statusand preserve diagnostics. - Ask the owner for thresholds. TorchScan measures; it does not decide whether a model fits.
Truth rules
complete: usevaluewith its method, unit, scope, and context.partial:known_valueis only a lower bound; do not extrapolate.unavailable: report that no measurement was produced.- Zero is valid only with
status == "complete". - Keep module FLOPs and operator FLOPs separate.
- Peak PyTorch memory is not process RSS or total device memory.
- Mocked or skipped CUDA/MPS checks are not hardware evidence.
For an uncounted operator, preserve the partial result. Rerun the equivalent workload with
measure_flops(..., custom_mapping=...) only when the owner can justify that operator's counting convention;
crawl_module does not accept custom mappings. Do not create a global registry, baseline store, wrapper service, or
automatic budget policy.
In a repository checkout, read ../../../docs/docs/agent-quickstart.md for the full workflow and
../../../docs/docs/report-schema.md for the report contract. Outside a checkout, use the published documentation at
https://frgfm.github.io/torch-scan/.
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.
- 5d ago First seen · 48 lines · 56 tokens per session scan A bfbfdb6b2916
torchscan is a skill published in the GitHub repository frgfm/torch-scan (222 stars, last pushed 5d ago), licensed Apache-2.0. It adds 56 tokens to every session and 556 once invoked, about $0.0003 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-30.
Other skills, from other repositories
model-integration
Use when adding a new model or pipeline to diffusers, setting up file structure for a new model, converting a pipeline to modular format, or converting weights for a new version of an already-supported model.
custom-blocks
Use when the user has written (or wants to write) a ModularPipelineBlocks subclass in a local Python file and needs to package it into a Hub-uploadable directory. Covers the workflow from a single block.py file to a published custom-block repo that consumers can load via ModularPipeline.frompretrained( …
physicsnemo-shard-tensor
Official NVIDIA-authored guidance for PhysicsNeMo ShardTensor domain parallelism — integrate domain parallelism into training/inference scripts (new or existing) with DDP or FSDP2, write and register shard patches to enable new layers/ops, and bootstrap multi-GPU correctness tests. Use when working with ShardTensor…
physicsnemo-discover
Official NVIDIA-authored guidance for navigating PhysicsNeMo — pick the model, datapipe, or example for a SciML/AI4Science task (surrogates, forecasting, downscaling, physics-informed, inverse, generative). Points at existing files via live repo search; never writes code. Do NOT use for installation or environment…
perforatedai
Expert in PerforatedAI library for adding artificial dendrites to PyTorch neural networks. Triggers: 'Perforate my model' (start interactive setup), 'debug my perforated model' (debug/optimize existing integration), 'load my perforated model for inference' (deploy trained models). Also use when: debugging dendrite…
trl
Reference for the TRL (Transformer Reinforcement Learning) library codebase. Use proactively before reading or editing any file under trl/ so you have the intended contracts and invariants in mind, not just what the current code says. Covers trainer hierarchy (SFT, DPO, GRPO, KTO), shared utility functions…