/codex
Invokes the Codex CLI as an independent reviewer. Codex sees the same files but not this session's prior context — that disconnect is the point. Use when you want a second opinion uncontaminated by the framing already in this conversation.
The skill itself runs in Claude Code (which is why cli_support: [claude-code] is single-entry). Codex is invoked as a subprocess; its output is parsed and surfaced back here.
When to use
- Pre-
/ship outside-voice review on a non-trivial diff
/investigate produced a confident root cause and you want it independently challenged
- A design decision was made in conversation and you want a fresh-eyes critique
/plan-eng-review cleared with caveats — use Codex to triangulate the caveats
When NOT to use
- The work is trivial — Codex tokens cost real money
- You've already disagreed with Codex twice on this same diff — escalate to a human reviewer instead
- Codex CLI isn't installed — surface that as a setup gap, do not silently fall back to "Claude reviewing itself"
Inputs
- Required: target (one of
--diff, --plan <file>, --code <file>, --hypothesis "<text>")
- Optional
--prompt-style <strict|exploratory> — strict = "find what's wrong", exploratory = "what would you do differently"
- Optional
--budget <tokens> — cap Codex call (default: 50k tokens)
Workflow
- Preflight. Verify
codex is on PATH. If not: report missing setup + exit. No fallback.
- Construct prompt. Inject the target (diff, plan body, code excerpt, hypothesis statement). Wrap in a directive: "You are reviewing this independently. The author has their own reasoning; surface what you'd push back on."
- Run Codex.
codex exec --quiet --output json --prompt-file <tmp> (or equivalent — adjust to current Codex CLI flags). Capture stdout, stderr, exit code.
- Parse output. Codex returns structured findings (severity, location, claim, evidence). Normalize to Lintel's P1/P2/P3 severity.
- Compare to local reasoning. If invoked mid-
/investigate or post-/review: explicitly diff Codex's findings against what was already concluded. Surface AGREEMENT and DISAGREEMENT separately.
- Persist via
bin/li-review-log with skill: codex so downstream /ship can read.
- Report.
Report format
Codex Review: <target>
Codex CLI: codex@1.4.2 (exec mode, exploratory style, budget 50k)
Tokens used: 31,400 / 50,000
## Findings from Codex (3)
[P1] (Codex confidence: 9/10) src/lib/dlxClient.ts:87
"The retry logic creates an AbortController but never resets between attempts. Second retry will abort itself."
← AGREES with /investigate root cause from this session.
[P2] (Codex confidence: 7/10) src/lib/dlxClient.ts:42
"Error handling swallows the original stack trace. Hard to debug downstream."
← NEW finding, not raised in local review.
[P3] (Codex confidence: 6/10) src/lib/dlxClient.ts:120
"Magic number 30000 should be a named constant."
← Style nit, agree.
## Synthesis
- 1 finding agrees with local conclusion (strengthens confidence)
- 1 new finding (P2) — recommend addressing before /ship
- 1 style nit (P3) — defer or include in same diff
Compliance integration
- Codex sees code. Per Layer 2: code is not customer-data, so no auth gate. But: if the target includes a fixture path containing customer-data patterns, BLOCK the Codex call and surface (Codex would receive that data).
- Token spend logged to
.claude/runtime/audit/codex-spend.jsonl.
- The active pack may route Codex calls via a configured gateway per
~/.lintel/config.yaml (none by default).
Failure modes
- Codex CLI missing: report + exit. No fallback to Claude self-review (that defeats the purpose).
- Codex returns malformed output: capture raw stdout to
.claude/runtime/audit/codex-raw-<ts>.txt, report parse failure, exit.
- Budget exceeded mid-call: Codex's own truncation kicks in. Report partial findings + budget overflow.
- Codex output contains a finding referencing a file we never sent: flag as hallucination, suppress from main report, log to debug appendix.
Examples
Outside opinion on a diff:
> /codex --diff
Codex found 2 P2 findings the local review missed. Recommend addressing before /ship.
Challenge a hypothesis:
> /codex --hypothesis "retry abort controller bug at dlxClient:87"
Codex agrees (9/10 confidence). Strengthens the root cause.
Style-only review:
> /codex --code src/components/case/AgentModeChip.tsx --prompt-style exploratory
3 stylistic suggestions, no correctness issues.
See also
/review — local diff review (use /codex as a follow-up for important diffs)
/investigate — --with-codex flag chains automatically
/plan-eng-review — uses /codex internally as the outside-voice step
/ship — reads codex review-log entries as part of clearance check
1---2name: codex3description: Outside-voice second opinion via Codex CLI. Independent review of diff, plan, or hypothesis.4---56# /codex78Invokes the Codex CLI as an independent reviewer. Codex sees the same files but not this session's prior context — that disconnect is the point. Use when you want a second opinion uncontaminated by the framing already in this conversation.910The skill itself runs in Claude Code (which is why `cli_support: [claude-code]` is single-entry). Codex is invoked as a subprocess; its output is parsed and surfaced back here.1112## When to use1314- Pre-`/ship` outside-voice review on a non-trivial diff15- `/investigate` produced a confident root cause and you want it independently challenged16- A design decision was made in conversation and you want a fresh-eyes critique17- `/plan-eng-review` cleared with caveats — use Codex to triangulate the caveats1819## When NOT to use2021- The work is trivial — Codex tokens cost real money22- You've already disagreed with Codex twice on this same diff — escalate to a human reviewer instead23- Codex CLI isn't installed — surface that as a setup gap, do not silently fall back to "Claude reviewing itself"2425## Inputs2627- Required: target (one of `--diff`, `--plan <file>`, `--code <file>`, `--hypothesis "<text>"`)28- Optional `--prompt-style <strict|exploratory>` — strict = "find what's wrong", exploratory = "what would you do differently"29- Optional `--budget <tokens>` — cap Codex call (default: 50k tokens)3031## Workflow32331. **Preflight.** Verify `codex` is on PATH. If not: report missing setup + exit. No fallback.342. **Construct prompt.** Inject the target (diff, plan body, code excerpt, hypothesis statement). Wrap in a directive: "You are reviewing this independently. The author has their own reasoning; surface what you'd push back on."353. **Run Codex.** `codex exec --quiet --output json --prompt-file <tmp>` (or equivalent — adjust to current Codex CLI flags). Capture stdout, stderr, exit code.364. **Parse output.** Codex returns structured findings (severity, location, claim, evidence). Normalize to Lintel's P1/P2/P3 severity.375. **Compare to local reasoning.** If invoked mid-`/investigate` or post-`/review`: explicitly diff Codex's findings against what was already concluded. Surface AGREEMENT and DISAGREEMENT separately.386. **Persist via `bin/li-review-log`** with `skill: codex` so downstream `/ship` can read.397. **Report.**4041## Report format4243```44Codex Review: <target>4546Codex CLI: codex@1.4.2 (exec mode, exploratory style, budget 50k)47Tokens used: 31,400 / 50,0004849## Findings from Codex (3)5051[P1] (Codex confidence: 9/10) src/lib/dlxClient.ts:8752 "The retry logic creates an AbortController but never resets between attempts. Second retry will abort itself."53 ← AGREES with /investigate root cause from this session.5455[P2] (Codex confidence: 7/10) src/lib/dlxClient.ts:4256 "Error handling swallows the original stack trace. Hard to debug downstream."57 ← NEW finding, not raised in local review.5859[P3] (Codex confidence: 6/10) src/lib/dlxClient.ts:12060 "Magic number 30000 should be a named constant."61 ← Style nit, agree.6263## Synthesis64- 1 finding agrees with local conclusion (strengthens confidence)65- 1 new finding (P2) — recommend addressing before /ship66- 1 style nit (P3) — defer or include in same diff67```6869## Compliance integration7071- Codex sees code. Per Layer 2: code is not customer-data, so no auth gate. But: if the target includes a fixture path containing customer-data patterns, BLOCK the Codex call and surface (Codex would receive that data).72- Token spend logged to `.claude/runtime/audit/codex-spend.jsonl`.73- The active pack may route Codex calls via a configured gateway per `~/.lintel/config.yaml` (none by default).7475## Failure modes7677- **Codex CLI missing:** report + exit. No fallback to Claude self-review (that defeats the purpose).78- **Codex returns malformed output:** capture raw stdout to `.claude/runtime/audit/codex-raw-<ts>.txt`, report parse failure, exit.79- **Budget exceeded mid-call:** Codex's own truncation kicks in. Report partial findings + budget overflow.80- **Codex output contains a finding referencing a file we never sent:** flag as hallucination, suppress from main report, log to debug appendix.8182## Examples8384**Outside opinion on a diff:**85```86> /codex --diff87Codex found 2 P2 findings the local review missed. Recommend addressing before /ship.88```8990**Challenge a hypothesis:**91```92> /codex --hypothesis "retry abort controller bug at dlxClient:87"93Codex agrees (9/10 confidence). Strengthens the root cause.94```9596**Style-only review:**97```98> /codex --code src/components/case/AgentModeChip.tsx --prompt-style exploratory993 stylistic suggestions, no correctness issues.100```101102## See also103104- `/review` — local diff review (use `/codex` as a follow-up for important diffs)105- `/investigate` — `--with-codex` flag chains automatically106- `/plan-eng-review` — uses `/codex` internally as the outside-voice step107- `/ship` — reads codex review-log entries as part of clearance check