{"id":251248,"date":"2026-11-23T12:45:09","date_gmt":"2026-11-23T12:45:09","guid":{"rendered":"https:\/\/www.europesays.com\/ai\/251248\/"},"modified":"2026-11-23T12:45:09","modified_gmt":"2026-11-23T12:45:09","slug":"claude-code-adds-experimental-code-mode-to-orchestrate-tool-calls-with-javascript","status":"publish","type":"post","link":"https:\/\/www.europesays.com\/ai\/251248\/","title":{"rendered":"Claude Code Adds Experimental Code Mode to Orchestrate Tool Calls with JavaScript"},"content":{"rendered":"<p>Anthropic has added <a href=\"https:\/\/code.claude.com\/docs\/en\/code-mode\" rel=\"nofollow noopener\" target=\"_blank\">Code Mode<\/a> to Claude Code, an experimental feature in which the model writes JavaScript to drive its tools instead of requesting each Bash, Read, or Edit call separately. Code Mode is off by default, requires Claude Code v2.1.323 or later, and is enabled with the CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 environment variable. Anthropic warns it may change or be removed in any release.<\/p>\n<p>In a normal session, Claude asks for one tool call, reads the full result, and decides the next step. In <a href=\"https:\/\/code.claude.com\/docs\/en\/code-mode\" rel=\"nofollow noopener\" target=\"_blank\">Code Mode<\/a>, one script can run commands in parallel, pass one result into the next call, and return only the output the model needs. The documentation&#8217;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.<\/p>\n<p>The permission model is the part architects should read first. Each call inside a script still goes through deny and ask rules and <a href=\"https:\/\/code.claude.com\/docs\/en\/hooks\" rel=\"nofollow noopener\" target=\"_blank\">PreToolUse hooks<\/a>, but in <a href=\"https:\/\/code.claude.com\/docs\/en\/permission-modes\" rel=\"nofollow noopener\" target=\"_blank\">auto mode<\/a> the classifier reviews the script before it runs, not each call, and cannot see values computed at run time. A git push can now reach a hook as cd &#8216;app&#8217; &amp;&amp; git push, so hooks must check every part of a command; a hook matching the REPL tool can read the JavaScript from tool_input.code. Project settings cannot enable Code Mode, so a cloned repository cannot switch it on, and administrators can block it through managed settings.<\/p>\n<p><a href=\"https:\/\/code.claude.com\/docs\/en\/code-mode\" rel=\"nofollow noopener\" target=\"_blank\">Code Mode<\/a> 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.<\/p>\n<p><a href=\"https:\/\/x.com\/bolyki\/status\/2123068346224509366\" rel=\"nofollow\">George (@bolyki)<\/a> compared Code Mode with normal mode across eight interactive Sonnet 5.5 runs and posted:<\/p>\n<p>&#13;<\/p>\n<p>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.<\/p>\n<p>&#13;<\/p>\n<p><a href=\"https:\/\/x.com\/ravibits\/status\/2123128487125123166\" rel=\"nofollow\">Ravi Madabhushi<\/a>, who builds agent auth infrastructure, pushed back on claims that the feature makes MCP obsolete:<\/p>\n<p>&#13;<\/p>\n<p>It doesn&#8217;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.<\/p>\n<p>&#13;<\/p>\n<p>The idea, and the name, predate Anthropic&#8217;s release. Cloudflare introduced <a href=\"https:\/\/blog.cloudflare.com\/code-mode\/\" rel=\"nofollow noopener\" target=\"_blank\">Code Mode for MCP<\/a>\u00a0converting MCP tools into a TypeScript API that models code against inside sandboxed Workers, where bindings keep API keys away from generated code. Anthropic&#8217;s own post on <a href=\"https:\/\/www.anthropic.com\/engineering\/code-execution-with-mcp\" rel=\"nofollow noopener\" target=\"_blank\">code execution with MCP<\/a> described one workflow dropping from 150,000 to 2,000 tokens, and the Claude API offers <a href=\"https:\/\/platform.claude.com\/docs\/en\/agents-and-tools\/tool-use\/programmatic-tool-calling\" rel=\"nofollow noopener\" target=\"_blank\">programmatic tool calling<\/a> in a remote code execution container. Code Mode instead runs the script in the developer&#8217;s local session, against Claude Code&#8217;s built-in tools and permission system.<\/p>\n<p>Code Mode remains opt-in and experimental, and Anthropic collects feedback through \/feedback. Setup steps and troubleshooting are in the <a href=\"https:\/\/code.claude.com\/docs\/en\/code-mode\" rel=\"nofollow noopener\" target=\"_blank\">Claude Code documentation<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Anthropic has added Code Mode to Claude Code, an experimental feature in which the model writes JavaScript to&hellip;\n","protected":false},"author":2,"featured_media":251249,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[24,53,3154,25,182,110896,10344,1642,634,641],"class_list":["post-251248","post","type-post","status-publish","format-standard","has-post-thumbnail","category-anthropic","tag-ai","tag-anthropic","tag-anthropic-claude","tag-artificial-intelligence","tag-claude","tag-claude-code-mode","tag-javascript","tag-large-language-models","tag-ml-data-engineering","tag-software-development"],"_links":{"self":[{"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/posts\/251248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/comments?post=251248"}],"version-history":[{"count":0,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/posts\/251248\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/media\/251249"}],"wp:attachment":[{"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/media?parent=251248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/categories?post=251248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/tags?post=251248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}