# Freeze a Codex run into a replayable skill.

> Point Codex's MCP config at Reelier, record the job once through the wrap proxy, and replay it deterministically — an assertion on every step, a receipt on every run.

Markdown twin of https://www.reelier.com/for/codex — deterministic replay for Codex. Reelier records what an agent actually did, compiles it into a SKILL.md with an assertion per step, and replays it at 0 LLM tokens with a receipt every run.

## How capture works on Codex

`reelier scan` includes Codex CLI's session directory in its source list. Honest caveat: today, transcript lines that don't match the Claude-style JSONL schema parse to 0 replayable sessions — scan skips what it doesn't recognize rather than fabricating a result. So treat scan as a bonus on Codex, not the plan.

The dependable capture path is the recording proxy: front the MCP server(s) your job uses with `reelier mcp --wrap`, run the job once in Codex, and the full trace lands in `.reelier/traces/`. Wrap captures lossless traces (tool annotations included) — scan-from-history is a reconstruction; wrap is the recording.

`reelier scan` reads: `~/.codex/sessions`
(The literal directory scan reads for Codex CLI (reelier/src/scan.ts). Unrecognized transcript formats contribute 0 replayable sessions — honest degradation, never a crash.)

## Wire it up

### ~/.codex/config.toml — Reelier's tools inside Codex

```toml
[mcp_servers.reelier]
command = "npx"
args = ["-y", "reelier", "serve"]
```

Codex's MCP config shape. The Reelier repo's guidance is agent-generic: any agent that speaks stdio MCP points its config at `npx -y reelier serve` (integrations/README.md).

### ~/.codex/config.toml — record through the proxy

```toml
[mcp_servers.your-data-server]
command = "npx"
args = ["-y", "reelier", "mcp", "--wrap", "npx -y @yourco/mcp-server"]
```

`reelier mcp` is the recorder — a different command from `reelier serve`, which exposes Reelier's own tools. Don't confuse the two when wiring things up.

## First receipt in 60 seconds

1. `npm i -g reelier` — Install the CLI — or run every command below through `npx -y reelier`.
2. Add both `[mcp_servers]` entries above to `~/.codex/config.toml` and restart Codex.
3. Run the job once in Codex. The proxy records every tool call to `.reelier/traces/<name>.jsonl`.
4. `reelier compile .reelier/traces/<name>.jsonl -o my-job.skill.md && reelier run my-job.skill.md` — Compile, then replay: 0 LLM tokens, every step asserted, receipt written. `reelier diff my-job` gates drift from the second run on.

## A real receipt

Verbatim output of a portfolio replay, run with the published CLI (`npx -y reelier@latest`, resolved to reelier@0.12.1) on 2026-07-21. The run record confirms passed: true and 0 LLM tokens. Replay it yourself:

```
npx -y reelier@latest run examples/portfolio/registry-latest.skill.md

=== registry-latest ===
✓ Step 1 — Latest dist-tag from the registry [passed] 152ms

PASSED: 1/1 steps ok, 0 failed, 152ms total
```

## FAQ

**Will reelier scan find my Codex sessions?**

It reads `~/.codex/sessions`, and sessions parse to replayable steps only where the transcript matches the JSONL schema scan recognizes today. Anything else shows up as 0 replayable — an honest zero. Recording through the wrap proxy sidesteps the format question entirely.

**Is there a Codex-specific rules file?**

Not yet. The repo's integrations guide says to adapt the Cursor or Windsurf variants by hand, or use the Claude Code SKILL.md as the fullest reference for when the agent should replay instead of re-reason.

**What can't Reelier replay?**

Reelier replays deterministic tool calls: MCP tool calls and its own `http.get`/`http.post` builtins. It cannot replay file edits, shell commands, reads and searches, subagent dispatch, or anything non-deterministic. An edit-heavy coding session honestly reports nothing replayable — an empty result, not an error.

## Links

- [Your OpenClaw cron burns 2,880 LLM calls a month. Here's the same job at zero.](https://www.reelier.com/blog/openclaw-cron-costs)
- [Scheduled agents re-learn the job every run. Replay the part that never changes.](https://www.reelier.com/blog/scheduled-agents-zero-token)
- [Agent cost calculator — what re-reasoning a recurring job costs, with your numbers.](https://www.reelier.com/tools/agent-cost-calculator)
- [seldonframe/reelier — the engine, AGPL-3.0. Fork it, audit it, self-host it.](https://github.com/seldonframe/reelier)

Other agents: [Claude Code](https://www.reelier.com/for/claude-code) · [Cursor](https://www.reelier.com/for/cursor) · [Windsurf](https://www.reelier.com/for/windsurf) · [OpenClaw](https://www.reelier.com/for/openclaw) · [Hermes](https://www.reelier.com/for/hermes)
