Catalogue / codex-subagent
codex-subagent
MITSignedDelegate a coding or implementation task to a nested Codex CLI agent through unattended, workspace-scoped `codex exec`. For non-Codex harnesses (Claude Code, OpenCode) only — never invoke from Codex itself. Use only when the user explicitly asks to use or delegate to a Codex subagent — not merely be…--- name: codex-subagent description: Delegate a coding or implementation task to a nested Codex CLI agent through unattended, workspace-scoped `codex exec`. For non-Codex harnesses (Claude Code, OpenCode) only — never invoke from Codex itself. Use only when the user explicitly asks to use or delegate to a Codex subagent — not merely because a task involves code. ---
Codex Subagent
> [!IMPORTANT] > Do not invoke this skill from Codex. It is exclusively for external harnesses (Claude Code, OpenCode) delegating work to Codex CLI.
Delegate the requested work to a non-interactive Codex CLI process and relay its result.
Workflow
- Confirm the action is within the user's authorized scope. By default the nested agent can write within the selected workspace and use the network, but cannot cross that filesystem boundary. Only the orchestrator may select
danger-full-access, and only when the user has authorized a Git-writing workflow in a trusted repository. - Build a self-contained prompt preserving all requirements: the concrete objective and deliverables; known repository paths/context; constraints, especially applicable
AGENTS.mdinstructions; required validation or acceptance criteria; and an instruction to inspect the repository, implement completely, run proportionate checks, and summarize changes and checks in the final response. Do not invent product requirements or paste secrets; ask the user only when a missing decision would materially change the result. - Pipe the prompt on stdin to
scripts/run-codex-subagent.sh. Run it via the harness's managed background-task mode — a foreground call gets cut off at the execution tool's fixed timeout, and&creates an unmanaged process. Do not poll; wait for the harness to report completion, and do not start dependent work until it finishes.
printf '%s\n' "$prompt" | /absolute/path/to/codex-subagent/scripts/run-codex-subagent.sh --model gpt-5.6-sol --effort high /path/to/repository
Defaults: model gpt-5.6-sol, effort medium, sandbox workspace-write. Override independently with --model, --effort (none|minimal|low|medium|high|xhigh|max|ultra; models may support a subset), and --sandbox (workspace-write or danger-full-access).
workspace-write deliberately makes .git read-only. If the delegated workflow must branch, stage, or commit — and the user authorized that in a trusted repository — use --sandbox danger-full-access. It removes filesystem sandboxing for the nested process; never enable it to recover from an unrelated failure.
- Read the output: stdout carries only the nested agent's final message; stderr carries the event-log path. The full event stream is written to that log file, not to the caller. Read the log (start with
tail -n 100) only when the exit is nonzero, the final message is missing, or step 5 contradicts its claims — never load it wholesale into context on a successful run. - After exit, inspect relevant workspace changes and run cheap checks to verify the nested agent's claims. On failure, enumerate completed or dirty work in a corrected, self-contained retry prompt so the next run preserves it; read the composed prompt once to catch truncation or quoting damage. Always retry through the runner — never reconstruct a raw
codex execcommand (global options must precede theexecsubcommand). - Report the outcome, material files changed, and verification results; clearly report a nonzero exit or partial completion.
Permissions
The runner defaults to --sandbox workspace-write --ask-for-approval never with network access: Codex works autonomously inside the repository while out-of-workspace and Git metadata writes fail instead of prompting. The explicit danger-full-access override supports authorized Git-writing workflows but removes filesystem isolation. Never silently enable it, broaden the task, expose credentials, or perform unrelated destructive actions.
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 4.0 kB | 402595292894 |
| SKILVAULT_SOURCE.json | 1.3 kB | a0d80b0e4cc5 |
| THIRD_PARTY_NOTICES.md | 1.1 kB | 21ccc59fb3e4 |
| agents/openai.yaml | 350 B | 5495758f8845 |
| scripts/run-codex-subagent.sh | 3.0 kB | 19b061c11db9 |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 0.1.0 Current | 8f6dd3077aa8 | 28 Nov 2026 |
Locking a skill to one version needs Pro.