MCPInstall

codex

MANDATORY handoff to the local Codex CLI. Triggers when (a) the user's message begins with /codex as a command, or (b) the user issues an explicit handoff directive like "hand this to codex", "run this through codex", "ask codex", or "have codex do X". On trigger, pipe the user's prompt verbatim to codex exec and return Codex's final message verbatim. Treat this like a shell alias the user is executing through you. Do NOT interpret the task, inspect files, gather context, attempt the work yourself, judge whether Codex is the right tool, or rewrite the prompt. The only abort condition is an empty prompt (ask what Codex should do).

Installs
41
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/petekp/claude-code-setup --skill codex
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads codex automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Codex

/codex is an imperative handoff, not a suggestion. When the trigger fires, you are a transport layer between the user and codex exec — nothing more. You are not the author of a decision about whether Codex should handle this task; the user already made that decision when they invoked the skill.

Trigger contract

The skill fires when one of these is true:

  • The user's message begins with /codex as a command prefix (like a shell command).
  • The user issues a handoff directive using the word "codex" plus a verb of delegation. Accepted forms (exact list, not examples): "hand this to codex", "run this through codex", "ask codex", "have codex do X", "send this to codex", "pass this to codex", "give this to codex", "forward this to codex", "dispatch this to codex", "let codex handle this", "invoke codex".

If the user's phrasing isn't on that list, it is not a trigger. Do not extrapolate "close variants" or invent equivalents — if they want Codex, they can use /codex. This rigidity is deliberate; soft matching is how models weasel out of dispatches.

A /codex reference inside quoted text, documentation, or code samples is not a trigger. The user is invoking the skill, not discussing it.

The one rule

Trigger fires → invoke Codex. One exception: empty prompt → ask what to send. Everything else — trivial tasks, tasks you could answer faster, tasks that "seem like a Claude job", tasks you'd rather handle yourself — still gets handed to Codex.

Hard prohibitions

Before dispatch:

  • ❌ Do NOT read files, run commands, grep the repo, or gather any context about the task. A shell alias doesn't do research before it executes; neither do you. Hand it off raw.
  • ❌ Do NOT reason about the task, decompose it, or plan an approach. That's Codex's job once it has the prompt.
  • ❌ Do NOT decide "this is simple enough, I'll just answer it myself."
  • ❌ Do NOT paraphrase, summarize, "clarify", or restructure the prompt.
  • ❌ Do NOT ask clarifying questions (unless the prompt is empty). Codex asks for itself.
  • ❌ Do NOT wrap the user's prompt in your own framing ("The user wants you to...").
  • ❌ Do NOT skip Codex because the task looks risky, off-topic, or beneath it. Let Codex push back if needed.
  • ❌ Do NOT --cd into a directory you think is more relevant. Symlinks, worktrees, and nested repos make this land in the wrong git tree.

During response:

  • ❌ Do NOT emit preamble ("Sure, I'll hand this to Codex...", "Let me dispatch this..."). Just invoke.
  • ❌ Do NOT narrate the dispatch ("Running Codex now...", "Waiting for Codex..."). Just invoke.
  • ❌ Do NOT echo or summarize the user's prompt back to them before dispatching. They wrote it; they saw it.
  • ❌ Do NOT paraphrase, excerpt, reformat, editorialize, or summarize Codex's output — not even as a supposed "helpful add-on" after the raw output. A post-hoc summary is still editorializing. Return Codex's output verbatim, full stop.
  • ❌ Do NOT fall back to doing the work yourself if Codex fails — surface the failure verbatim.

Workflow

  1. Extract the prompt. For /codex triggers: strip the leading /codex token. For natural-language triggers: strip the literal directive clause (e.g., "ask codex to review the login flow" → "review the login flow"; "hand this to codex: <task>" → "<task>"). Everything else stays verbatim — whitespace, newlines, code blocks, profanity, all of it. Do not normalize, reflow, or "tidy."
  2. Check for empty. If the extracted prompt is empty, ask the user what Codex should do. Otherwise proceed immediately, with zero preamble or commentary.
  3. Dispatch. Pipe the prompt to scripts/run-codex.sh (resolve the path relative to this skill directory) via stdin. No other steps — no file reads, no git inspections, no preparation.
  4. Relay verbatim. Return Codex's final message exactly as Codex produced it — no reformatting, no excerpting, no summary, no "key takeaways," no Claude-authored commentary appended before, after, or instead of the raw output. The raw Codex message is your response. If the user wants a summary or interpretation, they'll ask in a follow-up turn.

Invocation

Default invocation from the current working directory:

PROMPT="<everything after /codex or the handoff phrase>"
printf '%s' "$PROMPT" | "<skill-dir>/scripts/run-codex.sh"

Flags (strict policy)

The default invocation is correct for almost every prompt. Flag promotion is the only form of interpretation this skill allows, and even that is tightly scoped.

Promotable flags (natural-language only):

  • --cd /path/to/project — only if the user literally names a different working tree in the prompt (e.g., "run this in ~/other-repo"). Session context, symlinks, "I think they meant X" — all off-limits. Default: user's cwd, always.
  • --sandbox read-only — only if the user literally says "read-only", "don't edit", "no changes", "just look", or an equivalent explicit constraint. "Review" does not count; Codex handles reviews fine in full-auto.
  • --search — only if the user literally says "search the web", "look online", "check the internet", or equivalent. "Research" does not count.

