Back to Explore
NewsVibeFix editorialUpdated Nov 20, 2026

Claude Code's new experiment, Code Mode: let the model write code to call tools — but don't switch it on in a hurry

Claude Code v2.1.323 adds experimental Code Mode: Claude writes a JavaScript snippet to call tools instead of going back and forth call by call. Off by default, terminal-only, and the classifier reviews the code rather than each call; v2.1.325 fixed three related bugs a day later. Anthropic gives no savings figure — don't pin the 37% on it.

A developer typing code on a laptop keyboard, the screen showing a dark-themed code editor

One changelog line changes how tools get called

On November 12, 2026, Claude Code shipped v2.1.323. The changelog is long, but the first line is the one worth stopping for: "Added Code Mode, an experimental opt-in in which Claude writes JavaScript to call its tools." No blog post, no launch event — just one changelog line and a new documentation page. That quiet entrance understates the change: it alters the basic way an agent calls tools.

Here is the mechanism. Without Code Mode, Claude issues tool calls one at a time: it calls Bash, reads the result, then decides what to do next. Reading twenty files and running three commands takes twenty-three round trips, with a model response between each one. With Code Mode, Claude writes a piece of JavaScript, and Claude Code runs that code in your session; the code can make many tool calls at once. The documentation puts it plainly: "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."

This is not a rename. The difference between one call at a time and one piece of code shows up in three places. First, parallelism: one piece of code can run several independent commands at the same time. Second, chaining: one step's result can feed directly into the next call without going back to the model first. Third, filtering: the code can sift search results before Claude ever reads them, so the context window carries less useless output. In the conversation you still see the tool calls themselves — the diff of an edit, for example — while the code stays collapsed; press Ctrl+O to open the transcript viewer and read the full JavaScript. Code Mode changes the layer between the model and the tools. The session you look at barely changes.

But do not switch it on in a hurry: this is an experimental feature, off by default, with plenty of limits. This article checks the official documentation and both release notes line by line, and works through four questions: what it is, how to turn it on, where it works, and where the risks sit. One point up front: Anthropic has published no savings figure for Code Mode, and the "37%" number circulating online is not its result. That gets its own section below.

Before and after: from one call at a time to one piece of code

To see what Code Mode is good for, start with the three task types the documentation names: a change that repeats across many files; a search whose results need filtering before Claude reads them; and several independent commands that can run at the same time. These share one trait: many tool calls, simple relationships between steps, and intermediate results the model mostly does not need to see. In the old way, the model had to "run the errand" at every step; now it writes the errand list once, and the code does the running.

Tool-call flow before and after Code Mode: the old way needs a model round trip per call, while Code Mode completes many calls in a single JavaScript snippet

Take the documentation's own example: raising a retry limit. The old way has Claude find the file, read the result, decide how to edit it, then decide which tests to run, waiting for a model response at each step. With Code Mode, Claude writes one piece of code that finds the file, edits it, and runs the tests in a single run, returning only the file's path and the test output to Claude. What disappears is the model's back-and-forth, not the work itself — the file still has to be found and the tests still have to run. The saving is the overhead of "every call needs the model to send a request and read a result."

That distinction sets the boundary of where it helps. The more fixed and repetitive the steps, the more Code Mode pays off; the more a task needs the model to look at results and change its mind, the smaller the advantage. Once a piece of code starts running, the model cannot intervene until it finishes — unless the code runs in the background, in which case you can keep talking to Claude. The documentation is explicit: code either waits or runs in the background. While waiting, code stops after ten minutes, including time spent at permission prompts; in the background it can run for up to two hours, but the session must start in auto or bypassPermissions mode. In short, Code Mode suits tasks that are "decided before doing," not "figured out while doing."

One more detail worth noting: Code Mode does not let Claude run arbitrary code on your machine unchecked. Every tool call inside the code still passes through your deny and ask permission rules, and through PreToolUse hooks. You do not need to change a rule or matcher for a tool such as Bash; the rules apply as before. What changes is the granularity of review — the subject of the security section below.

How to turn it on: off by default, and organizations can switch it off entirely

Code Mode is off by default. To try it, set the environment variable CLAUDE_CODE_EXPERIMENTAL_CODE_MODE to 1 before starting Claude Code, or put it in the env block of ~/.claude/settings.json. Turning it off is just as simple: remove the variable, or set it to 0 in either place — a 0 anywhere keeps Code Mode off even if the other place says 1. If it fails to start, the top of the session reads "Code Mode (experimental) isn't available," followed by the reason; /status shows it too.

