home / skills / seika139 / dotfiles / with-codex-skills

This skill enables collaborative problem solving by running Claude Code and Codex side-by-side in tmux, providing integrated analysis and dual AI insights.

npx playbooks add skill seika139/dotfiles --skill with-codex-skills

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
3.6 KB
---
name: with-codex
description: Enables Claude Code to collaborate with OpenAI Codex CLI on Windows. Use this skill when the user wants to get a second opinion from Codex, compare approaches between Claude and Codex, or leverage both AI assistants for collaborative problem-solving. This skill supports both non-interactive mode (automatic response retrieval) and interactive mode (visual pane splitting with tmux).
---

# With Codex - Claude and Codex Collaboration

This skill enables collaboration between Claude Code and OpenAI Codex CLI for second opinions, validation, and collaborative problem-solving.

## CRITICAL REQUIREMENT

**Claude Code MUST be running inside a tmux session for this skill to work.**

If not in tmux, inform the user:
"このスキルを使用するには、tmuxセッション内でClaude Codeを起動する必要があります。以下のコマンドを実行してください:

```bash
tmux new-session -s claude
claude
```

"

## Environment Requirements

- WSL (Ubuntu) with tmux installed
- OpenAI Codex CLI installed and authenticated in WSL
- Claude Code running inside a tmux session
- Skill scripts at: `~/.claude/skills/with-codex/scripts/`

## Standard Workflow (MUST FOLLOW)

When this skill is triggered, ALWAYS execute these steps in order:

### Step 1: Setup - Split pane and start Codex

```bash
~/.claude/skills/with-codex/scripts/codex-manager.sh setup
```

This splits the current tmux pane:

- Left pane: Claude Code (current)
- Right pane: Codex CLI (newly created, with dark background)

### Step 2: Claude performs its own analysis first

Analyze the user's request independently before querying Codex.

### Step 3: Send the same prompt to Codex

```bash
~/.claude/skills/with-codex/scripts/codex-manager.sh send "YOUR_PROMPT_HERE"
```

Replace `YOUR_PROMPT_HERE` with the actual question/task from the user.

### Step 4: Wait for Codex response

```bash
~/.claude/skills/with-codex/scripts/codex-manager.sh wait 60
```

Wait up to 60 seconds for Codex to complete its response.

### Step 5: Capture Codex output

```bash
~/.claude/skills/with-codex/scripts/codex-manager.sh capture 200
```

Capture the last 200 lines of Codex's output.

### Step 6: Present combined results

Present results in this format:

```markdown
## Claude's Analysis
[Your independent analysis]

## Codex's Analysis
[Captured response from Codex]

## Synthesis
- **Agreement**: [Points where both AIs agree]
- **Differences**: [Alternative perspectives from Codex]
- **Recommendation**: [Best combined approach]
```

### Step 7: Cleanup (when conversation ends or user requests)

```bash
~/.claude/skills/with-codex/scripts/codex-manager.sh cleanup
```

## Available Commands

| Command | Description |
| ------- | ----------- |
| `setup` | Split pane and start Codex on the right |
| `send "prompt"` | Send prompt to Codex pane |
| `capture [lines]` | Capture Codex output (default: 100 lines) |
| `wait [timeout]` | Wait for response to stabilize (default: 60s) |
| `cleanup` | Close the Codex pane |
| `status` | Check pane status |
| `focus` | Switch focus to Codex pane |

## Error Handling

If setup fails with "Not running inside tmux":

- Inform user they need to start Claude Code inside tmux
- Provide the commands: `tmux new-session -s claude` then `claude`

## Alternative: Non-Interactive Mode

Only use when tmux is unavailable or user explicitly requests:

```bash
codex exec "your prompt" 2>/dev/null
```

## Best Practices

1. ALWAYS use tmux interactive mode by default
2. Let user see both AIs working side-by-side
3. Wait adequate time (30-60s) for complex Codex queries
4. Present both perspectives without bias
5. Acknowledge both AIs can be wrong - user makes final decision

Overview

This skill enables Claude Code to collaborate with the OpenAI Codex CLI on Windows (via WSL) to get a second opinion, compare approaches, and co-solve problems. It supports an interactive tmux-pane workflow for side-by-side collaboration and a non-interactive fallback for quick Codex calls. Use it when you want dual-AI analysis and a synthesized recommendation.

How this skill works

The skill requires Claude Code to be running inside a tmux session. It automates splitting the tmux pane, launching the Codex CLI on the right pane, sending the same user prompt to Codex, waiting for Codex to respond, capturing Codex output, and then delivering a combined report: Claude's independent analysis, Codex's captured output, and a synthesis with agreement, differences, and a recommendation. A non-interactive mode runs a direct Codex exec call when tmux is unavailable or explicitly requested.

When to use it

  • When you want a second AI opinion or validation of Claude's solution.
  • When comparing algorithmic approaches, implementations, or debugging strategies.
  • When you prefer to watch both assistants work side-by-side in tmux.
  • When you need a synthesized recommendation combining both AIs.
  • When tmux is not available but a quick Codex response is acceptable (non-interactive mode).

Best practices

  • Always run Claude Code inside a tmux session before invoking the skill.
  • Prefer interactive tmux mode so you can observe both assistants simultaneously.
  • Let Claude analyze first, then send the exact same prompt to Codex for an unbiased comparison.
  • Wait 30–60 seconds for Codex on complex queries before capturing output.
  • Present both outputs clearly and highlight agreements, differences, and a final recommendation.
  • Treat both AIs as advisory; validate critical results manually.

Example use cases

  • Debugging a stubborn build error: Claude proposes fixes, Codex suggests alternates, then synthesize the safest patch.
  • Comparing two implementations of an algorithm for performance and clarity.
  • Validating security-sensitive code patterns with two independent analyses.
  • Generating and reviewing unit tests: Claude crafts tests, Codex offers additional edge cases, then combine.
  • Exploring different shell automation solutions and choosing the most robust approach.

FAQ

What is the single critical requirement for this skill to work?

Claude Code must be running inside a tmux session. If not, start a tmux session and run Claude there.

What if tmux is not available on my system?

Use the non-interactive fallback which runs a direct Codex exec command, but expect less visibility and interactivity.