DEV Community

Terminal Chai
Terminal Chai

Posted on

Codex with ChatGPT: Connect Your ChatGPT Web Subscription as the Planning Brain for Codex

Dual-Engine Agentic Coding: Meet Codex with ChatGPT

Autonomous coding agents (such as OpenAI Codex and Claude Code) have revolutionized local software development. However, running high-reasoning models across entire codebases to draft architectural plans, design specifications, and review multi-file pull requests consumes millions of expensive API tokens. Paradoxically, many engineers pay for flat-rate monthly subscriptions (like ChatGPT Plus or Pro) whose generous web quotas sit underutilized while their command-line API bills mount.

Codex with ChatGPT is an open-source bridge developed by XiaoDuoYa. Operating on the core philosophy "ChatGPT thinks. Codex works.", it links the official ChatGPT web interface to your local Codex terminal session through a secure, read-only Model Context Protocol (MCP) bridge.


What is Codex with ChatGPT?

Codex with ChatGPT separates software development into two distinct layers:

  1. The Reasoning & Review Plane (ChatGPT Web): Evaluates requirements, drafts architectural plans, and independently reviews git diffs and test results using your existing web subscription.
  2. The Execution Plane (Codex Terminal): Applies code changes, manages git branches, and runs local test suites directly inside your terminal environment.

Rather than copying and pasting files manually or routing code through untrusted third-party reverse proxies, ChatGPT reads only the specific lines of code it requires via an OAuth 2.1-authenticated local MCP bridge.


Key Core Features

1. Zero API Token Waste for Reasoning

By offloading high-context architectural reasoning and code reviews to the ChatGPT web client, developers eliminate repetitive token burn on planning tasks. Codex only uses tokens when executing code edits and terminal commands.

2. Read-Only Security Architecture

Security is enforced by design:

  • No Write Capabilities on Bridge: The MCP bridge server only implements 9 read-only inspection tools (read_file, git_diff, test_status, etc.). No write, delete, or shell execution tools exist on the bridge server, eliminating prompt injection risks.
  • Automatic Secret Redaction: Files matching .env*, private keys, and credential stores are blocked by default.
  • OAuth 2.1 & Ephemeral Pairing: Connections require PKCE-authenticated OAuth and 5-minute single-use pairing codes.

3. Independent Post-Execution Code Review

Once Codex finishes modifying files and running test suites, ChatGPT does not rely on text summaries. Instead, it inspects the actual git diff and test execution records through the MCP data plane to verify correctness before signing off.

4. Automated One-Paste Installation

The project includes a streamlined Codex skill that automates full environment setup:

# Instruct your Codex agent directly:
Please install and configure "Codex with ChatGPT" for me, fully automatically.
Enter fullscreen mode Exit fullscreen mode

Codex checks system prerequisites, compiles the local bridge, provisions the tunnel, and establishes the pairing connection without manual configuration.


Conclusion

By combining the conversational reasoning depth of ChatGPT web with the local execution power of Codex, Codex with ChatGPT offers an economical and disciplined approach to agentic development.

Want to connect your web subscription to Codex? Check out the Codex with ChatGPT GitHub Repository.

Top comments (0)