tensorcircuit-ng: Skill for Claude Code

.agents/skills/contraction-tuner/SKILL.md

contraction-tuner is a skill for Claude Code from tensorcircuit/tensorcircuit-ng. It costs 51 tokens per session (2,429 once invoked), scanned A, original, Apache-2.0.

A tuning guide for tensor networks, which represent large calculations as connected smaller tensors, in TensorCircuit-NG. It helps compare different ways to perform those calculations and split them into smaller jobs.

In plain words
What is it for?
Use it to optimize or benchmark contraction paths and slicing for large-circuit amplitude or expectation calculations, including OMECO and cotengra settings.
Why use it?
It replaces guesses based on one measurement with measured comparisons of time, memory, floating-point work, written data, and the number of split tasks.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents).

This is tensorcircuit/tensorcircuit-ng's own configuration. It tells Claude Code how to work on tensorcircuit-ng itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tensorcircuit-ng configures →

Reuse

Borrowing it

Nothing to install: this file belongs to tensorcircuit/tensorcircuit-ng. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tensorcircuit/tensorcircuit-ng/master/.agents/skills/contraction-tuner/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/tensorcircuit/tensorcircuit-ng

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 contraction-tuner

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/tensorcircuit/tensorcircuit-ng/contraction-tuner"><img src="https://agentmods.dev/badge/skills/tensorcircuit/tensorcircuit-ng/contraction-tuner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,429 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 143
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
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.00051 $0.02429
Opus 5.5 $0.00020 $0.00972
Sonnet 5.5 $0.00010 $0.00486
Haiku 4.5 $0.00005 $0.00243

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

Security

Grade A, and why

contraction-tuner 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.

.agents/skills/contraction-tuner/SKILL.md · 179 lines

How it starts

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

Contraction Tuner

Use this skill when a task asks to optimize, compare, or benchmark tensor-network contraction paths, slicing targets, OMECO, cotengra, contraction width, FLOPs, write, or slice count for TensorCircuit-NG.

Core Principle

Treat contraction tuning as an empirical search problem. Do not infer quality from width alone. Always report at least:

  • path/search time and slicer/reconfiguration time separately
  • log10(total FLOPs)
  • log2(max intermediate size)
  • log2(total write)
  • number of sliced indices and total slice tasks
  • package versions and topology size (ntensors, nindices)

For dim-2 circuit indices, k sliced indices means 2**k slice tasks. A path with more slices can still have lower total FLOPs if per-slice contractions are much cheaper.

Metric Hygiene

  • cotengra target_size is a linear tensor element count. For target width W, pass target_size=2**W, not W.
  • cotengra ContractionTree.total_flops() and total_write() include slicing multiplicity.
  • OMECO SlicedEinsum.complexity() is per-slice. For fair comparison, convert the OMECO sliced tree to a cotengra ContractionTree and apply remove_ind_() for each sliced.slicing() label, or multiply per-slice FLOPs/write by prod(size_dict[ix] for ix in sliced.slicing()).
  • OMECO SlicedEinsum.num_slices() is the number of sliced labels, not total slice tasks.
  • A result where sliced.slicing() is empty but width improves means OMECO slicer reoptimized the tree enough to meet the target without actual slicing.

OMECO Workflow

Use OMECO as the default first pass for large/deep tensor networks because it often finds strong seed trees much faster than cotengra.

Recommended seed search grid:

seed_configs = ["8x48", "12x64", "24x64"]
score = omeco.ScoreFunction(
    tc_weight=1.0,
    sc_weight=0.0,
    rw_weight=64.0,
    sc_target=64.0,
)

Parse AxB as ntrials=A, niters=B, and use len(betas)=B, for example:

betas = [float(1.0 / x) for x in np.geomspace(2.0, 0.05, niters)]
tree = omeco.optimize_code(
    inputs,
    output,
    sizes,
    omeco.TreeSA(ntrials=ntrials, niters=niters, betas=betas, score=score),
)

Read the full file on GitHub · 179 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. 2mo ago First seen · 179 lines · 51 tokens per session scan A e5194bbe578b

Subscribe to this mod's changes

contraction-tuner is a skill published in the GitHub repository tensorcircuit/tensorcircuit-ng (93 stars, last pushed today), licensed Apache-2.0. It adds 51 tokens to every session and 2,429 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-30.

Related

Other skills, from other repositories

fine-tuning-serving-openpi

Fine-tune and serve Physical Intelligence OpenPI models (pi0, pi0-fast, pi0.5) using JAX or PyTorch backends for robot policy inference across ALOHA, DROID, and LIBERO environments. Use when adapting pi0 models to custom datasets, converting JAX checkpoints to PyTorch, running policy inference servers, or debugging…

Orchestra-Research/AI-Research-SKILLs · 87 tokens

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…

NVIDIA/physicsnemo · 124 tokens

evaluate-cluster

Evaluates an ML GPU cluster for a cloud trial or acceptance test: environment dump, isolated newest PyTorch, matmul FLOPS (MAMF/MSMF) on every GPU while the others compute, intra-node all-reduce bandwidth and per-call latency of every collective, the same inter-node on every node you were given (omit those sections if…

stas00/ml-engineering · 144 tokens

cellxgene-census-query

Query CZ CELLxGENE Census (61M+ cells). Filter by cell type/tissue/disease, retrieve expression data, and integrate with scanpy/PyTorch for population-scale single-cell analysis. Use this skill when: (1) Querying single-cell expression data by cell type, tissue, or disease, (2) Exploring available single-cell datasets…

PharMolix/OpenBioMed · 105 tokens

hugging-face-trackio

Track and visualize ML training experiments with Trackio. Use when logging metrics during training (Python API) or retrieving/analyzing logged metrics (CLI). Supports real-time dashboard visualization, HF Space syncing, and JSON output for automation.

patchy631/ai-engineering-hub · 52 tokens

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…

NVIDIA/physicsnemo · 152 tokens