Claude Code vs. Codex on a real task: Claude wins at RAG, Codex saves tokens
The author compared Claude Code and Codex on benchmarks, on a real RAG pipeline build and in day-to-day use. Claude proved stronger on long tasks and won the test 42 to 33, while Codex produced cleaner architecture and used noticeably fewer tokens. The final choice comes down to your workflow, your usage limits and the ecosystem around the tool.
AI-processed from Habr AI; edited by Hamidun News
This comparison of Claude Code and Codex is more useful than the usual screenshot battles and gut-feeling fandom. The author compared not only the Opus 4.6 and GPT-5.3-Codex models, but also how each agent behaves on a real engineering task, where a working result matters more than a polished answer.
How they were compared
First, the author looks at the completion time horizon metric from METR research. By that measure, Opus 4.6 handles tasks that take a human about 12 hours at 50% success, while GPT-5.3-Codex manages about 5 hours 50 minutes. The gap is noticeable, but it does not mean one tool is always better. What matters more: a coding agent is useful not when it types code fast, but when it gets a task to a working state without extra debugging loops.
So for the practical part the author chose neither a landing page nor a UI, but a measurable RAG pipeline for scientific papers.
- PDF text extraction
- Splitting papers into chunks
- Generating embeddings and a local index
- Retrieving relevant fragments for a question
- Answering only from the retrieved context, or falling back
Conditions were identical for both tools: Python, PDF processing with PyMuPDF, a free choice of chunking strategy and vector store, answer generation with llama-3.1-8b-instant, and a ban on hallucinations when the evidence is weak. For evaluation, the author assembled five scientific papers and a hundred questions with reference answers. This format matters because it removes subjectivity: it lets you compare not a feeling about the code, but extraction quality, answer accuracy and how finished the agent's deliverable is.
Where Claude won
In the author's experience, Claude Code feels like a more engaged partner. It starts working faster, more often carries the task through to the end itself and pushes fewer steps onto the user. That matched the experiment: Claude did not just write files, it ran the pipeline end-to-end and confirmed the script launches. Codex implemented the solution more slowly and, on the first pass, asked the user to install dependencies and check the launch themselves, after which an error had to be fixed. In practical development, the difference between "code is written" and "everything actually works" is critical.
"Claude is a
Senior Developer who does the work alongside you, while Codex is a contractor."
The final numbers reflect that difference. With an LLM acting as judge, the answers from the two pipelines were compared on correctness, completeness, relevance and conciseness. Of 100 questions, the Claude Code implementation won 42, Codex won 33, and 25 ended in a tie. The author attributes Claude's edge not to model magic but to a softer confidence threshold and, possibly, a slightly higher generation temperature. Claude also gets to the first token noticeably faster in a new session, whereas Codex sometimes took almost a minute to start.
Where Codex is better
Codex does not look like an underdog, though. On the contrary, its solution architecture is often tidier. In the RAG case, Codex built more structured code: a pipeline class, a centralized config, dataclass structures, an argparse interface and validation of model consistency. Claude chose a flatter, quicker implementation without that discipline. Technically, both arrived at a similar retrieval scheme, but the details differed: Claude used ChromaDB and recursive character chunking with overlap, while Codex used FAISS, sentence-based splitting and a three-level confidence score. For production code, such a design may matter even more than winning a single test run.
Another strong point for Codex is efficiency. According to the Morph analysis cited in the article, Claude Code uses 3.2 to 4.2 times more tokens on comparable tasks. If those estimates are close to reality, Claude users will hit subscription limits sooner. On the other hand, Anthropic has the stronger package around its product: the author finds the ecosystem of Claude Chat, Claude Code and other services fits together better. Pricing has a nuance too: both have plans at 20 and 200 dollars a month, but only Claude has an intermediate tier at 100. Skills are generally compatible across the tools, but the community around Claude currently looks noticeably larger.
What this means
The main takeaway is simple: choosing between Claude Code and Codex based on one number or someone else's thread on X makes no sense. Claude currently looks stronger where long tasks, end-to-end completion and ecosystem matter, while Codex looks stronger where code structure, token savings and predictable engineering discipline are critical. When requirements are spelled out firmly in AGENTS.md, the behavioral gap between them narrows. It is best to test this on your own short, verifiable tasks.
- Nov 1, 2026Local models lose to Opus and Codex: 0.21 on a MacBook versus 1.00 for Codex
- Nov 1, 2026Kimi scores 96.2% on a 1C database analytics test and emerges as a fallback if Claude access is blocked
- Nov 1, 2026OpenAI Rewrites GPT Behavior Rules: Five Values and a Chain of Command
- Nov 1, 2026Google admits AI Mode cuts search revenue, shares fall 15%
Key Questions Answered
How they were compared?
First, the author looks at the completion time horizon metric from METR research. By that measure, Opus 4.6 handles tasks that take a human about 12 hours at 50% success, while GPT-5.3-Codex manages about 5 hours 50 minutes. The gap is noticeable, but it does not mean one tool is always better. What matters more: a coding agent is useful not when it types code fast, but when it gets a task to a working state without extra debugging loops. So for the practical part the author chose neither a landing page nor a UI, but a measurable RAG pipeline for scientific papers. PDF text
Where Claude won?
In the author's experience, Claude Code feels like a more engaged partner. It starts working faster, more often carries the task through to the end itself and pushes fewer steps onto the user. That matched the experiment: Claude did not just write files, it ran the pipeline end-to-end and confirmed the script launches. Codex implemented the solution more slowly and, on the first pass, asked the user to install dependencies and check the launch themselves, after which an error had to be fixed. In practical development, the difference between "code is written" and "everything
Where Codex is better?
Codex does not look like an underdog, though. On the contrary, its solution architecture is often tidier. In the RAG case, Codex built more structured code: a pipeline class, a centralized config, dataclass structures, an argparse interface and validation of model consistency. Claude chose a flatter, quicker implementation without that discipline. Technically, both arrived at a similar retrieval scheme, but the details differed: Claude used ChromaDB and recursive character chunking with overlap, while Codex used FAISS, sentence-based splitting and a three-level confidence s
Build & Ship Production AI Agents Without Boilerplate Code
Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.