with-codex
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWith Codex - Claude and Codex Collaboration
Claude与Codex协作
This skill enables collaboration between Claude Code and OpenAI Codex CLI for second opinions, validation, and collaborative problem-solving.
此技能可实现Claude Code与OpenAI Codex CLI之间的协作,用于获取第二意见、验证方案以及协作解决问题。
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"
必须在tmux会话中运行Claude Code,此技能才能正常工作。
如果未处于tmux会话中,请告知用户:
"要使用此技能,必须在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/
- 已安装tmux的WSL(Ubuntu)环境
- WSL中已安装并完成认证的OpenAI Codex CLI
- 在tmux会话中运行的Claude Code
- 技能脚本路径:
~/.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
步骤1:设置 - 分屏并启动Codex
bash
~/.claude/skills/with-codex/scripts/codex-manager.sh setupThis splits the current tmux pane:
- Left pane: Claude Code (current)
- Right pane: Codex CLI (newly created, with dark background)
bash
~/.claude/skills/with-codex/scripts/codex-manager.sh setup此命令会拆分当前tmux面板:
- 左侧面板:Claude Code(当前会话)
- 右侧面板:Codex CLI(新创建,深色背景)
Step 2: Claude performs its own analysis first
步骤2:Claude先独立完成分析
Analyze the user's request independently before querying Codex.
在向Codex发起查询前,先独立分析用户的请求。
Step 3: Send the same prompt to Codex
步骤3:向Codex发送相同的提示词
bash
~/.claude/skills/with-codex/scripts/codex-manager.sh send "YOUR_PROMPT_HERE"Replace with the actual question/task from the user.
YOUR_PROMPT_HEREbash
~/.claude/skills/with-codex/scripts/codex-manager.sh send "YOUR_PROMPT_HERE"将替换为用户实际的问题或任务。
YOUR_PROMPT_HEREStep 4: Wait for Codex response
步骤4:等待Codex的响应
bash
~/.claude/skills/with-codex/scripts/codex-manager.sh wait 60Wait up to 60 seconds for Codex to complete its response.
bash
~/.claude/skills/with-codex/scripts/codex-manager.sh wait 60最多等待60秒,直至Codex完成响应。
Step 5: Capture Codex output
步骤5:捕获Codex的输出
bash
~/.claude/skills/with-codex/scripts/codex-manager.sh capture 200Capture the last 200 lines of Codex's output.
bash
~/.claude/skills/with-codex/scripts/codex-manager.sh capture 200捕获Codex输出的最后200行内容。
Step 6: Present combined results
步骤6:展示合并后的结果
Present results in this format:
markdown
undefined请按照以下格式展示结果:
markdown
undefinedClaude's Analysis
Claude的分析
[Your independent analysis]
[你的独立分析内容]
Codex's Analysis
Codex的分析
[Captured response from Codex]
[捕获到的Codex响应内容]
Synthesis
综合总结
- Agreement: [Points where both AIs agree]
- Differences: [Alternative perspectives from Codex]
- Recommendation: [Best combined approach]
undefined- 共识点:[两款AI达成一致的内容]
- 差异点:[Codex提出的不同视角]
- 推荐方案:[结合两者优势的最佳方案]
undefinedStep 7: Cleanup (when conversation ends or user requests)
步骤7:清理(对话结束或用户要求时)
bash
~/.claude/skills/with-codex/scripts/codex-manager.sh cleanupbash
~/.claude/skills/with-codex/scripts/codex-manager.sh cleanupAvailable Commands
可用命令
| Command | Description |
|---|---|
| Split pane and start Codex on the right |
| Send prompt to Codex pane |
| Capture Codex output (default: 100 lines) |
| Wait for response to stabilize (default: 60s) |
| Close the Codex pane |
| Check pane status |
| Switch focus to Codex pane |
| 命令 | 描述 |
|---|---|
| 拆分面板并在右侧启动Codex |
| 向Codex面板发送提示词 |
| 捕获Codex的输出(默认:100行) |
| 等待响应稳定(默认:60秒) |
| 关闭Codex面板 |
| 检查面板状态 |
| 切换焦点至Codex面板 |
Error Handling
错误处理
If setup fails with "Not running inside tmux":
- Inform user they need to start Claude Code inside tmux
- Provide the commands: then
tmux new-session -s claudeclaude
如果设置时出现“Not running inside tmux”(未在tmux中运行)错误:
- 告知用户需要在tmux会话中启动Claude Code
- 提供命令:然后执行
tmux new-session -s claudeclaude
Alternative: Non-Interactive Mode
替代方案:非交互模式
Only use when tmux is unavailable or user explicitly requests:
bash
codex exec "your prompt" 2>/dev/null仅当tmux不可用或用户明确要求时使用:
bash
codex exec "your prompt" 2>/dev/nullBest Practices
最佳实践
- ALWAYS use tmux interactive mode by default
- Let user see both AIs working side-by-side
- Wait adequate time (30-60s) for complex Codex queries
- Present both perspectives without bias
- Acknowledge both AIs can be wrong - user makes final decision
- 默认情况下始终使用tmux交互模式
- 让用户能够看到两款AI同时工作的过程
- 对于复杂的Codex查询,等待足够的时间(30-60秒)
- 无偏见地展示两种视角
- 需告知用户两款AI都可能出错,最终决策由用户做出