Anthropic is testing a new way of agentic work in Claude Code: in the experimental Code Mode, the model does not call Bash, Read, and Edit in sequence, but writes a single JavaScript script that is executed within the session. The mode appeared in the v2.1.323 release, is enabled by a single environment variable, and is currently available only in interactive terminal sessions with a Claude subscription or Console account.

image
image

What happened

Code Mode was released in Claude Code v2.1.323 on November 12, 2026; in the release notes, it is described as an experimental opt-in mode in which Claude writes JavaScript to invoke its own tools. In this mode, the model generates a single script instead of a chain of Bash, Read, and Edit calls, and Claude Code executes it directly within the session: commands can run in parallel, the result of one call is passed to the next without a new model turn, and only the fields needed for the response are returned to the context instead of the raw tool output. The mode is enabled by the environment variable CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 via the shell or ~/.claude/settings.json; in project-level settings, the variable is intentionally ignored so that a repository cannot enable it without the user's knowledge. Requirements: Claude Code v2.1.323 or newer, an active Claude subscription or Console account, Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.2 models, and an interactive terminal session. The mode does not work via gateway, Bedrock, AWS, Google Cloud Agent Platform, or Microsoft Foundry, nor with -p, Agent SDK, the VS Code panel, Desktop app, or cloud sessions.

Context

The standard agentic loop in CLI tools is built step-by-step: the model calls one tool, reads its raw JSON output into the context, reasons again, and makes the next call. On tasks where calls depend on each other — finding files, reading them, making edits — such a loop stretches over many model turns, and the context fills up with unprocessed data. Code Mode does not change the model itself: the supported set — the same Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.2 — has not been updated; what changes is the execution layer, where the generated code becomes an intermediate link between the model and the tools. This explains the narrow surface of applicability: the feature is tied to the session infrastructure of Claude Code specifically, so it is not available via gateway or cloud platforms. The security model also changes: in auto mode, the classifier checks the entire JS block as a whole, rather than each tool call separately.

Why this matters for the industry

For developers of agentic systems, Code Mode is a working example of the "code as an intermediate layer" pattern: one generated script instead of N turns of the "tool call — read output — reason" cycle. Mechanically, this affects two sources of overhead simultaneously — the number of model turns and the amount of context occupied by raw tool outputs — so in multi-step scenarios with mass file edits, filtered searches, and parallel commands, the number of LLM calls is reduced. The unit economics of agentic products improve here not through a new model, but through the restructuring of orchestration, meaning the pattern is reproducible in other frameworks. At the same time, the feature shows a boundary: the implementation is tied to the session infrastructure of Claude Code, and porting to Agent SDK and cloud runtimes is not yet supported. If the pattern takes hold, the focus of competition will shift to how convenient it is for models to write code for orchestration, and tool schemas will have to be designed for composition, not just for JSON calls.

Why this matters for users

You can try the mode today: simply update Claude Code to v2.1.323 or newer, have an active Claude subscription or Console account, and set CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 in the shell or in ~/.claude/settings.json — the option from project-level settings is designed not to work. The greatest effect is seen in tasks with a large number of related tool calls: mass file edits, filtered searches, parallel commands; it is worth measuring the number of turns and context volume before and after to assess the difference in your scenarios. Consider the beta limitations: Claude in Chrome, computer use, and Remote Control do not work, a saved session resumes only with the mode enabled, and an organization can block it via Managed Settings. Due to the unavailability of -p, Agent SDK, the VS Code panel, Desktop app, and cloud sessions, it is not yet advisable to migrate production automation to Code Mode.

What is currently unknown / limitations

Anthropic's public materials contain no numbers regarding the benefit: there are no measurements of tokens, latency, or cost, and no comparison of Code Mode with the classic cycle on the same set of tasks. The thesis about savings is plausible mechanically, but the actual scale on specific tasks will only be shown by the user's own paired measurements. The mode remains experimental with a deliberately narrow surface of applicability — interactive terminal, specific account and model types — and its behavior in real production pipelines has not been tested, as such scenarios are not supported. The change in the granularity of safety checks in the experimental mode is a trade-off, the consequences of which for detecting unsafe actions are not disclosed in the documentation. The only sources of details currently remain the Claude Code documentation and release notes on GitHub.

Sources

Author

Look at AI, editorial team