今日已更新 35 条资讯 | 累计 37284 条内容
关于我们

I measured what code mode actually saves: 65,500 tokens vs 226

Code From Anywhere 2026年08月18日 23:22 4 次阅读 来源:Dev.to

Cloudflare named code mode in September 2025, resting it on one line: "LLMs are better at writing code to call MCP, than at calling MCP directly." The follow-up post put a number on it — an entire 2,500-endpoint API in about 1,000 tokens. I wanted my own number, on my own data, for a task I actually had. The task fetch all linear tickets in progress (full body for each) and count the amount of times we say 'mcp' across all of it 39 tickets. Nothing exotic — the kind of thing you ask an agent on a Tuesday. There are two ways an agent can do this. As tool calls. One list_issues , then a get_issue for each ticket. Every ticket body travels into the model, because the model is the thing holding the running total. Forty round trips, each one waiting on the model to decide what to ask next. As a script. The agent writes ten lines, runs them once, and reads back a number. The bodies never enter its context at all. The numbers into the model round trips as tool calls ~65,500 tokens (262,159 chars) 40, in sequence as one script ~226 tokens (903 chars) 1 290× less into context. 99.66% saved. The token figures use the rough four-characters-per-token heuristic — the character counts are the exact measurement, and the ratio is the part that survives different data. Yours will differ with your tickets. And ~65,500 is the floor, not the ceiling. In a tool-call loop, context is re-read on every subsequent turn. The script pays once. The part the token count misses Two things, and I think both matter more than the headline ratio. Latency. Forty sequential tool calls each wait for a model to decide what to ask next. The script issues the same forty HTTP requests without stopping to think between them. The token saving is money; the round-trip saving is the thing you actually sit through. Correctness. Counting occurrences of a substring across a quarter of a million characters of prose is something a model does approximately . A script does it exactly. So the tool-call path doesn't ju

本文内容来源于互联网,版权归原作者所有
查看原文