Claude Code Can’t Draw — How to Use codex-bridge to Route Image and Bulk Work through Your Codex CLI Login

This guide explains codex-bridge, a Claude Code plugin that uses an existing Codex CLI login so Claude can request gpt-image-2 image generation and hand off high-volume work to GPT-5 subagents running on your ChatGPT plan. It covers prerequisites, installation, recommended workflow, validation and common failure modes and trade-offs for developers who already use Claude Code and also have a Codex login.

Key takeaways

  • codex-bridge uses your Codex CLI login to let Claude Code request gpt-image-2 images and offload high-volume work to GPT-5 subagents on your ChatGPT quota
  • Two wrappers are provided: codex-imagegen (workspace-write, images) and codex-run (read-only, text tasks). Both call codex exec and exit with predictable codes
  • Delegate mechanical, high-volume, self-contained tasks to Codex; keep ambiguous, architecture-level or conversation-history-dependent work with Claude
  • Validate by requiring a clean working tree before writes, verifying file paths and image properties, and monitoring ChatGPT quota

Problem and high-level approach

Claude Code lacks built-in image generation and large-scale delegated workers. codex-bridge solves this by running two small wrappers that call Codex CLI’s non-interactive mode (codex exec) with your existing Codex login. That lets Claude act as the orchestrator — write briefs, review results — while Codex performs image generation (gpt-image-2) and bulk mechanical edits using GPT-5 subagents billed to your ChatGPT quota instead of an OpenAI API key.

Prerequisites

  • You use Claude Code.
  • You have a working Codex CLI login (codex login) and the codex binary available locally.
  • macOS or Linux environment (project README indicates those platforms only).
  • Git and a writable working directory when running codex-run or codex-imagegen.

