Home / Companies / WorkOS / Blog / Post Details
Content Deep Dive

Cloudflare: Code Mode Cuts Token Usage by 81%

Blog post from WorkOS

Post Details
Company
Date Published
Author
Zack Proser
Word Count
875
Language
English
Hacker News Points
-
Summary

At MCP Night: The Holiday Special, Cloudflare's VP of AI & Developers, Rita Kozlov, introduced "Code Mode," a novel approach that could reshape the future of Multi-Cloud Platform (MCP) operations by enabling AI agents to generate and execute code instead of relying on direct tool calls. This method showcased significant advantages in efficiency, particularly in complex tasks, by reducing token consumption—a vital consideration for enterprise-level applications. While traditional tool-calling requires multiple interactions, Code Mode allows for code generation that can efficiently manage tasks through loops and conditionals, as illustrated in a demo where both methods created 31 events, but Code Mode consumed 81% fewer tokens. This approach leverages Cloudflare's Workers Loader for instant sandbox execution, highlighting a potential hybrid model that combines direct tool invocation for simple tasks and code generation for more complex operations, pointing to a more efficient future for MCP applications. Cloudflare is currently expanding access to Code Mode, which is in closed beta, and is seeking a product manager to further develop their AI and MCP strategies.