Create an autoresearch session
Build a durable experiment loop that can survive context resets and restarts.
- Infer or gather the goal, benchmark command, primary metric and direction, files in scope, and correctness constraints.
- Create a branch named
autoresearch/<goal>-<date>. - Read and understand the relevant implementation before changing it.
- Read references/session-design.md.
- Create
.auto/prompt.mdand.auto/measure.sh. Add.auto/checks.shonly when correctness constraints need a separate gate. - Make scripts executable and commit the initial session files before the baseline so discard can safely restore the tree.
- Call
init_experiment, run and log the baseline, then iterate immediately.
.auto/prompt.md
Write a self-contained playbook that a fresh agent can use without conversation history. Include:
- objective;
- primary and secondary metrics;
./.auto/measure.shusage;- files in scope and off limits;
- correctness and dependency constraints;
- a “What’s Been Tried” section that is maintained during the loop.
.auto/measure.sh
Use set -euo pipefail. Run fast pre-checks, then the benchmark, and print one
or more METRIC name=value lines. The primary name must exactly match
init_experiment.metric_name. For fast noisy workloads, take multiple samples
and report the median.
Loop rules
- Always call
log_experimentafterrun_experiment. - Keep primary-metric improvements; discard regressions or equal results.
- Include useful
asion every run. On discard or crash, preserve the failed hypothesis, rollback reason, and next action because the code will disappear. - Append deferred ideas to
.auto/ideas.md. - Update
.auto/prompt.mdas durable knowledge accumulates. - Treat confidence as advisory: re-run improvements inside the noise floor.
- Prefer simpler changes and structural hypotheses over repeated parameter tweaks.
- Continue until interrupted, a configured limit is reached, or the repeated failure guard stops the loop.
- If the user sends feedback during a run, finish and log that run before incorporating the feedback.