September 21, 2026
The runtime, not the protocol, is what matters: code instead of MCP calls cut spend by 98,7%
The difference between MCP and CLI is not the protocol, but whether the agent has an environment that remembers state between calls.

tobi lutke
@tobi
MCP versus CLI for LLMs is the wrong argument. People are arguing about the wrong layer. Both work perfectly as long as they run through an environment like a REPL that can retain state. It is funny that CLI tools are usually accessed through BASH, which is itself a REPL with persistent state (the filesystem), so CLI works much better than MCP. But that is nowhere near an inherent property of MCP. We just need better wrappers. The best REPLs for this right now are: - bash + filesystem - jupyter kernels - REPLs like codemode, usually quickjs LLMs are excellent at understanding the idea of progressively developing a system for a particular task. This came from agentic RL. They understand how to change the state of a codebase or retrieve data from databases and then work with it, roughly like people do. But without an execution environment, they cannot really do this properly. My bet? Soon someone will build (or perhaps already has?) an embeddable mini execution environment in the spirit of sqlite, which parses bash, typescript, or tool calls into a shared IL execution plan that can be easily checked for safety before running. And design it specifically for long-lived execution environments. Then we will simply connect cli, mcp, webmcp, whatever, and it will accept any input modality, because they can all be expressed through one another.
· 559.3K views
CLI and MCP completed the same set of tasks with equal success. They diverged on tokens: 1,3–2 million for CLI versus 35 thousand for MCP.
The issue turned out not to be the protocol. Both approaches work when the agent runs them in an environment that remembers state between calls, and both struggle when such an environment is absent.
Why bash won. The agent accesses CLI tools through bash, and bash keeps state in the filesystem: a written file remains between commands and does not disappear. MCP had no such memory between calls, which is why the terminal combination looked stronger.
The measurement these token figures come from is public and still the only one using the same tool: terminalcp, 3 tasks with 10 runs each in Claude Code, August 2025. CLI burned context because every bash call went through a dangerous-command check. The author of the measurement traced the difference to the design of the specific tool and called the protocol plumbing.
Anthropic tested the same idea internally and cut usage from 150 000 tokens to 2 000, or by 98,7%. The recipe is simple. MCP servers expose a file tree at `servers/<server>/<tool>.ts`, with each file wrapping a single tool, and the agent writes ordinary code against them.
You can get the environment today. On 6 September 2026, langchain-quickjs 0.3.7 shipped with a QuickJS-based JS sandbox that remembers state between calls. It installs with `pip install langchain-quickjs` and is enabled as `CodeInterpreterMiddleware()` in `create_deep_agent`. By default, it provides 64 MiB of memory and 5 seconds per call, with no filesystem or network inside.
Cloudflare Code Mode connects in three lines in the Agents SDK and runs code in a V8 isolate; locally, it works through Wrangler. At Anthropic, REPL state arrived in the `code_execution_20260120` tool; the container provides 5 GiB of memory, lives for 30 days, and is reused by passing its id.
Anthropic gives organizations 1550 execution hours per month for free, then charges $0,05 per container hour. To let the agent call your tools directly from code, add the `allowed_callers` field to their definition. On agent benchmarks, this delivered +11% quality with 24% fewer input tokens.
No one has yet put together a common execution plan that accommodates bash, TypeScript, and tool calls equally.
Source
