/claude-resources:codex-2ndfrom claude-resources
Gets a second opinion from OpenAI Codex CLI on plans, approaches, or codebase explorations. Useful during planning workflows for independent review.
Ships in claude-resources. 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.
Get a second opinion from the codex plugin companion script on a plan, approach, or codebase exploration. Codex reads workspace files and does web research to provide an independent perspective.
The codex plugin provides a companion script for running tasks. Resolve it dynamically:
CODEX_PLUGIN_ROOT=$(command ls -d "$HOME/.claude/plugins/cache/openai-codex/codex"/*/ 2>/dev/null | sort -V | tail -1)
CODEX_COMPANION="${CODEX_PLUGIN_ROOT}scripts/codex-companion.mjs"
If the file does not exist, report "Codex plugin not installed — skipping second opinion" and continue without it.
Usage for second opinion tasks:
node "$CODEX_COMPANION" task -- "<prompt>"
The -- is load-bearing — do not remove it. codex-companion.mjs shell-splits the prompt back into tokens when it is the only argument (normalizeArgv), and then reads any token starting with - as an option: a prompt merely mentioning -m sets --model to the next word and drops both from the text the model sees. -- stops option parsing and keeps the prompt one argument.
The task command runs Codex in read-only mode by default (no --write flag).
Before doing anything, check if Codex is currently rate-limited:
RATE_CHECK=$(node $HOME/.claude/scripts/codex-rate-limit.js check 2>&1)
RATE_EXIT=$?
If RATE_EXIT is non-zero (rate-limited), consider a disclosed Opus fallback for bounded work under model policy (see Step 5 Fallback). Record the reason and actual reviewer; unavailable strict/high-risk review stops the affected task.
Construct a prompt that includes:
You are reviewing a development plan. Provide a second opinion.
## Context
<what the project is, what repo we're in>
## Current Plan
<the plan or approach being considered>
## Questions
1. Are there any risks, edge cases, or issues with this approach?
2. Is there a simpler or better alternative?
3. Are there any files or areas of the codebase that should be considered but aren't mentioned?
4. Any other suggestions or concerns?
Be concise and practical. Focus on actionable feedback. If the plan looks solid, say so briefly — don't invent problems.
MUST run in the background. Call the Bash tool with
run_in_background: true. The Bash tool's foreground timeout is capped at 600000 ms (10 minutes) — a largertimeoutargument is silently clamped, so a foreground run is SIGKILLed at 10 minutes no matter whatgtimeoutis set to, leaving a 0-byte output file and an orphanedcodex-companion.mjsprocess. Backgrounded commands are not subject to that cap.After launching, wait for the task-completion notification (or poll the output file), then continue at Step 3. If a foreground run was started by mistake and got killed, clean up the orphan before retrying:
pkill -f 'codex-companion.mjs'
LOGDIR=$(node $HOME/.claude/scripts/get-logdir.js)
mkdir -p "$LOGDIR"
DATETIME=$(date +%Y%m%d_%H%M%S)
# Resolve codex companion script
CODEX_PLUGIN_ROOT=$(command ls -d "$HOME/.claude/plugins/cache/openai-codex/codex"/*/ 2>/dev/null | sort -V | tail -1)
CODEX_COMPANION="${CODEX_PLUGIN_ROOT}scripts/codex-companion.mjs"
# Detect timeout command (gtimeout on macOS via coreutils, timeout on Linux/WSL)
if command -v gtimeout &>/dev/null; then
TIMEOUT_CMD="gtimeout"
elif command -v timeout &>/dev/null; then
TIMEOUT_CMD="timeout"
else
TIMEOUT_CMD=""
echo "WARNING: neither gtimeout nor timeout found. Running without timeout."
fi
bash $HOME/.claude/scripts/codex-guard.sh --wait 300 -- \
${TIMEOUT_CMD:+$TIMEOUT_CMD} ${TIMEOUT_CMD:+1800} node "$CODEX_COMPANION" task -- \
"<prompt>" \
> "$LOGDIR/${DATETIME}-codex-2nd.md" \
2>"$LOGDIR/${DATETIME}-codex-2nd-stderr.log"
Long prompts: write the prompt to a file first and pass it as
PROMPT=$(cat <prompt-file>) … task -- "$PROMPT", rather than inlining a multi-hundred-line
heredoc into the command.
Timeout: 30 minutes (1800s), enforced by gtimeout/timeout inside a backgrounded
Bash call.
Check for rate limiting in output files:
node $HOME/.claude/scripts/codex-rate-limit.js check-output \
"$LOGDIR/${DATETIME}-codex-2nd.md" \
"$LOGDIR/${DATETIME}-codex-2nd-stderr.log"
If rate limit detected, jump to Step 5 Fallback (Opus second opinion).
Read the output file
If empty or missing, check stderr log for errors
If codex timed out or failed, jump to Step 5 Fallback
Return the codex feedback to the caller. The caller decides whether to incorporate it into the plan.
If codex was rate-limited, timed out, or produced no usable output, consider a disclosed Opus fallback for bounded work under model policy. Only after an acceptable bounded fallback is selected and disclosed, spawn one general-purpose subagent with model: opus to give the same second opinion the codex prompt would have produced. Record whether advisory feedback was actually obtained.
Agent tool:
description: "Opus 2nd opinion (codex fallback)"
subagent_type: "general-purpose"
model: "opus"
prompt: <same second-opinion prompt that would have gone to codex — plan/context + the standard questions>
Return the feedback with actual reviewer provenance and the fallback reason. Do not claim cross-provider review occurred; strict requirements or unresolved high-risk work stop/report when unavailable.
gtimeout/timeoutrun_in_background: true). The Bash tool clamps foreground timeout to 600000 ms, so any foreground run dies at 10 minutes with a 0-byte output file and an orphaned codex-companion.mjsmodel: opus — the caller gets a second opinion only when an acceptable disclosed fallback is available. Opus is the designated Claude-side stand-in for codex throughout these skillsThese skills call /codex-2nd during their planning phase:
/codex-2nd with the updated plan (up to 3 iterations total)~ in paths — use $HOMEWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub takazudo/claude-resources --plugin claude-resources84 skills in this plugin
/bambu-3mfCreate/edit Bambu Studio 3MF projects from a saved printer template. Use for Bambu/H2D printable parts, plate arrangement, 3MF revisions, or print settings, even when the input is STL/STEP./big-planPlan work as one epic plus child GitHub issues, with review and verification. Use for /big-plan, implementation planning/decomposition, UI brainstorming that should end in a plan (-pr), or issue sweeps (-is/-isask)./cclogsLoad recent prototypes, plans, logs and artifacts from the repo-scoped cclogs dir to continue earlier work. Use for /cclogs, or whenever the user refers to a prior session's prototype/plan/report as if it exists./claudemd-refactorRefactor CLAUDE.md files: analyze the setup and split a large root CLAUDE.md into directory-scoped files. Use for 'refactor/split/organize CLAUDE.md' or when the root CLAUDE.md is too large./claude-resources-sharePublish ~/.claude resources (skills, commands, hooks, scripts, CLAUDE.md) to the public claude-resources mirror. Use for 'share claude resource', 'sync settings', or 'export to claude-resources'./cleanup-resourcesEnd-of-workflow audit of touched GitHub issues, PRs and branches (close/keep/delete) plus a sweep of stale build temp dirs. Use after /big-plan, /x-as-pr, /x-wt-teams, or for 'cleanup resources' / 'clean disk'.Other plugins' skills for the same job