A skill your agent uses when an agent needs to delegate a task to the OpenAI Codex CLI from another agent environment such as Claude Code, OpenClaw, or similar.

MITAuto-check passedMedia & Creative

Install Codex CLI

skills CLI
$ npx skills add sugarforever/01coder-agent-skills --skill codex-cli -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sugarforever/01coder-agent-skills codex-cli --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sugarforever/01coder-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/codex-cli .claude/skills/codex-cli && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codex-cli
GitHub stars
136
Token cost
~1.9k tokens
SKILL.md length
828 words
Files
2
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when an agent needs to delegate a task to the OpenAI Codex CLI from another agent environment such as Claude Code, OpenClaw, or similar.

  • An agent needs to delegate a task to the OpenAI Codex CLI from another agent environment such as Claude Code
  • SKILL.md covers First Check, One-Off Task Workflow, Prompt Shape and Session Resume, plus 5 more sections
  • Calls codex
  • Tasks that involve Image generation

What it does

Codex CLI is an agent skill from sugarforever/01coder-agent-skills. Use when an agent needs to delegate a task to the OpenAI Codex CLI from another agent environment such as Claude Code, OpenClaw, or similar. Covers checking whether Codex CLI is installed, running one-off Codex prompts with codex exec, resuming sessions, collecting outputs, attaching images or files as input with -i/stdin, and handling Codex image generation including finding and reporting generated image file paths.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Media & Creative, covering Image generation. The licence is MIT.

When your agent uses it

  • An agent needs to delegate a task to the OpenAI Codex CLI from another agent environment such as Claude Code
  • Tasks that involve Image generation

Example prompts

  • “/codex-cli”

What it can do on your machine

Read from SKILL.md and the folder at commit e51fb6e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • codex

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codex CLI loads about 1.9k tokens when it runs. Until then it costs about 109 tokens; SKILL.md has 828 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~109
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from sugarforever/01coder-agent-skills at commit e51fb6e, republished under its MIT licence (© sugarforever). 828 words, ~1,949 tokens.

Download SKILL.mdSave it as .claude/skills/codex-cli/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
codex-cli
description
Use when an agent needs to delegate a task to the OpenAI Codex CLI from another agent environment such as Claude Code, OpenClaw, or similar. Covers checking whether Codex CLI is installed, running one-off Codex prompts with `codex exec`, resuming sessions, collecting outputs, attaching images or files as input with `-i`/stdin, and handling Codex image generation including finding and reporting generated image file paths.

Codex CLI

Use this skill when the user asks this agent to talk to Codex, consult Codex, delegate a coding/review/research task to Codex CLI, or ask Codex to generate an image.

The core interface is:

bash
codex exec "prompt"

For automation, prefer non-interactive codex exec over interactive codex.

First Check

Before using Codex CLI, verify it is available:

bash
command -v codex
codex --version
codex exec --help

If codex is missing, tell the user Codex CLI is not available in this environment and stop. Do not simulate a Codex response.

If codex exec --help is available, use it as the source of truth for the installed CLI flags. Codex CLI changes over time.

One-Off Task Workflow

Use this for normal delegation:

bash
codex exec -C "$PWD" -s read-only "Review this repository and identify likely bugs"

For tasks that may edit files, use the sandbox the user requested or the host agent allows:

bash
codex exec -C "$PWD" -s workspace-write "Implement the requested change"

For a response file:

bash
codex exec -C "$PWD" -o /tmp/codex-last-message.md "Summarize this project"

For machine-readable events:

bash
codex exec -C "$PWD" --json -o /tmp/codex-last-message.md "Analyze this project"

If the prompt is long, pass it via stdin:

bash
codex exec -C "$PWD" - < /tmp/prompt.txt

When using shell commands from another agent, avoid dangerous flags unless the user explicitly asked for them. Prefer read-only for review, planning, critique, image generation, and analysis.

Prompt Shape

For non-trivial tasks, shape the delegated prompt with OpenAI's Codex best-practices structure:

text
Goal:
Context:
Constraints:
Done when:

Keep the prompt scoped to one task. For complex implementation work, ask Codex for a plan first in read-only mode, then run a separate write task after the plan is accepted.

Session Resume

Codex emits a session id in normal startup output and in JSONL events as thread.started.

To resume:

bash
codex exec resume <session-id> "Continue from the previous task"

If the installed CLI supports a different resume syntax, follow codex exec resume --help.

Image and File Input

Codex cannot browse or read image files on its own. To let Codex see an image, attach it explicitly with -i/--image. This is the input side; image generation (below) is the output side.

Attach a single image:

bash
codex exec -C "$PWD" -s read-only -i screenshot.png "Explain the error shown here"

Attach multiple images. Both forms work — comma-separated or a repeated flag:

bash
codex exec -i before.png,after.png "Compare these two UI states"
codex exec -i mock1.png -i mock2.png "Which layout is closer to the spec?"

