Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Domain-agnostic metric-driven improvement loop, generalizing Karpathy's autoresearch. Use when you want an agent to discover what to measure for a project/goal, then run a keep-or-revert experiment loop that proposes changes, measures them against an objective, keeps wins, discards regressions, and records implemented improvements. Adapts to code perf-auditing, codegen, bug-finding, ad optimization, or any artifact + measurable objective + trial. Trigger: 'autoresearch this', 'find and implement
.claude/skills/jdrhyne-autoresearch-loop/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 20% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 9% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 52% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 51% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 49% | 0% |
Generalize Karpathy's autoresearch into a domain-adaptive improvement loop. The agent discovers what to measure, then runs a disciplined propose → trial → keep-or-revert loop, maintaining an explicit ledger of what was tried, kept, discarded, and implemented.
Read DESIGN.md once at the start of a run for the full architecture and the domain-specific tensions (metric latency/noise/cost, Goodhart gaming, cost-per-trial, reversibility). The phases below are the operating procedure.
Runtime: the loop's mechanics (run a trial, parse the metric, score confidence, keep/commit or discard/revert) are handled by the arl CLI over a .auto/ session folder — a Claude-native port of pi-autoresearch's tools. Read references/runtime-contract.md for the .auto/ layout, the METRIC name=value contract, MAD confidence scoring, and the arl init|run|log|status commands. Invoke it as node scripts/arl.mjs <cmd> (or arl if on PATH).
Given {project, goal, context} — follow the procedure in references/metric-discovery.md (restate the goal as an outcome → enumerate candidates on the proxy→outcome spectrum → score on six axes → choose primary + guardrails + strategy → red-team for gaming). In brief:
adapters/*.md). If none fits, draft an inline adapter following references/domain-adapter-contract.md.deterministic-delta (fast, low-noise), significance-test, or bandit (noisy/delayed/expensive — e.g. ads).runs/<id>/CHARTER.md. Confirm it with the user before spending real budget if trials cost money or touch production.Write .auto/measure.sh (and .auto/checks.sh if guardrails require it). arl init with the primary metric + direction, run the baseline (arl run), and record it (arl log --status keep --metric <baseline> --desc baseline). If the baseline can't be measured cleanly and repeatably, stop (see "When NOT to run").
Before proposing any change, profile where the cost actually is, and confirm the benchmark stresses the IN-SCOPE artifact — not a dependency, a native/FFI call, an external engine, the network, or unrelated code. (Validated the hard way on two live runs: once the assumed hot path was wrong twice and 97% of time was in an out-of-scope library; once the in-scope managed code was only 0.4–3.8% of wall-time because a Rust NIF dominated — the correct loop output there was a true negative, "re-scope," not a sub-noise edit. See adapters/code-perf-audit.md → Pitfalls.) Spend one profiling run on the managed-vs-native/dependency split; a loop that optimizes code which isn't the bottleneck produces confident, useless churn — and proving "no in-scope headroom" cheaply is itself a successful outcome.
Each iteration:
.auto/prompt.md, the .auto/log.jsonl tail, and .auto/ideas.md — never re-propose an exhausted line..auto/ideas.md; append newly-imagined ideas there..auto/ is preserved).arl run — runs the trial harness, parses METRIC lines, runs guardrail checks.sh.fast-low-noise domains, watch the MAD confidence score (<1.0× = within noise, re-run before trusting). For delayed-expensive domains (ads), do NOT trust a single trial — reach the adapter's minimum sample and use significance/bandit logic. A primary win that regresses any guardrail is a discard.arl log --status keep|discard|... --metric <value> --desc "..." --asi <learning>. Keep auto-commits and advances the baseline; discard auto-reverts the code. Record cost with --cost.--asi with what was learned (survives a discard's revert); prune exhausted ideas.Respect concurrency reality: deterministic domains can run many fast sequential trials; noisy/delayed domains (ads) run few long concurrent trials and must reach a minimum sample before any verdict.
adapters/web-onboarding.md.At any stop, report (arl status summarizes most of it): metric baseline → current with the delta and confidence, the kept improvements (each with its delta and cost), what was tried and discarded with the --asi reasons from .auto/log.jsonl, the remaining promising ideas, and total cost. The durable record is .auto/ plus the git history of kept commits.
DESIGN.md — architecture, per-domain design tensions, and the pi-autoresearch prior-art decision (read once per run).references/metric-discovery.md — the Phase 0 procedure: deriving + scoring + red-teaming the metric.references/runtime-contract.md — the .auto/ layout, METRIC contract, MAD confidence, and arl commands.references/domain-adapter-contract.md — how to define a new domain adapter.references/journal-schema.md — the ledger record formats.adapters/*.md — concrete domain adapters (code-perf-audit, bug-finding, code-generation, google-ads, web-onboarding).| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 29,543 | 32,324 | +9% | 1 | 1 | 0% | 5,419 | 6,503 | +20% | 0 | 0 | — |
case-02 | fail→pass | 35,783 | 34,104 | -5% | 1 | 1 | 0% | 6,226 | 6,762 | +9% | 0 | 0 | — |
case-03 | fail→fail | 32,689 | 5,222 | -84% | 1 | 1 | 0% | 6,220 | 1,986 | -68% | 0 | 0 | — |
case-04 | fail→pass | 50,651 | 28,312 | -44% | 1 | 1 | 0% | 4,302 | 6,526 | +52% | 0 | 0 | — |
case-05 | pass→pass | 24,290 | 15,495 | -36% | 1 | 1 | 0% | 1,788 | 3,047 | +70% | 0 | 0 | — |
case-06 | pass→pass | 17,781 | 14,154 | -20% | 1 | 1 | 0% | 2,658 | 4,132 | +55% | 0 | 0 | — |
case-19 | fail→pass | 9,366 | 1,704 | -82% | 1 | 1 | 0% | 1,362 | 2,062 | +51% | 0 | 0 | — |
case-07 | pass→pass | 11,014 | 9,015 | -18% | 1 | 1 | 0% | 1,666 | 3,075 | +85% | 0 | 0 | — |
case-08 | pass→pass | 13,313 | 5,219 | -61% | 1 | 1 | 0% | 1,915 | 2,577 | +35% | 0 | 0 | — |
case-09 | fail→pass | 12,545 | 5,009 | -60% | 1 | 1 | 0% | 1,771 | 2,640 | +49% | 0 | 0 | — |
case-10 | fail→pass | 20,987 | 3,884 | -81% | 1 | 1 | 0% | 1,810 | 2,431 | +34% | 0 | 0 | — |
case-20 | fail→pass | 13,093 | 2,610 | -80% | 1 | 1 | 0% | 1,877 | 2,216 | +18% | 0 | 0 | — |
case-11 | fail→pass | 14,093 | 2,423 | -83% | 1 | 1 | 0% | 2,248 | 2,206 | -2% | 0 | 0 | — |
case-12 | pass→pass | 10,550 | 3,310 | -69% | 1 | 1 | 0% | 1,478 | 2,353 | +59% | 0 | 0 | — |
case-13 | pass→pass | 4,798 | 2,592 | -46% | 1 | 1 | 0% | 660 | 2,202 | +234% | 0 | 0 | — |
case-14 | fail→pass | 12,261 | 2,822 | -77% | 1 | 1 | 0% | 1,871 | 2,220 | +19% | 0 | 0 | — |
case-15 | fail→pass | 15,203 | 3,673 | -76% | 1 | 1 | 0% | 2,328 | 2,334 | +0% | 0 | 0 | — |
case-16 | pass→pass | 11,072 | 4,815 | -57% | 1 | 1 | 0% | 1,482 | 2,472 | +67% | 0 | 0 | — |
case-17 | pass→pass | 8,493 | 3,649 | -57% | 1 | 1 | 0% | 1,308 | 2,431 | +86% | 0 | 0 | — |
case-18 | fail→pass | 10,845 | 2,337 | -78% | 1 | 1 | 0% | 1,650 | 2,138 | +30% | 0 | 0 | — |
case-21 | fail→fail | 22,502 | 3,445 | -85% | 1 | 1 | 0% | 3,571 | 2,384 | -33% | 0 | 0 | — |
case-22 | fail→fail | 11,412 | 2,911 | -74% | 1 | 1 | 0% | 1,725 | 2,216 | +28% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +50 percentage points is the difference between those two pass rates over the 21 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.