Claude Code shipped a new feature called Code Mode recently. The idea comes from Cloudflare's Code Mode for MCP and Anthropic's write-up from last year.
I wanted to know three things:
How it works under the hood?
Does it make Claude Code more efficient (reduced token usage, save money)
Any impact on quality of results?
How Claude Code works
Claude Code is a loop.
Say you ask it to fix a bug in your login code:
Claude Code sends your prompt to Claude.
Claude sends back a tool to use: search for
def login.Claude Code runs the search on your laptop and sends the result to Claude.
Claude sends back the next tool: read
src/auth.py.Claude Code runs it and sends the result back. And so on.
Each send-and-reply counts as one round trip. This fix takes 5: search, read, edit, run the tests, and the final reply.

Illustrative example.
What Code Mode changes
With Code Mode, Claude writes a small script that uses several tools at once. Claude Code runs the script locally on your laptop, and then sends the output back to Claude for the next step.
Same bug:
Claude Code sends your prompt to Claude.
Claude sends back a script: search for
def login, read the file, and return the login function.Claude Code runs it and sends back just the login function.
Claude sends back a second script: fix the line, and run the tests.
Claude Code runs it and sends back "12 passed."
Claude replies.
That's 3 round trips instead of 5.

Illustrative example.
Code Mode also makes each trip smaller. Claude sees two tools instead of dozens: REPL runs a script, and Poll collects the results of a slow one. Every other tool becomes a function inside the script, and MCP tools (plugins that give Claude extra tools) shrink to a list of names. In my setup, the first request went from 84,655 tokens to 57,158.
Does it save money?
Code Mode reduces token usage. Instead of sending all of your tools, Claude only sees two tools: REPL runs a script, and Poll collects the results of a slow one. Every other tool becomes a function inside the script.
(In my setup, the first request on average went from ~85k tokens to ~57k tokens).
I ran a couple of tasks from my real sessions with code mode enabled & disabled. These are the results I saw:
~40-60% fewer tokens sent
~40% faster (because it makes fewer calls to Claude)
~20% cheaper
Even though Code Mode sends ~40-60% fewer tokens, the total cost only reduced by ~20% because most of the cost comes from output tokens which doesn’t get impacted by Code Mode.
Fewer round trips means less re-reading of the entire context (which is already cached). So even though we send fewer tokens, total cost doesn’t reduce by the same amount.


Does Claude get worse at the task?
This was my main worry. Without Code Mode, Claude sees each result before it picks the next step. With it, Claude plans a few steps at once.
I didn't see a drop. I ran a bunch of my old claude sessions again with code mode enabled. It seemed to give the same results as the session without code mode. I am still keeping an eye on this since I have only used it for a day or two.
When not to use Code Mode
Code Mode only runs in the interactive terminal. Per the docs, it doesn't run in VS Code, the desktop app, cloud sessions, or through an LLM gateway. It turns off Remote Control, Claude in Chrome and computer use. In my tests it also didn't run in claude -p.
How to enable it
Add this to ~/.claude/settings.json:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_CODE_MODE": "1"
}
}