Claude Code's Experimental Code Mode: A Real 3-Round Test Shows 13% Savings, Not 77%
Cost savings from context compression in AI coding tools depend heavily on task complexity: simple edits barely benefit, while tool-heavy workflows can see major reductions. For developers paying per token, this experiment provides a realistic benchmark instead of the marketing 77% figure.
Anthropic's Code Mode for Claude Code, launched in v2.1.323, changes how Claude executes by having it first write a JavaScript script to chain multiple operations, compressing context and reducing token usage. A 36Kr report claimed it can cut costs by up to 77%. A developer who tracks token spending closely ran the same task three times with Code Mode on and off, using a 137-unit-test repository.
Averaged over three rounds, Code Mode cost $0.1586 per run versus $0.1816 for normal mode, a 13% reduction. Token reads (cache read) dropped by over 30% on average, but total cost only fell 13% because cache writes, which have a much higher unit price, made up a constant chunk of each run. Task completion times were essentially unchanged, ranging from 23 to 32 seconds in both modes.
The 77% figure applies to scenarios with heavy external tool calls, such as reading dozens of files or invoking external APIs repeatedly. This test's simple task of extracting config and re-running tests does not hit that profile, so the smaller savings are expected. The author also notes practical constraints: Code Mode only works in the terminal, not in VS Code plugin or desktop app; it requires an environment variable; and resuming a session demands the same variable.
The wide gap between token savings and cost savings shows that cache writes neutralize much of the benefit, so users paying per token need to watch both metrics, not just the headline percentage.
The 77% figure is real but conditional: it only appears in tool-heavy loops where context compression has a large impact. Simple tasks like this test won't see that level of savings, so cost expectations should be set by workload type.
A single 13% savings across three runs could still be noise; the second round showed nearly identical costs, suggesting variability is high enough that a longer test is needed to confirm the average.
Enabling Code Mode requires a manual environment variable and confirmation step, a friction that may deter casual users but is reasonable for an experimental feature.