OpenAI Codex vs GitHub Copilot
Codex and Copilot now meet at every level: a cloud agent that returns a pull request, an agent in the editor, a CLI, a desktop app and a pull request reviewer. How they compare at each, which instruction files each reads, which models each runs, and how Codex can run inside Copilot.
7 min read
OpenAI Codex and GitHub Copilot no longer compete as an autocomplete and an agent. Both now have a cloud agent that works on its own and returns a pull request, an agent in the editor, a command-line agent, a desktop app and a pull request reviewer. The real differences are where each is anchored and what it runs. Copilot is anchored in GitHub: issues, Actions, pull requests and policies, with models from several vendors, OpenAI’s among them. Codex is OpenAI’s own agent, running OpenAI’s models, anchored in your ChatGPT account and one AGENTS.md. And they are not exclusive: GitHub now offers the Codex coding agent inside Copilot, in public preview. Choose by where your team already works and reviews, then decide whether you need both.
The surfaces, side by side
Codex GitHub Copilot Cloud Codex cloud Copilot cloud agent Editor Codex IDE extension Copilot agent mode Terminal codex copilot Desktop ChatGPT desktop app, Codex view GitHub Copilot app Scripts, CI codex exec copilot -p PR review @codex review Copilot code review
Cloud delegation
Codex cloud runs tasks in isolated, OpenAI-managed environments that you configure once per repository with its dependencies, tools and variables. OpenAI’s Codex cloud page (opens in a new tab) says it connects to GitHub or, in beta, GitLab, and takes work from the web, GitHub pull requests, GitLab merge requests and issues, Linear and Slack, as well as from the CLI and the IDE extension. Each task returns a summary and a diff; you ask for follow-ups or open a pull request. Setup runs with network access; the agent phase is offline by default unless you allow it.
Copilot’s cloud agent, formerly called the coding agent, works in its own ephemeral development environment powered by GitHub Actions, according to GitHub’s page about the cloud agent (opens in a new tab). You start it from the agents panel on GitHub.com, by assigning an issue to Copilot, from VS Code, or with @copilot in a pull request comment, and there are integrations for Slack, Teams, Jira, Linear and Azure Boards. On GitHub.com it can research and plan on a branch before any pull request exists. It works only on repositories hosted on GitHub. The full walkthrough is in the GitHub Copilot coding agent.
In the editor
- Codex: the IDE extension runs in VS Code and compatible editors, including Cursor and Windsurf, while Xcode and JetBrains IDEs have their own Codex integrations. You add open files and selections to the prompt, review a focused diff and keep the changes you want, or hand a longer task to Codex cloud.
- Copilot: agent mode works in VS Code beside your code, with Plan to agree an approach first and checkpoints you can restore. Copilot also runs in other editors, including JetBrains IDEs. Habits that help are in GitHub Copilot agent mode best practices.
In VS Code the choice can be made per session. The editor’s page on agent harnesses (opens in a new tab) lists Local, Copilot, Claude and Codex harnesses, and says the Codex harness runs through the OpenAI Codex extension, with VS Code providing session management, chat and code review around it.
In the terminal
- Codex CLI:
codexin a repository. It runs in an OS-enforced sandbox with the network off and writes limited to the workspace by default,codex execruns it from a script,/reviewreviews local changes, andcodex cloudsends work to the cloud from the terminal. - Copilot CLI:
copilotin a repository. It asks before any tool that can change your system, lets you allow a tool once or for the session, has a plan mode on Shift+Tab, and runs from scripts with-pplus--allow-toolrules. A GitHub MCP server is built in, so it can list your pull requests or open an issue as well as change code. The detail is in GitHub Copilot CLI.
codex exec "Summarise this week's commits" copilot -p "Summarise this week's commits" --allow-tool='shell(git)'
The desktop apps follow the same split. Codex’s is now a view inside the ChatGPT desktop app, built for parallel threads and worktrees. GitHub’s newer Copilot app is built on Copilot CLI and runs several agent sessions, each on its own worktree and branch, with GitHub issues, pull requests and CI results in the same window.
GitHub integration and pull request review
This is Copilot’s home ground. Its code review can be requested on any pull request or turned on for every one, reads the whole repository for context, and can pass its suggestions to the cloud agent, which opens a pull request with the fixes applied. Organisations on Business and Enterprise plans can let members without a Copilot licence use it on GitHub.com.
Codex reviews on GitHub once Codex cloud is set up for the repository: comment @codex review, or turn on automatic reviews. It posts a standard GitHub review that flags only P0 and P1 issues and follows a ## Code Review Rules section in your AGENTS.md. Other requests work the same way; @codex fix the CI failures starts a cloud task with the pull request as context. How to fit either reviewer into your process is in AI agents for PR review.
Instruction files
Codex reads AGENTS.md, from ~/.codex down through each directory to where you are, with an AGENTS.override.md taking precedence in any directory that has one. Copilot reads more. GitHub’s page on repository custom instructions (opens in a new tab) lists .github/copilot-instructions.md, path-specific .instructions.md files, one or more AGENTS.md files with the nearest taking precedence, or a single CLAUDE.md or GEMINI.md at the root. The overlap is AGENTS.md, so put shared rules there. Which Copilot surface reads which file is in does GitHub Copilot support AGENTS.md?
Model choice, and Codex inside Copilot
Codex runs OpenAI’s models, chosen with /model or --model. Copilot runs several vendors’ models. GitHub’s supported models list (opens in a new tab) includes OpenAI’s GPT models, a Codex-tuned one among them, alongside models from Anthropic, Google, Microsoft, Moonshot AI and xAI, with availability depending on your plan and where you use Copilot. So you can use OpenAI models inside Copilot without Codex, but that is Copilot’s agent running an OpenAI model, not the Codex agent.
The Codex agent itself is available too. GitHub’s OpenAI Codex page (opens in a new tab) says the Codex coding agent is available on all paid Copilot plans, in public preview, as a third-party agent you enable in your Copilot policies. You assign it an issue or a prompt on GitHub, and it works on a pull request and consumes Actions minutes and AI credits like Copilot’s own agent. In the Codex VS Code extension, Sign in with Copilot is available to Copilot Pro+ and Max subscribers. Billing differs between the routes, so check each vendor’s current plans.
Who each suits
- Your team lives in GitHub, assigns work as issues and wants one reviewer on every pull request: Copilot, whose cloud agent, code review and policies are built into the platform.
- You want OpenAI’s agent with one configuration in every tool, including editors other than VS Code: Codex.
- Your code is on GitLab: Codex cloud connects to it in beta. Copilot’s cloud agent works on GitHub repositories.
- You want to try several vendors’ models on the same task: Copilot’s model picker, or its third-party agents.
- You pay for Copilot but want the Codex agent: enable the Codex coding agent in your Copilot policies, or use the Codex harness in VS Code.
- You already pay for ChatGPT: Codex signs in with your ChatGPT account and needs nothing else.
One list for every agent
With Codex and Copilot both able to take the same issue, the risk is two agents working one task and nobody seeing the whole picture. Keep the list outside both. On fenbs, Codex and Copilot in VS Code connect to the same MCP address with a browser sign-in; Copilot’s cloud agent, which does not yet support OAuth sign-in for remote servers, uses a token you issue under Settings. Every change is recorded in History under the assistant’s name on your behalf, and tasks move through To Do, Next Up, In Progress and Completed whichever agent did the work.
Related
Set-up pages: Codex CLI and GitHub Copilot. The Codex surfaces compared: Codex app vs CLI vs IDE extension. More comparisons: Cursor vs Codex, Google Antigravity vs Claude Code and Claude Code vs GitHub Copilot.