Overview

Loop supports extensions written in Rhai, a lightweight embedded scripting language for Rust. Extensions let you register custom commands, hook into agent events, and add custom logic to your workflow.

Setup

Place Rhai extension scripts in ~/.loop/agent/extensions/:
Configure them in settings:

Available APIs

Register Commands

Create custom slash commands:
Usage in the TUI:

Notifications

Send notifications to the TUI:

Extension Loading

Extensions are loaded at startup and when you run /reload. They execute in a sandboxed Rhai engine with access to Loop’s extension API.

Limitations

The Rhai extension system currently provides:
  • register_command — Register custom slash commands
  • notify — Send notifications to the TUI
Additional APIs for tool registration and hook integration are planned for future releases.
For declarative lifecycle hooks without scripting, see Hooks in the Features section.