How to Turn On Code Mode in Claude Code

Code Mode, experimental since Claude Code 2.1.323 on Nov 12, 2026, turns on with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude, or the same variable in the env block of ~/.claude/settings.json. Claude then writes JavaScript that makes several tool calls in one step. It needs a Claude subscription or Console account, Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2, and the terminal. Read at Anthropic's docs on Nov 23, 2026.

To turn on Code Mode in Claude Code, start it with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude (in PowerShell, $env:CLAUDE_CODE_EXPERIMENTAL_CODE_MODE = "1" and then claude), and answer "Yes, turn on Code Mode" when it asks (Run tool calls from code with Code Mode, read Nov 23, 2026). It needs Claude Code 2.1.323 or later, which shipped on Nov 12, 2026, a Claude subscription or Console account, and one of Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2 in an interactive terminal session. With it on, Claude writes a short JavaScript program that makes its tool calls (Bash, Read, Edit and the rest) in one step, instead of asking for one call at a time. It is experimental and off by default, and Anthropic says it "may change or be removed in any release".

New since Nov 19, 2026: a second creator's measurements. Chase AI had Claude Code build the same feature twice in a Nov 19, 2026 video, and the run with Code Mode read 660,000 tokens where the run without it read 2.3 million. He counts about 20,000 fewer tokens at the start of a session, because the code tool stands in for the usual tool definitions. Counting every function without a docstring in FastAPI, over 1,200 files, took 21 seconds with Code Mode and 25 without, with a context 37% smaller at the end and 93,000 tokens read against more than 250,000. On a one-step task, reading a README, Code Mode was slower, 15 seconds to 11, though it still read 35% fewer tokens. Adding a JSON output option to Django's migrations, it was 27% faster and read 71% fewer tokens, and every run in all three tests passed. Better Stack, below, found the cost "came out to be the same"; Chase measured tokens read, not the bill, so the two do not contradict each other, and both found the same quality on and off. His downsides match the docs: terminal only, no computer use and no Remote Control.

Next: where the env block lives and which file wins, how auto mode checks the code it writes or another one-line settings.json change.

The three ways to switch it on

Where What to type or save Lasts
macOS, Linux, WSL CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude This session
Windows PowerShell $env:CLAUDE_CODE_EXPERIMENTAL_CODE_MODE = "1", then claude This PowerShell window
~/.claude/settings.json {"env": {"CLAUDE_CODE_EXPERIMENTAL_CODE_MODE": "1"}} Every new session

Source: Code Mode, Claude Code Docs, read Nov 23, 2026. The variable is ignored in a project's .claude/settings.json, so a repository you clone cannot turn Code Mode on for you; it has to be your shell or your user settings file.

When it worked, this line sits near the top of the session:

Code Mode (experimental) is on · this session can be resumed only with Code Mode on

If the line says Code Mode (experimental) isn't available instead, the reason follows on the same line and in /status. To see the code Claude wrote, press Ctrl+O for the transcript and expand a Code row.

Ray Amjad's Nov 16, 2026 video, four days after the release, has a chapter on turning it on, after one on why one tool call per round trip wastes the model's time.

Check these first

  1. Version. claude --version must say 2.1.323 or later; claude update if not. The newest is 2.1.330 of Nov 20, 2026. On the Stable release channel the update can lag; the docs say to wait or switch to Latest.
  2. Account. A Claude subscription or a Console account. Not through a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud, Microsoft Foundry, or with an apiKeyHelper; not under the HIPAA configuration or zero data retention.
  3. Model. Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2. On an older model, start with --model opus.
  4. Surface. An interactive claude session in a terminal, on the native build. Not the VS Code panel, the desktop app, cloud sessions or claude -p. On Windows, Git for Windows must be installed.
  5. Telemetry. With OpenTelemetry events or metrics on, or feature-flag fetching off, you need 2.1.329 or later (Nov 19, 2026); OpenTelemetry tracing blocks it on every version.
  6. Agent teams. Need 2.1.326 or later.

Source: Code Mode requirements, read Nov 23, 2026. We count six separate conditions that each stop it from starting, which is why the first thing to read when it does not start is the reason on that top line.

