Codex with ChatGPT: ChatGPT Plans, Codex Executes

Move planning and review to your ChatGPT web subscription while Codex handles code execution, tests, and Git through its coding harness.

Codex with ChatGPT connects the ChatGPT web app to OpenAI Codex coding sessions. ChatGPT examines the repository, prepares implementation plans, and reviews the resulting changes. Codex handles file edits, terminal commands, tests, and Git operations.

An OAuth-protected, read-only MCP bridge lets ChatGPT retrieve relevant source files and execution results from the active workspace. Planning and review use a ChatGPT subscription, and the bridge requires no OpenAI API key.

Last updated: Nov 04, 2026

How ChatGPT and Codex Work Together

Codex opens a task by sending ChatGPT an INIT message with the goal. ChatGPT inspects the workspace through MCP and returns a PLAN describing the changes to make and the tests to run.

Codex executes the plan with its coding harness and reports EXECUTED after the iteration. ChatGPT reads the actual Git diff and available build, test, or lint results. It responds with DONE when the task is complete, another plan when more work is needed, or BLOCKED if it cannot proceed.

Control messages carry less than 1 KB of task state. Source files, diffs, searches, and execution records travel separately through MCP, which lets ChatGPT review the changes made in the local workspace.

ChatGPT Web <--- C2C ---> Codex
Plan / review Execute
| |
| read-only MCP | Git / tests
v v
C2C Bridge -------> Workspace
(Cloudflare Tunnel)

Read-Only Workspace Access and Security

Each bridge serves one workspace. OAuth 2.1 protects the MCP connection, and the first connection uses an eight-character, one-time pairing code valid for five minutes. MCP requests are authorized for that workspace.

Workspace path checks prevent access outside the authorized directory. The bridge filters sensitive files such as .env*, private keys, SSH files, and cloud credentials. You can add exclusions with .c2cignore. The rules also apply to directory searches, Git diffs, and Git status output.

Requested code, images, Git diffs, and sanitized execution output are transmitted to ChatGPT for planning and review.

Requirements and ChatGPT Plan Support

Installation requires Node.js 20 or newer, Git, and cloudflared. Automated setup also needs a Codex environment with access to its built-in browser. The Codex Skill can install missing dependencies through Homebrew on macOS or winget on Windows.

ChatGPT Pro supports custom MCP server connections with read/fetch permissions in Developer Mode. Business, Enterprise, and Edu workspaces support custom connections under their administrator and permission controls. ChatGPT Plus does not provide the custom MCP access this project requires.

See ChatGPT custom MCP server requirements for current account settings.

How to Install and Start a Session

Install with Codex

Paste this request into Codex to install the project and configure its ChatGPT connection. First-time setup offers automatic browser configuration or guided manual setup. Codex will ask for account sign-in, pairing, and choices that require your input.

Install Codex with ChatGPT for my current coding repository.
Use https://github.com/XiaoDuoYa/codex-with-chatgpt.
Check Node.js 20+, Git, and cloudflared, and install any missing tools.
Clone the repository and build it with corepack pnpm.
Copy skill/SKILL.md to <codex-home>/skills/codex-with-chatgpt/SKILL.md.
Use CODEX_HOME for <codex-home> when set, otherwise the default
Codex directory. Set the correct checkout path.
Run the C2C setup for my current workspace. Use the built-in browser
for ChatGPT authorization. Ask me when login, pairing, or a setup
choice needs input.
Confirm that the ChatGPT connector can read a workspace file.

Manual Installation

Clone and build the project:

git clone https://github.com/XiaoDuoYa/codex-with-chatgpt
cd codex-with-chatgpt
corepack pnpm install
corepack pnpm build

Locate your Codex home directory first. Use CODEX_HOME when that environment variable is set. Otherwise, the default is ~/.codex on macOS/Linux or %USERPROFILE%\.codex on Windows. Copy the contents of skill/ to <codex-home>/skills/codex-with-chatgpt/. In the installed SKILL.md, replace The codex-with-chatgpt checkout lives at: with your actual cloned repository path.

