Anthropic Adds Code Mode to Claude Code: Claude Now Chains Tool Calls in JavaScript
In one sentence
Anthropic has added an experimental Code Mode to Claude Code, allowing Claude to write JavaScript that chains multiple tool calls in a single step.
Key points
- Developers can opt in by setting CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 on Claude Code v2.1.323 or later.
- Claude can run commands in parallel, pass results between calls, and filter outputs, making it suited for multi-file changes.
- Waiting code stops after 10 minutes, while background code can run for up to 2 hours in supported permission modes.
- It is currently limited to the interactive terminal with Anthropic API or Claude subscriptions, excluding Bedrock, Google Cloud, and IDE panels.
In depth
An AI-written overview of the original article, not the article itself.
Anthropic has introduced an experimental Code Mode in Claude Code v2.1.323, allowing Claude to write JavaScript that chains or parallelizes multiple tool calls in a single step. This feature changes how the agent handles multi-step tasks and supports Claude Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.2.
How It Works and Use Cases
Without Code Mode, Claude requests Bash, Read, or Edit calls one by one and reads every result before proceeding. With Code Mode enabled, Claude writes JavaScript that runs in the session, feeding one result into the next call and returning only the needed output.
According to the article, Anthropic recommends this for repetitive multi-file edits, searches requiring filtering, and independent commands that can run concurrently. Developers can opt in by setting CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1, and while code is hidden by default, pressing Ctrl+O reveals it.
Permissions and Limitations
Each tool call inside the script still passes deny/ask rules and PreToolUse hooks. However, in Auto mode, a classifier reviews the code snippet rather than individual calls, meaning it cannot inspect runtime-computed values.
Waiting code times out after 10 minutes, while background tasks in auto or bypassPermissions mode can run for up to 2 hours. Availability is restricted to native interactive terminals via Anthropic API or Claude subscriptions, excluding Bedrock, Google Cloud, VS Code, and Desktop apps.
Background and Performance
The article notes that Cloudflare coined "Code Mode" in September 2025, and Anthropic previously launched Python-based Programmatic Tool Calling for its API. Anthropic has not published official benchmarks or token-saving figures for Claude Code's version, though a single independent test reported system-tool context dropping from 24.6k to 11.1k tokens.
This summary was generated by AI from the original article and may contain errors; the original is authoritative. Copyright belongs to the original author.