For organization administrators, the switch lives in managed settings: add CLAUDE_CODE_EXPERIMENTAL_CODE_MODE with the value 0, and nobody in the organization can use Code Mode. People already inside a Code Mode session are unaffected until they exit or restart Claude Code; after that they start without Code Mode and cannot resume their Code Mode sessions while the 0 is in place. Note that the switch only turns the feature off — administrators cannot turn it on for their users from managed settings. Each person still has to set the variable to 1 themselves.

One resume rule is easy to trip over: you can resume a Code Mode session only in the terminal, with Code Mode on. If you normally use Code Mode in the terminal and one day open the same session in the desktop app or on the web, it will not open. The documentation groups this with the other session limits: the session cannot move to the Desktop app, cannot become a background session, and /fork cannot start a background copy. Taken together, these small print items point to one fact — Code Mode is, for now, an experiment inside the terminal, not a feature for every surface.

Where it works, and where it does not

The documentation lists a long set of requirements, and checking them one by one shows Code Mode's reach is narrower than a first impression suggests. Version must be v2.1.323 or later, on either release channel; an older version simply starts without Code Mode. The installation must be the native build of Claude Code. The session must be an interactive claude session in a terminal — no -p, no Agent SDK, no VS Code panel, no Desktop app, no cloud sessions. The account must be a Claude subscription or Console account; it cannot run through a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform, or Microsoft Foundry. Only four models are supported: Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.2. The organization must not use the HIPAA configuration or zero data retention. On Windows, Git for Windows must be installed.

Beyond that, a list of settings will stop Code Mode from starting: an API key helper, agent teams, OpenTelemetry export, and DISABLE_TELEMETRY must all be off. The troubleshooting table gives a fix for each reason — for "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; for "it can't be used together with agent teams yet," unset CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS. The table itself tells a story: Code Mode is still competing for space with Claude Code's other experimental features, and several of them are mutually exclusive.

The feature gaps matter too. With Code Mode on, you cannot use Remote Control, Claude in Chrome, or computer use, and the session cannot move to the Desktop app or become a background session. These are not small print: if your daily workflow depends on remote control or browser actions, turning on Code Mode means giving those up first. For people who only write code in the terminal, the cost is small; for people who have wired Claude Code into desktop and web workflows, the trade-off needs a thought first.

One more change in the same release deserves a mention: v2.1.323 adds engines["claude-code"] to plugin.json, letting plugins declare the Claude Code version range they support. Plugins outside their stated range are not installed, updated, or loaded, and install and update pick the newest version that fits. It has nothing to do with Code Mode directly, but it shows Anthropic adding version guardrails to the plugin ecosystem — as experimental features multiply, somebody has to manage compatibility.

The security ledger: the classifier reviews the code, not each call

The security mechanism is the part of Code Mode most worth reading carefully, because it changes who checks what. In auto mode, the classifier reviews each piece of code, not each tool call. The documentation's own words: "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."

That sentence needs unpacking. Without Code Mode, auto mode's classifier checked things call by call: every tool call got a review before it went out. Code Mode bundles many calls into one piece of code, so review moves up from "each call" to "each piece of code." There are fewer reviews, and the reviewer sees less — values computed only at run time, such as a path pulled from search output, are invisible to the classifier. Code Mode's security model makes an explicit trade: one code-level review replaces many call-level reviews, and dynamically computed values become a blind spot.

Anthropic does not hide the blind spot; it offers ways to cover it. First, your deny and ask rules still apply to every call the code makes, and so do hooks. Second, to inspect 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 before deciding whether to allow it. Third, in permission modes other than auto, the code starts without a review, but each tool call that would prompt you in that mode still prompts you one by one. Modes other than auto keep per-call prompts, just without the code-level review.

Two edge cases in the documentation read like bugs already hit before launch. First: in auto mode, when Claude starts more code while earlier code is still running, the earlier code loses its classifier review, and Claude Code asks you about its remaining calls that would need a review. Without an IDE connected, the prompt shows a countdown; if you do not answer before it ends, that call is refused, and later calls that would show a countdown are refused without a prompt. Second: when hooks fail, calls are refused — a PreToolUse hook that cannot start, times out, or returns invalid output refuses the call even when onFailure is unset, and UserPromptSubmit hooks can block code output. The message is clear: Code Mode's safety is rules plus hooks plus classifier, stacked together. Remove one layer and something can slip through.

My judgment is that the security design is honest, but it asks more of the user. Where auto mode's per-call review used to be the backstop, you now need your own rules and hooks in place — above all for calls where "the path is computed at run time," such as searching first and then deleting, or looking up a table before writing. If your rule set is still at its defaults, write the deny rules for dangerous operations before trying Code Mode on a task that edits twenty files in one go. An experimental feature in auto mode is exactly the combination that most needs human guardrails.

