🔔 Claude Code Notify
Native Windows Toast notifications for Claude Code
📖 中文文档

Click the notification to jump back to your Claude Code window
✨ Features
- 🔔 Native Windows Toast — Clean, system-integrated notifications
- 🎯 One-Click Return — Click to jump back to your terminal/editor
- 🖥️ Wide Compatibility — VSCode, Cursor, JetBrains, Windows Terminal, and more
- 🔄 Tab-Aware — Supports Windows Terminal tab switching
- 🎨 Auto Icon — Extracts the calling application's icon
- 💬 Reply Preview — The done toast shows your prompt and the start of Claude's reply
- 🚨 Failure Alerts — Rate limits, billing and server errors show a red toast
🚀 Installation
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.
Requires Claude Code v2.1.139 or later for full functionality (failure toasts need v2.1.78+, reply preview needs v2.1.47+).
Options
Claude Code asks for these when you enable the plugin; change them later in /config:
| Option | Default | Description |
|---|
play_sound | on | Play a sound when a toast appears |
display_seconds | 3 | Seconds a toast stays before fading (hovering pauses it) |
idle_reminder | on | Remind you again when Claude has been waiting ~60s after finishing |
WSL Permission Fix
If you install the plugin inside WSL and hooks fail with Permission denied, make the bundled Windows executable runnable:
chmod +x ~/.claude/plugins/cache/claude-code-notify/claude-code-notify/*/notifications/ToastWindow.exe
This is the workaround from issue #2. If your cache path uses a fixed version directory, * can be replaced with that version, for example 1.1.0.
📖 Usage
After Claude finishes responding, a notification appears with your prompt as the title and the start of Claude's reply as the message:
| Action | Result |
|---|
| Left-click | Jump back to Claude Code window |
| Right-click / X | Dismiss notification |
🗑️ Uninstall
claude plugin uninstall claude-code-notify
⚙️ How It Works
Plugin System
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 Flow
| Hook | Trigger | Action |
|---|
UserPromptSubmit | You send a message | Saves current window handle, active tab, and caller app icon |
Stop | Claude finishes | Shows a done toast (orange border): your prompt as title, last_assistant_message as message; if background tasks or scheduled wakeups are pending, the title says so (e.g. "Waiting on 2 background tasks") |
StopFailure | The turn ends on an API error (rate limit, billing, 529, ...) | Shows a failure toast (red border) such as "Rate Limited" or "Billing Error" |
Notification | Claude needs input or something changed | Picks a title per notification_type: permission, idle, MCP form / URL, background sessions (agent view), usage-limit auto-resume, mod notifications; echo-only types like auth_success are skipped |
PreToolUse (AskUserQuestion | ExitPlanMode) | Claude asks a question or finishes a plan | Shows "Claude is Asking" / "Plan Ready for Approval" notification |
SessionEnd | Session ends | Cleans up the session's state file |
| Click notification | — | Activates saved window and switches to the correct tab |
Session Isolation
Each Claude Code session has a unique session_id (received via stdin JSON). State is stored per-session in %TEMP%\claude-notify-{session_id}.json (files left behind by sessions that never sent SessionEnd are pruned after 7 days), so multiple Claude instances don't interfere with each other.
Windows Terminal Tab Switching
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:
- Detect if the foreground window is Windows Terminal (by checking for the
CASCADIA_HOSTING_WINDOW_CLASS window class)
- Enumerate all tab items and record the RuntimeId of the currently selected tab at prompt time
- On notification click, find the tab with the matching RuntimeId and call
IUIAutomationSelectionItemPattern::Select() to switch back to it
Caller App Icon Extraction