Best practices:

  • Put -i flags before the prompt text.
  • Use common raster formats: PNG (best for screenshots/UI, lossless) or JPEG. Keep images reasonably small; very large images slow the request.
  • Combine images with a clear text instruction — the image alone is rarely enough context.
  • For visual review/analysis, pair with -s read-only so Codex inspects but does not edit.

For non-image files there is no attach flag. Two options:

  • Let Codex read the file from the workspace: point it at the directory with -C "$PWD" and name the file in the prompt ("Review src/auth.ts"). Use this for files already in the repo.
  • Pipe file contents via stdin. With a prompt also present, stdin is appended to the prompt as a <stdin> block:
bash
codex exec -C "$PWD" "Summarize the attached log" < /tmp/build.log

Image Generation Workflow

Codex can generate images through its built-in image generation tool when asked through codex exec.

Example:

bash
codex exec "Generate a black banana image with aspect ratio 16:9"

Important behavior:

  • Built-in image generation commonly saves files under $CODEX_HOME/generated_images/<codex-session-id>/.
  • If CODEX_HOME is unset, use ~/.codex/generated_images/<codex-session-id>/.
  • Codex may not print the path in its final response.
  • The agent using this skill must proactively locate and report generated image paths after image generation.
  • The PNG metadata may not expose the exact image model. Do not claim a specific backend model unless Codex output, CLI logs, or metadata clearly show it.
Show full SKILL.md (321 more words)Show less
Finding Generated Images

After any Codex image-generation request, find the image path before replying.

First extract the Codex session id from output if available. It may look like:

text
session id: 019e8cbf-5054-7131-9440-ee592f0d8a17

Then check:

bash
ls -l "${CODEX_HOME:-$HOME/.codex}/generated_images/<session-id>"

If the session id is not known, list recent generated images:

bash
find "${CODEX_HOME:-$HOME/.codex}/generated_images" -type f -maxdepth 3 -print

When possible, sort by modification time:

bash
find "${CODEX_HOME:-$HOME/.codex}/generated_images" -type f -maxdepth 3 -print0 \
  | xargs -0 ls -lt

If the user requested a project asset, copy or move the selected image into the project after generation if permissions allow. Never leave a project-referenced asset only under $CODEX_HOME/generated_images.

Verifying Aspect Ratio

If the user requested a specific aspect ratio, verify dimensions before answering.

On macOS:

bash
sips -g pixelWidth -g pixelHeight /path/to/image.png

Portable fallback:

bash
file /path/to/image.png

Report actual dimensions and whether they match approximately or exactly. Many generated images use nearest integer dimensions, so a 16:9 request may produce dimensions like 1672 x 941, which is effectively 16:9 but not mathematically exact.

Reporting Results

For normal Codex tasks, report:

  • command used, summarized if long
  • Codex status or final answer
  • any files Codex changed, if known
  • any limitations, errors, or missing permissions

For image tasks, always report:

  • generated image path
  • actual dimensions if available
  • whether the path is in $CODEX_HOME or copied into the project
  • whether the exact image model is known or not

Example response:

text
Codex generated the image here:
/Users/me/.codex/generated_images/019e.../ig_....png

Actual size: 1672 x 941, effectively 16:9.
The output does not expose the exact image backend model, so I cannot verify whether it was gpt-image-2.

Failure Handling

If Codex exits with network, auth, or model refresh errors, report the error plainly and include the relevant stderr lines.

If Codex claims it generated an image but no image file exists under $CODEX_HOME/generated_images, say so explicitly and do not invent a path.

If the host agent cannot read $CODEX_HOME/generated_images, ask the user to grant access or run:

bash
find "${CODEX_HOME:-$HOME/.codex}/generated_images" -type f -maxdepth 3 -print0 | xargs -0 ls -lt

Safety Notes

Do not pass secrets to Codex unless the user explicitly asks and understands the risk.

Use read-only for consultation. Use workspace-write only when Codex is expected to edit files. Avoid danger-full-access unless the user explicitly requested it in a controlled environment.

Do not claim Codex performed work solely from its final message. When file changes matter, inspect the filesystem or Git diff after the run.

© sugarforever, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/codex-cli of sugarforever/01coder-agent-skills.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit e51fb6e

Compare with similar skills

Codex CLI next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codex CLI compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codex CLI this skillsugarforever/01coder-agent-skills136—~1.9kAutomated safety check: PassMIT
Structured Image Generationbytedance/deer-flow83k5 repos~2.9kAutomated safety check: PassMIT
AI Image Generation and Editingzhayujie/CowAgent47k—~1.3kAutomated safety check: PassMIT
Canghe Comicfreestylefly/canghe-skills4618 repos~3.2kAutomated safety check: PassNone
Generate Imageynulihao/AgentSkillOS61710 repos~1.7kAutomated safety check: NotesNone
GPT Image Generation CLIwuyoscar/GPT-Image2-Skill5.6k—~2.5kAutomated safety check: NotesMIT

