drivelineresearch/autoresearch-claude-code
GitHub: drivelineresearch/autoresearch-claude-code
为 Claude Code 设计的自主实验循环技能,能够自动运行实验、测量结果、保留优胜方案并持续迭代优化,无需 MCP 服务器。
Stars: 88 | Forks: 6
# autoresearch-claude-code
[](LICENSE)
[](https://docs.anthropic.com/en/docs/claude-code)
[](https://python.org)
[Claude Code](https://docs.anthropic.com/en/docs/claude-code) 的自主实验循环。作为一项纯技能移植自 [pi-autoresearch](https://github.com/davebcn87/pi-autoresearch) —— 无需 MCP server,仅包含 Agent 使用其内置工具遵循的指令。
运行实验、测量结果、保留优胜者、淘汰失败者,无限循环。
## 安装
```
git clone https://github.com/drivelineresearch/autoresearch-claude-code.git ~/autoresearch-claude-code
cd ~/autoresearch-claude-code && ./install.sh
```
然后将钩子添加到 `~/.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
```
Agent 会创建一个分支,编写会话文档 + benchmark 脚本,运行基线,然后进入自主循环。在循环过程中发送消息可以引导下一次实验。
## 示例:Fastball 速度预测
包含使用 [Driveline OpenBiomechanics](https://github.com/drivelineresearch/openbiomechanics) 数据集的示例 —— 基于生物力学 POI 指标预测 fastball 速度。

22 次自主实验将 R² 从 **0.44 提升至 0.78** (+78%),仅凭生物力学数据即可在约 ±2 mph 的误差内预测新球员的 fastball 速度。
| 指标 | 基线 | 最佳 | 变化 |
|--------|----------|------|--------|
| R² | 0.440 | 0.783 | +78% |
| RMSE | 3.53 mph | 2.20 mph | -38% |
自行运行:
```
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
```
参见 [`obp-autoresearch.md`](obp-autoresearch.md) 了解会话配置,以及 [`experiments/worklog.md`](experiments/worklog.md) 了解完整的实验叙述。
## 工作原理
| pi-autoresearch (MCP) | 本移植版 (Skill) |
|---|---|
| `init_experiment` 工具 | Agent 将配置写入 `autoresearch.jsonl` |
| `run_experiment` 工具 | Agent 运行 `./autoresearch.sh` 并计时 |
| `log_experiment` 工具 | Agent 追加结果 JSON,保留时执行 `git commit` |
| TUI 仪表盘 | `autoresearch-dashboard.md` |
| `before_agent_start` 钩子 | `UserPromptSubmit` 钩子注入上下文 |
状态保存在 `autoresearch.jsonl` 中。会话产物(`*.jsonl`、仪表盘、会话文档、benchmark 脚本、想法积压、工作日志)均被 gitignore 忽略。
## 卸载
```
cd ~/autoresearch-claude-code && ./uninstall.sh
```
然后从 `~/.claude/settings.json` 中移除钩子。
## 许可证
[MIT](LICENSE)
标签:Agent, Apex, AutoGPT, AutoML, Claude Code, DLL 劫持, DNS解析, LLM, Python, Unmanaged PE, 人工智能, 代码自动化, 大语言模型, 开源项目, 循环优化, 技能插件, 无后门, 机器学习, 棒球数据分析, 生物力学, 用户模式Hook绕过, 网络安全研究, 自主代理, 自动化实验, 预测模型