codex-with-chatgpt: The Repo That Splits Coding Into Thinking and Doing

ChatGPT plans. Codex executes. This bridge shows how to connect two AI systems without handing the web one the keys to your machine.

7 min read • View on GitHub • More from XiaoDuoYa

A wide black-ink editorial scene shows a browser window on one side and a terminal on the other, linked by a narrow locked bridge. The browser side is crowded with notes and a plan, while the terminal side holds tools and files, explaining how the project separates planning from execution.
The repo’s core move is simple and sharp: keep the reasoning on one side, keep the dangerous work on the other, and connect them with a narrow protocol.
Key Takeaways

Why split one coding agent into two?

The obvious read is wrong. This is not “ChatGPT for coding.” It is a deliberate split-brain system: ChatGPT handles planning, review, and broad reasoning, while Codex handles the local work that actually touches files and state. That split matters because it turns a coding agent into a coordination problem, not a single-model problem.

The economic logic is part of the design. If you already pay for ChatGPT Plus or Pro, why spend expensive API or Codex capacity on steps that can live in the web UI? `codex-with-chatgpt` turns that annoyance into an architecture.

ChatGPT Plus/Pro web quota sits idle while your coding agent burns scarce API/Codex tokens on planning and review. This project moves the thinking to the subscription you already pay for; Codex only executes.

XiaoDuoYa, Project Creator / Maintainer · XiaoDuoYa/codex-with-chatgpt: ChatGPT thinks. Codex works.

The bridge is a protocol, not a shortcut

The repo’s C2C bridge is the real product. It moves messages through a state machine, not a loose chat loop, and that makes the whole thing legible: INIT, PAIR, PLAN, READ, EXECUTE, REVIEW, DONE. The sequence matters because each step has a different trust level.

This state machine is why the bridge feels like infrastructure, not a shortcut. It keeps the conversation structured enough that two different AI surfaces can cooperate without collapsing into one messy session.

The implementation choice that deserves attention is the narrow surface area. The public side exposes only what ChatGPT needs to inspect the workspace. The admin side stays loopback-only, guarded by a local token and kept away from tunnel exposure. That is the difference between an integration and a control plane.

A close black-ink scene shows a short-lived pairing code on a local screen while a hand enters it into a browser page. A lock encloses the approved connection, and a blocked path sits behind a hard barrier, explaining how authorization narrows access to the bridge.
Authorization is not an afterthought here. The system makes the user prove local control before the remote planning brain can read anything useful.

Security comes from narrowing the blast radius

This is where the repo earns trust. The bridge uses OAuth2 with PKCE, a short-lived pairing code, and read-only MCP tools so the web side can inspect without mutating. That means ChatGPT can see enough context to plan well, but it does not get shell access, write access, or a casual path into your machine.

Use the ChatGPT web app as the planning and review brain for your Codex coding sessions, while Codex keeps full ownership of execution. Your repository is never uploaded: ChatGPT reads exactly the lines it needs through a secure, OAuth-protected, read-only MCP connection.

James Chang, Developer / Reviewer · Use ChatGPT web as planning brain for Codex coding

The smartest trick is the installation flow

The repo’s most agentic idea may be its least flashy one. The install instructions are written so another model can follow them. In practice, that means the README is no longer just documentation for humans. It is a script for a helper agent that can clone, build, configure, and launch the bridge on your behalf.

That changes distribution. Software does not just tell users what to do anymore. It tells an agent what to do, and the agent does the boring work. If that pattern spreads, the README becomes a machine-readable operating manual with human prose wrapped around it.

Stateless MCP keeps the bridge from getting sticky

The technical subtlety is easy to miss and easy to appreciate once you see it. The HTTP handler creates a fresh MCP server per request, which keeps the bridge stateless at the transport edge. That avoids the usual long-lived-session problems: memory leakage, stale context, and state bleeding between conversations.

That matters because the client is not a tidy internal service. It is a remote model with unpredictable pacing and an uneven interaction pattern. Fresh server instances per request are boring in the best way. They make a weird system behave like a dependable one.

Compared with the rest of the agent stack, this is unusually narrow

ToolPrimary environmentPlanning/execution modelTrust modelBest fit
codex-with-chatgptWeb plus local bridgeChatGPT plans, Codex executesRead-only web side, local admin sideUsers who want ChatGPT and Codex to cooperate
Claude CodeCLISingle agent plans and executes in one loopLocal terminal trustTerminal-first implementation work
CursorIDEInline editor assistance with agent featuresEditor-centric workspace accessDevelopers who live inside an IDE
AiderCLIChat-driven edits against git reposLocal repo accessFast repo patching from the shell
ClineVS Code extensionAgent inside the editorExtension-scoped tool accessIDE-native MCP workflows
OpenCodeCLIMulti-provider coding assistantProvider-dependentUsers who want a flexible open-source harness

The point of the comparison is not that one tool wins. It is that `codex-with-chatgpt` occupies a very narrow niche: web-planning plus local execution with an explicit trust boundary. That niche is real, and it explains why the repo feels more like a protocol adapter than a competitor to editor-first tools.

What this repo says about the next wave of coding tools

The larger lesson is that coding agents are drifting toward specialization. One model reasons broadly. Another edits locally. A bridge coordinates them. That is a healthier mental model than expecting one giant assistant to be equally good at planning, implementation, review, and trust management.

`codex-with-chatgpt` is interesting because it makes that split concrete. It shows how software can be distributed across multiple AI surfaces, with explicit boundaries instead of one all-powerful agent. That feels less magical, and more deployable.