karpathy

karpathy is a skill for Claude Code, Codex from gaasher/Agent-Loop-Skills. It costs 132 tokens per session (2,611 once invoked), scanned A, original, MIT.

An autonomous machine-learning experiment loop that changes training code, runs it, and keeps changes that improve one numerical score. The score is a single measurement used to compare experiments.

In plain words
What is it for?
It helps optimize editable training code against one metric by proposing changes, running training, keeping improvements, and reverting unsuccessful changes.
Why use it?
It automates repeated trial and error for a training script, so improvements can be tested and retained without manual decisions after every run.

Skill for Claude CodeCodex

Part of the Agent-Loop-Skills plugin — 25 skills shipped together

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.

agentmods
npx agentmods add skills/gaasher/agent-loop-skills/karpathy
Any agent
npx skills add gaasher/Agent-Loop-Skills --skill karpathy
Clone the repo
git clone --depth 1 https://github.com/gaasher/Agent-Loop-Skills

Made for: Claude Code, Codex.

Or install Agent-Loop-Skills, the plugin that ships this one along with the rest of its 25 skills.

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 karpathy

README.md
[![agentmods](https://agentmods.dev/badge/skills/gaasher/agent-loop-skills/karpathy.svg)](https://agentmods.dev/skills/gaasher/agent-loop-skills/karpathy)
Your own site
<a href="https://agentmods.dev/skills/gaasher/agent-loop-skills/karpathy"><img src="https://agentmods.dev/badge/skills/gaasher/agent-loop-skills/karpathy.svg" alt="Measured on agentmods" height="20"></a>
Per session 132 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,611 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00132 $0.02611
Opus 5 $0.00066 $0.01306
Sonnet 5 $0.00026 $0.00522
Haiku 4.5 $0.00013 $0.00261

Measured 5d ago against content hash 3a0fad621df1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

karpathy 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.

loops/karpathy/SKILL.md · 149 lines

How it starts

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

Karpathy Autoresearch

This is an experiment to have the LLM do its own research. You are a completely autonomous researcher: you hack the training code with an idea, run it, keep the change if the metric improves and revert it if it doesn't, advancing a branch as you go — and you repeat forever, until the human interrupts you. The artifact is the <editable_files>; the feedback signal is one scalar <metric> (lower is better, e.g. val_bpb) read from the run. Training runs in the user's own environment via <run_cmd> — this skill installs nothing and imports nothing; it edits code, shells out, and reads the metric from the log.

When to use

Use this to leave an agent running on a single training script, optimizing one scalar metric hands-off, where any improvement is kept and the loop never stops on its own. Default to broad freedom inside <editable_files>; the only hard limit is that the run finishes within the budget without crashing. Not for the analysis-first variant that reasons about the data before each edit (that is ml-autoresearch).

Setup

Resolve bindings interactively (load loop.run.yaml and skip if it already exists; else, on Claude Code infer + recommend each via AskUserQuestion, otherwise ask as quoted prompts; write loop.run.yaml). Then work with the user to set up a fresh run:

  1. Choose <iter_strategy>branches (one git commit per run; the original) or snapshots (one folder per run under <sandbox_root>/). Snapshots are safer on a dirty or gitignored tree; branches mirror Karpathy. Either is fully supported throughout the loop.
  2. Open the runbranches: agree on a run tag from today's date (e.g. mar5) and create the branch git checkout -b autoresearch/<tag> (it must not already exist; this is a fresh run). snapshots: no branch — each iteration gets its own <sandbox_root>/iter<N>/.
  3. Read the in-scope files — the repo is small; read them for full context: the README, the read-only harness that defines the metric (the <metric> ground truth — do not modify), and the <editable_files> you will hack (model/optimizer/training loop).
  4. Verify the env/data exists — confirm <run_cmd> can run (data shards, tokenizer, deps present). If not, tell the human the one command to prepare it (e.g. uv run prepare.py).
  5. Initialize results.tsv — create it with just the header row; the baseline is recorded after the first run. Leave it untracked (never commit it).
  6. Confirm and go — confirm the setup looks right, then kick off the experimentation.

Read the full file on GitHub · 149 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. 5d ago First seen · 149 lines · 132 tokens per session scan A 3a0fad621df1

Subscribe to this mod's changes

karpathy is a skill published in the GitHub repository gaasher/Agent-Loop-Skills (163 stars, last pushed 2mo ago), licensed MIT. It adds 132 tokens to every session and 2,611 once invoked, about $0.0007 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.

Related

Other skills, from other repositories

cerna-analysis

Use when building a ceRNA regulatory network from a key gene list by combining bundled miRNA-mRNA and miRNA-lncRNA database files, with flat-file CSV exports and PDF visualization in a single output directory. NOT for: differential expression, single-cell analysis, enrichment analysis, or workflows without a key gene…

aipoch/medical-research-skills · 68 tokens

cibersort-immune-infiltration-analysis

Use when estimating relative immune cell infiltration from a bulk expression matrix with a CIBERSORT-style nu-SVR deconvolution workflow based on an LM22 signature matrix, comparing one case group against one control group, and generating structured tables plus immune-fraction plots. NOT for single-cell RNA-seq…

aipoch/medical-research-skills · 92 tokens

gene-protein-expression-matrix-normalization

Use when normalizing bulk gene or protein expression matrices with log2 transform, z-score standardization, or min-max scaling before downstream visualization or exploratory analysis. NOT for count-model normalization such as TPM/DESeq2 size factors, batch correction, or single-cell preprocessing.

aipoch/medical-research-skills · 63 tokens

start-experiment

Start the autoresearch optimization loop for a specific model + lane. Resolves the hierarchical program.md (root → model → lane), asks the user for hardware (local TPU VM or GKE cluster of a specified TPU type + topology), discovers available clusters from .env/, checks occupancy with USERPREFIX-aware attribution…

vlasenkoalexey/tpu_performance_autoresearch_wiki · 103 tokens

template-autoresearch-project

AutoResearch loop exemplar — deterministic ML candidate evaluation, evidence registries, claim ledgers, artifact manifests, readiness gates.

docxology/template · 30 tokens

autoresearch-ml

Autonomous LLM training optimization with GPU support. Runs 5-minute training experiments, measures valbpb, keeps improvements or reverts — repeat forever. Use this skill when the user asks to "train a model autonomously", "optimize LLM training", "run ML experiments", "autoresearch with GPU", "optimize valbpb"…

proyecto26/autoresearch-ai-plugin · 212 tokens