A PowerShell script that displays Windows Toast notifications for Claude Code hook events.
Zero dependency - Uses only built-in Windows APIs and PowerShell.
- Download the script:
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/soulee-dev/claude-code-notify-powershell/main/claude-hook-toast.ps1" -OutFile "$env:USERPROFILE\.claude\claude-hook-toast.ps1"- Add to
~/.claude/settings.json:
{
"hooks": {
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "cmd /c chcp 65001 >nul && powershell -ExecutionPolicy Bypass -File %USERPROFILE%\\.claude\\claude-hook-toast.ps1"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "cmd /c chcp 65001 >nul && powershell -ExecutionPolicy Bypass -File %USERPROFILE%\\.claude\\claude-hook-toast.ps1"
}
]
}
]
}
}More notifications (SessionStart, SessionEnd, PermissionRequest)
{
"hooks": {
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "cmd /c chcp 65001 >nul && powershell -ExecutionPolicy Bypass -File %USERPROFILE%\\.claude\\claude-hook-toast.ps1"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "cmd /c chcp 65001 >nul && powershell -ExecutionPolicy Bypass -File %USERPROFILE%\\.claude\\claude-hook-toast.ps1"
}
]
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "cmd /c chcp 65001 >nul && powershell -ExecutionPolicy Bypass -File %USERPROFILE%\\.claude\\claude-hook-toast.ps1"
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "cmd /c chcp 65001 >nul && powershell -ExecutionPolicy Bypass -File %USERPROFILE%\\.claude\\claude-hook-toast.ps1"
}
]
}
],
"PermissionRequest": [
{
"hooks": [
{
"type": "command",
"command": "cmd /c chcp 65001 >nul && powershell -ExecutionPolicy Bypass -File %USERPROFILE%\\.claude\\claude-hook-toast.ps1"
}
]
}
]
}
}For more hook events, see the Claude Code Hooks Guide.
The script automatically receives hook events from Claude Code and displays them as Windows toast notifications.
| Event | Message |
|---|---|
SessionStart |
Session started |
SessionEnd |
Session completed |
Stop |
Response finished |
Notification |
Custom message from Claude Code |
Edit the switch block in the script to customize messages:
$message = switch ($hookEvent) {
"SessionStart" { "Your custom message" }
"SessionEnd" { "Your custom message" }
# ...
}Contributions are welcome! Feel free to open issues or submit pull requests.