Patched a day later: v2.1.325 fixed three related bugs

Code Mode shipped on November 12; on November 13, v2.1.325 arrived, and three of its fixes relate directly to Code Mode. That speed is itself a signal: the feature had barely shipped before real-world use surfaced its problems.

The first fix concerns worktree paths: Code Mode scripts ignored a worktree entered with EnterWorktree, wrote paths containing ~ into the project, and left /mcp showing an MCP server as connected after its sign-in expired. The second concerns lost input: words typed with a Yes at a permission dialog or plan approval did not reach Claude in Code Mode. The third concerns resuming: resuming a session that ended during a Code Mode script made Claude start working by itself; after the fix it waits for your next prompt.

None of the three touches Code Mode's core mechanism, but each one lands on a real workflow pain point: paths written to the wrong place, confirmations silently dropped, work starting without being asked. Taken together they show that Code Mode in 2.1.323 was genuinely fresh out of the oven — usable, but with rough edges. The rest of v2.1.325 is worth noting too: it leads with a security fix for how zstd-compressed responses are decoded, plus a batch of permission and sandbox adjustments, including sandboxed Bash commands following the normal permission flow by default. If you want to try Code Mode, upgrade to v2.1.325 at minimum; do not be the first guinea pig on 2.1.323.

Do not pin the "37%" on it

After Code Mode shipped, discussion quickly turned to "how many tokens does it save," and the number quoted most often was 37%. That number needs care: it is not Code Mode's result. The 37% comes from an Anthropic engineering article from November 2025, about Programmatic Tool Calling in the API — a different feature in a different setting. Anthropic's Code Mode documentation gives no savings figure at all, and neither does the changelog. Attaching a 2025 API feature's number to a 2026 Claude Code feature is a mix-up.

Why would Anthropic give no number? A reasonable explanation is that the saving depends heavily on the task. Code Mode saves model round trips, but the code itself costs context too — the JavaScript Claude writes, the execution results, the back-and-forth records all go into the context window. For a task with many calls and short results, like reading twenty files and running three commands, the round trips saved dominate and it pays off. For a task with few calls but very long results each time, the round trips saved are few, and the code's own overhead may cancel the gain. Independent tests point the same way: real savings, but varying widely by task. The absence of one number is precisely because there is no one answer.

So the question "is Code Mode worth it" cannot be answered with a percentage. Look at your own task mix. If a large share of your day is "the same change across many files," "search a pile of results, then filter," or "run several independent commands at once," Code Mode will probably feel different — shorter sessions, less waiting, less noise from intermediate results in context. If most of your work is exploratory — read first, think, then act — Code Mode may change very little, and can even feel awkward, because the model cannot step in while code is running.

There is also a more practical money angle: Code Mode saves round trips, not total tokens. What decides the bill is the total tokens a task consumes, not the number of calls. A piece of code that hands large intermediate results back to the model does not get cheaper just because it made fewer calls. The documentation's design — "return the part of the output that Claude needs to read" — is exactly where the token saving lives: the code filters first, then returns. Whether it saves anything in the end depends on whether the code Claude writes really returns only what is useful. That is the uncertainty of an experimental feature: the result depends on how well the model writes code, and no public benchmark measures that yet.

Verdict: worth trying, but choose where to try it

Code Mode is the most interesting change Claude Code has shipped in the second half of this year, but its place needs to be stated correctly: this is not an "everyone upgrade" release, it is a "specific people try first" experiment. Its value is clear — bundle many tool calls into code, save round trips, save context, make parallelism and filtering possible. Its costs are equally clear — off by default, terminal only, four models only, no gateways or cloud providers, the classifier blind to values computed at run time, sessions that cannot be moved or resumed freely.

For individual developers, the advice is to start with low-risk, highly repetitive tasks. Rename the same constant across twenty files; run the tests and return only the failures; check the logs of several services at once and summarize. These are exactly the task types Code Mode is best at, and the consequences of imperfect code stay contained. Try it in auto mode, but set the deny rules for dangerous operations first rather than relying on the classifier alone. After a run, press Ctrl+O and read the code Claude wrote — check whether it really returned only the useful part. That is both a check and a way to learn how the model writes this kind of "errand code."

For teams and organization administrators, the advice runs the other way: do not open it to everyone yet. The organization switch can only turn Code Mode off, never on — a design that itself signals Anthropic's stance: let each organization set its own pace. My suggestion is to switch it off in managed settings first, let people try it in personal projects, build up rule and hook templates, and only then open it selectively. Teams with compliance requirements, or those sensitive to operations where "the path is computed at run time," should assess the classifier's blind spot on its own before enabling it.

