agentleFS
RoentekRoentek/Claude_Code_Boilerplate_Framework/.claude/skills/autoresearch/SKILL.md

autoresearch

Skill4 starsChanged 6 months agoMITView on GitHub

Autonomous ML research - agent modifies GPT training code, runs 5-min experiments, keeps improvements

  • Deletes or force-pushes

100 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use aeon-update, auto-workflow and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • aaronjmarsSkill

    aeon-update

    Pull framework updates from the upstream Aeon repo into this instance - 3-way merges canon's new commits into a PR, never clobbering operator config.

    Also in 4 projects that use this

  • aaronjmarsSkill

    auto-workflow

    Two-mode aeon.yml workflow builder - analyze inspects URLs and emits a tiered, signal-verified skill-enablement plan plus an aeon.yml diff; enable flips slugs to enabled:true and opens a PR.

    Also in 4 projects that use this

  • +10 more from aaronjmars

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 10 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 96 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When user says to start autoresearch, verify setup first:

    line 26
  2. Distinctive:

    Before starting the autonomous loop, work with the user to:

    line 44
  3. Distinctive:

    Confirm with user: before starting the autonomous loop

    line 74
  4. Distinctive:

    Review state: Check current branch/commit

    line 82
  5. Very specific:

    If grep output is empty → run crashed → read tail -n 50 run.log for stack trace

    line 99
  6. Distinctive:

    If trivial fix (typo, missing import) → fix and re-run

    line 100
  7. Distinctive:

    If fundamental issue → skip, log as "crash", move on

    line 101
  8. Very specific:

    If val_bpb improved (lower) → keep commit, advance branch

    line 112
  9. Very specific:

    If val_bpb equal or worse → discard via git reset --hard HEAD~1

    line 113
  10. Distinctive:

    If run exceeds 10 minutes, kill it and treat as failure (discard)

    line 118
  11. Distinctive:

    All else being equal, simpler is better:

    line 121
  12. Distinctive:

    Don't blow it up dramatically

    line 145
  13. Distinctive:

    If OOM crash → log as "crash" and try something smaller

    line 146
  14. Very specific:

    Read prepare.py, train.py, program.md, README.md

    line 237
  15. Very specific:

    Check if data exists: ls ~/.cache/autoresearch/

    line 238
  16. Very specific:

    Always log: every experiment to results.tsv

    line 250

“Common” is measured: kept by at least 6 in 10 of the 96 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

AutoResearch - Autonomous ML Research Agent

Use when: User wants to run autonomous machine learning experiments, optimize neural network training, or conduct overnight research runs.

Source: karpathy/autoresearch (33K+ stars)

What This Does

AutoResearch enables autonomous AI-driven machine learning research. You (the agent) modify GPT training code, run 5-minute experiments on a GPU, evaluate improvements, and iterate without human intervention. The human can leave you running overnight for ~100 experiments while they sleep.

Core Concept

  • You modify: train.py (model architecture, optimizer, hyperparameters, training loop)
  • You don't touch: prepare.py (data prep, tokenizer, evaluation — read-only)
  • You edit for human: program.md (your instructions — human can update to guide research direction)
  • Metric: val_bpb (validation bits per byte) — lower is better
  • Fixed time budget: 5 minutes per experiment (wall clock, excluding startup)

Quick Start (First Time)

When user says to start autoresearch, verify setup first:

# 1. Navigate to autoresearch directory
cd tools/autoresearch

# 2. Check if data exists
ls ~/.cache/autoresearch/

# If missing, run data prep (one-time, ~2 min):
uv run prepare.py

# 3. Test baseline run (~5 min)
uv run train.py

Experiment Setup

