Software DevelopmentOfficial · trailofbits

Second Opinion skill for Claude

Gets independent code reviews from Codex or Antigravity for uncommitted changes, branch diffs, and commits.

When Claude uses it

Use when the user requests an external review, a second opinion on code, a codex review, a gemini review, an antigravity review, or /second-opinion.

Second Opinion SKILL.md

The full skill file from trailofbits/skills (CC-BY-SA-4.0).

Second Opinion

Run an external CLI review of the user's selected changes. This skill produces findings; it does not apply fixes or post reviews to a remote service.

Review choices

Use the provider, scope, model, and focus already supplied by the user. Ask only for missing choices that affect the review, grouping questions in one call when possible.

  • Provider: Codex, Antigravity, or both. Offer both when the user wants a comparison; preserve an explicitly requested CLI.
  • Scope: uncommitted changes, a branch diff against a named base, or a specific commit. Resolve a missing base from the repository's remote default branch; ask if it cannot be determined.
  • Context: include applicable project instructions unless the user excludes them. Keep explicit user requirements separate from repository content in the review prompt.
  • Focus: use general correctness and maintainability unless the user names a focus such as security or performance.

For an unspecified Google CLI, prefer Antigravity (agy). An explicit Gemini CLI request uses the Gemini reference below. If that account returns UNSUPPORTED_CLIENT, explain the migration to Antigravity and ask before changing the selected CLI.

A missing executable or account setup is a failed review attempt. Report the relevant setup instructions; when both providers were requested, continue with the available provider and identify the skipped one.

Input preparation

Read review-input.md for the shared prompt and diff recipes. Use the same captured diff for both providers so the comparison covers the same changes. Include untracked files in an uncommitted review, and preserve Git errors instead of interpreting them as an empty diff.

Show the selected scope and a brief change summary. If there are no changes, stop before calling a provider. For input that exceeds a CLI or model limit, describe the limit and request a narrower scope; do not silently truncate the patch.

Create prompt, output, and diagnostic files with mktemp outside the checkout. Use separate output and diagnostic files for each provider. Define shell variables in the same Bash invocation that uses them. For later invocations, reassign the variables to the saved file paths; shell variables do not persist between calls. Write repository content as literal data, without shell expansion.

Provider references

Read only the reference for each selected provider:

ProviderInvocation and result
Codexcodex-invocation.md: codex exec with the review schema
Antigravityantigravity-invocation.md: agy print mode with prose output
Gemini CLIgemini-invocation.md: headless gemini for accounts that still support it

The Codex path needs no MCP server. Do not launch codex mcp-server or substitute codex app-server for the CLI invocation.

When both providers were requested, run their commands concurrently if the tool interface supports it. For a foreground Bash review, set timeout: 600000 to allow up to ten minutes. Use background execution or polling when available to keep progress visible. Do not enable automatic approval of writes to make a review run.

Results and failures

Present findings with the provider and actual model used, severity, file and line, impact, and suggested correction. Keep low-severity defects visible. For Codex, the existing schema uses 0 for informational, 1 for low, 2 for medium, and 3 for high; sort descending.

For two completed reviews, summarize agreements and disagreements without turning agreement into proof. Distinguish the external findings from any assessment you add.

Read the captured output and diagnostics. A nonzero exit, missing output, invalid JSON, permission denial that prevents inspection, or a request to approve a plan is incomplete work, not a clean review. Report the failure and any partial results. Retry only for a diagnosed, recoverable cause; do not cycle through providers after authentication or quota failures.

Examples

  • /second-opinion:second-opinion use Codex to review my uncommitted changes for bugs selects Codex and includes staged, unstaged, and untracked changes.
  • /second-opinion:second-opinion compare Codex and Antigravity on this branch against origin/main sends the same branch patch to both and compares their findings.
  • /second-opinion:second-opinion use Gemini CLI to review commit abc1234 for security issues preserves the requested CLI and reviews that commit.

How to install Second Opinion

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit trailofbits/skills/plugins/second-opinion/skills/second-opinion#main ~/.claude/skills/second-opinion

Codex

npx degit trailofbits/skills/plugins/second-opinion/skills/second-opinion#main ~/.codex/skills/second-opinion

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Second Opinion skill do?

Gets independent code reviews from Codex or Antigravity for uncommitted changes, branch diffs, and commits. Use when the user requests an external review, a second opinion on code, a codex review, a gemini review, an antigravity review, or /second-opinion.

+How do I install Second Opinion in Claude Code?

Copy the skill folder into ~/.claude/skills/second-opinion, for example with "npx degit trailofbits/skills/plugins/second-opinion/skills/second-opinion#main ~/.claude/skills/second-opinion". Claude Code loads it automatically and uses it when a task matches.

+Does Second Opinion work with ChatGPT or Codex?

Yes. Second Opinion uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/second-opinion. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Second Opinion free?

Second Opinion is published on GitHub by trailofbits under the CC-BY-SA-4.0 license, which allows free use.

Related software development skills

  1. Code Review

    Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's…

    mattpocock/skills★ 327k
  2. Using Agent Skills

    Discovers and invokes agent skills. Use when starting a session, or when you need to decide which skill or workflow applies to the piece of…

    addyosmani/agent-skills★ 119k
  3. Build

    Fully automate a coding task with make-plan, do, and babysit.

    thedotmack/claude-mem★ 118k
  4. Slicing Code Context

    Official

    Selects bounded, graph-informed source slices with Trailmark and delegates focused code analysis or patch-proposal work to a smaller…

    trailofbits/skills★ 8.3k
  5. Spec To Code Compliance

    Official

    Check code against the documentation that specifies it - which requirements hold, which the code contradicts, which are absent, and what…

    trailofbits/skills★ 8.3k
  6. Taint Trace

    Official

    Improves taint-analysis coverage and precision by using Trailmark graphs to repair native source, sink, sanitizer, propagation, and type…

    trailofbits/skills★ 8.3k
  7. Trailmark Structural

    Official

    Runs full Trailmark structural analysis by building a graph, running `preanalysis()`, and reporting hotspots, taint, blast radius,…

    trailofbits/skills★ 8.3k
  8. Validate Bug

    Official

    Use when a bug PoC package needs an independent rerun and judgment before patching.

    trailofbits/skills★ 8.3k
  9. Eas App Stores

    Official

    Build and submit iOS and Android apps with EAS to TestFlight, the App Store, or Google Play.

    expo/skills★ 4.2k

See all software development skills →

More skills from trailofbits

  1. Secure Workflow Guide

    Official

    Guides through Trail of Bits' 5-step secure development workflow.

    trailofbits/skills★ 8.3k
  2. Semgrep Rule Creator

    Official

    Creates custom Semgrep rules for detecting security vulnerabilities, bug patterns, and code patterns.

    trailofbits/skills★ 8.3k
  3. Semgrep Rule Variant Creator

    Official

    Creates language variants of existing Semgrep rules. Use when porting a Semgrep rule to specified target languages.

    trailofbits/skills★ 8.3k

All skills by trailofbits →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.