AI Catchup

Claude Code Adds Experimental Code Mode for Chaining Tool Calls

By 5 min read

Claude Code's experimental Code Mode lets Claude write JavaScript to coordinate several tool calls in one step. It is opt-in and requires Claude Code v2.1.323 or later, an eligible Claude account, a supported model, and an interactive terminal. Some account settings, operating-system setups, and Claude Code surfaces are unsupported.

Anthropic's Claude Code v2.1.323 release notes introduced experimental Code Mode, an opt-in way for Claude to write JavaScript that coordinates several tool calls in one step. A script can run independent calls in parallel, pass one result into a later call, and return only the output Claude needs to read. Code Mode is off by default and may change or be removed in a future release. (Claude Code v2.1.323 release notes, Claude Code Code Mode documentation)

Key Takeaways

Code Mode is an opt-in for eligible Claude Code users who need to coordinate multiple tool calls. It requires the native build of Claude Code in an interactive terminal; the version and feature flag are not enough because Anthropic lists separate account, organization, model, installation, and surface requirements. Code Mode uses generated JavaScript, which you can inspect by pressing Ctrl+O and expanding the collapsed Code row in the transcript viewer. (Claude Code Code Mode documentation)

  • Version and access: Use Claude Code v2.1.323 or later with an eligible account and supported model. (Claude Code Code Mode documentation)
  • Control: Code Mode is off by default, asks for first-session confirmation, and stays off if an organization-managed setting sets the flag to 0. (Claude Code Code Mode documentation)
  • Review: Generated JavaScript appears as a collapsed Code row in the transcript viewer; press Ctrl+O and expand the row to inspect it. (Claude Code Code Mode documentation)
  • Surfaces: The feature requires the native build of Claude Code in an interactive terminal and does not work with claude -p, the Agent SDK, the VS Code panel, Desktop, or cloud sessions. (Claude Code Code Mode documentation)
  • Runtime: Foreground code stops after ten minutes; background code can run for up to two hours, but the entire Code Mode session cannot be converted into a background session. (Claude Code Code Mode documentation)

Claude Code displays the resulting tool calls in the conversation, while generated JavaScript appears as a collapsed Code row in the transcript viewer. Press Ctrl+O and expand the Code row to inspect that code. (Claude Code Code Mode documentation)

How to enable Code Mode

Use Claude Code v2.1.323 or later, then set CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 in your shell or user settings before starting a session. On macOS, Linux, or WSL, you can start an enabled session with the command Anthropic documents below. The first Code Mode session asks for confirmation. (Claude Code Code Mode documentation)

CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude

The feature flag is ignored in project settings, so a repository cannot enable Code Mode just because you cloned it. A managed setting of CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=0 disables the feature even if another setting sets it to 1; version and the flag alone do not guarantee eligibility. (Claude Code Code Mode documentation)

Requirements and unsupported surfaces

Code Mode requires an eligible Claude subscription or Console account, a native Claude Code installation, and an interactive terminal session. Anthropic lists Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.2 as supported models. Gateways and several cloud providers are unsupported, including Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform, Microsoft Foundry, and Anthropic-managed Claude Models on Google Cloud. (Claude Code Code Mode documentation)

Code Mode does not work with claude -p, the Agent SDK, the VS Code panel, the Desktop app, or cloud sessions. Organizations using the HIPAA configuration or zero data retention are also unsupported. Windows users need Git for Windows. (Claude Code Code Mode documentation)

Some additional startup settings can also block Code Mode, including an API key helper, OpenTelemetry export, or DISABLE_TELEMETRY. (Claude Code Code Mode documentation)

Remote Control, Claude in Chrome, and computer use are unavailable in Code Mode. A Code Mode session can be resumed only in a terminal with Code Mode enabled; it cannot be moved to the Desktop app or converted into a separate background session. (Claude Code Code Mode documentation)

Using Code Mode with agent teams requires Claude Code v2.1.326 or later. Teammates get Code Mode in the default in-process display mode, but not in split panes. (Claude Code Code Mode documentation)

Permissions and long-running work

Code Mode does not remove Claude Code's normal permission rules. Tool calls in generated code still pass through deny and ask rules and PreToolUse hooks. In auto mode, however, the classifier reviews the generated code rather than each individual tool call, and it cannot see values calculated at runtime. Anthropic recommends keeping rules or hooks for calls that need tighter control. (Claude Code Code Mode documentation)

Foreground code can keep Claude waiting until it finishes, but it stops after ten minutes. Background code can run for up to two hours while you continue the conversation; the session must have started in auto or bypassPermissions mode for this path. Background code execution is distinct from converting the whole Code Mode session into a background session, which is not supported. (Claude Code Code Mode documentation)

When to try it

Code Mode is most relevant when a task needs several connected reads or commands and Claude can reduce the returned output before acting on it. Anthropic's examples include repeated edits across files, searches whose results need filtering, and independent commands that can run together. Start with a task and repository you know, confirm the feature prompt, and inspect the generated code in the transcript before relying on the workflow. (Claude Code Code Mode documentation)

Sources

Related coverage

Frequently Asked Questions

How do I turn on Claude Code Code Mode?

Set CLAUDE_CODE_EXPERIMENTAL_CODE_MODE to 1 in your shell or user settings, then start an interactive Claude Code terminal session. The first session asks you to confirm the experimental feature, but an organization-managed value of 0 blocks Code Mode even when another setting enables it. ([Claude Code docs](https://code.claude.com/docs/en/code-mode))

Which Claude Code version and surfaces are supported?

Code Mode requires Claude Code v2.1.323 or later, the native build, and an interactive terminal session. It does not work with -p, the Agent SDK, the VS Code panel, the Desktop app, or cloud sessions; Windows use also requires Git for Windows. ([Claude Code docs](https://code.claude.com/docs/en/code-mode))

Can I resume or move a Code Mode session to another Claude Code surface?

A Code Mode session can be resumed only in a terminal with Code Mode enabled. Remote Control, Claude in Chrome, and computer use are unavailable, and the session cannot be moved into the Desktop app or converted into a separate background session. ([Claude Code docs](https://code.claude.com/docs/en/code-mode))

How does Code Mode work with agent teams and long-running code?

Using Code Mode with agent teams requires Claude Code v2.1.326 or later; teammates get Code Mode only in the default in-process display mode, not split panes. Background code can run for up to two hours while you keep talking, but the session must start in auto or bypassPermissions mode, and this does not turn the Claude Code session itself into a background session. ([Claude Code docs](https://code.claude.com/docs/en/code-mode))

Get an email when Claude Code changes its plans, prices or limits

We check every change against Claude Code's own pages before we send. You also get the weekly AI Catchup; one click unsubscribes.