Install and enable codex-bridge

  1. Clone the repository into a skills/plugins directory that Claude Code recognizes. Example forms in the project show both plugin marketplace commands and manual installs. Two supported patterns shown in the source are:
    $ git clone https://github.com/Sateezg/codex-bridge.git claude --plugin-dir ./codex-bridge
    $ git clone https://github.com/Sateezg/codex-bridge.git ~/.claude/skills/codex-bridge
    chmod +x ~/.claude/skills/codex-bridge/bin/*
  2. Reload Claude Code plugins if necessary (the README suggests running a reload command if Claude asks you to).
  3. Verify the codex CLI is logged in and accessible. The wrappers check codex login status before they run and will exit with a precondition code if not logged in.

Key tools: what codex-run and codex-imagegen do

codex-bridge provides two wrapper scripts with distinct responsibilities:

  • codex-imagegen — shells out to codex exec in a workspace-write sandbox scoped to an output directory and drives the built-in Codex image skill ($imagegen) to call gpt-image-2. After generation, the wrapper verifies where Codex wrote the file (including a fallback folder) and prints the absolute path the plugin should read back.
  • codex-run — runs non-image text tasks in a read-only sandbox and captures the final message via an -o temporary file so subagents return clean answers instead of event logs. It’s used for subagent tasks such as code review, debugging hints, and bulk implementation coordination.

Design a clear division of labor that respects the trust and context boundaries described by the project:

  1. Have Claude scope the task and write a self-contained brief. Because Codex is a separate process and cannot use conversation history, every brief must include all context the subagent needs.
  2. Pick tasks to delegate according to the codex-delegate rubric: delegate mechanical, high-volume, or self-contained tasks (bulk edits across many files, exhaustive repo sweeps, scaffolding, image production). Keep architecture, ambiguous requirements, or anything that requires conversation history inside Claude without delegation.
  3. Use codex-imagegen for images and codex-run for text/bulk work. Claude should ask for a review after the subagent finishes so Claude verifies outputs before claiming success.
  4. Only allow codex-implementer (one subagent) to write to files and require a clean working tree and reviewable diffs before committing changes.

Exact command behaviours and constraints (implementation details)

  • Both wrappers call codex exec and exit with predictable codes: 0 for success, 1 for preconditions like missing login, 2 for failure, and 124 for timeout.
  • Image generation constraints: custom sizes are accepted only if these conditions hold simultaneously — longest edge ≤ 3840px, both edges multiples of 16, long-to-short ratio ≤ 3:1, and total pixels between 655,360 and 8,294,400. The project recommends generating a large master and resampling locally for special sizes like favicons or OG cards.
  • Codex may save images to a default generated_images session folder; the wrapper reports the real file path so Claude can read the image back into its review step.
  • Text tasks use -o to capture final output rather than replaying the entire event log, producing cleaner answers for verification.

Validation, verification and safe defaults

  • Verify codex login before running any wrapper; the scripts explicitly check this and fail fast when not logged in.
  • Require a clean working tree before allowing a write-implementer subagent to commit. The project enforces that only one subagent writes and only after user approval so you can review diffs.
  • For images, confirm the wrapper’s printed path matches an actual file and check image properties (dimensions, alpha channel) after generation. The README notes that native alpha may not be emitted by default; test your pipeline if alpha is required.
  • Enforce short, self-contained briefs — because Codex is blind to conversation history, ambiguous prompts increase rework and risk leaking iterative drafts between services.

Common failures and troubleshooting

  • Missing or logged-out codex binary: the wrappers exit 1 with an actionable message rather than hanging. Log in to Codex and re-run.
  • Timeouts: long-running tasks exit 124. Increase wrapper timeout where supported or break the task into smaller subtasks.
  • Platform incompatibility: the project lists macOS and Linux only. Windows users should run in WSL or an equivalent POSIX environment.
  • Image size or format issues: abide by the size constraints. For uncommon sizes, generate a large master then resample locally using ImageMagick as the README recommends.
  • Quota consumption: image turns and heavy GPT-5 use bill to your ChatGPT plan and may burn quota faster than text — plan accordingly.

Trade-offs and data policy considerations

codex-bridge trades conversational continuity for separate-quota performance. Because Codex runs outside Claude, intermediate outputs from Codex do not enter Claude’s context, which reduces Claude token use and keeps large intermediate artifacts out of the conversation. The trade-offs to consider:

  • Context blindness: Codex can’t access Claude conversation history, so briefs must be self-contained. This adds authoring overhead and can make some iterative workflows awkward.
  • Billing boundary: image generation and GPT-5 subagents run on the ChatGPT quota associated with your Codex CLI login, not Claude’s quota. If your organization’s policy forbids sending prompts to another vendor or service, that may be a blocker.
  • Visibility and auditing: Codex’s intermediate files and the generated artifacts are outside Claude’s transcript. Treat this as an operational difference and add logging and file checks as part of your pipeline if auditability is required.

Practical use cases

  • Generate consistent icon sets and style-matched variants by passing a reference (–ref) so palette and stroke weight carry across siblings.
  • Create a large master image and derive favicons, OG cards and size variants locally to avoid re-generating similar assets.
  • Hand off mechanical multi-file renames or repetitive refactors to a Codex implementer subagent, then review a single diff with Claude before merging.

Short FAQ

  1. Q: Does codex-bridge require an OpenAI API key? — A: No. It uses the Codex CLI login (credentials in ~/.codex) so operations run on your ChatGPT plan rather than API credits.
  2. Q: Will Codex see my prompts? — A: Yes. codex exec forwards the task text to OpenAI servers via your Codex session; if your data policy disallows this, don’t use it.
  3. Q: Can I run this on Windows? — A: The project targets macOS and Linux; use WSL or a POSIX-compatible shell to run the wrappers on Windows.

Next steps and audit checklist

  1. Review the codex-bridge README and the wrapper scripts (bin/codex-run and bin/codex-imagegen) to confirm behaviours and exit codes.
  2. Test locally with a small, non-sensitive repo and a sample image request to observe where files land and how the wrapper reports paths.
  3. Set quota alerts on your ChatGPT plan before running bulk jobs to avoid unexpected usage.
  4. Document which team tasks may be delegated under your internal data policy and require explicit approval for any write-enabled subagent runs.

Use the project repository for exact flags and examples; the code and README are the authoritative references for commands and script behaviour.

Stay in Touch

spot_img

Related Articles