Claude Code's Experimental Code Mode: A Real 3-Round Test Shows 13% Savings, Not 77%
Hello everyone, I'm Meng Jian.
I spend about 17,000 RMB a year on AI tools. I mainly use Claude Code for coding, so I pay close attention to token costs. Anthropic added an experimental feature called Code Mode to Claude Code. The idea is not to change models, but to have Claude first write a piece of JavaScript that chains multiple operations together, compressing context and reducing tokens. A 36Kr report titled it "can save up to 77%." I ran the same task three times with it on and off, to see what the real numbers are.
The first round in normal mode ended like this:

Results first
| Dimension | Round 1 | Round 2 | Round 3 |
|---|---|---|---|
| Normal mode cost | $0.1813 | $0.1794 | $0.1841 |
| Code Mode cost | $0.1480 | $0.1763 | $0.1516 |
| Normal mode task time | 26s | 28s | 28s |
| Code Mode task time | 23s | 32s | 25s |
Averaging over three rounds, normal mode cost $0.1816, Code Mode cost $0.1586, saving about 13%. Speed is about the same: normal mode 26 to 28 seconds, Code Mode 23 to 32 seconds, fluctuations within normal range.
Tokens saved more than money. In the /cost statistics, for cache read (reading context), normal mode was 317k, 264k, 381k across three rounds, while Code Mode was 178k, 265k, 178k, averaging over 30% less. Money only saved a bit over 10% because each round also has about 28k of cache writes, which have a much higher unit price, and that's similar whether Code Mode is on or not.
The 77% figure comes from a 36Kr report dated November 18, referring to scenarios with high-frequency external tool calls, where the total tokens processed by the model dropped by 62% to 77%. The same report's cost calculations show multi-step development tasks saving 22% to 23%, e.g., adding a command-line parameter with tests, dropping from $0.45 to $0.35 per run. My test task only modifies one local file and re-runs tests, simpler than both, so 13% is not surprising.
What is Code Mode and who can use it
The feature launched in v2.1.323, off by default, officially noted as experimental and subject to change or removal at any time. Before enabling, confirm the following:
- Claude subscription and Console accounts can use it; cloud platforms like Bedrock and Google Cloud require version v2.1.331 or later; gateways and relay endpoints don't work.
- It only runs in the
claudecommand in a computer terminal; VS Code plugin and desktop app don't support it. - While enabled, remote control, Claude in Chrome, and computer operation are unavailable (the confirmation page explicitly states this).
- Sessions started with it must be resumed with the same environment variable switch enabled.
How to enable
The current version (v2.1.332) does not provide the command-line argument --experimental-code-mode. The official docs recommend setting an environment variable in PowerShell before launching:
$env:CLAUDE_CODE_EXPERIMENTAL_CODE_MODE='1'; claude
This setting only lasts for the current terminal window; closing the window clears it, and you need to set it again next time.

Then an interactive confirmation page appears. Press the down arrow to move the cursor to "Yes, turn on Code Mode" and press Enter.

After entering the interactive interface, the top shows "Code Mode (experimental) is on", indicating the feature is active.

How I tested
The test project used is the open-source repository javascript-todo-list-tutorial from dwyl, which comes with 137 unit tests and no database dependency. I originally planned to use an Express + Postgres project, but that repo was 404 and could not be cloned, so I switched to this one.
git clone https://github.com/dwyl/javascript-todo-list-tutorial.git target-project
cd target-project
npm install
npm test
Running npm install produces a few deprecated warnings, which don't affect actual execution. First run npm test to confirm the baseline all passes:

During testing, each round used exactly the same prompt:
提取 lib/todo-app.js 里硬编码的配置到新建的 lib/config.js,保证测试还是过的。做完跑一遍 npm test
After the task completes, run /cost to read cost and token data, then /exit to end the session. Before the next round, restore the workspace code with:
git checkout . ; git clean -fd
Pitfalls encountered during testing
After sending the prompt with Code Mode on, the terminal looks like this:

In the very first round, the test failed: the workspace wasn't fully cleaned, Claude detected the config had already been extracted, only checked the changes and ran tests, finishing in about ten seconds. The time anomaly was obvious, so that data was discarded.
Then I exited the session, ran git checkout . ; git clean -fd ; git status, confirmed the terminal output nothing to commit, working tree clean, and restarted. Every round must verify this status before starting.
Another detail: sessions created via Code Mode must be resumed with the same environment variable; if not, the command is rejected, and you need to re-declare the variable and re-enter.
Comparison of three rounds
The first round re-run with Code Mode cost about 3 cents less than normal mode:

Compare with normal mode second round execution:

In Code Mode's second round, cost barely decreased: $0.1763 vs normal mode's $0.1794:

In the third round, the drop reappeared:

Round 3's total wall time shows 5m9s, but actual API processing time was only 20s.
Final data summary
Looking at details, Code Mode's second round read 265k context, nearly equal to normal mode's 264k, so costs didn't diverge.
Across three rounds, Code Mode was cheaper each time, but round 2 only marginally, speed didn't change noticeably, and the sample is only three rounds. Following 36Kr's methodology, the 70%+ savings apply to tasks that repeatedly call tools, like checking dozens of files or calling external tools. My task wasn't complex enough. If you have that kind of workload, follow the steps above, and remember to clean the code before each round.
👋 I'm Meng Jian, former Tencent T11, former ByteDance tech leader, now full-time AI programming.
🔥 More AI programming practice:
- GitHub: @mengjian-github
- Column: AI编程实战
- Full list for this episode: comment "省钱开关" in the comments, I'll send you how to get it
Found this useful? Like + Bookmark is the biggest support 🙏
This article was compiled with AI assistance and reviewed by the author after testing.