一键导入
skill-codex-delegation
Delegate coding tasks from Claude Code to OpenAI Codex CLI for autonomous code analysis, refactoring, and multi-file editing workflows
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Delegate coding tasks from Claude Code to OpenAI Codex CLI for autonomous code analysis, refactoring, and multi-file editing workflows
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | skill-codex-delegation |
| description | Delegate coding tasks from Claude Code to OpenAI Codex CLI for autonomous code analysis, refactoring, and multi-file editing workflows |
| triggers | ["use codex to analyze this codebase","delegate this refactoring to codex","run codex exec on this project","have codex review and improve this code","use codex with reasoning effort to solve this","start a codex session for this task","invoke codex cli for automated editing","run codex in sandbox mode"] |
Skill by ara.so — Codex Skills collection.
skill-codex enables Claude Code (or other AI coding agents) to delegate complex coding tasks to the OpenAI Codex CLI. This is useful when you need autonomous multi-file editing, deep code analysis, or refactoring workflows that benefit from Codex's specialized reasoning models.
The Codex CLI supports:
Install Codex CLI:
# Installation method depends on your OS
# Verify installation:
codex --version
Configure Codex credentials:
# Set up API keys (use environment variables)
export OPENAI_API_KEY=your_api_key_here
# Or configure via codex config
codex config set api_key $OPENAI_API_KEY
Verify installation:
codex --version
# Should output version info without errors
/plugin marketplace add skills-directory/skill-codex
/plugin install skill-codex@skill-codex
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
# Simple execution with default model
codex exec "analyze this codebase and suggest improvements"
# Specify model
codex exec -m gpt-5.3-codex-spark "refactor this module for better performance"
# With reasoning effort
codex exec -m gpt-5.4 --config model_reasoning_effort="high" "complex architectural review"
# Read-only (safe for analysis)
codex exec --sandbox read-only "analyze code quality"
# Docker sandbox (isolated execution)
codex exec --sandbox docker "run tests and fix failing ones"
# No sandbox (full file system access)
codex exec --sandbox off "update configuration files"
# Autonomous execution without prompts
codex exec --full-auto --skip-git-repo-check \
"implement user authentication feature"
# Resume last session
codex resume
# Resume specific session
codex resume --session abc123
# List sessions
codex sessions list
Available models (as of documentation):
gpt-5.5 - Latest flagship modelgpt-5.4 - Previous generation flagshipgpt-5.4-mini - Faster, cost-effective optiongpt-5.3-codex-spark - Specialized for code with enhanced reasoninggpt-5.3-codex - Code-specialized modellow - Fast responses, basic reasoningmedium - Balanced reasoning and speed (default)high - Deep analysis, slower but more thorough# Set default model
codex config set default_model gpt-5.3-codex-spark
# Set default reasoning effort
codex config set model_reasoning_effort medium
# Set default sandbox mode
codex config set sandbox_mode read-only
When user asks: "analyze this codebase for security 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 security audit of this codebase. Identify: 1) SQL injection risks, 2) XSS vulnerabilities, 3) insecure dependencies, 4) authentication weaknesses. Provide specific file locations and remediation steps." 2>/dev/null
Note: 2>/dev/null suppresses thinking tokens (stderr). Omit to see Codex's reasoning process.
When user asks: "refactor this module to use dependency injection"
codex exec -m gpt-5.4 \
--config model_reasoning_effort="medium" \
--sandbox docker \
--full-auto \
"Refactor src/services/user-service.js to use dependency injection pattern. Update all imports, add constructor injection, create service container. Maintain backward compatibility." 2>/dev/null
When user asks: "add rate limiting to the API"
codex exec -m gpt-5.5 \
--config model_reasoning_effort="high" \
--sandbox off \
--full-auto \
"Implement rate limiting middleware for Express API. Requirements: 1) Redis-based storage, 2) configurable limits per endpoint, 3) proper error responses, 4) unit tests. Update routes and add documentation." 2>/dev/null
# Initial task
codex exec -m gpt-5.3-codex-spark "create REST API for user management"
# Review output, then resume to iterate
codex resume
# User provides feedback in the resumed session
When user asks: "update all components to use the new theme system"
codex exec -m gpt-5.4 \
--config model_reasoning_effort="medium" \
--sandbox docker \
--full-auto \
--skip-git-repo-check \
"Update all React components in src/components/ to use the new theme system from src/styles/theme.js. Replace hardcoded colors with theme tokens. Update imports. Preserve all functionality." 2>/dev/null
# User prompt: "Use codex to analyze this repo and suggest improvements"
# Agent execution:
codex exec -m gpt-5.3-codex-spark \
--config model_reasoning_effort="high" \
--sandbox read-only \
--full-auto \
--skip-git-repo-check \
"Analyze this repository comprehensively:
1. Code Quality: Identify code smells, duplication, complexity issues
2. Architecture: Assess structure, separation of concerns, modularity
3. Performance: Find bottlenecks, inefficient algorithms, optimization opportunities
4. Testing: Evaluate test coverage, quality, missing test cases
5. Documentation: Review README, inline comments, API docs completeness
6. Security: Check for common vulnerabilities, insecure patterns
7. Dependencies: Review package.json for outdated or risky dependencies
Provide actionable recommendations prioritized by impact." 2>/dev/null
# User prompt: "migrate this JavaScript project to TypeScript"
codex exec -m gpt-5.5 \
--config model_reasoning_effort="high" \
--sandbox docker \
--full-auto \
"Migrate this JavaScript project to TypeScript:
1. Add tsconfig.json with appropriate settings
2. Rename .js files to .ts/.tsx
3. Add type annotations to all functions and variables
4. Create interface definitions for data structures
5. Fix all type errors
6. Update package.json scripts for TypeScript compilation
7. Ensure all tests pass after migration
Prioritize type safety while maintaining code clarity." 2>/dev/null
# User prompt: "optimize database queries in this service"
codex exec -m gpt-5.4 \
--config model_reasoning_effort="high" \
--sandbox read-only \
--full-auto \
"Analyze and optimize database queries in src/services/:
1. Identify N+1 query problems
2. Find missing indexes
3. Detect inefficient joins or subqueries
4. Suggest query refactoring for better performance
5. Recommend caching strategies
6. Provide benchmarking approach
Focus on src/services/order-service.js and src/services/product-service.js" 2>/dev/null
When delegating to Codex from Claude Code:
low for simple tasksmedium for standard refactoringhigh for architectural changes or complex analysisread-only for analysis tasksdocker for code changes (safe isolation)off for config file updates or when docker isn't available--full-auto --skip-git-repo-check for autonomous completion2>/dev/null to hide reasoning, omit to show# Verify installation
which codex
# Add to PATH if needed
export PATH=$PATH:/path/to/codex/bin
# Verify again
codex --version
# Check API key is set
echo $OPENAI_API_KEY
# If empty, set it
export OPENAI_API_KEY=your_key_here
# Or configure via codex
codex config set api_key $OPENAI_API_KEY
# List available sessions
codex sessions list
# Resume specific session by ID
codex resume --session <session_id>
# Start fresh if session is corrupted
codex exec "continue previous task: [describe task]"
Always use 2>/dev/null to suppress stderr (thinking tokens) unless debugging:
# Good - suppresses thinking
codex exec "task" 2>/dev/null
# Only for debugging - shows thinking
codex exec "task"
# Verify Docker is running
docker ps
# Use read-only sandbox if Docker unavailable
codex exec --sandbox read-only "task"
# Or disable sandbox (use cautiously)
codex exec --sandbox off "task"
# List available models
codex models list
# Use fallback model if preferred isn't available
codex exec -m gpt-5.4-mini "task"
2>/dev/null) to avoid context overflow# Required
export OPENAI_API_KEY=sk-...
# Optional
export CODEX_DEFAULT_MODEL=gpt-5.3-codex-spark
export CODEX_DEFAULT_SANDBOX=read-only
export CODEX_DEFAULT_REASONING=medium
When Claude Code activates this skill:
This enables seamless delegation of complex coding tasks while Claude Code maintains conversational context and user interaction.
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