/SKILL.md
Automatically delegate complex, logic-intensive tasks to OpenAI Codex CLI via `codex exec --full-auto`. Claude Code uses this skill to invoke Codex for complex backend logic, intricate algorithms, or persistent bugs. Enables seamless AI-to-AI collaboration where Claude Code analyzes and Codex executes.
npx skillsauth add eddiearc/codex-delegator codex-delegatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enables Claude Code to automatically delegate complex, challenging tasks to OpenAI Codex CLI using codex exec --full-auto. When Claude Code encounters tasks that require different problem-solving approaches, deep logical analysis, or tasks that have proven resistant to repeated attempts, it can seamlessly invoke Codex to provide fresh perspectives and alternative solutions. The delegation happens automatically and transparently, with Claude Code handling context preparation, execution, and solution validation.
When Claude Code determines a task is suitable for delegation:
Analysis Phase: Claude Code analyzes the task complexity, context, and requirements
Decision: Determines if delegation would be beneficial based on:
Delegation: Automatically invokes Codex:
codex exec --full-auto "detailed task context with:
- Problem description
- Architecture and constraints
- Previous attempts and failures
- Success criteria"
Validation: Claude Code reviews Codex's solution for correctness and completeness
Integration: Returns validated solution to user with transparency about using Codex
User Transparency: Claude Code will inform you when it delegates to Codex, e.g., "I'm using Codex to generate this complex backend logic..."
Activate this skill specifically for:
Complex Backend Logic
Logic-Intensive Problems
Persistent Unsolved Problems
When Different Perspective Needed
Use Codex when:
Don't use Codex when:
Before delegating, check if Codex is available:
which codex
If not installed:
npm i -g @openai/codex
codex auth
Create clear, detailed task description including:
Use when problem requires exploration and iteration:
cd /path/to/project
codex
Then provide detailed context:
I need help with [problem description].
Context:
- [Architecture overview]
- [Relevant constraints]
- [Previous attempts and failures]
The issue is in these files:
- [file1]: [specific problem]
- [file2]: [specific problem]
Goal: [clear success criteria]
Advantages:
/diff/undo/modelUse when problem is clear and specific:
codex exec "detailed task description with full context"
Add flags as needed:
--search - For problems requiring up-to-date library knowledge--full-auto - For trusted, well-scoped tasksUse for problems needing multiple solution attempts:
codex cloud exec --env ENV_ID --attempts 3 "complex problem description"
Advantages:
In interactive mode:
/diff to review changes before accepting/undo if approach is wrong/review to get Codex's own code reviewAfter execution:
If problem persists:
# Resume previous session
codex resume
# Or try different model/reasoning level
codex
/model # Switch to different model or higher reasoning
Scenario: Implementing sophisticated multi-tenant data isolation with complex permission rules.
cd /path/to/project
codex
I need to implement row-level security for a multi-tenant application.
Requirements:
- Each tenant can only access their own data
- Admin users can access all tenants
- Super admins can impersonate any user
- Audit all data access
Current architecture:
- PostgreSQL database
- Node.js/Express backend
- Using Sequelize ORM
Files involved:
- src/middleware/tenancy.js
- src/models/User.js
- src/policies/access-control.js
Previous attempts:
1. Tried global Sequelize scopes - leaked data in JOIN queries
2. Tried middleware checks - inconsistent across endpoints
3. Current approach using hooks - performance issues
Goal: Bulletproof tenant isolation with good performance
Scenario: Race condition causing intermittent failures.
codex exec --search "Debug and fix race condition in payment processing:
Context:
- Stripe webhook handler in src/webhooks/stripe.js
- Order service in src/services/orders.js
- Redis cache for order status
Problem:
- 5% of payments succeed but orders stay in 'pending' state
- Happens only under high load
- Attempted fixes:
1. Added database transaction - didn't help
2. Increased Redis TTL - still fails
3. Added retry logic - made it worse
Stack trace (intermittent):
[paste stack trace]
Need: Root cause analysis and fix with proper synchronization"
Scenario: Optimizing complex matching algorithm.
cd /path/to/project
codex
Need to optimize recommendation engine in src/algorithms/matching.js
Current implementation:
- O(n²) complexity with nested loops
- Processes 10k items in 30 seconds (too slow)
- Need to handle 100k+ items
Constraints:
- Must maintain ranking accuracy
- Memory limit: 2GB
- Real-time updates required
Attempted optimizations:
1. Added caching - helped but not enough
2. Tried batch processing - broke real-time requirement
3. Implemented early termination - minimal impact
Goal: Sub-second processing for 100k items
For extremely complex problems, request higher reasoning effort:
codex
/model # Choose GPT-5 or increase reasoning level
Then provide the complex problem.
Create project-specific guidelines:
codex
/init
Edit AGENTS.md to include:
Add relevant MCP servers for domain-specific knowledge:
codex mcp add <database-schema-server>
codex mcp add <api-documentation-server>
For very difficult problems:
# Try 4 different approaches
codex cloud exec --env ENV_ID --attempts 4 "complex problem"
Resume session when:
Start fresh when:
After Codex provides solution:
Code Review
# In Codex interactive mode
/review
Run Tests
npm test
# or appropriate test command
Performance Testing
Security Review
/undo to rollback/review to get Codex to check its own workThis skill enables seamless AI-to-AI collaboration:
codex exec --full-auto "Debug race condition in payment processing:
[Full context from previous attempts]
[Architecture details]
[Attempted fixes and why they failed]"
Users can also manually invoke Codex following the guidance in this skill for more control over the delegation process.
Codex is cost-effective for:
Use Claude Code instead for:
See references/execution_strategies.md for:
Load this reference when detailed command syntax or advanced patterns are needed.
# Installation
npm i -g @openai/codex
codex auth
# Interactive mode (most common for complex tasks)
cd /path/to/project
codex
# Exec mode with context
codex exec "detailed task with full context"
# Multi-attempt for difficult problems
codex cloud exec --env ENV_ID --attempts 3 "complex task"
# Resume previous session
codex resume
# Key slash commands in interactive mode
/model # Switch models/reasoning
/diff # Review changes
/undo # Rollback
/review # Code review
Track when delegation is effective:
✅ Success indicators:
❌ Failure indicators:
Adjust delegation strategy based on these outcomes.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.