Code Mode: Cutting Token Waste by Keeping Results Local
A traditional agent loop sends every intermediate result to the model. Reading 50,000 lines of log files costs tokens for every line. Code Mode changes that. Goose generates a TypeScript interface from all connected MCP tools. The model writes code that calls tools inside a sandbox. The code loops over files, reads them into local variables, and filters results. Only 240 lines of filtered output go back to the model. The neural network stops being a control flow primitive.
ACP: One Agent, Four Clients, One Protocol
The Agent Client Protocol standardizes how clients control agents. Goose implemented ACP support. Hancock showed four clients running simultaneously: a new terminal interface, an open-source client called Toad, a rewritten Goose desktop app, and the Z editor. All four sent the same prompt to write a poem. The Z editor streamed back file opens and text edits into new tabs. ACP with HTTP support would let a client on any machine control an agent running elsewhere.
MCP Apps: From Early Adoption to Spec Influence
Goose grabbed MCPUI early, before it became the MCP apps extension. Hancock used the Excalidraw MCP app to build one of his slides. The app took over the entire Goose window. He then demoed a non-standard feature: sampling from the app’s front-end code. The app sends a sampling request over the bridge to the host, which uses its model connection to return a completion. This lets apps become AI-powered themselves. Hancock is pushing to get this into the official apps SDK.
Q&A
How does sampling from the front-end app work with the current SDK? The SDK has a fallback handler for non-standard messages, and Goose checks the message type to forward sampling requests to its model connection. ▶ Watch (20:54)
Does Goose support long-running tasks? The Rust SDK models task primitives, but Goose has no user experience for backgrounding or canceling tasks yet. ▶ Watch (22:16)
Notable Quotes
I want to talk today about what I see as a useful proving ground and a place for us to collaborate on new MCP features and experiment in this space. Alex Hancock · ▶ Watch (0:37)
If you have an idea for MCP that’s like way different than how MCP works today, but you think it could be way better, Goose is a really great place where you can come, people can collaborate across companies, people can submit changes, and we’ll consider them and get them merged and get them shipped. Alex Hancock · ▶ Watch (6:23)
This is a cool win for open source and an example of where open source really helps when doing features like this. Alex Hancock · ▶ Watch (11:08)
Key Takeaways
- Code Mode reduces token costs by executing tool logic in a sandbox instead of the model.
- ACP standardizes client-agent communication, enabling interchangeable front ends.
- Goose incubates experimental MCP features like front-end sampling before spec inclusion.
About the Speaker(s)
Alex Hancock is a core maintainer of goose, and maintainer of the Rust SDK for the Model Context Protocol. Alongside teammates at Block he built and contributed goose as a founding project of the Agentic AI Foundation. He lives in Connecticut in the US with his wonderful family.