| name | autoloop |
| description | Autonomous single-metric optimization loop that edits a target file, runs experiments, commits improvements, and reverts regressions until a numeric goal is reached. |
| compatibility | Created for Zo Computer |
| metadata | {"author":"marlandoj.zo.computer","origin":"karpathy/autoresearch patterns","version":"1.0.0"} |
Autoloop — Autonomous Optimization Skill
Quick Start
cp Skills/autoloop/assets/template.program.md my-project/program.md
bun Skills/autoloop/scripts/autoloop.ts --program my-project/program.md
MCP Server
The autoloop skill exposes an MCP server for AI assistants to start, monitor, and manage optimization campaigns.
Available Tools
| Tool | Description |
|---|
autoloop_start | Start an optimization campaign with a program.md file |
autoloop_status | Check the status of a running or completed campaign |
autoloop_results | Get results.tsv data from a completed campaign |
autoloop_stop | Gracefully stop a running campaign |
autoloop_list | List recent autoloop campaigns |
Usage
Stdio transport (for Claude Desktop, Cursor):
bun /home/workspace/Skills/autoloop/scripts/mcp-server.ts
HTTP transport (for network access):
bun /home/workspace/Skills/autoloop/scripts/mcp-server-http.ts
Example: autoloop_start
{
"program": "/home/workspace/my-project/program.md",
"executor": "claude-code",
"dryRun": false
}
Example: autoloop_status
{
"program": "/home/workspace/my-project/program.md"
}
How It Works
- Reads your
program.md for configuration
- Creates a git branch
autoloop/{name}-{date}
- Runs the baseline (first experiment, no changes)
- Loops forever:
- Agent proposes a change to the target file
- Commits the change
- Runs the experiment via your run command
- Extracts the metric via your extract command
- If improved → keep commit, advance branch
- If regressed →
git reset --hard HEAD~1
- If crashed → log, attempt fix (max 3), skip if unfixable
- Stagnation detection triggers increasingly radical exploration
- Writes
results.tsv with full experiment history
Options
--program <path> Path to program.md (required)
--executor <name> Executor to use for proposals (default: claude-code)
--resume Resume from existing autoloop branch instead of creating new
--dry-run Parse program.md and show config without running
Scheduling as a Zo Agent
The autoloop can run overnight as a scheduled agent:
Create a Zo agent that runs:
bun /home/workspace/Skills/autoloop/scripts/autoloop.ts --program /home/workspace/my-project/program.md
Cost guardrails (maxExperiments, maxDurationHours, maxCostUSD) prevent runaway spending.
References
assets/template.program.md — Template for new programs
references/autoresearch-patterns.md — Design notes from karpathy/autoresearch
- Spec:
Skills/zo-swarm-orchestrator/specs/autoresearch-patterns-spec.md (Spec 3)