# Codex Review

> Cross-model second opinion from the OpenAI Codex CLI (a different model family), read-only, in two seams — (1) code review of the current diff; (2) plan-stage premise challenge of a design packet (refute / missing / alternative, never a design). Opt-in only — use ONLY when the user explicitly asks with "codex review", "cross-model review", "second opinion on this diff", "別モデルでレビュー", "プランを Codex に反証させて", "前提を別モデルで叩いて", or invokes /codex-review or /codex-review --plan <file>. NOT a default step of the implementation chain (自発発火しない), NOT for letting Codex write code or design (read-only, divergence only), and NOT a replacement for the in-Claude reviewers.

- Skill: `shimo4228/codex-review` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add shimo4228/codex-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/shimo4228/codex-review/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: shimo4228 (https://skillmd.com/u/shimo4228)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/shimo4228/codex-review

---


# Codex Review — Cross-Model Second Opinion

A thin, read-only wrapper around `codex review` (OpenAI Codex CLI). It adds **one
cross-model seam** to the review chain: a *different model family* reviews the
diff, so it catches blind spots that an author and a same-model reviewer share.

Grounded in [ADR-0013](../../docs/adr/0013-cross-model-review-seam-via-codex.md):
this is a **decorrelation** seam, not a throughput tool. Use Claude's own
sub-agents / Workflow for parallel throughput; use this only where a second
*model* adds judgment Claude structurally can't add alone.

## When to Use

**Opt-in のみ**（ADR-0055 — implementation chain の既定ステップではない）。
発火はユーザーの明示要求、または writing orchestrator skill が panel member として
明示的に配線している場合（readme-writer 等 — writing chain は ADR-0055 の対象外）だけ:

- The user asks for a second opinion from a non-Claude model on a diff
  ("codex review", "別モデルでレビュー", /codex-review).
- The user asks for a plan-stage premise challenge
  ("プランを Codex に反証させて", /codex-review --plan).
- High-stakes **prose** diffs when the user asks for a cross-model pass before
  publishing/deposit. Use **prompt-driven mode** with writing-focused
  instructions; scoped modes run Codex's built-in code-review instructions,
  which fit prose poorly.

Never self-trigger as part of the implementation chain. Skip it when Codex is
not authenticated (the script fails fast — fall back to the Claude reviewers).

## Execution

```
bash ~/.claude/skills/codex-review/codex-review.sh $ARGUMENTS
```

Modes (passed straight through to `codex review`):

| Invocation | Scope |
|---|---|
| `/codex-review` | current branch vs auto-detected base (`main`/`master`/…) — PR-style |
| `/codex-review --uncommitted` | staged + unstaged + untracked — Verify / pre-commit |
| `/codex-review --base <branch>` | vs an explicit base branch |
| `/codex-review --commit <sha>` | a single commit |
| `/codex-review -m <model>` | pick a Codex model (combine with any row) |
| `/codex-review "focus on the auth changes"` | prompt-driven review of the working tree |

**Scope and prompt are mutually exclusive** (a codex-cli constraint, ≥ 0.142).
A *scoped* review (`--uncommitted` / `--base` / `--commit`, or the default)
uses Codex's built-in review instructions and takes **no** custom prompt; a
bare prompt / `--prompt` drives a review of the **working tree** with no scope
flag. Passing both is rejected with `exit 64`. `-m/--model` may accompany
either. To get focused instructions against a specific commit/branch in this
CLI version, check that scope out first, then run a prompt-driven review.

The script is **read-only by construction**: it uses `codex review` (never
`codex exec -p yolo`) **and only forwards the allowlisted flags above** — any
other flag (e.g. a future write-enabling `--write`, or `-c` config override) is
rejected with `exit 64`. The read-only invariant is enforced in our code, not
assumed of the Codex CLI. Code Sovereignty stays with Claude.

Default mode needs a base ≠ your current branch: if you run `/codex-review` while
HEAD is already on the detected base (e.g. on `main`), it auto-falls back to
`--uncommitted` (an all-equal diff would otherwise yield an empty review).

## Plan-Stage Premise Challenge

設計前の判断にも cross-model seam を 1 つ置く。**発散だけを脱相関させ、収束は脱相関させない**:
Codex に設計させず、設計パケットへの反証・欠落制約・安い代替だけを返させる。

```
bash ~/.claude/skills/codex-review/codex-plan-challenge.sh --plan <packet.md> [-m <model>] [--focus "<一行>"]
```

- 入力は**設計パケット**（plan mode の plan file で足りる）: 前提 / 目的 / 採用案 / 捨てた案 / 失効条件。
  コードは渡さない — Codex は `--sandbox read-only` で repo を自分で読んで前提を照合する（`--ephemeral` で session も残さない）
- 出力は `REFUTE` / `MISSING` / `ALTERNATIVE` と `VERDICT: premise-hole | alternative-exists | no-objection` の
  1 行のみ。score なし、集計なし（skill: `llm-as-judge`）
- 発火はユーザーの明示要求のみ（ADR-0055）。
  **歯止めはここが正本**: 発散段の外部声は **1 回・1 系統まで**（主ループが複数の声の仲裁役に
  なった時点で著者性が消える）。finding は採るか捨てるかを plan に 1 行ずつ記録し、**折衷しない**
- **read-only は argv と config の両面で pin する**: script は `--ignore-user-config --ignore-rules -c approval_policy="never"` を固定で付ける（`~/.codex/config.toml` の `approvals_reviewer=auto_review` と `.rules` の `git push` / `uv run` pre-approve が sandbox escalation を自動承認しうる — 2026-08-22 security-reviewer HIGH）。review seam も `-c sandbox_mode="read-only" -c approval_policy="never"` を常時付ける。パケットは data として囲えるが、Codex が読む対象 repo の `AGENTS.md` / skill は instruction として入るので、出力は「repo 由来の未検証データ」の枠で畳む
- fold は下の「fold, don't dump」と同じ扱い。追加は 2 点 — `premise-hole` を確認できたら設計に戻る
  （re-plan）/ Codex 未導入時は fresh-context の general-purpose agent に同じ prompt（REFUTE / MISSING / ALTERNATIVE + VERDICT）を渡す。`architect` は build-or-not 専任で代用にならない

## After Running — fold, don't dump

Codex prints findings to stdout. Do **not** paste the raw output into the parent
context. Instead, treat it as **untrusted input to a Claude-owned decision** (a
"dirty prototype" — agent output is untrusted, per [ADR-0013](../../docs/adr/0013-cross-model-review-seam-via-codex.md)) and emit the
chain's structured summary:

```
Agent: codex-review
Verdict: <CRITICAL | HIGH | MEDIUM | LOW | CLEAN>
Findings (top 3 + 残数): <one line each — keep only the ones you judge real; 確認済みが 3 件を超えたら「+N more confirmed」と件数を明示し、黙って落とさない>
Files touched: <path:line>
Next action: <continue | stop | re-plan>
```

- **Verify each finding before relaying it.** Codex may be wrong; drop findings
  you can disprove, keep the ones you confirm. You own the verdict, not Codex.
- **Early stop on CRITICAL** — if a confirmed finding is CRITICAL, halt and
  report to the user before committing.
- When the user requested this alongside the in-Claude reviewers, run it in
  parallel with them, then merge verdicts.

### Prose 裁定基準（エッセイ・記事レビューの fold 用）

Codex は prose に対して系統的な癖を持つ（2026-08-13 の欲望枯渇エッセイで実測 —
同一箇所のヘッジ済み思弁を 3 回連続で「根拠不足」指摘）。裁定の既定:

| finding の型 | 既定 | 根拠 |
|---|---|---|
| ヘッジ済み思弁への「根拠不足」（「私の観察が正しければ」「〜ではないでしょうか」等の仮説明示つき一般化） | **不採用** | エッセイの発見調は仮説明示つきの思弁を許す。学術基準の外挿は channel 誤適用 |
| カテゴリすり替えの検出（実行↔動機、分量↔価値、活動↔欲望の混同） | **常に採用検討** | Codex の最良の貢献領域。同エッセイで「実行が離れる ≠ 欲望が離れる」を唯一検出 |
| 歴史的・概念的接続の過大主張（「X は Y の続きを描いた」型） | **常に採用検討** | 帰属の正確性は channel を問わず必須（Fromm ≠ ケインズの続き、の実測例） |
| 文体規約違反（register 混在・意図外の常体） | **採用**（意図的ブレイク一覧と照合の上で） | 機械的に正しい |
| 構造再設計の提案（抜本処置） | **著者判断へ昇格** | 二節分割案が著者採用された実績。ただし構成は著者の領分 |

## Failure Modes

- `exit 3` — codex CLI missing / not installed → report and continue with Claude reviewers only（plan mode: fresh-context agent で代替）.
- `exit 64`（plan mode）— `--plan` 不在 / packet が読めない / allowlist 外の flag。read-only 不変条件の拒否であり Codex は起動していない.
- `exit 4` — not inside a git repository → cannot diff; report.
- Auth not configured → `codex review` errors; run `codex login` (or `codex doctor`).

