Sulat.com / Writing on AISaturday, November 14, 2026
Agent Engineering/14 November 2026

Claude Code adds Code Mode, an opt-in where Claude writes JavaScript to run its tools

Anthropic's new docs page says Code Mode lets Claude batch tool calls into one piece of JavaScript. It's experimental, off by default and limited to interactive terminal sessions.

A matte terracotta 3D Claude starburst logo beside a glowing paper scroll whose light rails feed three tool tiles: a terminal, a file and a magnifier.

At a glance

  • Anthropic added Code Mode to Claude Code in v2.1.323 on 12 November 2026, an experimental opt-in in which Claude writes JavaScript that makes several tool calls in one step.
  • Anthropic says one piece of code can run commands in parallel, use one result in the next call and return only the output Claude needs to read.
  • Code Mode is off by default, turns on with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1, and works only in an interactive terminal session on Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2.
  • Each tool call in Claude's code still goes through your deny and ask rules and PreToolUse hooks; in auto mode a classifier reviews the code instead of each call.
  • Anthropic's page makes no claim about usage, tokens or the five-hour and weekly limits, and says Code Mode may change or be removed in any release.

Anthropic has added Code Mode to Claude Code, an experimental setting in which Claude writes JavaScript that makes several tool calls in one step instead of asking for them one at a time. It arrived in v2.1.323 on 12 November 2026, and Anthropic’s new Code Mode docs page says it’s off by default.

Without Code Mode, Claude asks for a tool call such as Bash, Read or Edit, then reads the result before it decides what to do next. With it, Claude Code runs a piece of JavaScript in your session. Anthropic says 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 to read.

Two-row diagram: without Code Mode Claude asks for one call, reads it, picks the next; with Code Mode it writes JavaScript, runs calls in parallel and reads only what it needs.
With Code Mode, one piece of JavaScript replaces a back-and-forth of single tool calls.

What the code looks like

Anthropic’s example is a request to raise a retry limit. Claude writes code that finds the file, edits it and runs the tests, and the last line hands the file’s path and the test output back to Claude:

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 the conversation you see the tool calls, such as the edit’s diff, and not the code. Press Ctrl+O to open the transcript viewer, where each piece of code appears as a collapsed Code row.

Anthropic suggests trying it on tasks that take many related tool calls: a change that repeats across many files, a search whose results need filtering before Claude reads them, and several independent commands that can run at the same time.

How to turn it on

  1. Run claude --version. If it’s older than v2.1.323, run claude update.
  2. Set CLAUDE_CODE_EXPERIMENTAL_CODE_MODE to 1, either in your shell (CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude) or in the env block of ~/.claude/settings.json. Claude Code ignores the variable in a project’s settings files, so a cloned repository can’t turn Code Mode on for you.
  3. Choose Yes, turn on Code Mode at the first-run prompt. Claude Code restarts and shows “Code Mode (experimental) is on”.
Three numbered steps: update Claude Code to v2.1.323 or later, set CLAUDE_CODE_EXPERIMENTAL_CODE_MODE to 1, then confirm the Yes, turn on Code Mode prompt.
Setting one variable and confirming one prompt is all it takes to start a Code Mode session.

An organisation can block it by setting the same variable to 0 in managed settings. Anthropic says managed settings can’t turn Code Mode on for users. A session started with Code Mode can be resumed only in the terminal with Code Mode on.

Where it works

ItemRequirement
VersionClaude Code v2.1.323 or later, on either release channel
AccountA Claude subscription or Console account. Not through a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform or Microsoft Foundry
ModelsClaude Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2
SurfaceAn interactive claude session in a terminal. Not -p, the Agent SDK, the VS Code panel, the Desktop app or cloud sessions
OrganisationNo HIPAA configuration or zero data retention
Unavailable in Code ModeRemote Control, Claude in Chrome and computer use
Source: Anthropic’s Code Mode documentation.
Code Mode works in an interactive claude terminal session, and doesn't work in cloud sessions, the Desktop app, the VS Code panel, claude -p or the Agent SDK.
Anthropic’s page limits Code Mode to the interactive terminal.

How permissions work

Anthropic says each tool call that Claude’s code makes still goes through your deny and ask permission rules and your PreToolUse hooks, so a rule for a tool such as Bash needs no change. In auto mode, a classifier reviews each piece of code before it runs rather than each tool call, and the page says it doesn’t see values computed at run time, such as a path taken from search output. In other permission modes the code starts without a review, and you’re prompted for each tool call that would prompt you in that mode.

To check the code itself, Anthropic says to write a PreToolUse hook that matches REPL, the tool that runs Claude’s code, and read the JavaScript from tool_input.code. Code that Claude waits on stops after ten minutes. Code that runs in the background can last up to two hours, and Anthropic says that needs a session started in auto or bypassPermissions mode.

What the page says about limits

The page makes no claim about usage, token counts or Claude Code’s five-hour and weekly limits. It calls Code Mode experimental and says it may change or be removed in any release. Feedback goes through /feedback.

Claude Code’s changelog lists three Code Mode fixes in v2.1.325, released on 13 November: scripts that ignored a worktree entered with EnterWorktree, wrote ~ paths into the project and left /mcp showing a server as connected after its sign-in expired; words typed with a Yes at a permission dialog or plan approval that didn’t reach Claude; and Claude starting work by itself when you resumed a session that ended during a Code Mode script.


Discover more from Sulat AI & Tech News

Subscribe to get the latest posts sent to your email.