🌍 Cross-Platform Multi-AI Collaboration: Claude + Codex + Gemini
Windows | macOS | Linux — One Tool, All Platforms
🪟 Full Windows Support via WezTerm WezTerm is now the recommended terminal for all platforms. It's a powerful, cross-platform terminal with native split-pane support. Linux/macOS users: give it a try! tmux remains supported.
- ⚡ Faster Response — Optimized send/receive latency, significantly faster than MCP
- 🐛 macOS Fixes — Fixed session resume and various login issues
- 🔄 Easy Updates — Run
ccb updateinstead of re-cloning
Found a bug? Run
claudein the project directory to debug, then share yourgit diffwith the maintainer!
Traditional MCP calls treat Codex as a stateless executor—Claude must feed full context every time.
ccb (Claude Code Bridge) establishes a persistent, lightweight channel for sending/receiving small messages while each AI maintains its own context.
| Role | Responsibilities |
|---|---|
| Claude Code | Requirements analysis, architecture planning, code refactoring |
| Codex | Algorithm implementation, bug hunting, code review |
| Gemini | Research, alternative perspectives, verification |
| ccb | Session management, context isolation, communication bridge |
| Aspect | MCP (Official) | Persistent Dual-Pane |
|---|---|---|
| Codex State | Stateless | Persistent session |
| Context | Passed from Claude | Self-maintained |
| Token Cost | 5k-20k/call | 50-200/call (much faster) |
| Work Mode | Master-slave | Parallel |
| Recovery | Not possible | Supported (-r) |
| Multi-AI | Single target | Multiple backends |
Prefer MCP? Check out CodexMCP — a more powerful MCP implementation with session context and multi-turn support.
Token Savings Explained
MCP approach:
Claude → [full code + history + instructions] → Codex
Cost: 5,000-20,000 tokens/call
Dual-pane approach (only sends/receives small messages):
Claude → "optimize utils.py" → Codex
Cost: 50-200 tokens/call
(Codex reads the file itself)
git clone https://github.com/bfly123/claude_code_bridge.git
cd claude_code_bridge
./install.sh install- WSL2 (recommended): run the same commands inside WSL.
- Native Windows (PowerShell/CMD): use the wrappers:
install.cmd install- or
powershell -ExecutionPolicy Bypass -File .\\install.ps1 install(you will be prompted forBackendEnv)
- WezTerm-only (no tmux): run
ccbinside WezTerm, or setCCB_TERMINAL=wezterm(and if neededCODEX_WEZTERM_BINtowezterm.exe).
ccb and codex/gemini must run in the same environment. Otherwise you may see:
exit code 127(command not found)cpend/gpendcannot find replies (different session directories)
Install-time selection is persisted to ccb_config.json (or override with CCB_BACKEND_ENV):
BackendEnv=wsl: codex/gemini runs in WSL (recommended if you typecodexinside a WSL shell).BackendEnv=windows: codex/gemini runs as native Windows CLI.
ccb up codex # Start with Codex
ccb up gemini # Start with Gemini
ccb up codex gemini # Start both
ccb up codex -r # Resume previous session
ccb up codex -a # Full permissions modeccb status # Check backend status
ccb kill codex # Terminate session
ccb restore codex # Attach to running session
ccb update # Update to latest version
-aenables--dangerously-skip-permissionsfor Claude and--full-autofor Codex.
-rresumes based on local dotfiles in the current directory (.claude-session,.codex-session,.gemini-session); delete them to reset.
- "Have Codex review my code changes"
- "Ask Gemini for alternative approaches"
- "Codex plans the refactoring, supervises while I implement"
- "Codex writes backend API, I handle frontend"
🎴 Featured: AI Poker Night!
"Let Claude, Codex and Gemini play Dou Di Zhu (斗地主)! You deal the cards, everyone plays open hand!" 🃏 Claude (Landlord) vs 🎯 Codex + 💎 Gemini (Farmers)
- "Play Gomoku with Codex"
- "Debate: tabs vs spaces"
- "Codex writes a function, Claude finds the bugs"
- "Codex designs architecture, Claude implements modules"
- "Parallel code review from different angles"
- "Codex implements, Gemini reviews, Claude coordinates"
Most users don't need these—Claude auto-detects collaboration intent.
Codex:
| Command | Description |
|---|---|
cask-w <msg> |
Sync: wait for reply |
cask <msg> |
Async: fire-and-forget |
cpend |
Show latest reply |
cping |
Connectivity check |
Gemini:
| Command | Description |
|---|---|
gask-w <msg> |
Sync: wait for reply |
gask <msg> |
Async: fire-and-forget |
gpend |
Show latest reply |
gping |
Connectivity check |
- Python 3.10+
- tmux or WezTerm (at least one; WezTerm recommended)
⚠️ Windows Users: Always install WezTerm using the native Windows .exe installer from wezfurlong.org/wezterm, even if you use WSL. Do NOT install WezTerm inside WSL. After installation, configure WezTerm to connect to WSL viawsl.exeas the default shell. This ensures proper split-pane functionality.
./install.sh uninstall🪟 全面支持 Windows — 通过 WezTerm WezTerm 现已成为所有平台的推荐终端。它是一个强大的跨平台终端,原生支持分屏。Linux/macOS 用户也推荐使用!当然短期tmux仍然支持。
- ⚡ 响应更快 — 优化了发送/接收延迟,显著快于 MCP
- 🐛 macOS 修复 — 修复了会话恢复和各种登录问题
- 🔄 一键更新 — 运行
ccb update即可更新,无需重新拉取安装
发现 bug?在项目目录运行
claude调试,然后将git diff发给作者更新到主分支!
传统 MCP 调用把 Codex 当作无状态执行器——Claude 每次都要传递完整上下文。
ccb (Claude Code Bridge) 建立持久通道 轻量级发送和抓取信息, AI间各自维护独立上下文。
| 角色 | 职责 |
|---|---|
| Claude Code | 需求分析、架构规划、代码重构 |
| Codex | 算法实现、bug 定位、代码审查 |
| Gemini | 研究、多角度分析、验证 |
| ccb | 会话管理、上下文隔离、通信桥接 |
| 维度 | MCP(官方方案) | 持久双窗口 |
|---|---|---|
| Codex 状态 | 无记忆 | 持久会话 |
| 上下文 | Claude 传递 | 各自维护 |
| Token 消耗 | 5k-20k/次 | 50-200/次(速度显著提升) |
| 工作模式 | 主从 | 并行协作 |
| 会话恢复 | 不支持 | 支持 (-r) |
| 多AI | 单目标 | 多后端 |
偏好 MCP? 推荐 CodexMCP — 更强大的 MCP 实现,支持会话上下文和多轮对话。
Token 节省原理
MCP 方式:
Claude → [完整代码 + 历史 + 指令] → Codex
消耗:5,000-20,000 tokens/次
双窗口方式(每次仅发送和抓取少量信息):
Claude → "优化 utils.py" → Codex
消耗:50-200 tokens/次
(Codex 自己读取文件)
git clone https://github.com/bfly123/claude_code_bridge.git
cd claude_code_bridge
./install.sh install- 推荐 WSL2: 在 WSL 内执行上面的命令即可。
- 原生 Windows(PowerShell/CMD): 使用包装脚本:
install.cmd install- 或
powershell -ExecutionPolicy Bypass -File .\\install.ps1 install(会提示选择BackendEnv)
- 仅 WezTerm(无 tmux): 建议在 WezTerm 中运行
ccb,或设置CCB_TERMINAL=wezterm(必要时设置CODEX_WEZTERM_BIN=wezterm.exe)。
ccb/cask-w 必须和 codex/gemini 在同一环境运行,否则可能出现:
exit code 127(找不到命令)cpend/gpend读不到回复(会话目录不同)
安装时的选择会写入 ccb_config.json(也可用环境变量 CCB_BACKEND_ENV 覆盖):
BackendEnv=wsl:codex/gemini 安装并运行在 WSL(如果你是在 WSL 里直接输入codex的场景,推荐选这个)BackendEnv=windows:codex/gemini 为 Windows 原生 CLI
ccb up codex # 启动 Codex
ccb up gemini # 启动 Gemini
ccb up codex gemini # 同时启动
ccb up codex -r # 恢复上次会话
ccb up codex -a # 最高权限模式ccb status # 检查后端状态
ccb kill codex # 终止会话
ccb restore codex # 连接到运行中的会话
ccb update # 更新到最新版本
-a为 Claude 启用--dangerously-skip-permissions,Codex 启用--full-auto。
-r基于当前目录下的本地文件恢复(.claude-session/.codex-session/.gemini-session);删除这些文件即可重置。
- "让 Codex 审查我的代码修改"
- "问问 Gemini 有没有其他方案"
- "Codex 规划重构方案,我来实现它监督"
- "Codex 写后端 API,我写前端"
🎴 特色玩法:AI 棋牌之夜!
"让 Claude、Codex 和 Gemini 来一局斗地主! 你来发牌,大家明牌玩!" 🃏 Claude (地主) vs 🎯 Codex + 💎 Gemini (农民)
- "和 Codex 下五子棋"
- "辩论:Tab vs 空格"
- "Codex 写函数,Claude 找 bug"
- "Codex 设计架构,Claude 实现各模块"
- "两个 AI 从不同角度并行 Code Review"
- "Codex 实现,Gemini 审查,Claude 协调"
普通用户无需使用这些命令——Claude 会自动检测协作意图。
Codex:
| 命令 | 说明 |
|---|---|
cask-w <消息> |
同步:等待回复 |
cask <消息> |
异步:发送即返回 |
cpend |
查看最新回复 |
cping |
测试连通性 |
Gemini:
| 命令 | 说明 |
|---|---|
gask-w <消息> |
同步:等待回复 |
gask <消息> |
异步:发送即返回 |
gpend |
查看最新回复 |
gping |
测试连通性 |
- Python 3.10+
- tmux 或 WezTerm(至少安装一个),强烈推荐 WezTerm
⚠️ Windows 用户注意: 必须使用 Windows 原生 .exe 安装包 安装 WezTerm(下载地址),即使你使用 WSL 也是如此。不要在 WSL 内部安装 WezTerm。安装完成后,可在 WezTerm 设置中将默认 shell 配置为wsl.exe,即可无缝接入 WSL 环境,同时保证分屏功能正常工作。
./install.sh uninstall
