
karpathy-autoresearch
Set up an autonomous research loop where an agent iterates on experiments, hypotheses, and code on git branches. Use this skill when the user wants to automate ML experiments, set up a research agent that self-improves, needs to run many variations of an experiment without manual intervention, or says "automate experiments", "agent research loop", "self-improving agent", "run hyperparameter search", "autoresearch". Based on Karpathy 28k-like AutoResearch post.
- Installs
- 126
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/learnprompt/andrej-karpathy-skills --skill karpathy-autoresearch- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads karpathy-autoresearch automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Skill 6: AutoResearch(自主研究循环)
Source: https://x.com/karpathy/status/2030371219518931079 "Autoresearch project — agent self-iterates training code" — 28k likes
Core Principle
You change the prompt. The agent changes everything else.
The loop: agent reads current state → runs experiment → analyzes results → proposes next iteration → you approve the prompt change → repeat.
You stay in the hypothesis space. Agent stays in the implementation + execution space.
The AutoResearch Architecture
Human Layer (you):
- Define research question
- Approve hypothesis changes
- Set evaluation metric
- Stop when satisfied
Agent Layer:
- Implement current hypothesis
- Run experiment (on git branch)
- Analyze logs/results
- Propose next hypothesis
- Never change the research question
Setup Prompt (One-Time)
You are AutoResearcher for this project.
Research question: [WHAT YOU'RE TRYING TO LEARN/OPTIMIZE]
Evaluation metric: [HOW WE MEASURE SUCCESS — must be a single number]
Current best result: [BASELINE or "none yet"]
Constraints:
- Work on git branches: each experiment gets branch "exp/[short-description]"
- Never modify main branch
- Log all results to experiments.jsonl in format: {"id": N, "hypothesis": "...", "metric": value, "notes": "..."}
- Each iteration: implement → run → log → propose next
Starting hypothesis: [YOUR FIRST HYPOTHESIS TO TEST]
Begin iteration 1. Implement the hypothesis, run it, report the metric, then propose iteration 2.
Per-Iteration Loop Prompt
AutoResearcher: Iteration [N]
Current state:
- Branch: exp/[current]
- Metric so far: [RESULTS LOG]
- Best result: [BEST SO FAR]
Completed last iteration: [WHAT HAPPENED]
Metric result: [VALUE]
Your tasks this iteration:
1. Analyze: what does the result tell us about the hypothesis?
2. Propose: what's the next hypothesis? (one variable change at a time)
3. Implement: write the code change for this hypothesis
4. Run: execute and report the metric
5. Commit: git commit to branch exp/[new-name] with message: "exp: [hypothesis description]"
Constraint: change ONE variable at a time. If last experiment failed, back off to simpler hypothesis.
Experiment Log Format
{"id": 1, "branch": "exp/baseline", "hypothesis": "default hyperparams", "metric": 0.423, "runtime_s": 45, "notes": "starting point"}
{"id": 2, "branch": "exp/lr-0.001", "hypothesis": "lower learning rate 0.01→0.001", "metric": 0.451, "runtime_s": 47, "notes": "small improvement, keep lowering?"}
{"id": 3, "branch": "exp/lr-0.0001", "hypothesis": "lower learning rate 0.001→0.0001", "metric": 0.438, "runtime_s": 46, "notes": "worse than id=2, sweet spot was 0.001"}
Research Summary Prompt (run after N iterations)
Summarize this research session.
Experiment log:
[PASTE experiments.jsonl]
Produce:
1. Best configuration found (all hyperparameters/settings)
2. What we learned (2-3 bullet points about the search space)
3. What we should try next (top 3 unexplored directions)
4. A clear hypothesis about WHY the best configuration works
5. Confidence level: how sure are we this is near-optimal?
Applying AutoResearch Beyond ML
This pattern works for any iterative optimization:
| Domain | Research Question | Metric |
|---|---|---|
| ML training | Best architecture/hyperparams | Validation loss |
| Prompt engineering | Best system prompt | Task success rate |
| Code optimization | Fastest implementation | Runtime (ms) |
| Content creation | Most engaging format | Click/read rate |
| Product design | Best UX flow | Task completion rate |
Safety Rails
AutoResearcher rules (always include):
- NEVER delete data or commits from previous experiments
- NEVER modify any file outside the current experiment's scope
- NEVER run experiments that cost > [COST_LIMIT] without checking
- ALWAYS commit before starting the next iteration
- ALWAYS report the metric before proposing the next hypothesis
- If metric degrades 3 iterations in a row, STOP and ask for guidance
Workflow
属于工作流:研究到发布(内容创作者/研究者)
| 位置 | 上游 | 下游 |
|---|---|---|
| 入口 | 用户有研究问题时直接触发 | karpathy-llm-wiki(把实验结果沉淀为知识页) |
完整链路:autoresearch → llm-wiki → output-evolution → education-first
Prompt Contract
You are AutoResearcher. Research question: <QUESTION>. Evaluation metric: <SINGLE_NUMBER_METRIC>. Current baseline: <VALUE or "none">. Starting hypothesis: <FIRST_HYPOTHESIS>. Work on git branches (exp/<name>). Each iteration: implement → run → log result to experiments.jsonl → analyze → propose next hypothesis (one variable change). Never modify main. Stop and ask if metric degrades 3 iterations in a row.
Verification Checklist
- 研究问题有明确的单一评估指标
- 每轮实验只改一个变量
- 所有结果都记录到 experiments.jsonl
- 每轮在独立 git branch 上工作
- 人类在方向性变更前被征求意见
- 有明确的停止条件(指标连续恶化/达到目标)
FAQ
What does the karpathy-autoresearch skill do?
Set up an autonomous research loop where an agent iterates on experiments, hypotheses, and code on git branches. Use this skill when the user wants to automate ML experiments, set up a research agent that self-improves, needs to run many variations of an experiment without manual intervention, or says "automate experiments", "agent research loop", "self-improving agent", "run hyperparameter search", "autoresearch". Based on Karpathy 28k-like AutoResearch post.
How do I install karpathy-autoresearch?
Run npx skills add https://github.com/learnprompt/andrej-karpathy-skills --skill karpathy-autoresearch in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/karpathy-autoresearch/ (personal) or .claude/skills/karpathy-autoresearch/ (project).
Which AI agents can use karpathy-autoresearch?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is karpathy-autoresearch safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains karpathy-autoresearch?
It is published by learnprompt in learnprompt/andrej-karpathy-skills. It has 126 recorded installs.
More from learnprompt/andrej-karpathy-skills
karpathy-agentic-engineering
learnprompt/andrej-karpathy-skills
Open the skill to read its SKILL.md instructions.
karpathy-methodology
learnprompt/andrej-karpathy-skills
Open the skill to read its SKILL.md instructions.
karpathy-minimalism
learnprompt/andrej-karpathy-skills
Apply Karpathy-style minimalism and anti-dependency principles to code and system design. Use this skill when the user wants to reduce dependencies, avoid supply chain risks, rewrite something in pure Python or minimal code, audit a project for bloat, design agent-native CLI tools, or says "too many dependencies", "minimize deps", "pure python", "yoink this", "vibe code this", "no frameworks", "agent-native design". Based on 28k-like litellm attack post and 25k-like 243-line GPT post.
karpathy-understanding-first
learnprompt/andrej-karpathy-skills
Open the skill to read its SKILL.md instructions.
karpathy-education-first
learnprompt/andrej-karpathy-skills
Apply the education-first mindset — make everything you build teachable, create nano-project explanations, write for beginners. Use this skill when the user wants to explain a project to beginners, create a tutorial from code, write documentation that teaches (not just documents), make a concept accessible, or says "make this teachable", "explain like im a beginner", "nano project version", "teaching version", "explain from scratch", "blog post about this". Based on Karpathy 243-line GPT and Eureka Labs posts.
karpathy-llm-wiki
learnprompt/andrej-karpathy-skills
Build and maintain an LLM-powered personal knowledge base or wiki. Use this skill when the user wants to organize research notes, build a second brain, set up an Obsidian vault with LLM compilation, ingest papers or articles automatically, or mentions "personal knowledge base", "LLM wiki", "second brain", "knowledge management", "ingest papers", "obsidian + LLM". Based on Karpathy Gist and 59k-like post.
Popular productivity & automation skills
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
lark-doc
open.feishu.cn
飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。
lark-base
open.feishu.cn
飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。
lark-drive
open.feishu.cn
飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。
lark-shared
open.feishu.cn
Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.
lark-im
open.feishu.cn
飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。