Anthropic Adds Experimental Code Mode to Claude Code

The optional feature lets Claude write JavaScript to drive Claude Code's tools rather than calling each tool separately.

Updated on Nov. 23, 2026 in Artificial Intelligence

Anthropic Adds Experimental Code Mode to Claude Code

Anthropic has added an experimental Code Mode to Claude Code, allowing the model to write JavaScript that controls the tool's functions instead of making each tool call one at a time. The feature is off by default and requires Claude Code v2.1.323 or later.

Why it matters

The approach can run commands in parallel and return only the output the model needs, which the extraction indicates may reduce token use and context size. Anthropic has said the feature may change or be removed in any release, so developers should treat it as unstable.

The reported savings come from a single user test with eight interactive Sonnet 5.5 runs, showing 37% fewer tokens and 19% lower cost on a bigger task. Anthropic has not published official token or latency figures for Code Mode, so the performance gains remain unverified.

The players

Anthropic

Anthropic is an artificial intelligence company that develops the Claude family of AI models and the Claude Code developer tool.

The details

Code Mode runs only in interactive terminal sessions of the native build, and it is enabled with the CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 environment variable. It does not work with -p, the Agent SDK, the VS Code panel, the Desktop app, Amazon Bedrock, gateways, or zero-data-retention organizations, and project settings cannot enable it. Administrators can block it through managed settings.

Timeline

  1. Agent teams require Claude Code v2.1.326, a later release than the Code Mode minimum of v2.1.323.

The Tech Race

Code Mode extends the code-execution pattern Anthropic described in its MCP workflow, where token use fell from 150,000 to 2,000, into interactive coding tools. The move reflects a broader effort among AI coding assistants to cut token costs by having models write code rather than issue sequential tool calls.

Developers using Claude Code in interactive terminal sessions can enable Code Mode with one environment variable after upgrading to v2.1.323 or later. Because Anthropic says the feature may change or be removed in any release, teams should test it before relying on it in production workflows.

The takeaway

Code Mode shows AI coding tools moving toward letting models write scripts rather than issuing one tool call at a time. Developers who try it should check the version requirements and expect the feature to change.

Further reading

For broader context on how AI systems are being built and deployed, see Artificial Intelligence.

More information

Read the Claude Code Mode article for details on how the feature works.

Source note: This article includes information reported by InfoQ.