一键导入
claude-code-codex-delegation
Delegate code analysis, refactoring, and editing tasks from Claude Code to the Codex CLI for autonomous AI workflows
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Delegate code analysis, refactoring, and editing tasks from Claude Code to the Codex CLI for autonomous AI workflows
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | claude-code-codex-delegation |
| description | Delegate code analysis, refactoring, and editing tasks from Claude Code to the Codex CLI for autonomous AI workflows |
| triggers | ["use codex to analyze this code","delegate this to codex","run codex on this repository","let codex refactor this","invoke codex session for this task","execute codex with full auto mode","resume my codex session","have codex review this codebase"] |
Skill by ara.so — Codex Skills collection.
This skill enables Claude Code to invoke the Codex CLI for automated code analysis, refactoring, and editing workflows. Codex is an autonomous AI coding agent that can perform complex multi-file operations, repository analysis, and sustained editing sessions. By delegating tasks to Codex, you leverage its specialized capabilities for code transformation while maintaining Claude Code's conversational interface.
Ensure the codex CLI is installed and configured:
# Verify installation
codex --version
# If not installed, follow Codex documentation to install
# Ensure valid credentials are configured
The codex binary must be available on your PATH.
Option 1: Plugin Installation (Recommended)
/plugin marketplace add skills-directory/skill-codex
/plugin install skill-codex@skill-codex
Option 2: Manual Skill Installation
git clone --depth 1 https://github.com/skills-directory/skill-codex.git /tmp/skills-temp
mkdir -p ~/.claude/skills
cp -r /tmp/skills-temp/plugins/skill-codex/skills/codex ~/.claude/skills/codex
rm -rf /tmp/skills-temp
# Single-shot analysis (read-only sandbox)
codex exec -m gpt-5.3-codex-spark \
--sandbox read-only \
--full-auto \
--skip-git-repo-check \
"Analyze this repository for security vulnerabilities" 2>/dev/null
# Code editing with write access
codex exec -m gpt-5.4 \
--config model_reasoning_effort="high" \
--sandbox writable \
--full-auto \
"Refactor all API handlers to use async/await patterns"
# Resume previous session
codex resume <session-id>
Choose based on task complexity:
# Low effort (faster, cheaper)
--config model_reasoning_effort="low"
# Medium effort (balanced)
--config model_reasoning_effort="medium"
# High effort (thorough, slower)
--config model_reasoning_effort="high"
--sandbox read-only: Analysis tasks, no file modifications--sandbox writable: Allow Codex to edit files--sandbox full: Unrestricted access (use with caution)# User asks: "Analyze this codebase for architectural issues"
codex exec -m gpt-5.3-codex-spark \
--config model_reasoning_effort="high" \
--sandbox read-only \
--full-auto \
--skip-git-repo-check \
"Perform comprehensive architectural analysis. Identify:
1. Code organization issues
2. Dependency coupling problems
3. Testing gaps
4. Performance bottlenecks
5. Security concerns
Provide specific file locations and recommendations." 2>/dev/null
# User asks: "Refactor this to use TypeScript strict mode"
codex exec -m gpt-5.4 \
--config model_reasoning_effort="medium" \
--sandbox writable \
--full-auto \
"Enable TypeScript strict mode and fix all resulting type errors:
1. Update tsconfig.json
2. Add explicit types to all functions
3. Fix null/undefined handling
4. Ensure all tests still pass" 2>/dev/null
# User asks: "Continue my previous codex session"
# List recent sessions
codex sessions list --limit 10
# Resume specific session
codex resume abc123def456
# User asks: "Migrate all class components to functional components with hooks"
codex exec -m gpt-5.4 \
--config model_reasoning_effort="high" \
--sandbox writable \
--full-auto \
"Migrate React class components to functional components:
1. Convert lifecycle methods to useEffect
2. Replace this.state with useState
3. Update event handlers
4. Preserve all functionality
5. Update tests accordingly
Process files in src/components directory." 2>/dev/null
# Codex API credentials (if required)
export CODEX_API_KEY="your-api-key-from-env"
# Default model preference
export CODEX_DEFAULT_MODEL="gpt-5.3-codex-spark"
# Default reasoning effort
export CODEX_DEFAULT_EFFORT="medium"
Codex may use ~/.codex/config.yaml or project-level .codex.yaml:
default_model: gpt-5.3-codex-spark
reasoning_effort: medium
sandbox_mode: read-only
full_auto: true
skip_git_repo_check: true
Important: By default, this skill suppresses Codex's thinking tokens (stderr output) using 2>/dev/null to prevent context window bloat in Claude Code.
To enable thinking tokens for debugging or insight:
# Remove stderr redirect
codex exec -m gpt-5.3-codex-spark \
--full-auto \
"Analyze this code"
# Now you'll see Codex's reasoning process
Or explicitly ask Claude: "Show me the thinking tokens from Codex"
User Prompt: "Use Codex to audit this Express.js API for security issues"
Executed Command:
codex exec -m gpt-5.4 \
--config model_reasoning_effort="high" \
--sandbox read-only \
--full-auto \
--skip-git-repo-check \
"Security audit for Express.js API:
- SQL injection vulnerabilities
- XSS attack vectors
- Authentication/authorization flaws
- Sensitive data exposure
- Rate limiting gaps
- CORS misconfigurations
Provide CVE references and fix recommendations." 2>/dev/null
User Prompt: "Generate comprehensive tests for all untested modules"
Executed Command:
codex exec -m gpt-5.3-codex-spark \
--config model_reasoning_effort="medium" \
--sandbox writable \
--full-auto \
"Analyze test coverage and generate missing tests:
1. Identify modules without tests
2. Create unit tests for pure functions
3. Create integration tests for API endpoints
4. Use existing test framework patterns
5. Aim for 80%+ coverage
Write tests to __tests__/ directory." 2>/dev/null
User Prompt: "Upgrade all dependencies and fix breaking changes"
Executed Command:
codex exec -m gpt-5.5 \
--config model_reasoning_effort="high" \
--sandbox writable \
--full-auto \
"Dependency upgrade workflow:
1. Update package.json to latest compatible versions
2. Run npm install
3. Identify breaking changes in CHANGELOG
4. Update code to match new APIs
5. Fix all TypeScript errors
6. Ensure all tests pass
Create git commits for each major dependency." 2>/dev/null
User Prompt: "Generate API documentation from code"
Executed Command:
codex exec -m gpt-5.3-codex-spark \
--config model_reasoning_effort="low" \
--sandbox writable \
--full-auto \
"Generate API documentation:
1. Extract all public API endpoints
2. Document request/response schemas
3. Include authentication requirements
4. Add usage examples
5. Generate OpenAPI 3.0 spec
Output to docs/api.md and openapi.yaml" 2>/dev/null
# Verify installation
which codex
# Check PATH
echo $PATH
# If missing, reinstall Codex CLI per official docs
# Verify credentials
codex auth status
# Re-authenticate if needed
codex auth login
# Check environment variables
env | grep CODEX
If Codex reports permission issues:
# Ensure correct sandbox mode
--sandbox writable # for file edits
# Check file permissions
ls -la <affected-files>
# For git repositories, ensure .git directory is accessible
If Claude Code runs out of context:
2>/dev/null is presentcodex resume# Switch to faster model
-m gpt-5.4-mini
# Reduce reasoning effort
--config model_reasoning_effort="low"
# Check Codex status
codex status
# List available sessions
codex sessions list
# Sessions may expire after 24 hours
# Start new session instead of resuming
--sandbox read-only for analysis tasks to prevent unintended modificationsgpt-5.4-mini for simple tasks, gpt-5.5 for complex refactoring1. User: "Analyze this codebase with Codex"
2. Claude: [Runs Codex in read-only mode]
3. Claude: [Summarizes findings in conversation]
4. User: "Fix the issues Codex found"
5. Claude: [Runs Codex in writable mode with specific fixes]
1. User: "Refactor authentication module"
2. Claude: [Codex session 1 - analyze structure]
3. User: "Good, now apply those changes"
4. Claude: [Codex resume - implement changes]
5. User: "Add tests for the new structure"
6. Claude: [Codex resume - generate tests]
1. Claude: [Makes code changes directly]
2. User: "Have Codex validate these changes"
3. Claude: [Runs Codex analysis on recent changes]
4. Claude: [Reports validation results]
codex exec -m gpt-5.4 \
--config model_reasoning_effort="high" \
--config temperature=0.3 \
--config max_tokens=8000 \
"Your task here"
codex exec -m gpt-5.3-codex-spark \
--files "src/auth/*.ts" \
--sandbox read-only \
--full-auto \
"Analyze authentication implementation in these files"
# Before refactoring
git checkout -b codex-refactor
# Run Codex
codex exec -m gpt-5.4 --sandbox writable --full-auto "Refactor task"
# After Codex completes
git add .
git commit -m "Codex: automated refactoring"
git diff main
Note: This skill is part of the Codex Skills collection at ara.so. For the most autonomous setup combining Claude Code and Codex, see klaudworks/ralph-meets-rex.
Convert attached object images into code-only, animation-ready procedural Three.js models through guided sculpting workflow
Create and manage AI video storyboard projects with automated asset generation through Codex Storyboard workspace
Continue-thinking middleware that detects and handles reasoning truncation in Codex/OpenAI Responses-compatible APIs
Desktop manager for OpenAI Codex CLI with prompt injection, provider switching, and TOML/Auth visualization
Inject unrestricted developer mode instructions into Codex CLI (GPT-5.5) to bypass content filters
Install and use TradingCodex to build Codex-native investment research workflows with fixed-role agents, order approval gates, and local Django service plane