Multi-Model Orchestration Protocol
A field manual for coordinating Claude Code, Gemini CLI, and OpenAI Codex CLI as a multi-model advisory system during planning and code review.
Multi-Model Orchestration Protocol
Claude Code can consult Gemini CLI and OpenAI Codex CLI as read-only advisors during planning and review phases. Both are installed and authenticated on this machine.
When to Invoke External Models
Use external models only for significant work:
- >Parallel research during plan mode or architecture exploration
- >Code review after changes spanning 5+ files
- >Tie-breaking on architecture decisions where trade-offs are unclear
- >Post-cutoff research for APIs, libraries, or frameworks that may have changed
Never invoke for trivial tasks, simple bug fixes, or when the answer is already clear.
Availability Check
Before each invocation, verify the CLI exists. Skip gracefully if missing:
which gemini >/dev/null 2>&1 && echo "available" || echo "unavailable" which codex >/dev/null 2>&1 && echo "available" || echo "unavailable"
Protocol: Parallel Research
For plan mode, architecture decisions, or exploring unfamiliar territory. Run both in parallel via background Bash calls, then synthesize.
# Gemini gemini --approval-mode plan -p "PROMPT" -m gemini-3.1-pro-preview -o json 2>/dev/null | jq -r '.response' # Codex codex exec -s read-only -m gpt-5.3-codex -c reasoning_effort=xhigh "PROMPT" 2>&1 | tail -1
Synthesis process:
- >Identify points of agreement between both models
- >Note disagreements and evaluate each side's reasoning
- >Highlight unique insights from either model
- >Claude makes the final decision, citing which inputs informed it
Always tell the user: "Consulting Gemini and Codex for additional perspectives..."
Protocol: Code Review
After implementing changes across multiple files, run Codex review for a second opinion.
# Review uncommitted changes codex exec review --uncommitted -m gpt-5.3-codex -c reasoning_effort=xhigh 2>&1 | tail -n +6 # Review against a base branch codex exec review --base main -m gpt-5.3-codex -c reasoning_effort=xhigh 2>&1 | tail -n +6
After receiving review output:
- >Evaluate each finding independently
- >Dismiss false positives with brief reasoning
- >Act on valid findings — fix the code
- >Summarize to the user what was found and what was addressed
Protocol: Gemini Deep Research
For researching technologies, APIs, or patterns that may have changed after Claude's knowledge cutoff (May 2025):
gemini --approval-mode plan -p "Research the current state of TOPIC. Include: latest version, breaking changes since May 2025, migration guides, and best practices as of 2026." -m gemini-3.1-pro-preview -o json 2>/dev/null | jq -r '.response'
Use this when:
- >A library version seems outdated in Claude's knowledge
- >The user references a feature Claude doesn't recognize
- >Documentation URLs or API signatures need verification
Safety Rules (Non-Negotiable)
- >Read-only enforcement: Gemini uses
--approval-mode plan(read-only). Codex uses-s read-only. NEVER use--full-auto,--yolo, or writable sandboxes. - >No secrets in prompts: Never pass API keys, passwords,
.envcontents, tokens, or credentials to external CLIs. - >Claude is the sole executor: External models advise only. Only Claude edits files, runs tests, and commits code.
- >Timeout: 60 minutes max per external call. Use
run_in_backgroundfor external calls. These models can take a while with high reasoning — that's fine. - >Cost awareness: No loops or repeated calls for the same question. One call per model per topic.
- >Transparency: Always inform the user before consulting external models and summarize what each returned.
Output Parsing Quick Reference
| CLI | Invocation | Response Extraction |
|---|---|---|
| Gemini | gemini --approval-mode plan -p "PROMPT" -m gemini-3.1-pro-preview -o json | | jq -r '.response' |
| Gemini (plain) | gemini --approval-mode plan -p "PROMPT" -m gemini-3.1-pro-preview | stdout directly |
| Codex exec | codex exec -s read-only -m gpt-5.3-codex -c reasoning_effort=xhigh "PROMPT" | | tail -1 |
| Codex review | codex exec review --uncommitted -m gpt-5.3-codex -c reasoning_effort=xhigh | | tail -n +6 |