second-opinion: switch Codex from codex review to codex exec#93
Merged
Conversation
Use codex exec with --output-schema and -o (--output-last-message) instead of codex review. This eliminates context waste from verbose [thinking] and [exec] blocks by capturing only the structured JSON review output to a file. Uses OpenAI's published code review prompt that GPT-5.2-codex was specifically trained on. Also lowers default reasoning from xhigh to high, removes the --base/--commit prompt limitation (all scopes now support project context and focus instructions), and adds a JSON schema for structured findings output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Include untracked files in uncommitted scope diff using git ls-files + git diff --no-index, matching the coverage that codex review --uncommitted previously provided - Replace hardcoded /tmp/ paths with mktemp for portability - Rename absolute_file_path to file_path in schema since git diff produces relative paths - Capture stderr to a log file instead of /dev/null for faster error diagnosis without retry Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add required and additionalProperties: false to JSON schema - Use -o (short flag) consistently; clarify --output-last-message - Add cookbook citation URL for the code review prompt - Add || true to git diff --no-index (exits 1 on diff found) - Fix schema.json → codex-review-schema.json in SKILL.md quick ref Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Change reasoning effort back to xhigh from high - Update cookbook URL to canonical developers.openai.com domain (old cookbook.openai.com returns 308 redirect) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codex reviewtocodex execwith--output-schemaand-o(output-last-message) to eliminate context waste from verbose[thinking]and[exec]blocksxhightohighfor faster reviews--base/--commitprompt limitation — all scopes now support project context and focus instructionsgit diff --no-indexmktempinstead of hardcoded/tmp/paths for portability/dev/nullfor faster error diagnosisTest plan
/second-opinionwith Codex on uncommitted changes (including new untracked files) and verify findings appear as structured JSON/second-opinionwith Codex on a branch diff with project context and verify the review prompt includes CLAUDE.md contents/second-opinionwith both tools and verify parallel execution still workscodex execoutput file contains valid JSON matching the schema🤖 Generated with Claude Code