Skip to content

snits/autoresearch-claude-code

 
 

Repository files navigation

autoresearch-claude-code

License: MIT Claude Code Python 3.10+

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.

Install

git clone https://github.com/drivelineresearch/autoresearch-claude-code.git ~/autoresearch-claude-code cd ~/autoresearch-claude-code && ./install.sh

Then add the hook to ~/.claude/settings.json:

{ "hooks": { "UserPromptSubmit": [ { "hooks": [{ "type": "command", "command": "~/.claude/hooks/autoresearch-context.sh" }] } ] } }

Usage

/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.

Example: Fastball Velocity Prediction

Included example using the Driveline OpenBiomechanics dataset -- predicting fastball velocity from biomechanical POI metrics.

Experiment Progress

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
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.py

See obp-autoresearch.md for the session config and experiments/worklog.md for the full experiment narrative.

How it works

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.

Uninstall

cd ~/autoresearch-claude-code && ./uninstall.sh

Then remove the hook from ~/.claude/settings.json.

License

MIT

About

Autonomous experiment loop skill for Claude Code — port of pi-autoresearch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 66.8%
  • Shell 33.2%