Autoresearch AI Plugin
Autonomous Experiment Loops for Claude Code — Let AI optimize while you sleep
Edit code → commit → run benchmark → measure metric → keep improvement or revert → repeat forever.
Works for any optimization target: LLM training loss, test speed, bundle size, build time, Lighthouse scores, and more.
Inspired by Karpathy's autoresearch, pi-autoresearch, and litesearch.
Skills
This plugin provides two skills that work together. Autoresearch is the core engine (works for any metric), and Autoresearch ML extends it with GPU-specific templates for LLM training.
1. Autoresearch (The Optimizer)
Domain-agnostic autonomous experiment loop.
- Edit → Measure → Keep/Discard: Autonomous cycle that edits code, runs benchmarks, and keeps only improvements.
- Context-Resilient: State persists in
autoresearch.jsonl — survives context resets and session restarts.
- Confidence Scoring: MAD-based statistical analysis separates real improvements from measurement noise.
- ASI (Actionable Side Information): Structured annotations per experiment that survive git reverts — the only memory of discarded experiments.
- Secondary Metrics: Track tradeoff metrics (memory, compile time) alongside the primary optimization target.
- Segments: Multi-phase sessions — switch optimization targets mid-session without losing history.
- Cancel & Status: Check progress or stop the loop at any time while preserving experiment history.
- Deterministic stopping rules (v0.3.1): every loop-termination condition is recomputed from
autoresearch.jsonl (current segment) so it survives context resets — a segment-scoped consecutive-failure wall (>8), honored max_iterations, a 200-run backstop for unbounded runs, and a session-lifecycle status marker so a cancelled/finished session is never silently resumed.
- Any Metric: Test speed, bundle size, build time, Lighthouse scores, memory usage — if you can measure it, you can optimize it.
2. Autoresearch ML (The Researcher)
Specialized for LLM training with NVIDIA GPUs. Extends the core Autoresearch skill.
- Ready-to-Use Template: Complete LLM pretraining setup based on Karpathy's autoresearch (GPT + Flash Attention + MuonAdamW).
- Consumer to Datacenter GPUs: Supports NVIDIA GPUs from 4GB (GTX 1080 Ti) to 80GB (H100) with automatic VRAM scaling guidance.
- Fixed Time Budget: Every experiment runs for exactly 5 minutes — all results are directly comparable.
- Bits Per Byte: Vocab-size-independent metric (
val_bpb) enables fair comparison across architectures.
3. /run-autoresearch Command + Orchestrator Agent
Managed execution — batches, checkpoints, lossless resume.
/run-autoresearch [goal] — one command to run a session end-to-end: it gathers goal/benchmark/metric (asking only for what it can't infer), then dispatches the Autoresearch Orchestrator sub-agent, which executes experiments in batches (default 10) following the skill protocol and returns a structured checkpoint after each batch.
/run-autoresearch status / /run-autoresearch cancel — inspect or wind down the current session directly, without launching the agent.
- Checkpoint loop:
CONTINUE → the next batch is dispatched automatically; DONE/WALL → final summary with baseline → best and the top untried ASI hints; BLOCKED → the blocker is surfaced. Because state lives in autoresearch.jsonl + autoresearch.md, every dispatch resumes losslessly — including after context resets or days later.
- Requires the plugin install (Option 1 below). Skills-only installs (
npx skills, clone-and-copy) get the two skills but not the command/agent.
Quick Start
Prerequisites
- Git — experiments use git commit/revert for state management
- For ML skill: NVIDIA GPU with 8GB+ VRAM, CUDA 12.0+, Python 3.10+, uv
Installation
Option 1: Claude Code Plugin (Recommended — full experience)
Install via Claude Code's built-in plugin system. This is the only option that installs everything: both skills, the /run-autoresearch command, the Autoresearch Orchestrator agent, and the file-protection hooks.
# Add the marketplace
/plugin marketplace add proyecto26/autoresearch-ai-plugin
# Install the plugin
/plugin install autoresearch-ai-plugin
Option 2: CLI Install (skills only)
Use npx skills to install the skills directly:
# Install all skills
npx skills add proyecto26/autoresearch-ai-plugin
# Install specific skills
npx skills add proyecto26/autoresearch-ai-plugin --skill autoresearch autoresearch-ml