TL;DR — I once had Claude Code call the local Codex CLI and save a generated image directly into a project. The bridge removed some window switching and file movement, but whether it works still depends on the login method, plan, tool availability, and local permissions. Using built-in image generation through ChatGPT authentication does not mean it is free or available to every account.

Lately, I have been spending most of my day inside Claude Code: writing articles, breaking down tasks, organizing material, and editing code. When I need an image, however, I often have to switch to the ChatGPT web app, paste a prompt, wait, download the result, and move it back into the project.

I wanted to connect that break in the workflow. Claude would organize the request, the local Codex environment would handle image generation, and the resulting file would be placed at a specified path. This article preserves my April 2026 implementation while clarifying what a reader needs to check before trying it today. The cover illustrates that original workflow; it is not a promise that every account can run it directly.

This Is for Readers Who Want Images Back Inside the Workflow

If you already manage projects in Claude Code and regularly need covers, slide illustrations, or product mockups, this integration is worth understanding. What it can save is the repeated movement of requirements and files between tools.

If you generate only an occasional image and do not need it written into a project, using a familiar interface directly may be simpler. First decide which step you actually want to remove. Then decide whether adding a CLI, Skill, or local connection tool is worth the maintenance.

A Few Terms in Plain Language

TermIts role in this workflow
Claude CodeUnderstands the request, organizes the prompt, and can run local commands after authorization
Codex CLIWorks in the terminal and can authenticate through a ChatGPT subscription or an API key; the billing and eligibility conditions differ
gpt-image-2The image model discussed in this article; OpenAI’s current built-in image-generation documentation also uses this name
SkillReusable work instructions; it does not create account entitlements or operating-system permissions
MCPA way to connect tools and services; what it can do depends on the particular tool and its authorization
CoworkThe Claude desktop work interface I used at the time; terminal assumptions cannot automatically be applied to it

The model, execution tool, and authenticated identity are separate layers. Seeing the name of a tool is not enough to determine its cost, access scope, or the model that ultimately runs. Each needs to be checked separately.

The Result I Wanted: One Image in a Specified Location

My request was concrete:

Generate one Shiba Inu wearing sunglasses. Save the new file in this project’s images folder without overwriting an existing image.

Claude organized the description, Codex performed the image-generation step, and the workflow reported the actual file path. That is the route I got working at the time. It is not a promise that the word “generate” alone can reproduce the same capability across every client.

Success also cannot be determined only from an agent saying that it is finished. A file’s existence still needs to be followed by checks of its content and location.

How the Workflow Runs

The workflow can be divided into four stages: organize the request, call the local Codex environment, generate and save the file, and inspect the result. Each stage has different failure modes. Looking at them separately is easier than installing every tool at once and troubleshooting the entire chain.

When Claude Code is authorized to execute a local shell, it can call Codex. At the time, I also experimented with launching the same route from the Claude desktop environment through a macOS control tool. That is another integration layer. Tool availability, accessible paths, and the way output returns to the desktop interface all need separate confirmation.

I therefore no longer describe a particular third-party MCP as the one bridge every desktop user must install, nor do I treat the Cowork output path from my old setup as a universal setting. Before sending a request to another tool, check what will be sent and which locations that tool can access.

Confirm the Login, Plan, and Permissions First

OpenAI’s authentication documentation distinguishes ChatGPT subscription authentication from API-key authentication. The first uses the applicable subscription entitlement; the second follows API usage billing. My original implementation used ChatGPT authentication and did not separately provide an OpenAI API key.

But not separately supplying an API key does not remove usage costs. According to the current Codex usage documentation, built-in image generation consumes usage, and the Free plan currently does not provide this capability. ChatGPT web image entitlements should not be assumed to carry over to Codex.

You can begin by checking the version, login status, and command help in your own environment:

codex --version
codex login status
codex exec --help

These checks do not generate an image. If Codex is not installed or authenticated, follow the current official installation and authentication documentation. Initial login may require a browser; that is different from saying that a browser will never be needed during setup. Do not share login credentials or auth.json when asking someone to troubleshoot.

Minimum Viable Version: Confirm One Image First

The current official image-generation documentation describes asking for an image in an interactive session or explicitly invoking $imagegen. Confirming that the tool is available in Codex’s own interface before reconnecting it to Claude removes one variable.

I originally used a non-interactive command. The example below preserves that invocation pattern so the relationship between the project directory and prompt remains understandable. Whether a particular Codex version and execution mode exposes the image-generation tool still needs to be confirmed:

mkdir -p ./images
codex exec -C "$PWD" -s workspace-write \
  'First confirm that built-in image generation is available in this turn. If it is, generate only one Shiba Inu wearing sunglasses and save it as ./images/shiba-new.png. If the file already exists or the tool is unavailable, stop and explain why.'

