Get independent code reviews from external LLM CLIs (OpenAI Codex, Google Gemini) on uncommitted changes, branch diffs, or specific commits.
Overview
The Second Opinion plugin shells out to external LLM CLIs for independent code reviews powered by separate models. It supports both OpenAI Codex CLI and Google Gemini CLI, with options to run them individually or compare results side-by-side. Author: Dan GuidoFeatures
Dual Model Support
Run reviews with OpenAI Codex (gpt-5.3-codex) or Google Gemini (gemini-3.1-pro-preview), or both for comparison
Multiple Scopes
Review uncommitted changes, branch diffs vs main, or specific commits
Focused Reviews
General review, security, performance, or error handling focus areas
Project-Aware
Optionally include CLAUDE.md or AGENTS.md for context-aware reviews
Prerequisites
OpenAI Codex CLI
1
Install Codex CLI
2
Configure Authentication
Requires OpenAI API key or ChatGPT Plus subscription configured for Codex
Google Gemini CLI
1
Install Gemini CLI
2
Authenticate
3
Install Extensions
Installation
Usage
1
Invoke the Command
2
Answer Questions
Claude asks up to 4 questions (skips any already specified):
- Review tool - Codex, Gemini, or both (default: both)
- Review scope - Uncommitted, branch diff, or specific commit
- Project context - Include CLAUDE.md/AGENTS.md? (if exists)
- Review focus - General, security, performance, or error handling
3
Review Diff Stats
Claude shows what will be reviewed:If the diff is empty, Claude stops. If very large (>2000 lines), Claude warns.
4
Run Review
For “Both” (default), Claude runs Codex and Gemini in parallel.For single tool, Claude runs just that tool.
5
View Results
Results are presented with clear headers:
Review Scopes
Uncommitted Changes
Reviews all uncommitted work (tracked and untracked files):Branch Diff vs Main
Reviews all changes in current branch since it diverged from default branch:Specific Commit
Reviews changes introduced by a single commit:Focus Areas
- General Review
- Security & Auth
- Performance
- Error Handling
Broad code review covering:
- Code quality and maintainability
- Potential bugs and edge cases
- Best practices and patterns
- Documentation completeness
Codex vs Gemini
Running both (the default) provides comparison and validation. Where they agree, findings are higher confidence.
Codex Invocation Details
- Uses OpenAI’s published code review prompt (fine-tuned into model)
- Diff is piped via stdin with the prompt
--output-schemaproduces structured JSON findings-ocaptures only final message (no thinking/exec noise)- Falls back to
gpt-5.2-codexon auth errors - Timeout: 600 seconds
Gemini Invocation Details
Uncommitted General Review
Branch/Commit Diffs
Security Focus
Dependency Scanning
When security focus is selected AND the diff touches dependency manifest files, Claude also runs:package.json,package-lock.json,yarn.lock,pnpm-lock.yamlrequirements.txt,setup.py,pyproject.toml,uv.lock,poetry.lockCargo.toml,Cargo.lockgo.mod,go.sumGemfile,*.gemspeccomposer.json,composer.lock
The scan is skipped if no manifest files are in the diff, since it analyzes the entire dependency tree (time-consuming with zero value when deps weren’t touched).
Usage Examples
- Both Tools (Default)
- Inline Arguments
- Large Diff Warning
Error Handling
Codex MCP Tools
This plugin bundles Codex CLI’s built-in MCP server (codex mcp-server), which auto-starts when the plugin is installed:
- codex - Start new Codex session with prompt, model, sandbox, approval policy
- codex-reply - Continue existing session by thread ID for multi-turn conversations
/second-opinion command. Use them for direct programmatic access to Codex.
Related Skills
- Modern Python - Reviews can check for modern Python best practices
- GH CLI - Can review branch diffs before opening PRs
- Git Cleanup - Can review branches before cleanup