Back to Article List

Codex vs Claude Code: OpenAI and Anthropic terminal agents

Codex vs Claude Code: OpenAI and Anthropic terminal agents

Codex and Claude Code play the same position: an agent living in your terminal that takes a task, edits the repo and runs commands until the tests pass. That makes this a much closer fight than the editor question I worked through in Claude Code vs Cursor, where the form factors differ. Here the form factor is identical and the differences are philosophical: how each tool thinks about safety, how each one extends and where each sends work you don't want on your laptop.

I've run both daily for months, Codex on my personal projects and Claude Code for most client work, on Ubuntu 24.04 and macOS. Both are moving targets. Codex ships releases at a pace that borders on aggressive (multiple times a week through 2026) and Claude Code's 2.1 line isn't far behind, so I'll stay off exact version numbers and stick to the parts that have held stable.

What each tool is

Codex is OpenAI's coding agent, and the CLI at the heart of it is open source on GitHub, a Rust implementation you can read end to end. It signs into a ChatGPT account and runs OpenAI's codex-tuned model family. Claude Code is Anthropic's agent, distributed as a closed binary (the GitHub repo hosts issues and the changelog rather than source), signing into a Claude account and running the current Claude model families. The open-source difference matters to some people a lot and to most people not at all, but it's real: with Codex you can audit exactly what the harness does with your files, and the community patches it.

Install and sign-in

Codex installs three documented ways:

npm install -g @openai/codex
# or
brew install --cask codex
# or
curl -fsSL https://chatgpt.com/codex/install.sh | sh

First run asks you to sign in with ChatGPT, which covers Plus, Pro, Business, Edu and Enterprise plans, with an API key as the alternative route. Claude Code mirrors the shape almost exactly. The native installer is one line per the official setup docs:

curl -fsSL https://claude.ai/install.sh | bash

Then /login inside the CLI authenticates against a Claude plan (Pro, Max, Team or Enterprise), or you export ANTHROPIC_API_KEY for pay-as-you-go. Homebrew, WinGet, apt and npm packages exist too. Day-one friction is near zero on either tool; I had both answering prompts within five minutes of a clean VM boot, and the only snag either gave me was PATH setup on a minimal server image.

Sandboxing and permissions

This is the deepest philosophical split, and it's worth understanding before you pick.

Codex builds a wall at the operating-system level. Commands the agent runs execute inside an OS sandbox with network egress controlled by rules (on Windows, egress is proxy-only), so even a badly behaved command hits a fence the model can't talk its way through. On top of that sits an approval system: /permissions configures it, and approvals can be remembered for the session so you're pressing y once per command class rather than constantly.

Claude Code runs unconfined by default and gates behavior with policy instead. Permission modes decide how often it asks, from manual approval through acceptEdits up to the fully unattended bypass, and you cycle them with Shift+Tab mid-session; the read-only research posture is plan mode, which I use for anything structural. Beneath the modes sit allow and deny rules in settings.json, precise down to individual command patterns like Bash(npm run test *), and they travel with the repo so a team shares one policy. Notably, the dangerous full-bypass flag refuses to run as root unless you're inside a container, which says something about where Anthropic expects it to be used.

Which approach wins depends on your threat model. An OS sandbox protects you from the agent surprising you, full stop, and Codex deserves credit for making that the default posture. Permission rules are finer-grained and more expressive, and they behave identically on any box, but they're policy rather than physics. My split: for experiments on code I don't fully trust, the Codex sandbox is genuinely comforting; for long-running work where I've already decided what the agent may touch, Claude Code's rule system describes my intent better.

Extension surface

Claude Code wins this one today, and it isn't especially close. The extension story spans MCP servers for connecting external tools, skills for packaged procedures, subagents for isolated specialist contexts, hooks for deterministic shell-level control over every tool call and a plugin format bundling all of the above. Each layer is documented, stable enough to build on and composable with the others; a team can ship one plugin carrying its MCP servers, its review agents and its guard hooks.

