ProductsMulti-sourceSelected

Claude Code adds Code Mode for JavaScript-based batch tool calls

Why we picked it

The real shift is architectural: permission checks move from auditing individual tool calls to reviewing whole code blocks, and the classifier can no longer see runtime values such as paths pulled from search results — a meaningful change to how auto-mode safety works. Teams running bulk refactors, large-scale searches or multi-file edits get the most immediate benefit. Note the model restriction means the feature is unavailable through enterprise gateways like Bedrock or Vertex, which affects enterprise rollout plans.

Anthropic's Claude Code has introduced an experimental feature called Code Mode, which is disabled by default and must be enabled manually. With Code Mode on, Claude stops calling one tool at a time — such as a single Bash, Read or Edit command — and instead writes a JavaScript snippet that invokes multiple tools in one go, executed locally within the Claude Code session.

Body

Anthropic's example changes a retry limit from 3 to 5: Claude writes code that locates files with rg, edits parameters, runs the relevant tests, and returns only file paths and test output to itself. Operations that previously took four or five back-and-forth rounds complete in one step. The gains come from three mechanisms: independent commands run in parallel, intermediate results pass directly between steps without going through the model, and bulky outputs are filtered in code so only the needed parts enter the context. In the chat UI, tool calls like edit diffs still appear; pressing Ctrl+O and expanding the Code line reveals the underlying script.

Enabling requires setting CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 in the shell or ~/.claude/settings.json — project-level settings do not work, so cloned repos cannot silently turn it on. Limits are substantial: it works only in interactive terminal sessions (no -p, Agent SDK, VS Code panel, desktop or cloud sessions), excludes Bedrock, Google Cloud, Microsoft Foundry gateways and API key helpers, supports only Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.2, and cannot start with agent teams, OpenTelemetry export or DISABLE_TELEMETRY on. Code runs in the foreground for up to 10 minutes, or up to 2 hours in the background when the session starts in auto or bypassPermissions mode.

Original · shao__meng

Claude Code 推出实验功能 Code Mode:从一次调一个工具,到写一段 JS 批量调工具 Code Mode 默认关闭,要自己打开。打开以后,Claude 调工具的方式变了:以前每次只调一个 Bash、Read 或 Edit,看完结果再决定下一步;现在 Claude 先写一段 JavaScript,在里面一次调用多个工具,由 Claude Code 在本地会话里执行。 code.claude.com/docs/en/code-m… # 具体怎么工作 官方举例是把重试上限从 3 改成 5。Claude 会写一段代码:先用 rg 找到文件,再改参数,接着跑相关测试,最后只把文件路径和测试输出交还给自己看。原本要来回四五轮的操作,现在一步就能做完。 这样做有三个好处。几个独立的命令可以并行跑;上一步的结果可以直接传给下一步,不用经过模型;中间产生的大量输出可以先在代码里筛一遍,只把需要的部分放进上下文。官方推荐的用法也围绕这几点:同一处改动要改很多文件、搜索结果需要先过滤再读、几个独立的命令可以同时跑。 对话界面里看到的仍然是每一次工具调用,比如编辑的 diff。想看背后的代码,按 Ctrl+O 打开记录,展开 Code 行就能看到。 # 门槛和限制 开启方法是设置 CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1,可以在 shell 里临时设,也可以写进 ~/.claude/settings.json。写在项目的设置文件里不生效,所以克隆下来的仓库没法替你偷偷打开它。第一次开启时,Claude Code 会先请你确认。 限制不少: · 只能在终端的交互式会话里用,不支持 -p、Agent SDK、VS Code 面板、桌面端和云端会话。 · 不能走网关、Bedrock、Google Cloud 或 Microsoft Foundry,也不能用 API key helper。 · 只支持 Opus 5.5、Sonnet 5.5、Haiku 5.5 和 Fable 5.2。 · 开着 agent teams、OpenTelemetry 导出或 DISABLE_TELEMETRY 时无法启动。 · 用 Code Mode 开的会话,恢复时也必须开着 Code Mode。 · 代码在前台跑,最长 10 分钟;放到后台最长 2 小时,但要求会话在 auto 或 bypassPermissions 模式下启动。 # 权限怎么管 代码里的每一次工具调用,仍然要经过你的 deny、ask 规则和 PreToolUse hook。真正变化的是 auto 模式:分类器现在审的是整段代码,不再一次次审单个调用,而且看不到运行时才算出来的值,比如从搜索结果里取出的路径。官方明确建议,必须管住的调用要靠规则或 hook 兜底。想审代码本身,可以写一个匹配 REPL 的 hook,从 tool_input.code 读出 JS。企业可以在托管设置里把这个变量设成 0,全员禁用。📊 3 ⚡

Industry Coordinates & Source Verification

This report is categorized under AITOP's "Products" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include Claude Code, Claude, coding assistants, MCP and tools.

Source attribution: curated from shao__meng (@shao__meng). Cross-source corroboration: 11 independent sources have covered this development (including lmarena.ai, kimmonismus, Perplexity), confirming industry-wide signal strength.