pytorch-migrate

pytorch-migrate is a skill for Claude Code from Axect/pytorch_template. It costs 88 tokens per session (4,384 once invoked), scanned C, original, MIT.

A migration guide for projects built from pytorch_template, a starter template for PyTorch machine-learning projects. It detects the project’s template version and applies the required updates from the latest template.

In plain words
What is it for?
Use it when updating, upgrading, or synchronizing a PyTorch template project, especially when newer features or structural changes are missing.
Why use it?
It helps bring an older project up to date without manually identifying every missing template change. The project’s files are checked against the current template to determine what needs updating.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it when updating, upgrading, or synchronizing a PyTorch template project, especially when newer features or structural changes are missing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/axect/pytorch_template/pytorch-migrate
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 Axect/pytorch_template --skill pytorch-migrate
Clone the repo
git clone --depth 1 https://github.com/Axect/pytorch_template

Made for: Claude Code.

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 pytorch-migrate

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/axect/pytorch_template/pytorch-migrate"><img src="https://agentmods.dev/badge/skills/axect/pytorch_template/pytorch-migrate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,384 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00088 $0.04384
Opus 5.5 $0.00035 $0.01754
Sonnet 5.5 $0.00018 $0.00877
Haiku 4.5 $0.00009 $0.00438

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

Security

Grade C, and why

pytorch-migrate scanned grade C with 1 finding 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 2d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$TEMPLATE_DIR"
skills/pytorch-migrate/SKILL.md · 239 lines

How it starts

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

pytorch-migrate

Detect the current version of a pytorch_template-based project and apply all necessary migrations to bring it up to date.

Usage

/pytorch-migrate [project_path]

If project_path is omitted, uses the current working directory.


Step 0: Clone the Template

Clone the latest template into a temporary directory. All code references during migration come from this clone — never from embedded snippets.

TEMPLATE_DIR=$(mktemp -d)
git clone --depth 1 https://github.com/Axect/pytorch_template.git "$TEMPLATE_DIR"

Use $TEMPLATE_DIR as the source of truth for all file contents throughout the migration. After migration is complete, clean up:

rm -rf "$TEMPLATE_DIR"

Step 1: Detect Current Version

Read the project's files and determine which version it's based on by checking for feature markers.

Run these checks in order — the first missing feature determines the starting migration point:

Check How to detect Version if MISSING
config.py has RunConfig dataclass class RunConfig exists Pre-template (not migratable)
callbacks.py exists File exists v0 (monolithic, pre-callback refactor)
pruner.py has PFLPruner class PFLPruner in pruner.py v1 (pre-PFL pruner, before 2024-12)
callbacks.py has OptimizerModeCallback Class exists v1 (pre-M1, missing optimizer mode toggle)
callbacks.py has LossPredictionCallback Class exists v1 (pre-M1, missing loss prediction)
callbacks.py has NaNDetectionCallback Class exists v2 (pre-NaN detection, before 2024-09)
callbacks.py has CheckpointCallback Class exists v3 (pre-checkpoint, before 2025-04)
config.py has data field in RunConfig data: str in RunConfig v4 (pre-data-decoupling)
callbacks.py has GradientMonitorCallback Class exists v5 (pre-diagnostics)
cli.py has preflight command def preflight exists v5 (pre-preflight)
cli.py has hpo_report command def hpo_report exists v5 (pre-hpo-report)
callbacks.py has CSVLoggingCallback Class exists v6 (pre-dual-logging)
config.py has logging or wandb field in RunConfig logging: str or wandb: bool in RunConfig v6 (pre-dual-logging)
provenance.py exists File exists v6 (pre-provenance)
cli.py has update_skills command def update_skills exists v7 (pre-TUI-tabs)
tools/monitor/src/hpo/mod.rs exists File exists v7 (pre-HPO-monitor)
config.py has wandb: bool field in RunConfig wandb: bool in RunConfig v8 (pre-wandb-toggle)
checkpoint.py has find_resume_checkpoint def find_resume_checkpoint exists v9 (pre-resume)
util.py has start_epoch parameter on Trainer.train start_epoch literal in util.py v9 (pre-resume)
pruner.py has discard_trial def discard_trial exists v11 (pre-correctness-fixes)
checkpoint.py has atomic_torch_save def atomic_torch_save exists v11 (pre-correctness-fixes)
config.py has SUPPORTED_MONITORS or monitor_mode either literal (M15 replaced SUPPORTED_MONITORS by def monitor_mode) v11 (pre-correctness-fixes)
pruner.py has sync_with_study def sync_with_study exists v12 (pre-pruner-persistence)
callbacks.py has step_offset step_offset literal in PrunerCallback v12 (pre-pruner-persistence)
config.py has TrainingConfig class TrainingConfig exists v13 (pre-training-options)
util.py has FastTensorLoader class FastTensorLoader exists v13 (pre-training-options)
config.py has load_splits def load_splits exists v14 (pre-evaluation-methodology)
util.py has finalize_study def finalize_study exists v14 (pre-evaluation-methodology)
callbacks.py has BestWeightsCallback class BestWeightsCallback exists v14 (pre-evaluation-methodology)
pruner.py has rank_reliability def rank_reliability exists v14 (pre-evaluation-methodology)
metrics.py has greater_is_better greater_is_better literal v15 (pre-metric-objectives)
util.py has aggregate_seeds def aggregate_seeds exists v15 (pre-metric-objectives)
config.py has TrialSeededSampler class TrialSeededSampler exists v15 (pre-per-trial sampler seeds)
All checks pass — Current (up to date)

Read the full file on GitHub · 239 lines

Files

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.

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. 2d ago Changed · +53 lines · +10 tokens per session dfdab6b2f850
  2. 3mo ago First seen · 186 lines · 78 tokens per session scan C c69ad437eed4

Subscribe to this mod's changes

pytorch-migrate is a skill published in the GitHub repository Axect/pytorch_template (10 stars, last pushed 2d ago), licensed MIT. It adds 88 tokens to every session and 4,384 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

pytorch-migrate compared with skills from other repositories

pytorch-migrate next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pytorch-migrateAxect/pytorch_templateSkill102d agoMITC88Claude Code
perforatedaiPerforatedAI/PerforatedAISkill2419d agoApache-2.0A133Claude Code, Codex
flow-nexus-neuralruvnet/rufloSkill83ktodayMITA21Claude Code
marimo-pairmarimo-team/marimoSkill24ktodayApache-2.0A57Claude Code, Codex
fill-model-descriptionsmarimo-team/marimoSkill24ktodayApache-2.0A65Claude Code
physicsnemo-shard-tensorNVIDIA/physicsnemoSkill3.5ktodayApache-2.0A152Claude Code, Codex
physicsnemo-discoverNVIDIA/physicsnemoSkill3.5ktodayApache-2.0A124Claude Code, Codex