/agents-bridge:codex <prompt>from agents-bridge
Bridges Claude Code with OpenAI Codex CLI for cross-model collaboration, delegation, and second opinions on code tasks.
Ships in agents-bridge. 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.
None: SKILL.md is the whole skill.
Every Codex call goes through codex-run.ts, which owns the invocation: a
private run directory, the resolved settings in run.json, one directory per
turn, a detached supervisor that outlives the Bash call, and resume on the same
thread with the same settings. Pass the user's request through; do not call the
codex CLI directly.
<codex_models>
!"${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.ts" models
</codex_models>
Without --role or -m, the run uses the codex configuration default. Pick a
role when the work calls for a tier; pass -m <slug> only when the user names
a model, with a slug from the list above.
gpt-daybreak-blue-latest is served only to a Codex session that codex login
opened with the user's hardware key: a run on a session logged in by password
or Google fails with "this session was not authenticated with one of your
authorized hardware keys". The user re-runs codex login, cancels a password
manager's passkey prompt if one appears, and picks the USB security key in the
browser's own dialog (PIN, then touch). Nothing on the agent's side fixes it.
| Work | Role |
|---|---|
| Implementation, debugging, judgment on code | coding |
| Review, audit, security, hard reasoning | audit |
| Tests, gates, research, bounded mechanical work | bounded |
--effort <level> overrides the role's effort; it must appear in that model's
efforts: list. codex-run.ts checks both against the catalog and refuses an
unknown pair with exit 2.
Create the run directory. Use the printed path literally in every later step: shell variables do not survive between Bash calls.
"${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.ts" new codex
Write the task for Codex to <dir>/prompt.md with the Write tool, as an
instruction addressed to Codex: the user's request verbatim, minus the parts
addressed to you (which model, role or effort to use, how to report back to
the user). Codex reads "ask Codex to…" as an order to run the codex CLI. The
prompt never goes on the command line.
Start the turn from the repository Codex works in (-C <dir> otherwise):
"${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.ts" start <dir> --prompt-file <dir>/prompt.md
Add --role <role>, -m <slug> or --effort <level> as above. Add
--skip-git-repo-check only when -C points outside a git repository.
Run each codex-run.ts command alone, as written: a ;, && or
echo $? added to it asks for permission. The envelope's status already
gives the exit code.
The first stdout line is a JSON envelope (status, thread_id, model,
effort, mode, blocked, error, final_message_file). Once the turn is
over, a --- final message --- line follows, then Codex's answer. The exit
code carries the status:
| Exit | Status | Next step |
|---|---|---|
| 0 | completed | Relay the answer, then check its claims before acting on them |
| 1 | failed | Report error; do not retry blindly |
| 2 | usage error | Fix the command from the message on stderr |
| 10 | running | Run wait <dir> again; the turn goes on without you |
| 11 | blocked | See "Blocked actions" below |
| 124 | deadline | The turn hit --deadline (default 2 h) and was interrupted |
| 130 | cancelled | The turn was cancelled |
start and resume wait up to 540 s, under the 600 s Bash cap. A longer turn
returns 10 and keeps running; pick it up with:
"${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.ts" wait <dir>
status <dir> reads the envelope without waiting and exits 0. cancel <dir>
interrupts the turn. --wait 0 returns at once, so you can work in parallel
and call wait later.
Runs are read-only by default: review, debugging, architecture and questions
never touch the workspace. When the user asks Codex to change files, add
--mode write. Codex then works in its workspace-write sandbox under its own
auto-review, which judges every request to go beyond the sandbox, and its
answer comes back as the answer of a JSON object, with denied actions listed
apart. Add --git-write only when Codex must stage or commit: it grants the
repository's git directories, which the sandbox otherwise keeps read-only.
Exit 11 means an action stayed blocked. Each item of blocked gives the
action, its cwd, the rationale and the cause (review_denial or
sandbox_failure). You take the human's place on each item:
danger-full-access, bypass flags) to get past a
denial.A follow-up that builds on the turn (iterate on findings, push back, fix and confirm) resumes the thread, so Codex keeps what it already read. Write the follow-up to a new file in the run directory, then:
"${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.ts" resume <dir> --prompt-file <dir>/followup-2.md
Resume replays the model, effort, mode, cwd and writable roots recorded in
run.json; only --effort, --output-schema, --deadline and --wait can
change per turn. Each turn keeps its own files under <dir>/turn-<n>/. The
allowed-tools grant covers the invoking turn only, so a follow-up in a later
turn may prompt.
--output-schema <file> makes Codex answer as JSON matching that schema; the
final message is the JSON, formatted. The schema applies to that turn only.
The Agent and Workflow model parameter takes Claude models only, so route
Codex through a wrapper agent: a sonnet/low agent that writes the prompt, runs
codex-run.ts as above and returns the answer. The wrapper does no reasoning.
Label the agent with the Codex model it runs, since the UI shows the wrapper's
Claude model. Parallel write runs need isolation: 'worktree'.
A second opinion (code review, debugging, architecture) on a prompt or on
conversation context that never hit disk, or work delegated to Codex. For
local git changes, uncommitted work or a branch against its base, use
/agents-bridge:adversarial-review, which reads the diff directly.
Keep runs bounded: low or medium effort for quick probes; high effort plus
a docs MCP can rabbit-hole. To stop a runaway turn, cancel <dir>.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
6 skills in this plugin
/adversarial-reviewAdversarial review by Codex (OpenAI) of local git changes, either the uncommitted work or the current branch against a base ref, with optional focus text. Codex runs read-only; each finding names a file, a line range and a concrete fix, and the review ends with a SHIP or NO-SHIP verdict. Use when the user asks Codex to review, challenge or attack their uncommitted changes, their diff or their branch before shipping./codex-orchestrateClaude Code only. Use when the user explicitly invokes /agents-bridge:codex-orchestrate (or /codex-orchestrate) in Claude Code or asks Claude to orchestrate a large multi-slice plan by delegating implementation to the Codex CLI through agents-bridge. In native Codex, use $slice-runner instead./npx claudepluginhub bengous/claude-code-plugins --plugin agents-bridge