codex

A command that sends a coding task to OpenAI Codex, an AI coding agent, from Claude Code. It can use recommended settings or ask you to configure the run.

In plain words
What is it for?
Use it to refactor code, write tests, fix bugs, explain code, add features, or review changes.
Why use it?
It avoids manually switching tools when you want help with code changes, debugging, explanations, or reviews. It chooses the official Codex plugin when available and otherwise uses the Codex command-line tool.

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/gopherguides/gopher-ai/codex
Clone the repo
git clone --depth 1 https://github.com/gopherguides/gopher-ai
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 4,693 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.04693
Opus 5 $0.00009 $0.02346
Sonnet 5 $0.00004 $0.00939
Haiku 4.5 $0.00002 $0.00469

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

Security

Grade A, and why

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/llm-tools/commands/codex.md · 323 lines

How it starts

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

Delegate to Codex

If $ARGUMENTS is empty or not provided:

Display usage and ask for input:

This command delegates tasks to Codex. In Claude Code, it prefers the official codex@openai-codex plugin when installed and falls back to the built-in Codex CLI flow when it is missing or declined.

Usage: /llm-tools:codex [--ask] <prompt>

All commands use recommended defaults automatically. Add --ask to use the customizable built-in CLI flow for model, review depth, context, and other options.

Examples:

Command Description
/llm-tools:codex refactor the auth module Refactor existing code (uses defaults)
/llm-tools:codex write tests for utils.ts Generate test files (uses defaults)
/llm-tools:codex fix the bug in checkout flow Debug and fix issues (uses defaults)
/llm-tools:codex explain how the API routes work Code explanation (uses defaults)
/llm-tools:codex add dark mode support Implement new features (uses defaults)
/llm-tools:codex review the auth changes Review with recommended defaults
/llm-tools:codex review the auth changes --ask Review with interactive configuration
/llm-tools:codex refactor the module --ask Exec with interactive model/sandbox selection

Codex Model Selection:

Option Behavior
Provider default Let Codex CLI choose the latest recommended Codex model
Custom model ID Pass an explicit model with -m for codex exec or -c review_model=... for codex review

Ask the user: "What would you like Codex to do?"


If $ARGUMENTS is provided:

Run a task using Codex with the prompt: $CODEX_PROMPT.

0. Parse Flags

Check if $ARGUMENTS starts or ends with --ask (as a standalone flag, not embedded in the prompt text). Only strip --ask from the leading or trailing position — if it appears mid-prompt (e.g., "explain what --ask does"), leave it intact and do NOT enable interactive mode:

Read the full file on GitHub · 323 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 · 323 lines · 18 tokens per session scan A e42396ccbfc2

Subscribe to this mod's changes

codex is a command published in the GitHub repository gopherguides/gopher-ai (21 stars, last pushed 2d ago), licensed MIT. It adds 18 tokens to every session and 4,693 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.