Codex delegation
Internal contract for delegating implementation work to Codex GPT-5.6 models - model tiering, preflight, dispatch rules, fix cycles, failure fallback, and ledger requirementsFrom its SKILL.md
npx -y skills add em411/supercodex --skill codex-delegationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.6 KB, as published. Nobody here has run it
Codex Delegation
This is the orchestrator-side contract for every Codex delegation in supercodex. Workflow skills (subagent-driven-development, executing-plans, systematic-debugging) reference this skill instead of restating these rules.
Model tiering (single source of truth)
| Task class | Model | --effort |
|---|---|---|
| Complex implementation, debugging, rescue | gpt-5.6-sol | high |
| Standard plan tasks | gpt-5.6-terra | high |
| Mechanical work (renames, boilerplate, config edits, doc moves) | gpt-5.6-luna | medium |
Classify each task before dispatch:
- Mechanical: the plan step is fully prescriptive — exact content or commands given, no design judgment needed. → luna.
- Complex: novel algorithms, cross-cutting changes, debugging an unknown fault, tasks a reviewer previously bounced twice. → sol.
- Everything else → terra.
The orchestrator chooses the tier. The codex-implementer agent never picks models itself.
Preflight (once per session, before the first delegation)
Run:
node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs" setup --json
Healthy: exit code 0 and the JSON reports the Codex CLI present and
authenticated. Unhealthy (non-zero exit, error output, CLI missing,
unauthenticated): tell the user Codex is unavailable and why — suggest
running supercodex:setup for guided fixes — then enter fallback mode
for the rest of the session (see below). Do not re-run preflight per task.
If the JSON reports supportsGpt56: false, the CLI is too old for the
tiering models: warn the user once (upgrade command is in nextSteps),
then dispatch without --model so Codex uses its supported default — stay
on Codex rather than falling back, and record the actual model in the
ledger.
Dispatching a task
- Always dispatch through the
supercodex:codex-implementeragent — never call the runtime from the orchestrator directly. The wrapper keeps Codex transcripts out of your context. - Give the wrapper: the complete task prompt (composed per
supercodex:codex-prompting), plus exact flags:--model,--effort, and--backgroundwhen the task is open-ended, multi-step, or likely to run long. Small, clearly bounded tasks run foreground. - Every dispatch is write-capable; read-only delegation is not used in
supercodex (Claude does its own reading). Choose the write mode:
--full-access(default for local development repos and worktrees the user owns): Codex runs without sandbox restrictions, so it can commit its own work and spawn test processes. Expect commits in the implementer's report.--write(restricted sandbox): use when the workspace is untrusted or the user asks for containment. Codex's sandbox mounts.gitread-only and may block nested process spawning — in this mode YOU make the commits after independently re-running the task's tests, and note the workaround in the ledger.
Fix cycles
When a Claude reviewer returns Critical/Important findings on a Codex task,
dispatch a new codex-implementer call with --resume-last and ONLY the delta
instructions (the findings and what to change). The Codex session retains its
own context; do not restate the whole task.
Reading results
The wrapper returns the runtime's stdout unchanged. Treat it as:
- Success: a summary of what Codex did plus its change/verification report. Proceed to review.
- Failure: empty output, an error report, or output showing Codex made no changes for a task that required them.
Failure & fallback ladder
- First failure: retry once —
--resume-lastif a Codex session exists for this task, otherwise a fresh dispatch. - Second failure: fall back to Claude. Dispatch a classic implementer
subagent using
skills/subagent-driven-development/implementer-prompt.mdwith the same task brief. Announce the substitution to the user in one line ("Codex unavailable/failed for Task N — implemented by Claude subagent") and record it in the ledger. - Usage-limit errors count as failures. Preflight failure puts the whole session in fallback mode: skip the ladder and dispatch Claude implementers directly (still announced once).
Work never stalls silently, and the user always knows which model wrote what.
Ledger
For every task, the progress ledger records: implementing model
(gpt-5.6-sol / gpt-5.6-terra / gpt-5.6-luna / claude-fallback),
effort, and the number of fix cycles.