Collaborative development workflow using Claude Code and Codex together. Use this skill when the user wants to leverage both Claude Code (for planning, search, architecture) and Codex (for code generation, refactoring, bug fixes) in a coordinated workflow. Triggers on phrases like "cc codex", "codex collaboration", "collaborative coding", or when complex development tasks would benefit from dual-AI orchestration.
Orchestrate Claude Code and Codex working together for superior development outcomes.
This skill coordinates two AI systems:
The workflow maximizes each AI's strengths while compensating for their limitations.
~/.claude.json:{
"mcpServers": {
"codex": {
"type": "stdio",
"command": "codex",
"args": ["mcp-server"],
"env": {
"HTTP_PROXY": "http://127.0.0.1:7897",
"HTTPS_PROXY": "http://127.0.0.1:7897",
"NO_PROXY": "localhost,127.0.0.1"
}
}
}
}
Gather context using available tools:
Output: Context report covering tech stack, relevant files, patterns, and potential risks.
Create a structured plan using this template:
## Tech Spec
Goal: [Single sentence objective]
Tech: [Language/framework/libraries]
Risks: [Potential breaking changes]
Compatibility: [How to preserve existing behavior]
## Tasks
- [ ] Task 1: [Description]
- Executor: Codex
- Files: [Paths]
- Constraints: [Limitations]
- Acceptance: [Verification criteria]
Delegate code tasks to Codex via MCP:
mcp__codex__codex({
"sandbox": "danger-full-access",
"approval-policy": "on-failure",
"prompt": "<structured prompt with context, task, constraints, acceptance criteria>"
})
Session Management:
threadId from the responsemcp__codex__codex-reply for follow-up messages:
mcp__codex__codex-reply({
"threadId": "<saved-thread-id>",
"prompt": "<next instruction>"
})
Verify the implementation:
If issues found, return to Phase 3 with specific fixes.
| Task Type | Executor | Rationale |
|---|---|---|
| Code changes | Codex | Strong code generation |
| New features | Codex | Better implementation quality |
| Bug fixes | Codex | Better code understanding |
| Refactoring | Codex | Global code comprehension |
| Architecture | Claude Code | Planning strength |
| Documentation | Claude Code | No code generation needed |
| Trivial edits (<20 lines) | Claude Code | Too simple for Codex overhead |
When calling Codex, use this structure:
## Context
- Tech Stack: [language/framework/version]
- Files: [path]: [purpose]
- Reference: [file for pattern/style]
## Task
[Clear, specific, verifiable task]
Steps:
1. [First step]
2. [Second step]
3. [Third step]
## Constraints
- API: Don't change [signatures]
- Performance: [requirements]
- Style: Follow [reference file]
- Scope: Only modify [specified files]
- Dependencies: No new deps without approval
## Acceptance Criteria
- [ ] Tests pass
- [ ] Types compile
- [ ] Linter clean
- [ ] [Project-specific criteria]
| Pattern | Problem | Solution |
|---|---|---|
| Claude Code writing code | Wastes Codex strength | Delegate to Codex |
| Vague Codex prompts | Poor output quality | Use structured template |
| Skipping validation | Hidden bugs | Always run Phase 4 |
| Missing threadId | Lost context | Save and reuse threadId |
| Ignoring constraints | Breaks existing code | Document all constraints |
/cc-codex-flow Add email validation to the user registration form
/cc-codex-flow Implement user authentication with JWT, including login, registration, password reset, and session management
/cc-codex-flow Refactor the payment processing module to use the strategy pattern for multiple payment providers