codex-plan-execute

A command that helps you design a coding task and then sends the written plan to Codex, an AI coding agent, for implementation in the background.

In plain words
What is it for?
Use it to inspect a repository, identify files and changes, define tests or checks, and hand the ordered plan to Codex for execution.
Why use it?
It separates deciding what should change from writing the code, so the implementation agent receives a complete plan instead of missing conversation context.

Command for Claude Code

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/jgt87/codex-offload-mcp/codex-plan-execute
Clone the repo
git clone --depth 1 https://github.com/jgt87/codex-offload-mcp

Made for: Claude Code.

Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 485 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.00019 $0.00485
Opus 5 $0.00010 $0.00243
Sonnet 5 $0.00004 $0.00097
Haiku 4.5 $0.00002 $0.00049

Measured yesterday against content hash 14d507118bd2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codex-plan-execute 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 yesterday.

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.

.claude/commands/codex-plan-execute.md · 31 lines

What it actually says

The user wants the plan→execute collaboration: you do the design thinking, Codex does the typing.

Task: $ARGUMENTS

  1. Plan it yourself, in this conversation. Work out the approach: which files change, what each change is, the order to do them in, and how to tell it worked (tests to run, behaviour to check). Investigate the codebase as much as you need — this is the part only you can do.
  2. Write the plan as a self-contained, ordered list. Codex cannot see this conversation, so name every file and state every step and acceptance check in the plan text itself.
  3. Hand it off with codex_execute_plan(plan, cwd=<repo root>). Since the design is done, consider a lower reasoningEffort unless individual steps are themselves subtle. You get a jobId back immediately.
  4. Keep working or verify — don't sleep-poll. The job runs detached; do real work meanwhile and collect with codex_result when you're ready, which checks Codex's report against git. Don't narrate a wait and fire sleep — foreground sleep is blocked by the harness, so the wait never happens and you just re-poll seconds later. If you genuinely have nothing else to do, block on completion by running the returned watchCommand via Bash with run_in_background; it gives one notification when the job finishes. Don't use Monitor here: it is for repeated events, not a one-shot completion wait. Also don't narrate a wait and fire nothing — ending the turn on "I'll check back shortly" leaves nothing to bring you back; either arm watchCommand now or keep working now. If Codex reports a blocker, revise the plan and resume with codex_reply.

If the task is exploratory (each step changes what you'd do next) or needs this conversation's context to execute, say so and do it in-process instead — plan→execute only fits work whose shape is known before it starts.

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. yesterday First seen · 31 lines · 19 tokens per session scan A 14d507118bd2

Subscribe to this mod's changes

codex-plan-execute is a command published in the GitHub repository jgt87/codex-offload-mcp (0 stars, last pushed 1mo ago), licensed MIT. It adds 19 tokens to every session and 485 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-31.