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.
What Both Tools Actually Are
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.
- Both operate on your real working tree, staging edits and running commands rather than just suggesting text.
- Both are conversational and iterative, reacting to test failures and error output on their own.
- Both integrate with git so they can commit, branch, and help open pull requests.
How They Are Similar
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.
Where They Differ
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.
- Vendor and models: Claude Code runs on Anthropic's Claude models; Codex CLI runs on OpenAI's GPT models. Your choice ties you to that provider's account and ecosystem.
- Licensing: Codex CLI is open source under the Apache-2.0 licence, so you can read, fork, and self-host the client; Claude Code is proprietary software from Anthropic.
- Config file: Claude Code reads CLAUDE.md, while Codex CLI reads AGENTS.md, an open, cross-tool convention now used by many agents beyond Codex.
- Permission model: both gate risky actions, but the controls differ, Codex exposes sandbox and writable-root settings and approval modes, while Claude Code offers its own permission modes and hooks.
How To Choose For Your Workflow
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.
A Fast-Moving Space
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.
- Underlying models and their defaults change frequently; check which model an agent uses today rather than trusting an old blog.
- Feature parity moves fast, MCP support, IDE plugins, and cloud modes appear on both sides over time.
- Pricing and plan limits are the fastest-moving detail of all and were deliberately not quoted here; confirm them on each vendor's pricing page.
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.

