
Codex
Delegate a clearly framed coding task to Codex CLI via the bundled script when the user explicitly asks Codex to execute—not for every general coding request.
Overview
codex is an agent skill most often used in Build (also Ship) that delegates explicitly requested coding tasks to Codex CLI through a bundled runner script with framed prompts.
Install
npx skills add https://github.com/oil-oil/codex --skill codexWhat is this skill?
- Invoke only when the user explicitly requests Codex (e.g. ask codex to, 用 codex 来做)
- Bundled shell script handles output capture, session tracking, and progress streaming—not raw codex CLI
- Task prompts stay under ~500 words: goals and constraints, not step-by-step file lists
- Quote paths with brackets, spaces, or glob-sensitive characters for zsh safety
- Single run per task: exit 0 means read the output file; do not re-run for short silent diffs
- ~500 word recommended maximum task prompt
- 1 run per task on success exit code 0
Adoption & trust: 610 installs on skills.sh; 82 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want Codex—not your main chat agent—to implement a task, but direct CLI calls lose session tracking and you over-specify steps Codex should discover itself.
Who is it for?
Solo builders using Claude Code who explicitly want Codex autonomous edits and are comfortable with shell-backed agent delegation.
Skip if: General feature requests where the user did not ask for Codex, or environments without the bundled script and Codex CLI available.
When should I use this skill?
User explicitly asks to use Codex—e.g. 用 codex 来做, 让 codex 执行, ask codex to, codex 帮我写.
What do I get? / Deliverables
Codex runs once via the script with a tight goal prompt; you read the captured output and continue orchestration without redundant re-runs.
- Captured Codex run output file
- Repository changes applied by Codex
- Session-tracked execution log
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Agent-tooling is the canonical shelf because the skill defines how Claude frames work and invokes Codex’s autonomous file and bash tooling. Agent-tooling captures explicit delegation, session tracking, and prompt discipline distinct from implementing features directly in the primary agent.
Where it fits
User says ask Codex to add the API route while Claude stays on architecture questions.
Explicit Codex request for a UI pass with quoted app router paths.
User assigns Codex to apply review fixes in one scripted run after exit 0.
How it compares
Agent delegation bridge—not a skill that implements features inside Claude; compare to doing the work inline unless the user names Codex.
Common Questions / FAQ
Who is codex for?
Developers orchestrating multiple coding agents who want Claude to frame tasks and hand execution to Codex when they ask for it by name.
When should I use codex?
In Build for implementation passes the user assigns to Codex; in Ship for fix-it requests that explicitly say ask Codex or 让 codex 执行—not for default coding.
Is codex safe to install?
It runs shell and filesystem tooling through Codex; review the bundled script and Security Audits panel on this Prism page before enabling in production repos.
SKILL.md
READMESKILL.md - Codex
## Critical rules - Use the bundled shell script rather than calling `codex` CLI directly — the script handles output capture, session tracking, and real-time progress streaming correctly. - Run the script once per task. If it succeeds (exit code 0), read the output file and proceed. Don't re-run just because the output seems short — Codex often makes changes quietly without narrating every step. - Quote file paths containing `[`, `]`, spaces, or special characters (e.g. `--file "src/app/[locale]/page.tsx"`). Without quotes, zsh treats `[...]` as a glob pattern and fails with "no matches found". - **Keep the task prompt to the goal and constraints, not the implementation steps.** Aim for under ~500 words. Codex has the same tools as Claude and will explore the codebase itself — spelling out every file to change or every step tends to constrain it rather than help. - **Don't paste file contents into the prompt.** Use `--file` to point Codex to key files — it reads them directly at their current version. Pasting contents wastes tokens and risks passing stale code. - **Don't mention this skill or its configuration in the prompt.** Codex doesn't need to know about it. ## How to call the script ### Linux/macOS (bash) The script path is: ``` ~/.claude/skills/codex/scripts/ask_codex.sh ``` Minimal invocation: ```bash ~/.claude/skills/codex/scripts/ask_codex.sh "Your request in natural language" ``` With file context: ```bash ~/.claude/skills/codex/scripts/ask_codex.sh "Refactor these components to use the new API" \ --file src/components/UserList.tsx \ --file src/components/UserDetail.tsx ``` Multi-turn conversation (continue a previous session): ```bash ~/.claude/skills/codex/scripts/ask_codex.sh "Also add retry logic with exponential backoff" \ --session <session_id from previous run> ``` ### Windows (PowerShell) The script path is: ``` ~/.claude/skills/codex/scripts/ask_codex.ps1 ``` Minimal invocation: ```powershell & ~/.claude/skills/codex/scripts/ask_codex.ps1 "Your request in natural language" ``` With file context: ```powershell & ~/.claude/skills/codex/scripts/ask_codex.ps1 "Refactor these components to use the new API" ` -f src/components/UserList.tsx ` -f src/components/UserDetail.tsx ``` Multi-turn conversation (continue a previous session): ```powershell & ~/.claude/skills/codex/scripts/ask_codex.ps1 "Also add retry logic with exponential backoff" ` -Session <session_id from previous run> ``` ### Output format The script prints on success: ``` session_id=<thread_id> output_path=<path to markdown file> ``` Read the file at `output_path` to get CodeX's response. Save `session_id` if you plan follow-up calls. ## Workflow 1. Understand the problem: read the key files to grasp what's broken or needed. Focus on being able to describe the problem and goal clearly — you don't need to design the full solution or enumerate every affected file. Codex will explore the codebase itself. 2. Run the script with a focused task description: the goal, key constraints, and any non-obvious context. For discussion or analysis without changes, use `--read-only`. 3. Pass 1-4 entry-point files with `--file` as starting hints. Codex has the same tools as Claude and will discover related files on its own — no need to enumerate everything upfront. 4. Read the output — Codex executes changes and reports what it did. 5. Review the changes in