This page is for developers who want to write their own extensions. It covers the basic concepts and how extensions work. If you just want the Agent to build one for you, see Plugin Extensions. For the release status of each capability, see Capabilities and progress.
The render chain and
Each session has one status band, shared by every plugin that draws
What an extension is
An extension (full name “plugin extension”) is a TypeScript program inside a plugin. It can draw a line or two in the status band, add its own panel to the conversation’s side panel, give the conversation its own backdrop and colors, add commands to the/ menu in the message box, and react to events in the conversation, such as the end of a turn or the Agent calling a tool.- Status band: the strip above the message box, inside its border. All plugins share one band, and each draws a line or two in it. Its site name in code is
above-prompt. - Panel: a tab in the conversation’s side panel on the right, next to tabs such as Files and Browser. Its site name in code is
pane. - Backdrop Coming soon: the backdrop behind the conversation in the main window, a layer under all the panels. It replaces the wallpaper while a plugin theme is active. Its site name in code is
backdrop.
hooks/register.tsx. It exports a register function, and you register handlers inside it with on(...).Some terms:Extensions here have nothing to do with “model access extensions” (“My extensions”) in usage settings, and they aren’t Chrome browser extensions.
What an extension can do
- Draw a line or two in the status band (
above-prompt). - Add its own panel to the side panel (
pane). - Coming soon Set a theme for the conversation: draw an SVG picture on the backdrop (
backdrop), and generate a full palette from a few anchor colors (ctx.theme). - Coming soon Add commands to the
/menu in the message box (ctx.command). A command runs right away when the user picks one without an argument hint from the menu, or types/command argumentsand presses Enter. The result shows as a notice and isn’t sent to the model. - Observe events: session start, turn start and end, tool calls and results, context usage changes, the user closing the panel.
- Call MCP tools that ship with the plugin or are already configured (
ctx.mcp.call), and read and write files or access the network through them. - Save state: session state (
ctx.state) and data that persists across sessions (ctx.store). - Fill text into the message box, show a gray suggestion, and read the draft (
ctx.prompt). Sending stays up to the user. - Run one inference call on the model (
ctx.model.complete). - Start a background subagent (
ctx.agent.spawn). - Read context usage (
ctx.session.usage()). - Show toasts (
ctx.ui.toast) and set timers withctx.clock.
How extensions work
File structure
An extension lives in an ordinary plugin package:plugin.jsonpoints tohooks.jsonwith"hooks": ["hooks/hooks.json"].modulesinhooks.jsoncan have only one entry:"./register.tsx".- The package has no
package.jsonand no installed dependencies. A module imports only from files in the package and@minimax/mcode-plugin-extension(plus/ui,/jsx-runtime, and/jsx-dev-runtime; tests can also import/testing).
A minimal extension
This is the template the Agent generates when it runsinit with the extension tool and the title Counter, written here in JSX. It shows a click count in the status band. When you press the button, the count goes up by one, a toast appears, and some text is filled into the message box.hooks/state.ts
hooks/register.tsx
register(on)
register runs once when the extension loads. You can only call on() at its top level: not inside an if, a loop, or a callback, and not after an await. A matcher (such as { site: 'above-prompt' }) must be an object literal whose values are string literals. Static checks enforce these rules. See Events.There are two kinds of hooks:ui.render: the host calls it when it needs to draw a site, and it returns an element tree.- Observe events:
session.start,turn.start,turn.complete,tool.call,tool.result,session.measure,ui.close.
ctx. Callbacks such as a button’s onPress receive only their own value and use the enclosing hook’s ctx through a closure. Always write ctx out in full (ctx.state.set(...)). Don’t destructure it or rename it.The render chain and next()
Each session has one status band, shared by every plugin that draws above-prompt. The panel works the same way: every plugin that matches the panel takes part in drawing it. Each plugin is a layer in the render chain, and await next() returns what the layers after yours drew.So put await next() in your element tree, usually as the last child of a vertical Box. If you leave it out, the plugins after you can’t draw, and you get the diagnostic EXTENSION_SHADOWING.Coming soon The status band will be drawn in two steps: each plugin’s above-prompt draws its own row, independently of the others. Filtering and ordering across plugins move to above-prompt-list, where the render chain runs over those rows. Keeping await next() in above-prompt stays compatible. See Status band row arrangement.The host keeps the drawn result and only redraws when a ctx.state key read during drawing changes, or after you call ctx.ui.invalidate(). See Interface: sites and elements.Where it runs
Extensions run in the main window of local sessions in the MiniMax Code desktop app. You develop, preview, and use installed extensions there: the status band shows above the message box, and the panel shows in the side panel on the right.Choosing between extensions and other features
Extensions and MCP often work together: the plugin includes an MCP server that reads and writes data, and the extension calls it with
ctx.mcp.call and draws the result in the status band or panel.What an extension can reach
Previewing an extension also needs permission. The first time the Agent runs
preview in a session, a permission card appears. You can allow it for this chat only, or always allow it.How to get an extension
- Have the Agent write it: describe what you want in a sentence. The Agent writes the code and previews it, and you install it once you’re happy. See Plugin Extensions.
- Write it yourself: write the code in your editor, then test, preview, and install it through the Agent. See Write your first extension.
- Install an official plugin: official plugins in the plugin marketplace can also include extensions. Once installed, they work in all local sessions.
Version
These docs cover extension API0.1.0. If the type files in .minimax-plugin/types/ in your plugin package differ from the docs, the type files win.Next steps
Write your first extension
Go from init to install and build a status band that shows tool call counts.
Interface: sites and elements
Rules for the status band and panel, and the elements you can use.
Events (hooks)
ui.render and each observe event.Extension API
State, MCP, the message box, the model, and subagents.