Skip to content

Repository files navigation

logo

NotifAI

Mirror AI-agent notifications from your PC to your phone and Apple Watch

Version .NET ntfy.sh License


What it does

A tiny Windows tray app watches the Windows notification stream, filters to an allowlist of apps (VSCode, Cursor, Claude desktop, Copilot, Cowork, …), and forwards each one to ntfy.sh — whose iOS app delivers to your phone and mirrors to your Apple Watch automatically. No mobile app, push server, or Apple Developer account to build.

 Windows toasts ─┐
 Claude Code hook ├─► NotifAI ─► https://ntfy.sh/<your-topic> ─► iPhone / Apple Watch
 Codex hook ──────┘

Desktop app mirror

  • Reads every app's toasts via the Windows UserNotificationListener.
  • Forwards only apps on your allowlist; matched case-insensitively by name.
  • Classifies text into ntfy priority + tags (error → high, needs-input → question).
  • Dedupes by notification id so the same toast never double-sends.
  • Apps ▸ tray submenu lists every app seen this session — one click to toggle.

CLI agent hooks

  • Claude Code and Codex run in a terminal and don't reliably raise a toast, so they call NotifAI.exe --send directly — same ntfy topic, no dependency on the mirror.
  • Set up CLI agents… writes the hooks into their own config files for you, idempotently, backing up any existing file first.

Per-machine topics + QR

  • On first run each PC auto-assigns a unique topic (NotifAI-<machine>-<random>) so different machines never collide.
  • Show QR to subscribe renders the ntfy:// deep-link — scan it in the ntfy app to subscribe your phone, no typing.

Install

Build from source with the .NET 8 SDK:

dotnet build

The exe lands in bin/Debug/net8.0-windows10.0.19041.0/win-x64/NotifAI.exe, with a config.json seeded next to it from config.example.json.

For a portable single-file release (packs to 7z):

./make-release.sh 1.0.0          # bash
powershell -File make-release.ps1 1.0.0   # PowerShell

This build is framework-dependent — it needs the .NET 8 Desktop Runtime installed (~1 MB exe instead of ~180 MB). If it's missing, Windows shows a prompt with a link to install it — accept and relaunch. Building from source with dotnet build works either way since it uses your local SDK.

Run

NotifAI.exe

On first launch it auto-assigns this machine a topic and asks Windows for notification access — click Yes. A tray icon appears.

Usage

Subscribe your phone

  1. Install ntfy on your iPhone (App Store).
  2. Tray → Show QR to subscribe (phone)….
  3. In ntfy tap subscribe and scan the QR. Apple Watch mirrors automatically.
  4. Repeat per machine (each has its own topic).

Forward a desktop app

  1. Trigger a notification from the app once so it appears under Apps ▸.
  2. Check it. Saved to config.json live — no restart.
  3. Apps that haven't notified yet: Add app manually… and type the name.

Wire up CLI agents (Claude Code, Codex)

  1. Tray → Set up CLI agents (Claude Code, Codex)… → confirm.
  2. It writes hooks into ~/.claude/settings.json and ~/.codex/config.toml (backing up to *.bak first), then restart the agent.

To wire them by hand instead, replace <PATH-TO>\NotifAI.exe with your exe path:

Claude Code~/.claude/settings.json:

{
  "hooks": {
    "Notification": [
      { "hooks": [ { "type": "command",
        "command": "\"<PATH-TO>\\NotifAI.exe\" --send \"Claude Code\" \"Needs your input\"" } ] }
    ],
    "Stop": [
      { "hooks": [ { "type": "command",
        "command": "\"<PATH-TO>\\NotifAI.exe\" --send \"Claude Code\" \"Task complete\"" } ] }
    ]
  }
}

Codex~/.codex/config.toml:

notify = ["<PATH-TO>\\NotifAI.exe", "--send", "Codex", "Turn complete"]

GitHub Copilot — no hook needed; it notifies through VSCode, which the mirror already forwards. Just check Visual Studio Code under Apps ▸.

Autostart (optional)

Drop a shortcut to NotifAI.exe in the Startup folder: press Win+R, type shell:startup, and put a shortcut there.

Security & privacy

  • Public ntfy.sh topics are world-readable. Anyone who knows the topic can read your notifications — keep the auto-generated random topic, add an ntfy access token, or self-host.
  • Notification text can contain code, paths, and errors and transits ntfy.sh. Self-host (ntfy.server in config.json) if that content must not leave your network.

How it works

File Role
Ntfy.cs One HTTP POST to your ntfy topic — the entire "push server".
Watcher.cs Polls UserNotificationListener, dedupes by id, classifies text → priority/tags.
TrayApp.cs Tray icon, Apps submenu, QR, agent setup, pause/test/config controls.
Config.cs Loads/saves config.json; auto-assigns a per-machine topic; builds the subscribe URL.
AgentSetup.cs Writes NotifAI hooks into Claude Code / Codex config files (idempotent, backs up first).
Program.cs Entry point; --send CLI path for hooks.

Polls every pollSeconds (default 2). Deliberately simple — see the ponytail: comments for the known ceilings and upgrade paths.

License

MIT. Delivery via ntfy — Apache-2.0 / GPLv2. QR codes via QRCoder — MIT.

About

Mirror AI-agent notifications from your PC to your phone and Apple Watch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages