Overview
Plan a code change in a ChatGPT conversation, hand the written plan to Codex CLI in your local repository to edit files and run tests, then bring the diff back to ChatGPT for a second review before you merge.
Problem or Objective
- Which tools help write a spec before an agent writes code?
- Which agents build a non-trivial feature with you?
More in Coding and Code Review
AI Agents and Models
Tools and Integrations
- Tools
- ChatGPT · Codex CLI · Git
- Prerequisites
- A ChatGPT plan that includes Codex (the Codex README names Plus, Pro, Business, Edu and Enterprise) and Codex CLI installed on your computer, plus a local Git repository.
How It Works
Describe the feature or fix to ChatGPT, with the relevant file names, constraints and how it will be tested, and ask for a step-by-step implementation plan and a list of risks. Save the agreed plan as a Markdown file in your repository. Create a new branch, start Codex CLI in the repository and sign in with your ChatGPT account. Ask Codex to read the plan file, carry out the steps, and run the existing tests and linters. Watch the commands and diffs as they appear and steer it when it drifts from the plan. When it finishes, copy the diff and test output into the ChatGPT conversation and ask for a review against the plan: missed steps, risky changes, missing tests. Feed any fixes back to Codex. Review the final diff yourself and merge it only when you are satisfied.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up ChatGPT, Codex CLI.
- Connect the toolsConnect the tools this workflow relies on: ChatGPT, Codex CLI, Git.
- Check the prerequisitesA ChatGPT plan that includes Codex (the Codex README names Plus, Pro, Business, Edu and Enterprise) and Codex CLI installed on your computer, plus a local Git repository.
- Gather your detailsCollect what the prompt asks for: Change you want, Language and framework, Files you already know are involved.
- Run the starter promptPaste the starter prompt below into ChatGPT and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at github.com before you rely on it.
Practical Starter Prompt: Plan this change for a coding agent
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
I want to [Change you want] in a [Language and framework] project. Relevant files: [Files you already know are involved]. Write a numbered implementation plan a coding agent can follow, with the files to touch in each step, the tests to add or update, and the commands to run to verify. List risks and open questions at the end. Later I will paste the agent's diff and test output here: review it against this plan and tell me what is missing or risky. I will merge only after my own review.Save the plan to the repository, let Codex CLI carry it out on a new branch, and approve its commands as they appear. Bring the diff back to ChatGPT for review, then review and merge yourself.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. The Codex README describes Codex CLI as a coding agent that runs locally and can be used with a ChatGPT plan, and the Codex CLI page says it inspects files, makes edits and runs the tools installed on your machine, showing commands and diffs as they appear. No cited page documents a direct link between a ChatGPT conversation and a Codex session, so the hand-off here is copy and paste, and no page measures the quality of the result.
Limitations and Considerations
Work on a separate branch and keep your own review and tests before merging; neither tool merges anything in this workflow. Do not paste secrets or credentials into either tool. Codex runs commands on your own computer, so read its proposed commands before approving them. Check which ChatGPT plans include Codex and what usage limits apply to yours. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Official Website
The official site of the main tool or project in this use case.
Visit Website (opens in a new tab)developers.openai.com
Related Videos
About openai/codex
Meet the New Codex CLI (opens in a new tab)
Published by the project’s official channel.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- openai/codex README (opens in a new tab)
Project documentation · github.com · Undated · Source checked 25 Nov 2026, 11:59 UTC
What this source supports
- Codex CLI is a coding agent from OpenAI that runs locally on your computer.
- Run codex and select Sign in with ChatGPT. We recommend signing into your ChatGPT account to use Codex as part of your Plus, Pro, Business, Edu, or Enterprise plan.
- Codex CLI | ChatGPT Learn (opens in a new tab)
Project documentation · developers.openai.com · Undated · Source checked 25 Nov 2026, 12:11 UTC
What this source supports
- Let Codex inspect files, make edits, and run the tools already installed on your machine.
- Steer the active turn, inspect commands and diffs as they appear, and keep follow-up work in the same session.
