· AI dev tools

Claude Code Adds Experimental Code Mode to Orchestrate Tool Calls with JavaScript

A file search using rg within an example demonstrates how Claude Code's new Code Mode can raise a retry limit, run tests, and return only the path and test output.


A file search using `rg` within an example demonstrates how Claude Code's new Code Mode can raise a retry limit, run tests, and return only the path and test output.

Anthropic has introduced Code Mode to Claude Code, an experimental capability allowing the model to generate JavaScript to manage its tools. This contrasts with the previous method of requesting each Bash, Read, or Edit call individually.

This feature is not active by default; it requires Claude Code v2.1.323 or a newer version, and it must be activated using the environment variable CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1. Anthropic cautions that this mode might undergo changes or be removed in future releases.

In standard operation, Claude requests one tool call, processes the complete result, and then determines the subsequent action. With Code Mode, a single script can execute commands in parallel, pass one result to the next call, and return only the necessary output for the model.

Architects should pay close attention to the permission model. Although every script call still passes through deny and ask rules and PreToolUse hooks, in auto mode, the classifier reviews the entire script before execution, rather than each individual call, and cannot see runtime values.

Code Mode is restricted to interactive terminal sessions within the native build, operating on Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.2, and requires a Claude subscription or Console account. It is unavailable for use with -p, the Agent SDK, the VS Code panel, the Desktop app, Amazon Bedrock, gateways, or organizations with zero data retention.

George (@bolyki) noted from eight interactive Sonnet 5.5 runs that the results were consistent: "Same results every time. Context 20-25% smaller. On the bigger task: 37% fewer tokens, 19% lower cost. But it is not faster, and on a tiny task it cost more."

Ravi Madabhushi countered any notion that the feature renders MCP obsolete, stating, "It doesn't materially change anything wrt authentication, authorization and audit policy layers; Your agent still makes those same MCP calls, with the same auth tokens and context and what materially changes is how much context gets into the model window and how much can be discarded."

Why it matters

This feature represents a significant shift in how developers interact with AI agents, moving from sequential tool requests to complex, scripted workflows. For working developers, this offers a new capability to manage intricate, multi-step coding tasks more efficiently within the model's execution environment.

Earlier coverage

Related coverage

Also worth reading

  1. next.js 16.5.0-canary.62 released with switchyard updates, Turbopack fixes
  2. AWS releases API Portal, API Security, AI Security for API and AI endpoint protection
  3. Anthropic Claude Ship lets Claude review, fix, and approve routine pull requests
  4. Google DeepMind releases Lean 4 framework to verify Gemini 4 agents cutting quantum costs 290-fold
  5. Signal blocks screenshots on Apple, Google OS to protect data from AI agents