Finally, look a little further out. The idea behind Code Mode is not Anthropic's alone — OpenCode 2.0 shipped its own Code Mode in October, along similar lines. "Let the model write code to call tools" is becoming a shared direction for coding agents: the model stops sending one tool call at a time and starts organizing calls as programs. If that direction holds, the interface between agents and tools may shift from "one call at a time" to "one program," and permissions, review, and billing will have to follow. Code Mode is only an experiment today, but the direction it points in is worth watching. The day it graduates from experiment to default, the one-line entry in 2.1.323 will look inevitable in hindsight.

What it means for vibe coding developers

For developers who use Claude Code daily for vibe coding, Code Mode's most direct impact sits in two scenarios. The first is "the same change across many files": renaming something used in dozens of files, adding the same attribute to a batch of components, swapping one class of prompts for another. These sessions used to be very long — the model went back and forth once per file, and context filled up with intermediate results. With Code Mode, the changes can go into one piece of code and finish in a single run: shorter sessions, less waiting. The second is "search, then filter": finding every use of an interface across the codebase, dropping test files and third-party code first, and only then handing the rest to the model. Filtering in code is cheaper than filtering across model round trips.

But Code Mode will not make vibe coding "foolproof." If anything, it demands clearer task descriptions: once code starts running, the model cannot step in midway, so you need to have thought through "what to change, how to filter, what to return" before acting. A vague instruction handed to Code Mode most likely produces code that runs very efficiently in the wrong direction. With per-call tool use, the model stops at each step and waits for confirmation, so a wrong direction surfaces early; now a wrong direction only surfaces after the whole script has run. For a workflow built on "build and adjust as you go," that is a change to get used to.

One more practical note: Code Mode currently supports only four models and only the Anthropic API or subscription accounts — no gateways, no cloud providers. If you normally use Claude Code through Bedrock or another gateway, Code Mode has nothing for you right now; check back once it supports more ways in. The first users of an experimental feature are always the people whose setup happens to fit the requirements list — native build, terminal session, subscription or Console account, one of the four models. If your setup does not fit, trying anyway will only show "not available" and a list of reasons.

Overall, Code Mode is worth an afternoon of trying for any heavy Claude Code user, but not worth reorganizing a whole workflow around. Right now it is an experiment with clear boundaries: inside them, repetitive tasks get noticeably smoother; outside them, it does not exist yet. Find the one or two task types inside the boundary where it helps you most, set up the rules and hooks, and wait for it to graduate from experiment before embracing it fully.

Views 4Comments 0

Comments (0)

ME
0/1000
Loading comments...

Sources

Browse projectsPublish your project

Related articles

A developer with glasses types on a laptop at a wooden desk, an external monitor to the left showing C code on a dark background, a small plant on the desk
News
Microsoft's Coding Model Stops Playing Second Fiddle: MAI Code 2 Scores 96% of Opus 5.5 for 5% of the Cost — Read the Three Caveats First

On 17 November 2026, Microsoft launched MAI Code 2 and Code 2 Flash: the larger model has 77 billion active parameters and a one-million-token context, averaging 63.2% across four benchmarks — close to GPT-6.1 Sol and Claude Opus 5.5 — at $0.309 per task. Read the three caveats first: promotional pricing, the lowest score of the three, and no long-horizon work.

Developer WorkflowProduct LaunchModel Updates
Against a black background, a conductor seen from behind raises a baton, with swirling trails of light circling beneath him like an orchestra being conducted
News
One API for 45 Models, and It Switches Providers When One Fails: Perplexity's Orchestrator Wants to Be the Switchboard

On 17 November 2026, Perplexity launched the Orchestrator API: one interface reaching OpenAI, Anthropic, Google, xAI and open-weight models such as GLM, Kimi and DeepSeek, billed at the answering model's published rate with no platform fee. When one provider fails, the same model retries on another deployment, and preview routing assigns requests to models by task.

Developer WorkflowProduct LaunchModel Updates
A developer types at a dual-monitor workstation; the left screen shows a dark code editor, the right a testing dashboard with green checkmarks and bar charts
News
Did Your Agent Get Better or Worse? AWS Open-Sources UAEF to Measure Agents from Every Framework with One Ruler

On 11 November 2026, AWS open-sourced UAEF: adapters turn traces from LangGraph, LangChain, Strands and Bedrock AgentCore into one format, then 36 metrics across 7 dimensions score them, flagging regressions past 5%. The judge model is hardened too — scores must cite verbatim evidence, and never decide safety.

Developer WorkflowProduct LaunchTesting & Quality