Preface¶
After an IDE-driven main model finishes modifying code, many people launch another round of “have another model take a look”: uncommitted diffs, branch changes relative to main, or a specific commit. Assembling prompts manually, capturing patches, and aligning the review scopes of two passes is both time-consuming and prone to missing untracked files. Below we introduce the second-opinion Skill offered by Trail of Bits in the skills marketplace: within an Agent session, select the review provider and scope, hand the same change set to an external CLI for independent review, and consolidate the findings; it does not automatically modify code, nor does it send results to remote services.
What Is This¶
second-opinion is an Agent Skill (SKILL.md format) located under plugins/second-opinion/skills/second-opinion in the trailofbits/skills repository. It is maintained by Trail of Bits, alongside its Code Auditing and security-review plugins, within the same Claude Code / Codex plugin marketplace.
In one sentence: for user-selected uncommitted changes, branch diffs relative to a specified baseline, or a specified commit, it calls Codex or Antigravity (and Gemini CLI under accounts that still support it) to perform external model code review, producing findings; it optionally runs two providers in parallel and compares conclusions.
Core Functionality¶
The Skill metadata description reads: obtain independent review from Codex or Antigravity for uncommitted changes, branch diffs, and commits; activate when the user requests an external review, second opinion, codex review, gemini review, antigravity review, or uses /second-opinion. Allowed tools include Bash, Read, Glob, Grep, and AskUserQuestion.
Review Dimensions (filled in by the user or defaults)¶
- Provider: Codex, Antigravity, or both simultaneously (for comparison). When the user names a specific CLI, keep that choice.
- Scope: uncommitted workspace changes; branch diff relative to a named baseline; or a single commit. If no baseline is given, attempt to use the remote default branch; ask the user only when it cannot be determined.
- Context: by default include applicable project notes (unless excluded by the user); when the user explicitly requests it, write it separately from repository content in the prompt.
- Focus: defaults to general correctness and maintainability; the user may specify security, performance, etc.
When no Google-family CLI is specified, prefer Antigravity (agy). When the user explicitly requests Gemini CLI, follow the Gemini reference documentation; if the account returns UNSUPPORTED_CLIENT, explain the migration to Antigravity and ask before switching the CLI.
Input and diff¶
Before execution, read the shared prompt and diff recipes in references/review-input.md within the repository. When comparing two providers, use the same captured diff. Uncommitted reviews include untracked files; Git errors are preserved as-is and not treated as empty diffs.
If there are no changes, do not call any external provider. When CLI or model limits are exceeded, explain the limit and ask the user to narrow the scope; do not silently truncate patches.
Temporary prompts, outputs, and diagnostic files are created with mktemp outside the checkout; each provider gets its own output and diagnostic files; repository content is written literally to avoid shell expansion.
Providers and Invocation¶
| Provider | Description |
|---|---|
| Codex | references/codex-invocation.md: codex exec, combined with references/codex-review-schema.json |
| Antigravity | references/antigravity-invocation.md: agy print mode, prose output |
| Gemini CLI | references/gemini-invocation.md: headless gemini under accounts that still support it |
The Codex path does not require an MCP server; do not start codex mcp-server, and do not replace the CLI invocation with codex app-server.
When two providers are selected and the tool supports it, run them concurrently; foreground Bash reviews may set timeout: 600000 (roughly ten minutes). Do not enable automatic approval of writes for review runs.
Results and Failures¶
Presentations include: provider and actual model, severity, file and line number, impact, and remediation suggestions; low-severity issues are still retained. Codex schema severities: 0 informational, 1 low, 2 medium, 3 high, ordered in descending order.
When both reviews complete, summarize agreements and divergences; do not treat “agreement” as proof; distinguish external findings from the Agent’s own judgments.
Non-zero exits, no output, invalid JSON, permission-blocked checks, or requests to approve a plan are all treated as incomplete rather than “clean pass”; report failures and partial results. Retry only for diagnosable, recoverable causes; do not enter a provider-rotation loop after authentication or quota failures.
Missing executables or account configuration are treated as review failures, with corresponding installation instructions; if a two-provider request was made, continue with the available one and note the skipped provider.
Installation and Activation¶
The Skill is installed via the trailofbits/skills marketplace, not by separately cloning this Skill directory.
For Claude Code, add the marketplace and install the plugin:
/plugin marketplace add trailofbits/skills
Browse and install:
/plugin menu
In the menu, select the corresponding plugin containing second-opinion (path: plugins/second-opinion/).
Codex can directly use the Claude plugin marketplace compatibility:
codex plugin marketplace add trailofbits/skills
codex plugin list
codex plugin add <plugin-name>@trailofbits
Replace <plugin-name> with the plugin name corresponding to second-opinion shown in codex plugin list (repository directory is second-opinion).
For local development, in the parent directory of this repository:
cd /path/to/parent
/plugins marketplace add ./skills
Each provider also requires the corresponding CLI (codex, agy, or gemini) to be installed and signed in on the local machine. The documentation does not provide Cursor-specific installation steps, so they are not covered here.
Typical Usage¶
Examples from the official SKILL (slash-command form; the exact prefix depends on your host):
- Use Codex to review uncommitted changes (including staged, unstaged, untracked), focusing on bugs:
/second-opinion:second-opinion use Codex to review my uncommitted changes for bugs
- Compare Codex and Antigravity on this branch’s patch against
origin/main:
/second-opinion:second-opinion compare Codex and Antigravity on this branch against origin/main
- Use Gemini CLI to review a specified commit, focusing on security issues:
/second-opinion:second-opinion use Gemini CLI to review commit abc1234 for security issues
Natural-language triggers also work: e.g., requesting an external review, second opinion, or a codex / gemini / antigravity review.
Use Cases and Caveats¶
Suitable for: wanting a second model to scan the diff before committing or opening a PR; security or performance-focused reviews; comparing how Codex and Antigravity differ on the same change.
Limitations: it only produces findings; it does not automatically fix code or post to remote services like GitHub; it depends on external CLIs and account quotas; large diffs require proactively narrowing the scope; if the Gemini account no longer supports the client, migrate to Antigravity.
Alongside other audit capabilities in the repository such as differential-review (security-oriented diff review and git history), second-opinion focuses on “external CLI second opinions” and multi-provider comparison; choose according to your needs.
Closing¶
second-opinion packages “the same patch, cross-reviewed by multiple models” into a reusable Skill workflow, suitable for teams already using the Claude Code or Codex plugin marketplaces with Codex / Antigravity (or still-supported Gemini CLI) configured locally. Official Skill and documentation:
https://github.com/trailofbits/skills/tree/main/plugins/second-opinion/skills/second-opinion