2026-11-26 15:47 UTC

Anthropic documents experimental Claude Code Mode

state: significantheat: lowuncertainty: mediumrelevance: highclaude-code agent-integration coding-agentsAnthropic

What is this?

Anthropic documents Code Mode as an experimental, off-by-default feature in Claude Code. It lets Claude write JavaScript that runs several tool calls in one step, including parallel calls and sequences where one result informs the next; the user sees the tool calls, while the generated code is available in the transcript viewer. The supplied official documentation says it requires Claude Code v2.1.323 or later, a supported model and an interactive terminal session, and is unavailable on several other surfaces and through several third-party providers. The sole supplied source is an official documentation page linked from a Hacker News post; the search results add no independent confirmation or adoption evidence.

Why it matters

Code Mode offers a notable new way for a coding agent to coordinate tools and compress returned results, with potential efficiency gains and a distinct permission-review tradeoff. Its experimental status and restricted availability make real-world impact uncertain, but the capability is worth tracking for AI enthusiasts.

Current assessment

Anthropic’s official Claude Code documentation describes Code Mode as an experimental, off-by-default feature in which Claude writes JavaScript to batch and sequence tool calls, including parallel calls and calls dependent on earlier results, and return selected output. It could reduce orchestration overhead on multi-step coding tasks, but supplied evidence establishes no measured gains, reliability or safety outcomes, or adoption. The documentation restricts availability by version, supported model, interactive terminal session, and account route; permission rules and hooks still apply, while auto-mode review evaluates generated code rather than each call and cannot inspect runtime-computed values. The feature may change or be removed. Later Hacker News posts repeat or discuss the feature but provide no substantive independent confirmation or implementation evidence; engagement is low and past its peak. Track availability and practical performance or safety evidence.

Measured heat

now 0 pts/hpeak 12 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 267h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-15 12:23 (minted)⭐ origin echo-reconstructedThe documentation page appears to be the primary announcement/source: “Try Code Mode, an experimental feature in which Claude writes JavaScr
Anthropic on other (echo) · attributed from hn.story.50506338 · published time unknown
—
11-15 12:08first on hacker news · published · lag ?Codemode in Claude Code
vindex10
—
11-15 12:08amplified on hacker news 👑hn.story.50506338
vindex10
peak 4 · 0 comments · 40% of case engagement
11-17 21:20amplified on hacker newshn.story.50538346
mfiguiere
peak 4 · 0 comments · 40% of case engagement
11-22 17:56amplified on hacker newshn.story.50602092
franze
peak 1 · 0 comments · 10% of case engagement
11-23 12:58amplified on hacker newshn.story.50610977
muthuishere
peak 1 · 0 comments · 10% of case engagement
11-15 12:21our radar first saw it · lag ?discovery anchor: hn.story.50506338—
pace: p38 vs 2096 stories at the 168h mark (now 267h old) — ahead of adobe-max-ai-agents-creative-tools-mcp (1.5x), behind 42loop-agent-operated-product-experiment (0.8x)

Evidence (5) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnCodemode in Claude Code
Retrieved article excerpt

Open article · Retrieved 2026-11-15T12:22:06.008192+00:00

Model and responses

# Run tool calls from code with Code Mode

Copy pageCopy page

Try Code Mode, an experimental feature in which Claude writes JavaScript that makes several tool calls in one step.

Copy pageCopy page

