/crosscheck:tri-reviewfrom Model Crosscheck
Runs three independent code reviews (Claude, OpenAI Codex CLI, Google Gemini) on the same diff and merges findings into a consolidated report. Use before merging for maximum independent coverage.
Ships in Model Crosscheck. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Three independent reviews of the same diff, merged into one report. The value is in the merge: agreement across different models is the strongest signal a finding is real; disagreement tells the user exactly where to look manually.
Sibling skills.
/dual-review,/tri-reviewand the rest name the other skills in this set. Installed as the plugin, invoke them as/crosscheck:<name>; as plain copies, as/<name>. Either way their files sit next to this one, so "see /tri-review's Notes" means../tri-review/SKILL.mdrelative to this skill's base directory.
Sibling rule. Where this skill and /dual-review, or this skill and a shared file, still differ: follow the stricter rule, report the difference to the user, and never edit a skill during a run.
Claude Code loads only this SKILL.md. Resolve <shared dir>: the absolute
path of <this skill's base directory>/../../crosscheck-shared (Claude Code states a
skill's base directory when it loads it). Write that absolute path in every
command: commands run from the target repo, where a relative path would
resolve against the repo. If the folder is missing, stop and say the
install is incomplete (README, "Install").
Before step 0, Read each of these files in full; their rules are part of this skill:
<this skill's base directory>/../../crosscheck-shared/gate.md<this skill's base directory>/../../crosscheck-shared/run.md<this skill's base directory>/../../crosscheck-shared/codex.md<this skill's base directory>/../../crosscheck-shared/gemini.md<this skill's base directory>/../../crosscheck-shared/egress.md<this skill's base directory>/../../crosscheck-shared/tiers.mdPrompt templates, in <shared dir>/prompts/
(filled per egress.md, "Prompt templates"): probe.md, review-gemini.md,
review-walkthrough.md, review-operations.md,
review-gemini-ops-preamble.md, review-plan-trace.md,
review-rebuttal.md, standing-risks-head.md. This skill also ships
receipt.schema.json (Notes) and standing-risks.example.md (egress.md,
"Standing risks") in its own directory.
Legs. Claude: blind findings, verification, merge. Codex: the built-in review, plus the prompted passes 4a, 4b and 4d. Gemini: the baseline bug review, plus the operations pass 4b. 4a and 4d run on Codex alone because Gemini's quota is the scarce resource (gemini.md, "Budget").
Gate, run folder, mode. Run the gate check (gate.md). Create the
run folder (run.md, skill name tri-review). Then decide the mode before
any repository command: documents the user names outside any git repo
→ no-repo mode (step 1, last bullet), which runs no repository git
command; otherwise repo mode: record <repo root> from the
session's working directory (git rev-parse --show-toplevel; if it
fails, there is no repo: ask whether this is a no-repo document review).
Determine diff scope.
Find the trunk first; never assume a name. If the repo's
CLAUDE.md or AGENTS.md names one, use it; if the two name different
trunks, stop and ask. Only when neither names one, ask the server:
cd "<repo root>" && git ls-remote --symref origin HEAD, taking the
branch from its ref: refs/heads/<name> line, never the cached
origin/HEAD (it can be years stale on an old clone).
Check the name with git check-ref-format --branch "<name>" and quote
it. Then
cd "<repo root>" && git fetch origin "<trunk>" && git rev-parse --verify "origin/<trunk>".
No source, or fetch or validation fails: stop and ask. Name the trunk
in the report.
Branch has commits vs the trunk: scope = origin/<trunk>...HEAD;
Codex uses --base "origin/<trunk>", the SAME ref as the patch (a
stale local trunk silently gives Codex a different diff).
Only uncommitted changes: Codex uses --uncommitted (includes
untracked files). Write the patch with this command instead of step
2's. It marks untracked files in a THROWAWAY index copy, so the real
staging area is never touched, not even if the run is interrupted (no
pathspec, so a run from a subdirectory still catches repo-wide
untracked files; verified on git 2.54). Do not use git add -N on the
real index and git reset afterwards: a bare reset unstages the
user's work, and so does git reset --pathspec-from-file with an
empty list. PowerShell forms: run.md's table.
cd "<repo root>" && umask 077 && cp "$(git rev-parse --git-path index)" "<run folder>/idx" && GIT_INDEX_FILE="<run folder>/idx" git add --intent-to-add --all && GIT_INDEX_FILE="<run folder>/idx" git diff HEAD > "<run folder>/review.patch"; rc=$?; rm -f "<run folder>/idx"; [ $rc -eq 0 ] && git ls-files --others --exclude-standard && grep -c '^diff --git' "<run folder>/review.patch"
PowerShell (untested; git diff --output writes the patch byte for
byte, and finally removes the temporary index on any outcome):
Set-Location '<repo root>'; $idx = '<run folder>\idx'; $ok = $false; try { Copy-Item (git rev-parse --git-path index) $idx -ErrorAction Stop; $env:GIT_INDEX_FILE = $idx; git add --intent-to-add --all; if ($LASTEXITCODE -ne 0) { throw 'git add failed' }; git diff HEAD --output='<run folder>\review.patch'; if ($LASTEXITCODE -ne 0) { throw 'git diff failed' }; $ok = $true } catch { "FAILED: $_" } finally { Remove-Item Env:GIT_INDEX_FILE -ErrorAction SilentlyContinue; Remove-Item $idx -Force -ErrorAction SilentlyContinue }; if ($ok) { git ls-files --others --exclude-standard; (Select-String -Path '<run folder>\review.patch' -Pattern '^diff --git' -CaseSensitive).Count }
The temporary index is removed whether or not the chain succeeded,
and nothing after it runs on a failure: no file list and no count
means stop and report the error. The final number is step 2's
empty-patch check (0 = nothing to review: stop before any leg);
then continue at step 2's pin and scan. Show the user the untracked list in the run's status line before
any leg starts (those files go out in the patch); stop and ask only if
a name looks secret (.env*, keys, credentials, dumps) or the list
has more than 20 files. /code-review reads
git diff HEAD, which omits untracked files: review those from the
patch.
Both committed AND uncommitted changes: --base and
--uncommitted are mutually exclusive, so don't pick silently. Ask
the user to commit first, or review the committed scope and say in the
report that the uncommitted edits are excluded.
Documents with no repo (no trunk, no git): stage only the
documents and their source of truth in the run folder (run.md) and
build the patch with
cd "<run folder>" && { diff -u /dev/null "<file>" >> review.patch || [ $? -eq 1 ]; }
per file (diff exits 1 when the files differ, which is success
here; exit 2 is a failure).
Then check the assembled patch is not empty: grep -c '^+++ ' review.patch
must be at least 1, else there is nothing to review: stop. Skip the built-in review (it needs --base or --uncommitted);
the Codex leg is then the walkthrough pass 4a, run from the run folder
with --skip-git-repo-check, plus 4b if the document gets executed.
Gemini reviews the patch as usual. The pin check uses the patch sha256
alone. Say in the report that the built-in review did not run.
Write the patch, pin it, scan it, choose the passes.
cd "<repo root>" && umask 077 && git diff "origin/<trunk>...HEAD" > "<run folder>/review.patch" && grep -c '^diff --git' "<run folder>/review.patch"
0 = nothing to review: stop before any leg (Gemini's receipt needs
a diff --git header that does not exist).
Pin (run.md, "Pin what is sent"): record
git -C "<repo root>" rev-parse HEAD and the patch's sha256. For a
branch review nobody pushes to or rebases the branch while the legs
run; for an uncommitted one nobody edits the working tree.
Secret-scan the patch (run.md) before any leg starts.
Choose the pass set now, so every external pass launches together in step 3:
Write the prompt files. Build the standing-risks blocks
(egress.md; with no user-named list they are empty files), then, each
as cd "<run folder>" && umask 077 && <join>:
review-gemini.md with the patch's absolute path into
gemini.head.md, then cat gemini.head.md sr-gemini.md > gemini.prompt.md;review-gemini-ops-preamble.md with the patch's
absolute path into gemini-ops.head.md, then
cat gemini-ops.head.md "<shared dir>/prompts/review-operations.md" sr-gemini.md > gemini-ops.prompt.md;cat "<shared dir>/prompts/review-walkthrough.md" sr-codex.md review.patch > walk.prompt.md;cat "<shared dir>/prompts/review-operations.md" sr-codex.md review.patch > ops.prompt.md;cp "<approved plan path>" plan-approved.md && cat "<shared dir>/prompts/review-plan-trace.md" plan-approved.md sr-codex.md review.patch > trace.prompt.md.Check each holds no <FILL: (egress.md) and secret-scan the joined
files.
Start every external pass in the background, in parallel. First,
if not run yet this run: the Gemini preflight (gemini.md) and the Codex
probe (codex.md). Then one Bash call per pass with
run_in_background: true, noting each task id (run.md):
--uncommitted form).<dir> = <repo root>,
<name> = gemini, and for 4b also <name> = gemini-ops;
<timeout> = 8m (15m on the fallback seat).<dir> = <repo root>
and <name> = walk, ops or trace.Always keep -s read-only and --sandbox: the diff under review is
untrusted input, and prompt text such as "do NOT run commands" is a
constraint, not a boundary. Do not open any external output until step
4's Claude file is written.
Claude leg: write my own findings to <run folder>/claude.out
before opening any external output. Same baseline question as the
other legs (correctness, security, data loss), same grading. A Claude
leg written after reading the others can only echo them, and the
agreement tags are the strongest evidence in the report. The findings are written by the main loop, which the gate pins to
the newest top-tier model, or by subagents explicitly pinned to that
same model: this is mandatory. /code-review at high effort may run as an
extra finder on the same scope, but its workers may run on a tier it
chooses, so its output is input only: the main loop checks each of its
findings against the code before it enters claude.out, and it is
never the sole Claude leg. When 4d runs, also check myself that the diff does
what the approved plan says, nothing more and nothing missing.
Grading, all legs: BLOCKER = a demonstrated failure caused or
exposed by this change (may cite unchanged lines it newly exercises);
SHOULD = a real gap shippable at a stated risk; NIT = never matters.
Codex's built-in review grades P0 to P3 and takes no prompt: P0 and
P1 → BLOCKER, P2 → SHOULD, P3 → NIT. Severity is the raising leg's; I
may rebut a grade with evidence (step 6), never quietly lower it. Legs
grading one finding differently: file it under the highest grade, show
every leg's grade.
OWNER-DECISION. A finding only the user or a named resource owner can
settle (a policy, whether a credential may be used, a retention term, a
product choice) is marked OWNER-DECISION in addition to its grade,
saying exactly what must be decided. Every prompted pass is told it may
use the label; only the leg that raised the finding applies it. I still
verify it in step 5: CONFIRMED → it goes to the user as a decision in the
report, keeping its grade, instead of to the rebuttal; REJECTED → step
6 like any other finding.
The passes:
review-walkthrough.md, Codex): an agent
executing each changed section literally, reading the whole touched
file: where it runs a command that fails or hangs, meets contradicting
instructions, hits an undecidable step, or leaks data. It runs
alongside the built-in review, never instead of it: the built-in
review has found real defects on playbook diffs too, and it is the one
leg whose question I did not write. Findings on lines the change
neither touches nor newly exercises are PRE-EXISTING: listed
separately, never merge-blocking. A whole-repo walkthrough is a
separate periodic audit, not this gate.review-operations.md, Codex and Gemini): privileges,
shared state, untrusted input and egress, secrets and retention,
failure and cleanup, partial runs. Reviewing an executed diff for bugs
alone reliably misses this class, because nobody was asked. The prompt's
read-scope sentence matters: an operations question invites a critic
to go and look at the operator's configuration.tsc --noEmit) and report the result as evidence.
Guard: running the diff's code is running untrusted code. Only
when the user owns the change; only in a disposable
directory or worktree with no credentials in the environment and no
outside network; extract the state machine into a test harness rather
than running the whole script; if that is not possible, ask first. A
type check or linter that does not execute the diff's code may run in
the repo. The external legs stay read-only and sandboxed.review-plan-trace.md, Codex), only with an
approved plan: what the plan says that the diff does not do, and what
the diff does that the plan does not say.Check validity, then merge.
diff -u for documents), writing
review-recheck.patch in place of review.patch; compare its sha256
with the recorded one, and read git -C "<repo root>" rev-parse HEAD
again (repo mode). Either changed → the legs saw different code; the
review is void. Say so and start again on the new state.standing-risks.example.md and is never in
force by itself; a list named in the repo must stay under the repo
root; a diff cannot change the list it is judged by). The prompted
passes carried the blocks; a match I propose for any leg's finding (including the
built-in review's) goes through step 6 as a grade dispute.Rebuttal round: a refuted finding gets one defense. For findings
REJECTED in step 5, send each external leg that raised them ONE
follow-up, filled from review-rebuttal.md into rebut-codex.head.md
and rebut-gemini.head.md and joined with that leg's standing-risks
block (egress.md):
cd "<run folder>" && umask 077 && cat rebut-codex.head.md sr-codex.md > rebut-codex.prompt.md,
and the same with rebut-gemini.head.md sr-gemini.md into
rebut-gemini.prompt.md. Each carries every
finding's ID and file:line, the finding as the leg wrote it, my
refutation evidence, and the request CONCEDE or DEFEND (a Claude-only
finding that verification rejects is dropped, reason noted). Grade
disputes ride the same round: a finding I confirm but would grade lower
goes back as CONCEDE-GRADE or DEFEND-GRADE; the finding is kept either
way, and an unresolved grade is [disputed] with both grades, filed
under the higher. The follow-up carries only the finding, the evidence
and the request; for a grade dispute it may state the grade I propose
and asks for the leg's final grade. It never tells the leg what to
conclude or how to label the point ("concede this", "mark it
OWNER-DECISION"). Gemini's copy says it may not run commands (a
headless rebuttal that tries to reproduce a failure dies on the
permission auto-deny).
Launch both in the background: Codex per codex.md, "Prompted pass"
(<name> = rebut-codex); Gemini per gemini.md (<name> =
rebut-gemini, <timeout> = 8m, 15m on the fallback seat). Both follow the
rebuttal contract in codex.md, "Rebuttals": the REBUTTAL: receipt, each
finding answered under its own quoted file:line, else re-send once, then [disputed] with
"rebuttal failed". Concede → drop. Defend → re-examine once; if I still
disagree, [disputed] with both positions and my recommendation;
the user rules. One round only; skip it when nothing was rejected.
Report one consolidated list, grouped BLOCKER, SHOULD, NIT, then
PRE-EXISTING and matched standing risks, each tagged by source:
[all], [claude+codex], [claude+gemini], [codex+gemini],
[claude], [codex], [gemini] or [disputed], naming the pass when
it was not the baseline review (walkthrough, operations, plan trace).
Never omit a disputed finding. Open BLOCKERs = the review recommends
against merging; the user decides. The report also lists: every
OWNER-DECISION with what must be decided; every leg or pass missing or
retried, and why; the Gemini model per pass (and the default seat's reset
time on a fallback); the trunk; the 4c results; any sibling-rule difference
found between sibling skills; and the gate check, run once more just before reporting
(gate.md).
End with a block ready to paste into the PR or MR description (many repos ask to fix the findings or list them as waived), one line per open BLOCKER or SHOULD that will not be fixed before merge:
Waived review findings (/tri-review, <date>):
- <grade> <file:line>: <one line>. Waived because: <reason or the user's ruling>.
With none: Waived review findings: none. Then cleanup, and the run-log
line only if the user named a run-log file (run.md): findings per leg and pass by grade, confirmed vs
rejected, rebuttals conceded, calls and wall-clock minutes per pass.
Defects surfacing later are logged then, as MISSED-BY-ALL or credited
to the leg that raised them.
The patch file is what Gemini reads. Codex's built-in review reads the repo itself, so it has no path to lose and no receipt.
Codex needs --skip-git-repo-check only when run outside a git work
tree (documents with no repo).
Machine-checked Gemini receipt. Instead of the INSPECTED line, the
CLI can enforce the receipt. receipt.schema.json ships in this skill's
directory (fields inspected_files, first_header, verdict in CLEAN /
FINDINGS / FILE-NOT-READ, and findings[] of
file:line | grade | issue | why strings). Pick one path per run, not
both. Write gemini-schema-prompt.md as the filled review-gemini.md
with its receipt sentences replaced by: Fill the schema, inspected_files
= number of files in the diff, first_header = the first diff --git line
verbatim, verdict = CLEAN or FINDINGS (FILE-NOT-READ if you could not
open the file), findings = one string per defect as file:line | BLOCKER
or SHOULD or NIT | issue | why it breaks. Then, with the resolved
absolute path of this skill's directory:
cd "<repo root>" && umask 077 && agy --sandbox --model <gemini-seat> --print-timeout 8m --output-format json --json-schema "<this skill's base directory>/receipt.schema.json" -p "$(cat "<run folder>/gemini-schema-prompt.md")" > "<run folder>/gemini.out" 2> "<run folder>/gemini.log"
The reply is a JSON envelope: read its structured_output object (the
one validated against the schema; the free-text response field may
carry extra keys the model invented) and compare inspected_files and
first_header to the patch yourself; a mismatch is a hollow run.
--json-schema is rejected unless --output-format is json or
stream-json (verified on Gemini 3.8 Flash). For a custom-prompt Codex
pass, codex exec --output-schema <file> - < <prompt file> does work and
prints the constrained JSON directly.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
7 skills in this plugin
/dual-planPlan and build a feature with Claude AND OpenAI Codex together: Claude drafts the implementation plan, Codex critiques it against the codebase, Claude merges and implements after user approval, then /dual-review gates the merge. Use when the user says "dual plan", "plan with both", "plan this with ChatGPT/Codex", or wants both models on a feature./dual-reviewDual code review: Claude writes its own blind findings on the gated top-tier model (main loop or pinned subagents; /code-review only as an extra finder) while OpenAI Codex CLI reviews the same pinned diff, then both are verified and merged into one consolidated report. Use when the user says "dual review", "review with both", "Claude + ChatGPT review", or before a merge when they want two independent reviewers./tri-decideDecide an architecture or technology question with Claude, OpenAI Codex, and Google Gemini proposing independently and blind, then cross-examining each other's approaches. Produces a decision record: options, cruxes, what each bets on, a recommendation, and a revisit trigger, not a winner. Use when the user says "tri decide", "triple decide", "decide with all three", or faces a hard-to-reverse technical decision (datastore, framework, protocol, architecture, build-vs-buy)./tri-planPlan a feature with Claude, OpenAI Codex, AND Google Gemini together: Claude drafts the implementation plan, Codex and Gemini independently critique it against the codebase in parallel, Claude adjudicates and implements after user approval, then /tri-review gates the merge. Use when the user says "tri plan", "triple plan", "plan with all three", or wants maximum independent scrutiny on a plan before code is written./tri-researchResearch a factual question with Claude, OpenAI Codex, and Google Gemini: Claude gathers and writes a claim ledger (every number dated and sourced), the other two re-fetch the sources and try to break it, then Claude re-verifies every disputed row against the page. Produces one ledger where every claim carries a status, confirmed by N auditors, corrected, disputed, unverified, unsourced, or single-source, rather than three merged reports. Use when the user says "tri research", "triple research", "verify these numbers", or before external facts (competitor pricing, platform capability, market claims) become load-bearing in a memo or a hard-to-reverse decision./tri-strategyDecide a business or strategy question with Claude, OpenAI Codex, and Google Gemini arguing from three deliberately different lenses: unit economics, competitive positioning, and execution capacity, over the same evidence pack. Produces a strategy memo with what each option bets on, cruxes resolved against real data, and a revisit trigger. Use when the user says "tri strategy", "strategy decision", "strategy with all three", or faces a hard-to-reverse business decision (pricing, packaging, market focus, build-vs-buy, hiring shape, GTM motion).npx claudepluginhub sameerkhan/model-crosscheck --plugin crosscheckOther plugins' skills for the same job