Before starting the autonomous loop, work with the user to:

  1. Agree on a run tag based on today's date (e.g., may3, may3-gpu0)
    • Branch name: autoresearch/<tag>
    • Branch must NOT already exist (this is a fresh run)
  2. Create the branch:
    git checkout -b autoresearch/<tag>
  3. Read in-scope files for full context:
    • README.md (repo overview)
    • prepare.py (fixed constants, evaluation harness)
    • train.py (what you'll modify)
    • program.md (your instructions)
  4. Initialize results log:
    echo -e "commit\tval_bpb\tmemory_gb\tstatus\tdescription" > results.tsv
  5. Run baseline (unchanged train.py):
    uv run train.py > run.log 2>&1
    grep "^val_bpb:\|^peak_vram_mb:" run.log
  6. Log baseline to results.tsv
  7. Confirm with user before starting the autonomous loop

The Autonomous Loop

CRITICAL: Once the loop starts, NEVER STOP unless the user manually interrupts you. Do NOT ask "should I continue?" — the user might be asleep. You run indefinitely.

Loop Steps (Repeat Forever)

  1. Review state: Check current branch/commit
  2. Ideate: Pick an experimental idea (architecture change, optimizer tweak, hyperparameter adjustment, etc.)
  3. Modify: Edit train.py
  4. Commit:
    git add train.py
    git commit -m "experiment: [short description]"
  5. Run experiment:
    uv run train.py > run.log 2>&1
  6. Extract results:
    grep "^val_bpb:\|^peak_vram_mb:" run.log
  7. Check status:
    • If grep output is empty → run crashed → read tail -n 50 run.log for stack trace
    • If trivial fix (typo, missing import) → fix and re-run
    • If fundamental issue → skip, log as "crash", move on
  8. Log to results.tsv:
    [commit_hash]	[val_bpb]	[memory_gb]	[status]	[description]
    • commit: 7-char short hash
    • val_bpb: 6 decimal places (e.g., 0.997900), or 0.000000 for crashes
    • memory_gb: peak VRAM in GB, rounded to .1f (divide peak_vram_mb by 1024), or 0.0 for crashes
    • status: keep, discard, or crash
    • description: short text (NO COMMAS — tab-separated format)
  9. Decide:
    • If val_bpb improved (lower) → keep commit, advance branch
    • If val_bpb equal or worse → discard via git reset --hard HEAD~1
  10. Repeat from step 1

Timeout Handling

  • Each run should take ~5 minutes + overhead (~6-7 min total)
  • If run exceeds 10 minutes, kill it and treat as failure (discard)

Simplicity Criterion

All else being equal, simpler is better:

  • A 0.001 val_bpb improvement that adds 20 lines of hacky code? Probably not worth it.
  • A 0.001 val_bpb improvement from deleting code? Definitely keep.
  • Improvement of ~0 but much simpler code? Keep (simplification win).

What You CAN Modify

In train.py, everything is fair game:

  • Model architecture (depth, width, attention patterns)
  • Optimizer (Muon, AdamW, learning rate, warmup, decay)
  • Hyperparameters (batch size, gradient accumulation)
  • Training loop (mixed precision, gradient clipping, etc.)

What You CANNOT Do

  • Modify prepare.py (it's read-only)
  • Install new packages or change dependencies
  • Modify the evaluation harness (evaluate_bpb function)
  • Change the 5-minute time budget

VRAM Constraint

VRAM is a soft constraint:

  • Some increase is acceptable for meaningful val_bpb gains
  • Don't blow it up dramatically
  • If OOM crash → log as "crash" and try something smaller

Expected Throughput

  • ~12 experiments per hour (~5 min each)
  • ~100 experiments over 8 hours of sleep
  • User wakes up to a full log of results and (hopefully) a better model

Results Format

Example output from a run:

---
val_bpb:          0.997900
training_seconds: 300.1
total_seconds:    325.9
peak_vram_mb:     45060.2
mfu_percent:      39.80
total_tokens_M:   499.6
num_steps:        953
num_params_M:     50.3
depth:            8

Example results.tsv:

commit	val_bpb	memory_gb	status	description
a1b2c3d	0.997900	44.0	keep	baseline
b2c3d4e	0.993200	44.2	keep	increase LR to 0.04
c3d4e5f	1.005000	44.0	discard	switch to GeLU activation
d4e5f6g	0.000000	0.0	crash	double model width (OOM)

Platform Support

Default: Single NVIDIA GPU (tested on H100)

Other platforms: See community forks in tools/autoresearch/README.md:

  • MacOS: miolini/autoresearch-macos, trevin-creator/autoresearch-mlx
  • Windows: jsegov/autoresearch-win-rtx
  • AMD: andyluo7/autoresearch

Smaller compute tuning: See tools/autoresearch/README.md for hyperparameter recommendations (TinyStories dataset, lower vocab_size, MAX_SEQ_LEN, DEPTH, etc.)

Key Commands

# Navigate to autoresearch
cd tools/autoresearch

# Install dependencies (first time)
uv sync

# Data prep (one-time)
uv run prepare.py

# Run single experiment
uv run train.py

# Run with log capture
uv run train.py > run.log 2>&1

# Extract results
grep "^val_bpb:\|^peak_vram_mb:" run.log

# Read error trace
tail -n 50 run.log

# Check git state
git log --oneline -n 10

# Discard failed experiment
git reset --hard HEAD~1

Integration Notes

  • Location: tools/autoresearch/ directory
  • Setup: Auto-installed via setup.sh step 13
  • Permissions: Bash(uv *) and PowerShell(uv *) in settings.json
  • Files tracked: prepare.py, train.py, program.md, pyproject.toml, uv.lock
  • Files git-ignored: results.tsv, data cache (~/.cache/autoresearch/)

Usage Example

User: "Run autoresearch overnight on the baseline GPT model"

You:

  1. cd tools/autoresearch
  2. "Let's set up a new run. I propose the tag may3. Creating branch autoresearch/may3..."
  3. git checkout -b autoresearch/may3
  4. Read prepare.py, train.py, program.md, README.md
  5. Check if data exists: ls ~/.cache/autoresearch/
  6. If missing: uv run prepare.py
  7. Initialize results.tsv with header
  8. Run baseline: uv run train.py > run.log 2>&1
  9. Extract results and log to results.tsv
  10. "Baseline is logged. Starting autonomous research loop. I'll run experiments until you stop me."
  11. LOOP FOREVER: ideate → modify → commit → run → evaluate → keep/discard → repeat

Remember

  • Never stop unless manually interrupted
  • Never ask "should I continue?" mid-loop
  • Always log every experiment to results.tsv
  • Simplicity matters — don't add complexity for tiny gains
  • VRAM is soft — some increase OK, but don't blow it up
  • Fixed 5-min budget — experiments are always comparable
  • Lower val_bpb = better — that's the only metric that matters

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.