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
- Version.
claude --versionmust say 2.1.323 or later;claude updateif 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. - 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. - Model. Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2. On an older model, start with
--model opus. - Surface. An interactive
claudesession in a terminal, on the native build. Not the VS Code panel, the desktop app, cloud sessions orclaude -p. On Windows, Git for Windows must be installed. - 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.
- 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 --continuewithout 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
denyandaskrules andPreToolUsehooks 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
- Run tool calls from code with Code Mode, Claude Code Docs, read Nov 23, 2026
- Claude Code v2.1.323, GitHub, Nov 12, 2026
- Claude Code v2.1.330, GitHub, Nov 20, 2026
- Code Mode Makes Claude Code Smarter & Cheaper, Ray Amjad, Nov 16, 2026 (video)
- I Tested Claude Code's New Code Mode 6 Times, Better Stack, Nov 20, 2026 (video)
- This Experimental Feature Is Claude Code's Biggest Upgrade of 2026, Chase AI, Nov 19, 2026 (video)
Moments
This Experimental Feature Is Claude Code's BIGGEST Upgrade of 2026
Chase AI
- 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…
- He counts about 20,000 fewer tokens at the start of a session, because the code tool stands in for the usual tool…
- Counting every function without a docstring in FastAPI, over 1,200 files, took 21 seconds with Code Mode and 25…
- 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…
- His downsides match the docs: terminal only, no computer use and no Remote Control.
Code Mode Makes Claude Code Smarter & Cheaper
Ray Amjad
I Tested Claude Code's New Code Mode 6 Times
Better Stack
See also
-
Claude CodeWe rate Claude Opus 5.5, Claude Code's default model, S tier, and think Claude Code is among the strongest coding agents measured and the dearest to run: second on Terminal-Bench 4.1 on Nov 25, 2026, behind GitHub Copilot's Copilot Fusion, after leading it on Nov 11. Claude Code is Anthropic's agentic coding tool. It reads a codebase, edits files, runs commands and opens pull requests from the terminal, VS Code, JetBrains IDEs, the Claude desktop app, the browser and Slack, and it comes with every paid Claude plan or a pay-as-you-go Console account. -
Claude Code SettingsClaude Code reads settings from ~/.claude/settings.json (you), .claude/settings.json (shared project), .claude/settings.local.json (you, one project) and managed policy, with managed settings winning; /config edits them in a session.
-
Claude Code Permissions and ModesClaude Code has six permission modes (Manual, Accept edits, Plan, Auto, Don't ask and Bypass permissions), cycled with Shift+Tab; since v2.1.283 interactive sessions start in auto mode, and --dangerously-skip-permissions turns every check off and belongs only in a container or VM.
-
How to Remove Co-Authored-By Claude From CommitsTo stop Claude Code adding "Co-Authored-By: Claude" to git commits, put "attribution": false in ~/.claude/settings.json (Claude Code 2.1.281 or later); on older versions set attribution.commit and attribution.pr to empty strings. The deprecated includeCoAuthoredBy key still works but is ignored once attribution is set. Read at Anthropic's Claude Code docs on Nov 23, 2026.
-
Claude in ChromeClaude in Chrome is Anthropic's extension for Google Chrome that lets Claude read web pages and click, type and fill forms on sites you are signed in to. It is on every paid Claude plan and has been generally available since Aug 26, 2026. -
Computer UseComputer use is a Claude API tool that lets Claude operate a desktop through screenshots, mouse clicks and keystrokes, which your own application carries out. It launched in public beta on Oct 22, 2024 and has been generally available as the computer_toolset_20260801 toolset since Aug 19, 2026.