Autoresearch Agent (Autonomous Experiment Loop)
An autonomous edit-measure-keep/revert loop that optimizes any file against a measurable metric using git as the safety net.
What it does
An autonomous experiment loop inspired by Karpathy's autoresearch. The agent edits one target file, runs a fixed evaluation command, keeps improvements via git commit, discards regressions via git reset --hard, and repeats indefinitely.
- Slash commands:
/ar:setup,/ar:run,/ar:loop,/ar:status,/ar:resume - Logs every run to
results.tsv(commit, metric, keep/discard/crash, description) with TSV/CSV/Markdown dashboards - Built-in evaluators: speed (p50_ms), file/bundle size, test pass rate, build time, peak memory, plus LLM judges for headlines, copy, and prompts
- Guardrails: one change per experiment, never modify the evaluator, timeout at 2.5× budget, pause after 5 consecutive crashes, escalate strategy over time
Who it's for
- Engineers optimizing latency, bundle size, build time, or test pass rate
- Marketers and prompt engineers who can score copy or prompts numerically
- Anyone wanting an agent to run measured experiments overnight
Prerequisites: a git repo, one target file, an eval command that prints a metric to stdout, and Python.
Examples
- Cut p50 latency in
src/api/search.pyusing a pytest benchmark as the evaluator - Improve headlines in
content/titles.mdscored by an LLM judge (ctr_score0-10) - Run a nightly loop shrinking a frontend bundle measured by
size_bytes
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/alirezarezvani/claude-skills/HEAD/.gemini/skills/autoresearch-agent/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the .gemini/skills/autoresearch-agent folder from the GitHub repo alirezarezvani/claude-skills into my ~/.claude/skills/autoresearch-agent/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/alirezarezvani/claude-skills.git && mkdir -p ~/.claude/skills && cp -r claude-skills/.gemini/skills/autoresearch-agent ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and clone the repo:
git clone https://github.com/alirezarezvani/claude-skills.git - Locate the skill folder:
find claude-skills -name autoresearch-agent -type d - Create your skills directory:
mkdir -p ~/.claude/skills - Copy the whole folder:
cp -r claude-skills/.gemini/skills/autoresearch-agent ~/.claude/skills/ - Confirm the
scripts/Python helpers came along and that Python 3 is installed. - Make sure the project you want to optimize is a git repo (
git initand commit if not). - Restart Claude Code, then run
/ar:setupor simply ask "optimize this file for speed". - Before starting a long loop, run your evaluation command once manually and verify it prints
metric_name: value.