Sep 16, 2026
Give Claude Code an Automatic Codex Second Opinion on Every Plan
A 182-star skill that hooks Claude Code's ExitPlanMode so OpenAI Codex reviews every plan — architecture decisions and implementation approaches included — before you approve.
When Claude Code finishes a plan, the only reviewer between that plan and your codebase is you. The 182-star cathrynlavery/codex-skill inserts a second reviewer: every time Claude exits plan mode, OpenAI Codex reads the plan and comments before you approve.
Why This Skill Matters
The skill's pitch is "two AIs checking each other's work catches more edge cases". The README's automatic-review list has three triggers: every plan Claude creates (via hook), architecture decisions, and implementation approaches. Manual use covers researching unfamiliar APIs or libraries, verifying complex code patterns, and getting alternative perspectives.
Codex reviews for four things: potential issues or risks, missing steps, better alternatives, and edge cases not addressed. The output lands in your terminal before you make the approve-or-revise call, so the second opinion arrives exactly when it can still change the plan.
Installation
First install the Codex CLI and configure your OpenAI API key:
npm install -g @openai/codex
The recommended path is the plugin install, which auto-registers both the /codex skill and the automatic plan review hook:
claude plugin marketplace add cathrynlavery/codex-skill
claude plugin install codex-skill@codex-skill
For manual installation, clone the repo, copy the skill and the hook script, and wire the hook into settings:
git clone https://github.com/cathrynlavery/codex-skill.git
mkdir -p ~/.claude/skills/codex
cp codex-skill/skills/codex/SKILL.md ~/.claude/skills/codex/
mkdir -p ~/.claude/hooks
cp codex-skill/hooks/plan-review.sh ~/.claude/hooks/
chmod +x ~/.claude/hooks/plan-review.sh
Then add the hook registration to ~/.claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "ExitPlanMode",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/plan-review.sh",
"timeout": 120
}
]
}
]
}
}
How the Automatic Review Works
The hook intercepts ExitPlanMode and reads the plan from tool_response.plan — the field where Claude Code stores the plan content — with fallbacks to tool_response.filePath and filesystem search. It passes the plan to Codex and displays the result before you approve. A typical result looks like the README's example:
CODEX SECOND OPINION ON PLAN
LGTM - Plan covers the main implementation steps.
Minor suggestions:
- Consider adding error handling for the API timeout case
- Step 3 could be split into separate DB migration and code changes
Real Workflow: Ask for a Second Opinion Manually
Invoke the skill directly with /codex, or just ask Claude:
Can you verify this approach with Codex?
Get a second opinion on this architecture
Model choice is a knob worth turning. Automatic plan reviews do not pin a model; they inherit your configured Codex default. For the hardest questions — novel architecture, deep analysis, or security review — the README says to explicitly select gpt-6-astra with high or greater reasoning effort. For trivial fact checks, select gpt-5.6-luna. The lineup also includes gpt-5.6-sol and gpt-5.6-terra (medium default effort) and gpt-5.5 (xhigh default); supported effort ranges top out at ultra — max for gpt-5.6-luna, xhigh for gpt-5.5.
Tips
- If the hook does not fire, check that Codex is installed and on your PATH (
codex --version) — the hook exits silently on errors to avoid blocking your workflow, so failures are quiet by design. - "No plan content found" usually means an outdated Claude Code — the
tool_response.planfield needs a current version to populate. - The hook timeout is 120 seconds in the documented settings; long reviews on big plans run against that ceiling.
When Not to Use This
The whole loop depends on the Codex CLI and an OpenAI API key — if either is absent, there is no second opinion. If you deliberately want one model's judgment without a second provider in the loop, skip the hook and keep manual /codex for the occasions you ask for it. And on plans you already intend to reject and rewrite, waiting on a review adds a step before the decision you have already made.
See the leaderboard for more skills.