Independent · Source-cited · No sponsored rankingsSources linked in every article
AIToolRanked
AI News · 5 min read

Code Mode is opt-in. The 37% is a 2025 API test

Claude Code 2.1.323, shipped November 12, 2026, adds experimental Code Mode. The docs give no savings figure. The 37% line is a November 2025 API test.

RA
· Founder, AIToolRanked
A closed laptop and a fan of blank index cards under one upright card, lit by a desk lamp at night
On this page

What shipped on November 12

On November 12, 2026, Claude Code 2.1.323 added Code Mode. The changelog ↗ says: "Added Code Mode, an experimental opt-in in which Claude writes JavaScript to call its tools." The GitHub release ↗ went up the same day. The picture above is ours. We have not turned Code Mode on.

The docs ↗ say it is off by default and "may change or be removed in any release." Without it, Claude asks for Bash, Read, or Edit one call at a time. With it, Claude writes JavaScript that can run commands in parallel, pass one result into the next call, and return only the output it needs. Press Ctrl+O for the transcript. Each script is a collapsed Code row.

How you turn it on

Run claude --version. Below 2.1.323, run claude update.

For one shell, on macOS, Linux, or WSL:

CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude

For every new session, put the same variable in ~/.claude/settings.json under env, set to "1". Claude Code ignores that variable in a project's settings, so a repository you clone cannot turn Code Mode on for you. The first session asks you to confirm. The docs say the restart then shows: "Code Mode (experimental) is on · this session can be resumed only with Code Mode on."

To turn it off, remove the variable or set it to 0. A 0 in the shell or in user settings wins over a 1 in the other place. An admin can force 0 in managed settings. That blocks new sessions. It does not pull someone out of a session that is already running, and managed settings cannot force Code Mode on.

Resume only from the terminal, with the variable still set to 1. With it off, claude --continue and claude --resume refuse a Code Mode session.

Where it does not run

CheckWhat the docs require
BuildNative Claude Code 2.1.323 or newer. Windows needs Git for Windows
AccountA Claude subscription or Console account
ModelsOpus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.2
SurfaceAn interactive terminal session

The same page blocks a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform, and Microsoft Foundry. It blocks a HIPAA configuration and zero data retention. It does not run under -p, the Agent SDK, the VS Code panel, the Desktop app, or a cloud session.

Each tool call still passes deny and ask rules and PreToolUse hooks. In auto mode the classifier reviews the script, not each call, and it does not see a path the script computes at runtime. Unless the code is backgrounded, it stops after ten minutes. You cannot move the session to Desktop, and /fork cannot start a background copy.

Where the 37% comes from

The Code Mode docs publish no token-savings figure. Magnus Kofod ↗ (@mKLAPPEREN_) wrote on November 15: "the code mode docs don't have a 37% anywhere. that number is from anthropic's api tool calling writeup from last year, different test."

That writeup is Introducing advanced tool use on the Claude Developer Platform ↗, dated November 24, 2025. Under Programmatic Tool Calling, Anthropic says average usage dropped from 43,588 to 27,297 tokens, a 37% reduction on complex research tasks. In that test Claude writes Python inside the API's code-execution tool. Code Mode is JavaScript inside a Claude Code terminal session. Same idea, different product, and the 37% is not a Code Mode measurement.

What people are saying

  • "I ran it 8 times on Sonnet 5.5, with and without Code Mode: → short tasks (rename across 33 files, a TODO report): about 40% fewer tokens → long task (refactor 30 files): 55% fewer, 486K → 218K" — kairo ↗ (@kairofeed), November 14. That is one person's log. We have not reproduced it.

  • "How Code Mode is implemented in Claude Code - they use node:vm running in process in Bun" — Rhys ↗ (@RhysSullivan), November 15. The same post says Codex does its code mode in V8, OpenCode in a custom interpreter, and Pi in QuickJS. The Code Mode docs do not name the runtime.

  • "I've seen code mode in Codex and didn't find the results to be better. Could be wrong but code mode needs some time to cook." — Santosh Kathira ↗ (@Santosh74038967)

  • "Should help drive down usage since Code Mode will allow filters/transformers to be written for tools that return large amounts of data." — Derek Lewis ↗ (@dlewis)

Reddit was not reachable for this story.

Our take

Turn it on for a terminal session that fans out. The docs name the fit: a change repeated across many files, a search whose results need filtering before Claude reads them, and independent commands that can run together. Derek's point matches that second case. A huge MCP or search result is the reason to let the script filter before the model reads it.

Leave it off when you are not in that terminal. The VS Code panel, the Desktop app, cloud sessions, Bedrock, Foundry, Google Cloud's Agent Platform, a gateway, HIPAA, and zero data retention are outside the requirements list. An older build starts without Code Mode. If the work is destructive, auto mode's review of the script is the wrong place to be your only check, because the classifier does not see paths the script computes.

Do not put 37% in a budget. That number is the November 24, 2025 API test. kairo's 40% and 55% are his eight runs on Sonnet 5.5. We did not measure either figure.

This is a switch on the seat you already pay for. The review is Claude Code. The env var belongs in user settings, the same family as the settings and secrets note, and a cloned repo cannot opt you in. It is separate from the Projects coordinator. An editor-first comparison is Copilot vs Cursor. Santosh's Codex line is one user's. The head-to-head we published is Codex vs Claude Code.

More from the news desk · About Rai Ansar