cli-codex

cli-codex is a skill for Claude Code, Codex, OpenCode from MichelKerkmeester/skilled-agent-harness_spec-driven-loops. It costs 29 tokens per session (7,805 once invoked), scanned B, original, MIT.

A command-line controller for OpenAI's Codex coding agent, used to delegate repository work, reviews, research, and validation to another Codex process.

In plain words
What is it for?
It is for repository analysis, pull-request reviews, web research, security checks, and parallel coding tasks.
Why use it?
It gives the current agent an independent way to check code, investigate a codebase, or compare implementation approaches.

Skill for Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: allowed-tools in frontmatter, but also runs codex exec. Also seen: reads .claude/ paths; mentions AGENTS.md; mentions Codex.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is printf '%s' "$JSON_PAYLOAD" | node .opencode/skills/system-spec-kit/runtime/cli/dist/continuity/generate-context.js --stdin [spec-folder].

Good fit It is for repository analysis, pull-request reviews, web research, security checks, and parallel coding tasks.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/MichelKerkmeester/skilled-agent-harness_spec-driven-loops
agentmods
npx agentmods add skills/michelkerkmeester/skilled-agent-harness_spec-driven-loops/cli-codex

Made for: Claude Code, Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cli-codex

README.md
[![agentmods](https://agentmods.dev/badge/skills/michelkerkmeester/skilled-agent-harness_spec-driven-loops/cli-codex/github.svg)](https://agentmods.dev/skills/michelkerkmeester/skilled-agent-harness_spec-driven-loops/cli-codex)
Your own site
<a href="https://agentmods.dev/skills/michelkerkmeester/skilled-agent-harness_spec-driven-loops/cli-codex"><img src="https://agentmods.dev/badge/skills/michelkerkmeester/skilled-agent-harness_spec-driven-loops/cli-codex/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cli-codex

Your own site · 80×15
<a href="https://agentmods.dev/skills/michelkerkmeester/skilled-agent-harness_spec-driven-loops/cli-codex"><img src="https://agentmods.dev/badge/skills/michelkerkmeester/skilled-agent-harness_spec-driven-loops/cli-codex.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,805 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 5 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Excessive Agency · line 212
    Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
    Fix: Remove the model/provider override or disclose it prominently and require explicit operator approval before invoking an external coding CLI or billed model.
  • high Agent Snooping · line 264
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Rogue Agent · line 289
    Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
    Fix: Prevent the skill from modifying its own code, SKILL.md, or configuration files. Treat skill files as read-only at runtime.
  • medium Rogue Agent · line 262
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
  • medium Excessive Agency · line 301
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
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.1 $0.00029 $0.07805
Opus 5 $0.00015 $0.03903
Sonnet 5 $0.00006 $0.01561
Haiku 4.5 $0.00003 $0.00781

Measured today against content hash 2e41eaf34d7e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

cli-codex scanned grade B with 2 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 today.

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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- **Always pass `-c service_tier="fast"` explicitly** — this routes through the fast tier instead of whatever the caller's `~/.codex/config.toml` defaults to. Explicit means reproducible regardless of who runs it.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

ancestry = subprocess.check_output(['ps', '-o', 'command=', '-p', str(os.getppid())]).decode()
.opencode/skills/cli-external-orchestration/cli-codex/SKILL.md · 384 lines

How it starts

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

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 §2), the skill MUST refuse to load and return the documented error message instead of generating any codex invocation.

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, /review diff-aware workflow.
  • Web Research — current internet info via the top-level --search flag (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_ID or any CODEX_* env var set, codex in process ancestry, or ~/.codex/state/<id>/lock present), 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 codex directly instead).
  • Tasks where Codex CLI is not installed.

Read the full file on GitHub · 384 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. today Changed · -8 lines 2e41eaf34d7e
  2. 4d ago Changed · +4 lines cbf440c7c318
  3. 6d ago First seen · 388 lines · 29 tokens per session scan B dbdc1e591c24

Subscribe to this mod's changes

cli-codex is a skill published in the GitHub repository MichelKerkmeester/skilled-agent-harness_spec-driven-loops (35 stars, last pushed yesterday), licensed MIT. It adds 29 tokens to every session and 7,805 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 2 findings (reads agent configuration directories, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.