A collaborative development environment that pairs Claude Code (Anthropic) with Codex CLI (OpenAI, GPT-5.3) and ChatGPT Pro (GPT-5.2 Pro), enabling you to leverage the strengths of multiple AI models.
| Claude Code (Primary) | Codex CLI (GPT-5.3) | ChatGPT Pro (GPT-5.2) |
|---|---|---|
| Fast iteration & prototyping | Deep, thorough code review | Extended thinking for complex analysis |
| Planning & orchestration | Complex algorithm implementation | 200k context for large codebases |
| Quick fixes & refactoring | Security vulnerability analysis | Second opinion on architecture |
| Context switching & multitasking | Meticulous edge case handling | Long-running deep reviews (5-30 min) |
By combining multiple models, you get rapid development velocity with rigorous quality checks and diverse perspectives.
- tmux - Terminal multiplexer
- Claude Code - Anthropic's CLI
- Codex CLI - OpenAI's CLI
- jq - JSON processor
- Node.js - For the MCP server
# macOS
brew install tmux jq node
# Claude Code & Codex CLI - follow their respective installation guidesgit clone https://github.com/antorsae/dual-agent.git
cd dual-agent
./setup-dual-agent.shThis will:
- Build the codex-delegate MCP server
- Install Claude skills to
~/.claude/skills/ - Install Codex skills to
~/.codex/skills/ - Configure Claude Code with MCP server and permissions
- Initialize the
.agent-collab/directory
After running setup, Claude Code has Codex tools available directly. Just ask naturally:
You: Review src/auth.ts for security vulnerabilities using codex
You: Have codex implement a rate limiter for the API
You: Ask codex to review my migration plan
Available MCP Tools:
| Tool | Description |
|---|---|
delegate_codex_review |
Code review (security, bugs, performance) |
delegate_codex_implement |
Implement features with Codex |
delegate_codex_plan_review |
Review implementation plans |
delegate_codex |
Send any custom prompt to Codex |
For interactive side-by-side work with both agents visible:
./start-dual-agent.shThis opens a split tmux session with Claude (left) and Codex (right).
Skills:
| Claude Skills | Codex Skills |
|---|---|
/codex-review |
$read-task |
/codex-implement |
$respond |
/codex-plan-review |
$claude-status |
/codex-read |
|
/codex-status |
Use GPT-5.2 Pro via Claude Code's Chrome integration for deep, extended-thinking code reviews:
# Start Claude Code with Chrome integration
claude --chromeThen ask naturally:
You: Review src/auth.ts with ChatGPT
You: Get GPT-5.2 Pro to review this migration plan
Prerequisites:
- Claude Code with
--chromeflag - Claude in Chrome extension (v1.0.36+)
- Logged into chat.com with ChatGPT Pro subscription
Workflow:
- Claude submits the code review request to GPT-5.2 Pro
- Returns immediately (non-blocking) - GPT-5.2 can take 5-30 minutes
- Ask Claude to "fetch ChatGPT results" when ready
Skill: /chatgpt-code-review
# 1. Run setup
./setup-dual-agent.sh
# 2. Restart Claude Code to load MCP tools
claude
# 3. Use naturally
> Review src/auth.ts for security issues using codex# 1. Run setup
./setup-dual-agent.sh
# 2. Start dual-agent environment
./start-dual-agent.sh
# 3. In Claude pane, use skills
> /codex-reviewYou: I just implemented authentication. Review src/auth.ts using codex
for security vulnerabilities.
Claude: I'll use the delegate_codex_review tool to have Codex analyze this file...
[Claude calls delegate_codex_review tool]
Claude: Codex found the following issues:
## Critical Issues
1. **SQL Injection (Line 45)**
The query uses string concatenation instead of parameterized queries.
Fix:
```python
cursor.execute("SELECT * FROM users WHERE id = ?", (user_id,))
```
2. **Weak Password Hashing (Line 78)**
Using MD5 instead of bcrypt/argon2.
...
[Claude Pane]
You: Review src/auth.ts for security issues
Claude: I'll delegate this to Codex for a thorough security review.
Delegating to Codex...
[Codex Pane - automatically receives task]
Codex: Reading task from Claude...
Analyzing src/auth.ts for security vulnerabilities...
[Deep analysis]
Response ready.
[Claude Pane - automatically reads response]
Claude: Codex completed the review. Here are the findings:
[Presents Codex's analysis]
+-----------------------------------------------------------------------------------+
| Claude Code |
| |
|+-----------------------+ +-----------------------+ +---------------------------+|
|| MCP Tools | | Skills (tmux) | | Skills (Chrome) ||
|| delegate_codex_* | | /codex-review | | /chatgpt-code-review ||
|+-----------+-----------+ +-----------+-----------+ +-------------+-------------+|
+------------+--------------------------+----------------------------+--------------+
| | |
v v v
+-----------------------+ +-----------------------+ +---------------------------+
| codex-delegate | | .agent-collab/ | | Chrome + chat.com |
| MCP Server | | (file-based IPC) | | (browser automation) |
| | | | | |
| Spawns codex CLI | | requests/task.md | | JavaScript injection |
+-----------+-----------+ +-----------+-----------+ +-------------+-------------+
| | |
v v v
+-----------+--------------------------+-----------+ +-------------+-------------+
| Codex CLI (GPT-5.3) | | GPT-5.2 Pro |
| | | |
| Deep code review & Implementation | | Extended thinking (5-30m) |
| Security analysis & Plan review | | 200k context + analysis |
+--------------------------------------------------+ +---------------------------+
Edit .agent-collab/context/shared.md to provide both agents with project context:
# Shared Project Context
## Project Overview
E-commerce platform using FastAPI + Redis + PostgreSQL
## Architecture Decisions
- All auth uses JWT with refresh rotation
- Redis for rate limiting and session storage
## Conventions
- Type hints required on all functions
- Pydantic models for all API schemasThe setup script configures ~/.claude/settings.json with:
{
"mcpServers": {
"codex-delegate": {
"command": "node",
"args": ["/path/to/dual-agent/agent/dist/mcp.js"]
}
},
"permissions": {
"allow": [
"Bash(cat .agent-collab:*)",
"Bash(tmux send-keys:*)",
...
]
}
}| Keys | Action |
|---|---|
Ctrl-b ←/→ |
Switch between Claude and Codex panes |
Ctrl-b d |
Detach from session |
Ctrl-b z |
Zoom current pane (fullscreen toggle) |
-
Check the setup completed successfully:
cat ~/.claude/settings.json | jq '.mcpServers'
-
Restart Claude Code:
claude
- Check tmux pane numbers:
tmux list-panes - Ensure Codex is running in pane 1
- Manually trigger:
tmux send-keys -t 1 '$read-task' Enter
echo "idle" > .agent-collab/status# Verify codex is installed and authenticated
codex "hello"dual-agent/
├── agent/ # MCP server & CLI
│ ├── src/
│ │ ├── mcp.ts # MCP server (delegate_codex_* tools)
│ │ ├── cli.ts # CLI wrapper
│ │ └── codex.ts # Codex subprocess spawner
│ └── dist/ # Compiled JS
├── .claude/skills/ # Claude Code skills
│ ├── codex-review/ # /codex-review (tmux mode)
│ ├── codex-implement/ # /codex-implement (tmux mode)
│ ├── codex-plan-review/ # /codex-plan-review (tmux mode)
│ ├── codex-read/ # /codex-read (tmux mode)
│ ├── codex-status/ # /codex-status (tmux mode)
│ └── chatgpt-code-review/ # /chatgpt-code-review (Chrome)
├── .codex/skills/ # Codex CLI skills
├── setup-dual-agent.sh # Setup script
├── start-dual-agent.sh # Tmux launcher
└── README.md
MIT