/hey-codex:codex-research [objective or workspace path]from hey-codex
Run an iterative research loop with Codex CLI — automatically repeats goal-directed experiments and records results. Use for requests like "codex 연구", "codex research", "반복 연구", "연구 루프", "research loop", "자율 연구", "codex로 연구", "깊이 연구", "반복 실험", "autoresearch", "codex 루프", "계속 연구", "overnight research", "연구 상태 확인", "연구 이어줘", "연구 재개", "research status", "resume research". For one-off task delegation, hey-codex is a better fit.
Ships in hey-codex. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Run a goal-directed research loop by repeatedly invoking the Codex CLI. Based on the karpathy/autoresearch pattern.
Each round, Codex selects a hypothesis -> makes a change -> verifies -> returns structured JSON, and the host script handles the 3-Layer decision -> git management -> ledger recording.
Respond to the user in Korean.
bash "${CLAUDE_PLUGIN_ROOT}/scripts/preflight.sh"
Analyze the user request to determine the mode.
| Mode | Keywords | Claude role | Script role |
|---|---|---|---|
| design | 설계, 계약, contract, 루프 설계 | Write the contract | init only |
| guided-loop (default) | 연구 시작, 루프 시작, N라운드, 연구해줘 | Run script -> report results | run --max-rounds N |
| autonomous-loop | 계속 돌려, overnight, 자율, loop-forever | Issue command + warnings | run --loop-forever |
When the keywords are unclear, default to guided-loop.
Check whether a .codex-research/ directory exists in the workspace.
init + switch to design mode (write the contract first)contract.md, confirm the hard gate/metric, then proceeddesign mode:
codex-research.sh initcontract.md together with the user (see references/loop-contract.md)guided-loop mode:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/codex-research.sh" run <workspace> --max-rounds N --search --full-auto
After running, read ledger.tsv + state_snapshot.md and report the results.
autonomous-loop mode:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/codex-research.sh" run <workspace> --loop-forever --search --full-auto
This runs without interruption. Always show the warning, re-confirm the contract's stop condition and budget, and only then issue the command.
Report the following after a round completes:
Keep hard gate result, experiment status, and control action in separate columns — never merged into one.
| Layer | Value | Meaning |
|---|---|---|
| hard gate result | pass / fail | Minimum passing line. On fail, reject regardless of metric improvement |
| experiment status | keep / discard / crash | Whether to retain this round's result relative to the best-known state |
| control action | pass / refine / pivot / rescope / escalate / stop | Controls the whole loop. Decides the next round's direction |
Loop termination: control_action is pass/stop/rescope/escalate, or max_rounds is reached.
| Criterion | hey-codex | codex-research |
|---|---|---|
| Purpose | One-off task delegation | Iterative research loop |
| Rounds | 1 | N |
| State retention | None | program + contract + snapshot + ledger |
| Keywords | "codex한테 시켜" | "codex로 연구해" |
Routing: includes "연구/루프/반복/research/loop" -> codex-research. Otherwise -> hey-codex.
Note:
initrequires the workspace directory to already exist. For a new project, runmkdir -p <workspace>before init.
# Initialize (the workspace directory must already exist)
bash "${CLAUDE_PLUGIN_ROOT}/scripts/codex-research.sh" init <workspace> "objective"
# Check status
bash "${CLAUDE_PLUGIN_ROOT}/scripts/codex-research.sh" status <workspace>
# Run research
bash "${CLAUDE_PLUGIN_ROOT}/scripts/codex-research.sh" run <workspace> --max-rounds N --search --full-auto
The shell wrapper converts the
<workspace>positional argument internally to--workspace <path>. If needed, call the Python runner directly to specify options like--workspaceand--state-direxplicitly.
| Option | Default | Description |
|---|---|---|
| --workspace | . | Workspace directory where research runs (same as the positional argument in the shell wrapper) |
| --state-dir | <workspace>/.codex-research | Override the state file directory |
| --codex-bin | codex | Codex CLI executable to use |
| --sandbox | - | read-only / workspace-write / danger-full-access |
| --max-rounds | 3 | Maximum number of rounds |
| --loop-forever | false | Run infinitely (autonomous-loop only) |
| --search | false | Codex --search (web search) |
| --full-auto | false | Codex --full-auto |
| --model | - | Specify the Codex model |
| --timeout-seconds | 1800 | Per-round timeout (seconds) |
| --skip-git-repo-check | false | Skip Codex's git repo check (for non-git workspaces) |
| --commit-on-keep | auto | Force auto-commit of keep results |
| --no-commit-on-keep | false | Disable auto-commit on keep |
| --allow-dirty | false | Allow running even on a git dirty tree |
| --add-dir | - | Additional reference directory for Codex (repeatable) |
--commit-on-keep: always attempt to auto-commit keep results--no-commit-on-keep: do not auto-commit keep results. Without --allow-dirty in this case, automatic progression to the next round may be halted.codex-research/
├── program.md # objective + research scope
├── contract.md # evaluation contract (loop-contract.md format)
├── state_snapshot.md # baseline, best state, next candidates
├── ledger.tsv # per-round result record
├── runtime/ # temporary files during Codex execution
└── rounds/
├── round-000/
│ ├── prompt.md
│ ├── last-message.json
│ ├── response.json
│ ├── codex-events.jsonl
│ └── evidence.md
└── round-001/...
pivot, rescope, or escalate over refine.sleep N && <cmd>: the Claude Code Bash tool blocks a leading sleep chain. To check round progress on a running run, call codex-research.sh status <workspace> on its own; when you actually need to wait, use the Monitor tool's until <check>; do sleep 2; done pattern. Keep log checks like tail -f as separate, standalone Bash calls too.references/loop-contract.md -- guide for writing the research contractWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub oozoofrog/oozoofrog-plugins --plugin hey-codex2 skills in this plugin
Other plugins' skills for the same job