# Claude Code vs Codex CLI: terminal coding agents compared (October 2026)

Canonical: https://theagenticweekly.com/compare/claude-code-vs-codex-cli · Last verified: 2026-10-26 · Published: 2026-10-25 · Author: Agentic Weekly (operated independently from Texas, US) · Evidence: Evidence: Tested (smoke test) for both tools on 2026-10-25 (America/Chicago), using a small local open-weight model (Qwen2.5-3B-Instruct, 4-bit, via Ollama 0.40.11) on a Linux box with no GPU and no vendor account. We tested the tools, not any vendor's hosted models. Features, prices and release contents are Reported from vendor pages.

**Our pick:** Pick Claude Code for anyone relying on the Bash sandbox or permission rules (the 2.1.309 fixes close real gaps); pick Codex CLI for people who already use Codex and repeat the same setup prompts (presets save the typing). No overall winner: we have not benchmarked them against each other. **Updated:** 2026-10-26 (America/Chicago).

> Claude Code (Anthropic, v2.1.310) and Codex CLI (OpenAI, 0.164.0) are both terminal coding agents that read your repo, edit files and run commands, and we smoke-tested both on 2026-10-25 with a small local model. Claude Code also runs in VS Code, JetBrains, a desktop app and the web and needs a Claude plan or Console account; Codex CLI is open source under Apache-2.0 and installs from a script, npm or Homebrew. Neither test used the vendors' own models, so this is not a quality ranking.

## What we measured

We ran both Claude Code and Codex CLI ourselves; the table links each full test log. These are smoke tests on one CPU-only machine, not benchmarks. Both ran the same task on the same local model, so the two results are comparable on that one task only. Model-driven runs used a small local Qwen2.5-3B-Instruct model.

Table: Our own tests for Claude Code and Codex CLI

