Codex Exec Delegation
Delegate tasks to the OpenAI codex CLI non-interactively from Claude Code, with hardened rules for timeouts and session recovery.
Dev & CodingAdvanced★ 404⑂ 32AI score 9/10Last updated: Sep 27, 2026
What it does
- Runs
codex execto hand a whole task to the codex CLI — progress on stderr, final result on stdout. - Enforces
< /dev/nullon non-piped calls so codex doesn't hang forever on a never-EOF stdin pipe inside subagent/subprocess contexts. - Routes large or untrusted context (diffs, file contents, specs, tool output) through a written file piped over stdin so backticks,
$, and quotes are never shell-interpreted. - Defines recovery paths for every failure mode: 600s force-backgrounding, hard kill (exit 143), and runs that exit 0 while asking for authorization — capture the
session id,resume, or recover the ID from~/.codex/sessions/.../rollout-*.jsonl. - Adds guidance on
--sandboxmode selection, absolute randomized-ooutput paths, XML-tagged prompt shaping, and parallelspawn_agent/wait_agentfan-out.
Who it's for
- Developers running both Claude Code and the OpenAI codex CLI who want to offload heavy analysis or implementation.
- Anyone building multi-agent pipelines with parallel sub-agents.
- Anyone repeatedly bitten by codex exec hanging or returning empty output.
Example uses
- "Have codex analyze this repo's auth flow" → runs with
--sandbox read-onlyand returns a grounded report. - Reviewing a long diff: write the diff to a file and pipe it (
cat context.txt | codex exec ...) so nothing is interpreted on the way in. - A run that blows past the 10-minute ceiling gets force-backgrounded — re-read the output file once the task notification fires, or
resume <session-id>if it was hard-killed.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/tobihagemann/turbo/HEAD/claude/skills/codex-exec/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the claude/skills/codex-exec folder from the GitHub repo tobihagemann/turbo into my ~/.claude/skills/codex-exec/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/tobihagemann/turbo.git && mkdir -p ~/.claude/skills && cp -r turbo/claude/skills/codex-exec ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Make sure the OpenAI codex CLI is installed and authenticated: run
codex --version. - Clone the repo:
git clone https://github.com/tobihagemann/turbo.git - Create the skills directory:
mkdir -p ~/.claude/skills - Copy the skill in:
cp -r turbo/claude/skills/codex-exec ~/.claude/skills/ - Verify that
references/parallel-execution.mdcame along with it. - Restart Claude Code and try a trigger phrase like "run codex exec to analyze this file".
- Note: this skill requires disabling the Bash sandbox for every codex call — use it only in project directories you trust.
View source on GitHub ↗License: MIT