Skip to content
Development
Skill

/codex-delegation

Delegates tasks to the OpenAI Codex CLI (codex exec) via delegation-core. Use when delegation-core selects Codex or OpenAI credentials are already configured.

From plugin
claude-night-market
343200 skills60 agents162 commands1 MCP

Claude Code

$ npx -y skills add athola/claude-night-market --skill codex-delegation --agent claude-code

SKILL.md

codex-delegation.SKILL.md
name: codex-delegation
description: Delegates tasks to the OpenAI Codex CLI (codex exec) via delegation-core. Use when delegation-core selects Codex or OpenAI credentials are already configured.
alwaysApply: false
category: delegation-implementation
tags:
- codex
- openai
- cli
- delegation
dependencies:
- delegation-core
tools:
- codex
- delegation_executor.py
usage_patterns:
- codex-cli-integration
- headless-ci-execution
complexity: intermediate
estimated_tokens: 550
references:
- delegation-core/shared-shell-execution.md

Codex CLI Delegation

Overview

OpenAI's Codex CLI ships as npm `@openai/codex` and installs a `codex` binary. Its headless entry point is `codex exec`, which takes the prompt as a positional argument and reuses saved CLI credentials.

When To Use

  • `delegation-core` selected `codex` for the task
  • OpenAI credentials are already configured on the machine
  • The work suits a second opinion from a non-Anthropic, non-Google

model

When NOT To Use

  • The host is headless and `codex login` has never succeeded there.

See the login caveat below

  • The job checks out untrusted repository code. OpenAI's own docs warn

against exposing the key as a job-level environment variable in that case

Prerequisites

Installation

npm install -g @openai/codex

Homebrew and a curl installer are also documented upstream.

Authentication

Either persist an API key or log in interactively:

printenv OPENAI_API_KEY | codex login --with-api-key

Verification runs `codex login status`, which reports one of "Logged in using an API key", "Logged in using ChatGPT", "Logged in using Agent Identity", or "Not logged in". The service uses that probe rather than checking a single variable, because either credential path is valid and only the probe sees both.

`CODEX_API_KEY` scopes a credential to a single `codex exec` run.

Quick Start

Using the shared delegation executor

uv run python scripts/delegation_executor.py codex "Explain this module" \
  --files src/

Through the Makefile

make -C plugins/conjure delegate-codex PROMPT='Explain this module'

Direct CLI usage

codex exec "Explain the retry logic in this package"

Smart Delegation

`codex` declares the `code_execution` strength and ranks behind gemini, qwen, minimax, glm and muse in the candidate order. It declares no model ids, so `smart_delegate` leaves model selection to the CLI.

Codex-Specific Details

| Property | Value | |----------|-------| | Binary | `codex` | | Package | `@openai/codex` | | Headless form | `codex exec <prompt>` | | Prompt delivery | positional, stdin also supported | | Version probe | `codex --version` | | Auth probe | `codex login status` | | Structured output | `codex exec --json` |

Login caveat worth knowing before scripting this: an open issue (openai/codex#9253) reports that `codex login` fails outright on headless hosts, over SSH or in containers, unless a workspace administrator has separately enabled device-code auth. That is a single reporter's account with no maintainer confirmation, but it is the failure mode to check first when `codex exec` will not run unattended. Persisting an API key beforehand avoids it.

Exit Criteria

  • [ ] `codex` resolves on PATH and answers `codex --version`
  • [ ] `codex login status` reports a logged-in state rather than "Not

logged in"

  • [ ] The built command is `codex exec <prompt>` with the prompt last

and no prompt flag before it

  • [ ] File context was inlined into the prompt
  • [ ] Output saved to `delegations/codex/YYYYMMDD_HHMMSS.md`
  • [ ] This skill ran because `delegation-core` selected `codex`
Read more
@athola
Ships withclaude-night-market

A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.

343200 skills60 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
343
Star history of athola/claude-night-market on GitHub, a chart by star-history.com

Other skills on claude-night-market.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about codex-delegation.

Which coding agents can use codex-delegation?
codex-delegation installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.