Skip to main content
Extensions add commands, model tools, and terminal widgets to Mirror. Several everyday features, including the model picker, editor, service connections, memory, and feedback form, are bundled extensions.
Mirror and its extension API are in early beta.
  • Check /help for the commands loaded in your installation.
  • Test custom extensions after upgrading.

Enable or disable an extension

  1. Run /extensions to open the picker.
  2. Type to filter the list, then use the arrow keys to select an entry.
  3. Press Enter to toggle it. The picker stays open so you can change several entries.
  4. Press Escape when finished.
Disabling an extension removes its commands, tools, and UI from the running workspace agents.
Mirror extensions picker filtered to workspace-note, with the extension enabled

The picker filtered to the custom workspace-note extension used below. A filled circle marks it as enabled.

Choices persist in ~/.mirror/config.json:
  • Bundled entries use keys such as builtin/editor.
  • External entries use the resolved absolute path to their extension.py file.
  • Moving an external extension can trigger a new trust decision.

Bundled extensions

These names appear in the picker:

Install an external extension

An external extension is a directory with an extension.py file. Choose a location:
  • Outside a repository, Mirror checks the launch directory for project extensions.
  • Discovery uses the launch directory. Switching workspaces does not scan a new directory for additional extensions.
  1. Add the extension.py file in one of these locations.
  2. Start Mirror.
  3. Review the code and select Enable if you trust it.
For newly discovered external code, the consent prompt offers these choices:
Extensions run Python code inside Mirror with your account’s permissions.
  • Enabling an extension allows its imports and callbacks to execute.
  • Tool-approval mode does not sandbox that code.
  • Use /extensions to change the decision later.
  • After editing Python source, toggle the extension off and on, or restart Mirror.
  • Saving the file alone does not reload its code.
With mirror --trust-extensions:
  • Newly discovered external extensions are enabled without the consent prompt.
  • Existing disabled choices are preserved.
To suppress external discovery for a launch while keeping bundled features available:

Example: a workspace reminder

This extension adds /note and shows its text above the prompt. It performs no file, network, or model operations. Create the directory in your project:
Save this as .mirror/extensions/workspace-note/extension.py:
  1. Start Mirror.
  2. Enable workspace-note when prompted.
  3. Set a reminder with /note:
A custom workspace reminder displayed above the Mirror prompt

The example extension renders a reminder above Mirror's prompt in a demonstration project.

The text belongs to the workspace’s current session. This example does not save reminders to disk.

How the example works

  1. slash_commands() registers the command. Its handler returns a RoutedExtensionAction containing the text.
  2. reduce() applies that action to this workspace’s extension state.
  3. render() draws the resulting reminder above the prompt.
When writing an extension:
  • Keep id() stable and unique.
  • Define one concrete Extension subclass in the module, with a no-argument constructor.
  • Set supports_local = True for local workspaces.

Extension API

Start with the reminder example, then add the hooks your extension needs:
  • Keep file and network operations out of reduce() and render().
  • Emit an effect and do the work in handle_effect() so rendering remains responsive.
A model-facing tool must:
  • Expose a ToolDefinition.
  • Implement async execute(arguments: str) -> ToolResult. The argument string contains JSON.
Tools require model-call approval by default, subject to the workspace’s approval mode.

Extensions across workspaces

Store workspace-specific values in extension state, as the reminder example does, rather than on the shared Python object.

Ask Mirror to create an extension

Enable the bundled user_extensions entry in /extensions to let the agent author and manage global user extensions. It exposes the user-extensions__extensions tool with these actions: For example:
  • Review the generated code before asking Mirror to load it.
  • create only writes the scaffold. Loading is a separate step.
  • If you want tool-call review while the agent works, choose manual approval with /permissions.

Troubleshoot an extension

Remove API keys and private code before sharing logs. See reporting a bug.