diff --git a/documentation/blog/2025-12-15-code-mode-mcp/index.md b/documentation/blog/2025-12-15-code-mode-mcp/index.md index 5118dd623067..96f1326a7802 100644 --- a/documentation/blog/2025-12-15-code-mode-mcp/index.md +++ b/documentation/blog/2025-12-15-code-mode-mcp/index.md @@ -33,7 +33,7 @@ posts. Since the approach and the benefits are clearly laid out in those posts I ## In goose -In v1.17.0 of goose, we've introduced an open source implementation of this idea in a new platform extension called: Code Execution. +In v1.17.0 of goose, we've introduced an open source implementation of this idea in a new platform extension called: Code Mode. Our implementation generates a JavaScript interface representing the connected MCP tools and then lets the model write code to run against it in [boa](https://github.com/boa-dev/boa) which is an embeddable JavaScript engine. One neat feature of boa we were able to take advantage of was the concept of [NativeFunction](https://docs.rs/boa_engine/latest/boa_engine/native_function/struct.NativeFunction.html). @@ -47,7 +47,7 @@ MCP server with ease! Our hope is that we improve tool calling performance and handling of large numbers of tools in goose, but also provide an open source implementation of this emerging approach. -* Try out the feature by enabling the ["Code Execution" extension](https://github.com/block/goose/blob/main/crates/goose/src/agents/code_execution_extension.rs) in v1.17.0 or later of goose by clicking extensions on the left side of the desktop app or running `goose configure` on cli +* Try out the feature by enabling the ["Code Mode" extension](https://github.com/block/goose/blob/main/crates/goose/src/agents/platform_extensions/code_execution.rs) in v1.17.0 or later of goose by clicking extensions on the left side of the desktop app or running `goose configure` on cli * Please give us feedback on how it works for you by joining our [discord](https://discord.gg/goose-oss). Kudos to my colleague [Mic Neale](https://github.com/michaelneale) for collaborating with me on the implementation! diff --git a/documentation/blog/2025-12-21-code-mode-doesnt-replace-mcp/index.md b/documentation/blog/2025-12-21-code-mode-doesnt-replace-mcp/index.md index d9123bc2f9cb..c36c8d2154a2 100644 --- a/documentation/blog/2025-12-21-code-mode-doesnt-replace-mcp/index.md +++ b/documentation/blog/2025-12-21-code-mode-doesnt-replace-mcp/index.md @@ -37,7 +37,7 @@ When the concept of Code Mode landed on socials, many people claimed it was a re ### How goose Implemented Code Mode -[goose](/) took a unique approach by making [Code Mode](/blog/2025/12/15/code-mode-mcp) itself an extension called the Code Execution extension. When active, it wraps your other extensions and exposes them as JavaScript modules, allowing the LLM to see only three tools instead of eighty. +[goose](/) took a unique approach by making [Code Mode](/blog/2025/12/15/code-mode-mcp) itself an extension called the Code Mode extension. When active, it wraps your other extensions and exposes them as JavaScript modules, allowing the LLM to see only three tools instead of eighty. When the agent needs to perform a complex task, it writes a script that looks something like this: @@ -103,7 +103,7 @@ Code Mode helps us take a step forward in building agents that can scale to hand --- -*Ready to try Code Mode? Enable the "Code Execution" extension in [goose](/docs/quickstart) v1.17.0 or later. Join our [Discord](https://discord.gg/goose-oss) to share your experience!* +*Ready to try Code Mode? Enable the "Code Mode" extension in [goose](/docs/quickstart) v1.17.0 or later. Join our [Discord](https://discord.gg/goose-oss) to share your experience!* diff --git a/documentation/blog/2026-02-06-8-things-you-didnt-know-about-code-mode/index.md b/documentation/blog/2026-02-06-8-things-you-didnt-know-about-code-mode/index.md index de5cae4f5df6..8de87f755eea 100644 --- a/documentation/blog/2026-02-06-8-things-you-didnt-know-about-code-mode/index.md +++ b/documentation/blog/2026-02-06-8-things-you-didnt-know-about-code-mode/index.md @@ -27,12 +27,12 @@ Code Mode wraps your MCP tools as JavaScript modules, allowing the agent to comb ## 2. goose Supports Code Mode -Code Mode support landed in goose v1.17.0 in December 2025. It ships as a platform extension called "Code Execution" that you can enable in the desktop app or CLI. +Code Mode support landed in goose v1.17.0 in December 2025. It ships as a platform extension called "Code Mode" that you can enable in the desktop app or CLI. To enable it: -- **Desktop app:** Click the extensions icon and toggle on "Code Execution" -- **CLI:** Run `goose configure` and enable the Code Execution extension +- **Desktop app:** Click the extensions icon and toggle on "Code Mode" +- **CLI:** Run `goose configure` and enable the Code Mode extension Since its initial implementation, we've added so many improvements! diff --git a/documentation/docs/getting-started/using-extensions.md b/documentation/docs/getting-started/using-extensions.md index 1d3263e0f390..e58fb6a59500 100644 --- a/documentation/docs/getting-started/using-extensions.md +++ b/documentation/docs/getting-started/using-extensions.md @@ -37,10 +37,11 @@ Platform extensions are built-in extensions that provide global features like co - [Apps](/docs/mcp/apps-mcp): Create, manage, and launch custom HTML apps in standalone windows - [Chat Recall](/docs/mcp/chatrecall-mcp): Search conversation content across all your session history -- [Code Execution](/docs/mcp/code-execution-mcp): Execute JavaScript code for tool discovery and tool calling +- [Code Mode](/docs/mcp/code-mode-mcp): Execute JavaScript code for tool discovery and tool calling - [Extension Manager](/docs/mcp/extension-manager-mcp): Discover, enable, and disable extensions dynamically during sessions (enabled by default) - [Summon](/docs/mcp/summon-mcp): Load skills and recipes, and delegate tasks to subagents (enabled by default) - [Todo](/docs/mcp/todo-mcp): Manage task lists and track progress across sessions (enabled by default) +- [Top of Mind](/docs/mcp/tom-mcp): Inject persistent instructions into goose's working memory every turn ### Toggling Built-in Extensions diff --git a/documentation/docs/guides/managing-tools/code-mode.md b/documentation/docs/guides/managing-tools/code-mode.md index 4db2c26415ea..49883b3ff291 100644 --- a/documentation/docs/guides/managing-tools/code-mode.md +++ b/documentation/docs/guides/managing-tools/code-mode.md @@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem'; Code Mode is a method of interacting with MCP tools programmatically instead of calling them directly. Code Mode is particularly useful when working with many enabled extensions, as it can help manage context window usage more efficiently. :::info -This functionality requires the built-in [Code Execution extension](/docs/mcp/code-execution-mcp) to be enabled. +This functionality requires the built-in [Code Mode extension](/docs/mcp/code-mode-mcp) to be enabled. ::: Code Mode controls how tools are discovered and called: @@ -21,7 +21,7 @@ Code Mode controls how tools are discovered and called: ## How Code Mode Works -The [Code Execution extension](/docs/mcp/code-execution-mcp) is an MCP server that uses the MCP protocol to expose three foundational meta-tools. When Code Execution is enabled, goose switches to Code Mode. For every request, the LLM writes JavaScript code that goose runs in a sandbox environment to: +The [Code Mode extension](/docs/mcp/code-mode-mcp) is an MCP server that uses the MCP protocol to expose three foundational meta-tools. When Code Mode is enabled, goose switches to Code Mode. For every request, the LLM writes JavaScript code that goose executes using [pctx (Port of Context)](https://github.com/AdrianCole/pctx), a custom Deno-based runtime, to: - Discover available tools from your enabled extensions (if needed) - Learn how to work with the tools it needs for the current task - Call those tools programmatically to complete the task @@ -32,7 +32,7 @@ Traditional MCP tool calling and Code Mode are two different approaches to the s | Aspect | Traditional | Code Mode | |--------|------------------|-----------| -| **Tool Discovery** | All tools from enabled extensions, for example:
• `developer.shell`
• `developer.text_editor`
• `github.list_issues`
• `github.get_pull_request`
• `slack.send_message`
• ... *potentially many more* | Code Execution extension's meta-tools:
• `list_functions`
• `get_function_details`
• `execute`

