Properties2
TypePractice
Note createdMar 5, 2026

OpenCode supports desktop notifications and sound alerts through the @mohak34/opencode-notifier plugin. This is how to set it up on macOS with Ghostty.

Plugin installation

Add the plugin to the global OpenCode config at ~/.config/opencode/opencode.jsonc:

{
  "plugin": ["@mohak34/opencode-notifier@latest"]
}

After adding it, kill all OpenCode processes and restart. The plugin is installed automatically via Bun at startup.

Notification system

The plugin supports three notification backends on macOS: osascript (default, shows Script Editor icon), node-notifier (custom icon but unreliable), and ghostty (native terminal notifications via OSC 777).

Configuration

Create ~/.config/opencode/opencode-notifier.json to customize behavior. The current configuration uses Ghostty notifications with macOS system sounds:

{
  "notificationSystem": "ghostty",
  "sounds": {
    "complete": "/System/Library/Sounds/Tink.aiff",
    "error": "/System/Library/Sounds/Sosumi.aiff",
    "permission": "/System/Library/Sounds/Basso.aiff",
    "question": "/System/Library/Sounds/Pop.aiff"
  }
}

Events

EventWhen it firesSound
completeSession finishedTink
errorSession errorSosumi
permissionAgent needs approvalBasso
questionAgent asks a questionPop
subagent_completeSubagent finishedSilent by default
user_cancelledESC pressedSilent by default

Other options

The plugin also supports per-event volume control (volumes), custom notification messages with placeholders like {sessionTitle} and {projectName}, focus suppression (suppressWhenFocused), and a custom command hook to run arbitrary scripts on events.