karpathy

karpathy is a skill for Claude Code 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 Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: names the AskUserQuestion tool; mentions Claude Code.

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

Good fit It helps optimize editable training code against one metric by proposing changes, running training, keeping improvements, and reverting unsuccessful changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gaasher/agent-loop-skills/karpathy
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 gaasher/Agent-Loop-Skills --skill karpathy
Clone the repo
git clone --depth 1 https://github.com/gaasher/Agent-Loop-Skills

Made for: Claude Code.

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

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. 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 89
    Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.
    Fix: Set explicit rate limits, timeouts, and resource quotas for API calls, file operations, and compute. Implement circuit breakers for runaway loops.
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.00132 $0.02611
Opus 5.5 $0.00053 $0.01044
Sonnet 5.5 $0.00026 $0.00522
Haiku 4.5 $0.00013 $0.00261

Measured 3mo ago against content hash 3a0fad621df1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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 run — branches: 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. 3mo 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 (186 stars, last pushed 5mo ago), licensed MIT. It adds 132 tokens to every session and 2,611 once invoked, about $0.0005 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

karpathy compared with skills from other repositories

karpathy next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
karpathygaasher/Agent-Loop-SkillsSkill1865mo agoMITA132Claude Code
cerna-analysisaipoch/medical-research-skillsSkill2.1k15d agoMITA68Claude Code, Codex
cibersort-immune-infiltration-analysisaipoch/medical-research-skillsSkill2.1k15d agoMITA92Claude Code, Codex
gene-protein-expression-matrix-normalizationaipoch/medical-research-skillsSkill2.1k15d agoMITA63Claude Code, Codex
template-autoresearch-projectdocxology/templateSkill25yesterdayApache-2.0A30Claude Code, Codex
automodelUnlayer-AI/automodelSkill128d agoApache-2.0A68Claude Code, Codex
autoresearch-mlproyecto26/autoresearch-ai-pluginSkill124mo agoMITA212Claude Code