delegate-codex

A command that starts a separate local Codex command-line task and passes it a focused request. The task runs in the background while its live tool activity is recorded.

In plain words
What is it for?
Use it to delegate code reviews, overviews, adversarial checks, or rescue tasks in a chosen project directory, with a selected model and permission level.
Why use it?
It lets you hand off a review or other supported task to another local Codex process without doing the work in the current conversation.

Command

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 commands/arthurkatcher/grok-delegate/delegate-codex
Clone the repo
git clone --depth 1 https://github.com/arthurkatcher/grok-delegate
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 528 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.00018 $0.00528
Opus 5 $0.00009 $0.00264
Sonnet 5 $0.00004 $0.00106
Haiku 4.5 $0.00002 $0.00053

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

Security

Grade A, and why

delegate-codex 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.

plugins/delegate/commands/delegate-codex.md · 43 lines

What it actually says

Delegate to local OpenAI Codex CLI. Models/efforts from live codex debug models (GPT-5.6 Sol/Terra/Luna when CLI ≥ 0.144).

Launch (required)

Use exactly one run_terminal_command with background: true and timeout: 0 (or a very high timeout) so the host does not SIGTERM the companion after ~20s.

Flags before free text; use -- before focus. Prefer --payload-file for messy paste. Prefer --cwd at a real project/repo (not $HOME).

node "${GROK_PLUGIN_ROOT}/scripts/delegate-companion.mjs" codex --wait --model gpt-5.6-sol --effort ultra --sandbox read-only -- review -- "focus text"
  • Expand the Grok task for live tools.
  • Cancel the Grok task → stops Codex process tree.
  • Do not poll status into chat.

If cwd is not a git work tree, the companion auto-passes --skip-git-repo-check so Codex does not refuse $HOME/non-repo dirs on first launch.

Sandbox

Action soft default (if --sandbox omitted)
overview / review / adversarial → read-only
rescue → workspace-write

User can always pass --sandbox … or --yolo. --read-only rejects write sandboxes.

Auth / preflight

codex login or CODEX_API_KEY. Setup warns if CLI < 0.144 for GPT-5.6.

Every action (setup, overview, review, adversarial, rescue) runs the same readiness check first: Codex binary on PATH + login/API key. If not ready, the companion does not spawn Codex — it prints the setup-style next steps and exits non-zero.

Raw arguments:

$ARGUMENTS

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 · 43 lines · 18 tokens per session scan A 8da1cc0cf572

Subscribe to this mod's changes

delegate-codex is a command published in the GitHub repository arthurkatcher/grok-delegate (13 stars, last pushed 1mo ago), licensed MIT. It adds 18 tokens to every session and 528 once invoked, about $0.0001 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.