| Test | Claude Code | Codex CLI |
|---|---|---|
| Hands-on test log (install and a real task) | Tested: Claude Code 2.1.310, Oct 25, 2026: partly worked. Claude Code 2.1.310 edited calc.py through its Edit tool with a local 3B model on the second prompt (85.9 s); the first, vaguer prompt made no edit. [Full test log](https://theagenticweekly.com/tests/claude-code) | Tested: Codex CLI 0.164.0, Oct 25, 2026: partly worked. Codex CLI 0.164.0 changed calc.py by running a sed command in its sandbox with a local 3B model; an earlier plain-language edit request ran no edit. [Full test log](https://theagenticweekly.com/tests/codex-cli) |

How we test and label results: [methodology](https://theagenticweekly.com/methodology#testing-rig). All test logs: [test hub](https://theagenticweekly.com/tests).

## Claude Code vs Codex CLI at a glance

Table: Claude Code and Codex CLI side by side (vendor pages and our test, 2026-10-25)

|  | Claude Code | Codex CLI |
|---|---|---|
| Vendor | Anthropic | OpenAI |
| What it is | "An agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools" ([overview](https://code.claude.com/docs/en/overview)) | "Lightweight coding agent that runs in your terminal" ([GitHub repository](https://github.com/openai/codex)) |
| Where you use it | Terminal, VS Code, JetBrains, a desktop app and the web | Terminal |
| License | Not stated on the pages we read | Apache-2.0, per the GitHub repository metadata |
| Install | Native installer, Homebrew, WinGet or apt, dnf, apk; npm install is deprecated | Install script, npm (`npm install -g @openai/codex`) or Homebrew |
| Latest version covered | v2.1.310 (released 2026-10-23) | 0.164.0 (released 2026-10-23) |
| Models and access | Claude models via a Claude subscription or Anthropic Console account; CLI, VS Code and JetBrains also support third-party providers | Sign in with a ChatGPT plan, or point it at other providers; we ran it against a local model |
| Smoke test result | Ran an edit through a local model: vaguer prompt failed, exact-path prompt worked | Ran a sandboxed command through a local model: worked; plain-language edit requests were unreliable |
| Evidence on this site | Tested (smoke test) | Tested (smoke test) |
| Last verified | 2026-10-25 | 2026-10-25 |

## What we ran, and what we did not

On 2026-10-25 we installed and ran both tools on a Linux x86_64 box with 8 CPUs, no GPU, no vendor account, login or API key. Both were pointed at the same small local model, Qwen2.5-3B-Instruct (4-bit) served by Ollama 0.40.11, and given the same style of task: change `a-b` to `a+b` in `calc.py`.

- **Claude Code:** installed with Anthropic's native installer; `claude --version` printed 2.1.310. Pointed at the local model, a headless run used the Edit tool and changed the file once we gave the exact path and strings; the first, vaguer prompt made no edit. [Full log](https://theagenticweekly.com/tests/claude-code).
- **Codex CLI:** installed `@openai/codex` from npm; version 0.164.0. `codex exec --oss --local-provider ollama` ran a `sed` command we asked for inside its sandbox and changed the file. An earlier plain-language edit request ran no edit (the small model tried a sub-agent call that failed to parse); we kept two runs, so this is not a pass rate. [Full log](https://theagenticweekly.com/tests/codex-cli).
- **Not tested for either:** the vendors' own models, subscription or ChatGPT sign-in, the features named in the latest releases, MCP, IDE extensions and desktop or web surfaces.

The two runs are not a head-to-head benchmark. The attempts, prompts and agent settings differed, and a 3B local model says little about how either tool performs with its vendor's models. See the full notes on the [Claude Code](https://theagenticweekly.com/tools/claude-code) and [Codex CLI](https://theagenticweekly.com/tools/codex-cli) pages.

## Features the vendors document (Reported)

Table: What each tool says it can do

| Capability | Claude Code | Codex CLI |
|---|---|---|
| Edit files and run commands | Yes; plans, writes code across multiple files and verifies it works | Yes; runs commands in a sandbox (we saw this) |
| Git and pull requests | Stages changes, writes commit messages, creates branches and opens pull requests | Not covered on the pages we read |
| Parallel and background work | Multiple agents with a lead agent; background agents; scheduled tasks | Not covered on the pages we read |
| Customisation | CLAUDE.md, skills, hooks, MCP; can read AGENTS.md instead | Numbered /presets slots for reusable prompts; inline /model and /permissions arguments (0.164.0 notes) |
| Enterprise and cloud | Bedrock, Vertex and Foundry support; Enterprise custom roles for cloud sessions and Remote Control (v2.1.310 notes) | Enterprise MCP sign-in; Amazon Bedrock setup wizard on by default (0.164.0 notes) |
| Security work in the latest releases | Sandbox and permission fixes in v2.1.309 and v2.1.310 | Credential masking in remote Bash and Zsh snapshot sessions |

These come from [Claude Code's overview](https://code.claude.com/docs/en/overview) and the release notes we read, not from our test. None of these features were exercised in our smoke tests.

## Pricing

Claude Code is included with Claude Pro ($20 a month, or $17 a month billed annually) and the paid plans above it, and is not included on the Free plan, per [claude.com/pricing](https://claude.com/pricing) read on 2026-10-25. Usage shares one pool with the rest of your Claude plan. Codex CLI's code is open source; using it with a ChatGPT plan depends on that plan, and we did not verify OpenAI's current limits, so check OpenAI's pricing page before relying on it.

## Pick Claude Code if / pick Codex CLI if

- **Pick Claude Code if** you want the same agent across terminal, IDE, desktop and web, plus scheduled runs, CI integrations and the Agent SDK, and you already use or plan to buy a Claude plan.
- **Pick Codex CLI if** you want an open-source terminal agent under Apache-2.0 that you can read and run from a script, npm or Homebrew install, and you are comfortable using OpenAI sign-in or your own provider.
- **Expect to be specific either way.** In our runs, both tools needed a precise instruction before a small local model made the edit. A larger hosted model may behave differently, and we did not test that.
- **Not sure?** Try both on a small throwaway repo with the same prompt. Also see [what is an AI coding agent](https://theagenticweekly.com/what-is/ai-coding-agent) and [Claude Code vs Cursor](https://theagenticweekly.com/compare/claude-code-vs-cursor).

## What others found

- [Codex vs Claude - an Honest Comparison](https://www.youtube.com/watch?v=sbuwHi1Sz6k) · Tech With Tim · 2026-08-27

Third-party video, not one of our tests. Nothing here is marked Tested because of it.

## FAQ

### Is Claude Code or Codex CLI better?

We cannot rank them on quality. We smoke-tested both on 2026-10-25 using a small local model, not either vendor's own models. Claude Code spans terminal, IDEs, desktop and web; Codex CLI is an open-source terminal agent.

### Is Codex CLI free and open source?

The code is open source under Apache-2.0, per the GitHub repository metadata. Using it with your ChatGPT plan depends on that plan, so check OpenAI's pricing for current limits.

### Is Claude Code free?

Claude Code is not included on the Free Claude plan. It is included with Claude Pro at $20 a month ($17 a month billed annually) and the paid plans above it, per claude.com/pricing read on 2026-10-25.

### How do I install Claude Code and Codex CLI?

Claude Code: run the native installer from code.claude.com/docs (curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux and WSL), or use Homebrew or WinGet. Codex CLI: use the install script, npm install -g @openai/codex, or Homebrew. See each tool page for the exact commands.

### Did you test Claude Code and Codex CLI?

Yes, a smoke test of each on 2026-10-25. Both were run with a small local model (Qwen2.5-3B-Instruct) with no vendor account. We did not test the vendors' hosted models, sign-in, or the newest features in each release.

### Can Claude Code or Codex CLI use local models?

In our test both could be pointed at a local Ollama model: Claude Code through its Anthropic-compatible API, and Codex CLI with the --oss option. A 3B model made plain-language edits unreliable, so expect a larger model to be needed for real work.

## Sources

- [Claude Code overview (Anthropic docs)](https://code.claude.com/docs/en/overview) (fetched 2026-10-25)
- [Claude pricing](https://claude.com/pricing) (fetched 2026-10-25)
- [Claude Code v2.1.310 release](https://github.com/anthropics/claude-code/releases/tag/v2.1.310) (fetched 2026-10-25)
- [Codex CLI rust-v0.164.0 release](https://github.com/openai/codex/releases/tag/rust-v0.164.0) (fetched 2026-10-25)
- [openai/codex repository (GitHub)](https://github.com/openai/codex) (fetched 2026-10-25)

## Related

- [Claude Code: test notes and changelog](https://theagenticweekly.com/tools/claude-code)
- [Codex CLI: test notes and changelog](https://theagenticweekly.com/tools/codex-cli)
- [Claude Code vs Cursor](https://theagenticweekly.com/compare/claude-code-vs-cursor)
- [goose vs opencode](https://theagenticweekly.com/compare/goose-vs-opencode)
- [What is an AI coding agent?](https://theagenticweekly.com/what-is/ai-coding-agent)
- [Best AI coding agents](https://theagenticweekly.com/best/ai-coding-agents)

## Changelog

- 2026-10-25: First published. Facts read from the official pages listed under Sources on this date.

## How to cite

Agentic Weekly, "Claude Code vs Codex CLI: terminal coding agents compared (October 2026)", last updated 2026-10-26, https://theagenticweekly.com/compare/claude-code-vs-codex-cli
