Claude Code vs Codex
How Anthropic's and OpenAI's coding agents compare once they leave the laptop: the cloud machine each runs on, how it reaches your network and credentials, where work starts, and what comes back for review.
Facts checked against each vendor’s documentation on .
The short answer
Both are capable coding agents, and which one writes better code on a given week moves with every model release, so this page doesn't pick a winner on code quality. What differs, and changes more slowly, is how each one runs once a team stops driving it from a laptop: how its cloud environment is built, what it can reach on the network, how your credentials stay out of the agent's hands, where a task can start, and what lands in review.
In practice: Codex Cloud prepares and tests its own environment from your repositories and adds private networking over Tailscale and short-lived cloud credentials over OIDC. Claude Code's cloud sessions start from a pre-loaded Ubuntu VM you extend with a setup script, with organization-shared environments and the option to run sessions on your own runners. Codex takes work straight from Linear; Claude Code doesn't yet. Both work from Slack in their business tiers, and both run in GitHub Actions.
Claude Code and Codex side by side
| Feature | Claude Code | Codex |
|---|---|---|
| Maker and models | Anthropic; Claude models. The CLI can also reach Claude through Amazon Bedrock or Google Cloud Vertex AI. | OpenAI; OpenAI models. Sign in with a ChatGPT plan or use an API key. |
| Running it in the cloud | Cloud sessions, started at claude.ai/code, from the Desktop or mobile app, or with claude --cloud in the terminal. | Codex Cloud tasks, started from the web, the desktop app (Work in › Cloud) or mobile. |
| The cloud machine | A fresh Ubuntu 24.04 VM per session with your repo cloned and common runtimes, Docker, PostgreSQL and Redis pre-installed. Anthropic lists approximate ceilings of 4 vCPUs, 16 GB RAM and 30 GB disk. | A VM per task. OpenAI lists 2 vCPUs and 8 GiB on Plus, and 4 vCPUs, 16 GiB and 32 GiB disk on Pro, Business and Enterprise, with larger VMs on request for Enterprise. |
| Environment setup | You write a setup script that runs as root. If it finishes in roughly five minutes, the result is snapshotted and later sessions start from it. | Codex inspects your repositories, installs and tests the setup itself, records an install script and a start skill, and you publish the result. |
| Sharing a setup | On Team and Enterprise, Owners create organization-shared environments. Sessions can also route to self-hosted environments on your own runners. | Publish an environment and share it with your workspace (Enterprise). Each person supplies their own personal secrets when a shared setup asks for them. |
| Network access | None, Limited (package registries plus domains you allow; the default) or Full. | All public internet, or restricted to a package-manager preset plus domains you add. Private services over a Tailscale VPN. |
| Credentials | Network secrets attached by a proxy outside the VM. GitHub goes through a separate proxy, so your token never enters the session. | Network secrets substituted by a proxy on HTTPS. OIDC connections give tasks short-lived credentials for supported AWS and Google Cloud services. |
| Slack | Claude Tag (Team and Enterprise, in beta): tag @Claude in a channel and it works under the organization's own identity. | Ask @ChatGPT in Slack or Microsoft Teams, in Enterprise workspaces with cloud delegation turned on. |
| Linear | No Linear assignee at the time of writing; an open feature request on Anthropic's repo tracks it. | Assign an issue to Codex or mention @Codex; it runs as a cloud task and posts progress back to the issue. |
| GitHub | The Claude GitHub app and the claude-code-action workflow: mention @claude in an issue or pull request, or run it on any GitHub event. | @codex review on pull requests, and the openai/codex-action workflow, which runs codex exec in your CI. |
| Repo instructions | CLAUDE.md, or AGENTS.md in its place. The repo's .claude/ settings, hooks, skills and .mcp.json carry into cloud sessions. | AGENTS.md. Skills stored in the repository are available in cloud tasks. |
| What comes back | A branch and pull request. Commits carry a Claude-Session trailer that links back to the session transcript. | A diff and test results to review in the task, then a commit or pull request. |
| Price | Cloud sessions need a paid Claude plan. Check Anthropic's pricing page for current plans and usage limits. | Cloud tasks come with ChatGPT plans. Check OpenAI's Codex pricing page for current plans and usage limits. |
Where each one runs once it leaves the laptop
Both tools started as agents a developer runs in a terminal, and both now have a hosted mode where the work runs on the vendor's machines and keeps going after the laptop closes. That hosted mode is what matters for a team: it is the difference between an agent one engineer babysits and one that takes a ticket and returns a pull request. The trade-offs behind that move are covered in cloud vs local agent environments.
Claude Code's cloud sessions give each session a fresh VM with the repository cloned. A session can be started from the browser, the apps or the terminal, and handed between terminal and cloud with --cloud and --teleport. Codex Cloud gives each task its own workspace, and a task's saved VM state stays recoverable for up to seven days after it was last used, so a reviewer can come back to it.
Building the environment
This is the biggest practical difference. Claude Code starts every session from the same pre-loaded image (Python, Node, Ruby, PHP, Java, Go, Rust, C/C++, Docker, PostgreSQL, Redis, Chrome) and you add what's missing with a setup script. The script has to exit cleanly and finish in roughly five minutes for its result to be cached; anything that should run per session, such as starting a database, goes in a SessionStart hook.
Codex Cloud asks less of you up front: point it at your repositories and it works out the runtimes, installs dependencies, tests the workflow and writes down what worked as an install script and a start skill. You review that report and publish. Either way the goal is the same: an agent that can install, build and run its tests without asking, which is what dependency preloading and toolchain parity are about.
Network access and credentials
Both default to a restricted network that still reaches package registries, and both let you widen it per environment. Both also keep API keys away from the agent by letting a proxy add them to outbound requests for the hosts you name, so a prompt-injected agent can use a key without being able to read or leak it.
Past that, they reach private systems differently. Codex Cloud can join your network over Tailscale, including TCP services such as databases, and can take short-lived AWS and Google Cloud credentials over OIDC instead of stored keys. Claude Code's answer for private systems is to run sessions in a self-hosted environment on your own runners, where traffic leaves through your own network. If an agent needs to reach a staging database or an internal registry, test that path first; it decides more than any feature list. The site's guide to network access controls covers what to allow.
Starting work from Slack, Linear and GitHub
Codex has the wider set of native triggers today: Linear issues assigned to Codex become cloud tasks, @codex review reviews pull requests, and Enterprise workspaces can hand work to it from Slack or Teams. OpenAI says the older Codex Cloud experience still runs Code Review and the Linear and GitHub integrations and that it plans to retire it, so check which environment those integrations use before you set them up.
Claude Code's team trigger in Slack is Claude Tag, which acts as the organization rather than as one member, with environments an Owner sets. For Linear there is no native assignment yet; teams connect it through Linear's MCP server, the GitHub Action, or a dispatch layer of their own. Both run in GitHub Actions. More on each path: triggering coding agents from Slack, connecting coding agents to Linear and GitHub Actions integration.
What comes back, and how to review it
Both end at a pull request your team reviews as usual. Claude Code marks its commits with a link to the session that produced them, so a reviewer can read how the change was made. Codex keeps the task, its diff and its test results together, so the reviewer can ask for changes in the same task before anything is committed. Whichever you use, review is where agent work slows down, so make the pull request carry what the reviewer needs: what was asked, what ran, and what passed.
Which one to give which task
If you run both, split work by its shape rather than by habit. The site's multi-agent routing guide goes task class by task class; the short version:
- Work that needs the engineer in the loop as it develops, such as a cross-file refactor or a design question, suits an interactive Claude Code session that can move between terminal and cloud.
- Well-specified tickets that can run unattended and come back as a pull request suit Codex Cloud, especially when they start in Linear.
- Work that needs private services suits whichever one can reach them in your setup: Codex over Tailscale or OIDC, Claude Code on a self-hosted environment.
- Pull request review can go to either: Codex through
@codex review, Claude Code through its GitHub app or Action.
Running both without two workflows
Picking one isn't required. Keep one AGENTS.md at the repo root (Claude Code can read it in place of CLAUDE.md), keep setup in scripts the repository owns rather than in each vendor's settings, and send both agents' output through the same pull request review. Platforms that run several agents in the same kind of environment exist for this: Replicas, for one, runs Claude Code, Codex and other agents each in an isolated VM, starts them from Slack, Linear or GitHub, and returns pull requests. The site's guide to isolated VM environments lists what to ask of any of them.
Check these before you choose
Plans, prices and limits change faster than this page. Confirm these with each vendor for your own team:
- Current prices and usage limits, on Anthropic's and OpenAI's pricing pages: both change often.
- Which plan includes what you need: cloud sessions, Claude Tag, Codex in Slack and environment sharing each depend on the plan.
- Where your code lives: Codex Cloud doesn't support self-hosted GitHub Enterprise Server yet, and lists GitLab support as beta; check each vendor's docs for your host.
- Whether the agent can reach every registry, service and database your tests need, from inside its environment.
- Each vendor's data retention and training terms for your plan, in their trust and privacy documentation.
Sources
- Use Claude Code in the cloud (Anthropic)
- Configure cloud environments for Claude Code (Anthropic)
- Claude Code GitHub Actions (Anthropic)
- How Claude remembers your project: CLAUDE.md and AGENTS.md (Anthropic)
- Work with Claude Tag (Anthropic)
- Feature request: Linear integration for Claude Code (GitHub)
- Codex Cloud environments (OpenAI)
- Use Codex in Linear (OpenAI)
- Review GitHub pull requests with Codex (OpenAI)
- Codex GitHub Action (OpenAI)
Go deeper on Hands Off Development
- Multi-Agent Routing on a Single Cloud Platform When Claude Code Codex Cursor and OpenCode Each Own Different Task Classes
A task-by-task guide to which coding agent fits which job.
- Cloud vs Local Agent Environments for Engineering Teams
Laptops can't isolate, parallelize, or reproduce agent work at team scale.
- Isolated VM Environments for Coding Agents
Why coding agents need microVM-grade isolation, not just containers.
- Network Access Controls for Sandboxed Agent Environments
Agent sandboxes leak through the network, and scoped egress allowlists close the gaps.
- Triggering Coding Agents From Slack
Slack Code turns a team thread into a reviewable agent run.
- Connecting Coding Agents to Linear for Task Automation
Linear's coding sessions turn issues into agent tasks with PR review.
- GitHub Actions Integration With Cloud Coding Agents
Actions gives coding agents the permissions, sandboxing, and review controls teams already trust.
- Headless Agent Execution Pipelines That Deliver Pull Requests From Cursor and Claude Code Without Human Babysitting
How Claude Code and Cursor ship unattended PRs through triggers, sandboxes, and review.