Claude Code Mode: JavaScript Now Runs Your Tool Calls

Claude Code just changed how it works — and if you ship JavaScript for a living, the change is worth an hour of your week. Anthropic shipped Code Mode in Claude Code v2.1.323 on November 12, 2026: instead of asking for one tool call at a time and reading each result, Claude now writes a piece of JavaScript that makes several tool calls at once, and Claude Code runs that code in your session.

That sounds like a small plumbing change. It is not. The old loop — ask, wait, read, ask again — is the tax every coding agent pays on multi-file work. A rename across 40 files or a test run after every edit used to cost a full round trip per step. Code Mode folds those steps into one script. For a freelancer billing by the job instead of the hour, fewer round trips means faster delivery and a wider margin.

There is a catch, and Anthropic prints it in the open. Code Mode is experimental, off by default, and the docs warn it “may change or be removed in any release.” It works only in an interactive terminal, only with a direct Claude subscription or Console account, and only on four models. This is what it does, what it costs, and how to turn it into income without building your business on a flag that could vanish.

Claude Code in the terminal reading a file and writing tests, from Anthropic's official Claude Code product page

What Code Mode actually changes

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. That is the loop every Claude Code user knows: one call, one result, one decision.

With Code Mode, Claude writes JavaScript to carry the work out. One piece of code can run commands in parallel, use one result in the next call, and return only the part of the output Claude needs to read. Anthropic’s own example is a retry limit: Claude writes code to find the file, edit it, and run the tests — then hands back just the file path and the test output.

You still see the tool calls in the conversation — the edit’s diff, the test result — not the code itself. Press Ctrl+O to open the transcript viewer, where each piece of code appears as a collapsed Code row. What changes is where the waiting happens: inside one script instead of across a dozen round trips.

When Code Mode earns its keep

Anthropic’s docs name three kinds of task where Code Mode fits. All three share one trait: the work is wide, not deep.

  • A change that repeats across many files. Rename a prop, update an API call, or swap a dependency’s usage everywhere it appears.
  • A search whose results need filtering before Claude reads them. Grep 200 files, keep the 6 that matter, and hand Claude only those.
  • Several independent commands that can run at the same time. Lint, type-check, and test in parallel instead of in sequence.

One hard bug in one file still gets the old loop. Forty small edits across forty files is where the script earns its keep — and those are exactly the unglamorous jobs clients pay freelancers to finish.

PROMPT → SCRIPT → PARALLEL CALLS → FILTERED RESULT

1. PROMPT

You describe the task as usual — for example, raise the retry limit and run the tests.

2. SCRIPT

Claude writes one piece of JavaScript that makes the tool calls, instead of asking for them one by one.

3. PARALLEL CALLS

The code runs commands together, feeds one result into the next call, and filters the output itself.

4. FILTERED RESULT

Only the part Claude needs to read comes back — the file path and the test output, not the noise.

Code Mode at a glance

Everything in this table comes from Anthropic’s own changelog, docs, or pricing page — nothing here is a third-party claim.

Item What Anthropic says
Shipped Claude Code v2.1.323, November 12, 2026 — “Added Code Mode, an experimental opt-in in which Claude writes JavaScript to call its tools.”
Switch CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 — off by default; “may change or be removed in any release.”
Models Claude Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.2
Accounts A Claude subscription or Console account. Not through a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry.
Surface An interactive claude session in a terminal only — not -p, the Agent SDK, the VS Code panel, the Desktop app, or cloud sessions.
Cheapest way in Claude Pro at $20 a month ($17 a month billed annually). Max is $100 a month; Ultra is $200 a month.
Channel note The docs say v2.1.323 or later on either release channel — but npm still lists the stable channel at v2.1.311, so most users need the latest channel for now.

One honest gap: Anthropic publishes no speed or token-saving figure for Code Mode. The November 19 changelog says the latest release improves token use with shorter tool descriptions, but it gives no number. Any percentage you see elsewhere is someone else’s test, not Anthropic’s claim — so do not quote one to a client.

