Claude Code tests Code Mode, where Claude writes JavaScript to call tools
Code Mode arrived in Claude Code v2.1.323 as an experimental opt-in; by v2.1.331 it also works on Amazon Bedrock, Google Cloud and Microsoft Foundry.

TL;DR
- In Code Mode, Claude writes JavaScript that makes its tool calls and processes the results, instead of requesting the tools directly [1][4].
- It is experimental, off by default and turned on with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 [4].
- v2.1.331 added support in terminal sessions on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and Claude Platform on AWS [3].
Anthropic added Code Mode to Claude Code in v2.1.323, released on 12 November 2026. It is an experimental opt-in in which Claude writes JavaScript to call its tools [1]. Over the next releases, Anthropic let it run alongside agent teams in v2.1.326 [2]. In v2.1.331, released on 23 November, it added Code Mode support in terminal sessions on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry and Claude Platform on AWS [3].
Why it matters
Without Code Mode, Claude asks for tool calls such as Bash, Read or Edit directly and reads each result before it decides what to do next [4]. In Code Mode, Claude writes a piece of code that makes the calls, and Claude Code runs it in the session [4]. One piece of code can run commands in parallel, feed one result into the next call and return only the part of the output Claude needs [4]. The docs suggest it for tasks with many related calls: the same change across many files, searches whose results need filtering, or independent commands that can run at once [4]. Since v2.1.331, teams that reach Claude through a cloud provider such as Amazon Bedrock can try it too [3][4].
How to turn it on
Users set the environment variable CLAUDE_CODE_EXPERIMENTAL_CODE_MODE to 1 and confirm a dialog on the first session [4]. Claude Code ignores this variable in a project’s settings files, so a cloned repository cannot switch it on [4]. In the conversation, users see the tool calls but not the code; Ctrl+O opens the transcript viewer, where each piece of code shows as a collapsed Code row [4]. Admins can block it for an organization by setting the variable to 0 in managed settings; if users can connect through a cloud provider, the docs say to deploy that setting through MDM or a managed settings file [4]. Users already in a Code Mode session stay in it until they exit or restart Claude Code [4].
In auto mode, the classifier reviews each piece of code before it runs rather than each tool call. It does not see values computed at run time, so the docs advise keeping permission rules or hooks for calls that must be controlled [4].
Limits
Code Mode may change or be removed in any release [4]. It needs Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2, the native build, and an interactive terminal session; it does not work in the VS Code panel, the Desktop app or cloud sessions [4]. It is not available through a gateway, with Claude for Government, or for organizations with HIPAA or zero data retention settings [4]. A Code Mode session can be resumed only with Code Mode on, and code that cannot run in the background stops after ten minutes [4]. Remote Control, Claude in Chrome and computer use are not available in it [4].
Sources
Written and checked by AI from the sources below
- Claude Code v2.1.323 release notes
- Claude Code v2.1.326 release notes
- Claude Code v2.1.331 release notes
- Run tool calls from code with Code Mode
Fact-checked by gpt-6.1-sol on · Editorial policy



