What changed on 23 November

Anthropic shipped Claude Code v2.1.331 on 23 November 2026. The first item in its release notes adds Code Mode support for terminal sessions running through Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and Claude Platform on AWS. Until this release, the feature only worked for people signed in with a Claude subscription or a Console account talking directly to Anthropic's API.

That matters to a lot of New Zealand teams. Many organisations here buy model access through their existing cloud contract so procurement, billing and data residency reviews stay in one place. Those developers couldn't try Code Mode at all for the first eleven days after it appeared. Now they can, as long as they meet the other requirements.

One thing to watch: when we checked the Code Mode documentation on 24 November, its requirements section still listed Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform and Microsoft Foundry as unsupported. The release notes are newer, so we expect the docs to catch up. If you hit the startup message saying Code Mode "only works directly with the Anthropic API", first check that you've updated to v2.1.331. Gateways and custom ANTHROPIC_BASE_URL setups aren't named in the new release, so we'd assume they're still excluded.

How Code Mode works

In a normal Claude Code session, the model asks for one tool at a time (a shell command, a file read, an edit), waits for the result to come back into its context, then decides on the next step. Every one of those round trips costs a model turn and fills the context window with raw output.

Code Mode changes the unit of work. Claude writes a short JavaScript program, and Claude Code executes it locally inside your session. That program can call the same tools Claude would normally call, run independent commands side by side, pass the output of one step into the next, and hand back only the slice of data the model actually needs to see. The documentation's example finds a file with ripgrep, edits a retry setting, runs the matching tests and returns just the file path and test results.

You still see the individual actions in the chat, such as an edit's diff. The JavaScript itself sits in the transcript viewer, which opens with Ctrl+O, where each script shows up as a collapsible Code row.

The idea isn't new at Anthropic. Its November 2025 engineering post on advanced tool use introduced Programmatic Tool Calling on the Claude API, where Claude writes Python that runs in a remote sandbox. On complex research tasks, average token use there fell from 43,588 to 27,297, a 37% cut, and the post noted that bundling 20 or more calls into one block removes 19 or more inference passes. InfoQ points out the key difference: the API feature runs in a hosted container, while Claude Code's version runs on your own machine against the built-in tools and permission system.

A short history of the feature

  • v2.1.323, 12 November: Code Mode arrived as an opt-in experiment.
  • v2.1.326: it started working alongside agent teams.
  • v2.1.328: Anthropic removed a 0.75 second pause after most scripts in auto and bypass modes and shortened tool descriptions to save tokens. It also stopped feeding script output to UserPromptSubmit hooks.
  • v2.1.329: it could be switched on while OpenTelemetry events and metrics were enabled, and a cap now stops runaway loops before they exhaust memory.
  • v2.1.331, 23 November: cloud provider support, plus fixes for resumed sessions losing thinking and the prompt cache, a bug that sent a request about every second while a script ran, and long script output losing its middle section (Claude now gets a path to the full text).

That's a busy changelog for two weeks, which tells us the feature is still settling.

Limits to know before you switch it on

Code Mode is off by default, and Anthropic says it may change or disappear in any release. To try it, you need:

  • the native build of Claude Code at v2.1.323 or later (v2.1.331 for the cloud providers);
  • an interactive terminal session, since the VS Code panel, Desktop app and cloud sessions aren't supported;
  • Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2;
  • an organisation that isn't on the HIPAA configuration or zero data retention.

You turn it on by setting CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 in your shell or in ~/.claude/settings.json. Claude Code ignores that variable in project settings, so a cloned repo can't switch it on behind your back. Admins can block it for everyone by setting the value to 0 in managed settings.

Other constraints:

  • A script Claude waits on is stopped after ten minutes. In auto or bypassPermissions mode, scripts can keep going in the background for up to two hours while you keep chatting.
  • You can only resume a Code Mode session from the terminal with the variable still set.
  • Remote Control, Claude in Chrome and computer use don't work in Code Mode sessions.
  • An API key helper blocks startup, which is worth checking on cloud setups that rely on one.

Security and permissions

Each tool call a script makes still passes through your deny and ask rules and your PreToolUse hooks under its usual name, like Bash. In auto mode, the classifier looks at the whole script before it runs. Because it can't see values that only appear at run time, such as a file path pulled from search results, the docs advise keeping rules or hooks for anything you must control.

Your sandbox covers the shell commands a script launches. The JavaScript runtime and its file, web and MCP calls run outside that sandbox, so teams wanting full isolation should run Claude Code in a container or VM. Shell hooks also need to inspect every part of a compound command, since a push from a subfolder can arrive as cd 'app' && git push.

Costs and what the numbers say

Anthropic hasn't published token or latency figures for Code Mode in Claude Code. The best independent data we found is one developer's test reported by InfoQ: across eight interactive Sonnet 5.5 runs, results matched every time and context came out 20 to 25% smaller. On a bigger task, tokens dropped 37% and cost dropped 19%. It wasn't faster, and on a tiny task it cost more. That's a single small sample, so treat it as a hint rather than a benchmark. On Bedrock, Foundry or Google Cloud, any savings will show up in your cloud provider bill at that provider's token rates.

What builders can do with it

Code Mode suits jobs made of many related tool calls: the same change across dozens of files, a search whose results need trimming before Claude reads them, or a batch of independent commands. For cloud-billed teams, we'd suggest:

  1. Update to v2.1.331 and enable the variable in a personal shell first, on a repo you know well.
  2. Add an ask rule for REPL, the tool that runs scripts, so you can read each script before it runs.
  3. Use a PostToolUse hook on REPL to redact secrets from script output, and leave OTEL_LOG_TOOL_DETAILS unset if your telemetry backend shouldn't see them.
  4. Compare token use on a few real tasks against normal mode before rolling it out.
  5. If you aren't ready, block it in managed settings until the docs and feature settle.

The MCP debate is worth a look too. Ravi Madabhushi told InfoQ that batching calls in code "doesn't materially change anything wrt authentication, authorization and audit policy layers". Your access controls still need the same design work.

Sources

Build with people working on the same things

Join the Auckland Society for AI: NZ$599 a year with a ForgeBox and the members' projects area. Our Auckland meetups are open to everyone.

Become a member