๐Ÿง  BigBrain

March 14, 2026 ยท View on GitHub

MCP server that lets Claude Code talk to Codex (OpenAI) and Gemini (Google) CLIs. Claude stays in charge โ€” the other models provide second opinions. No API keys needed; both CLIs use their own cached OAuth.

๐Ÿน Origin Story

This project was born on a Saturday night vibecoding session fueled by spiced rum.

The kind of evening where you look at your API bill ๐Ÿ’ธ, look at your glass ๐Ÿฅƒ, and think: "there has to be a better way."

Turns out, both Codex and Gemini have CLIs with free OAuth access. So instead of paying per token like a responsible adult, BigBrain just shells out to the CLIs like a genius cheapskate. No API keys. No billing surprises on Monday morning. Just three AI models arguing with each other over stdio while you sip your drink. ๐Ÿน

Does it work? Yes. Is it elegant? Debatable. Did it save money? Absolutely. ๐Ÿ’ฐ Will your future self thank your rum-fueled past self? Also debatable. ๐Ÿ˜…

Enjoy responsibly (the rum and the code). ๐Ÿฅ‚

๐Ÿ—๏ธ Architecture

You ๐Ÿซต
 โ””โ”€> Claude Code (chairman โ€” decides, writes memory, synthesizes)
       โ””โ”€> BigBrain MCP Server (Python, FastMCP, stdio)
             โ”œโ”€> Codex CLI  (async subprocess)
             โ””โ”€> Gemini CLI (async subprocess)

๐Ÿ”— Shared context: Every prompt sent to Codex/Gemini is automatically prepended with the current project's CLAUDE.md and MEMORY.md. Claude is the sole writer of these files; the other models only read them.

๐Ÿ“ Dynamic project detection: All tools accept an optional project_path param. Falls back to BIGBRAIN_PROJECT_PATH env var, then cwd. Works with any Claude Code project.

๐Ÿ› ๏ธ Tools

ToolWhat it does
ask_codexAsk Codex a single question ๐Ÿค–
ask_geminiAsk Gemini a single question ๐Ÿ’Ž
ask_both_modelsAsk both in parallel, get both answers โšก
request_consensusBoth answer independently, then one synthesizes agreements/differences ๐Ÿค
request_debateMulti-round debate โ€” each model sees the other's previous answer (1โ€“5 rounds) ๐ŸฅŠ
request_councilThree-stage council with anonymized peer review (see below) ๐Ÿ‘‘

๐Ÿ‘‘ Council โ€” Three-Stage Process

The most thorough tool. All three models participate equally. Based on Karpathy's llm-council:

Stage 1: Individual ๐Ÿ—ฃ๏ธ       Stage 2: Peer Review ๐Ÿ”      Stage 3: Chairman ๐Ÿ›๏ธ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Claude  โ”‚โ”€โ”€> Answer A      โ”‚ Codex   โ”‚โ”€โ”€> Reviews &     โ”‚ Claude  โ”‚โ”€โ”€> Final
โ”‚ Codex   โ”‚โ”€โ”€> Answer B      โ”‚ Gemini  โ”‚    ranks all     โ”‚         โ”‚   answer
โ”‚ Gemini  โ”‚โ”€โ”€> Answer C      โ”‚ Claude  โ”‚    (anonymized)  โ”‚         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  (all three)                  (all three)                 (chairman)
  1. ๐Ÿ—ฃ๏ธ Individual โ€” Claude forms its opinion first, then Codex and Gemini answer independently in parallel. All three answers collected.
  2. ๐Ÿ” Peer Review โ€” All answers are anonymized as Model A/B/C. Codex and Gemini each review and rank them. Claude receives the same anonymized prompt and does its own review too. No model knows which answer is whose ๐Ÿ•ต๏ธ
  3. ๐Ÿ›๏ธ Chairman โ€” Claude synthesizes all three individual answers + all three peer reviews into the final answer.

๐Ÿš€ Quick Start

1. Prerequisites

Install the Codex and Gemini CLIs, then authenticate once:

npm install -g @openai/codex @google/gemini-cli
codex   # follow OAuth prompts ๐Ÿ”
gemini  # follow OAuth prompts ๐Ÿ”

2. Install & Register (one command each)

pip install git+https://github.com/Leonard013/BigBrain.git
claude mcp add bigbrain -- bigbrain

3. Done ๐ŸŽ‰

Restart Claude Code, run /mcp โ€” bigbrain should show as connected. โœ…

That's it. Start asking Claude to use ask_codex, ask_gemini, request_council, etc.


โš™๏ธ Advanced Configuration

Custom Python environment

If you want a dedicated env (conda, venv, etc.):

conda create -n bigbrain python=3.12 -y
conda activate bigbrain
pip install git+https://github.com/Leonard013/BigBrain.git

Then register with the full path to the bigbrain binary:

claude mcp add bigbrain -- /path/to/envs/bigbrain/bin/bigbrain

Override models

export BIGBRAIN_CODEX_MODEL="gpt-5.4"
export BIGBRAIN_GEMINI_MODEL="gemini-3.1-pro-preview"

Dev install (from source)

git clone https://github.com/Leonard013/BigBrain.git
cd BigBrain
pip install -e ".[dev]"
pytest tests/ -v