Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

codex-media-gen

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.

Why this exists

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."

How it works

                  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
  1. User asks for an image
  2. Skill loads via tool_search (Desktop Commander tools are deferred)
  3. Claude runs Codex CLI with a generation prompt
  4. Codex calls gpt-image-2 (covered by the user's ChatGPT Plus/Pro)
  5. PNG is written to disk, Claude reads it back and displays inline

Requirements

On the user's Mac:

  • Codex CLI v0.130.0+ installed at ~/.npm-global/bin/codex
    npm install -g @openai/codex
  • Codex authenticated with ChatGPT Plus or Pro (~/.codex/auth.json with auth_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)

Installation

This is a Claude skill, not a standalone tool. To use it:

  1. Open Claude Desktop or claude.ai web
  2. Go to skills (or plugin) settings
  3. Add this repo as a skill source, or copy SKILL.md into your local skills directory
  4. 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.

Usage

Just ask:

Generate an illustration of a retro astronaut drinking coffee in space
şu görseli üret: minimalist mountain landscape at sunset

Claude will:

  1. Run tool_search to load Desktop Commander tools
  2. Verify Codex is installed and configured
  3. Build an English prompt optimized for gpt-image-2
  4. Run Codex in the background
  5. Wait 45-75 seconds for generation
  6. Copy the result to a sensible path (default: ~/Pictures/codex-generated/)
  7. Display the image inline in the chat
  8. Tell you the file's full path

Trigger phrases

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)

File structure

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.

Output location policy

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.

Known failure modes

See SKILL.md for the full table. The two most common:

  1. 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.

  2. 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 = true is in ~/.codex/config.toml.

Out of scope

This skill deliberately stays small. Not included:

  • Batch generation (multiple images per call)
  • Automatic retry-on-quality loops
  • Video (a separate codex-video-gen skill 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.

License

MIT.

About

A Claude skill that lets Claude generate real AI raster images by shelling out to the user's locally-installed Codex CLI (gpt-image-2) through Desktop Commander MCP.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors