TEXT

Second Opinion

Contributed by ilkerulusoy

Improved by Laravel Company · 2026-09-07

Second Opinion: Expert Consultation from Gemini and Codex

Invocation Overview

When this tool is executed, it initiates a comprehensive, parallel analysis of your coding problem using two specialized subagents: gemini-consultant and codex-consultant. The primary goal is to provide a detailed, comparative report that combines the unique insights of both AI systems to guide your problem-solving process effectively.

Tool Execution Process

Step 1: Problem Identification

  • The tool automatically extracts the coding problem from the conversation context.
  • It generates a clear, concise summary of the problem (~100 words), ensuring both subagents have a shared understanding of the challenge you're facing.

Step 2: Parallel Subagent Deployment

  • Gemini Consultation: The gemini-consultant subagent is spawned with the following command, providing Gemini with the problem summary to analyze:

    bash
    gemini -p "I'm working on a coding problem... [problem summary]"
  • Codex Consultation: Simultaneously, the codex-consultant subagent is deployed using the Task tool, executing the problem summary through the Codex AI:

    bash
    codex exec "I'm working on a coding problem... [problem summary]"

Step 3: Combined Results Presentation

The tool aggregates and presents a unified report that includes:

  • Gemini's Perspective: A detailed, expert assessment of the coding problem from Gemini's unique analytical capabilities.

  • Codex's Perspective: An in-depth technical analysis of the same problem, leveraging Codex's advanced coding insights and expertise.

  • Agreement Analysis: A side-by-side comparison highlighting the areas where Gemini and Codex agree, providing a solid foundation for your problem-solving approach.

  • Differences and Recommendations: A clear breakdown of the divergent opinions between the two AI systems, along with a recommended approach that maximizes the benefits of both perspectives.

Tool Constraints and Assumptions

  • The tool assumes that the problem summary extracted from the conversation context is sufficiently clear and comprehensive to enable meaningful analysis by both subagents.
  • It operates under the assumption that the coding problem presented is within the technical scope of both Gemini and Codex's expertise.

Expected Output Format

The output will be a well-structured report that separates Gemini's and Codex's analyses and provides clear, actionable insights to help you effectively approach and solve the identified coding problem. The report will be designed for easy reference and assimilation, ensuring that you can extract the maximum value from the expertise of both AI systems.

Original prompt (before our improvements)

--- name: second-opinion description: Second Opinion from Codex and Gemini CLI for Claude Code --- # Second Opinion When invoked: 1. **Summarize the problem** from conversation context (~100 words) 2. **Spawn both subagents in parallel** using Task tool: - `gemini-consultant` with the problem summary - `codex-consultant` with the problem summary 3. **Present combined results** showing: - Gemini's perspective - Codex's perspective - Where they agree/differ - Recommended approach ## CLI Commands Used by Subagents ```bash gemini -p "I'm working on a coding problem... [problem]" codex exec "I'm working on a coding problem... [problem]" ```