cli-codex
FreeNo executable scriptsNot checkedCodex CLI executor for OpenAI-backed coding, repo analysis, PR review, web research, and cross-model validation.
by MichelKerkmeester★ 40 GitHub starsAbout this skill
Codex CLI Orchestrator - Cross-AI Task Delegation
CRITICAL — SELF-INVOCATION PROHIBITED
This skill dispatches to the OpenAI CLI binary (
codex). If the agent currently reading this skill is itself running inside Codex (detection signals listed in the self-invocation guard inROUTER.md), the skill MUST refuse to load and return the documented error message instead of generating anycodexinvocation.A running CLI skill never dispatches itself. The cli-X skills are for cross-AI delegation only — never self-invocation.
Orchestrate OpenAI's Codex CLI for tasks that benefit from a second AI perspective, real-time web search, deep codebase analysis, built-in code review workflows, or parallel code generation.
Core Principle: Use Codex for what it does best. Delegate, validate, integrate. The calling AI stays the conductor.
1. WHEN TO USE
Activation Triggers
- Cross-AI Validation — code review second perspective, security audit alternative analysis, bug detection,
/reviewdiff-aware workflow. - Web Research — current internet info via the top-level
--searchflag (codex --search exec …), latest library versions, API changes, community solutions. - Codebase Architecture Analysis — onboarding to unfamiliar codebases, cross-file dependency mapping, architecture docs from code.
- Parallel Task Processing — offloading generation, simultaneous code generations, background docs/test generation.
- Agent-Delegated Tasks — specialized profile matches (
.codex/agents/*.toml), session management (resume, fork), multi-strategy planning. - Specialized Generation — explicit Codex requests, test suite generation, code translation, batch docs (JSDoc, README, API), visual input via
--image/-i.
When NOT to Use
- You ARE Codex already. If your runtime is Codex (detection signal:
$CODEX_SESSION_IDor anyCODEX_*env var set,codexin process ancestry, or~/.codex/state/<id>/lockpresent), this skill refuses to load. Self-invocation creates a circular dispatch loop and burns tokens for no value. - Simple, quick tasks where CLI overhead is not worth it, or tasks needing an immediate response (rate limits may delay).
- Context already loaded and understood by the current agent.
- Interactive refinement requiring the full-screen TUI (use
codexdirectly instead). - Tasks where Codex CLI is not installed.
2. SMART ROUTING
The cli-external-orchestration hub routes an OpenAI dispatch here: the prompt names Codex, the Codex CLI, codex exec or a web-research or second-opinion handoff, and the hub's cli-codex mode signal selects this packet.
A session already running inside Codex never routes here; the self-invocation guard refuses it.
The hub ROUTER.md names the two leaves a dispatch starts from.
Inside this packet the ALWAYS tier loads first: references/cli-reference.md for the subcommands, flags and sandbox modes, and assets/prompt-quality-card.md for the fast-path prompt framework.
Intent-mapped references load after those, one set per intent.
Read ROUTER.md before selecting skill-local resources; open only the matched files.
Keep every path inside this skill folder, and load a file only when it exists.
When nothing matches, report UNKNOWN_FALLBACK with the checklist from the machine router instead of guessing.
3. HOW IT WORKS
Prerequisites
Install with npm i -g @openai/codex, or with brew install --cask codex.
cli-codex authenticates through ChatGPT OAuth only. Run codex login and complete the browser flow, which requires a ChatGPT Plus/Pro/Business/Edu/Enterprise account. The skill does not use an OpenAI API key.
The ALWAYS-loaded cli-reference.md holds the full install, auth, flag, sandbox, session and troubleshooting tables. This section keeps only the routing decisions and dispatch-critical gotchas.
Execution Ownership
This packet owns user-facing routing, the command -v codex availability probe, prompt construction, and the self-invocation guard.
Research and review lineages delegate process construction and execution to the already-shipped deep-loop runtime at ../../system-deep-loop/runtime/scripts/fanout-run.cjs, using executor kind cli-codex.
That runner accepts only the research and review loop types, so a single build or doc dispatch uses the child dispatch envelope in providers-and-models.md §5.
The runtime is the single Codex execution adapter. Do not add a packet-local wrapper, command builder, or spawn path. Direct codex exec snippets below are operator reference and manual-testing examples; research and review lineages use the shared runtime, and a one-shot dispatch uses the child envelope.
Provider Auth Pre-Flight (ChatGPT OAuth)
MANDATORY before any first dispatch in a session. cli-codex authenticates through ChatGPT OAuth only
Install cli-codex in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
BashReadGlobGrepBundled files
FAQ
What does the cli-codex skill do?
Codex CLI executor for OpenAI-backed coding, repo analysis, PR review, web research, and cross-model validation.
How do I install the cli-codex skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the cli-codex skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
skill-creator
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…
by Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
by Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
by Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
by Anthropic