Parsing rule — literal --flag tokens in the prompt are NOT extracted. If the user types /codex --search investigate X, the entire string --search investigate X is the payload forwarded to Codex — it does NOT become codex exec --search with payload investigate X. Flag extraction is strictly from natural-language instructions; anything that looks like a CLI flag stays in the prompt. This keeps dispatch unambiguous.

If you are rationalizing a flag ("the user probably wants..."), don't add it. Rationalization is inference, and inference is banned here.

Helper script behavior

scripts/run-codex.sh:

  • checks that codex is available on PATH
  • uses printf instead of echo so multi-line prompts stay intact
  • adds --skip-git-repo-check automatically outside Git repositories
  • defaults to --full-auto --ephemeral --color never for a clean one-shot run
  • keeps /codex executions out of the Codex desktop app's saved session list
  • captures Codex stdout and stderr to a temp directory
  • returns Codex's final message on success
  • exits non-zero with useful error output on failure

Failure modes

Failure output follows the same verbatim rule as success output. Codex's words, not yours. No paraphrase, no cherry-picking the "important parts," no "let me summarize the error."

  • codex missing from PATH → tell the user: "Codex CLI is not installed or not on PATH." Do not silently do the task yourself.
  • Codex exits non-zero → return the error output verbatim. Do not retry silently, and do not substitute your own work as a fallback.
  • Codex produces no final message → return exactly that fact: "Codex exec completed but did not write a final message." No speculation about why. No silent fallback to Claude-authored work.

Mental model

$ codex "<prompt>". You are the shell. Parse, dispatch, relay.

The shell doesn't decide "eh, I could handle this one" — neither do you. The shell doesn't peek at files before running — neither do you. The shell doesn't summarize the command's output — neither do you. The shell doesn't say "sure, running your command now" — neither do you.

Just run it.

FAQ

What does the codex skill do?

MANDATORY handoff to the local Codex CLI. Triggers when (a) the user's message begins with /codex as a command, or (b) the user issues an explicit handoff directive like "hand this to codex", "run this through codex", "ask codex", or "have codex do X". On trigger, pipe the user's prompt verbatim to codex exec and return Codex's final message verbatim. Treat this like a shell alias the user is executing through you. Do NOT interpret the task, inspect files, gather context, attempt the work yourself, judge whether Codex is the right tool, or rewrite the prompt. The only abort condition is an empty prompt (ask what Codex should do).

How do I install codex?

Run npx skills add https://github.com/petekp/claude-code-setup --skill codex in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/codex/ (personal) or .claude/skills/codex/ (project).

Which AI agents can use codex?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is codex safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains codex?

It is published by petekp in petekp/claude-code-setup. It has 41 recorded installs.

More from petekp/claude-code-setup

View all →

code-comments

petekp/claude-code-setup

Write, review, or remove code comments. Use when adding comments or doc comments, reviewing the comments in a diff, or cleaning up or removing comments.

deep-research

petekp/claude-code-setup

Investigate a question that requires sustained research across sources and produce cited findings. Use for deep research requests; skip ordinary lookups and single-document reviews.

exhaustive-systems-analysis

petekp/claude-code-setup

Open the skill to read its SKILL.md instructions.

173 installs

typography

petekp/claude-code-setup

Open the skill to read its SKILL.md instructions.

Frontend & Design152 installs

claude-code-audit

petekp/claude-code-setup

Forensic audit of the user's recent Claude Code sessions to surface step-change workflow improvements — not marginal ones. Use when the user asks to "audit my Claude Code sessions", "analyze how I use Claude Code", "find patterns in my usage", "improve my Claude Code workflow", "review my sessions", "find leverage in my setup", or wants to understand where their Claude Code setup is leaking time. Samples dozens of real transcripts, extracts quantitative signal via scripts, uses parallel subagents for deep reads, then synthesizes into a short prioritized report with drafted implementations (new skills, CLAUDE.md rules, hooks, settings diffs) that the user can install directly. Trigger even when the user doesn't say the word "audit" — if they're asking about improving or reviewing their Claude Code habits at scale, use this skill.

Security130 installs

literate-guide

petekp/claude-code-setup

Create a narrative guide to a codebase or feature in the style of Knuth's Literate Programming — code and prose interwoven as a single essay, ordered for human understanding rather than compiler needs. Use when the user asks to 'explain this codebase as a story', 'write a literate guide', 'create a narrative walkthrough', 'tell the story of this code', 'Knuth-style documentation', 'weave a guide for this feature', or when they want deep, readable documentation that treats the program as literature. Also trigger when someone wants a document that a thoughtful reader could follow from start to finish and come away understanding both WHAT the code does and WHY every design choice was made.

Popular ai & agents skills

View category →

google-agents-cli-publish

google/agents-cli

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

AI & Agents513.9K installs

google-agents-cli-eval

google/agents-cli

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).

AI & Agents513.5K installs

skill-creator

anthropics/skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

OfficialAI & Agents416.4K installs

codex-pet

prime-skills/runcomfy-agent-skills

Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.

AI & Agents402.1K installs

full-output-enforcement

leonxlnx/taste-skill

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

AI & Agents401K installs

executing-plans

obra/superpowers

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

AI & Agents245.7K installs