codex-exec

A wrapper command for running Codex CLI tasks from Claude Code with predefined modes for analysis, editing, searching, and resuming work.

In plain words
What is it for?
Use it to ask Codex to review code, analyze security or architecture, read documentation, study performance, or modify files with a selected model.
Why use it?
It handles the command format and selects settings suited to read-only analysis or workspace edits, reducing setup mistakes.

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/alirezarezvani/claude-code-skill-factory/codex-exec
Clone the repo
git clone --depth 1 https://github.com/alirezarezvani/claude-code-skill-factory

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,520 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.00000 $0.02520
Opus 5 $0.00000 $0.01260
Sonnet 5 $0.00000 $0.00504
Haiku 4.5 $0.00000 $0.00252

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

Security

Grade A, and why

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

.claude/commands/codex-exec.md · 521 lines

How it starts

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

/codex-exec - Execute Codex CLI Commands

Easy wrapper for running Codex CLI commands from Claude Code with proper syntax.


Usage

/codex-exec [analysis|edit|search|resume] "your task"
/codex-exec --model [gpt-5|gpt-5-codex] "your task"
/codex-exec --help

What This Command Does

Executes Codex CLI commands with:

  • ✅ Correct syntax (always uses codex exec)
  • ✅ Intelligent model selection
  • ✅ Appropriate sandbox modes
  • ✅ High reasoning effort
  • ✅ Error handling

CRITICAL: Always uses codex exec not plain codex (required for Claude Code environment)


Command Types

Analysis (Read-Only)

Safe code analysis without modifications.

Usage:

/codex-exec analysis "analyze security vulnerabilities"

Executes:

codex exec -m gpt-5 -s read-only \
  -c model_reasoning_effort=high \
  --skip-git-repo-check \
  "analyze security vulnerabilities"

Use for:

  • Code review
  • Security analysis
  • Architecture review
  • Documentation reading
  • Performance analysis

Edit (Workspace Write)

Code editing and file modifications.

Usage:

/codex-exec edit "refactor main.py for async patterns"

Executes:

codex exec -m gpt-5-codex -s workspace-write \
  -c model_reasoning_effort=high \
  --full-auto \
  --skip-git-repo-check \
  "refactor main.py for async patterns"

Use for:

  • Code refactoring
  • Bug fixes
  • Feature implementation
  • Test generation
  • Documentation updates

Search (Web Search Enabled)

Tasks requiring latest information from the web.

Usage:

/codex-exec search "research latest Python async patterns"

Executes:

codex exec -m gpt-5 -s read-only \
  -c model_reasoning_effort=high \
  --search \
  --skip-git-repo-check \
  "research latest Python async patterns"

Use for:

  • Technology research
  • Best practices lookup
  • Library comparisons
  • Latest trends
  • Documentation lookup

Resume (Continue Session)

Resume previous Codex session.

Read the full file on GitHub · 521 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 · 521 lines · 0 tokens per session scan A d98c18ca29db

Subscribe to this mod's changes

codex-exec is a command published in the GitHub repository alirezarezvani/claude-code-skill-factory (855 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,520 tokens. 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.