Skip to content

soulee-dev/claude-code-notify-powershell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Claude Code Notification Hook for Windows

Demo

A PowerShell script that displays Windows Toast notifications for Claude Code hook events.

Zero dependency - Uses only built-in Windows APIs and PowerShell.

Installation

  1. 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"
  1. 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.

Usage

The script automatically receives hook events from Claude Code and displays them as Windows toast notifications.

Event Types

Event Message
SessionStart Session started
SessionEnd Session completed
Stop Response finished
Notification Custom message from Claude Code

Customization

Edit the switch block in the script to customize messages:

$message = switch ($hookEvent) {
    "SessionStart"  { "Your custom message" }
    "SessionEnd"    { "Your custom message" }
    # ...
}

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

About

PowerShell toast notifications for Claude Code. Zero dependencies.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published