Running this command requests image generation and consumes the applicable usage. First confirm the project directory, available allowance, and a filename that will not overwrite an existing file. Keep the prompt as data; do not concatenate arbitrary user input directly into a shell command. workspace-write is also not a switch that guarantees every operation will succeed.

This revision checked documentation and command help only. I did not generate another image or perform an end-to-end test across every version. If the non-interactive mode cannot access the tool, return to an interactive session to confirm availability. Do not try to force the workflow through by broadly loosening permissions.

The Original Output as a Record of One Implementation

My record from that run was a PNG produced in about one minute, measuring 1254 × 1254 and approximately 2 MB. Those were the results of that task, not fixed promises about dimensions, latency, or file size.

A Shiba Inu wearing sunglasses retained from the April 2026 implementation as a record of that output

The useful part for me was that the image landed directly in the project instead of being downloaded from a web page and moved afterward. To decide whether this bridge is still suitable today, I would need to confirm tool availability, output location, and usage cost rather than relying on the old result alone.

Two Problems I Encountered: Locate the Cause Before Acting

The first was Operation not permitted. That message can appear at different stages and does not, by itself, establish that the ownership of the entire ~/.codex directory is wrong. The original article recommended recursively changing permissions across the directory. That advice was too broad and has been removed.

A better starting point is to record the failed step and exact path, then distinguish among the working directory, tool authorization, a protected location, and a confirmed file-permission problem. If the cause is uncertain, stop instead of changing an entire directory with administrator privileges.

The second problem was the working directory. -C specifies Codex’s working root. Any relative output path needs to be understood from that root. Use pwd to confirm where you are, then compare the final reported absolute path. A process ending does not prove that the image was saved where you expected.

Turning It into a Skill: Preserve the Workflow and Its Stopping Conditions

After one image works, it may be worth turning the process into a Skill. I previously made CLI and desktop variants, but the old download contains outdated plan and troubleshooting information. This article no longer provides it as a direct installer, and I do not recommend using the old package to overwrite an existing skill.

If I were documenting a Skill for my current environment, I would use this outline:

  1. Confirm the request, image count, working directory, and a filename that will not overwrite an existing file.
  2. Confirm the authentication method, available image-generation tool, and applicable usage. If the tool is unavailable, state why.
  3. Invoke it in a way supported by the current client without mixing desktop MCP permissions with CLI permissions.
  4. Confirm that the file opens, the image matches the request, and the reported path is correct.
  5. If anything fails, preserve the reason. Do not change permissions across an entire directory, switch billing routes, or retry continuously without authorization.

This is the outline of a work instruction, not a newly validated installation package. Trigger phrases and allowed tools can help define a workflow, but the actual environment still decides whether a Skill is selected and whether execution is permitted. Clear instructions do not grant the Skill every tool automatically.

When Is This Integration Worth Building?

People who regularly write, edit code, and produce assets in the same project, and who are willing to maintain tool versions, are most likely to benefit. Keeping the request, image, and later revisions in one workflow can reduce unnecessary movement.

If you generate images only occasionally and have no clear file-output or batch requirement, there is no need to add integration for its own sake. For batch work, define the quantity, filename rules, and acceptable cost before execution. One successful run should not be expanded into a claim of unlimited automation.

One Less Interruption Still Requires Clear Responsibility at Every Layer

I still like the idea: Claude organizes the request, Codex handles the part it is able and authorized to execute, and the image returns to the project. The value is not the number of connected tools. It is the number of repetitive actions removed between the request and the finished asset.

Successful login does not guarantee that the image-generation tool is available.

No API key does not mean no usage will be consumed.

A file’s existence still needs to be followed by checks of its content and location.

Permission errors need to be located, not answered by broadly loosening access.

Separating these layers makes the workflow easier to maintain. I described another experience using Codex as an external checker in I Had Codex Catch Claude’s Mistakes. But I Don’t Just Take Its Word for It. The same principle applies: a tool can provide a result, but I still need to inspect and accept it myself.

Four-panel comic: whether it works still depends on the login method, plan, tool availability, and local permissions. Successful login does not guarantee that the image-generation tool is available. No API key does not mean no usage will be consumed. A file's existence still needs to be followed by checks of its content and location. Permission errors need to be located, not answered by broadly loosening access. Separating these layers makes the workflow easier to maintain.

November 2026 revision: This revision uses OpenAI’s official authentication, image-generation, and usage documentation to clarify plan and execution conditions. It removes the direct installation instructions for the old package, the broad permission fix, and unverified universal claims about desktop integration. The original test image remains as a record of that run and was not regenerated.