[KongchangAI]
· 2 min read· 1,094 words

Claude Code vs Codex: Same Model, Same Prompt — Which Is Smarter?

Claude Code vs Codex: Same Model, Same Prompt — Which Is Smarter?

With the same local model, Claude Code understands intent better than Codex but is subject to regional restrictions — choose based on your scenario.

A Bilibili creator ran a controlled-variable experiment, connecting the same local model to both Claude Code and Codex with identical prompts to generate interactive animations. Claude Code proactively added unrequested interactive buttons, showing stronger intent inference and higher overall completeness; Codex generated faster but had visual errors and a different style. The creator found Claude Code smarter with the same model but limited by regional restrictions in China, while Codex offers better compatibility. The takeaway: each excels in different scenarios, and tool-level strategies matter as much as model benchmarks.

When it comes to AI coding assistants, Claude Code and Codex are two names you can't avoid. But most comparisons overlook the model variable — if you run them on the same local model with the same prompt, does the difference come from the tools themselves or from the underlying models? A Bilibili creator ran a controlled-variable experiment to find out, and the results are worth a closer look.

Experiment Setup: Same Local Model, Same Prompt

The creator deployed the same model locally (mentioned in the video as a slightly lower-precision but faster version in the Q3 series) and connected it to both Claude Code and Codex, feeding them an identical prompt to generate an animated scene with interactive buttons. This approach eliminates the interference of cloud-model capability differences and directly tests how the two agents perform on task understanding, code organization, and detail completion.

Scene generated by Cloud Code

Controlled-variable experiment is a method commonly used in scientific research, where only one variable is changed while all other conditions are held constant to determine that variable's effect on the outcome. In AI tool comparisons, controlling variables means using the same model, the same prompt, and the same task environment to isolate differences caused by the tools themselves (rather than model capability). This design allows for a more accurate assessment of tool-level characteristics such as an agent's prompt engineering, context management, and code generation strategies.

Claude Code: Better at Understanding Intent, Filling in Details on Its Own

The first version Claude Code produced surprised the creator: the buttons in the scene weren't requested in the prompt at all — it added them based on its own contextual judgment. In the video, the creator said outright, "I never asked it to add those." This tendency to proactively complete interactive elements shows that it goes beyond literal execution when understanding a task, attempting instead to infer the user's true intent.

Of course, limited by the local model's precision, the visual details weren't refined enough. The creator also acknowledged that this model itself is "not as good as that Q3X," but its advantage is speed, making daily use smoother.

Slightly lower model precision but faster

Agent in the context of AI coding assistants refers to a system capable of autonomously understanding tasks, planning steps, and executing code generation. Unlike simple code-completion tools, agents typically have task decomposition, context maintenance, and tool-calling capabilities. Claude Code and Codex are both typical coding agents — they don't just generate code but also proactively add interactive elements or adjust implementation strategies based on task goals. This explains why Claude Code added buttons not requested in the prompt: it's a manifestation of the agent's intent inference and proactive planning.

Codex: Faster, but the Style Drifts

Switching to Codex with the same model and the same prompt, generation was indeed faster than Claude Code. But the creator noted there were "still some errors at the top" of the scene, and the quality and style were completely different from Claude Code's output.

Animation generated by Codex

This means that even with an identical underlying model, the two agents differ substantially in code generation strategy, structural organization, and how they interpret the prompt. Codex leans toward rapid output, while Claude Code delivered more complete interaction logic in the same amount of time.

Prompt engineering refers to the technique of designing and optimizing input prompts to guide AI models toward desired outputs. In agents, prompt engineering involves not only user-input instructions but also built-in system prompt templates, context management strategies, and information organization across multi-turn conversations. Even with the same underlying model, differences in prompt engineering between agents lead to different interpretation paths for the same prompt, which in turn affects the structure, style, and completeness of the generated code. This is one of the key reasons Claude Code and Codex produce such different results with the same model.

Capability Comparison: The Trade-off Between Smartness and Compatibility

The creator's assessment was direct: with the same model, Claude Code is "smarter and more intelligent" — in his view, the smartest agent. All the toggles, effects, and camera transitions were very smooth, with higher overall completeness.

Side-by-side comparison under the same model

But Claude Code has a practical shortcoming — regional restrictions mean many features can't be used in China. Codex has better compatibility in this regard, which is why the creator acknowledged that "in some ways Codex is stronger than Claude Code."

Regional restrictions in AI services typically refer to limiting access or feature availability for users in specific geographic areas due to legal regulations, data compliance, or business strategy. As an Anthropic product, Claude Code may not be fully accessible in mainland China and other regions, while Codex (an OpenAI product) has relatively looser access restrictions. This compatibility gap directly affects developers' tool choices — especially for users who need stable access, tool availability may matter more than absolute performance.

How to Choose: It Depends on Your Environment and Task

The creator's conclusion is that "each excels in its own domain": both are excellent tools, and the key is knowing which scenario to use each in. If your network environment allows it and you're after higher task comprehension and generation quality, Claude Code is the priority choice; if you're limited by regional availability or need more stable access, Codex's compatibility advantage stands out.

This comparison also serves as a reminder: when evaluating AI coding agents, you can't just look at model benchmarks. Tool-level prompt engineering, context management, and code generation strategies also significantly affect the final output. The same model in different agents' hands can produce vastly different results.

One-line Summary

With the same local model, Claude Code understands intent better than Codex but is subject to regional restrictions — choose based on your scenario.

Paragraph Summary

A Bilibili creator ran a controlled-variable experiment, connecting the same local model to both Claude Code and Codex with identical prompts to generate interactive animations. Results showed that Claude Code proactively added unrequested interactive buttons, leaning more toward intent inference in task understanding with higher overall completeness; Codex generated faster but had visual errors, and its style differed from Claude Code's. The creator concluded that with the same model, Claude Code is smarter, but regional restrictions make some features unavailable in China, while Codex has better compatibility. The takeaway: each has its strengths, and the choice depends on network environment and task requirements — and evaluating AI coding agents shouldn't rely on model benchmarks alone, since tool-level strategies matter just as much.

#Claude Code#Codex#AI coding assistant#local model#prompt engineering#agent comparison
Share:

Related articles