Claude Code and Codex are the two terminal-first coding agents most developers are choosing between. Both take a task in plain language, read the codebase, plan, edit files, run commands and tests, and iterate. The models underneath are different, the products around them are shaped differently, and those shapes matter more than any benchmark. This is a comparison of how each works day to day, so you can decide from your own workflow rather than from a leaderboard.
What both do#
Give either a task — “add rate limiting to the API and write tests for it” — and it will explore the repository to find the relevant code, propose a plan, make the edits across however many files are involved, run the test suite, read the failures, and fix them. Both support MCP servers for extra tools, both can be scripted from CI, both work from the terminal and have editor integrations. For an ordinary task in a well-structured codebase, either produces a usable result, and the quality gap on any given week depends on the latest model releases more than on the products.
Where they run#
| Claude Code | Codex | |
|---|---|---|
| Primary surface | Local terminal | Local terminal CLI, plus a cloud mode |
| Editor integration | VS Code, Cursor, JetBrains | VS Code and forks |
| Cloud execution | Via the web and mobile apps, and remote sessions | Built in: tasks run in isolated cloud containers you can delegate to and walk away from |
| Non-interactive use | A print mode for scripts and CI | An exec mode for scripts and CI |
The cloud mode is the structural difference. Codex was designed around delegating a task to a sandbox that clones your repository, works, and returns a pull request, with several running at once. Claude Code was designed around a session in your own terminal, in your own environment, where you can watch and steer. Both have since grown the other’s mode, but the emphasis shows in the defaults, and which default matches how you work is the first question to answer.
Control and permissions#
Both ask before doing anything risky, and both let you loosen that. Claude Code’s permission model is granular: allow or deny specific commands and file patterns, per project, with a settings file that can be committed so the whole team runs with the same rules. Codex has approval modes ranging from asking about everything to running autonomously inside its sandbox, where the sandbox itself is the safety boundary.
The practical difference: in Claude Code you tune what it may do on your machine; in Codex’s cloud mode you rely on the container being disposable. Both approaches are sound. For work on a machine with credentials and production access, the granular local model is worth understanding properly before turning anything to automatic.
Configuration#
Each reads an instruction file from the repository root that tells the agent about the project: how to build, how to test, conventions to follow. Claude Code reads CLAUDE.md, Codex reads AGENTS.md, and many repositories now carry both with the same content. Both support hierarchical files, so a subfolder can add its own rules.
# CLAUDE.md or AGENTS.md
Python 3.13, FastAPI, SQLModel. Run tests with: pytest -q
Use type hints. Keep functions small. Do not add dependencies without asking.
Migrations live in alembic/; never edit an applied migration.
Claude Code adds slash commands, hooks that run shell commands at points in the agent’s loop, and subagents for delegating parts of a task. Codex has its own configuration for models, sandboxing and tools. The learning curve is similar; the vocabularies differ.
Working style#
Users tend to describe Claude Code as a collaborator you keep in the terminal beside the editor: you give a task, watch the plan, interrupt, redirect, and it explains as it goes. Codex is often described as a delegate: you hand off a well-specified task and review the result as a diff or pull request. Each can be used the other way, and the descriptions say as much about the users as the tools. The question for you is whether you want to steer while it works or review after.
Cost#
Both are available through subscription plans with usage limits, and both can bill by API usage instead. Agentic sessions consume many more tokens than chat because the agent reads whole files repeatedly, so a plan that seems generous can run out on a large codebase. Check the current pricing pages; figures printed here would be stale within months. The shape to understand is that cost scales with how much of the repository the agent reads, which rewards a well-organised codebase and precise tasks.
How people decide#
- You want to work alongside the agent in your terminal, on your machine: Claude Code’s design centres on this.
- You want to delegate several tasks in parallel and review pull requests: Codex’s cloud mode was built for it.
- Your team standardises on one model vendor: that decides it.
- You already use Cursor or Copilot: both agents integrate; try the one whose model you have found stronger on your code.
A number of developers use both: one for interactive work on hard problems, the other for delegating well-defined chores. The instruction files are nearly interchangeable, so running both costs little beyond the subscriptions.
Questions people ask#
Can I use Codex with Claude models, or Claude Code with OpenAI models?
Not officially. Each is built for its own vendor’s models. Third-party compatibility layers exist and are unsupported.
Which is better for beginners?
Either, used cautiously. The risk for beginners is the same with both: accepting large diffs they do not understand. Start with small tasks and read every change.
Do they replace Cursor or Copilot?
They overlap on multi-file tasks. Inline completion while typing is still the editor tools’ strength; the agents are for delegating whole tasks.
Will this comparison hold next year?
The workflow differences are structural and change slowly. Model quality changes every few months. Re-run the test on your own task when a major release ships.
Where to go next#
- Cursor vs Claude Code — editor-first versus terminal-first.
- Claude Code not working — setup problems on either side.
- What is an MCP server? — giving either agent tools.