Agents & Automation

How Claude Code’s Code Mode chains tool calls

Claude Code can use a single script to run related tools and return only the output it needs. Here’s where that can save tokens, how to try it and where human approval still matters.

Finley · FoxAI World3 min read
18
Finley presents a sequence of workflow icons and small robots beneath the Anthropic logo.Tools in One Script

Conceptual cover created with AI.

You have a meeting transcript in Google Drive and want to attach it to a prospect’s record in Salesforce. If the assistant reads the whole transcript and then writes it out again, it processes the same text twice just to move it. Code Mode gives Claude Code a different way to handle that handoff.

Anthropic introduced the experimental mode on 12 November 2026 in Claude Code 2.1.323 and left it off by default. You still describe the task in plain language. Usually, Claude gets each tool result before deciding what to do next. In Code Mode, it can write a single JavaScript script that passes one tool’s result straight to the next, runs independent steps in parallel and returns to the model the information it needs to read.

Where a script can save tokens

The change matters most when several steps share data or a tool returns more than you need. A script could search a project for broken links and return just the matches. That gives Claude less text to process. Tokens are the small units of text a model reads or generates.

In a separate 2025 example, Anthropic’s engineers used MCP, a standard for connecting AI assistants to external tools, to move a transcript from Google Drive to Salesforce. They reported a drop from 150,000 to 2,000 tokens for that workflow. The figures describe that earlier implementation. They give us a reason to look at how much text an intermediate step produces, while leaving the time and cost of your Claude Code session to be measured on the actual task.

Finley points toward document, gear and terminal icons beneath the Anthropic logo.
AI-generated conceptual illustration.

Who can turn it on

You need the native build of Claude Code in an interactive terminal and Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2. The minimum version is 2.1.323 with a Claude subscription or a Console developer account. Support for terminal sessions using cloud providers such as Amazon Bedrock, Google Cloud’s Agent Platform and Microsoft Foundry starts at 2.1.331. The feature is unavailable in the VS Code panel, Desktop and Claude Code cloud sessions. On Windows, you also need Git for Windows. The mode is unavailable to organizations using Anthropic’s HIPAA setup for US health data or its zero data retention setting.

Start a session and inspect the script

Check your version with claude –version and run claude update if needed. On macOS, Linux or WSL, run CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude. In Windows PowerShell, run $env:CLAUDE_CODE_EXPERIMENTAL_CODE_MODE = “1” and then run claude on the next line. Confirm the first time and look for the Code Mode status line after the restart. To see the JavaScript, press Ctrl+O and expand a Code entry in the session transcript.

Keep control of the next step

Keep Code Mode on to resume the session. Moving it to Desktop, using Remote Control, using Claude in Chrome and letting Claude operate the computer interface are unavailable. In auto mode, which automates some permission decisions, Claude Code reviews the script before it runs. Values that appear during execution are outside that review. Individual tool calls still have to follow the permission rules.

I’d start with a read-only search that produces a long list. You can compare the matches and token use with the same task in a regular session. If you later use the mode to update records, keep approval at the write step so a person can check which record the script is about to change.

Ask AI about this article

Opens in a new tab with the question filled in.

Sources and research

Written by FoxAI World. The cover and illustrations are AI-generated conceptual artwork.

Your favourites

This list stays in this browser on your device. No account is needed, and other visitors cannot see it.

Use a story’s bookmark button to add your first favourite.