What changes while it is on

  • Resuming. A Code Mode session resumes only in the terminal with the variable still set to 1; claude --continue without it is refused.
  • Auto mode. The safety classifier reviews each piece of code before it runs, not each tool call inside it, so it never sees a path the code works out at run time. Your deny and ask rules and PreToolUse hooks still check every call.
  • Time. Code that Claude waits on stops after ten minutes; started in auto or bypass mode it can run in the background for up to two hours.
  • Off limits. No Remote Control, Claude in Chrome or computer use in the session, and it cannot move to the desktop app or become a background session.

To read and approve each program before it runs, add {"permissions": {"ask": ["REPL"]}} to ~/.claude/settings.json; REPL is the tool that runs the code. To turn Code Mode off, remove the variable or set it to 0; a 0 in either place wins over a 1 in the other. An administrator blocks it for everyone with the same variable at 0 in managed settings (Code Mode, read Nov 23, 2026).

Is it worth turning on?

Better Stack measured it on Nov 20, 2026: the same migration of 166 console calls across 53 files, three runs with Code Mode and three without, all on Opus 5.5 at medium effort in auto mode. Quality was identical in all six, every run ending with all 56 tests passing; with Code Mode the runs were faster, needed "about 28 percent fewer round trips to the model" and finished within 10 seconds of each other, while the cost "came out to be the same".

That one test is the best measurement we found, and it fits Anthropic's own advice to try Code Mode on "tasks that take many related tool calls": one change across many files, a search whose results need filtering, several commands that can run at once. We think it is worth switching on for a big refactor in the terminal on a subscription, and worth leaving off on a project where auto mode is your only guard against a destructive command, since the classifier then sees the program and not each call.

Sources

Moments

This Experimental Feature Is Claude Code's BIGGEST Upgrade of 2026

Chase AI

  1. Chase AI had Claude Code build the same feature twice in a Nov 19, 2026 video, and the run with Code Mode read 660,000…
  2. He counts about 20,000 fewer tokens at the start of a session, because the code tool stands in for the usual tool…
  3. Counting every function without a docstring in FastAPI, over 1,200 files, took 21 seconds with Code Mode and 25…
  4. On a one-step task, reading a README, Code Mode was slower, 15 seconds to 11, though it still read 35% fewer tokens.
  5. Adding a JSON output option to Django's migrations, it was 27% faster and read 71% fewer tokens, and every run in all…
  6. His downsides match the docs: terminal only, no computer use and no Remote Control.

Code Mode Makes Claude Code Smarter & Cheaper

Ray Amjad

  1. Ray Amjad's Nov 16, 2026 video, four days after the release, has a chapter on turning it on, after one on why one tool…

I Tested Claude Code's New Code Mode 6 Times

Better Stack

  1. Better Stack measured it on Nov 20, 2026: the same migration of 166 console calls across 53 files, three runs with…

See also

About this page

Last updated Nov 23, 2026 by the Vi.ki team. Page text CC BY-SA 4.0.

Edit History

Hotkeys

/
Jump to the search box
? or Ctrl + /
Open this list
Esc
Close this list, the photo viewer, or the account menu

Video

Space or K
Play or pause
← →
Back or forward 5 seconds
J L
Back or forward 10 seconds
0 to 9
Go to 0% to 90% of the video
, .
Previous or next frame, while paused
M
Mute or unmute
C
Captions on or off
F
Full screen on or off
A D
Previous or next moment

Photo viewer

← → or A D
Previous or next photo
↑ ↓ or W S
Previous or next photo
Home End
First or last photo
I
Show or hide the photo's info
Z
Clickless on or off: a pointer over a thumbnail shows it
N
Compare with the last photo: back to the one shown before this, and N again comes back
Q
Move the thumbnails to the next edge: top, bottom, left and round
, or Ctrl + ,
Open or close the viewer's settings
V
Clickless pan: a zoomed photo follows the pointer, rather than being dragged
Shift
Browse on or off
B
Show or hide the button bar
T
Show or hide the thumbnails
1
100% zoom on or off
0
Rate the photo as no opinion; again takes the answer back
+ -
Rate the photo a step higher or lower
F
Full screen: the photo alone. F again puts everything back.
Back to top