Skip to main content
Claude AI interface displaying JavaScript code, demonstrating its new ability to chain tool calls for complex tasks.

Editorial illustration for Anthropic's Claude Code Now Writes JavaScript to Chain Tool Calls

Claude Code v2.1 Chains Tool Calls with JavaScript

Anthropic's Claude Code Now Writes JavaScript to Chain Tool Calls

• 4 min read

Anthropic pushed out Code Mode in Claude Code v2.1.323 last week, an experimental feature developers have to switch on themselves. The idea: instead of Claude requesting one tool call at a time (a Bash command here, a Read there, waiting on each result before moving on), it now writes JavaScript that bundles several calls into a single program the terminal session runs directly.

That's a real shift in how the agent burns round-trips. The feature only works in an interactive terminal session on the native build, running Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2, and it's locked to the Anthropic API or a Claude subscription. Windows users need Git for Windows installed first. There's no support yet for Bedrock, Google Cloud, Foundry, the -p flag, the Agent SDK, VS Code or the desktop app, so this is a narrow rollout by design.

Anthropic hasn't published any benchmark numbers or token-savings figures for Code Mode, so the gains are structural rather than measured. Background code can run up to two hours while you keep working with Claude, but anything Claude is waiting on directly times out after ten minutes.

Without Code Mode, Claude requests each Bash, Read or Edit call directly. It reads every result before choosing the next step. With Code Mode, Claude writes a piece of JavaScript, and Claude Code runs it in your session.

Why this matters Code Mode is a small plumbing change with real cost implications. Anthropic's pitch is straightforward: instead of Claude firing off one tool call, waiting, reading the result, then firing the next, it writes a script that batches several calls at once. For anyone running Claude Code on long agentic tasks, that's fewer round-trips and less token burn per step, which translates directly to lower API bills and faster turnaround on multi-file edits or test runs. That's worth testing on real workloads, not just demos.

We'd flag two things worth watching. First, the model list in Anthropic's own materials includes "Fable 5" alongside Opus 5.5, Sonnet 5.5 and Haiku 5.5, a name that doesn't match any Anthropic release we can verify, so treat the sourcing here with some caution until Anthropic's actual docs confirm it. Second, this ships as opt-in and experimental in v2.1.323, meaning early adopters should expect rough edges around parallel execution and error handling before trusting it on production codebases.

Common Questions Answered

How does Code Mode in Claude Code v2.1.323 change the way tool calls are executed?

Code Mode allows Claude to write JavaScript that bundles multiple tool calls into a single program instead of requesting each Bash, Read, or Edit call individually. Previously, Claude would wait for each result before choosing the next step, but now it can execute several calls at once in an interactive terminal session, significantly reducing round-trips.

What are the cost implications of using Code Mode for agentic tasks?

Code Mode reduces the number of round-trips required for multi-step operations, which directly decreases token burn per step and lowers API bills. By batching multiple tool calls together instead of executing them sequentially, developers can achieve faster turnaround times on complex tasks like multi-file edits or test runs while spending less on API usage.

Is Code Mode enabled by default in Claude Code, and how does it work?

Code Mode is an experimental feature that developers must manually enable themselves in Claude Code v2.1.323. When activated, Claude writes a piece of JavaScript code that chains multiple tool calls together, and Claude Code runs this bundled script directly in the interactive terminal session rather than executing individual commands sequentially.

What specific operations can be chained together using Code Mode's JavaScript approach?

Code Mode allows Claude to chain together Bash commands, Read operations, and Edit calls into a single JavaScript program. This bundling capability enables developers to perform complex workflows like multi-file edits and test runs more efficiently by executing all related operations in one batch rather than waiting between individual steps.

LIVE09:42SID AI Releases SID-2 Agentic Search Model With 0.720 NDCG Swarm Mode