Skip to main content
Mythos

Code Mode is an agent tool-use pattern in which a model writes code against 📝Model Context Protocol (MCP) tools presented as a typed API and runs it in a sandbox, so only the final result enters its context.

📝Cloudflare named the pattern on September 26, 2025, in a post by Kenton Varda and Sunil Pai. It argued that models handle more and more complex tools as a TypeScript API because their training data holds far more real-world code than synthetic tool-call examples, and that chained calls no longer route every intermediate result through the model. Generated code runs in a V8 isolate with no internet access and reaches tools only through bindings that hold the credentials, so API keys never enter the sandbox.

📝Anthropic described the same approach as code execution with MCP on November 4, 2025, citing one workflow that fell from 150,000 to 2,000 tokens. On November 24 it shipped Programmatic Tool Calling and the Tool Search Tool as Claude Developer Platform betas; that post put a five-server setup of 58 tools at roughly 55,000 tokens of definitions. Block's goose agent added an open-source Code Mode extension in v1.17.0 in December 2025.

In February 2026 Cloudflare moved the pattern server-side: its Cloudflare API MCP server exposes more than 2,500 endpoints through two tools, search() and execute(), in about 1,000 tokens, against an estimated 1.17 million as individual tools. Code Mode changes how a client presents MCP tools rather than replacing the protocol, which still supplies uniform connection, authorization and documentation. Anthropic notes the trade-offs: it requires a secure sandbox, and it helps little for single quick lookups or tasks where the model should reason over every intermediate result.

MythOS's own MCP already takes the first step: extended tools stay out of the catalog behind list_extended_tools and call_extended_tool. Code Mode is the next one — letting agents script memo operations instead of calling them one at a time.

Contexts

Created with 💜 by One Inc | Copyright 2026