mcpbeat Sign in

Torch Bisect Skill for Claude

Bisect PyTorch commits to find the regression that breaks TorchTitan. Use when the user wants to bisect PyTorch or invokes /torch_bisect.

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
5585
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/pytorch/torchtitan --skill torch_bisect

What it tells the agent to use

found in the instruction text
Bash runs shell commands — read the instruction before connecting

The instruction itself

6 sections, as written by the author

PyTorch Git Bisect for TorchTitan

Bisect the PyTorch repo to find the commit that broke TorchTitan.

Always use absolute paths — shell state does not persist between Bash calls.

Phase 1: Gather Information

Record the TorchTitan directory (pwd). Then check if

~/.claude/torchtitan_torch_bisect_cache.json exists — if so, show cached

values and let the user reuse or override them.

Collect via AskUserQuestion (pre-fill from cache if available):

  • PyTorch repo path — absolute path to local checkout
  • Build command — shell command to recompile PyTorch after each checkout
  • Test command — run from TorchTitan dir; must exit 0 on good commits,

non-zero on bad. Judge ONLY by exit code, never by log content.

  • Good commit — a commit hash or a date (e.g., Feb 15)
  • Timeout policy — if test exceeds 10 min, auto-mark bad or ask each time?

After collecting, offer to save answers to the cache file.

Phase 2: Setup

  • Check GitHub connectivity: run curl -s -o /dev/null --connect-timeout 20 -w "%{http_code}" https://github.com.

If it fails or returns non-200, tell the user GitHub is not reachable and

suggest checking internet connectivity or proxy settings. On Meta internal

servers, suggest setting https_proxy=http://fwdproxy:8080. Do not proceed

until connectivity is confirmed.

  • cd <pytorch> && git fetch origin (timeout 300000ms). On failure, ask user

to fix (remind about proxy/fwdproxy if it looks like a network error).

  • Check git bisect log 2>&1 — if a bisect is active, ask user to reset or abort.
  • Resolve the good commit:
  • Hash: verify with git log -1 <hash>
  • Date: git log origin/main --before="<DATE>T23:59:59" --format="%H %s" -1

— show result and confirm with user.

  • Bad commit is origin/main. Show it to user.
  • Show git rev-list --count <good>..origin/main and estimated steps (~log2).
  • Run each bisect command individually so failures can be reported cleanly:
  • git bisect start
  • git bisect bad origin/main
  • git bisect good <good>

If any step fails, show the error and run git bisect reset before asking

the user how to proceed.

Phase 3: Bisect Loop

Repeat until bisect finds the first bad commit:

A. Build — run build command in PyTorch dir (timeout 600000ms).

On failure: show last 50 lines, ask user to Skip / Retry / Abort.

B. Test — run test command in TorchTitan dir (timeout 600000ms).

Exit 0 = good, non-zero = bad. On timeout, follow user's policy from Phase 1.

Never analyze logs — use only exit code.

C. Recordgit bisect good or git bisect bad in PyTorch dir.

  • Output contains "is the first bad commit" → done, go to Phase 4.
  • Output contains "Bisecting:" → continue loop.
  • Cannot narrow further (too many skips) → tell user, suggest abort.

D. Progress — print step number, commit hash, good/bad, remaining count.

Phase 4: Report and Cleanup

  • Capture git bisect log and git show --stat <bad_commit>.
  • Extract PR number from commit subject ((#NNNNN) pattern). If found, run

gh pr view <N> --repo pytorch/pytorch --json title,body,url to get PR

details. Fallback URL: https://github.com/pytorch/pytorch/pull/<N>.

  • git bisect reset.
  • Present summary:
## Bisect Complete
**First bad commit:** <hash>
**Commit message:** <subject>
**Author:** <author> | **Date:** <date>

### Associated Pull Request
**PR:** #<N> — <title>
**Link:** https://github.com/pytorch/pytorch/pull/<N>
**Summary:** <first ~20 lines of PR body>

### Changed files
<git show --stat output>

### Full bisect log
<git bisect log output>

Omit the PR section if no PR number was found. Do NOT diagnose root cause.

Rules

  • Always use absolute paths.
  • Judge test results by exit code only — never analyze output.
  • On unexpected errors, show the error and ask the user before proceeding.
  • Keep the user informed after every bisect step.

Other skills for the same job

different authors, same section of the catalogue
Skill Creator
by anthropics
vendor ×10

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

56k tokens scripts
Geo Database
by christophacham
×4

Access NCBI GEO for gene expression/genomics data. Search/download microarray and RNA-seq datasets (GSE, GSM, GPL), retrieve SOFT/Matrix files, for transcriptomics and expression analysis.

12k tokens
Pymc Bayesian Modeling
by christophacham
×4

Bayesian modeling with PyMC. Build hierarchical models, MCMC (NUTS), variational inference, LOO/WAIC comparison, posterior checks, for probabilistic programming and inference.

24k tokens scripts
Pymoo
by christophacham
×4

Multi-objective optimization framework. NSGA-II, NSGA-III, MOEA/D, Pareto fronts, constraint handling, benchmarks (ZDT, DTLZ), for engineering design and optimization problems.

19k tokens scripts
Statsmodels
by ComeOnOliver
×4

Statistical modeling toolkit. OLS, GLM, logistic, ARIMA, time series, hypothesis tests, diagnostics, AIC/BIC, for rigorous statistical inference and econometric analysis.

41k tokens
Finetuning
by microsoft
vendor ×3

Fine-tune models on Azure AI Foundry using SFT (supervised), DPO (preference), or RFT (reinforcement with graders). Covers dataset preparation, training job submission, deployment, and evaluation. USE FOR: fine-tune, SFT, DPO, RFT, training data, grader, distillation, fine-tuned model, training job, large file upload, calibrate grader, deploy fine-tuned model, evaluate fine-tuned model. DO NOT USE FOR: general model deployment without fine-tuning (use deploy-model), agent creation (use agents), prompt optimization without training (use prompt-optimizer).

47k tokens scripts
Arboreto
by christophacham
×3

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

6k tokens scripts
Datacommons Client
by christophacham
×3

Work with Data Commons, a platform providing programmatic access to public statistical data from global sources. Use this skill when working with demographic data, economic indicators, health statistics, environmental data, or any public datasets available through Data Commons. Applicable for querying population statistics, GDP figures, unemployment rates, disease prevalence, geographic entity resolution, and exploring relationships between statistical entities.

9k tokens

How to use it

Copy the folder

Take pytorch/torch_bisect from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.