Claude Code tests scripted batch tool calls in Code Mode

AI coding illustration: a robotic arm fitting a red block into a structure

This week Anthropic added an experimental feature called Code Mode to Claude Code. When it is on and Claude needs to call several tools, it first writes a piece of JavaScript, which Claude Code then executes inside the session on the user's own machine. One script can run several commands at once, pass the result of one step to the next, and hand back to the model only the part it needs. In the default mode, Claude calls tools such as Bash, Read and Edit one at a time and reads the result after each call.

The official documentation is blunt about where the feature stands:

"Code Mode is experimental and off by default. It may change or be removed in any release."

How to turn it on, and how permissions work

You enable it by setting the environment variable CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1, either in front of the launch command or in the user-level ~/.claude/settings.json. Project-level configuration files ignore this variable. The first activation has to be confirmed manually. Enterprise administrators can disable it across an entire organization by setting it to 0 in the managed configuration.

The documentation names three suitable scenarios: repetitive edits spread across many files, searches that need filtering, and independent commands that can run at the same time. The conversation view still shows each individual tool call, such as the diff of an edit, while the code itself is collapsed into a single line. Pressing Ctrl+O opens the transcript viewer, where it can be expanded.

Permissions are not loosened as a result. Every tool call made from the code still goes through the deny and ask rules and PreToolUse hooks under its original tool name, such as Bash. The code itself runs through a tool called REPL. One change is worth noting: the auto mode classifier reviews the entire block of code and cannot see values that only exist at run time.

The requirements are longer than the feature description

The documentation lists many restrictions. Time: code the session is waiting on in the foreground is stopped after 10 minutes, and code moved to the background can run for at most two hours. Version: it is available from Claude Code v2.1.323, and using it together with agent teams requires v2.1.326. Entry points: it works only in the interactive terminal claude. The command-line -p mode, the Agent SDK, the VS Code panel, the desktop app and cloud sessions cannot use it. Remote Control, Claude in Chrome and computer use are likewise unsupported, and once it is on, a session cannot be moved to the desktop app or turned into a background session. Models: limited to Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.2.

The documentation gives no figures for token savings or latency reduction, so the actual benefit is left for developers to measure.

Can developers in China use it?

The account requirement is the tightest constraint. Code Mode is open only to Claude subscribers and Console accounts. Anyone who reaches Claude through a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform or Microsoft Foundry cannot use it. Many teams in China connect to Claude through cloud-provider channels or self-built gateways, so for now this group is left out. Organizations with zero data retention or a HIPAA configuration are also excluded, and environments with an API key helper, OpenTelemetry export or DISABLE_TELEMETRY configured are blocked as well.

Windows users need to install Git for Windows first, and Claude Code itself must be the native install. A team that wants to try it is better off running it in a personal terminal for a few days and comparing elapsed time and token consumption on the same kind of batch change, rather than putting it straight into team configuration, particularly since project-level configuration does not recognize the variable anyway.

Sources: CocoLoop, the Code Mode page of the Claude Code official documentation, Anthropic developer announcement; used to check how to enable it, version requirements, the runtime limits and the unsupported access channels.