Enables Claude Code to automatically delegate complex tasks to OpenAI Codex CLI for AI-to-AI collaboration
Codex Delegator is a Claude Code Agent Skill - a specialized module that extends Claude Code with the ability to automatically delegate complex, logic-intensive programming tasks to OpenAI's Codex CLI.
Think of it as giving Claude Code a specialized co-worker (Codex) for handling particularly challenging problems.
When you're working with Claude Code and encounter:
- 🔧 Complex backend logic implementations
- 🧮 Intricate algorithm optimizations
- 🐛 Persistent bugs that resist multiple fix attempts
- 🔄 Race conditions and concurrency issues
- 💡 Problems needing a fresh perspective
Claude Code can automatically invoke Codex to provide alternative solutions, leveraging the strengths of both AI systems.
You: "This payment processing bug keeps happening under high load,
I've tried 3 different fixes"
↓
Claude Code: [Analyzes problem, recognizes delegation criteria]
"I'm going to use Codex to help debug this race condition..."
↓
Codex: [Analyzes with fresh perspective, generates solution]
↓
Claude Code: [Validates solution, runs tests, integrates]
"Here's the fix. The issue was a race condition in Redis cache updates..."
- Claude Code - Install from claude.com/claude-code
- OpenAI Codex CLI - Install globally:
npm i -g @openai/codex
- Authentication - ChatGPT Plus/Pro/Business/Enterprise account OR OpenAI API key:
codex auth
Option 1: Download and Extract
- Download
codex-delegator.zip - Extract to
~/.claude/skills/codex-delegator - Restart Claude Code
Option 2: Git Clone (if developing)
cd ~/.claude/skills
git clone https://github.com/your-org/codex-delegator.gitYou: "This race condition in my payment system has been
failing 5% of transactions. I've tried adding
transactions, increasing Redis TTL, and retry logic."
Claude Code: "I'm delegating this to Codex for a fresh
analysis of the race condition..."
[Codex analyzes and fixes]
Claude Code: "Found the issue - your webhook handler and
order service were competing for cache locks.
Here's the fix using distributed locking..."
You: "My recommendation engine is too slow - 30 seconds
for 10k items. Need to handle 100k+ items."
Claude Code: "This is a complex optimization problem.
Using Codex to explore algorithmic improvements..."
[Codex optimizes]
Claude Code: "Reduced complexity from O(n²) to O(n log n)
using spatial indexing. Now processes 100k
items in under 1 second."
The skill uses intelligent decision-making to determine when delegation is beneficial. It automatically delegates when:
- ✅ Problem attempted 2+ times without resolution
- ✅ High logic complexity (nested conditions, complex state)
- ✅ Backend/algorithm heavy tasks
- ✅ Need for different problem-solving approach
codex-delegator/
├── SKILL.md # Main skill documentation
├── references/
│ └── execution_strategies.md # Detailed Codex usage patterns
└── README.md # This file
- Claude Code: Latest version recommended
- Codex CLI: v0.58.0+
- Node.js: For Codex CLI installation
- Git repository: Codex works best in version-controlled projects
- OpenAI Account: ChatGPT Plus/Pro/Business/Enterprise OR API key
This skill is designed for complex problems. It's not used for:
- Simple CRUD operations
- Basic UI components
- Straightforward bug fixes (first attempt)
- Simple configuration changes
- General coding questions
Agent skills are modular packages that extend Claude Code with specialized capabilities. They work by:
- Providing specialized knowledge - Domain-specific workflows and best practices
- Tool integration - Connecting Claude Code with external tools (like Codex)
- Automated decision-making - Knowing when to apply specialized capabilities
Learn more about creating agent skills: Claude Code Documentation
Contributions welcome! This skill can be improved with:
- Additional delegation strategies
- More example scenarios
- Better decision-making criteria
- Performance optimizations
See CONTRIBUTING.md for guidelines.
MIT License - see LICENSE file for details.
- Built for Claude Code by Anthropic
- Uses OpenAI Codex CLI
- Inspired by the idea of AI collaboration and specialization
Made with ❤️ for the Claude Code community