Skip to main content

Claude Code: what is the new "Code Mode", and should you enable it?


Since Thursday 12 November and version 2.1.323, Claude Code has been hiding an experimental new feature that changes the way it works: Code Mode. Instead of asking for its tools one by one, Claude writes a small JavaScript program that does all the work at once. And on Monday 16 November, version 2.1.326 had already improved it. It is disabled by default. But on big repetitive tasks, it can save you time and spare your quota, provided you know its pitfalls.

In a restaurant kitchen, on one side a chef makes exhausting trips back and forth to the pantry for every ingredient, while on the other side a second chef has written a complete list and a kitchen assistant brings him all the ingredients at once on a large tray

One ingredient per trip, or the whole list at once

Before, Claude did its shopping aisle by aisle

When you ask Claude Code for something, it uses tools: read a file, search for a word in the project, modify a line, run a command. Until now, it called them one by one. It asks to read a file, waits for the result, reads it, thinks, asks for the next command, waits again. And every result, even a huge one, goes entirely back through its working memory.

With Code Mode, Claude writes a bit of code that chains several calls together, launches some of them at the same time, reuses the result of one in another, and sends back only what it really needs at the end. Here is the example from the official documentation, when you ask it to increase the number of attempts in a program:

const files = await $`rg -l "function retryPolicy" src`.text();
const target = files.trim().split("\n")[0];
await edit(target, "maxAttempts: 3", "maxAttempts: 5");
({ edited: target, tests: $`npm test -- retryPolicy`.nothrow() });

In plain English: it looks for the file that contains the function, takes the first one, replaces the 3 with a 5, runs the tests, and sends back only the file name and the test result. Four steps, one round trip. In the conversation, you continue to see the modifications as usual, not the code. To read the JavaScript it wrote, you have to press Ctrl+O.

Why it's clever

Because everything Claude reads costs you. Money if you go through the API, quota if you have a subscription. AI is billed by the token, a small piece of a word of about four letters, and a search result of three thousand lines that goes entirely back into the conversation, that weighs a lot. If Claude filters that result itself in its little program and reads only the ten useful lines, it saves everything else.

Anthropic had already shown the idea a year ago, in November 2025, with an example involving tools connected to Claude: we went from 150,000 tokens to 2,000 for the same task, which is 98.7% savings. Careful, that figure concerned a different case from Claude Code's Code Mode, and Anthropic has not published a measurement for this one. But the principle is the same: less chatter between Claude and its tools.

At a desk, one employee receives a single small sorted sheet from a colleague, while next to him another employee is buried under a huge pile of unsorted files overflowing everywhere

The ten useful lines rather than the whole pile

Concretely, take a case every developer knows: renaming a function used in forty files. Without Code Mode, that's forty round trips, and just as many results filling up the conversation. With it, in principle it's a single program that does all forty and reports only the summary. For you, that means a task that moves forward faster, and a usage limit on your subscription that melts more slowly. Anthropic gives no figure, so I'm not going to make one up for you.

The documentation recommends trying it on tasks that require lots of related calls: the same modification in lots of files, a search whose results need to be sorted, or several independent commands to launch at the same time.

How to activate it

First, check your version. You need at least 2.1.323, and the native version of Claude Code, not the one installed some other way:

claude --version
claude update

Then, on Mac or Linux, you launch Claude Code with the variable that turns it on:

CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude

On Windows, in PowerShell, you also need Git for Windows installed:

$env:CLAUDE_CODE_EXPERIMENTAL_CODE_MODE = "1"
claude

To have it in every session, you can put the variable in your personal settings, the settings.json file in your Claude user folder:

{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_CODE_MODE": "1"
  }
}

One detail I think is well thought out: this variable is ignored in a project's settings. A code repository you download therefore can't turn on Code Mode behind your back. On the first launch, Claude Code asks you to confirm, then displays a line at the top of the session saying that experimental Code Mode is active.

To turn it off, you remove the variable or set it to 0. And a 0 in one place takes precedence over a 1 somewhere else.

The traps, because there are some

First trap: it only works in a terminal, when you're talking to Claude directly. Not in the VS Code panel, not in the desktop application, not with -p, not via the SDK. As for models, you need Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2. And you need a Claude subscription or a Console account: if you go through Amazon Bedrock, Google's or Microsoft's cloud platforms, or an intermediary, it's a no. And a session started in Code Mode can only be resumed with Code Mode turned on.

The big issue is security. Every tool called by the code still goes through your denial rules and your hooks, those little scripts you can plug in to check what Claude is about to do. But the command your hook receives can look different. Example from the documentation: a git push launched in an app folder can arrive in the form cd 'app' && git push. A hook that only checks whether the command starts with git push won't recognize it. And if you want to inspect the program itself, you need to target the REPL tool, the one that runs the JavaScript.

At the entrance of a building, a security guard carefully checks the badges of the people passing by one at a time, without noticing that a large closed cardboard box is quietly passing beside him on a trolley, with several pairs of feet sticking out underneath

A security guard who checks badges one by one must also learn to open cardboard boxes

In auto mode, the one where Claude acts without asking you, a classifier rereads every bit of code before running it, but not every call. So it does not see a value calculated along the way, such as a file path pulled from a search. For the actions that really matter, keep rules or hooks. Finally, a program can only run for ten minutes if you wait for it, or up to two hours in the background in auto mode. And certain plugins or mods that monitor tool calls prevent it from starting.

So, do I turn it on or not?

Me, with my collection of hooks that monitor what Claude does, this is the first thing I will check before turning it on: do they still see everything they are supposed to see go past. But I really like the idea. On a major change that affects thirty files, Claude doing all thirty in one go instead of thirty back-and-forths, that is less time and quota used, and I am signing up for that!

For casual use, on a personal project, give it a try, that is what it is made for. On a sensitive project, wait and see how it matures: it is marked experimental in black and white, and Anthropic warns that it may change or disappear in any version. Claude writing code to better write code...

Sources

Article written with the help of Claude Code, proofread and corrected by me.

Join the conversation

You need an account to comment on this article. Creating one is free and takes under a minute.

  • The XMLTV file, free to download every day
  • Comment on articles and reply to other readers
  • Get an e-mail when an article you follow is updated

No comments yet.

Une erreur s'est produite. Cette application peut ne plus répondre jusqu'à ce qu'elle soit rechargée.Veuillez contacter l'auteur. Reload 🗙