● In a recent post, Elvis called Anthropic's latest release "another banger guide" and said it's essential reading for anyone building AI agents. The new framework tackles three big pain points—token costs, speed, and tool complexity—by rethinking how agents interact with Model Context Protocol (MCP) tools and shifting more work into code execution environments. Anthropic's approach fundamentally changes how agents handle tools and data, unlocking serious performance improvements across the board.
● The guide kicks off by addressing the token efficiency problem. Traditional MCP setups load every tool definition into context and route all intermediate results through the model, often burning through 150,000+ tokens per workflow. Anthropic's code-as-API method flips the script: it treats MCP servers as TypeScript-like modules that agents can import and call directly. Some workflows that used to cost 150k tokens now run on just 2,000—a 98.7% drop. That means lower costs and faster execution.
● Anthropic also introduces progressive tool discovery, so agents only load the tools they actually need at each step instead of dumping everything upfront. When combined with in-environment data processing, agents can crunch large datasets—like filtering 10,000 spreadsheet rows down to five relevant ones—before passing anything to the model. This keeps context lean and avoids wasting tokens.
● The guide pushes for better control flow too, encouraging developers to handle loops, conditions, and errors using native code instead of chaining tool calls through the model. On the privacy front, sensitive data can now stay inside the execution environment rather than being exposed in the model's context, with optional automatic PII tokenization. Agents can also maintain state persistence by saving intermediate files and can build reusable capabilities through documented SKILL.md functions.
● Anthropic acknowledges the approach is more complex and comes with trade-offs, but this guide represents a big step forward in building AI agents that scale better, cost less, and work more reliably. For developers working on advanced agent systems, this could become the new blueprint for next-gen AI tooling.
Peter Smith
Peter Smith