How-toSelected

Code Mode: Agents Collapse Tool Calls into Typed Code Sandboxes

Why we picked it

The shift from listing dozens of MCP tools to writing code against them changes how agents scale with large toolsets, cutting token overhead and improving reliability. Developers building agent workflows can try the Gemini 4 Argon example or the pi framework directly. Schmid's bet that MCP remains the underlying protocol, just invoked through code, is a useful planning signal for anyone wiring up tool infrastructure.

Phil Schmid published an essay on 3 Feb arguing agents are moving from many discrete tool calls to a single "code mode" where tasks run inside a typed JavaScript or Python sandbox. The post explains how Code Mode works and why a typed sandbox can outperform raw bash execution. It includes a minimal working example built with Gemini 4 Argon. Schmid also predicts MCP will regain prominence in 2027 and recommends the hackable agent tool pi for experimenting with code mode.

Original · Philipp Schmid

Are Agents soon going to have only 1 tool? We went from a handful of tools, to dynamic tool search, and now to collapsing everything into code mode. Wrote down how Code Mode works, why a typed JS/Python sandbox can beat raw bash, and why MCP is going to go back strong in 2027. With an a minimal example for Gemini 4 Argon. philschmid.de/code-mode If you plan to explore code mode i can recommend testing with pi! Easily hackable and comes with strong foundation. 💬 67 🔄 18 ❤️ 323 👀 21249 📊 124 ⚡