/external-agents:codex [run <prompt>|review --base <ref>|status [<job>]|result <job>|cancel <job>|update]from external-agents
Delegates tasks, investigations, or code reviews to OpenAI's Codex CLI as a background job and retrieves results. Supports run, review, status, result, cancel, and update actions.
Ships in external-agents. 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.
Arguments. [run <prompt>|review --base <ref>|status [<job>]|result <job>|cancel <job>|update].
A bare request that is not one of the other actions is run.
This skill drives the plugin's external-agents command, which is on the Bash PATH while the
plugin is enabled. The command is the only thing that starts Codex; never call codex yourself,
and never look up the plugin's install path. Delegate only when the user asks for Codex.
| Action | Command | Read |
|---|---|---|
run (default): a task (may write) or an investigation (read-only) | external-agents run codex --use task|investigate [--add-dir <dir>]... --prompt-file <file> | reference/run.md |
review: Codex reviews this branch, read-only | external-agents review codex --base <ref> [--brief-file <file>] | reference/run.md |
status, result, cancel | external-agents status [<job>], result <job>, cancel <job> | reference/jobs.md |
update: readiness, CLI facts, version and routing check | external-agents update codex | reference/update.md |
| Choosing a model or effort | --model, --effort for one run; config keys otherwise | reference/routing.md |
Mode: <mode> (<use>), taken from the job, never from what was asked: the
mode: line of external-agents status <job> (the job id is the job: <id> line on stderr).
A review is always Mode: read-only (review). When the mode ceiling lowered a write request, say
so and name the config key the notice names. When the run passed --model or --effort, add
the model: and effort: lines from the same status output and why they were chosen.scripts/lib/runner.mjs:12): 0 ok, 1 failed, 2 usage or refused, 3 blocked
by the mode, 4 Codex unavailable or skipped. On 1, 2 or 4, report the first line and the
CLI's error and stop: never do the task yourself in Codex's place. On 4, point the user to
external-agents update codex.Write the prompt with the Write tool to a file in a gitignored scratch folder (this repository's
convention, else the session scratchpad) and pass it with --prompt-file; the command keeps its
own copy in the job folder. Name the files and paths Codex should read; never paste file contents,
diffs or logs into the prompt. Codex reads them itself inside its sandbox.
Before a write task, list every directory outside the worktree it will write, pass each with
--add-dir and name them in the prompt; pass none when the worktree is enough
(reference/run.md).
Run every run and review with the Bash tool's run_in_background: a run can last up to
codex.timeout_seconds, longer than a foreground Bash call may wait, and a call cut off by its own
timeout leaves the job without its result. You are notified when it exits, so do not poll. The job id prints only at the end, so while it runs, find it with bare
external-agents status. Stop a run with external-agents cancel <job>, which stops Codex's whole
process tree; stopping the background Bash task alone may leave Codex running.
/review:council for a ranked, multi-reviewer review of the same change, with Codex as one member.
blocked-by-mode is not success. The command records a run blocked-by-mode, exits 3,
and still prints the final message whenever the sandbox refused a command, whatever Codex's own
exit was; that message may describe work that never happened. Say the run was blocked, give the
blocked count and commands from the first line, and never report the task done.ran. codex: ran (...) with a blocked-commands
part means Codex tried something the read-only sandbox refused; the findings stand, and the
blocked part is worth one line in the reply.notice: when the reviewed change touches .codex/;
relay that notice.--mode write on a use whose configured mode is
read-only runs read-only; the notice names codex.uses.<use>.mode. Only the user changes that
key, in <home>/external-agents.yaml or .local.yaml.external-agents update codex closes it once Codex is
logged in again; do not retry the run in a loop.codex.binary_path is read only from an untracked personal file
(<home>/external-agents.local.yaml, absolute path, file named codex, or codex.exe, .cmd or .bat on Windows). Set anywhere else, it
is ignored with a notice: config: line; relay that notice rather than working around it.CLAUDE_PLUGIN_DATA. A notice: saying another plugin's CLAUDE_PLUGIN_DATA is not used is
expected. A checkout that is not installed refuses to run until CLAUDE_PLUGIN_DATA names a
directory starting with external-agents- (see the plugin README's Job files section).update captured (its cli facts: line), not this skill and not memory.What SKILL.md sets; muted values are Claude Code's defaults
bash2 skills in this plugin
npx claudepluginhub melodic-software/claude-code-plugins --plugin external-agentsOther plugins' skills for the same job