/codex-plus:codex-plusfrom codex-plus
Executes tasks via OpenAI Codex CLI with model selection, reasoning effort configuration, and session management. Handles image generation and goal definition workflows.
Ships in codex-plus. 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.
Read references/run-brief.md before writing the prompt file: the role every prompt declares, what a prompt judging a decision carries, and how the model is chosen.
a3f9, timestamp fragment, or task keyword) for this invocation<scratchpad>/codex_prompt_<suffix>.txt using the Write tool — <scratchpad> is the session's scratchpad directory, the /private/tmp/…/scratchpad path announced in the system prompt; writes there run without permission prompts. When no scratchpad directory is announced, fall back to /private/tmp.${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.sh [options] <scratchpad>/codex_prompt_<suffix>.txtWhen the delegated task is image generation or image editing:
$imagegen in the prompt so downstream clients treat it as an explicit image-generation request.image_gen tool, whose only parameters are prompt, referenced_image_paths, num_last_images_to_include and transparent_background. The image model is chosen server-side and not reported, so a model, quality or output format named in the prompt never reaches the call. Carry size, layout, exact text, style and transparency as words in the prompt. For an edit, the prompt names each input image by its absolute path for referenced_image_paths; a relative path fails the call.$CODEX_HOME/generated_images/<session-id>/. When the caller needs the file, the prompt tells codex to copy it into the -C directory.quality, complexity, SVG or GIF output and markup edits live only on the Images API. Where the model has to be the one named, the prompt asks the imagegen skill for CLI mode with --model <slug> (any gpt-image-* slug, 2.6 included) and has it run the script as uv run --with openai python3 …/scripts/image_gen.py, since the openai SDK is not installed alongside it; OPENAI_API_KEY must be exported into the wrapper's environment, which codex passes through to the command. The script takes quality low|medium|high|auto and none of the other controls.When the delegated task is to define, create, or refine a Codex goal — a goal-backed run, an objective with success criteria:
$define-goal in the prompt so codex shapes the objective with the define-goal skill and sets it through its own goal tools (get_goal, create_goal), which codex exec exposes while the goals feature is on (codex features list).define-goal is a curated skill, not bundled: when it is absent from $CODEX_HOME/skills, install it once with codex's bundled skill-installer — $CODEX_HOME/skills/.system/skill-installer/scripts/install-skill-from-github.py --repo openai/skills --path skills/.curated/define-goal — and it is available from the next run.Choose the model and effort. Whatever the caller named upstream — a model, an effort, a service tier, several models at once — IS the answer: pass it through and do not re-ask it. Otherwise take the model and effort references/run-brief.md § Choosing the model and effort names.
What a choice may name:
codex debug models lists.low, medium, high, xhigh, max, ultra. ultra is maximum reasoning with automatic task delegation, as the model catalog describes it. A model's ladder may stop short of the top — gpt-6-luna's ends at max — and a parallel run needs an effort every model in it takes; codex debug models reports each model's ladder.-f, under the caveat in the Quick Reference.Select sandbox mode. Omitting -s gives workspace-write with network access — codex offers no network under read-only at all, so this is the only mode short of full access that has any. Pass -s read-only when a run must neither touch the tree nor reach off-machine; -s danger-full-access only when it must write outside the workspace. Because the default already permits writes, what bounds a run that is meant to only read is the role its prompt declares — state it.
Write the prompt per references/run-brief.md to <scratchpad>/codex_prompt_<suffix>.txt.
Delegate execution to a Bash subagent (Task tool) — never run codex-run.sh directly in the main session. This keeps codex's verbose banner and full output out of the main context. Give the subagent:
${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.sh [options] <scratchpad>/codex_prompt_<suffix>.txt with -m MODEL / -r EFFORT / -s SANDBOX / -C DIR, or -S <SESSION_ID> to resume.session id: <uuid> to stderr; the subagent extracts that line verbatim and returns it as SESSION_ID: <uuid>. The wrapper does no parsing — stderr is left unsuppressed precisely so the subagent can read the session id and any failure straight from the output.-m. Each returns its own SESSION_ID.Record each returned SESSION_ID against its purpose/model. This {purpose → SESSION_ID} map is the only resume handle.
Resume: write new instructions to a fresh <scratchpad>/codex_prompt_<suffix>.txt, then delegate to a Bash subagent running ${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.sh -S <SESSION_ID> <scratchpad>/codex_prompt_<suffix>.txt. Resume is always by explicit id, which stays deterministic under parallel sessions. A resumed turn inherits none of the session's settings — pass -m, -r, -C and -f again to stay where the session was. Omit -m/-r and the wrapper passes its own fallback, gpt-6.2-astra at medium, so a resumed run started on another model silently moves to gpt-6.2-astra; omit -C and the turn runs wherever the subagent happens to be, re-resolving every pointer against that tree. -s has no effect on resume: codex exec resume takes no sandbox option, and the turn runs under the sandbox_mode of the codex config in force at resume time, not the -s the session was created with.
Summarize each outcome to the user; for parallel work, surface which SESSION_ID maps to which branch. Inform the user: "Resume anytime with 'codex resume'."
Each command below runs inside a Bash subagent, which returns the outcome summary plus the session id: <uuid> line as SESSION_ID: <uuid>.
Base patterns:
${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.sh -m MODEL <scratchpad>/codex_prompt_<suffix>.txt (the default sandbox: workspace-write, network on — it applies edits without prompting, because codex exec is headless and has no approval step to opt out of)${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.sh -s read-only <scratchpad>/codex_prompt_<suffix>.txt${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.sh -s danger-full-access <scratchpad>/codex_prompt_<suffix>.txt${CLAUDE_PLUGIN_ROOT}/scripts/codex-run.sh -S <SESSION_ID> -m <SAME_MODEL> -r <SAME_EFFORT> <scratchpad>/codex_prompt_<suffix>.txt; the explicit id is the resume path, deterministic under parallel sessions.Modifiers, added to any base pattern above:
-C <DIR>; pass it again on resume (step 6)-m MODEL, -r EFFORT (omitted, the wrapper falls back to gpt-6.2-astra at medium); pass both again on resume (step 6)-f; a request rather than a guarantee, since codex drops the tier without an error where the model does not carry it (codex debug models lists what each one has). Pass it again on resume (step 6)-o <FILE> writes codex's final message to FILE deterministicallycodex --version or a codex exec command exits non-zero; request direction before retrying.
When the failure is codex's login — a 401, refresh_token_reused, or no login — and the user takes up signing in again, read references/auth.md for how the re-login proceeds.-s danger-full-access, ask the user for permission using AskUserQuestion unless it was already given. --skip-git-repo-check is not a choice you make: the wrapper passes it on every run, because a prompt file in a scratchpad is routinely outside any repository.Read the prompting guide before writing a prompt for a gpt-6 model, and again whenever a run came back having stopped early or asked a question instead of deciding.
File: references/gpt-6.2_prompting_guide.md
That file keeps only what changes for an unattended codex exec run. For the rest of
prompting GPT-6.2 — its best practices and migration notes — read OpenAI's
guide itself: https://developers.openai.com/api/docs/guides/latest-model
references/computer-use.md and pass it to the child prompt. Select the entry
point from that child's actual tools and returned runtime documentation.references/computer-use-troubleshooting.md.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jongwony/cc-plugin --plugin codex-plusOther plugins' skills for the same job