Image Gen skill for Codex.
Image Gen is the skill behind $imagegen. It tells Codex when an image should be generated rather than drawn in code, turns your request into a structured prompt, and makes sure project images end up in your workspace. It comes built into Codex.
Updated November 12, 2026 · 3 min read
At a glance
| Skill name | imagegen |
| Comes with | Codex itself, as a system skill |
| Install | Built into Codex (a system skill); nothing to install |
| Codex uses it | When a task needs a new or edited bitmap: photos, illustrations, sprites, mockups, cutouts; not for SVG or CSS visuals |
| Source | openai/skills on GitHub |
What it does
The skill has two modes. By default it uses Codex’s built-in image_gen tool, which needs no API key. A fallback CLI, scripts/image_gen.py, runs only when you ask for it and needs OPENAI_API_KEY. Codex never switches to it on its own.
Before generating, it sorts the request: a new image or an edit, one asset or many. For many assets it makes one call per image. Then it rewrites your prompt as a short labeled spec, with lines such as use case, asset type, style, composition, lighting, exact text and things to avoid. It adds detail only when your prompt is vague, and lists what must stay unchanged in edits.
It also has file rules:
- Built-in images save under
$CODEX_HOME/generated_images/by default. - An image meant for your project gets moved or copied into the workspace before Codex finishes.
- It doesn’t overwrite an existing asset unless you ask; it saves a versioned copy like
hero-v2.png.
It skips images when the job is better done in code: extending an SVG icon set, a logo system, or simple shapes and diagrams.
When to use it
Use it for hero images, product shots, game sprites, UI mockups, transparent cutouts, or edits to an image already in the chat.
Try it
$imagegen Create a wide hero image for our coffee subscription landing page: a ceramic mug on a light wooden table in soft morning light, with empty space on the left for the headline. No text, no logos. Save it to public/images/hero.png.
Does it work in Claude Code?
Only partly. The default path depends on Codex’s built-in image_gen and view_image tools, which Claude Code doesn’t have. If you copy the folder into ~/.claude/skills, the only part that can run is the fallback CLI script, which needs your own OPENAI_API_KEY.