台灣 AI x AEC 情報BY FBI SICENTER
AI × AEC · CURATED INSIGHT

Anthropic Introduces Experimental Code Mode in Claude Code for Batching Tool Calls with JavaScript

AI assistants · AI coding

Anthropic has introduced an experimental feature called Code Mode in Claude Code 2.1.323. Instead of sequential step-by-step tool invocations, Claude writes JavaScript to execute multiple actions within the session and filters essential results back into context, reducing token usage and turn latency under specific operating constraints.

Anthropic Introduces Experimental Code Mode in Claude Code for Batching Tool Calls with JavaScript
AI-generated concept illustration; not an event photograph.

Anthropic added the experimental Code Mode feature to Claude Code version 2.1.323. Previously, Claude handled file reading, terminal commands, and file edits through individual tool calls, evaluating results after every single turn. Under Code Mode, Claude instead writes a JavaScript script executed inside the session. This enables parallel operations or step-by-step piping, passing back only the required outputs to mitigate context window bloat and reduce token expenditure during complex multi-file tasks. Code Mode is turned off by default and requires setting the CLAUDE_CODE_EXPERIMENTAL_CODE_MODE environment variable to 1 along with an interactive interface confirmation. Enterprise admins can enforce disabling it across organizations. The feature is restricted to Anthropic's direct API and interactive terminal sessions with specific models, excluding third-party gateways and desktop panels. Additionally, auto-mode permissions evaluate scripts as a whole, execution enforces runtime limits in both foreground and background sessions, and specific remote or browser controls remain unavailable while active.

Key takeaways

  • Claude Code 2.1.323 adds experimental Code Mode, using JavaScript execution to batch tool tasks and filter outputs.
  • The architecture aims to mitigate context bloat and reduce round trips when inspecting large logs or multiple files.
  • Disabled by default, the feature requires specific environment variable activation, with admin controls to lock it out.
  • Restricted to official Anthropic APIs and terminal sessions, running under script-level auto checks with runtime execution limits.

Source:INSIDE Read the original ↗

Prepared, checked and automatically published by AI; not individually reviewed by a human. Translation checked by AI.

← All articles