autoresearch
Skill41 starsChanged 7 months agoMITView on GitHub
Scaffold and run Karpathy-style autoresearch loops in any git repo. This skill should be used when setting up autonomous code improvement, generating adversarial eval harnesses, running hypothesis-implement-eval-keep/discard loops, or checking autoresearch progress. Triggers on "autoresearch", "autonomous improvement", "eval loop", "hypothesis loop", "self-improvement loop".
- Reads credentials
- Deletes or force-pushes
We split this skill into the rules it gives an agent
23 rules. 0 are common, 11 are distinctive, and 12 are very specific to this project.
0
Common
Most of the 89 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Never modify .lab/ contents during hypothesis implementation
- Distinctive: line 25
Never skip eval — every commit must be evaluated before keep/discard
- Very specific: line 26
Always revert on crash — atexit handler restores git state
- Very specific: line 65
Verify .git/ exists in current directory
- Distinctive: line 71
Run the scaffold script:
- Distinctive: line 80
Run baseline eval to verify gates work:
- Distinctive: line 97
Add custom gates for domain-specific behavior
- Distinctive: line 99
Add behavioral gates that test specific CLI invocations or API endpoints
- Very specific: line 156
Check if .lab/ exists
- Very specific: line 157
If yes: read config.json, results.tsv, tail of log.md
- Very specific: line 159
Ask: resume (continue from last experiment) or fresh (archive .lab.bak.<timestamp>/)
- Distinctive: line 160
If resume: check for stale lock file, clean up if needed, then run
- Very specific: line 207
All scripts run with python3 (no special dependencies).
- Distinctive: line 212
Gate stochasticity: If gates produce different scores on the same code, the runner will thrash between keep/discard.
- Distinctive: line 213
Large dt on resume: If the machine suspends during a run, the runner handles it gracefully via atexit + lock file cleanup.
- Distinctive: line 220
After every autoresearch run:
- Very specific: line 223
Read .lab/eval-report.md for cumulative progress and ceiling detection
- Very specific: line 225
Update .lab/program.md dead ends with falsified approaches
- Very specific: line 226
Run python3 .lab/eval.py to confirm final composite
- Very specific: line 230
Never modify .lab/eval_base.py or .lab/runner.py during a run
- Distinctive: line 231
Never run two runners concurrently (lock file prevents this, but don't bypass)
- Very specific: line 232
Never commit .lab/ to git (it's gitignored for a reason)
- Distinctive: line 233
Never trust a composite that includes crashed gates
“Common” is measured: kept by at least 6 in 10 of the 89 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.
Files
<critical>Five Invariants (never violate)
- Single mutable surface — one hypothesis per iteration, one change per experiment
- Fixed eval budget — eval runs in bounded time, no network calls in gates
- One scalar metric — composite score drives keep/discard, not vibes
- Binary keep/discard — improved = keep, else revert
git reset --hard HEAD~1 - Git-as-memory — every experiment is a commit, discards are reverts, history is the log
Safety rules
- Never modify
.lab/contents during hypothesis implementation - Never skip eval — every commit must be evaluated before keep/discard
- Always revert on crash —
atexithandler restores git state - Runner uses subscription auth (
claude -pwith ANTHROPIC_API_KEY stripped)
</critical>Autoresearch
Scaffold and run autonomous code improvement loops in any git repo. The pattern: generate a hypothesis via claude -p, implement it, run programmatic eval gates, keep if the composite score improves, discard if it doesn't. Proven across 50+ iterations on two codebases (shadow-engine: 0.69 to 1.0, perplexity-clone: search quality optimization).
Category
Runbooks — mechanical process with clear steps, not cognitive reasoning.
Quick Start
/autoresearch init # scaffold .lab/ in your repo
/autoresearch run # start the loop (default: 50 iterations)
/autoresearch status # check progress
/autoresearch resume # recover interrupted runCommand Dispatch
Parse $ARGUMENTS and route:
| Argument | Action |
init | Run scaffold workflow (see Init below) |
eval-gen | Regenerate eval gates from repo analysis |
run [--max-iterations N] [--dry-run] | Launch the autoresearch loop |
status | Show composite, timeline, convergence signals |
resume | Detect .lab/, present state, ask resume or fresh |
| (empty) | Show help text with available commands |
Init Workflow (/autoresearch init)
- Verify
.git/exists in current directory - Run stack detection:
python3 ~/.claude/skills/autoresearch/scripts/detect_stack.py - Review the detected stack info (language, build_cmd, test_cmd, lint_cmd)
- Run the scaffold script:
python3 ~/.claude/skills/autoresearch/scripts/scaffold.py --repo-root . --yes - Review
.lab/config.json— adjustkeep_threshold,max_iterations,gate_weightsif needed - Edit
.lab/program.md— this is the most important file. Add:- Specific areas to improve (not vague goals)
- Concrete hypothesis list (ranked)
- Constraints the agent must respect
- Run baseline eval to verify gates work:
python3 .lab/eval.py - Report the initial composite to the user
If .lab/ already exists, ask the user: resume existing lab, or archive to .lab.bak.<timestamp>/ and start fresh?
Eval-Gen Workflow (/autoresearch eval-gen)
Regenerate eval gates without re-scaffolding everything:
python3 ~/.claude/skills/autoresearch/scripts/eval_gen.py --repo-root . --output .lab/eval.pyReview the generated gates. The user may want to:
- Add custom gates for domain-specific behavior
- Adjust tier weights in
.lab/config.json - Add behavioral gates that test specific CLI invocations or API endpoints
Gates follow a 4-tier architecture:
| Tier | Weight | What it measures | Anti-cheat |
| T1: Build+Test | 0.20 | Compiles, tests pass, lint clean | Runs real commands, sums pass counts |
| T2: Behavioral | 0.40 | Integration tests, CLI output, API responses | Validates content, not file existence |
| T3: Pipeline | 0.25 | Build artifacts, installs, real I/O | File size >1KB, header validation |
| T4: Documentation | 0.15 | Test count floor, doc coverage | Counts code, never trusts comments |
Run Workflow (/autoresearch run)
python3 .lab/runner.py --max-iterations 50Or for a dry run (prints hypothesis, creates no files):
python3 .lab/runner.py --dry-run --max-iterations 1Monitor progress in a separate terminal:
tail -f .lab/results.tsvThe runner:
- Loads config from
.lab/config.json - Reads program.md for constraints and hypothesis direction
- Creates an
autoresearch/{date}branch - Loops: hypothesis via
claude -p-> implement viaclaude -p-> git commit -> eval -> keep/discard - Logs every experiment to
.lab/results.tsvwith extended statuses:
| Status | Meaning |
KEEP | Composite improved >= keep_threshold |
KEEP* | Primary improved but secondary metric regressed |
DISCARD | No improvement, reverted |
INTERESTING | Negative result that reveals structure, logged to dead-ends |
CRASH | Eval infrastructure failure, reverted |
TIMEOUT | Experiment exceeded timeout, logged as crash |
- Checks 9 convergence signals after each experiment (see
references/convergence-signals.md) - Re-validates baseline every 10 real experiments
- Auto-generates
.lab/eval-report.mdwith cumulative progress
Status Workflow (/autoresearch status)
python3 ~/.claude/skills/autoresearch/scripts/report.py --repo-root .Shows: composite (live), experiment timeline, keeps/discards/crashes, active convergence signals, branch genealogy, dead-ends.
Resume Workflow (/autoresearch resume)
- Check if
.lab/exists - If yes: read
config.json,results.tsv, tail oflog.md - Present summary: objective, metrics, experiment count, current best vs baseline, last status
- Ask: resume (continue from last experiment) or fresh (archive
.lab.bak.<timestamp>/) - If resume: check for stale lock file, clean up if needed, then run
.lab/ Directory Layout
.lab/ # gitignored — experiment knowledge store
config.json # All parameters (repo_name, build_cmd, keep_threshold, etc.)
runner.py # Customized runner (from runner_template.py)
eval.py # Generated + user-extended eval gates
eval_base.py # Base framework (gate registration, composite scoring)
program.md # Human-maintained constraints + priorities
results.tsv # Experiment log (experiment_id, branch, parent, commit,
# composite, status, duration_s, description)
log.md # Narrative per-experiment entries
branches.md # Branch registry
dead-ends.md # Falsified approaches + why they failed
parking-lot.md # Deferred ideas for later
eval-report.md # Auto-generated cumulative report
runner-*.log # Runner stdout/stderr logs
.runner.lock # PID lock file (prevents concurrent runs)Why .lab/ not autoresearch/: Code state (git) and experiment knowledge (.lab/) are fully decoupled. git reset --hard HEAD~1 (the core discard mechanic) never touches .lab/. Results survive branch operations.
Three-Tier Output Protocol
Eval gates emit structured diagnostics to stderr:
GATE build=PASS # Binary — blocks iteration on FAIL
METRIC test_count=475 # Continuous — tracked in results.tsv
TRACE gate_duration_ms=3200 # Execution data — for debugging onlyScripts Reference
| Script | Purpose | Run from |
scripts/detect_stack.py | Detect language, build system, test runner | Skill dir |
scripts/scaffold.py | Create .lab/ with all files | Skill dir |
scripts/eval_gen.py | Generate adversarial eval gates | Skill dir |
scripts/report.py | Render status report | Skill dir |
scripts/runner_template.py | Template copied to .lab/runner.py | Skill dir |
assets/eval_base.py | Base eval framework copied to .lab/ | Skill dir |
assets/config.json.tmpl | Config template with documented fields | Skill dir |
assets/program.md.tmpl | Program.md template | Skill dir |
All scripts run with python3 (no special dependencies). Use uv run if preferred.
Gotchas
ANTHROPIC_API_KEYin environment: The runner strips it soclaude -puses subscription auth (not pay-per-use API). If you want API auth, setuse_api_key: truein config.json.- Gate stochasticity: If gates produce different scores on the same code, the runner will thrash between keep/discard. All gates must be deterministic.
- Large dt on resume: If the machine suspends during a run, the runner handles it gracefully via atexit + lock file cleanup.
- Eval crashes vs gate crashes: An eval crash (eval.py itself fails) aborts the iteration. A gate crash (one gate throws) is logged in
crashed_gatesand excluded from composite.
<critical>Post-Run Checklist
After every autoresearch run:
tail -f .lab/results.tsv— review keeps/discards- Read
.lab/eval-report.mdfor cumulative progress and ceiling detection - Merge the autoresearch branch to main if satisfied
- Update
.lab/program.mddead ends with falsified approaches - Run
python3 .lab/eval.pyto confirm final composite
Never
- Never modify
.lab/eval_base.pyor.lab/runner.pyduring a run - Never run two runners concurrently (lock file prevents this, but don't bypass)
- Never commit
.lab/to git (it's gitignored for a reason) - Never trust a composite that includes crashed gates
</critical>Other versions93 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 93
- github/awesome-copilot★ 41ksame name
- Yeachan-Heo/oh-my-claudecode★ 40ksame name
- Yeachan-Heo/oh-my-claude-sisyphus★ 40ksame name
- Yeachan-Heo/oh-my-codex★ 34ksame name
- AgriciDaniel/claude-obsidian★ 16ksame name
- Orchestra-Research/AI-research-SKILLs★ 13ksame name
- zechenzhangAGI/AI-research-SKILLs★ 13ksame name
- Orchestra-Research/AI-Research-SKILLs★ 12ksame name
- getcompanion-ai/feynman★ 10ksame name
- advaitpaliwal/feynman★ 10ksame name
83 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects 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.
aaronjmarsSkillaeon-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
aaronjmarsSkillauto-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
In this repository99 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agents-md-managerSkill
- architecture-md-builderSkill
- claude-agent-sdkSkill
- claude-md-managerSkill
- claude-usageSkill
- dag-typesafeSkill
- fableSkill
- glossarySkill
- openrouter-usageSkill
- react-best-practicesSkill
- skill-optimizerSkill
- stop-slopSkill
- tamarruSkill
- test-harness-auditorSkill
- user-model-builderSkill
- atmosphere-shaderSkill
- component-gallerySkill
- conductor-motionSkill
- design-auditSkill
- design-critiqueSkill
- design-mdSkill
- design-polishSkill
- gemini-claude-resonanceSkill
- gemini-forgeSkill
- gpt-atelierSkill
- grainientSkill
- image-forgeSkill
- image-wellSkill
- meshySkill
- mindnode-uiSkill
- minoan-frontend-designSkill
- nano-banana-proSkill
- overwatch-slidedeckSkill
- paper-designSkill
- particle-swarm-simSkill
- pellicolaSkill
- photo-to-slack-emojiSkill
- pretextSkill
- recordlySkill
- rocaille-shaderSkill
- scroll-cinemaSkill
- shadcnSkill
- shapeSkill
- smolvlmSkill
- speak-responseSkill
- sprite-forgeSkill
- threejs-particle-canvasSkill
- vellum-editorialSkill
- webgpu-threejs-tslSkill
- agent-browserSkill
- beautiful-mermaidSkill
- classical-887Skill
- claude-peersSkill
- cloudflareSkill
- codex-ctoSkill
- codex-orchestratorSkill
- disc-forgeSkill
- figma-mcpSkill
- linkedin-exportSkill
- The first 60 shown.
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
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.

