Skip to content
codex-bridge logo

codex-bridge

Use when user wants to ask Codex, get GPT's opinion, get a second opinion from OpenAI, compare perspectives, have Codex review code or docs, or let Codex fix/refactor/implement something.

SKILL.md

Full skill instructions

Codex Bridge

Call OpenAI's Codex CLI to get responses, reviews, or perform tasks.

When to Use

Activate when user says:

  • "Ask Codex...", "Have Codex...", "Let Codex..."
  • "Get GPT's opinion on...", "What does OpenAI think..."
  • "Get a second opinion on..."
  • "Have Codex review...", "Let Codex fix/​refactor/​implement..."
  • "Compare Claude vs Codex...", "Run this through Codex..."

Quick Reference

FlagWhenExample
(none)Opinions, reviews, questions, analysisnode "$CODEX_BRIDGE" "Review this code" --working-dir "<project>"
--full-autoFix, refactor, implement, update filesnode "$CODEX_BRIDGE" "Fix errors" --full-auto --working-dir "<project>"
--model MODELOverride model (default: Codex default)node "$CODEX_BRIDGE" "Explain" --model gpt-4o --working-dir "<project>"
--jsonBridge outputs raw JSON events (debugging)node "$CODEX_BRIDGE" "Analyze" --json --working-dir "<project>"
--timeout MSOverride 20-minute default timeoutnode "$CODEX_BRIDGE" "Long task" --timeout 2400000 --working-dir "<project>"

Setup

# Resolve bridge path (one command):
CODEX_BRIDGE=$(ls -1 "$HOME/​.claude/​plugins/​cache/​saurun-marketplace/​saurun/"*/​skills/​codex-bridge/​codex-bridge.mjs 2>/​dev/​null | head -1)

CRITICAL: Always pass --working-dir with the project directory. Without it, Codex runs in its install location and can't access project files.

Decision Logic

ModeWhen
Read-only (no flags)Opinion, explanation, review, comparison, questions
--full-autoModify files. Trigger words: "fix", "refactor", "implement", "update", "change"

Handling File Reviews

When user wants Codex to review a file:

  1. Read the file content with the Read tool
  2. Include content in the prompt to Codex
node "$CODEX_BRIDGE" "Review this document for feasibility, risks, and suggestions:

---
[FILE CONTENT HERE]
---" --working-dir "/​path/​to/​project"

Response Format

For opinions/​reviews:

Codex (OpenAI) says: [response]

For comparisons: Provide your own analysis AND Codex's response, noting differences.

For file modifications: After Codex completes, show changes with git diff.

Common Mistakes

MistakeFix
Omitting --working-dirCodex can't read project files. Always pass it.
Using --full-auto for reviewsRead-only is safer for opinions. Only use --full-auto when user wants file changes.
Sending huge files as CLI argsBridge handles this automatically (writes to temp file for prompts >7000 chars).
Forgetting prerequisitesCodex CLI must be installed (npm install -g @openai/​codex) and authenticated (codex login).

Error Handling

If the bridge fails (exit code non-zero), check:

  • Codex CLI installed: which codex (install: npm install -g @openai/​codex)
  • Authentication valid: codex login
  • Working directory exists and is accessible
  • Timeout: increase with --timeout MS (default: 1,200,000ms / 20 min)