← ClaudeAtlas

delegate-to-codexlisted

Call the OpenAI Codex CLI (`codex exec`) non-interactively to get a second opinion, run a code review, or delegate read-only or edit-capable work to an independent Codex run. Use for Codex CLI subagent-style delegation, long-running worker runs, worktree-isolated edits, machine-readable JSONL output, resume flows, and harness gotchas around stdin and sandboxing.
T0mSIlver/skills · ★ 1 · AI & Automation · score 70
Install: claude install-skill T0mSIlver/skills
# Delegate to Codex (CLI) Run `codex exec` non-interactively for a second opinion, review, or a delegated edit worker. Model default: `gpt-5.6-sol` at `-c model_reasoning_effort='"high"'` (`medium`/`low` only for small or mechanical work). ## Happy path 1. **Isolate.** Read-only work runs in the current checkout with `-s read-only`: ```bash slug="codex-$(date +%Y%m%d-%H%M%S)" run_dir="/tmp/codex-$slug"; mkdir -p "$run_dir" ``` Edit work gets its own worktree instead, so the diff is easy to inspect or discard: ```bash slug="codex-$(date +%Y%m%d-%H%M%S)" worktree="../$(basename "$PWD")-$slug" git worktree add -b "agent/codex/$slug" "$worktree" HEAD run_dir="$worktree/.agent-runs/$slug"; mkdir -p "$run_dir" ``` 2. **Write the brief** to `$run_dir/prompt.md`. Include context, exact task, constraints, verification commands, output contract — and a **hard completion criterion**: GPT-5.6 Sol is exploratory and keeps widening scope without an unambiguous definition of "done". 3. **Launch.** Always feed the prompt from the file with `- < prompt.md`; never pass it as a bare argument under a harness (see Gotchas: stdin wedge). Read-only reviewer / second opinion: ```bash codex exec -C "$PWD" \ -m gpt-5.6-sol -c model_reasoning_effort='"high"' \ -s read-only --json -o "$run_dir/final.md" \ - < "$run_dir/prompt.md" > "$run_dir/events.jsonl" ``` Edit worker — same command with `-C "$worktree"` and `