Make Images with Claude Code
Claude Code cannot make images. It can only read them. The fix is ChatGPT next to it. One prompt tells Claude Code to run Codex, save the image into your project, and check that the file is real. No Claude Code skill to install: one VS Code extension, a paid ChatGPT plan, and this prompt.
// how it works
Claude Code Runs Codex
The ChatGPT extension for VS Code comes with Codex, a command line tool from OpenAI. Codex can make and edit images through your ChatGPT account. Claude Code can run command line tools. Put the two together and Claude Code asks Codex for the picture, waits 2 to 3 minutes, and checks that the file is there.
The prompt tells Claude Code where Codex lives, how to run it, how to check the file, and what to do when a run fails.
// the prompt
Copy the Prompt
This is the whole thing. Paste it into Claude Code, then say what picture you want.
Make an image for me with Codex.
You cannot make images yourself. The ChatGPT extension for VS Code comes with Codex, a command line tool that can. Use it like this.
1. Find Codex. Try codex on PATH first (codex.cmd too on Windows; on a Mac also check /opt/homebrew/bin and /usr/local/bin). If it is not there, look under ~/.vscode/extensions, ~/.cursor/extensions, ~/.vscode-insiders/extensions, and ~/.vscode-server/extensions (WSL and remote) for a folder that matches openai.chatgpt-*. Inside it the binary is bin/windows-x86_64/codex.exe on Windows, bin/macos-aarch64/codex or bin/macos-x86_64/codex on Mac, and bin/linux-x86_64/codex on Linux. Ignore the other bin folders, they are for other systems. Two versions side by side: take the highest version number, compared number by number, not alphabetically. If you find nothing, stop and tell me to install the ChatGPT extension in VS Code (marketplace id openai.chatgpt), sign in with my ChatGPT account, and reload the window. Do not install anything yourself. No npm, no downloads. Wait for me.
2. If I have not said what the image is, ask me: the subject, the setting and light, the framing, the style, and what to leave out. Write that as one clear brief. The brief is the scene only. File names and folders stay out of it: the folder is where you run Codex, and the file name goes in the command.
3. Run Codex from the folder where the image should be saved. Create the folder if it is missing, and do the cd in the same command as the run. CODEX is the path you found in step 1, in quotes. One image per run:
cd FOLDER && "CODEX" exec --sandbox workspace-write --skip-git-repo-check "Generate one image saved as NAME.png in the current working directory: BRIEF" < /dev/null
Use a lowercase file name with hyphens, no folder in it. Never overwrite an image that exists; add -v2 instead. Before you run it, note the time and whether a file with that name already exists. A run takes 2 to 3 minutes, longer than your default command timeout, so give the command a 10 minute timeout (600000 ms) or start it in the background and check the folder when it ends. --sandbox workspace-write lets Codex run without asking and write files only in the folder it starts in, so start it in the image folder, never at the root of my drive. --skip-git-repo-check lets it run in a folder that is not a git repo. Do not use --full-auto: Codex removed that flag in version 0.154 and the run fails before it starts. PowerShell: put & before the quoted path, use ; between the commands, and drop the < /dev/null part.
Several images: start one background run per image at the same time, up to six, each with its own file name, then collect the results.
4. Check the file yourself. It must exist, be bigger than 0 bytes, and have a modified time later than the time you noted. Do not trust Codex saying it saved something. Then look at it and say what you see: count hands, fingers, and objects, and read any lettering. Flag anything wrong before I ask. Then show me the image.
5. Report one line: OK with the path and size, or FAIL with the last 10 lines of the Codex output.
To edit an image I already have, keep the prompt BEFORE the -i flag:
"CODEX" exec --sandbox workspace-write --skip-git-repo-check "Keep everything exactly as it is. Change only WHAT. Save the edited image as NAME-v2.png in the current working directory. Do not overwrite the input file." -i NAME.png
If something goes wrong, do this before you ask me:
- Your permission system blocks the Codex run (the message says a classifier blocked it): stop. Do not work around it. Tell me to press Shift+Tab until the line under the prompt box no longer says auto mode, then say go. Run the same command again and wait for me to approve it.
- Codex says "not logged in" or "usage limit": stop. Tell me to sign in to the ChatGPT extension again, or to wait for the limit to reset. Keep my brief so we can rerun it.
- The command stopped at 2 minutes with no file: that was your own timeout, not Codex. Look for the file first. If it is not there, run the same command again with the 10 minute timeout.
- The run ends but no new file appears: run the same command once more. If there is still no file, list the newest PNG files in the folder. Codex will say it saved something when nothing hit the disk. If a PNG written during this run shows up under another name, rename it to the one I asked for and carry on. If a folder was in the file name, drop it. Codex only writes into the folder it runs in.
- A background run is still going after 10 minutes: stop it. ChatGPT is slow or queued. Tell me, and try once more later.
- An edit fails with "no prompt provided": -i read the prompt as a file name. Put the prompt before -i and run again.
- Codex says its sandbox could not start (a Linux box, a container, or WSL): run the same command again with --sandbox danger-full-access in place of --sandbox workspace-write. Codex may then write anywhere, so keep the run inside the image folder.
- Codex says the flag --full-auto is unknown: the command still has the old flag. Use --sandbox workspace-write --skip-git-repo-check instead.
- I asked for a transparent background: you cannot tell real transparency by looking, and a checkerboard in a viewer usually means it worked. Check the PNG has an alpha channel and a corner pixel that is fully transparent (with Pillow: python -c "from PIL import Image; im=Image.open('NAME.png'); print(im.mode, im.getpixel((0,0)))"). Only if the background is painted in, change the brief to "isolated on a fully TRANSPARENT background, PNG with alpha, no backdrop, no floor, no shadow plate" and run once. No Pillow: say you could not check, do not guess.
- The image has extra fingers, doubled objects, or wrong text: tell me what you see. Rerun with that object removed from the brief ("no hands", "no cutlery") instead of counting it. Keep any text in the image to a few short words.
- After two edits on the same image, stop editing. Put everything we learned into one fresh brief and make it new.
// set it up
Set It Up in 5 Minutes
Four steps. One extension, one sign-in, one prompt.
Install the Extension
In VS Code, click the Extensions icon in the left sidebar (Ctrl+Shift+X, or Cmd+Shift+X on Mac) and search for ChatGPT by OpenAI. The marketplace id is openai.chatgpt. Install it. It brings the Codex command line tool with it.
Sign In
A ChatGPT icon appears in the left sidebar. Click it and sign in with your ChatGPT account. Codex comes with the paid ChatGPT plans, not the free one. Then press Ctrl+Shift+P (Cmd+Shift+P on Mac), type Reload Window, and press Enter.
Paste the Prompt
Open the project folder that needs the image in VS Code and start Claude Code there. Hit the Copy button on the prompt and paste it in. Add one line: what the picture is and where it goes.
Wait 3 Minutes
Claude Code finds Codex, runs it, and checks the file. Then it shows you the image. Not right? Say what to change. Claude Code edits it and keeps the rest.
// say what you want
Write a Good Brief
Claude Code turns your words into the brief Codex needs. Give it these five things, in this order.
Naming a folder is fine. Claude Code moves into that folder and hands Codex only the file name. For a cutout with no background (a logo, a mascot), say so in the brief: transparent background, no backdrop, no floor, no shadow plate. A grey and white checkerboard in the result means it worked. Here is a brief that works.
Make me the hero image for my pizza page. Subject: a wood-fired margherita pizza on a dark slate board. Setting and light: a rustic oak table, warm side light from a window on the left. Framing: close three-quarter view, the board fills the lower two thirds. Style: editorial food photography, shallow depth of field. Leave out: text, hands, cutlery. Save it in assets/img as pizza-hero.png.
// if it does not work
When a Run Fails
The prompt already tells Claude Code what to try when a run fails.
Nothing Was Saved
Claude Code runs it once more, then lists the newest PNG files. Codex will say it saved something when nothing hit the disk. The usual cause is a folder inside the file name Codex got. Claude Code moves into the folder instead and passes only the file name.
Not Logged In or Limit Hit
Codex refuses when the ChatGPT sign-in expired or the usage limit is reached. Sign in again in the ChatGPT panel, or wait for the reset. Your brief is kept for the rerun.
Auto Mode Blocked It
Claude Code in auto mode may refuse to run Codex and say a classifier blocked it. Press Shift+Tab until the line under the prompt box no longer says auto mode, then say go. Claude Code runs the same command again and you approve it.
Six Fingers, Wrong Text
AI images miscount things. Claude Code reruns with that object removed from the brief instead of counting it. Text in the image stays to a few short words. Two edits max, then a fresh brief.
// good to know
What It Costs. What You Get.
Four things worth knowing before you paste it.
ChatGPT Pays, Not Claude Code
The prompt is free. The images are not. Codex needs a paid ChatGPT plan that includes it, and every image comes out of that plan's usage, not your Claude Code usage. Run one test image before a big batch.
One Image per Run
Each run makes one PNG in about 3 minutes. Six images means six runs. The prompt tells Claude Code to start them side by side, up to six at a time, so the wait stays about the same.
Edits Keep What You Like
Say what stays, then the one thing that changes. Codex keeps the approved parts. After two edits the image goes soft, so the third change gets a fresh brief.
The Skill Is Free
The full pvc-img-gen-codex skill is open source under Apache 2.0. It finds Codex on its own on Windows, Mac and Linux, checks the file opens with its real size and alpha, and hands each render to the pvc-image-check skill when that one is installed. One trigger phrase instead of a pasted prompt. See the skill page.
// get started
Want the Full Skill?
The pvc-img-gen-codex skill is free on GitHub under Apache 2.0. The Pro Vibe Coding community adds the check that catches six fingers and warped text, and 60+ lessons on building real tools with Claude Code.