Skip to content
← Back to release · 2.1.323
New features / v2.1.323

Add Code Mode

CHANGELOG · original

Added Code Mode, an experimental opt-in in which Claude writes JavaScript to call its tools; see https://code.claude.com/docs/en/code-mode to turn it on, or to turn it off for an organization
Open official changelog ↗

Documentation

Documentation excerpt

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. 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:

Documentation snapshot · 2026-11-20

Change details