A Claude skill that lets Claude in claude.ai web or Claude Desktop generate real AI raster images on the user's local machine, by shelling out to the locally-installed Codex CLI (gpt-image-2 model) through the Desktop Commander MCP bridge.
Claude in claude.ai web and Claude Desktop cannot generate raster images natively. When a user asks for "an illustration of X", Claude either declines or offers SVG/mermaid as a substitute. This skill closes that gap: if the user has Codex CLI installed on their Mac with image generation enabled, Claude can call it through Desktop Commander and return a real PNG.
The user experience should feel native: ask for an image, an image appears, no meta-commentary about "I can't do this directly."
ChatGPT image_gen tool inside Codex CLI
|
Claude (web or Desktop) ──> Codex CLI on user's Mac ──> PNG on disk
^ |
| v
└──────────── Desktop Commander MCP ←───────── inline preview
- User asks for an image
- Skill loads via
tool_search(Desktop Commander tools are deferred) - Claude runs Codex CLI with a generation prompt
- Codex calls gpt-image-2 (covered by the user's ChatGPT Plus/Pro)
- PNG is written to disk, Claude reads it back and displays inline
On the user's Mac:
- Codex CLI v0.130.0+ installed at
~/.npm-global/bin/codexnpm install -g @openai/codex
- Codex authenticated with ChatGPT Plus or Pro (
~/.codex/auth.jsonwithauth_mode: chatgpt) - Image generation feature enabled in
~/.codex/config.toml:[features] image_generation = true
- Desktop Commander MCP connected to Claude (Claude Desktop or web with the MCP server configured)
This is a Claude skill, not a standalone tool. To use it:
- Open Claude Desktop or claude.ai web
- Go to skills (or plugin) settings
- Add this repo as a skill source, or copy
SKILL.mdinto your local skills directory - The skill will activate automatically when you ask for an image
Exact installation steps depend on which Claude client you use and how it discovers skills. Skill loading is currently in active development across Claude clients.
Just ask:
Generate an illustration of a retro astronaut drinking coffee in space
şu görseli üret: minimalist mountain landscape at sunset
Claude will:
- Run
tool_searchto load Desktop Commander tools - Verify Codex is installed and configured
- Build an English prompt optimized for gpt-image-2
- Run Codex in the background
- Wait 45-75 seconds for generation
- Copy the result to a sensible path (default:
~/Pictures/codex-generated/) - Display the image inline in the chat
- Tell you the file's full path
The skill activates on phrases like:
- "Make me a picture of..."
- "Generate an illustration..."
- "Create a banner..."
- "I need a hero image..."
- "Design a logo concept..."
- "Şu görseli üret..."
- "Bana bir illüstrasyon yap..."
It does NOT activate for:
- SVG, mermaid, or ASCII art requests (Claude handles those directly)
- Analysis of existing images (Claude's vision handles that)
- Video (out of scope)
codex-media-gen/
├── README.md # This file
├── LICENSE # MIT
└── SKILL.md # The actual skill definition Claude loads
SKILL.md is what Claude reads. The frontmatter at the top of that file
controls when the skill triggers and how it's described to Claude.
By default the skill picks a path based on conversation context:
| Context | Destination |
|---|---|
| Ad-hoc request, no project context | ~/Pictures/codex-generated/<YYYY-MM-DD>-<slug>.png |
| User is in a git repo / project dir | <repo>/assets/ |
| User named a path | Exactly there |
| Note in a notes app | Adjacent attachments/ folder |
You can override by saying "save to /some/path/file.png" in your request.
See SKILL.md for the full table. The two most common:
-
Claude says "I cannot generate images" or offers SVG as a fallback. This means Claude didn't load Desktop Commander tools first. The skill's v0.4 prompt explicitly forbids this pattern but some clients may still trip. Tell Claude to run
tool_search("desktop commander")and try again. -
Output is a tiny ~5 KB PNG with a perfect geometric shape. Codex fell back to a Python-rendered placeholder instead of calling gpt-image-2. Make sure
[features] image_generation = trueis in~/.codex/config.toml.
This skill deliberately stays small. Not included:
- Batch generation (multiple images per call)
- Automatic retry-on-quality loops
- Video (a separate
codex-video-genskill could cover Sora) - Image editing of existing files
- Transparent-background workflow
- Notes-app auto-linking
If you need any of these, fork the skill or open an issue describing the use case.
MIT.