Codex has a plugin system and an extension story that grows by the week, which is the honest way to put it for a project releasing this fast; check the repo README for the current state rather than any blog post, mine included. The gap is age more than intent. Claude Code's mechanisms have simply had longer to accumulate documentation, community servers and patterns, and if your workflow depends on customizing the agent heavily, that maturity is the strongest single argument on Claude Code's side.

Cloud agents: Codex Web and Claude Code on the web

Both vendors now run the same trick in the cloud. Codex Web at chatgpt.com/codex runs agent tasks against your repos from the browser, tied to the same ChatGPT account as the CLI. Anthropic's equivalent is Claude Code on the web: asynchronous sessions on Anthropic-managed VMs working against a GitHub repo, with results coming back as branches and pull requests. The terminal integration is the part I use, since claude --cloud "task" hands a job to the cloud from your shell and claude --teleport pulls a cloud session down to continue locally.

There's a third option both camps quietly support: neither cloud, just your own server. A terminal agent in tmux on a small box survives laptop sleep and flaky hotel Wi-Fi, keeps its own fast pipe to the API and costs you no vendor lock; LumaDock's Claude Code VPS hosting even deploys the one-click template with the CLI preinstalled, which is how my always-on instance lives. Codex installs on the same box in one line. For overnight refactors I trust a tmux session I control over either vendor's queue.

IDE presence

Codex covers editors through extensions for VS Code, Cursor and Windsurf, plus a desktop app for people who want the agent outside the terminal entirely. Claude Code has a VS Code extension and a JetBrains plugin, both wrapping the same engine as the CLI; I've compared those two integrations properly in the guide to Claude Code in VS Code and JetBrains. Cursor users get an interesting wrinkle here: Codex's Cursor extension means OpenAI's agent embeds in the editor built around OpenAI's competitor models, and it works fine.

Models

Codex defaults to OpenAI's current codex-tuned GPT family; Claude Code runs the current Claude families, switchable per session through aliases like sonnet and opus, with the flagship models carrying a 1M-token context window at the moment. I'm deliberately vague on versions because both vendors have shipped multiple model generations since these CLIs launched and any specific claim ages in weeks. The durable observation: both harnesses always get the vendor's newest coding models first, so picking a CLI is largely picking which lab's model trajectory you want to ride.

Which one to pick

For most people this decision was made before the comparison started: your existing subscription is the deciding factor. If you pay for ChatGPT, Codex is included and Claude Code means a second bill; if you're on a Claude plan the reverse holds, and I've broken down how the Claude Code usage limits behave on each tier separately. Running both on API keys is the only setup where the choice is purely on merit, and few people do that for daily driving.

Where merit does decide it: pick Codex if the OS-level sandbox matters to your risk posture or if you want an agent you can read the source of. Pick Claude Code if you customize your tooling heavily, because MCP, skills, subagents and hooks together form the deeper platform right now, and its docs are in better shape. And honestly, run both for a week before committing. They coexist in the same repo without conflict, each keeps its own configuration, and the comparison you run on your own codebase beats anything I can tell you from mine.

Your idea deserves better hosting

24/7 support 30-day money-back guarantee Cancel anytime
Ciclo de Pagamento

VPS.S1

$5.99 Save  17 %
$4.99 Mensalmente
  • 2 vCPU AMD EPYC
  • 2 GB RAMMEMÓRIA
  • 30 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos. incluídos

VPS.S3

$14.99 Save  33 %
$9.99 Mensalmente
  • 4 vCPU AMD EPYC
  • 6 GB RAMMEMÓRIA
  • 70 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos. incluídos

EPYC VPS.P1

$8.99 Save  22 %
$6.99 Mensalmente
  • 2 vCPU AMD EPYC
  • 4 GB RAMMEMÓRIA
  • 40 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que pode configurar para diário, semanal ou mensal.

EPYC VPS.P2

$16.99 Save  24 %
$12.99 Mensalmente
  • 2 vCPU AMD EPYC
  • 8 GB RAMMEMÓRIA
  • 80 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que pode configurar para diário, semanal ou mensal.

EPYC VPS.P4

