Anthropic has added an experimental Code Mode to Claude Code. Instead of calling Bash, Read, or Edit one operation at a time, the model can write JavaScript that coordinates those built-in tools. The main idea is not to add another tool, but to avoid repeatedly sending large intermediate results back into the model’s context.
What changes
In a conventional session, Claude makes one tool call, reads its full result, and then chooses what to do next. Code Mode allows a script to connect several steps. For example, it can search for files with rg, raise a retry limit, run tests, and return only the relevant paths and test output. It can also run independent commands in parallel or filter results before returning them. Tool calls and diffs remain visible in the conversation, and generated code is saved in the session record viewer.
The feature is off by default. It requires Claude Code v2.1.323 or later and the CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 environment variable. It runs only in native interactive terminal sessions and supports the models listed in the source: Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.2. It is unavailable with the -p flag, Agent SDK, VS Code panel, desktop app, Amazon Bedrock, gateways, and zero-data-retention organizations. Agent teams require v2.1.326. Synchronous execution waits for up to 10 minutes; in auto or permission-bypass mode, a task can run in the background for up to two hours. Anthropic warns that the experimental feature may change or be removed in any release.
A different review boundary
Calls made by a script still go through deny rules, ask rules, and PreToolUse hooks. But in auto mode, the classifier reviews the entire script before it runs rather than inspecting each call separately, and it cannot see values calculated at runtime. A hook may receive a combined command such as cd 'app' && git push, so checking only the command’s first part may be insufficient. Hooks matching the REPL tool can read JavaScript from tool_input.code. Repository settings cannot enable Code Mode, and administrators can disable it through managed settings.
What it could mean
Anthropic recommends trying Code Mode on edits spanning multiple files, searches that need filtering, and tasks made up of independent commands. Developer George reported an eight-run Sonnet 5.5 comparison in which outputs matched and context fell by 20% to 25%. For larger tasks, the reported token use dropped 37% and cost 19%, but speed did not improve; small tasks became more expensive. These are results from an individual comparison, not an official benchmark, and Anthropic has not published token or latency figures.
The feature is best understood as an orchestration layer for controlling context, not a speed upgrade or a replacement for MCP. An infrastructure developer cited in the report argued that MCP calls, credentials, and authorization context remain the same; what changes is how much information reaches the model window and how much can be discarded. Code Mode also differs from Cloudflare’s MCP-oriented approach and Claude API’s remote programmable tool calling: it runs scripts in a local Claude Code session, using Claude Code’s built-in tools and permission system. Teams evaluating it should weigh possible context savings against the changed review boundary and verify that hooks cover the commands the scripts can actually execute.
Source: InfoQ Chinese
Comments
Checking sign-in status...
Loading comments...