The LLM uses these tools to discover tools from other enabled extensions as needed | +| **Tool Discovery** | All tools from enabled extensions, for example:
• `developer.shell`
• `developer.text_editor`
• `github.list_issues`
• `github.get_pull_request`
• `slack.send_message`
• ... *potentially many more* | Code Mode extension's meta-tools:
• `list_functions`
• `get_function_details`
• `execute`

The LLM uses these tools to discover tools from other enabled extensions as needed | | **Tool Calling** | • Sequential tool calls
• Each result sent to the LLM before the next call | • May require tool discovery calls
• Multiple tool calls batched in one execution
• Intermediate results are chained and processed locally | | **Context Window** | Every LLM call includes all tool definitions from enabled extensions | Every LLM call includes the 3 meta-tool definitions, plus any tool definitions previously discovered in the session | | **Best For** | • 1-3 enabled extensions
• Simple tasks using 1-2 tools | • 5+ extensions
• Well-defined multi-step workflows | diff --git a/documentation/docs/guides/tips.md b/documentation/docs/guides/tips.md index b9d447cc7e6c..361ed65da126 100644 --- a/documentation/docs/guides/tips.md +++ b/documentation/docs/guides/tips.md @@ -29,7 +29,7 @@ Press `Cmd+Option+Shift+G` (macOS) or `Ctrl+Alt+Shift+G` (Windows/Linux) and sen ### Turn off unnecessary extensions or tool Turning on too many extensions can degrade performance. Enable only essential [extensions and tools](/docs/guides/managing-tools/tool-permissions) to improve tool selection accuracy, save context window space, and stay within provider tool limits. -:::tip Code Execution for Many Extensions +:::tip Code Mode for Many Extensions Consider enabling [Code Mode](/docs/guides/managing-tools/code-mode), an alternative approach to tool calling that discovers tools on demand. ::: diff --git a/documentation/docs/mcp/code-execution-mcp.md b/documentation/docs/mcp/code-mode-mcp.md similarity index 74% rename from documentation/docs/mcp/code-execution-mcp.md rename to documentation/docs/mcp/code-mode-mcp.md index 607cd90580f6..c01cb22f23cb 100644 --- a/documentation/docs/mcp/code-execution-mcp.md +++ b/documentation/docs/mcp/code-mode-mcp.md @@ -1,5 +1,5 @@ --- -title: Code Execution Extension +title: Code Mode Extension description: Execute JavaScript code to interact with multiple MCP tools --- @@ -8,9 +8,11 @@ import TabItem from '@theme/TabItem'; import { PlatformExtensionNote } from '@site/src/components/PlatformExtensionNote'; import GooseBuiltinInstaller from '@site/src/components/GooseBuiltinInstaller'; -The Code Execution extension enables [Code Mode](/docs/guides/managing-tools/code-mode), a programmatic approach for interacting with MCP tools. +The Code Mode extension enables [Code Mode](/docs/guides/managing-tools/code-mode), a programmatic approach for interacting with MCP tools. -In Code Mode, the LLM discovers which tools are available from your enabled extensions and writes JavaScript code that goose runs in one execution instead of calling tools directly and one at a time. This helps manage context window usage more efficiently when multiple extensions are enabled and when performing workflows with multiple tool calls. +The Code Mode extension is an MCP server that exposes three meta-tools. When Code Mode is enabled, the LLM writes JavaScript code that goose executes using a Deno-based runtime called [Port of Context](https://github.com/AdrianCole/pctx) to discover tools, learn their interfaces, and call them programmatically. + +This helps manage context window usage more efficiently when multiple extensions are enabled and when performing workflows with multiple tool calls. ## Configuration @@ -19,7 +21,7 @@ In Code Mode, the LLM discovers which tools are available from your enabled exte diff --git a/documentation/static/servers.json b/documentation/static/servers.json index 3acc9c3efe9e..3c0c6f859763 100644 --- a/documentation/static/servers.json +++ b/documentation/static/servers.json @@ -229,6 +229,17 @@ } ] }, + { + "id": "code_execution", + "name": "Code Mode", + "description": "Execute JavaScript code to interact with MCP tools efficiently", + "command": "", + "link": "https://github.com/block/goose/tree/main/crates/goose/src/agents/platform_extensions/code_execution.rs", + "installation_notes": "This is a built-in platform extension that comes with goose. No installation required.", + "is_builtin": true, + "endorsed": true, + "environmentVariables": [] + }, { "id": "developer", "name": "Developer", @@ -639,6 +650,17 @@ } ] }, + { + "id": "summon", + "name": "Summon", + "description": "Load skills and delegate tasks to subagents", + "command": "", + "link": "https://github.com/block/goose/tree/main/crates/goose/src/agents/platform_extensions/summon.rs", + "installation_notes": "This is a built-in platform extension that comes with goose. No installation required.", + "is_builtin": true, + "endorsed": true, + "environmentVariables": [] + }, { "id": "supabase", "name": "Supabase", @@ -691,6 +713,28 @@ } ] }, + { + "id": "tom", + "name": "Top of Mind", + "description": "Inject persistent instructions into goose's working memory every turn", + "command": "", + "link": "https://github.com/block/goose/tree/main/crates/goose/src/agents/platform_extensions/tom.rs", + "installation_notes": "This is a built-in platform extension that comes with goose and is enabled by default. Configure via GOOSE_MOIM_MESSAGE_TEXT or GOOSE_MOIM_MESSAGE_FILE environment variables.", + "is_builtin": true, + "endorsed": true, + "environmentVariables": [ + { + "name": "GOOSE_MOIM_MESSAGE_TEXT", + "description": "Literal text injected into working memory each turn", + "required": false + }, + { + "name": "GOOSE_MOIM_MESSAGE_FILE", + "description": "Path to a file whose contents are injected (supports ~/)", + "required": false + } + ] + }, { "id": "tutorial-mcp", "name": "Tutorial",