Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ALWAYS activate when user types /autoresearch, $autoresearch plan, $autoresearch debug, $autoresearch fix, $autoresearch security, $autoresearch ship, $autoresearch scenario, $autoresearch predict, $autoresearch learn, $autoresearch reason, or $autoresearch probe. MUST also activate when user mentions "autoresearch" with ANY goal, metric, or task, even when the invocation is embedded in prose. This is a BLOCKING skill invocation — invoke BEFORE generating any other response.
.claude/skills/majiayu000-autoresearch/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-13 | ✗→✓ | ▲ Improved | 65% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 26% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 271% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 755% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 65% | 0% |
<critical>
git reset --hard HEAD~1.lab/ contents during hypothesis implementationatexit handler restores git stateclaude -p with ANTHROPIC_API_KEY stripped)</critical>
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).
Runbooks — mechanical process with clear steps, not cognitive reasoning.
/autoresearch init # scaffold .lab/ in your repo
/autoresearch run # start the loop (default: 50 iterations)
/autoresearch status # check progress
/autoresearch resume # recover interrupted runParse $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 |
/autoresearch init).git/ exists in current directorybash python3 ~/.claude/skills/autoresearch/scripts/detect_stack.py
bash python3 ~/.claude/skills/autoresearch/scripts/scaffold.py --repo-root . --yes
.lab/config.json — adjust keep_threshold, max_iterations, gate_weights if needed.lab/program.md — this is the most important file. Add:bash python3 .lab/eval.py
If .lab/ already exists, ask the user: resume existing lab, or archive to .lab.bak.<timestamp>/ and start fresh?
/autoresearch eval-gen)Regenerate eval gates without re-scaffolding everything:
bashpython3 ~/.claude/skills/autoresearch/scripts/eval_gen.py --repo-root . --output .lab/eval.py
Review the generated gates. The user may want to:
.lab/config.jsonGates 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 |
/autoresearch run)bashpython3 .lab/runner.py --max-iterations 50
Or for a dry run (prints hypothesis, creates no files):
bashpython3 .lab/runner.py --dry-run --max-iterations 1
Monitor progress in a separate terminal:
bashtail -f .lab/results.tsv
The runner:
.lab/config.jsonautoresearch/{date} branchclaude -p -> implement via claude -p -> git commit -> eval -> keep/discard.lab/results.tsv with 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 |
references/convergence-signals.md).lab/eval-report.md with cumulative progress/autoresearch status)bashpython3 ~/.claude/skills/autoresearch/scripts/report.py --repo-root .
Shows: composite (live), experiment timeline, keeps/discards/crashes, active convergence signals, branch genealogy, dead-ends.
/autoresearch resume).lab/ existsconfig.json, results.tsv, tail of log.md.lab.bak.<timestamp>/).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.
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 only| 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.
ANTHROPIC_API_KEY in environment: The runner strips it so claude -p uses subscription auth (not pay-per-use API). If you want API auth, set use_api_key: true in config.json.crashed_gates and excluded from composite.<critical>
After every autoresearch run:
tail -f .lab/results.tsv — review keeps/discards.lab/eval-report.md for cumulative progress and ceiling detection.lab/program.md dead ends with falsified approachespython3 .lab/eval.py to confirm final composite.lab/eval_base.py or .lab/runner.py during a run.lab/ to git (it's gitignored for a reason)</critical>
Other measured skills in the registry, with their headline benchmark lift.