Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

second-opinion

Problem The model that wrote a diff can approve a defect shaped by its own assumptions
Theory An LLM council combines independent model judgments to reduce shared blind spots
This tool A second, independent model attacks each meaningful diff and sends standing disagreements to a human referee
flowchart LR
  A[Meaningful diff] --> B[Independent model attacks]
  B --> C[Second-opinion verdict]
  C -->|Clear| D[Merge gate]
  C -->|Objection| E[One author rebuttal]
  E -->|Concede| D
  E -->|Stand| F[Human referee decides]
Loading

For production-stakes changes, get a second opinion from an independent model; for routine low-stakes changes, normal review may be enough.

Same model writing and reviewing is homework marking itself.

second-opinion makes your agent send every meaningful diff to a second, independent model with one instruction: prove it wrong. If the models agree, it merges without you. If they disagree, both arguments go to a human referee with file references, and the disagreements are the only part worth human attention.

Install

npx skills add runsagents/second-opinion

Then say "get a second opinion on this diff" before merging agent-written changes. Requires a second, independent model your agent can reach (a second CLI like codex, an API, or another agent session).

Try the ritual in 2 minutes

The included exercise is synthetic and contains one planted payments defect. First, hand the exact briefing and patch to the independent reviewer. With Codex CLI as the second model:

(cat fixtures/second-opinion-briefing.md; printf '\n\n## Patch\n\n'; cat fixtures/sample-diff.patch) | codex exec -

A defect-finding run returns this shape (the ready-made result is in fixtures/second-opinion-position.json):

{"verdict":"objection","position":"The retry key includes Date.now(), so the same payment gets a new key on every retry. If the first request succeeds but its response is lost, the retry is not idempotent and can capture the payment twice.","reference":"src/capture-payment.mjs:6"}

Give that objection verbatim to the author for its one rebuttal. Then render the included standing disagreement:

node scripts/triage.mjs fixtures/author-position.json fixtures/second-opinion-position.json
second-opinion: standing disagreement

Independent reviewer position (verbatim, src/capture-payment.mjs:6):
The retry key includes Date.now(), so the same payment gets a new key on every retry. If the first request succeeds but its response is lost, the retry is not idempotent and can capture the payment twice.

Author position (verbatim, src/capture-payment.mjs:6):
I stand by the implementation. The paymentId still identifies the payment, and the timestamp prevents unrelated capture attempts from colliding; the gateway can use paymentId to recognize a retry.

Read: The independent reviewer treats retryKey as the deduplication boundary; the author assumes paymentId is a second deduplication boundary.

The zero-dependency triage schema is deliberately small. second-opinion-position.json uses verdict: "clear" alone, or verdict: "objection" with verbatim position and file:line reference. For an objection, author-position.json uses verdict: "concede" or "stand" with its verbatim position and reference; "stand" also requires the orchestrator's one-line read. For a clear verdict, the author uses {"verdict":"not-needed"}.

Tested compatibility: Claude Code as author/orchestrator paired with Codex CLI as the second, independent reviewer. Other model and CLI pairings are untested; feed them the same fixtures/second-opinion-briefing.md and patch.

Why it works

A model can't catch its own blind spots, it reviews with the same assumptions it wrote with. A second, independent model has different blind spots, so the overlap of "both approve" is much safer than either alone. In my fleet, agreement auto-merges; standing disagreements reach the human referee verbatim. That queue is the best reading of my day.

Limitations

Costs a second model call per review; route the independent reviewer at high reasoning only for changes that deserve it. Two models agreeing is strong evidence, not proof; keep your tests and gates. And never let the models resolve a disagreement between themselves: that's negotiation, not review.

License: CC0 · v1.2.0

Terminology & prior art

This pattern is known in the field as an LLM council, related to LLM-as-a-judge. This implementation adds adversarial code-diff review and escalation to a human referee when models disagree.

About

Second-opinion code review: a different model reviews each diff, and disagreements go to a human. Multi-model deliberation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages