A PowerShell script that displays Claude Code notifications as Windows desktop notifications from WSL.
Integrates with Claude Code's Notification and Stop hook system to provide native Windows notifications.
toast-notification.ps1- PowerShell script that displays Windows notifications with fallback chain
- Windows 10 or later
- PowerShell execution permissions
- Windows Runtime API (for toast notifications)
- System.Windows.Forms (.NET Framework)
The script is designed to work with Claude Code's Notification hook, which receives actual notification messages from Claude Code and displays them as Windows notifications.
Refer Claude Code hooks documentation for more details.
Add to your Claude Code settings file:
For Notification Hook Support:
{
"hooks": {
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "powershell.exe -ExecutionPolicy Bypass -File \"/path/to/toast-notification.ps1\""
}
]
}
]
}
}This will intercept all Claude Code notifications and display them as Windows toast notifications instead of (or in addition to) the default notification method.
For Stop Hook Support:
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "powershell.exe -ExecutionPolicy Bypass -File \"/path/to/cc-utils/toast-notification.ps1\""
}
]
}
]
}
}Input Priority: JsonInput → Stdin → Default
Override Rule: Title/Message parameters force override regardless of input source
# Default notification (lowest priority)
powershell.exe -File "/path/to/toast-notification.ps1"
# Manual JSON input (highest priority)
powershell.exe -File "/path/to/toast-notification.ps1" -JsonInput '{"title":"Test","message":"JSON test"}'
# Stdin input (Claude Code hook simulation)
echo '{"hook_event_name":"Notification","title":"Claude Code","message":"Hook message"}' | powershell.exe -File "/path/to/toast-notification.ps1"
# Force override examples
# Override Stop hook message
echo '{"hook_event_name":"Stop","stop_hook_active":false}' | powershell.exe -File "/path/to/toast-notification.ps1" -Message "Custom Complete Message"
# Override title only (keep parsed message)
echo '{"hook_event_name":"Notification","title":"Original","message":"Keep this"}' | powershell.exe -File "/path/to/toast-notification.ps1" -Title "My App"The script uses a robust fallback chain to ensure reliable notification delivery:
- Uses Windows Runtime API with
Anthropic.ClaudeCodeAppID - Appears in Windows Action Center with modern toast styling
- Persistent in Action Center until dismissed
- Traditional balloon notifications from system tray
- Appears in bottom-right corner for 5 seconds
- Used when toast notifications fail