Skip to content

Claude Code lets Claude write JavaScript instead of individual tool calls

Code Mode is an experimental opt-in where Claude writes one script that calls Bash, Read, Edit and MCP tools as async functions, rather than emitting them one at a time.

Source: Anthropic

Claude Code 2.1.323, released yesterday, adds Code Mode: an experimental, opt-in way for Claude to write JavaScript that calls its own tools instead of making one tool call per turn. Every tool, Bash, Read, Edit, and any MCP tool, becomes an async function Claude can call from a script it writes itself.

It’s off by default. Anyone can turn it on for themselves, and organisations can turn it off entirely, through the settings linked from the changelog entry.

Why it matters: fewer turns means less context spent on tool-call plumbing, which matters most with MCP servers that expose a lot of tools. Cloudflare’s own MCP server leans on the same idea, exposing just search() and execute() rather than thousands of individual endpoints, to fit its full API surface into a fraction of the tokens a one-tool-per-endpoint design would need.

The caveat: this is experimental and opt-in for a reason. A script that chains several tool calls before anything is shown to you changes what you’re reviewing mid-task, so it’s worth watching how it behaves on anything destructive before trusting it by default.

Share

Related reading

More from The Wire

All briefs