Native Windows toast notifications for Claude Code
npx claudepluginhub chuilishi/claude-code-notifyNative Windows toast notifications for Claude Code with window activation
Share bugs, ideas, or general feedback.
Native Windows Toast notifications for Claude Code
Click the notification to jump back to your Claude Code window
claude plugin marketplace add chuilishi/claude-code-notify
claude plugin install claude-code-notify@claude-code-notify
That's it. Restart Claude Code and notifications will work automatically.
After Claude finishes responding, a notification appears:
| Action | Result |
|---|---|
| Left-click | Jump back to Claude Code window |
| Right-click / X | Dismiss notification |
claude plugin uninstall claude-code-notify
This project uses Claude Code's plugin system to register hooks automatically — no manual settings.json editing required. Hooks are defined in hooks/hooks.json and discovered by Claude Code at startup.
| Hook | Trigger | Action |
|---|---|---|
UserPromptSubmit | You send a message | Saves current window handle, active tab, and caller app icon |
Stop | Claude finishes | Shows "Task completed" notification (orange border) |
Notification | Claude needs input | Shows "Input required" notification (yellow border) |
| Click notification | — | Activates saved window and switches to the correct tab |
Each Claude Code session has a unique session_id (received via stdin JSON). State is stored per-session in %TEMP%\claude-notify-{session_id}.txt, so multiple Claude instances don't interfere with each other.
When running inside Windows Terminal, simply bringing the window to the foreground isn't enough — the user may have switched to a different tab. This project uses the Windows UI Automation API to:
CASCADIA_HOSTING_WINDOW_CLASS window class)IUIAutomationSelectionItemPattern::Select() to switch back to itThe notification displays the icon of the app you're using (VSCode, Cursor, JetBrains IDEs, etc.), not a generic icon. This is done by walking up the process tree at prompt time:
ExtractIconExW() and displays it in the toastWindows restricts SetForegroundWindow() — a background process can't just steal focus. This project uses several techniques to work around it:
AllowSetForegroundWindow(ASFW_ANY) to permit foreground changesAttachThreadInput) between current, foreground, and target threadsSetWindowPos + BringWindowToTop + SwitchToThisWindow + SetForegroundWindow for reliable activationMultiple notifications stack vertically (Telegram-style) without overlapping:
ClaudeCodeToast and discover each other via EnumWindowsToasts are created with WS_EX_NOACTIVATE | WS_EX_TOPMOST | WS_EX_LAYERED, so they:
MIT License