A Claude Code skill that lets Claude invoke OpenAI Codex for second opinions on code.
-
Ensure you have Node.js 18+
node --version # Should be 18.x or higher -
Set your OpenAI API key
export OPENAI_API_KEY="your-key-here"
Or add to your shell profile (~/.zshrc, ~/.bashrc):
echo 'export OPENAI_API_KEY="your-key-here"' >> ~/.zshrc
-
Install dependencies
cd ~/.claude/skills/codex-orchestrator npm install
Once set up, just ask Claude Code to use Codex:
- "Write a function to parse CSV, then have codex review it"
- "Use codex to double check this code for bugs"
- "Get codex's opinion on my implementation"
Claude Code will automatically invoke the skill when you mention Codex or ask for a second opinion.
Test the script directly:
cd ~/.claude/skills/codex-orchestrator
# Simple test
echo '{"action":"new","prompt":"What is 2+2?"}' | npx tsx scripts/codex.ts
# Code review test
echo '{"action":"new","prompt":"Review this: function add(a,b){return a+b}"}' | npx tsx scripts/codex.tsSKILL.md- Instructions for Claude Codescripts/codex.ts- Main orchestration scriptscripts/state.json- Thread persistence (auto-created)package.json- Dependencies
"OPENAI_API_KEY not set"
- Make sure you've exported the key in your current shell
- Verify with:
echo $OPENAI_API_KEY
"Cannot find module @openai/codex-sdk"
- Run
npm installin this directory
Script hangs
- Check your internet connection
- Codex may take a few seconds to respond
Each Codex invocation uses your OpenAI API credits. Monitor usage at https://platform.openai.com/usage