$29.99 Save  23 %
$22.99 Mensalmente
  • 4 vCPU AMD EPYC
  • 16 GB RAMMEMÓRIA
  • 160 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que pode configurar para diário, semanal ou mensal.

EPYC VPS.P5

$39.99 Save  25 %
$29.99 Mensalmente
  • 8 vCPU AMD EPYC
  • 16 GB RAMMEMÓRIA
  • 180 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que pode configurar para diário, semanal ou mensal.

EPYC VPS.P6

$59.99 Save  25 %
$44.99 Mensalmente
  • 8 vCPU AMD EPYC
  • 32 GB RAMMEMÓRIA
  • 200 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que pode configurar para diário, semanal ou mensal.

EPYC VPS.P7

$69.99 Save  29 %
$49.99 Mensalmente
  • 16 vCPU AMD EPYC
  • 32 GB RAMMEMÓRIA
  • 240 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que pode configurar para diário, semanal ou mensal.

Genoa VPS.G2

$24.99 Save  20 %
$19.99 Mensalmente
  • 2 vCPUAMD EPYC Genoa 4ª geração 9xx4 com 3,25 GHz ou similar, na arquitetura Zen 4. AMD EPYC G4
  • 4 GB DDR5MEMÓRIA
  • 50 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que pode configurar para diário, semanal ou mensal.

Genoa VPS.G4

$44.99 Save  22 %
$34.99 Mensalmente
  • 4 vCPUProcessador AMD EPYC com núcleos vCPU dedicados, em hardware de servidor empresarial. AMD EPYC G4
  • 8 GB DDR5MEMÓRIA
  • 100 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que pode configurar para diário, semanal ou mensal.

Genoa VPS.G6

$89.99 Save  22 %
$69.99 Mensalmente
  • 8 vCPUProcessador AMD EPYC com núcleos vCPU dedicados, em hardware de servidor empresarial. AMD EPYC G4
  • 16 GB DDR5MEMÓRIA
  • 200 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que pode configurar para diário, semanal ou mensal.

Genoa VPS.G7

$159.99 Save  22 %
$124.99 Mensalmente
  • 8 vCPUProcessador AMD EPYC com núcleos vCPU dedicados, em hardware de servidor empresarial. AMD EPYC G4
  • 32 GB DDR5MEMÓRIA
  • 250 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos. incluídos
  • Backup automático grátisInclui um espaço de backup que pode configurar para diário, semanal ou mensal.

AMD Ryzen VPS.R1

$16.99 Save  18 %
$13.99 Mensalmente
  • 1 CPU dedicado AMD Ryzen 9 7950X com 4,5 GHz ou similar, na arquitetura Zen 4. vCPU
  • 4 GB DDR5MEMÓRIA
  • 50 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6 incluídos O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos.
  • Backup automático incluído

AMD Ryzen VPS.R2

$29.99 Save  17 %
$24.99 Mensalmente
  • 2 CPU dedicados AMD Ryzen 9 7950X com 4,5 GHz ou similar, na arquitetura Zen 4. vCPU
  • 8 GB DDR5MEMÓRIA
  • 100 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6 incluídos O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos.
  • Backup automático incluído

AMD Ryzen VPS.R4

$109.99 Save  18 %
$89.99 Mensalmente
  • 8 CPU dedicados AMD Ryzen 9 7950X com 4,5 GHz ou similar, na arquitetura Zen 4. vCPU
  • 32 GB DDR5MEMÓRIA
  • 400 GB NVMeDISCO
  • Largura de banda ilimitada
  • IPv4 & IPv6 incluídos O suporte a IPv6 está indisponível de momento em França, Finlândia ou nos Países Baixos.
  • Backup automático incluído

My answers to other questions

Can I use Codex and Claude Code on the same repository?

Yes, and it's a good way to evaluate them. Each keeps its own configuration and instruction files, so they don't interfere with each other. The one habit worth adopting is running them on separate branches or at separate times; two agents editing one working tree simultaneously will step on each other's changes like any two developers sharing a checkout would.