installsource
guide / coding agents

opencode notifications on Mac, from the notch.

Save a small plugin as ~/.config/opencode/plugins/drip.js and opencode shows a card from your Mac's notch when it asks for a permission, and another when a session is done. Install drip first with brew install jrnxf/tap/drip.

brew install jrnxf/tap/drip

opencode has plugins instead of hooks, so this recipe is a plugin and installs nothing in drip. Save this as ~/.config/opencode/plugins/drip.js:

export const Drip = async ({ $, directory }) => {
  const project = directory.split("/").pop()
  return {
    event: async ({ event }) => {
      const id = `opencode:${event.properties?.sessionID}`
      if (event.type === "permission.asked") {
        const detail = `opencode wants to use ${event.properties.permission}`
        await $`drip info ${`${project} needs you`} -d ${detail} --id ${id} --icon terminal.fill --stay`.quiet().nothrow()
      } else if (event.type === "session.idle") {
        await $`drip ok ${`${project} is done`} --id ${id} --icon terminal.fill`.quiet().nothrow()
      }
    },
  }
}

drip is a free, open-source macOS CLI that shows scriptable notification cards from the MacBook notch, for builds, deploys and coding agents like Claude Code, Codex and Gemini CLI.

For permission cards only, drop the session.idle branch.

How it works

  1. Plugins, not hooks. opencode loads plugins from ~/.config/opencode/plugins/. This one listens to opencode's events and calls drip itself.
  2. A permission shows a waiting card. On permission.asked the plugin runs drip info --stay: my-app needs you, with opencode wants to use and the permission as the detail.
  3. An idle session shows a done card. On session.idle the plugin runs drip ok: my-app is done.
  4. The done card replaces the waiting one. Both use the id opencode:<session>, so a session has one card that changes in place.
  5. Named by project. The title is the last folder of the directory opencode runs in.

FAQ

Do I need drip hook for opencode?

No. opencode has plugins instead of hooks, so the plugin calls drip info and drip ok directly. drip hook is for Claude Code, Codex and Gemini CLI.

How do I get cards for permissions only?

Drop the session.idle branch from the plugin. Then only the waiting card shows, and no done card follows it.

How does the waiting card go away?

It stays until you click it, the done card of the same session replaces it, or 10 minutes pass. The plugin has no event that takes the card away when you answer in the terminal.

Can I allow or deny from the card?

No. The cards only tell you. The --approve flag is for drip hook with Claude Code and Codex.

Does a failing drip break opencode?

No. The plugin runs drip with .quiet().nothrow(), so a drip that fails does not throw in the plugin.

Related