Skip to content
Back to skills

Codex

ASecurity

Delegate a task, investigation, or read-only review to OpenAI's Codex CLI as a background job (status, result, cancel, update); delegate only when asked for Codex. Use when: 'ask Codex', 'Codex review of this branch', 'resume the Codex thread'. Not for a multi-reviewer panel: /review:council.

  • 34 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 22, 2026
ai-agentsgoshellbashgit

Works with

  • cli

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add melodic-software/claude-code-plugins --skill codex --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Codex?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Codex
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/melodic-software-codex/badge)](https://www.skillsdirectory.com/skills/melodic-software-codex)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: "Delegate a task, investigation, or read-only review to OpenAI's Codex CLI as a background job (status, result, cancel, update); delegate only when asked for Codex. Use when: 'ask Codex', 'Codex review of this branch', 'resume the Codex thread'. Not for a multi-reviewer panel: /review:council."
argument-hint: "[run <prompt>|review --base <ref>|status [<job>]|result <job>|cancel <job>|update]"
user-invocable: true
disable-model-invocation: false
allowed-tools:
  - "Bash(external-agents run codex:*)"
  - "Bash(external-agents review codex:*)"
  - "Bash(external-agents status:*)"
  - "Bash(external-agents result:*)"
  - "Bash(external-agents cancel:*)"
  - "Bash(external-agents update codex:*)"
shell: bash
metadata:
  workflow-stage: implement
  summary: Hand tasks, investigations and reviews to the Codex CLI and read back its jobs
---

# Codex

**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.

## Actions

| 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](reference/run.md) |
| `review`: Codex reviews this branch, read-only | `external-agents review codex --base <ref> [--brief-file <file>]` | [reference/run.md](reference/run.md#review) |
| `status`, `result`, `cancel` | `external-agents status [<job>]`, `result <job>`, `cancel <job>` | [reference/jobs.md](reference/jobs.md) |
| `update`: readiness, CLI facts, version and routing check | `external-agents update codex` | [reference/update.md](reference/update.md) |
| Choosing a model or effort | `--model`, `--effort` for one run; config keys otherwise | [reference/routing.md](reference/routing.md) |

## Reporting a run

- **First reply line:** `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.
- Then the command's first stdout line, then Codex's final message verbatim. That message is
  Codex's answer, not yours: relay it, and add your own reading only below it, labeled as yours.
- Exit codes (`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`.

## Prompts

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. Unless the `hold_rule`
config key turns it off (`hold_rule.enabled: false`), the command opens every prompt with the hold
rule (`holdRuleFor` in [scripts/lib/runner.mjs](../../scripts/lib/runner.mjs)), naming the labels
in `hold_rule.labels`. While it is on, never ask Codex for what it forbids: hold labels, merges and
review threads stay with you.

Before a write task, list every directory it will write outside the worktree and outside the temp
directories (which the sandbox already allows), pass each with `--add-dir` and name them in the
prompt; pass none when the worktree and temp directories are enough. Codex cannot stage
or commit inside its sandbox: tell it to leave Git to you, and stage and commit after the run
([reference/run.md](reference/run.md#run)).

## Background runs

Run every `run` and `review` with the Bash tool's `run_in_background`: a run can last up to
`codex.timeout_seconds`, which can outlast a foreground Bash call (how long one may wait:
[timeout and output limits](https://code.claude.com/docs/en/tools-reference#timeout-and-output-limits)), 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.

## Next

`/review:council` for a ranked, multi-reviewer review of the same change, with Codex as one member.

## Gotchas

- **`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. Any failed
  command whose output reads like a refusal records the run `blocked-by-mode`, including one
  Codex then worked around, such as a cache write it retried under a temp directory: the command
  cannot tell the two apart. The first line names the command, not what was refused; read the
  job's `log_path` to see which write failed. When the refusals were only `git add`,
  `git commit` or cache writes, the edits may all be in place, but each refused command did not
  finish: check the edits, rerun what those commands were for, then stage and commit yourself
  ([reference/run.md](reference/run.md#run)).
- **A review can be blocked and still count as `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.
- **The ceiling is Codex's sandbox only.** What Codex config can run outside that sandbox is
  upstream's to state: read
  [Non-interactive mode § Permissions and safety](https://learn.chatgpt.com/docs/non-interactive-mode#permissions-and-safety)
  when it matters. The command prints a `notice:` when the reviewed change touches `.codex/`;
  relay that notice.
- **The mode is a ceiling, not a request.** `--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`.
- **The breaker refuses runs after an unavailable-class failure** (missing binary, logged out,
  usage limit) until the time it prints. `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.
- **Plugin data directory.** Job files, logs, the breaker and the CLI-facts cache live in this
  plugin's data directory, which the command works out for itself; never pass or set
  `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).
- **CLI flags come from the CLI.** When a question turns on what a Codex flag or subcommand does,
  read the help `update` captured (its `cli facts:` line), not this skill and not memory.

Files in this skill

  • SKILL.md6.4 KB
  • evals/evals.json2.8 KB
  • reference/jobs.md1.6 KB
  • reference/routing.md1.7 KB
  • reference/run.md2.8 KB
  • reference/update.md1.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.