codex

A guide for running OpenAI Codex from the command line to analyse, refactor, review, or edit code automatically.

In plain words
What is it for?
Use it when you want Codex CLI to inspect code, refactor it, review changes, or make automated edits.
Why use it?
It gives you a defined way to start or continue Codex tasks and choose the model, reasoning level, and access limits.

Skill for Claude CodeCodex

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 skills/skills-directory/skill-codex/codex
Any agent
npx skills add skills-directory/skill-codex --skill codex
Clone the repo
git clone --depth 1 https://github.com/skills-directory/skill-codex

Made for: Claude Code, Codex.

Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,784 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.00038 $0.01784
Opus 5 $0.00019 $0.00892
Sonnet 5 $0.00008 $0.00357
Haiku 4.5 $0.00004 $0.00178

Measured 2d ago against content hash 76ca5c8efaf0, 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/skill-codex/skills/codex/SKILL.md · 91 lines

How it starts

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

Codex Skill Guide

Running a Task

  1. For a new session (resumes inherit the prior model/effort — see step 5), ask the user (via AskUserQuestion) which model AND which reasoning effort to use, in a single prompt with two questions. When the user expresses no preference, default to gpt-5.6-sol at high.
    • Model — default gpt-5.6-sol:
      • GPT-5.6: gpt-5.6-sol (frontier / most capable — default), gpt-5.6-terra (balanced, everyday), gpt-5.6-luna (fast & affordable)
      • Legacy (kept for compatibility): gpt-5.5, gpt-5.4, gpt-5.4-mini, gpt-5.3-codex-spark, gpt-5.3-codex
    • Reasoning effort — default high: low, medium, high, xhigh, max, ultra.
      • max/ultra require a GPT-5.6 model; ultra is only on sol/terra (luna caps at max); legacy models cap at xhigh.
      • ultra = maximum reasoning with automatic task delegation (slowest and most expensive — reserve for the hardest jobs).
      • If the chosen effort exceeds the chosen model's maximum, fall back to that model's highest supported effort and tell the user.
  2. Select the sandbox mode required for the task; default to --sandbox read-only unless edits or network access are necessary.
  3. Assemble the command with the appropriate options:
    • -m, --model <MODEL>
    • --config model_reasoning_effort="<low|medium|high|xhigh|max|ultra>" (max/ultra only on GPT-5.6 models; ultra only on sol/terra — see step 1)
    • --sandbox <read-only|workspace-write|danger-full-access>
    • --full-auto
    • -C, --cd <DIR>
    • --skip-git-repo-check
    • "your prompt here" (as final positional argument)
  4. Always use --skip-git-repo-check.
  5. When continuing a previous session, use codex exec --skip-git-repo-check resume --last via stdin. When resuming don't use any configuration flags unless explicitly requested by the user e.g. if he species the model or the reasoning effort when requesting to resume a session. Resume syntax: echo "your prompt here" | codex exec --skip-git-repo-check resume --last 2>/dev/null. All flags have to be inserted between exec and resume.
  6. IMPORTANT: By default, append 2>/dev/null to all codex exec commands to suppress thinking tokens (stderr). Only show stderr if the user explicitly requests to see thinking tokens or if debugging is needed.
  7. IMPORTANT (stdin): codex exec always reads stdin and concatenates it with the positional prompt -- even when the prompt is fully supplied as a positional argument. If stdin is not closed, codex blocks forever. When invoking from a harness (background tasks, hooks, scripts where stdin is not a TTY but also not closed), explicitly redirect stdin: append </dev/null to the command, e.g. codex exec ... "prompt" </dev/null 2>/dev/null. Symptom of getting this wrong: zero bytes of stdout, zero CPU accumulated, process appears hung indefinitely.
  8. Run the command, capture stdout/stderr (filtered as appropriate), and summarize the outcome for the user.
  9. After Codex completes, inform the user: "You can resume this Codex session at any time by saying 'codex resume' or asking me to continue with additional analysis or changes."

Read the full file on GitHub · 91 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 · 91 lines · 38 tokens per session scan A 76ca5c8efaf0

Subscribe to this mod's changes

codex is a skill published in the GitHub repository skills-directory/skill-codex (1,424 stars, last pushed 1mo ago), licensed MIT. It adds 38 tokens to every session and 1,784 once invoked, about $0.0002 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.