Watch: Anthropic introduces Claude Code on its official YouTube channel. There is no Code-Mode-specific video yet — this is the official Claude Code introduction.

How to turn it on

Three steps, straight from Anthropic’s docs. An older version starts without Code Mode, and may tell you the feature “isn’t open to your account yet.”

  1. Check the version. Run claude –version. You need v2.1.323 or later, on the native build of Claude Code. On Windows, Git for Windows must be installed.
  2. Set the flag. Start Claude Code with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude, or set the variable in the env block of ~/.claude/settings.json so every new session has it.
  3. Confirm once. Claude Code asks you to confirm before the first Code Mode session. Say yes and you are in.

Three steps to turn on Claude Code Mode: check the version, set the flag, confirm once

Turning it off is the mirror image: remove the variable, or set it to 0 — a 0 in one place keeps Code Mode off even if another place sets 1. Agencies can block it for everyone with a managed setting, so nobody in the organization can use Code Mode or resume a Code Mode session.

Two settings also stop Code Mode from starting: an API key helper, and OpenTelemetry export (or DISABLE_TELEMETRY). If you see “Code Mode (experimental) isn’t available” at the top of a session, /status shows the reason, and the docs’ troubleshooting table maps each reason to its fix.

How to profit from Code Mode: 5 moves

Code Mode is a speed tool for JavaScript work, not a product by itself. The money is in what it lets a solo freelancer finish in a day.

  1. Sell fixed-price multi-file jobs. Offer a flat fee for a rename, a migration, or a dependency upgrade across a whole codebase. Scope it by file count, run it in Code Mode, and keep the gap between your price and your time as margin.
  2. Offer a test-suite rescue. A client’s tests are red and nobody knows why. Run the suite, chase the failures across files, and hand back green tests with a short report. That is a repeatable package, and Code Mode’s parallel calls are built for it.
  3. Productize the boring refactor. Lint sweeps, dead-code removal, config cleanups — the jobs clients keep postponing because they look expensive by the hour. Quote them fixed, finish them fast, and let the client feel the difference.
  4. Charge for the setup, not the flag. Install Claude Code, verify the version, set the flag, and document how to turn it off. Small teams will pay for a working setup with a one-page runbook more readily than for a tool they have to configure themselves.
  5. Keep a human in the loop on client repos. Use the permission modes that ask first, and never run auto mode against a client’s production code without their explicit agreement. Your reputation is the asset; the script is the labor.

Claude Code welcome screen in the terminal, from Anthropic's official Claude Code product page

The limits that shape your jobs

Code Mode’s limits are not footnotes — they decide which jobs you can take. Scope every offer around them.

Limit What happens
Waiting code Code stops after 10 minutes, including time you spend at permission prompts.
Background code Can run for up to 2 hours while you keep talking to Claude — but only if the session started in auto or bypassPermissions mode.
Resuming You can resume a Code Mode session only in the terminal, with Code Mode on.
Auto mode The classifier reviews the code, not each tool call — and it cannot see values computed at run time, such as a path taken from search output.
Not available Remote Control, Claude in Chrome, and computer use. You also cannot move the session to the Desktop app or turn it into a background session.
Nov 19 update Anthropic removed a 0.75-second pause after most scripts in auto and bypass-permissions modes, shortened tool descriptions to cut token use, and made scripts show the command and its output while they run.

The auto-mode blind spot is the one to respect. The classifier reviews the code before it runs, but it does not see values computed at run time — so a path pulled from search output escapes review. Keep deny and ask rules or PreToolUse hooks for calls you must control; each tool call inside the code still passes through your rules under its usual name, such as Bash. To check the code itself, write a PreToolUse hook that matches REPL, the tool that runs it.

