Codex Autoresearch Skill — A self-directed iterative system for Codex that continuously cycles through: modify, verify, retain or discard, and repeat indefinitely. Inspired by Karpathy’s autoresearch concept.
# Add to your Claude Code skills
git clone https://github.com/leo-lilinxiao/codex-autoresearchGuides for using ai agents skills like codex-autoresearch.
Last scanned: 11/28/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-11-28T21:52:18.987Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}codex-autoresearch is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by leo-lilinxiao. Codex Autoresearch Skill — A self-directed iterative system for Codex that continuously cycles through: modify, verify, retain or discard, and repeat indefinitely. Inspired by Karpathy’s autoresearch concept. It has 3,294 GitHub stars.
Yes. codex-autoresearch passed AgentsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/leo-lilinxiao/codex-autoresearch" and add it to your Claude Code skills directory (see the Installation section above). codex-autoresearch ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
codex-autoresearch is primarily written in Python. It is open-source under leo-lilinxiao on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh codex-autoresearch against similar tools.
No comments yet. Be the first to share your thoughts!
Improve a repository through repeated, reversible experiments:
hypothesize -> change -> measure -> learn -> keep or revert -> repeat
Codex chooses hypotheses and makes code changes. The control script owns measurement, commits, rollback, and the event history.
Resolve <control> to this skill's own scripts/autoresearch.py. Do not assume it is installed in the target repository.
For a status or results request, run the corresponding command directly:
| Request | Command |
|---|---|
| Status | python3 <control> status --repo <repo> |
| History | python3 <control> history --repo <repo> |
| TSV export | python3 <control> history --repo <repo> --format tsv |
| HTML report | python3 <control> report --repo <repo> |
Report the requested result without starting or resuming experiments. Return the generated path for an HTML report.
Before starting or resuming an experiment, read the applicable workflow unless it is already in context:
complete, no Goal is needed.finish to finalize each coherent experiment. Do not manually commit, revert, or edit run artifacts during an active run.complete. An iteration limit, error, or external blocker has its own status.Foreground continuation belongs to the official Codex Goal. Background continuation belongs to the detached controller. An already launched background worker follows its supplied experiment contract, without starting a new launch flow.
Tell Codex which number you want to move and where it should end up. Codex looks through your repository, confirms the plan with you, and then works one change at a time: measure it, keep it if it helps, roll it back if it doesn't, and repeat until the target is reached.
It works for anything a command can measure: failing tests, coverage, type errors, warnings, latency, binary size, reproducible security findings, and so on.
Install from Codex:
$skill-installer install https://github.com/leo-lilinxiao/codex-autoresearch
Open a clean Git repository with Full Access:
codex --dangerously-bypass-approvals-and-sandbox
Then invoke the skill:
You: $codex-autoresearch
Reduce `python3 scripts/score.py` error_count to 0.
Codex: Baseline: 5
Target: 0 (lower is better)
Scope: src/
Verify: python3 scripts/score.py, JSON key error_count
Guard: none
Run in foreground or background?
You: Background. Go.
Codex starts the run you confirmed. You don't need to change any Codex settings or learn special syntax.
See Installation for manual and development installs.
look at the evidence
|
change one thing
|
commit and measure
|
+-- improved + guard passes --> keep
|
+-- otherwise ---------------> revert
|
record the result
|
repeat until target
Codex decides what to try and writes the code. A small control script does the bookkeeping: commits, measurement, rollback, and the record of every experiment.
| Foreground | Background | |
|---|---|---|
| Runs in | Current Codex task | Detached controller |
| Continuation | Official Codex Goal | One codex exec worker per iteration |
| Best for | Watching and steering live | Long or overnight runs |
| Control | Codex Goal pause/resume | Ask $codex-autoresearch for status, stop, or resume |
Both modes follow the same rules. What differs is what keeps the loop going: in the foreground, a Codex Goal in your current task. In the background, a separate controller that starts a fresh worker for each experiment. A run uses one mode at a time.
Before it changes anything, Codex shows you:
You need a clean, named Git branch to start, and each run covers one repository.
Codex won't ask again about anything you've already decided. Once you confirm, it keeps going without asking you to approve each experiment.
Everything the run records goes in autoresearch-results/, which is never committed:
| Path | Purpose |
|---|---|
run.json |
The settings you confirmed. Never changes |
events.jsonl |
Every baseline, experiment, stop, and completion, in order. Only appended to |
logs/ |
Full metric, guard, and background worker output |
runtime.json |
Background process state |
runtime.log |
What the background controller did |
report.html |
Optional visual report, rebuilt on request |
events.jsonl is the source of truth. If it's missing or damaged, the skill stops and says so. It never guesses results from old files or from the conversation.
Ask the skill for the history:
$codex-autoresearch show experiment history
Codex Autoresearch
Run: 0a516883 Status: complete Mode: foreground
Metric: error_count 2 -> 0 Target: 0 (lower is better)
SEQ ITER EVENT PREVIOUS TRIAL RETAINED DESCRIPTION
--- ---- -------- -------- ----- -------- ------------------------------------
0 0 baseline - - 2 Initial measurement
1 1 discard 2 3 2 Broaden parser fallback
2 2 keep 2 1 1 Fix nested parser branch
3 3 keep 1 0 0 Remove final parser error
4 3 complete - - 0 retained metric satisfies the target
You can also export it as TSV or get a self-contained HTML report:
$codex-autoresearch export experiment history as TSV
$codex-autoresearch generate an HTML report
The report goes to autoresearch-results/report.html. It's only a snapshot, so delete or regenerate it whenever you like.
git revert. A guard timeout counts as a failure.crash. A single crash does not stop the run. Three consecutive crashes do.git worktree.complete only when the kept result actually reaches the target.blocked is reserved for real outside problems, such as missing credentials or data. A hard problem or a failed idea is not a blocker.This is strict on purpose. If a long unattended run quietly papered over problems, you couldn't trust its results.
The verify command has to exit successfully and print one finite number on its last non-empty stdout line. It can print a JSON object there instead, as long as Codex names the numeric key to read.
7
{"error_count": 7, "passed": 12}
Use a guard for anything the metric doesn't cover, such as running the test suite while you optimize latency. The guard has to pass before the run starts.
Keep the verify script and its data out of the scope, so experiments can't change how they are measured. If the same code gives different numbers from run to run, report the median of several runs.
| Guide | Contents |
|---|---|
| Installation | Install, update, and verify the skill |
| User Guide | Setup, how runs work, and troubleshooting |
| Examples | Practical prompts and metric patterns |
| Contributing | Architecture and validation for contributors |
Does installation change my Codex settings?
No. It only copies the skill files. You do need a recent Codex release, because foreground runs rely on Codex Goals.
Why Full Access?
Every experiment makes or reverts a Git commit, and restricted sandboxes may block writes under .git. So background runs default to Full Access. You can still choose workspace-write if you accept that Git writes may fail.
Can I stop and resume?
Yes. In the foreground, interrupt or pause the Goal. In the background, ask $codex-autoresearch for status, stop, or resume. A background stop lets the current experiment finish first. Just saying "resume" continues the same experiment. You can add a new direction if you like.
Can it run without Git or across several repos?
No. Git is how the run remembers what it tried and how it rolls back. One run per repository keeps it clear which commits and numbers belong to which run.
Is this only for small changes?
No. Each experiment tests one idea, and it can be as big as that idea needs, as long as it can be measured and rolled back on its own.
Inspired by Karpathy's autoresearch, generalized for Codex and software repositories.
@misc{codex-autoresearch,
author = {Li, Linxiao},
title = {Codex Autoresearch: Autonomous Goal-Driven Experimentation for Codex},
year = {2026},
publisher = {GitHub},
url = {https://github.com/leo-lilinxiao/codex-autoresearch}
}
GitHub also reads CITATION.cff for its Cite this repository menu.