By ehzawad
Get a second opinion from OpenAI Codex on your work inside Claude Code.
A Claude Code plugin that gets a second opinion from OpenAI's Codex CLI on your work.
claude in terminal)codex in terminal)Both must be logged in and working in your terminal before using this plugin.
claude plugins marketplace add ehzawad/codex-opinion
claude plugins install codex-opinion@codex-opinion
Persists across sessions — no flags needed.
git clone https://github.com/ehzawad/codex-opinion.git
claude --plugin-dir ./codex-opinion/plugins/codex-opinion
/codex-opinion:codex-opinion
With a custom instruction:
/codex-opinion:codex-opinion focus on security vulnerabilities
Claude Code also triggers the skill automatically when you ask for a second opinion in natural language — no slash command needed:
ask codex what it thinks about this diff
get a second opinion on my changes
When invoked, Claude gathers your diff, plan, or context and pipes it to codex exec. Codex uses your configured model and settings from ~/.codex/config.toml, reads the codebase, runs commands, and does deep analysis. Claude reads the response and reports back.
sequenceDiagram
participant U as User
participant C as Claude Code
participant S as ask_codex.py
participant X as Codex CLI
U->>C: /codex-opinion:codex-opinion
C->>C: Gather diff / plan / context
C->>S: Pipe context via stdin
S->>X: codex exec --json
X-->>S: JSONL events
S->>S: Extract final message
S-->>C: Codex's analysis via stdout
C-->>U: Reports findings
One Codex session per project, stored at ~/.local/state/codex-opinion/{project-hash}.json. Follow-up calls resume the prior Codex thread so it builds on its accumulated codebase knowledge — across Claude Code sessions, not just within one.
If the session has expired server-side, the script logs a notice and starts fresh.
flowchart TD
A[Invoke /codex-opinion:codex-opinion] --> B{Session file exists<br/>for this project?}
B -- Yes --> C[codex exec resume session_id]
C --> D{Resume succeeded?}
D -- Yes --> E[Extract response]
D -- No --> F["Log: session could not be resumed"]
F --> G[Start fresh session]
B -- No --> G
G --> H[Save session metadata]
H --> E
E --> I[Return to Claude]
The script communicates with codex exec --json via JSONL events on stdout:
sequenceDiagram
participant S as ask_codex.py
participant X as Codex CLI
X->>S: {"type": "thread.started", "thread_id": "UUID"}
Note over S: Captures session ID
X->>S: {"type": "turn.started"}
X->>S: {"type": "item.completed", "item": {"type": "agent_message", "text": "..."}}
Note over S: Captures last agent message
X->>S: {"type": "turn.completed", "usage": {...}}
Note over S: Returns final message to Claude
Codex runs with --dangerously-bypass-approvals-and-sandbox — no approval prompts, no filesystem sandbox. This gives Codex full read/write access to your machine so it can thoroughly inspect and analyze the codebase. Do not use this plugin on untrusted repositories or with untrusted input.
The script uses your Codex CLI defaults — model, reasoning effort, and other settings come from ~/.codex/config.toml. No model is hardcoded. Sandbox and approval settings are overridden by the plugin (see Security above).
MIT
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub ehzawad/codex-opinion --plugin codex-opinionMulti-perspective parallel Codex review — N sub-agents in parallel, each framed with a role you decide per call.
Double-check layer for the Official Codex plugin — wraps every Codex interaction with Claude's independent critical evaluation. Review, adversarial, rescue, verify, research.
Claude Code skill to delegate prompts to OpenAI Codex CLI for code analysis, refactoring, code review, and automated editing
OpenAI Codex CLI integration with MCP server and skills for plan review, code review, and codebase analysis
Give Claude Code a second opinion using OpenAI Codex - automatic plan review via hooks
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.