From codex-cli-subagent
Spawns a subagent using codex exec for focused tasks like refactors, audits, or scans while keeping the main Claude Code session intact.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codex-cli-subagent:codex-cli-subagentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill lets you spawn a nested Codex process (a “subagent”) using `codex exec` so it can work with the same project and AGENTS.md instructions.
This skill lets you spawn a nested Codex process (a “subagent”) using codex exec so it can work with the same project and AGENTS.md instructions.
filename="$(openssl rand -hex 4)"
codex exec "count the total number of lines of code in this project" 2>>/tmp/${filename}.log
In non-interactive mode, codex exec runs without a TUI and follows the configured approval/sandbox policy (flags and/or ~/.codex/config.toml). By default it runs in read-only mode, so it cannot edit files or run commands that require network access.
When you use this skill, follow these logging rules:
codex exec, generate a unique log file name with openssl rand -hex 4.2>>/tmp/${filename}.log to your codex exec command so only the subagent’s final message is visible to the caller, while stderr is captured for debugging.cat /tmp/${filename}.log).Since the codex exec may run couple hours, set a generous timeout so long-running subagent work can complete:
Run (or Bash) tool unless the user explicitly requests other limit.Use this skill when you want a focused helper agent (for refactors, audits, scripted operations, or scans) while keeping your main session and context intact.
Use codex exec --full-auto to allow file edits. Use codex exec --sandbox danger-full-access to allow edits and networked commands, but only when the user clearly permits this level of access.
codex exec - < /tmp/prompt.md.--search (otherwise assume “no web tool” and use curl/repo sources).codex exec from inside a codex exec session).--output-last-message /tmp/${filename}.out to capture the final answer without scraping logs.--full-auto: Unattended operation with workspace-write sandbox--dangerously-bypass-approvals-and-sandbox or --yolo: Complete hands-off mode (use carefully)--cd <path>: Set working directory--model <model> or -m: Specify model (e.g., -m gpt-5.1-codex-max)--sandbox: Sandbox types:
read-only: No file edits, no networked commandsworkspace-write: Can edit files in the workspacedanger-full-access: No sandboxing; full access (use with care)--search: Enable built-in web search tool--config: Pass config variables:
model_reasoning_effort: Model reasoning effort: low, medium, high;# As a subagent, perform automated refactoring
filename="$(openssl rand -hex 4)"
codex exec --full-auto "Update all README links to HTTPS" 2>>/tmp/${filename}.log
# Run in a specific project directory
filename="$(openssl rand -hex 4)"
codex exec --cd /path/to/project "Fix failing tests" 2>>/tmp/${filename}.log
# Use AGENTS.md context for a focused refactor
filename="$(openssl rand -hex 4)"
codex exec --cd /path/to/project "Using this repo's AGENTS.md instructions, refactor the test helpers for clarity and consistency" 2>>/tmp/${filename}.log
filename="$(openssl rand -hex 4)"
codex exec --model gpt-5.1-codex-max --sandbox workspace-write --config model_reasoning_effort=medium - < /tmp/some-big-prompt.md 2>>/tmp/${filename}.log
# For audits / deep analysis
filename="$(openssl rand -hex 4)"
codex exec --model gpt-5.2 --sandbox read-only --config model_reasoning_effort=high "Audit this repo for security issues" 2>>/tmp/${filename}.log
# Pipe prompt from file
filename="$(openssl rand -hex 4)"
codex exec - < prompt.txt 2>>/tmp/${filename}.log
# Standard input
filename="$(openssl rand -hex 4)"
echo "Review this code" | codex exec - 2>>/tmp/${filename}.log
When this skill is invoked, you should decide:
--model gpt-5.1-codex-max --config model_reasoning_effort=medium unless the user explicitly requests otherwise.--model gpt-5.2 --config model_reasoning_effort=high unless the user explicitly requests otherwise.2>>/tmp/${filename}.log or read/tail /tmp/${filename}.log)Guides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Reference for writing and editing skills with predictable behavior, covering invocation models, description writing, and information hierarchy.
npx claudepluginhub p/timur-khakhalev-codex-cli-subagent-plugins-codex-cli-subagent