Back to the catalog

codex-cli

Delegate review, implementation, or image generation to the Codex CLI for a second opinion. Use when asking codex.

Open source Open in the app JSON README (API)

About

Delegate review, implementation, or image generation to the Codex CLI for a second opinion. Use when asking codex.

Details

Kind
Plugins
Topic
Developer tools
Publisher
cskwork
Origin
gemini
Category
ferramentas
Version
0.1.0
Last push
2026-08-21T14:41:16Z
Repository state
ativo
Language
Python
License
MIT
Added
2026-08-30 14:13:39
Updated
2026-08-30 14:13:39
Origin id
cskwork/claude-codex-skill

README

<p align="center"><img src="logo.png" width="120" alt="logo" /></p>

# claude-codex-skill

> **Generate images with the OpenAI Codex CLI without an `OPENAI_API_KEY` — plus second-opinion code review and implementation, all from inside Claude Code.**

<p align="center">
  <img src="assets/panda.png" width="420" alt="Red panda holding a heart-mug coffee, generated by codex CLI on ChatGPT login alone — no OPENAI_API_KEY"/>
</p>

<p align="center"><sub>↑ Generated by <code>codex exec</code> in 12 seconds. <b>No <code>OPENAI_API_KEY</code></b>. Just <code>codex login</code> with ChatGPT.</sub></p>

<p align="center">
  <a href="https://github.com/cskwork/claude-codex-skill/stargazers"><img src="https://img.shields.io/github/stars/cskwork/claude-codex-skill?style=for-the-badge&logo=github&color=ffd700" alt="Stars"/></a>
  <a href="https://github.com/cskwork/claude-codex-skill/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=for-the-badge" alt="MIT"/></a>
  <img src="https://img.shields.io/badge/codex--cli-%E2%89%A5%200.128-blue?style=for-the-badge" alt="codex-cli ≥ 0.128"/>
  <img src="https://img.shields.io/badge/Claude%20Code-skill-orange?style=for-the-badge" alt="Claude Code skill"/>
</p>

---

## The hook

**`codex` CLI ships with a built-in image generation tool (`image_gen.imagegen`) that nobody talks about.**

It's gated behind a feature flag that is **already on by default** (`codex features list | grep image_generation`). It uses your ChatGPT subscription auth — no separate OpenAI API key, no separate billing.

The catch: in `codex exec` mode, the model only picks this tool if you don't tell it to "use the OpenAI API" or "use curl/python". Most users never discover it.

This skill teaches Claude Code the right prompt shape to unlock it — plus wires up two more modes for the things `codex` is actually built for: **review** and **impl**.

## Three modes

The skill exposes one slash command, `/codex-cli`, with a subcommand as the first argument:

| Invocation | What it does | Example |
|---|---|---|
| `/codex-cli review` | Hands the diff to Codex for a second-opinion review | `/codex-cli review --base main` |
| `/codex-cli impl <prompt>` | Hands a coding task to Codex non-interactively | `/codex-cli impl "add JWT refresh to api/auth.ts"` |
| `/codex-cli image <prompt>` | Generates an image via Codex's built-in tool — no API key | `/codex-cli image "isometric CPU diagram, neon"` |

You can also just describe what you want in natural language ("ask codex to review my diff", "have codex generate an isometric CPU diagram"). The skill's `when_to_use` field tells Claude to load it on those phrasings.

## Install

### One-liner (Windows / PowerShell)

```powershell
iwr -useb https://raw.githubusercontent.com/cskwork/claude-codex-skill/main/install.ps1 | iex
```

### One-liner (macOS / Linux)

```bash
curl -fsSL https://raw.githubusercontent.com/cskwork/claude-codex-skill/main/install.sh | bash
```

### Manual

Drop `SKILL.md` into your Claude Code skills directory:

| OS | Path |
|---|---|
| Windows | `%USERPROFILE%\.claude\skills\codex-cli\SKILL.md` |
| macOS / Linux | `~/.claude/skills/codex-cli/SKILL.md` |

Restart Claude Code. The skill auto-registers — type `/codex-cli` to confirm.

## Prerequisites

