Claude Code Gets Code Mode: Claude Scripts Its Own Tool Calls in JavaScript
Since version 2.1.323, Claude can bundle searches and commands into one short program and read back only the part of the output it needs.

Until this week, every time Claude Code needed to search a folder, run a command or open a log, it asked for one tool, waited, read the whole result and only then decided what to do next. Since version 2.1.323, released on November 12, it can instead write a few lines of JavaScript that make all of those calls itself, run independent ones at the same time and hand back only the lines that matter. For developers in long sessions, that means fewer round trips and less of the model's attention spent reading noise.
One Program Instead of a Dozen Round Trips
The change is in how Claude talks to its own tools. Without Code Mode, Claude asks for Bash, Read or Edit directly and reads each result before choosing the next step. With it, Claude writes a piece of JavaScript that makes the tool calls, and Claude Code runs that code inside the session.
“One piece of code can run commands in parallel, use one result in the next call, and return the part of the output that Claude needs to read.”— Claude Code documentation
The documentation points to two jobs where that pays off: a search whose results need filtering before Claude reads them, and several independent commands that can run at once. A script waits for up to ten minutes, or up to two hours if it runs in the background. Nothing is hidden: pressing Ctrl+O opens the transcript, where each script appears as a collapsed Code row that expands into the JavaScript Claude wrote.
Anthropic moved quickly on early feedback. Version 2.1.325, out the next day, fixed three Code Mode bugs, including scripts that ignored a worktree and typed replies that never reached Claude. Developer Daniel San tried it with Fable 5.2 and shared the banner that greets you: "Code Mode (experimental) is on." The idea behind it is older than the feature, and it comes with a number.
The 98.7% Idea Behind It
In November 2025, Anthropic engineers Adam Jones and Conor Kelly published a study on letting agents call tools through code instead of one request at a time. Their clearest example was a spreadsheet with 10,000 rows. Called the old way, every row flows through the model. Called from code, the agent filters first and "sees five rows instead of 10,000."
In that same study, loading only the tool definitions a task needed cut one example from 150,000 tokens to 2,000. Cloudflare published similar findings and gave the approach the name Code Mode. Anthropic has not yet published figures for the new feature in Claude Code, which is why it ships as an experiment that developers can measure on their own projects.
Who Can Turn It On, and What Keeps It Honest
Code Mode is off by default. To try it, a developer sets CLAUDE_CODE_EXPERIMENTAL_CODE_MODE to 1, for one session or in their personal settings, and confirms once. Claude Code ignores that switch in a project's own settings files, so a repository you clone cannot turn it on for you. Companies can keep it off for everyone through managed settings, but they cannot force it on.
It needs a Claude subscription or a Console account, Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2, and an interactive session in a terminal. It is not available yet through cloud providers such as Amazon Bedrock, in the Desktop app, in the VS Code panel or in cloud sessions.
The safety rules carry over. Every tool call the code makes still goes through the developer's deny and ask rules and their PreToolUse hooks, and in auto mode a classifier reviews each script before it runs. The agent that used to ask for one step at a time can now hand over a whole plan written as code, and code is something a developer can read line by line.
One Script Beats Many Round Trips
The Brief
Stay curious
AI and technology: what changes and why it matters.
Your daily selection, in English or Spanish.
Free forever. Unsubscribe anytime.
More stories

The Specialty News





Conversation
Start the conversation