Similar skills

  • Structured Image Generation

    bytedance/deer-flow

    Turns an image request into a structured JSON prompt and runs a bundled Python script to generate the picture, optionally guided by reference images.

    83k GitHub starsUsed in 5 repos~2.9k tokens
    Media & CreativeAuto-check passed
  • Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured.

    47k GitHub stars~1.3k tokensUpdated yesterday
    Media & CreativeAuto-check passed
  • Canghe Comic

    freestylefly/canghe-skills

    Knowledge comic creator supporting multiple art styles and tones.

    461 GitHub starsUsed in 8 repos~3.2k tokens
    Media & CreativeAuto-check passed
  • Generate Image

    ynulihao/AgentSkillOS

    Generate or edit images using AI models (FLUX, Gemini). An agent skill from ynulihao/AgentSkillOS.

    617 GitHub starsUsed in 10 repos~1.7k tokens
    Media & CreativeAuto-check: notes
  • GPT Image Generation CLI

    wuyoscar/GPT-Image2-Skill

    Generates and edits images with GPT Image 2 or 2.5 through a packaged CLI and a prompt gallery, after settling which model fits the request.

    5.6k GitHub stars~2.5k tokensUpdated 7 days ago
    Media & CreativeAuto-check: notes
  • Minimal Zine Poster Generator

    LiamGvchi/gc-minimal-zine-poster

    Creates or analyzes quiet, paper-texture zine posters with big negative space, one color accent and experimental type, returning an image prompt and the generated poster.

    7.3k GitHub stars~2.9k tokensUpdated 1 mo ago
    Media & CreativeAuto-check passed

More from sugarforever/01coder-agent-skills

All 21 skills in this repo
  • Typography Cover Designer

    sugarforever/01coder-agent-skills

    Designs typography-driven video covers and thumbnails in HTML/CSS and screenshots them with Chrome DevTools at 16:9, 16:10, 9:16 and 3:4.

    136 GitHub stars~3.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Mining Session Skills

    sugarforever/01coder-agent-skills

    Reviews one finished Claude Code session from its exported markdown and decides whether a skill is worth creating, updating or reusing for similar work.

    136 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Subtitle Correction

    sugarforever/01coder-agent-skills

    Fixes speech-recognition mistakes in .srt subtitle files, in Chinese or English, using terms you supply and leaving every timestamp untouched.

    136 GitHub stars~2.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Claude Session Exporter

    sugarforever/01coder-agent-skills

    Lists Claude Code session transcripts and exports them to organized Markdown with a digest, a clean conversation and linked tool-call details.

    136 GitHub stars~1.7k tokensUpdated 3 mo ago
    Auto-check passed
  • Codex Session Manager

    sugarforever/01coder-agent-skills

    Lists, filters and exports local Codex session transcripts to organized Markdown with a digest, timeline and tool-call details, in full or pick-one mode.

    136 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Diagram to Image Converter

    sugarforever/01coder-agent-skills

    Converts Mermaid diagrams and markdown tables into PNG images through a hosted rendering API, for platforms without rich formatting.

    136 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Codex CLI

What does Codex CLI do?

A skill your agent uses when an agent needs to delegate a task to the OpenAI Codex CLI from another agent environment such as Claude Code, OpenClaw, or similar. Codex CLI is an agent skill from sugarforever/01coder-agent-skills. Use when an agent needs to delegate a task to the OpenAI Codex CLI from another agent environment such as Claude Code, OpenClaw, or similar.

When should I use Codex CLI?

Codex CLI fits situations like: an agent needs to delegate a task to the OpenAI Codex CLI from another agent environment such as Claude Code; tasks that involve Image generation.

How do I install Codex CLI in Claude Code?

Run `npx skills add sugarforever/01coder-agent-skills --skill codex-cli -a claude-code`. Or copy the skill folder (skills/codex-cli in sugarforever/01coder-agent-skills) into .claude/skills/codex-cli in your project. Claude Code loads it when a task matches its description.

How do I install Codex CLI in Codex?

Run `npx skills add sugarforever/01coder-agent-skills --skill codex-cli -a codex`. Or copy the skill folder (skills/codex-cli in sugarforever/01coder-agent-skills) into .agents/skills/codex-cli in your project. Codex loads it when a task matches its description.

Can I use Codex CLI in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sugarforever/01coder-agent-skills --skill codex-cli -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codex-cli, .gemini/skills/codex-cli, .github/skills/codex-cli and .opencode/skills/codex-cli in your project.

What does Codex CLI need to run?

Going by SKILL.md and its folder, Codex CLI needs the command-line tools its instructions call (codex).

Does Codex CLI access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Codex CLI safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Codex CLI use?

Codex CLI is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codex CLI use?

About 1.9k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codex CLI?

Skills that share tags, products or a category with Codex CLI: Structured Image Generation (bytedance/deer-flow, 83k stars), AI Image Generation and Editing (zhayujie/CowAgent, 47k stars), Canghe Comic (freestylefly/canghe-skills, 461 stars) and Generate Image (ynulihao/AgentSkillOS, 617 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codex CLI?

sugarforever (a GitHub user) maintains it in sugarforever/01coder-agent-skills, which has 136 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on June 19, 2026.

Source: sugarforever/01coder-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.