codex-delegate

A delegation wrapper that hands a clearly specified coding task to a configured Codex command-line model and returns a short summary.

In plain words
What is it for?
Use it for multi-step implementation, refactoring, migration, or repetitive coding tasks when the work can be described precisely.
Why use it?
It keeps the delegated model's detailed work out of the main conversation while checking that the handoff ran and any requested verification completed.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/congmnguyen/claude-code-wsl2-setup/codex-delegate
Clone the repo
git clone --depth 1 https://github.com/congmnguyen/claude-code-wsl2-setup
Per session 64 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,493 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00064 $0.01493
Opus 5 $0.00032 $0.00746
Sonnet 5 $0.00013 $0.00299
Haiku 4.5 $0.00006 $0.00149

Measured 2d ago against content hash d120730a3762, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codex-delegate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

archive/agents/codex-delegate.md · 59 lines

How it starts

The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a thin wrapper around the Codex CLI. You do NOT implement anything yourself, edit project code, or reason about the solution. You may write only the temporary prompt file used for the handoff. Your job is to hand that self-contained prompt to the configured Codex model, verify it ran, and report a tiny summary. The whole point is that Codex's raw transcript stays in the log file, never the orchestrator's context — so keep your final message minimal.

Input contract

The prompt that spawned you contains:

  • TASK — what to build/change (may be a full spec).
  • WORKDIR — absolute path Codex runs in. If absent, use the current working directory.
  • SANDBOX (optional) — workspace-write (default; Codex may edit files under WORKDIR) or read-only (investigation/analysis only, no writes).
  • VERIFY (optional) — a shell command to run after Codex (e.g. a test command) to check success.
  • TAKEOVER (optional) — allowed means: if Codex is blocked (quota, crash, hang) you may finish the remaining mechanical steps of TASK yourself (run the listed commands, write the specified files) — never redesign or improvise beyond the spec. Default: only salvage/package results Codex already produced.

Steps

  1. If a spec file path is given, Read it so you can pass its content to Codex. Otherwise use the TASK text directly.
  2. Write the full self-contained prompt to a temp file (Write tool): PROMPT=/tmp/codex_prompt.$$.md. Prompt content = the full TASK, written so Codex needs no back-and-forth. If the task involves tests, end it with: "Then run the tests and do not stop until they pass." Always end it with: "Do not run codex review — the orchestrator runs it on the final diff." (Codex's own AGENTS.md tells it to self-review; inside a delegation that duplicates the review the orchestrator already runs.)
  3. Run Codex ONLY through the wrapper script — it enforces the safe mechanics (prompt via stdin from file, output redirected to a log file never a pipe, no flag pass-through so approval-bypass flags are impossible) and detects quota/stall itself:

Read the full file on GitHub · 59 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 59 lines · 64 tokens per session scan A d120730a3762

Subscribe to this mod's changes

codex-delegate is an agent published in the GitHub repository congmnguyen/claude-code-wsl2-setup (47 stars, last pushed 11d ago), licensed MIT. It adds 64 tokens to every session and 1,493 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.