AI news, problem solutions & tool picks
DigestX

Tool Suggestions

Claude Code's Code Mode: what it does, how to turn it on, and why the 37% token saving claim is wrong

· 4 min read

Photo via Pexels

Claude Code has a new experimental way of working. Code Mode, shipped in version 2.1.323 on November 12, changes how Claude calls its tools: instead of asking for Bash, Read or Edit one at a time and reading each result before deciding what to do next, Claude writes a piece of JavaScript that makes the tool calls, and Claude Code runs that code in your session. One piece of code can run commands in parallel, use one result in the next call, and return only the part of the output Claude needs. You still see the tool calls themselves, not the code — press Ctrl+O for the transcript viewer to read it. It is off by default, and it is experimental.

How to turn it on

Set the environment variable and start Claude Code: CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude, then confirm “Yes, turn on Code Mode” at the prompt. To keep it on, put the variable in the env block of ~/.claude/settings.json — Claude Code ignores it in a project's .claude/settings.json, so a cloned repository cannot switch it on for you. Administrators can block it organisation-wide by setting the variable to 0 in managed settings, but they cannot turn it on for users. To turn it off, remove the variable or set it to 0.

Who can use it — and who cannot

Code Mode needs Claude Code v2.1.323 or later, and a Claude subscription or Console account. It works with Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.2 — there is no Fable 5.5, whatever the launch-week chatter said. It runs only in an interactive claude session in a terminal: not with -p, not the Agent SDK, not the VS Code panel, not the Desktop app and not cloud sessions. It does not work through a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform or Microsoft Foundry, and it is unavailable on accounts with a HIPAA configuration or zero data retention. It needs the native build of Claude Code, and on Windows, Git for Windows must be installed. It also cannot start with an API key helper, agent teams, OpenTelemetry export, DISABLE_TELEMETRY, --restricted, or REPL in the disallowed tools.

What it is best for — and the catches

Anthropic says Code Mode fits three jobs: a change repeated across many files, a search whose results need filtering before Claude reads them, and several independent commands that can run at the same time. The catches matter as much as the pitch. In auto mode, the classifier reviews the code, not each tool call, and it does not see values computed at run time, such as a path taken from search output — so keep deny or ask rules, or hooks, for calls you must control. Each tool call the code makes still goes through your deny and ask rules and PreToolUse hooks, and you can inspect the code itself with a PreToolUse hook matching REPL. Long-running code stops after ten minutes unless it runs in the background, where it can run up to two hours. While Code Mode is on, Remote Control, Claude in Chrome and computer use are unavailable, you cannot move the session to the Desktop app or turn it into a background session, and /fork cannot start a background copy. A Code Mode session can only be resumed in the terminal, with Code Mode on. Version 2.1.325, released November 13, fixed three early Code Mode bugs, including scripts ignoring a worktree and writing paths into the project, and Claude starting work by itself when a session ended during a Code Mode script.

The 37% claim is wrong

The number travelling with Code Mode on social media is 37% fewer tokens. It is not from Code Mode. It comes from Anthropic's engineering post “Introducing advanced tool use”, published November 24, 2025, which reported average usage falling from 43,588 to 27,297 tokens on complex research tasks — a 37% reduction. That post measured Programmatic Tool Calling in the Claude API, a different product a year earlier, where Claude writes Python in a sandboxed code-execution environment, not JavaScript in Claude Code. Anthropic's Code Mode documentation contains no savings figure at all: no token counts, no percentages, no before-and-after. The companion claim of “1.6x longer sessions” has no findable Anthropic source either. One independent single-task test found input tokens falling from 150,364 to 94,659 with Code Mode on — but the run took 37 seconds against 15, and it was one task, run once, by its author's own admission not a benchmark. Until Anthropic publishes a number, or someone runs a real benchmark, there is no verified token saving to quote.

Should you turn it on?

If you live in the terminal and your work is bulk edits, filtered searches or parallel commands, Code Mode is worth trying — with your deny and ask rules in place, and with the understanding that it is experimental and was already patched once the day after release. If you work in the VS Code panel, the Desktop app or cloud sessions, it is not available to you at all. And whatever a viral post tells you, do not switch it on expecting a 37% token saving: nobody has measured one.