Benchmark Results: When to Use Claude Opus with Codex vs. Pure Opus for Code Generation

Cost Analysis of Opus+Codex Workflow
A Reddit user conducted a controlled benchmark comparing pure Claude Opus usage against a combined workflow where Opus plans and OpenAI Codex executes the code. The setup used Claude Opus 4.6 with the OpenAI Codex CLI via the opus-codex skill, testing three real tasks in isolated git worktrees.
Benchmark Results
The tests measured cost in dollars for each approach across tasks of increasing scale:
- 80 LOC task (CLI flag + 3 tests): Pure Opus $0.33, Opus+Codex $0.53
- 400 LOC task (HTML report + 10 tests): Pure Opus $0.68, Opus+Codex $0.74
- 1060 LOC task (REST API + 46 tests): Pure Opus $0.86, Opus+Codex $0.78
The cost crossover point occurs at approximately 600 lines of code. Below this threshold, the planning and handoff overhead of the combined approach costs more than having Opus write the code directly. Above 600 LOC, Opus+Codex becomes more economical because it reduces output tokens by about 50%.
Hidden Cost Driver: Cache Reads
The analysis identified cache reads as a significant cost factor often overlooked. While many developers focus on optimizing output tokens, each API turn resends the full conversation as cached context. Extra turns from planning and review phases accumulate costs. The benchmark found that 600 lines of Codex stdout landing in the conversation was the single biggest cost inflator—piping this output to a file saved approximately $0.15 per run.
Practical Recommendations
- < 500 LOC: Use pure Opus. The simpler approach is more cost-effective for small tasks.
- 500-800 LOC: Either approach works with roughly equal cost.
- > 800 LOC: Opus+Codex saves money, with the efficiency gap increasing with scale. Codex's free trial makes this approach particularly attractive for large tasks.
For developers experiencing high Opus token consumption, checking cache reads in the cost breakdown is recommended. If cache reads are 5-10 times higher than output tokens, the context is likely bloated and should be optimized.
📖 Read the full source: r/ClaudeAI
👀 See Also

TEMM1E v3.1.0: AI Agent That Self-Fine-Tunes Using User Interactions
TEMM1E v3.1.0 introduces Eigen-Tune, a system that captures LLM interactions as training data, scores quality from user behavior, and fine-tunes local models via LoRA with zero added LLM cost. Tested on Apple M2, it corrected temperature conversions from 72°F = '150°C' to '21.2°C' after 10 conversations.

Madar: Local Context Compiler for Claude Code / Cursor — 78% Fewer Tokens on NestJS Repo
Madar is an open-source local context compiler for coding agents. On a NestJS + BullMQ repo (~800 files), it cut Claude Code input tokens by 78% and cost by 63% for an explanation task. Scoped graphs only.

Text Adventure Game Engine Skill for Claude Desktop
A text adventure game engine runs entirely inside Claude Desktop as a skill with no servers, apps, or code to run. It includes full RPG mechanics, 3D dice rendering, 19 expansion modules, and portable save files.

CONTACT: 3D Naval Combat Game Built Entirely with Claude Code
CONTACT is a 3D naval combat game built entirely with Claude Code + Opus, featuring a 7×7×7 volumetric cube, credit economy with tactical perks, and three game modes including Human vs Claude and Sonnet vs Sonnet with persistent strategic memory.