ai newsMi., 25. Nov.
EilmeldungYale’s Sonnenfeld: Nvidia is a ‘detriment’ to U.S. industrial might — not a champion

Claude Code: Experimenteller Code Mode orchestriert Tool-Aufrufe per JavaScript

Anthropics experimenteller Code Mode erlaubt es Claude Code, JavaScript zu schreiben, das Bash-, Read- und Edit-Aufrufe verkettet, parallelisiert und filtert. Auch die Prüfung dieser Aufrufe durch Auto-Modus und Hooks ändert sich.

InfoQMontag 13:17 · 23.11.DE2 Min. Lesezeit
Bild: InfoQ

In a normal session, Claude asks for one tool call, reads the full result, and decides the next step. In Code Mode, one script can run commands in parallel, pass one result into the next call, and return only the output the model needs. The documentation's example finds a file with rg, raises a retry limit, runs the tests, and returns just the path and test output. The conversation still shows each tool call and diff, while the generated code sits in the transcript viewer. Anthropic recommends it for edits repeated across many files, searches that need filtering, and independent commands. Code that Claude waits on stops after ten minutes; sessions started in auto or bypassPermissions mode can push it to the background for up to two hours while the conversation continues.

Code Mode runs only in interactive terminal sessions of the native build, on Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.2, through a Claude subscription or Console account. It does not work with -p, the Agent SDK, the VS Code panel, the Desktop app, Amazon Bedrock, gateways, or zero-data-retention organizations. Agent teams need v2.1.326. Anthropic has published no token or latency figures for it.

George (@bolyki) compared Code Mode with normal mode across eight interactive Sonnet 5.5 runs and posted:

Same results every time. Context 20-25% smaller. On the bigger task: 37% fewer tokens, 19% lower cost. But it is not faster, and on a tiny task it cost more.

Ravi Madabhushi, who builds agent auth infrastructure, pushed back on claims that the feature makes MCP obsolete:

It doesn't materially change anything wrt authentication, authorization and audit policy layers; Your agent still makes those same MCP calls, with the same auth tokens and context and what materially changes is how much context gets into the model window and how much can be discarded.

The idea, and the name, predate Anthropic's release. Cloudflare introduced Code Mode for MCP converting MCP tools into a TypeScript API that models code against inside sandboxed Workers, where bindings keep API keys away from generated code. Anthropic's own post on code execution with MCP described one workflow dropping from 150,000 to 2,000 tokens, and the Claude API offers programmatic tool calling in a remote code execution container. Code Mode instead runs the script in the developer's local session, against Claude Code's built-in tools and permission system.

Code Mode remains opt-in and experimental, and Anthropic collects feedback through /feedback. Setup steps and troubleshooting are in the Claude Code documentation

Presented by: Kiran Gangadharappa - Engineering Advisor at Harness, and Scott Davis - Senior Engineering Manager at Harness

Originaltitel: Claude Code Adds Experimental Code Mode to Orchestrate Tool Calls with JavaScriptQuelle: InfoQ (InfoQ). Original öffnen