Claude Code Code Mode: Power-User Guide to Setup, Permissions and Limits

Last updated: November 14, 2026

Claude Code Code Mode is an experimental opt-in feature added in Claude Code 2.1.323 on November 12, 2026. Instead of calling tools one at a time, Claude writes JavaScript that runs several tool calls in one step, in parallel or in sequence, and returns only the output it needs. It is off by default.

This guide covers how Code Mode works, requirements, setup, permissions and limits. Details come from Anthropic’s Code Mode documentation and the Claude Code changelog.

Contents

How Code Mode works

Without Code Mode, Claude requests tool calls such as Bash, Read or Edit directly and reads each result before choosing the next step. With Code Mode, Claude writes a piece of JavaScript that makes those calls, and Claude Code runs it through a tool named REPL.

One program can run commands in parallel, feed one result into the next call and return only the part of the output that matters. Anthropic’s four-line example finds a file with rg, edits a retry limit and runs the matching tests.

In the conversation you see the tool calls, such as an edit’s diff, rather than the code. Press Ctrl+O to open the transcript viewer, where each program appears as a collapsed Code row.

Anthropic recommends trying Code Mode on tasks that need many related tool calls:

  • A change that repeats across many files.
  • A search whose results need filtering before Claude reads them.
  • Several independent commands that can run at the same time.

Requirements and availability

Code Mode has narrower requirements than most Claude Code features. The table summarizes what the requirements section lists.

Requirement Supported Not supported
Version v2.1.323 or later, on either release channel Older versions
Account Claude subscription or Console account Gateways, Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, Microsoft Foundry
Models Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2 Earlier models
Surface Interactive claude session in a terminal, native build -p, Agent SDK, VS Code panel, Desktop app, cloud sessions
Organization Standard configurations HIPAA configuration, zero data retention
Windows Git for Windows installed Without Git for Windows

Code Mode also refuses to start with an API key helper, agent teams, OpenTelemetry export or DISABLE_TELEMETRY turned on. If your version is current but the start-up line says it isn't open to your account yet, the documentation suggests checking your connection and trying again another day.

How to turn on Code Mode

  1. Check your version. Run claude --version. If it is older than v2.1.323, run claude update. On the stable channel, wait for it to catch up or switch to the latest channel.
  2. Set the environment variable. Start a session with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude. On Windows PowerShell, set $env:CLAUDE_CODE_EXPERIMENTAL_CODE_MODE = "1" and run claude.
  3. Make it permanent if you like. Add {"env": {"CLAUDE_CODE_EXPERIMENTAL_CODE_MODE": "1"}} to ~/.claude/settings.json. Claude Code ignores this variable in project settings, so a cloned repository cannot turn Code Mode on for you.
  4. Confirm the prompt. Select Yes, turn on Code Mode. After a restart, the session shows “Code Mode (experimental) is on”.
  5. Give Claude a multi-step task. Anthropic suggests a prompt such as asking Claude to read every Markdown file and list links to local files that do not exist.
  6. Review the code. Press Ctrl+O and expand a Code row to read the JavaScript behind the tool calls.

To resume a Code Mode session with claude --continue or claude --resume, keep the variable set to 1; with Code Mode off, Claude Code refuses to resume it. To turn the feature off, remove the variable or set it to 0. A 0 in either your shell or user settings wins over a 1 in the other.

Administrators can block Code Mode for everyone by setting the variable to 0 in Claude Code managed settings. Managed settings cannot turn it on for users.

Permissions and long-running code

Every tool call made from Claude’s code still goes through your deny and ask permission rules and your PreToolUse hooks. What changes depends on your permission mode:

  • Auto mode. The classifier reviews each program before it runs, not each tool call. It does not see values computed at run time, such as a path taken from search output, so keep rules or hooks for calls you must control.
  • Other modes. The code starts without review, and you are prompted for each tool call that would normally prompt you.

To inspect the code itself, write a PreToolUse hook that matches REPL and read the JavaScript from tool_input.code. Anthropic also warns that Bash rules match command text, so a denied command can run in a form the rule does not match; sandboxing is the stronger control.

Timing limits depend on the mode, as the table shows.

How code runs When it applies Time limit
Waiting (foreground) Default; Claude answers after the code finishes Ten minutes, including time at permission prompts
Background Session started in auto or bypassPermissions mode Up to two hours, and you can keep talking to Claude

If Claude starts new code in auto mode while earlier code is still running, the earlier code loses its classifier review, and Claude Code may show a prompt with a countdown of about two minutes. Unanswered calls are refused.

Limits and troubleshooting

  • Experimental status. Anthropic says Code Mode may change or be removed in any release.
  • Unavailable features. Remote Control, Claude in Chrome and computer use do not work in Code Mode, and the session cannot move to the Desktop app or become a background session.
  • Hooks. A PreToolUse hook that fails or times out on a call from code refuses the call unless you set "onFailure": "continue".
  • Early fixes. Version 2.1.325, released November 13, fixed Code Mode scripts that ignored a worktree entered with EnterWorktree, input typed with a permission approval not reaching Claude, and resumed sessions starting work on their own.

If Code Mode does not start, the session shows Code Mode (experimental) isn't available with a reason, also listed in /status. The documentation maps each reason to a fix.

How Code Mode compares

Code Mode arrived after the release covered in our Claude Code 2.1.318 guide. The approach is not unique to Anthropic: the OpenCode 2.3.0 release notes describe refinements to OpenCode’s own Code Mode, and our Browser Use 1.0 guide covers a browser agent built around a REPL. For background on how Claude Code stores context between sessions, see Does Claude Code have memory?, and check the Claude Code system requirements before installing the native build.

Frequently asked questions

What is Code Mode in Claude Code?

Code Mode is an experimental Claude Code feature added in version 2.1.323 on November 12, 2026. Instead of requesting each tool call separately, Claude writes a short JavaScript program that makes the calls, and Claude Code runs it in your session. It is off by default.

How do I turn on Code Mode in Claude Code?

Update to v2.1.323 or later, then start Claude Code with the environment variable CLAUDE_CODE_EXPERIMENTAL_CODE_MODE set to 1, either in your shell or in the env block of ~/.claude/settings.json. Confirm the prompt that asks you to turn it on.

Which models support Code Mode?

Anthropic’s documentation lists Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.2. Older models return the reason that Code Mode only works with Opus 5.5, Sonnet 5.5 and later models.

Does Code Mode work with Amazon Bedrock or an LLM gateway?

No. Code Mode needs a Claude subscription or Console account on the Anthropic API. It does not work through a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform or Microsoft Foundry, or with an API key helper.

Can administrators block Code Mode?

Yes. Set CLAUDE_CODE_EXPERIMENTAL_CODE_MODE to 0 in the env block of managed settings. Users finish any open Code Mode session, then start without it and cannot resume Code Mode sessions. Managed settings cannot turn Code Mode on for users.

Sources

Related answers

2 thoughts on “Claude Code Code Mode: Power-User Guide to Setup, Permissions and Limits”

Leave a Comment