Knowledges 15 min

Claude Code vs Codex

Claude Code vs Codex: don't ask which one wins, ask how you're actually building. One is an open harness you wire into your own workflow, the other is a shipping machine packaged from prompt to pull request.

Also in: Tiếng Việt · 中文 · 한국어 · 日本語

There's a kind of AI coding tool comparison video that makes it really easy to get dragged into a football match: Team Claude Code in blue, Team Codex in black, and whoever wins, you go all-in on.

The video "100 Hours Testing Claude Code vs ChatGPT Codex" takes a slightly more sober route. The creator tested both for about a month, comparing features, pricing, and a few concrete use cases. Their main takeaway: don't ask which tool is the absolute best. Ask which tool fits the use case sitting right in front of you.

I agree with that framing. But stopping at "it depends on the use case" is a bit of a waste, because Claude Code vs Codex is no longer about which model codes better. It's about two companies packaging the "AI software engineer" under two different product philosophies.

Claude Code

Feels like an open harness you assemble your own workflow on: hooks, skills, subagents, MCP, routines, channels, Agent SDK, enterprise deployment. It gives builders lots of knobs to turn.

Codex

Feels like a shipping machine that OpenAI has packaged more tightly into the app, ChatGPT plans, worktrees, GitHub review, in-app browser, computer use, image generation, credits, and lots of shared surfaces. It cuts the friction of getting a task from prompt to pull request.

If you're building a weekend toy project, that's one thing. If you're running client repos, reviewing PRs, running automations, managing permissions, tracking quota, and building reusable agent workflows, that's a completely different story.

This post isn't a video recap. I use the video as a starting point, then check it against the official OpenAI and Anthropic docs to see which claims hold up, which are personal experience, and how builders should actually make the call.


TL;DR

  1. The video gets the big picture right: Claude Code and Codex now overlap a lot. Both have gone way beyond code autocomplete.
  2. Claude Code is currently strong in harness depth: more lifecycle hooks, more automatic subagents, richer workflow configuration, a more flexible Agent SDK and enterprise providers.
  3. Codex is currently strong in shipping packaging: a desktop app with worktrees, a review pane, commit/push/PR, GitHub @codex review, in-app browser, computer use, image generation, and pricing/credits tied directly to ChatGPT plans.
  4. The $20/$100/$200 sticker prices are only half the story. The other half is quota, credit burn, context, image generation, cloud tasks, and whether the tool makes you plug in a separate API key.
  5. Don't pick by fan club. Pick by workflow. If you're designing an agent system with lots of policies, hooks, context, permissions, and reusable skills, Claude Code is worth the money. If you need an app that pushes tasks in parallel, reviews, tests UI, and ships PRs on a cleaner product surface, Codex is becoming a very annoying competitor.

1/ What's good about this video is that it doesn't pretend to be a benchmark

In the video, the creator is pretty clear on one important point: Claude Code feels more "creative", better at brainstorming, and willing to push back when you head in the wrong direction; Codex follows instructions better, reviews plans/code more sharply, and catches bugs/gaps better. But they also say this isn't a hard metric or KPI, just a gut feeling after many hours of use.

In AI coding agent comparisons, the most common mistake is taking a personal impression and cosplaying it as a universal conclusion. A small frontend repo, a legacy Java codebase, a monorepo with many packages, a migration task, a security review task, a landing page build with browser feedback: they all give different results.

The official docs also support a "workflow first" view over "model first".

Anthropic describes Claude Code as an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with the terminal, IDE, desktop app, browser, MCP, skills, hooks, agent teams, background agents, routines, channels, Agent SDK. In other words, they're selling a working environment for agents.

OpenAI describes the Codex app as a desktop experience for running many threads in parallel with worktrees, automations, Git functionality, local/worktree/cloud modes, in-app browser, computer use, GitHub integration, image generation, web search, MCP, skills, subagents. In other words, they're selling a command center for agentic coding.

Neither side is selling "AI code suggestions" anymore. Autocomplete is now basically a side feature. The real fight is the harness: where the agent runs, what it remembers, what it's allowed to do, when it gets blocked, how it tests, how it gets reviewed, and how its output turns into shippable code.

2/ Claude Code: strong because it feels like a workflow operating system

The creator in the video nails this point: Claude Code is deeply customizable.

The Claude Code hooks docs list a pretty dense lifecycle: SessionStart, UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, SubagentStart, SubagentStop, TaskCreated, TaskCompleted, WorktreeCreate, PreCompact, PostCompact, FileChanged, InstructionsLoaded, SessionEnd, and many more events. A rough count gets you close to 30 places to inject logic.

For a regular user, "hook event" sounds a bit dry. For a builder running agents in a real repo, it's life or death. For example:

  • When the agent is about to run Bash, you can block rm -rf or commands that touch production.
  • When the agent edits a file, you can auto-format, run lint, or log the diff.
  • When context is about to compact, you can save important state.
  • When instructions get loaded, you can audit which rules made it into context.
  • When a subagent starts/stops, you can track fan-out and cost.

This is the mindset of "an agent isn't just a chatbot that can code, an agent is a process with a lifecycle".

Claude Code's subagents follow the same direction. The docs say subagents have their own context, their own system prompt, their own tool access, their own permissions, and can be used to keep exploration from polluting the main context. Claude Code ships with built-in Explore, Plan, general-purpose, and can delegate on its own when a task matches a description.

This is the part I think fits anyone who works in a context engineering style. Dumping everything into one chat window and praying is a rather spiritual way to burn tokens. Splitting exploration, planning, review, and docs research into separate contexts is a more practical way to keep context rot under control.

The Claude Agent SDK then pulls that same engine out into Python and TypeScript. Anthropic's docs say the SDK provides the same tool loop, context management, file read/write/edit, Bash, hooks, subagents, MCP, permissions, sessions. It also supports Bedrock, Vertex AI, Microsoft Foundry, and some other enterprise providers.

This matters for big teams. A regulated company doesn't just ask "which model codes faster". They ask where the data goes, how auth works, where the logs live, who can approve which commands, and whether it runs through a cloud provider they already have a contract with.

Locked section: 3/ Codex: strong because OpenAI is packaging the path from task to shipped code

Locked section: 4/ Pricing: don't just look at the subscription number

Locked section: 5/ Which claims are solid, which deserve a question mark

Locked section: Facts well supported by the docs

Locked section: Vendor claims, read with a clear head

Locked section: Claims from the video, best treated as personal experience

Locked section: 6/ How I'd choose if I were building for real

Locked section: 7/ Hot take: OpenAI is attacking distribution, Anthropic is attacking the control surface

Locked section: Wrapping up

Locked section: Sources

The rest is for Knowledges members

Plus 10 more sections (about 10 min) for members

You are reading roughly the first third. Knowledges, Combo and Community plans unlock paid articles in full; the Zuey AI plan reads previews only.