/ask-codex:ask-codexfrom ask-codex
Invokes OpenAI Codex (headless `codex exec`) for an independent review of design docs, specs, diffs, or code, then reconciles findings with your own view. Handles codex invocation details (stdin, sandbox, timeout).
Ships in ask-codex. 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; scripts run unread.
Ask a different model to critique an artifact, then report where it and you agree, disagree, and what changed your mind. The value is independence: codex has none of this conversation's context, so it catches assumptions you and the user share without noticing.
This skill handles the codex invocation details (closed stdin, read-only sandbox, timeout) that otherwise hang or misbehave.
Do NOT use for generic requests for a second opinion, outside review, sanity check, or another model; handle those yourself or ask which reviewer they want.
Always go through the bundled script; never call codex exec directly.
scripts/ask-codex.sh [-m MODEL] [-e EFFORT] [-t SECONDS] [-C DIR] PROMPT_FILE
(scripts/ is relative to this skill's directory.)
The script exists because headless codex has sharp edges:
codex exec reads stdin until EOF whenever stdin is not a TTY. From an
agent's Bash tool that means it blocks forever. The script redirects
</dev/null; codex prints "Reading additional input from stdin...", sees
EOF, and proceeds.-o FILE to capture only the final message and discards the
rest; stderr is shown only on failure.-s read-only so a
reviewer can read the repo but cannot modify it, and --ephemeral so no
session file is left behind.timeout on macOS. The script bounds the run with perl alarm
(default 600s). Set the Bash tool's own timeout at least as high.Write the prompt to a file in the scratchpad directory and pass the path. A long prompt on the command line is fragile (quoting, ARG_MAX).
-C DIR sets codex's working root; default is the current directory. Codex
resolves relative paths in the prompt against it and can read any file
under it, so point it at the repo root when the artifact references
other files.
-m MODEL and -e EFFORT (reasoning effort, e.g. low, medium,
high) override the user's codex config (~/.codex/config.toml). Omit
both unless the user asks for a specific model or effort; their configured
defaults are deliberate.
Codex starts cold. The prompt is the whole briefing. Include:
git diff ... > scratch/change.diff and name
that file. For code, name the files and the entry points; do not make it
guess where to look.docs/PRD.md) rather than paraphrasing a long one.-C on the repo).Example prompt file:
You are an independent reviewer giving a second opinion. Be direct and
specific. Skip praise and summary; only report problems and alternatives.
Artifact: docs/milestones/05-usage/design.md (read it). Context: docs/PRD.md
sections FR-9 and FR-10 state the requirements. Fixed constraints: Go
backend, MongoDB, single container; per-user visibility is enforced in the
API layer, never in the database. Decided and out of scope: the choice to
store usage records outside the deleteAccountData cascade.
Questions:
1. Does the aggregation design bound memory as the collection grows?
2. Are there race conditions between the background job and live writes?
3. What is the simplest design that meets FR-9 and FR-10, if not this one?
4. Could someone who knows the PRD but not the code follow each
decision and judge it? Quote any that only make sense with the code
open. Flag any claim about the current code that the repo contradicts.
Output: up to 8 findings ranked by severity. For each: severity, section,
problem, concrete suggestion, confidence (high/med/low). Mark each as
"defect" or "preference".
Tell the user you are about to consult codex and what you will ask; a one-line summary is enough. Do not paste the whole prompt unless they ask. Runs take one to several minutes and consume their OpenAI quota.
Do not relay codex's output verbatim. You are the one with the conversation context, so reconcile:
Keep codex's severities and locations so the user can trace each item. If the user wants the raw output, the script printed it to stdout; save it to the scratchpad first when the run is long so you can quote it later.
codex login),
a model name codex does not know, or the timeout. Report the stderr tail;
do not retry blindly.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
codex-review, independent-review, design-review, code-review
npx claudepluginhub xdg/xdg-claude --plugin ask-codexOther plugins' skills for the same job