{"slug": "claude-code-s-code-mode-does-it-actually-save-tokens", "title": "Claude Code's Code Mode: Does It Actually Save Tokens?", "summary": "A hands-on test of Claude Code's experimental Code Mode across four tasks found the setting cut input tokens in every comparison, by roughly 35% in raw terms and about 17% once cached tokens were weighted by actual cost, but slowed three of five runs. Most of the savings came from setup overhead: a normal message carried Claude's full tool list at about 60,000 tokens versus about 38,000 with Code Mode, which replaces the tool list with a single code tool. Accuracy was unchanged on every task, and the feature currently works only in the Claude Code terminal, requiring a recent Claude Code version and a current model such as Opus 4.5, with Anthropic shipping dozens of fixes in the first week and a half after launch.", "body_md": "# Claude Code's Code Mode: Does It Actually Save Tokens?\n\nA hands-on test of Claude Code's new Code Mode against normal mode across four tasks, measuring real token savings, cost, and speed.\n\n## What is Code Mode in Claude Code?\n\nCode Mode is an experimental setting in Claude Code that changes how the model uses tools. Instead of making one tool call at a time (read a file, wait for the result, decide the next step, repeat), Claude writes a short JavaScript program that makes several tool calls in one shot, runs it inside your session, and only returns the parts of the output it actually needs. In a hands-on test covering four real tasks, this cut input tokens on every single comparison, by roughly 35% in raw terms and closer to 17% once cached tokens were weighted by actual cost. The catch is speed: three of the five test runs got slower, not faster.\n\n## TL;DR\n\n- **Code Mode changes the “how,” not the “what”** : Claude still does the same job, but it bundles multiple tool calls into one script instead of asking for each one individually.\n- **Token savings were consistent but modest** , averaging around 35% fewer input tokens across five test runs, dropping to about 17% once cached tokens were priced at their real (much lower) cost.\n- **Most of the savings come from setup overhead, not task execution** : a normal message carries Claude’s full tool list, which ran about 60,000 tokens per message in testing versus about 38,000 with Code Mode on, since the whole tool list gets replaced by a single code tool.\n- **Speed was a mixed bag** : Code Mode was faster on a quick single-file question and one data task, but slower on three others, including one job that took three minutes instead of 27 seconds because it fired off over 100 separate shell commands.\n- **Accuracy didn’t change** : every task produced the correct answer whether Code Mode was on or off.\n- **The feature only works in the Claude Code terminal** right now, not in the desktop app, VS Code panel, or Claude sessions, and it requires a recent Claude Code version and a current model like Opus 4.5.\n- **It’s explicitly experimental and moving fast** : Anthropic shipped dozens of fixes and changes in the first week and a half after launch, so current behavior may already differ from any single test.\n\nLive class · Wed, Dec 2\n\n### $40,000+/mo\n\nin SaaS spend the Remy team cut by building its own apps with AI.\n\nWe'll show you how.\n\nBring an idea.\n\nBuild it live.\n\nLeave certified.\n\n## How does Code Mode actually work?\n\nIn normal Claude Code operation, every action is a separate “tool call.” Claude asks to read a file, gets the content back, decides what to do next, asks for another file, and so on. Each of those round trips adds to the conversation, and everything Claude reads along the way stays in its context for the rest of the session. That’s the standard agentic loop.\n\nCode Mode replaces that loop, at least partially, with a different pattern. Rather than requesting tools one by one, Claude writes a small JavaScript program that calls multiple tools inside that program, runs it directly in the session, and returns a filtered result. One script might read 40 files, check them for data problems, and tally totals, handing back only the final ranking instead of dumping every intermediate read into the chat.\n\nA useful way to picture it: without Code Mode, it’s like sending an assistant to a filing cabinet and having them read every page out loud as they bring each folder back. With Code Mode on, you hand them a note that says pull all the folders, add everything up, and come back with just the top three results.\n\nDespite the name, you don’t write or read any code to use it. Prompts work exactly the same as before. The “code” part happens behind the scenes in how Claude executes tool calls, not in how you interact with it.\n\n## How much does Code Mode actually save?\n\nThe idea behind Code Mode isn’t new. Anthropic’s own engineers tested a similar approach roughly a year before Code Mode shipped in Claude Code, having an agent pull a meeting transcript from Google Drive and attach it to a Salesforce lead. Writing code to chain those actions instead of calling each tool directly dropped that job from about 150,000 tokens to around 2,000.\n\nThat kind of reduction didn’t show up in smaller, real-world tasks. Testing four jobs that a small business might hand to Claude, including finding top customers across 40 days of order files, checking a folder of 30 documents for broken links, updating a phone number and price across a 25-page website, and answering a quick question about a single file, Code Mode reduced input tokens on all five runs (the order-file task was run twice), averaging about 35% fewer tokens overall.\n\nMost of that saving came from setup overhead rather than the actual work. Every message Claude sends carries its full set of instructions and tool list. With Code Mode off, that overhead ran around 60,000 tokens per message. With Code Mode on, the entire tool list gets swapped for a single code tool, dropping that baseline to about 38,000 tokens. That’s why even a simple one-file question got noticeably cheaper: the savings show up before Claude even reads the actual prompt.\n\n**›** Build a safety-inspection app for 60 plants.\n\n*already included:*✓ SOC 2✓ role-based access✓ audit log✓ self-hosted\n\nThe real cost picture is smaller than the raw token numbers suggest, though. A large share of those tokens were cached, and cached tokens cost far less than fresh ones as long as they stay in cache. Weighting the comparison by actual dollar cost rather than raw token count brought the savings down to roughly 17%. That’s a real reduction, useful for anyone bumping against usage limits, but far short of the dramatic reductions sometimes cited for code-based tool use in other contexts.\n\n## Is Code Mode faster than normal mode?\n\nNot reliably. Speed results were mixed across the five test runs. Code Mode was faster on the one-file question and on one of the two order-file runs, but slower on the other three tasks. The broken-link check was the starkest example: it took about three minutes with Code Mode on, versus 27 seconds with it off.\n\nDigging into the logs explained why. The Code Mode script fired off more than 100 separate shell commands, essentially one per link, and on a Windows machine each of those commands has to spin up its own new shell process. Without Code Mode, Claude handled the entire check with a single command instead of a hundred small ones.\n\nIt’s also worth noting that Claude was already writing small scripts in the terminal on several tasks even with Code Mode off, which narrowed the practical gap between the two modes. And run-to-run variance was real: the same broken-link job took 12 seconds in one normal-mode run and 36 seconds in another, a reminder that a single comparison doesn’t establish a firm pattern.\n\n## How do you turn Code Mode on?\n\nCode Mode currently only works inside the Claude Code terminal interface, not in the desktop app, the VS Code extension, or Claude sessions in the browser. It requires Claude Code version 2.1.323 or later, a Claude subscription or console account, and a current model such as Opus 4.5.\n\nTo enable it, set the environment variable `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE` to `1`, either directly in the terminal before launching Claude or in the settings file. Another option is pasting the Code Mode documentation link into Claude Code and asking it to set the variable for you.\n\nOn first launch, Claude Code shows a notice explaining that Claude will write JavaScript to call its tools, that the feature is experimental, and that certain other capabilities (like Chrome and computer use) are disabled while Code Mode is active. Once confirmed, a “Code Mode is on” indicator appears at the top of the session. To inspect what Claude actually wrote, pressing Control+O opens the full transcript, where each script appears as a row labeled “code” with its underlying tool calls listed below it.\n\n## Is Code Mode worth using?\n\nAnthropic recommends Code Mode for three kinds of work: repeated changes across many files, searches where results need filtering before Claude reads them, and multiple commands that can run in parallel. Testing suggests a fourth use case worth adding: long sessions where every message’s overhead matters, since each message is lighter with Code Mode on regardless of task type.\n\n*Enterprises have Remy.*\n\n**⌂** Self-hosted\n\n**✓** SOC 2\n\n**✚** HIPAA\n\n**☰** Audit log\n\nBecause the feature is explicitly experimental, Anthropic has warned it could change or be removed in any release. It shipped in mid-November, and in the following week and a half the company pushed dozens of fixes and changes, so current behavior is a moving target. Anyone testing Code Mode for a specific workflow should check the version in use and run their own comparison rather than relying on fixed numbers.\n\n## Frequently Asked Questions\n\n### Does Code Mode make Claude more accurate?\n\nNo. In testing across four tasks, accuracy was identical with Code Mode on or off. Every run produced the correct answer either way. Code Mode changes efficiency and execution style, not reasoning quality.\n\n### Why do cached tokens matter for Code Mode savings?\n\nA chunk of the tokens in any Claude Code session are cached (things like the system prompt and tool definitions), and cached tokens cost much less than fresh input tokens. Raw token counts showed Code Mode saving about 35%, but once those cached tokens were weighted by their actual (lower) cost, the real savings dropped to around 17%.\n\n### Can I use Code Mode in the Claude desktop app?\n\nNot currently. Code Mode only works in the Claude Code terminal interface. It’s not available in the desktop app, the VS Code panel, or browser-based Claude sessions.\n\n### Why was Code Mode slower on some tasks?\n\nIn at least one test, a broken-link check, Code Mode’s generated script fired off more than 100 separate shell commands instead of handling the check in one pass. On Windows, each command spins up its own shell, adding overhead that outweighed the token savings and made that task roughly seven times slower.\n\n### Is Code Mode safe to rely on for production workflows?\n\nTreat it as experimental. Anthropic has said the feature may change or be removed in future releases, and it shipped dozens of updates within the first days of release. Anyone adopting it should expect behavior to shift and should verify results on their own version rather than assuming fixed performance.", "url": "https://wpnews.pro/news/claude-code-s-code-mode-does-it-actually-save-tokens", "canonical_source": "https://www.mindstudio.ai/blog/claude-code-mode-token-savings-test/", "published_at": "2026-11-25 00:00:00+00:00", "updated_at": "2026-11-25 10:44:44.819911+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "large-language-models", "developer-tools"], "entities": ["Anthropic", "Claude Code", "Code Mode", "Opus 4.5"], "also_reported_by": [], "takeaway": "Code Mode cut input tokens roughly 35% raw and about 17% cost-weighted by collapsing the ~60,000-token tool list to ~38,000, but one task took three minutes instead of 27 seconds after firing over 100 shell commands.", "recommendation": {"advice": "Enable Code Mode in the Claude Code terminal to cut input tokens about 35% raw and 17% cost-weighted, but watch for slowdowns when scripts fire over 100 shell commands.", "playbook": "llm-cost", "playbook_url": "https://wpnews.pro/playbooks/llm-cost"}, "alternates": {"html": "https://wpnews.pro/news/claude-code-s-code-mode-does-it-actually-save-tokens", "markdown": "https://wpnews.pro/news/claude-code-s-code-mode-does-it-actually-save-tokens.md", "text": "https://wpnews.pro/news/claude-code-s-code-mode-does-it-actually-save-tokens.txt", "jsonld": "https://wpnews.pro/news/claude-code-s-code-mode-does-it-actually-save-tokens.jsonld"}}