Code Mode changes how Claude uses its [tools](https://code.claude.com/docs/en/tools-reference). 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. With Code Mode, Claude writes a piece of JavaScript that makes the tool calls, and Claude Code runs that code in your session.

Code Mode is experimental and off by default. It may change or be removed in any release. To share feedback, run `/feedback`.

## How Code Mode works

In a Code Mode session, you still describe your task in a prompt, and Claude writes JavaScript to carry it out. One piece of code can run commands in parallel, use one result in the next call, and return the part of the output that Claude needs to read.
For example, if you ask Claude to raise a retry limit, Claude might write this code to find the file, edit it, and run the tests. The last line returns the file’s path and the test output to Claude:

```
const files = await $`rg -l "function retryPolicy" src`.text();
const target = files.trim().split("\n")[0];
await edit(target, "maxAttempts: 3", "maxAttempts: 5");
({ edited: target, tests: $`npm test -- retryPolicy`.nothrow() });
```

In the conversation, you see the tool calls, such as the edit’s diff, and not the code. To read the code, press `Ctrl+O` to open the [transcript viewer](https://code.claude.com/docs/en/interactive-mode#transcript-viewer). Each piece of code appears there as a collapsed **Code** row, with a hint for how to expand it.

### When to use Code Mode

Try Code Mode on tasks that take many related tool calls, such as:

- 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

### Code Mode limitations

Before you turn on Code Mode, check that you can accept these limits:

- **Resuming**: you can resume a Code Mode session only in the terminal, with Code Mode on
- **Auto mode**: auto mode’s classifier [reviews the code, not each tool call](https://code.claude.com/docs/en/code-mode#permission-checks)
- **Long-running code**: unless [code can run in the background](https://code.claude.com/docs/en/code-mode#long-running-code), you wait for it to finish, and it stops after ten minutes
- **Hooks**: you can see [tool calls refused](https://code.claude.com/docs/en/code-mode#tool-call-refused-by-a-hook) when a `PreToolUse` hook can’t run or times out, and [code output blocked](https://code.claude.com/docs/en/code-mode#code-output-withheld-by-a-hook) by a `UserPromptSubmit` hook
- **Unavailable features**: you can’t use [Remote Control](https://code.claude.com/docs/en/remote-control), [Claude in Chrome](https://code.claude.com/docs/en/chrome), or [computer use](https://code.claude.com/docs/en/computer-use)
- **Moving the session**: you can’t move the session to the Desktop app or turn it into a [background session](https://code.claude.com/docs/en/agent-view), and `/fork` can’t start a background copy

## Requirements

- **Version**: Claude Code v2.1.323 or later, on either [release channel](https://code.claude.com/docs/en/setup#configure-release-channel). An older version starts without Code Mode, with or without the reason `it isn't open to your account yet`
- **Account**: a Claude subscription or Console account. You can’t use Code Mode through a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry
- **Organization**: your organization doesn’t use the [HIPAA configuration](https://code.claude.com/docs/en/hipaa-setup) or [zero data retention](https://code.claude.com/docs/en/zero-data-retention)
- **Model**: Claude Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.2
- **Surface**: an interactive `claude` session in a terminal. Code Mode doesn’t work with `-p`, the Agent SDK, the VS Code panel, the Desktop app, or cloud sessions
- **Installation**: the [native build](https://code.claude.com/docs/en/setup) of Claude Code
- **Windows**: [Git for Windows](https://git-scm.com/downloads/win) is installed

You also can’t start Code Mode with some settings on, such as an API key helper, agent teams, OpenTelemetry export, or `DISABLE_TELEMETRY`. For the fix for each, see [Code Mode doesn’t start](https://code.claude.com/docs/en/code-mode#code-mode-doesnt-start).

## Try Code Mode

Turn on Code Mode, give Claude a task, and look at the code that Claude wrote.

1

Check your version

Run `claude --version`. If the version is older than v2.1.323, run `claude update`. If you’re on the `stable` channel and the update doesn’t reach v2.1.323, wait for `stable` to catch up or [switch to `latest`](https://code.claude.com/docs/en/setup#configure-release-channel).

2

Start Claude Code with Code Mode on

Set the [`CLAUDE_CODE_EXPERIMENTAL_CODE_MODE`](https://code.claude.com/docs/en/env-vars#variables) environment variable to `1`. To try Code Mode, set it in your shell. To turn on Code Mode for every new session, set it in your user settings.

- macOS, Linux, WSL
- Windows PowerShell
- settings.json

```
CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude
```

```
$env:CLAUDE_CODE_EXPERIMENTAL_CODE_MODE = "1"
claude
```

Save this `env` block in `~/.claude/settings.json` and start `claude`:

```
{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_CODE_MODE": "1"
  }
}
```

Claude Code [ignores this variable in a project’s settings files](https://code.claude.com/docs/en/settings-reference#variables-claude-code-ignores-in-env), so a repository you clone can’t turn on Code Mode for you.

3

Confirm that you want Code Mode

Claude Code asks you to confirm before your first Code Mode session. Select **Yes, turn on Code Mode**. Claude Code restarts and shows this line near the top of the session:

```
Code Mode (experimental) is on · this session can be resumed only with Code Mode on
```

If you see a different line or none, see [Code Mode doesn’t start](https://code.claude.com/docs/en/code-mode#code-mode-doesnt-start).

4

Give Claude a task with many tool calls

In a project you know, send a prompt such as this one:

```
Read every Markdown file in this project and list the links that point to local files that don't exist.
```

5

Read the code Claude wrote

Press `Ctrl+O` and expand a **Code** row to see the JavaScript behind the tool calls. Press `Ctrl+O` again to return to the conversation.

To resume a Code Mode session later, keep `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE` set to `1` when you run `claude --continue` or `claude --resume`. With Code Mode off, Claude Code refuses to resume the session. Sessions that you started without Code Mode resume without Code Mode, even with the variable set.

### Turn off Code Mode

Remove `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE` from your shell and from `~/.claude/settings.json`, then start a new session. You can also keep the variable and change its value to `0` in either place. With a `0` in one place, Code Mode stays off even if you set `1` in the other.

### Block Code Mode for your organization

Add `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE` with the value `0` to your [managed settings](https://code.claude.com/docs/en/managed-settings) so that nobody in your organization can use Code Mode:

```
{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_CODE_MODE": "0"
  }
}
```

Users who are in a Code Mode session stay in it until they exit or restart Claude Code. After that, your users start without Code Mode and can’t resume their Code Mode sessions while the `0` is in place. You can’t turn on Code Mode for your users from managed settings.

## Permissions and long-running code

Your permission mode decides how Claude’s code is checked and whether you can talk to Claude while the code runs.

### Permission checks

Each tool call that Claude’s code makes goes through your `deny` and `ask` [permission rules](https://code.claude.com/docs/en/permissions) and your [`PreToolUse` hooks](https://code.claude.com/docs/en/hooks#pretooluse). You don’t need to change a rule or matcher for a tool such as `Bash`. Beyond rules and hooks, a classifier reviews the code in auto mode, and you answer prompts in the modes that ask:

- **[Auto mode](https://code.claude.com/docs/en/permission-modes#eliminate-prompts-with-auto-mode)**: the classifier reviews each piece of code before it runs, not each tool call. It doesn’t see values computed at run time, such as a path taken from search output, so keep rules or hooks for calls you must control. You can still be [prompted when new code starts while earlier code runs](https://code.claude.com/docs/en/code-mode#permission-prompt-with-a-countdown)
- **Other [permission modes](https://code.claude.com/docs/en/permission-modes)**: the code starts without a review, and you’re prompted for each tool call that would prompt you in that mode

To check the code itself, write a `PreToolUse` hook that matches `REPL`, the tool that runs Claude’s code, and read the JavaScript from `tool_input.code`.

Bash rules match command text, so Claude can run a denied command [in a form the rule doesn’t match](https://code.claude.com/docs/en/permissions#bash-rule-limits), with or without Code Mode. For limits that don’t depend on command text, see [sandboxing](https://code.claude.com/docs/en/sandboxing).

### Long-running code

While code runs a long build or test, Claude either waits for it or lets it continue in the background:

- **Waiting**: Claude answers after the code finishes, and the code stops after ten minutes, including time you spend at permission prompts
- **Background**: you can keep talking to Claude, and the code can run for up to two hours

For background code, start your session in auto or `bypassPermissions` mode. If Claude still waits, check your current mode and how you started the session:

- **You switched to another mode**: press `Shift+Tab` until you’re back in the mode you started in
- **You started in another mode, or picked the session from the `claude --resume` list**: if [auto mode is available](https://code.claude.com/docs/en/permission-modes#eliminate-prompts-with-auto-mode) to you, exit, then run `claude --continue --permission-mode auto` with Code Mode on
- **You passed tool names to `--tools`**: start again in auto mode without that flag

## Troubleshooting

### Code Mode doesn’t start

`Code Mode (experimental) isn't available` near the top of the session means that Claude Code started without Code Mode. The reason follows on the same line, and `/status` shows it too. Find the reason in this table, make the change, and start a new session. For a reason that isn’t listed, check the [requirements](https://code.claude.com/docs/en/code-mode#requirements).


| Reason includes | What to do |
| --- | --- |
| `it isn't open to your account yet` | If your version is older than v2.1.323, [update](https://code.claude.com/docs/en/code-mode#try-code-mode). Otherwise, check your network connection and start again. If the reason stays, try again another day |
| `it only works with the Anthropic API` | Remove the settings that route requests through a cloud provider, a gateway, or a custom `ANTHROPIC_BASE_URL` |
| `it doesn't work with an API key helper` | Remove `apiKeyHelper`, `ANTHROPIC_AUTH_TOKEN`, and any `Authorization` or `X-Api-Key` header in `ANTHROPIC_CUSTOM_HEADERS`. Then sign in or set `ANTHROPIC_API_KEY` |
| `it only works with Opus 5.5, Sonnet 5.5 and later models` | Start with a [supported model](https://code.claude.com/docs/en/code-mode#requirements), for example with `--model opus`. Haiku 5.5 and Fable 5.2 also work |
| `it doesn't work in background jobs` | Start in the foreground, without `--remote-control` |
| `it needs settings that Claude Code downloads from Anthropic` | Unset the variable that [turns off feature-flag
vindex1040
🟧 echo.other ⭐The documentation page appears to be the primary announcement/source: “Try Code Mode, an experimental feature in which Claude writes JavaScrAnthropic——
🟧 hnRun tool calls from code with Code Modemfiguiere40
🟧 hnRun tool calls from code with Code Modefranze10
🟧 hnClaude Code Mode Internalsmuthuishere10

Interpretation history

Decision trace