What to watch before you trust it

  • It is experimental. The docs warn it may change or be removed in any release. Do not write it into a client contract as a guaranteed capability, and do not build a workflow that has no fallback.
  • No official performance number exists. Anthropic claims no speedup and no token saving. Judge Code Mode on your own jobs, timed, before you promise a client anything.
  • It is terminal-only. No Desktop app, no VS Code panel, no -p flag, no Agent SDK, no cloud sessions. If your workflow lives in an IDE panel, Code Mode is not in it yet.
  • Resuming is strict. A Code Mode session can only be resumed in the terminal with Code Mode on. Close the terminal without the flag and the session will not come back the way you left it.
  • It is moving fast. Version 2.1.325 fixed three Code Mode bugs a day after launch, 2.1.326 added it for agent teams, and the November 19 release polished speed and token use. Re-check the docs before every job.

What to watch next

  • The stable channel. The stable release is still on v2.1.311, so Code Mode reaches most users only when stable catches up to v2.1.323. That is the moment it stops being an early-adopter feature.
  • Agent teams. Since v2.1.326, Code Mode works with agent teams on — teammates run in Code Mode in the default in-process display mode. Multi-agent JavaScript work is the next thing to test.
  • Performance numbers. If Anthropic ever publishes a measured speedup or token saving, it will settle the argument about what Code Mode is worth. Until then, your own timed jobs are the only honest benchmark.
  • Graduation or removal. Experimental flags either become settings or disappear. Watch the changelog: the day Code Mode loses the EXPERIMENTAL in its flag name is the day it is safe to build on.

The bottom line is simple. Code Mode does not make Claude smarter. It makes Claude less chatty with its own tools — one script instead of a dozen round trips — and for JavaScript work spread across many files, that is the difference between a job that takes an afternoon and a job that takes a day. Learn it now, while it is experimental, and you will be the freelancer who can quote the forty-file job with a straight face.

Frequently asked questions

What is Claude Code Mode?

Code Mode is an experimental, opt-in feature in Claude Code, added in v2.1.323 on November 12, 2026. Instead of asking for one tool call at a time, Claude writes a piece of JavaScript that makes several tool calls in one step, and Claude Code runs that code in your session. It is off by default and, per Anthropic’s docs, may change or be removed in any release.

How do I turn on Code Mode?

First check your version with claude –version — you need v2.1.323 or later. Then start Claude Code with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude, or set the variable in the env block of ~/.claude/settings.json. Confirm once when Claude Code asks, and the session runs in Code Mode. Set the value to 0 to turn it off.

How much does Code Mode cost?

Code Mode itself has no separate price. You need a Claude subscription or an Anthropic Console account: Claude Pro is $20 a month ($17 a month billed annually), Max is $100 a month, and Ultra is $200 a month. Usage is billed through your plan as usual.

Does Code Mode make Claude Code faster or cheaper?

Anthropic publishes no speed or token-saving figure for Code Mode, so there is no official number to quote. The November 19, 2026 changelog says the latest release improves Code Mode’s token use with shorter tool descriptions and removes a 0.75-second pause after most scripts in auto and bypass-permissions modes.

Can I use Code Mode in VS Code, the Desktop app, or with -p?

No. Code Mode works only in an interactive claude session in a terminal. It does not work with -p, the Agent SDK, the VS Code panel, the Desktop app, or cloud sessions, and you cannot use it through a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry.

Is Code Mode safe to use on client work?

It is experimental, so treat it as a tool you supervise, not one you hand the keys to. Each tool call inside the code still passes through your deny and ask rules and PreToolUse hooks. In auto mode, the classifier reviews the code, not each call, and cannot see values computed at run time — so keep rules or hooks for calls you must control, and do not run auto mode against a client’s production code without agreement.

What happens if I try to resume a Code Mode session without the flag?

You cannot resume it. Anthropic’s docs state that a Code Mode session can be resumed only in the terminal, with Code Mode on. Start the session again with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 set, or the session will not resume in Code Mode.

Sources: Anthropic, “Run tool calls from code with Code Mode” (updated Nov 16, 2026); Anthropic, Claude Code changelog (v2.1.323, v2.1.325, v2.1.326, Nov 19, 2026); Anthropic, Claude pricing; npm, @anthropic-ai/claude-code.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top