Claude Code vs Codex: Agentic Coding Compared

No. The old Codex was a 2021 code-generation model, now deprecated, that once powered early GitHub Copilot. Codex CLI is a separate 2025 command-line coding agent from OpenAI that runs in your terminal and is built on current GPT models.
Codex CLI is open source, released under the Apache-2.0 licence, so you can read, fork, and self-host the client. Claude Code is proprietary software from Anthropic and is not open source, though it is freely installable with an account.
Yes. Both Claude Code and Codex CLI support the Model Context Protocol, an open standard for connecting AI tools to external data sources and tools. That means you can extend either with MCP servers for things like issue trackers or databases.
CLAUDE.md is the project instructions file Claude Code reads at the start of a session. AGENTS.md serves the same purpose for Codex CLI but is an open, cross-tool convention adopted by many agents, so one AGENTS.md can guide several different tools.
Pick Codex CLI if open source and self-hosting matter, or if you are already in the OpenAI ecosystem. Pick Claude Code if you prefer its broader surfaces and features or already use Claude models. Both change fast, so test each on a real task and check current docs.

Key Takeaway
Claude Code and Codex CLI are agentic coding assistants that run in your terminal, read and edit your repository, run shell commands, and iterate on a task. Claude Code is Anthropic's proprietary tool built on Claude models. Codex CLI is OpenAI's open-source, Apache-2.0 licensed agent built on GPT models. Both support the Model Context Protocol.
The words agentic coding used to describe autocomplete. In 2025 they describe something bigger: a tool that lives in your terminal, reads the whole repo, edits files, runs commands, checks the output, and keeps going until the task is done. Two of the most talked-about tools in this category are Anthropic's Claude Code and OpenAI's Codex CLI.
To be clear about names first: this Codex is the 2025 command-line coding agent, not the deprecated 2021 Codex model that once powered early Copilot. This post compares the two current CLI agents on the things that actually change your day, vendor, models, licensing, permissions, extensibility, and config, without inventing benchmark numbers or pricing.
Both are agentic coding assistants that you drive from a command line inside a project directory. You describe a goal in plain language. The agent plans an approach, reads the relevant files, edits code across multiple files, runs commands such as tests or a build, reads the results, and iterates. It is less an autocomplete and more a junior engineer working a ticket.
Anthropic describes Claude Code as an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools, available in the terminal, IDE, desktop app, and browser. OpenAI describes Codex CLI as a lightweight coding agent that runs in your terminal, where you inspect, edit, and run code without leaving the command line.
The overlap is large enough that switching between them feels familiar. Each reads a project-level instructions file at the start of a session, exposes a permission or approval system so it does not run destructive commands unprompted, and supports the Model Context Protocol so you can plug in external tools and data sources.
Both are also backed by frontier models from their own vendor and both run beyond the raw terminal, Claude Code across IDE, desktop, and web surfaces, and Codex through related ChatGPT and IDE integrations. If you have used one agentic CLI, the mental model transfers cleanly to the other.
A side-by-side comparison of Claude Code and Codex CLI across the aspects that most affect adoption.
| Aspect | Claude Code | Codex CLI |
|---|---|---|
| Vendor | Anthropic | OpenAI |
| Underlying models | Claude models | OpenAI GPT models |
| Open source | No, proprietary | Yes, Apache-2.0 |
| Config file | CLAUDE.md | AGENTS.md |
| Extensibility (MCP) | Yes, MCP support | Yes, MCP support |
Whichever tool you pick, invest early in its instructions file. A clear CLAUDE.md or AGENTS.md describing your build commands, test runner, and conventions cuts wasted iterations more than any model upgrade.
The surface behaviour is similar, but the details that matter for adoption, especially licensing, vendor lock-in, and configuration, diverge in ways worth knowing before you standardise a team on one.
If open source matters to you, whether for auditing what the client does, self-hosting, or avoiding a proprietary binary, Codex CLI has a clear edge because the client is Apache-2.0 licensed. If you already pay for one vendor's models or subscription, using the matching agent keeps billing and access simple, and often gives you the newest model first.
Config portability is a quieter but real factor. AGENTS.md is an open format adopted by many tools, so a repo carrying one can be understood by several agents, not just Codex. CLAUDE.md is specific to Claude Code but pairs with a deep feature set, auto memory, skills, hooks, subagents, and multiple surfaces. Teams juggling several agents may keep both files.
Do not assume the two tools share a permission model. An approval or sandbox setting that feels safe in one does not map one-to-one to the other, so read each tool's current permission docs before granting it command-execution rights on a real repo.
This category changes monthly. Default models, permission commands, pricing tiers, and even installation methods have all shifted within single release cycles, and anything specific quoted here can go stale fast. Treat the durable structure below as the takeaway and verify the specifics against current docs before you commit.
Claude Code and Codex CLI solve the same problem, an agent in your terminal that reads, edits, runs, and iterates, and they are more alike than different. The real deciders are licensing, which vendor you are already invested in, and how much you value the open, cross-tool AGENTS.md convention versus Claude Code's broader surface set. Try both on a real task and let your own repo decide.