Claude Code Code Mode Does the Boring Part Differently
I spent most of November watching Claude Code work the slow way. I'd give it a job — rename a function across twelve files, say — and then sit there while it called Read, then Bash, then Edit, then Read again, one tool at a time, reading every result before deciding what to do next. It worked. It just felt like watching someone carry groceries one bag at a time when there was a trolley right there. Claude Code Code Mode is the trolley. Instead of asking for one tool call after another, Claude writes a short piece of JavaScript that makes all the calls at once, and Claude Code runs that code inside your session.
It shipped quietly. One line in the changelog for version 2.1.323, dated November 12, 2026: "Code Mode, an experimental opt-in in which Claude writes JavaScript to call its tools." No launch video, no big announcement. A week later the documentation page appeared, and by then a few developers had already tried it and started arguing about it online. This guide is the plain version of what they found, what Anthropic's own docs actually say, and what you give up by turning it on. I am not going to tell you it makes Claude Code 37% faster or cheaper, because Anthropic has published no such number, and the 37% figure floating around comes from a different, year-old feature. More on that below.
What Claude Code Code Mode Actually Is
Here is the difference in one paragraph. 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. One piece of code can run commands in parallel, use one result in the next call, and return only the part of the output that Claude needs to read.
Think of it like the difference between texting someone instructions one message at a time and handing them a checklist. In normal mode, Claude sends a message, waits for your reply, sends the next one. In Code Mode, Claude writes the whole checklist, hands it over, and gets back a short summary of what happened. The conversation still looks the same to you. You see the edit diffs and the command output, same as always. The JavaScript itself stays out of sight unless you go looking for it: press Ctrl+O to open the transcript viewer, and each piece of code appears there as a collapsed Code row you can expand.
One detail worth understanding early. The code is the unit of work now. When a run surprises you, the script is the thing to read, not the list of tool calls. That changes how you debug. Instead of scrolling through twenty tool calls to find the one that went wrong, you open the script and read it like any other small program. If you can read JavaScript, even badly, you can follow what Code Mode did. If you can't, the diffs and outputs in the conversation still tell you what changed — but you are trusting the script a little more than you trusted the step-by-step version.
How Claude Code Code Mode Works Under the Hood
Anthropic's documentation explains the mechanism in plain terms, and it's worth knowing because it explains both the benefit and the risks. In a Code Mode session, you still describe your task in a prompt, exactly as you always have. Claude then writes JavaScript to carry it out. A shell call goes through a tagged template, an edit goes through a helper, and the last expression in the script is what Claude reads back.
The model itself gets a different set of tools in this mode. Instead of the full list of system tools, it gets two: REPL, which runs the JavaScript, and Poll, which collects results. The rest of the tools reach it as JavaScript functions described inside REPL, in a shorter form. That shorter form is where the token saving comes from. In normal mode, every tool's full description sits in the model's context on every request. In Code Mode, the descriptions are compressed into JavaScript function signatures, so the fixed context is smaller. One independent tester measured about 14,000 fewer input tokens on the first request of the same task, with the system-tools portion of context dropping from roughly 24,600 tokens to roughly 11,100. That is one person's test on one task, not an Anthropic promise — but it shows where the saving lives.
Variables survive from one script to the next, too. If an early script finds a list of files, a later script can use that list without searching again. That sounds small. On a long session with a big codebase, it is the difference between Claude re-reading the same directory tree ten times and reading it once. Less re-reading means less context burned, which means longer sessions before the conversation gets crowded out.
Here's a concrete example from the docs. Say you want to raise a retry limit in a file and then run the tests. In normal mode, that's a chain: find the file, read it, edit it, run the tests, read the output, decide what to do next — a round trip to the model at every step. In Code Mode, one script finds the file, edits it, and runs the tests, and the last line returns the file's path and the test output to Claude. One round trip instead of several.
How to Turn On Claude Code Code Mode
Code Mode ships off, and it stays off until you turn it on. There is no toggle in a menu. You enable it with one environment variable, and there are two ways to set it.
For one session: start Claude Code from your terminal with the variable set:
CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude
To keep it on: add it to the env block of your user settings file, ~/.claude/settings.json:
{ "env": { "CLAUDE_CODE_EXPERIMENTAL_CODE_MODE": "1" } }
One thing to get right, because it trips people up silently: the variable only works in your user settings file. Claude Code ignores it in a project's .claude/settings.json, without any warning. That's deliberate, so a repository you clone can't switch Code Mode on for you. If you set it in the project file, everything will install cleanly and nothing will happen, and you'll spend twenty minutes wondering why.
The first time you start a session with it on, a dialog titled "Code Mode (experimental)" opens, with the focus sitting on "No, start without it." Move down to "Yes, turn on Code Mode" and press Enter. What it warns you about, in short: it's an experiment that can change or disappear in any release, a session you start in Code Mode can only be resumed with it on, and in auto mode the safety check reads each script once before it runs, not each tool the script then calls.
Check that it worked. A line near the top of the session should say something like "Code Mode (experimental) is on · this session can be resumed only with Code Mode on." You can also run /status and look for a line reading "Code Mode: on (experimental)". If you see "Code Mode (experimental) isn't available" instead, the reason is printed on the same line, and /status repeats it. The most common reason is an old version — run claude --version and update if you're below 2.1.323.
To turn it off again, remove the variable from your shell and from ~/.claude/settings.json, then start a new session. You can also keep the variable and set its value to 0 in either place. A 0 in one place keeps Code Mode off even if you set 1 in the other. And if you manage a team, you can block it for your whole organisation by adding the variable with the value 0 to your managed settings, so nobody can use it.
What You Need Before Claude Code Code Mode Will Start
Code Mode has a short list of requirements, and if you miss one it simply won't start, usually with a one-line reason. Here's the list, straight from Anthropic's documentation, current as of November 2026.
- Version: Claude Code v2.1.323 or later, on either release channel. An older version starts without Code Mode. If you're on an older version and the reason says it isn't open to your account yet, update first — that message is often just the version check.
- Surface: an interactive
claudesession in a terminal, native build. That's it. It does not work withclaude -p, the Agent SDK, the VS Code panel, the Desktop app, or cloud sessions. - Account: a Claude subscription or Console account, through Anthropic's own API. It does not work through gateways, Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry.
- Model: Claude Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.2. If you're running an older model, Code Mode won't turn on.
- Agent teams: if you use agent teams with Code Mode on, you need v2.1.326 or later. Earlier versions refuse to start the combination.
The surface limit is the one that catches most people. If you live in the VS Code panel or the Desktop app, Code Mode is not available to you at all right now. It's terminal-only. That's not a bug or an oversight in your setup. It's how Anthropic shipped it. If your whole workflow runs through VS Code, don't rearrange your life for this. The mode will either come to your surface later or it won't, and the normal mode still does the same jobs, just with more round trips.
What Claude Code Code Mode Is Good For
Anthropic recommends Code Mode for tasks that take many related tool calls, and the pattern is easy to recognise once you've seen it. If your job is one big search followed by many small edits, or many independent commands that can run at the same time, that's the sweet spot.
A change that repeats across many files is the classic case. Rename a function, update an import path, change a config value in twenty places. In normal mode, Claude reads each file, edits it, and moves on, one round trip per file. In Code Mode, one script finds every file, makes every edit, and returns a summary. The same goes for a search whose results need filtering — find every Markdown link in the project that points at a local file that doesn't exist, for example. One developer who tried exactly that task reported 13 tool calls in 2 model turns with Code Mode on, and all 3 broken links found. Without it, that's 13 round trips, each one spending a turn of context and a wait.
Several independent commands that can run at the same time are the other clear win. Run the tests, check the lint, and grep the logs in parallel instead of one after another. A script can fan them out and collect the results together.
It also helps on long sessions. Because the tool descriptions are shorter and variables survive between scripts, the context stays smaller for longer. If you've ever watched a long Claude Code session slow down as the conversation fills up with repeated file reads, that's the problem Code Mode is quietly fixing. Not dramatically. Quietly.
What You Give Up While Claude Code Code Mode Is On
Every feature has a price, and this one is honest about it. Here's what stops working, or works differently, while Code Mode is on.
Resuming only works with it on. A session you start in Code Mode can only be resumed with Code Mode on. Cloud sessions and the Claude apps can't continue it. If you run claude --continue or claude --resume without the variable set, it refuses the session. To resume, start with the variable again: CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude --resume. This is the limitation most likely to bite you in real life, because it means your session is tied to the terminal and the variable, not just to your account.
Remote Control, Claude in Chrome, and computer use don't work. If your workflow depends on any of those, Code Mode isn't for that session. The same goes for the surfaces already listed — VS Code panel, Desktop app, cloud sessions, -p, and the Agent SDK.
Auto mode reviews the code, not each tool call. In auto mode, the classifier reviews each piece of code before it runs, not each tool call the code makes. And it doesn't see values computed at run time, such as a path taken out of search output. Your permission rules still apply — every tool call a script makes still goes through your deny and ask rules and your PreToolUse hooks — but the shape of the safety check changes. If you run in auto mode a lot, read that twice. The script is approved as a whole, and what it does inside is its own business. Sandboxing is the limit that doesn't depend on how a command is spelled, so if you're worried, lean on the sandbox, not on clever deny rules. One caveat worth knowing: Bash rules match command text, so a denied command can still be written in a form your rule doesn't match. That's true with or without Code Mode.
Long-running code has a clock on it. While code runs a long build or test, Claude either waits for it or lets it continue in the background. If Claude waits, the code stops after ten minutes, including the time you spend sitting at permission prompts. If you let it run in the 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.
Plugin hooks used to block it. Until v2.1.327, a plugin with hooks that checked tool calls would stop Code Mode from starting. Since v2.1.327, it starts anyway, and only your organisation's settings can keep it off. If you read an older guide that says plugins block it, that guide is out of date.
The Savings Question, Answered Honestly
Let's deal with the number everyone is quoting, because it's wrong in an interesting way. You've probably seen a post claiming Code Mode makes Claude Code 37% cheaper, or 37% faster, or saves 37% of tokens. Anthropic has published no savings figure for Code Mode. None. The documentation gives no number at all.
The 37% figure comes from Anthropic's November 2025 article on Programmatic Tool Calling in the API. That's a different feature, from a year earlier, about the API — not about Claude Code, and not about Code Mode. Somebody read the old article, saw a real number attached to a similar-sounding idea, and pasted it onto the new feature. Then a hundred other posts copied the copy. It's the telephone game, and the number survived because it sounds specific enough to be true.
So what do we actually know about savings? Two things, and both are modest. First, the mechanism is real: shorter tool descriptions mean less fixed context on every request, and one script replacing many round trips means fewer turns. Second, the only measured number I've seen from an independent test is the one I mentioned earlier — about 14,000 fewer input tokens on the first request of the same task, with the system-tools slice of context falling from roughly 24,600 tokens to roughly 11,100. That's a real measurement of a real task, but it's one task, one setup, one tester. Don't build a budget on it.
Here's the honest way to think about it. Code Mode probably saves you tokens, especially on tasks with many tool calls, and it probably saves you time, because fewer round trips mean less waiting. How much depends entirely on your tasks. A rename across fifty files saves a lot. A single careful edit to one file saves almost nothing. If a post gives you a precise percentage for this feature, that post is guessing, or quoting the wrong feature. Check the source before you believe the number.
Claude Code Code Mode vs Normal Mode: When to Use Which
Code Mode isn't a replacement for normal mode. It's a different gear, and the right choice depends on the job in front of you.
Use Code Mode when the job is many related tool calls: a change repeated across files, a search that needs filtering, several commands that can run in parallel, or a long session where context is getting tight. If you can describe the job as "find all the X and do Y to each one," that's a Code Mode job.
Stay in normal mode when the job is one careful thing, or a few careful things. A single tricky edit, a debugging session where you want to see each step, a task where the next step depends entirely on what the last one found. Normal mode shows you every tool call as it happens, which is exactly what you want when you're watching closely. Code Mode hides the steps inside a script, and that hiding is a cost when the work is delicate.
Stay in normal mode when you need the surfaces Code Mode doesn't support. VS Code panel, Desktop app, cloud sessions, Remote Control, Claude in Chrome — if that's where you work, normal mode is your mode, full stop. No amount of token saving is worth rebuilding your workflow around a terminal you don't use.
Think twice in auto mode. If you run Claude Code in auto mode with Code Mode on, remember the classifier reviews the code, not the calls inside it. For routine work in a project you trust, that's fine. For unfamiliar code, or a repository you just cloned, run it in normal mode first, or at least with permissions set to ask. The ten-minute clock on waiting code is another reason to be deliberate: a long build that needs your input at a permission prompt can eat its own time limit while you read the prompt.
My own rule, after trying it on a few real tasks: turn it on for the plumbing jobs, leave it off for the thinking jobs. Renames, sweeps, test runs, bulk edits — Code Mode. Architecture decisions, debugging a weird failure, anything where I need to watch Claude think — normal mode. The switch costs one environment variable, so there's no reason to pick a side and stay there.
Five Mistakes People Make With Code Mode
Setting it in the project settings file. I said this already and I'm saying it again, because it's the mistake with no error message. Claude Code ignores CLAUDE_CODE_EXPERIMENTAL_CODE_MODE in a project's .claude/settings.json. It only works in your user settings file or in your shell. Set it in the wrong place and you'll conclude the feature is broken, when it's your file that's wrong.
Quoting the 37% figure. It's from a different feature, a year old, about the API. If you repeat it in a post or a client call, someone who checks will find the real source, and your credibility takes the hit. The honest line is: Anthropic publishes no savings number; independent tests show real but task-dependent savings.
Expecting it in VS Code or the Desktop app. It's terminal-only. If you open the VS Code panel expecting a Code Mode toggle, you won't find one, and no update you install will add it until Anthropic ships it there. Check the docs, not the settings menu.
Starting a Code Mode session and forgetting the resume rule. You close the terminal, come back tomorrow, run claude --resume, and it refuses. Not because anything broke, but because you forgot the variable. Put it in your user settings file if you use Code Mode regularly, so every session starts with it and every resume works.
Running auto mode on unfamiliar code. The classifier reviews the script, not the calls inside it, and it can't see values computed at run time. That's a real change in what gets checked. On a project you know, fine. On code you haven't read yet, ask mode is the safer choice.
Code Mode Questions People Ask
Is Code Mode free? There's no separate price. It's a mode inside Claude Code, which comes with the paid Claude plans or the API. You need Claude Code v2.1.323 or later and a supported model. If you want the pricing breakdown, my guide on Claude Code pricing in 2026 covers Pro at $20, Max at $100, and Ultra at $200 a month.
Does Claude Code Code Mode work in VS Code? No. It's terminal-only: an interactive claude session in a terminal, native build. Not the VS Code panel, not the Desktop app, not cloud sessions, not claude -p, not the Agent SDK.
How much does Claude Code Code Mode save? Anthropic publishes no figure. The 37% number you've seen is from a different feature — Programmatic Tool Calling in the API, November 2025 — not Code Mode. One independent test measured about 14,000 fewer input tokens on the first request of the same task. Your savings will depend on your tasks.
Can I resume a Claude Code Code Mode session? Yes, but only with Code Mode on. Run CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude --resume, or keep the variable in your user settings so it's always on. Cloud sessions and the Claude apps can't continue a Code Mode session.
Is Code Mode safe to use? Your permission rules still apply, and every tool call a script makes still goes through your deny and ask rules and your PreToolUse hooks. The change is in auto mode, where the classifier reviews each script once, not each call inside it. Use the sandbox for real protection, and be careful with auto mode on unfamiliar code.
Will Code Mode stay, or disappear? Anthropic calls it experimental and says it may change or be removed in any release. It's been updated twice already — agent teams support in v2.1.326, plugin-hook behaviour in v2.1.327 — which suggests it's being actively developed, not abandoned. But don't build a workflow that only works with it on. Keep your normal-mode habits intact.
The Short Version
Claude Code Code Mode, shipped in Claude Code v2.1.323 on November 12, 2026, changes how Claude uses its tools. Instead of calling Read, Bash, and Edit one at a time, Claude writes a JavaScript program that makes the calls, and Claude Code runs it. You turn it on with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude, or permanently in the env block of your user settings file. It works in the terminal only, with Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.2, through Anthropic's own API. It's best for jobs with many related tool calls — renames across files, searches that need filtering, parallel commands. It costs you the ability to resume without it on, the VS Code and Desktop surfaces, and the per-call safety review in auto mode. And Anthropic has published no savings figure, so don't quote one. Try it on a plumbing job, watch what the script does with Ctrl+O, and decide from your own tasks whether the gear is worth shifting into.
If you want the agent workflows that make Claude Code pay for itself, the AI Agent Starter Kit has the plug-and-play setups I use for first builds, and the free AI Creator Prompt Pack gives you 64 copy-ready prompts to practise with. And if you haven't used Claude Code at all yet, start with the basics before you switch on an experimental mode.
Keep Reading
Two guides that go with this one:
- How to Use Claude Code: A Practical Step-by-Step Guide in 2026 — the full walkthrough of setting up and using Claude Code, so Code Mode has something to speed up.
- Claude Code for Beginners: Build Your First AI Agent in a Weekend — build your first working agent before you worry about making it faster.