Juejin's 36-run benchmark delivers a sharply contradictory conclusion: Code Mode (having the model write code that calls tools, instead of reading every return value into context) cut input tokens from 169,000 to 90,000 and cost from $0.89 to $0.14 in scenarios where tools return large volumes of data and only a small portion ends up being used — an 84% saving, with execution time dropping from 36 seconds to 25 seconds. But on tasks that call tools only once or twice, input tokens rose from 21,000 to 39,000, making it 65% more expensive — an absolute difference of roughly one cent.
What deserves attention is not the toggle itself but the cost structure behind it: Code Mode never saves on the number of calls — the request count actually rose from 4 to 6. What it saves is data that would otherwise be pulled back into context, such as "270 KB fetched, 34 records actually used." Whether to enable it depends on how large the tool results are and how much you ultimately need, not on how many tools you call.
What this is
Code Mode was proposed by Cloudflare in September 2025. In Anthropic's November engineering blog post "Code execution with MCP," it broke down Token costs into two categories: the context occupied by tool definitions, and the intermediate results returned by each call. The approach converts tools into code APIs, so the model loads definitions on demand, processes the data inside the execution environment first, and only then hands back results.
Today in Claude Code, the first category — tool definitions — is already handled by tool search, which is on by default (retrieving tools by keyword and placing only relevant definitions into context). So Code Mode mainly targets the second category. This is also why the effect is most pronounced in MCP scenarios: MCP returns are often large blocks of JSON. With the feature enabled in Claude Code, the model sees only a single REPL; Bash, Read, and MCP calls are all written in JavaScript.
Industry view
Those in favor argue that this kind of optimization is sinking from client-side configuration down into the model layer. In the model catalog Codex pulls from the server, all 12 models have a tool_mode field set to code_mode_only, including GPT-6.2 Sol and Astra. The source code even reads model metadata first, only checking user configuration when the metadata says nothing — and --disable cannot turn it off. This means it is no longer an optional experiment but default model behavior.
But we think several points deserve reservations. First, documentation and behavior do not match: Codex's configuration reference states that features.code_mode.enabled is "under development and off by default," while actual behavior is determined by server-side metadata, leaving users unable to anticipate it or fall back. Second, the benefit depends heavily on task shape — single-call scenarios cost 65% more, and summarizing the overall effect as "84% saved" distorts the picture. Third, Claude Code's Code Mode only works in interactive sessions; claude -p in CI cannot use it. It also forbids enabling it at the project level, on the grounds that "the repository you cloned cannot enable Code Mode for you" — a security boundary that also means enterprises cannot enforce a unified policy. Fourth, auto mode's classifier reviews the entire block of code rather than each tool call inside the script, and scripts default to a 10-minute timeout — there is currently no clear accounting between money saved and review loosened.
Impact on regular people
For enterprise IT: for teams that have adopted MCP (an interface protocol that lets external services plug into models in a standard way) for data aggregation, daily reports, and reporting tasks, Code Mode is worth enabling by default — in this dataset one scenario saves $0.75 while another costs an extra $0.01, a difference of more than 60x. But first confirm whether your tool returns are "large and mostly unused" or "small and fully used," rather than copying the conclusion wholesale.
For individual professionals: people using Claude Code or Codex for long-chain analysis may see per-task costs drop significantly once the toggle is on; but note that your automation scripts and CI pipelines may not travel the same path — interactive sessions and unattended calls behave differently.
For the consumer market: a downward cost curve expands the pricing headroom for products like "one model connected to dozens of data sources at once." Conversely, once closed-source models bake this mode into the metadata layer and make it non-disableable, the differences users can perceive will increasingly depend on the provider rather than on their own settings.