- [Claude Code](https://docs.claude.com/en/docs/claude-code) installed
- [Codex CLI](https://github.com/openai/codex) ≥ 0.128.0 (`codex --version`)
- `codex login status` shows "Logged in" (ChatGPT login is enough; API key login also works)

## Usage examples

### 1. Code review on uncommitted changes

```
/codex-cli review
```

Claude takes Codex's findings, regroups them by **CRITICAL / HIGH / MEDIUM / LOW**, and writes them back as a structured review with `file:line` citations — instead of dumping raw output. If Codex contradicts something Claude already verified, it flags the conflict instead of silently siding with Codex.

### 2. Hand off a coding task

```
/codex-cli impl "add a /healthz endpoint to api/server.ts that returns 200 if redis is reachable"
```

Runs `codex exec -s workspace-write -C <repo>`, sandboxed to your workspace. Network access on, writes outside the repo blocked.

### 3. Generate an image

```
/codex-cli image "isometric data center, glowing fiber, dark background, 1024x1024"
```

→ Claude tells Codex to generate it (without naming an API).
→ Codex picks `image_gen.imagegen` automatically.
→ PNG lands at `~/.codex/generated_images/<session>/ig_*.png`.
→ Claude copies it to your workspace and prints the absolute path.

## Why this skill exists

Three pain points it removes:

1. **The image-generation discovery problem.** Codex CLI's image tool works through ChatGPT login alone, but the docs barely mention it. Most people end up trying to set `OPENAI_API_KEY` and giving up. This skill encodes the right invocation.
2. **The Windows sandbox copy bug.** On Windows, `codex-cli 0.128.0` generates the image fine but fails to copy it into your workspace (`CreateProcessAsUserW failed: 5`). Most users see the failure message and assume nothing was generated. The skill knows to look in `~/.codex/generated_images/` and copy the file itself.
3. **Sandbox safety.** The skill never escalates to `-s danger-full-access` or `--dangerously-bypass-approvals-and-sandbox` without explicit per-run approval. You get Codex's power without bypassing its guardrails.

## How it actually works

```
┌─────────────────┐  /codex-cli image "..."   ┌──────────────────┐
│  Claude Code    │ ────────────────────────▶ │  Skill (this)    │
└─────────────────┘                           └────────┬─────────┘
                                                       │
                                                       ▼
                              codex exec -s workspace-write -C <out>
                                          "Generate an image of ..."
                                                       │
                                                       ▼
                             ┌──────────────────────────────────────┐
                             │  Codex CLI agent (gpt-5.5)           │
                             │  picks built-in image_gen.imagegen   │
                             │  → uses ChatGPT auth from auth.json  │
                             └──────────────────────────────────────┘
                                                       │
                                                       ▼
                              ~/.codex/generated_images/<session>/
                                          ig_<hash>.png
                                                       │
                                                       ▼
                              Claude copies → workspace/output.png
```

## Verified — trust record

This skill ships with a reproducible test suite. The last verified run is committed at [`tests/RESULTS.md`](tests/RESULTS.md), so you can see exactly what was checked, when, and on which platform without running anything.

```bash
# Run the full suite (requires `codex login` with ChatGPT)
python tests/run.py

# Skip the E2E image-gen step (still validates metadata, URLs, codex install)
python tests/run.py --skip-image
```

The suite covers metadata correctness (frontmatter spec compliance, no fictitious slash aliases), URL availability (install one-liners actually resolve), codex prerequisites (installed + logged in), and an end-to-end image generation that proves the no-API-key path works through the documented Windows copy-workaround. See [`tests/README.md`](tests/README.md) for the full list of checks and how to add new ones.

## Compatibility matrix

| Codex CLI | Image gen | Code review | Code impl | Notes |
|---|---|---|---|---|
| 0.128.x (Windows) | ✅ via skill workaround | ✅ | ✅ | Sandbox copy bug — skill handles it |
| 0.128.x (macOS / Linux) | ✅ | ✅ | ✅ | Should work without the copy workaround |
| < 0.128 | ❓ untested | ✅ | ✅ | `image_generation` feature flag may differ |

## Contributing

PRs welcome. The skill is one Markdown file (`SKILL.md`) + frontmatter — no build step, no JS, no dependencies. Test by editing locally and restarting Claude Code.

## License

MIT — see [LICENSE](LICENSE).

## Credits

Built and verified using Claude Code itself. The first generated image (the red panda above) was the moment we confirmed the `image_gen.imagegen` tool works through ChatGPT auth alone — no API key required.

More