In July I wrote about the effort dial: how much thinking you let a model do, and what that does to the bill. When Fable 5.1 came out in September, the docs mentioned something unrelated to effort. In long agent sessions the model sometimes made one tool call per turn where the previous version had batched several. Every turn is a trip back to the model, and those trips cost time and tokens.
Claude Code 2.1.323 shipped on November 12, and the first line of its changelog is about exactly those trips. Code Mode is an experimental feature you turn on yourself. Instead of calling its tools one at a time, Claude writes a short piece of JavaScript that calls them.
What changes
Without Code Mode, Claude Code runs a fixed loop. The model picks a tool, Claude Code runs it, the result goes back into the context, and the model picks the next one. Searching ten files and then writing a summary takes ten trips, and every intermediate result lands in the conversation in full.
With Code Mode, Claude writes one script that makes those ten calls, filters the results and returns only the outcome. The model sees the end result, not the ten steps in between.
| Without Code Mode | With Code Mode | |
|---|---|---|
| Calling | one tool per model turn | one script calls several tools |
| Intermediate results | all in the context | stay inside the script |
| Filtering and totals | done by the model, in tokens | done by the code |
| What you see | every step on its own | the script and the outcome |
The changelog is brief. Code Mode gets one sentence, with a link to a docs page on how to turn it on and how an organization can turn it off for everyone. On November 13 that page still returned a 404. So I could not get from the primary source how you enable it or which tools take part.
Where the idea comes from
The idea itself is not new. The API has had it for a while as programmatic tool calling, and Anthropic wrote two engineering posts about it last year. Anthropic does not say whether Code Mode in Claude Code uses the same machinery. In both cases the model writes code that calls tools, rather than calling them itself turn by turn. The numbers below are therefore about the API version. They show what the mechanism does, but they are not measurements of Code Mode.
The numbers, including the unflattering one
The API documentation gives three measurements, all from Anthropic:
- On a project-management agent benchmark with 75 tools, billed input tokens fell by roughly 38 percent with no change in accuracy.
- On τ²-bench, where each turn makes one or two sequential tool calls, scores stayed the same and it cost roughly 8 percent more.
- In production traffic with 10 to 49 tool definitions, the docs report typical savings of 20 to 40 percent.
The engineering post Code execution with MCP from November 2025 had a much bigger figure. One example went from 150,000 to 2,000 tokens, which Anthropic says saved 98.7 percent. That is a single worked example, a transcript moving from one system to another, not an average. The 8 percent extra on τ²-bench is the most useful line of the three to me, because it tells you when to leave the feature off.
The docs spell that out too. It works well for fan-out work: checking fifty endpoints, fetching twenty records, large results you want to filter first. It works poorly when each step depends on what the model made of the previous one, because a script cannot skip that trip. And for a handful of small calls, the script overhead can outweigh the savings.
What this means for ordinary work in Claude Code
Much of what I do in Claude Code is sequential. I read a file, the model thinks, it changes something, runs a test and looks at the result. Every step hangs on the one before it. Code Mode will do little there, and going by the τ²-bench result it may even cost a bit.
The difference is in the searching and inventory turns. Checking every article for a broken link, or lining up twenty scheduled posts side by side. Those are the turns that currently fill the context with intermediate results I never read.
The caveat
You see less of what happens. Right now every tool call shows up on its own, with its own result. With Code Mode you see a script and an outcome. Anyone who reads along to check what an agent is doing now has to read code instead of a list of steps. Keeping an eye on it gets harder, and that lands on the user.
Responsibility for what comes back moves into the script. The API docs warn that tool results come back as strings that can contain code or commands, and that external data carries a code injection risk if that output gets run. In Claude Code, tool results come from web pages, files and MCP servers you do not own. How Code Mode handles that, and how permission prompts work for a script that does ten things, is not documented yet. The same release fixes a long list of holes in the Bash sandbox and the permission rules. That says nothing about Code Mode itself, but it does show where things went wrong in recent weeks.
Fewer tokens does not mean less data leaving. In the API, the programmatic version runs in a code execution container, and that is outside zero data retention. The docs list retention of up to 30 days. Whether Code Mode in Claude Code runs locally or in a similar container is not in the changelog. Ask before you turn it on anywhere that handles sensitive data.
What I do myself
At the time of writing my own install is still on 2.1.319, so I have not been able to try Code Mode yet.
If you do turn it on, the advice in the API docs carries over word for word: measure usage with and without on a few representative tasks before you enable it everywhere. In Claude Code, /context shows how much of your context goes to intermediate results. That is a decent first gauge.
Frequently asked questions
Is Code Mode on by default?
No. The changelog calls it an experimental opt-in. You turn it on yourself, and an organization can turn it off for everyone.
Is Code Mode the same as programmatic tool calling in the API?
Anthropic does not say. The mechanism is the same, Claude writes code that calls tools, but nothing states that the implementation is identical. The savings figures in the API docs are about the API.
Does it always save tokens?
No. On τ²-bench, with one or two sequential tool calls per turn, the API version cost roughly 8 percent more. It pays off for work that fans out over many calls with large results.
Where can I find how to turn it on?
The changelog points to code.claude.com/docs/en/code-mode. On November 13 that page still returned a 404.
Sources
- Anthropic — Claude Code changelog, version 2.1.323, November 12, 2026
- Anthropic — Programmatic tool calling, documentation, accessed November 13, 2026
- Anthropic — Code execution with MCP, November 4, 2025
Checked on November 13, 2026. The Code Mode docs page was not online yet, so I could not verify how you enable it or whether it runs locally or in a container. All figures are about programmatic tool calling in the API and come from Anthropic itself; I found no independent measurement of Code Mode.
