Multi-model code review and planning pipeline via PAL MCP with Codex and Gemini CLI subagents
From README links · today
Orchestrated Codex and Gemini CLI subagents through PAL MCP for isolated
What they did
They wired PAL MCP (Provider Abstraction Layer) into their existing CLI so a single session could call out to multiple models and external CLIs. Using the clink tool, they spawned isolated Codex subagents to audit an auth module for security issues without polluting the main context window, then ran a consensus step between GPT-5 and Gemini Pro to decide between two roadmap options (dark mode vs offline support). The winning recommendation was handed off to a Gemini CLI subagent via clink, which received the full debate context and started implementing the feature. Conversation threading carried context forward across the review, the debate, and the implementation, so each tool picked up where the last left off rather than restarting from scratch.
How it went
The workflow produced a clean security review report, a documented model debate with a clear recommendation, and an implementation started in a fresh context. Context isolation kept the main session unpolluted, and the handoff preserved reasoning between tools. Polish level is high for the orchestration pattern itself, though the actual code output still needs human review before merge.
Worth knowing
Requires PAL MCP configured as an MCP server plus API keys or local model access for each provider used. External CLI subagents need Codex CLI and Gemini CLI installed and authenticated. Subagent runs consume tokens and time, and isolated contexts mean you must explicitly pass findings forward. Consensus debates can stall on ambiguous prompts, so scope questions tightly.
Wiring
Install pal-mcp-server and register it as an MCP server in the host CLI (Claude Code, Codex CLI, Cursor, or similar). Configure provider credentials for the models you want (Gemini, OpenAI, Anthropic, Grok, Azure, Ollama, OpenRouter, DIAL, or on-device). Ensure Codex CLI and Gemini CLI are installed and authenticated for clink subagents. Order of operations: main CLI calls clink with a role (e.g., codereviewer) to spawn an isolated sub-CLI; the sub-CLI runs with its own context and returns final results; the main session then calls consensus with two model names to compare positions; finally clink is invoked again with the chosen CLI and the prior context so implementation continues seamlessly. Conversation threading links the steps so context carries forward between tools.
Try it yourself
Set up PAL MCP in this repo and use it to run a multi-model workflow: (1) use clink with a codex codereviewer role to audit the auth module for security issues in an isolated context and return only the final report; (2) run a consensus between gpt-5 and gemini-pro on whether we should prioritize dark mode or offline support next, given the current codebase; (3) hand the winning recommendation to a gemini CLI subagent via clink with the full debate context and have it draft the implementation plan and first commit. Keep my main session context clean and summarize each step's output.
Tools in this stack
Run this stack
Install the stack into this project. It writes AGENTS.md and the manifest, merges the MCP servers into .mcp.json, and — with --yes — runs the tool installs.
npx runchr install runchr/stack-codex-and-gemini-cli-and-pal-mcp-servercurl -s https://api.runchr.com/api/recipes/runchr/stack-codex-and-gemini-cli-and-pal-mcp-server/manifestThis stack has no prompt yet. You get the tools and the wiring, not the prompt.
The manifest is also at api.runchr.com/api/recipes/runchr/stack-codex-and-gemini-cli-and-pal-mcp-server/manifest.