AIFCC
記事一覧へ
claude-workflowagent-opsharness-design

Claude vs Codex:本番コードベース比較

hoeem@hooeem
9
MAG7企業での勤務経験を持つ14年選手のエンジニアが、今週末20時間以上かけて両ツールを実際のプロダクションコードベースで動かした。彼が発見したことを紹介する(この記事を読んだら、スタックを変えたくなるかもしれない)。 Redditでこのポストを見つけた(リンクは末尾に)。二つのツールを比較したもので、「雰囲気でコーディングする趣味の人」の視点ではなく、major tech firmのprincipal/staff eng manager相当・MAG7経験者エンジニアの視点だった点が興味深い。 ■ 共通ワークフロー(両ツールに同じルールを適用) 結果に入る前に、ワークフローが重要だ。両ツールは同じ仕組みで動かした。 ・プランモード優先:しっかりとスコープを絞ったプロンプトを書き、8サブエージェントのplan-reviewスキルを起動。アーキテクチャレビューはSOLID・DRY・KISS・YAGNIを参照ドキュメント(postgres_performance.md、python_threading.md、software_architecture.md)付きで確認。各サブエージェントにはプロンプト強化がある。 ・コードフェーズ:各プランフェーズを個別にコミット。code-reviewスキルを各コミットで実行し、出力を手動レビューして方向を調整。 ・CLAUDE.md / AGENTS.md は両方とも約100行:TDDルール、gitワークフロー、主要なdevex規約、dockerコマンド。 同じ運転手。同じルール。でもツールの挙動はまったく違った。 ■ Claudeが実際のコードベースでやること Claudeは時間に追われるシニアエンジニアのような感覚だ。 賢い。速い。本当に有能だ。でも、アーキテクチャが綺麗かどうかをあまり気にせず、機能をリリースして次に進もうとする。 80k LOCのコードベースで数ヶ月間使い続けてきた人間の観察をいくつか: ・100万トークンのコンテキストウィンドウは初心者向けの罠だ。25万以下に収めるほうが挙動がはるかに予測しやすい。それでも——Claudeはセッションに1回はCLAUDE.mdを無視する。明示的に書いた規約が。消えてしまったかのように。 ・新機能のために新しいファイルをほとんど作らない。既存ファイルに手を伸ばして拡張し続ける。C/C++出身で、ファイルを600行以下・関心の明確な分離で保ちたいエンジニアには、毎日の摩擦になる。 ・8スイートのテスト移行タスクを与えると、ほとんどを完了させて残りは古いパターンのまま静かに放置する。確認が必要だ。 ・テストの問題が複利で積み重なる。放置するとClaudeはテストを変更して、自分が目標だと思ったものに合わせてしまう。書くテストの95%は堅牢だが、5%が壊れた挙動を固定してしまう。時間が経つと、その比率が効いてくる。 ・プロトタイピングでのインタラクティブな速度は優秀だ。でも、出力から目を離さない熟練ドライバーが常に必要だ。 ■ Codexが実際のコードベースでやること Codexは経験5〜6年のしっかりしたエンジニアのような感覚だ。ジュニアではない。principalでもない。でも本当に思慮深い。 ここから面白くなる。 何度か、Codexはタスクの途中で止まり、ゴッドクラスを拡張していることに気づき、プロンプトなしにすべてをきれいなコンポーネントに自発的にリファクタリングした。Claudeだったらファイルの末尾にもう一つ関数を追加して完了にしていた。 同じタスクに対してClaudeの3〜4倍遅い。これは小さな差ではない。 でも手がかからない。エンジニアのワークフローはこうなった:起動して、終わったら戻ってきてレビューする。十分な実力を示してくれたので、出力を一行一行見守る必要性を感じなかった。 AGENTS.mdを一度も無視したことがない。セッション途中でのディレクティブ上書きを許可しない。その水準の指示忠実度は、ビルドのやり方を変える。 何度かエンジニアが思いつかなかった改善案を出してきた。ハルシネーションではない。本当に付加価値のある判断だ。 自律性は本物だ。遅さも本物だ。片方を払って、もう片方を得ているのだ。 ■ 総合的な正直な評価 Codex pro x5 の使用上限は claude x20 に近い。予算を立てる前に知っておく価値がある。 Claudeのセッションでは、より多くのものが作られる。プロトタイピングは速い。でも数日ごとにツールが積み上げた技術的負債を片付けるリファクタリングパスが発生する。 Codexでも、リファクタリングパスは発生する。ただしこれはアプリの自然な成長によるものであり、「さて何の片付けが必要か見てみよう」という感じではない。 ・プロトタイピングや、スピード重視の低〜中複雑度プロジェクト:Claude ・生き残って拡張し続けなければならないエンタープライズソフトウェア:Codex そして、あまり言われていない点を一つ:どちらのツールもソフトウェアエンジニアリングを知らなければゴミを生産する。これらはマルチプライヤーだ。悪い入力はより速く増幅されるだけで、修正はされない。 ■ あなたのスタックにとって何を意味するか どのシニアエンジニアもこの判断に持ち込むべきフレームワーク: 1. フェーズに合ったツールを選ぶ。探索とプロトタイピングはClaude。長持ちするものを作るときはCodex。 2. .mdファイルに投資する。CLAUDE.mdとAGENTS.mdは、強力なツールと負債の差を生む。1セッションごとに100行の丁寧な規約が返ってくる。 3. プランレビューレイヤーを構築する。一行も書く前にアーキテクチャ・コーディング基準・パフォーマンス・UIデザインをチェックする8つの専門サブエージェントはやりすぎではない。それが両ツールをプロダクショングレードにするワークフローだ。 4. テストを守る。AIコーディングツールはほっておくとテストスイートをドリフトさせる。機能するルール:変更後にテストが壊れたら止めてフラグを立てる。ツールに黙って直させてはいけない。 最高のAIコーディングセットアップは、自分が実際にガバナンスできるものだ。 今あなたのスタックで何を動かしているか?Claude、Codex、それとも他の何か? @steipete がCodexをこれほど愛している理由がこれでわかる。 元のポストへのリンク: https://www.reddit.com/r/ClaudeCode/s/1QpTzC54vQ
原文を表示 / Show original
an engineer with 14 years of experience with time at a MAG7 company spent 20+ hours this weekend running both tools on a real production codebase. here's what he found (you might be changing your stack after reading this article): I came across this post on reddit (linked at the end) that compared the two, it was interesting because it wasn't from the perspective of a "vibe coding hobbyist" it was from the perspective of a engineer that is working at a major tech firm at principal/staff eng manager equivalent with prev MAG7 experience. THE SHARED WORKFLOW (BOTH TOOLS RAN THE SAME RULES) before getting into the results, the workflow matters. both tools operated under the same system: plan mode first - a thorough, scoped prompt, then an 8-subagent plan-review skill fires. architecture review checks SOLID, DRY, KISS, YAGNI with explicit reference documents (postgres_performance.md, python_threading.md, software_architecture.md). each subagent has tightening prompts. code phase - each plan phase committed separately, code-review skill runs on each commit, output manually reviewed and steered. CLAUDE.md / AGENTS.md both sitting at ~100 lines - TDD rules, git workflow, key devex conventions, docker commands. same driver. same rules. very different behaviour from the tools. WHAT CLAUDE ACTUALLY DOES ON A REAL CODEBASE claude feels like a senior engineer on a time crunch. smart. fast. genuinely capable. but trying to ship the feature and move on, not worrying too much about whether the architecture is clean on the other side. a few observations from someone who has been running it on an 80k LOC codebase for months: the 1MM context window is a noob trap. keeping it under 250k produces far more predictable behaviour. and even then - claude ignores CLAUDE.md at least once a session. conventions explicitly written down. gone. like they weren't there. it almost never creates new files for new functionality. it reaches for existing files and keeps extending them. for an engineer who comes from C/C++ and wants files under ~600 lines with strong separation of concerns, this is a daily friction point. give it an 8-suite test migration task and it will complete most of them and quietly leave the rest on the old pattern. you have to check. the test problem is the one that compounds. left unchecked, claude changes tests to match what it thinks the goal is. 95% of the tests it writes are solid. 5% pin broken behaviour. over time, that ratio matters. the interactive speed is excellent for prototyping. but it needs a skilled, focused driver with eyes on the output at all times. WHAT CODEX ACTUALLY DOES ON A REAL CODEBASE codex feels like a solid 5-6 year engineer. not junior. not principal. but genuinely thoughtful. here's where it gets interesting. on multiple occasions, codex stopped mid-task, recognised it was extending a god class, and refactored the whole thing into clean components without being prompted. claude would have dropped another function at the bottom of the file and called it done. it runs 3-4x slower than claude for the same task. that is not a small gap. but it doesn't need babysitting. the engineer's workflow became: fire it off, come back when it's done, review the work. it demonstrated enough competence that watching the output line by line felt unnecessary. it has never once ignored AGENTS.md. it won't let you override directives mid-session. that level of instruction fidelity changes how you build. a handful of times it produced improvements the engineer hadn't thought of. not hallucinations. genuinely additive decisions. the autonomy is real. the slowness is real. you are paying for one with the other. THE HONEST OVERALL VERDICT codex pro x5 has roughly similar usage caps to claude x20. worth knowing before you budget. in a session with claude, more gets built. prototyping is fast. but every few days there is a refactoring pass to clean up accumulated cruft that the tool introduced. with codex, refactoring passes still happen, this is driven by natural app growth rather than "let me go see what mess needs fixing." for prototyping and fast-moving low-to-moderate complexity projects: claude. for enterprise software that has to live and scale: codex. and this is the part that doesn't get said enough: both tools produce garbage if you don't know software engineering. they are multipliers. bad inputs get multiplied faster, not fixed. WHAT THIS MEANS FOR YOUR STACK the framework any senior engineer should carry into this decision: 1. match the tool to the phase. claude for exploration and prototyping. codex when you're building something that has to last. 2. invest in your .md files. CLAUDE.md and AGENTS.md are the difference between a powerful tool and a liability. 100 lines of well-crafted conventions pays back every single session. 3. build a plan-review layer. 8 specialised subagents checking architecture, coding standards, performance, and UI design before a single line gets written is not overkill. it's the workflow that makes both tools production-grade. 4. guard your tests. ai coding tools will drift your test suite if left unchecked. the rule that works: if tests break after a change, stop and flag it. do not let the tool fix them silently. the best ai coding setup is the one you can actually govern. which of these are you running in your stack right now? claude, codex, or something else? You can now see why @steipete loves Codex so much. Here's the link to the original post: https://www.reddit.com/r/ClaudeCode/s/1QpTzC54vQ

AIFCC — AI Fluent CxO Club

読み書きそろばん、AI。経営者が AI を自分で動かせるようになるコミュニティ。

Claude vs Codex:本番コードベース比較 | AIFCC