A cross-platform notification plugin for OpenCode that alerts you when an agent finishes a task.
- Cross-Platform: Works on macOS, Linux (including WSL), and Windows.
- Smart Summaries: Extracts the first 5 words of the agent's completion message so you know what finished.
- Zero Config: Just install and it works.
-
Create the plugin directory if it doesn't exist:
mkdir -p ~/.config/opencode/plugin -
Copy the
index.tsfile to your plugin folder:cp index.ts ~/.config/opencode/plugin/notify.ts -
Restart OpenCode.
The plugin listens for the session.idle event, which triggers whenever the AI agent finishes generating a response and is waiting for user input. It then:
- Fetches the last message from the session history.
- Cleans up the text (removes code blocks, markdown).
- Truncates it to a short summary.
- Sends a native system notification.
- Linux:
notify-send(usually installed by default on Ubuntu/Debian vialibnotify-bin). - Windows: PowerShell (optional:
BurntToastmodule for better notifications). - macOS: No extra requirements.
MIT License. Feel free to modify and distribute as you see fit.