Autonomous experiment loop for Claude Code. Port of pi-autoresearch as a pure skill -- no MCP server, just instructions the agent follows with its built-in tools.
Runs experiments, measures results, keeps winners, discards losers, loops forever.
git clone https://github.com/drivelineresearch/autoresearch-claude-code.git ~/autoresearch-claude-code cd ~/autoresearch-claude-code && ./install.shThen add the hook to ~/.claude/settings.json:
{ "hooks": { "UserPromptSubmit": [ { "hooks": [{ "type": "command", "command": "~/.claude/hooks/autoresearch-context.sh" }] } ] } }/autoresearch optimize test suite runtime /autoresearch # resume existing loop /autoresearch off # pause The agent creates a branch, writes a session doc + benchmark script, runs a baseline, then loops autonomously. Send messages mid-loop to steer the next experiment.
Included example using the Driveline OpenBiomechanics dataset -- predicting fastball velocity from biomechanical POI metrics.
22 autonomous experiments took R² from 0.44 to 0.78 (+78%), predicting a new player's fastball velocity within ~2 mph from biomechanics alone.
| Metric | Baseline | Best | Change |
|---|---|---|---|
| R² | 0.440 | 0.783 | +78% |
| RMSE | 3.53 mph | 2.20 mph | -38% |
To run it yourself:
mkdir -p third_party git clone https://github.com/drivelineresearch/openbiomechanics.git third_party/openbiomechanics python3 -m venv .venv && source .venv/bin/activate pip install xgboost scikit-learn pandas numpy matplotlib .venv/bin/python train.pySee obp-autoresearch.md for the session config and experiments/worklog.md for the full experiment narrative.
| pi-autoresearch (MCP) | This port (Skill) |
|---|---|
init_experiment tool | Agent writes config to autoresearch.jsonl |
run_experiment tool | Agent runs ./autoresearch.sh with timing |
log_experiment tool | Agent appends result JSON, git commit on keep |
| TUI dashboard | autoresearch-dashboard.md |
before_agent_start hook | UserPromptSubmit hook injects context |
State lives in autoresearch.jsonl. Session artifacts (*.jsonl, dashboard, session doc, benchmark script, ideas backlog, worklog) are gitignored.
cd ~/autoresearch-claude-code && ./uninstall.shThen remove the hook from ~/.claude/settings.json.
