/ 目錄 / 演練場 / Autoresearch (Karpathy-style)
● 社群 uditgoenka ⚡ 即開即用

Autoresearch (Karpathy-style)

作者 uditgoenka · uditgoenka/autoresearch

輸入目標,輸出結果——Claude 提出變更、執行、衡量、保留優勝、捨棄敗者、迭代。Andrej Karpathy 的 autoresearch 迴圈,封裝成一個 skill。

Autoresearch 讓 Claude 成為閉迴路研究者:你指定一個目標與驗證器(指標、測試或裁判提示),skill 就以預算控制迭代「修改 → 驗證 → 保留/捨棄」。靈感來自 Karpathy 的 autoresearch 文章。適用於目標可測量但搜尋空間太大而無法提前規劃的場景——提示調優、超參數搜尋、效能重構、文案 A/B 測試。

為什麼要用

核心特性

即時演示

實際使用效果

就緒

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "autoresearch-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/uditgoenka/autoresearch",
        "~/.claude/skills/autoresearch"
      ],
      "_inferred": true
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "autoresearch-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/uditgoenka/autoresearch",
        "~/.claude/skills/autoresearch"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "autoresearch-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/uditgoenka/autoresearch",
        "~/.claude/skills/autoresearch"
      ],
      "_inferred": true
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "autoresearch-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/uditgoenka/autoresearch",
        "~/.claude/skills/autoresearch"
      ],
      "_inferred": true
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "autoresearch-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/uditgoenka/autoresearch",
        "~/.claude/skills/autoresearch"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "autoresearch-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/uditgoenka/autoresearch",
          "~/.claude/skills/autoresearch"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add autoresearch-skill -- git clone https://github.com/uditgoenka/autoresearch ~/.claude/skills/autoresearch

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: Autoresearch (Karpathy-style)

針對基準測試迭代調優系統提示

👤 調優提示的 AI 工程師 ⏱ ~90 min advanced

何時使用: 你有一個提示、一個基準測試,以及進行迴圈的耐心。

前置條件
  • 已安裝 Skill — git clone https://github.com/uditgoenka/autoresearch ~/.claude/skills/autoresearch
  • 有評分函式的基準測試 — /bench/run.sh 在標準輸出列印分數
步驟
  1. 框架目標
    Use autoresearch. Goal: maximize score from /bench/run.sh on prompt at /prompts/system.md. Budget 30 iterations.✓ 已複製
    → 迴圈開始;第一個提案已提出
  2. 查看追蹤記錄
    Show me iterations 5–10 with deltas.✓ 已複製
    → 每次迭代含分數的追蹤記錄;保留/捨棄已標記
  3. 提前停止
    If 3 consecutive iterations fail to improve > 1%, stop and report best.✓ 已複製
    → 收斂守衛觸發;最佳提示已回報

結果: 更好的提示,並附有解釋原因的追蹤記錄。

注意事項
  • 驗證器可被博弈——分數上升但品質未改善 — 加入健全性核查驗證器(LLM 裁判或保留集)
搭配使用: filesystem

透過自動迭代讓熱點函式效能提升 20%

👤 有效能分析資料的後端開發者 ⏱ ~120 min advanced

何時使用: 你知道哪個函式很慢;你想讓 Claude 找到更快的等效實作。

步驟
  1. 定義
    Goal: minimize wall-time of /bench/perf.sh which exercises foo(). Constraint: tests must keep passing.✓ 已複製
    → 迴圈開始;基準已擷取
  2. 迭代
    Run 20 iterations. Show the top 3 improvements at the end.✓ 已複製
    → 3 個候選重構,含測量到的加速幅度

結果: 具體的效能提升,並有驗證。

注意事項
  • 迭代引入了測試未捕捉到的正確性問題 — 加入屬性測試作為驗證器,搭配單元測試一起使用
搭配使用: github

針對點擊率裁判自動迭代落地頁文案

👤 執行內容測試的行銷人員 ⏱ ~60 min intermediate

何時使用: 你有一個 CTR 目標(或模擬它的裁判提示)並有時間迭代。

步驟
  1. 設定裁判
    Goal: maximize judge_score on /copy/headline.md. Judge prompt: 'rate likelihood a Series-B SaaS founder clicks this headline'.✓ 已複製
    → 裁判基準已評分;迴圈開始
  2. 迭代
    Run 15 iterations; keep top 3 distinct candidates.✓ 已複製
    → 前 3 個不同的標題

結果: 3 個供人工審查的候選標題。

注意事項
  • 裁判有與點擊率無關的強烈風格偏好 — 用含明確評分標準的規則檔案限定裁判

組合

與其他 MCP 搭配,撬動十倍槓桿

autoresearch-skill + filesystem

持久化迭代追蹤記錄以供檢視

Save trace to /research/traces/<ts>.md after each loop.✓ 已複製
autoresearch-skill + github

以勝出候選開啟 PR

When loop finishes, open PR titled 'autoresearch: <metric> +X%'.✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
loop goal, verifier, max_iter, budget_tokens? 閉迴路最佳化 Variable — bound by budget
trace loop_id? 檢視某次執行 0
rollback to_iteration 迴圈走偏了 0

成本與限制

運行它的成本

API 配額
受限於你的 LLM
每次呼叫 Token 數
較重——完整迴圈可能超過 100k token
費用
免費;LLM 費用自行負擔
提示
務必設定 max_iter 與 budget_tokens——開放式迴圈會燒錢

安全

權限、密鑰、影響範圍

憑證儲存:
資料出站: 受限於你的 LLM 服務商

故障排查

常見錯誤與修復

迴圈卡住——每次迭代提案相同

提高提案者的探索溫度;或提供多樣的種子候選

驗證器不穩定地失敗

驗證器的不穩定性使迴圈失效——固定種子,每次迭代重複驗證 N=3 次

預算耗盡前未收斂

檢視追蹤記錄——若增益持續,提高預算;否則驗證器或提案者是瓶頸

替代方案

Autoresearch (Karpathy-style) 對比其他方案

替代方案何時用它替代權衡
wanshuiyin/Auto-claude-code-research-in-sleep (ARIS)你想要專門針對 ML 的隔夜非同步研究迴圈ARIS 針對 ML;autoresearch 是通用的
手動 A/B 加腳本化迭代目標小且是一次性的Skill 移除了協調的額外負擔

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills