← All posts

Claude Code Code Mode: what it is and how to turn it on

2026-11-21 · 4 min read

Code Mode is an experimental Claude Code setting that lets Claude write a short piece of JavaScript to run several tool calls in one step, where it would normally call them one at a time. You turn it on by starting Claude Code with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 and confirming a one-time prompt.

The post that put it on the timeline

On X, @addyosmani wrote that Code Mode "can improve both speed and context efficiency when Claude needs to orchestrate multiple steps." His post describes the mechanism the same way Anthropic's docs do: Claude performs multi-step tool calls by writing and running JavaScript. He also asked people to try it and report back.

Anthropic's own Code Mode docs say it is "experimental and off by default" and that it "may change or be removed in any release." It needs Claude Code v2.1.323 or later. Dataconomy reported on November 19 that the version shipped the week before.

What it changes

Normally Claude calls Bash, Read or Edit, waits, reads the whole result, then decides on the next call. Every result lands in the conversation, including the 400 lines of search output it only needed two lines from.

With Code Mode on, Claude writes one script that makes those calls itself. The docs walk through raising a retry limit: the script runs rg to find the file, edits maxAttempts: 3 to 5, runs npm test, and hands back only the file path and the test output. The intermediate results stay inside the script and never reach the conversation.

The docs list three kinds of work where this helps:

  • A change repeated across many files
  • A search whose results need filtering before Claude reads them
  • Several independent commands that can run at the same time

Don't expect an official number for the savings. The docs say Anthropic doesn't publish benchmark or token figures for Code Mode. Dataconomy cites an independent test in which the context taken up by system tools dropped from 24,600 tokens to 11,100 with it on. That's a single test, and your own results may differ.

How to turn it on

Where How
macOS, Linux, WSL CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude
PowerShell $env:CLAUDE_CODE_EXPERIMENTAL_CODE_MODE = "1" then claude
Every session Add the variable to the env block in ~/.claude/settings.json
Turn it off Remove the variable or set it to 0

The first Code Mode session asks you to confirm, then restarts. A project's settings file can't switch it on, so cloning someone's repo won't enable it behind your back. A 0 anywhere wins, and an admin can set that in managed settings to block it for a whole organization.

A good first test is the prompt from the docs: "Read every Markdown file in this project and list the links that point to local files that don't exist." To see the JavaScript Claude wrote, press Ctrl+O and expand the collapsed Code row in the transcript.

If you already tune Claude Code through environment variables, this sits next to the one we covered in Claude Code subagent effort.

How permissions work

Each tool call inside the script still goes through your deny and ask rules and your PreToolUse hooks, under its normal tool name, so a rule that blocks a command still blocks it when a script makes the call.

Auto mode works differently. There, the docs say, the classifier reviews each piece of code before it runs instead of each tool call, and it can't see values worked out at run time, such as a file path pulled from search output. If you want to approve every script yourself, add REPL (the tool the code runs through) to your ask rules.

Sandbox settings need attention too. According to the docs they apply to shell commands only, so the JavaScript and its file, web and MCP calls run outside the sandbox.

What it can't do yet

The list of limits is long for a feature this small. Per the docs, Code Mode works in the terminal only, so the VS Code panel, the Desktop app and cloud sessions are out. It also isn't available through Amazon Bedrock, Microsoft Foundry or Google Cloud, or under HIPAA and zero data retention configurations. Code that Claude waits on stops after ten minutes, and a session started with Code Mode on can't be resumed with it off.

Our read: try it on a personal machine for bulk edits and noisy searches, and keep it out of anything shared until the permission behavior is something your team has tested. If you build on Claude Code with mods or MCP Tasks, check that your hooks still fire the way you expect before you rely on it.

What this means for businesses using AI

Most AI automations pay the cost Code Mode goes after: the model reads everything a step produces when it only needs the answer. You can fix that with a setting like this one or by redesigning the workflow. Either way, giving the model less to read is usually the cheapest speedup available.

If you want help finding where your own processes waste steps, New Face Design's free process audit is a good place to start.

08 / Start here

Which of this can you use today?

Tell us what you use today and we'll reply within one business day with what it would take. Free, 20 minutes, no pitch deck.

Email

pgorski@newfacedesign.com

Phone

+1 (773) 627-2176

Based in

Chicago area

Working with clients everywhere

Skip the form: grab a 20 minute slot.

Open the calendar →