From the cloned C2C directory, run setup for the coding workspace you want ChatGPT to inspect:

node bin/c2c.js setup -w <path-to-your-coding-repository>

Setup starts the bridge and Cloudflare connection and guides you through ChatGPT authorization. After the connection and file-read check succeed, invoke the installed Skill with a coding task:

Use Codex with ChatGPT to implement dark mode.

Inspecting Images and Importing Media

ChatGPT can inspect workspace screenshots and visual assets through the read-only read_image MCP tool. It supports PNG, JPEG, GIF, WebP, and SVG files, subject to workspace and size limits.

For an image or video downloaded through ChatGPT, Codex can import the file into the repository with c2c asset import. The local import checks the file signature and destination path and creates a new file in the workspace.

c2c asset import -w <workspace> --from <downloaded-file> --to <new-workspace-path>

Cloudflare Connections and Recovery

The default Cloudflare Quick Tunnel provides a temporary public address for the MCP bridge. When that address changes after a restart, the C2C Skill can recreate the affected ChatGPT connector and verify access with workspace_info. If the saved chat cannot use the new connector, the Skill starts a replacement chat in the same ChatGPT Project and transfers the task handoff.

A named Cloudflare Tunnel uses a stable hostname across restarts. It requires a Cloudflare account and a domain already managed through Cloudflare. The temporary tunnel works without a custom domain.

When a connection fails, run c2c doctor to inspect the bridge, workspace, authorization, and tunnel. Generate a fresh pairing code with c2c pair when the ChatGPT authorization form is ready. On networks that repeatedly interrupt QUIC, setting C2C_TUNNEL_PROTOCOL=http2 lets cloudflared use HTTP/2.

The CLI includes these workspace commands. If c2c is not on your command path, use node bin/c2c.js from the C2C checkout with the same arguments.

TaskCommand
Check the connectionc2c status -w <workspace>
Diagnose and repairc2c doctor -w <workspace>
Generate a pairing codec2c pair -w <workspace>
Revoke workspace accessc2c unpair -w <workspace>
View logsc2c logs -w <workspace>
Stop the bridgec2c stop -w <workspace>

ChatGPT Projects and Longer Coding Tasks

A new workspace can use a ChatGPT Project to organize its C2C conversations. Each new Codex conversation starts a separate chat inside that Project, with one connector assigned to the workspace. Existing workspaces can continue using their original long-running chat.

When work needs to continue in another chat, Codex sends a short HANDOFF with the task goal, completed steps, outstanding issues, and next action. ChatGPT can inspect the latest code through MCP before resuming its review.

Local checkpoints record the current iteration and next expected step, allowing Codex to resume after a restart. The default limit is 12 iterations per task, configurable through maxIterations in .c2c.json. At the limit, Codex asks whether to continue.

The installed Skill checks GitHub for updates daily. You can also ask Codex to Update Codex with ChatGPT to pull, rebuild, and reinstall the latest version.

Pros

  • ChatGPT reviews the actual repository changes and recorded test results.
  • Codex performs coding, shell, test, and Git operations in its existing harness.
  • OAuth and workspace-specific file rules limit MCP access.
  • Saved conversations, checkpoints, and connector repair support longer tasks.

Cons

  • Requires eligible ChatGPT MCP access and local Cloudflare bridge setup.
  • Temporary tunnel addresses can trigger connector reauthorization.

FAQs

Does the ChatGPT connection require an OpenAI API key?

No. ChatGPT connects through the OAuth-protected MCP bridge. Codex continues to use its own configured access for running coding tasks.

Does ChatGPT receive my entire repository?

ChatGPT receives the files, diffs, images, searches, and execution results it requests through MCP. The project does not automatically upload the repository as a single archive.

Is Codex with ChatGPT an official OpenAI project?

No. It is an independent, MIT-licensed open-source project and is not affiliated with OpenAI.

Alternatives & Related Resources

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!