A lightweight tool for displaying Windows desktop notifications in WSL environment, designed for command-line tools like Claude Code.
- Elegant UI Design: Modern notification window with rounded corners and smooth fade-in/fade-out animations
- Smart Positioning: Notifications appear at the top center of the screen
- Auto Management: Automatically closes after 2.5 seconds with smooth fade-out effect
- Auto Version Update: Built-in version verification mechanism ensures PowerShell script is always up-to-date
- High Performance: Uses fixed script file to avoid repeatedly creating temporary files
- Customizable: Supports custom title and message content
- Windows 10/11
- WSL (Windows Subsystem for Linux)
- PowerShell (built-in with Windows)
git clone <repository-url>
cd claude-code-notify-hook-in-WSLchmod +x cc-notifyAdd the script to system PATH for easy access from anywhere:
# Method 1: Create symbolic link to /usr/local/bin
sudo ln -s $(pwd)/cc-notify /usr/local/bin/cc-notify
# Method 2: Add to ~/.bashrc or ~/.zshrc
echo 'export PATH="$PATH:/path/to/claude-code-notify-hook-in-WSL"' >> ~/.bashrc
source ~/.bashrc# Use default title and message
./cc-notify
# Custom title
./cc-notify "My Title"
# Custom title and message
./cc-notify "Task Complete" "Build finished successfully!"Add to Claude Code hooks configuration:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "/path/to/cc-notify 'Claude Code' 'Command execution completed'"
}
]
}
]
}
}#!/bin/bash
# Execute long-running task
./your-script.sh
# Send notification after task completion
cc-notify "Task Complete" "Script execution finished!"cc-notify (Bash)
↓
Version Check
↓
notify.ps1 (PowerShell)
↓
Windows WPF Notification Window
- First Run: Automatically creates
notify.ps1file - Version Verification: Checks PowerShell script version on each run
- Auto Update: Automatically regenerates script if version mismatch detected
- Seamless Upgrade: Users don't need manual intervention, script stays up-to-date automatically
claude-code-notify-hook-in-WSL/
├── cc-notify # Main script (Bash)
├── notify.ps1 # PowerShell notification script (auto-generated)
└── README.md # This document
- Window Size: 350x140 pixels
- Position: Top center of screen, 20 pixels from top
- Style:
- White background (#FFFFFF)
- Gray border (#E0E0E0)
- Green left decoration bar (#4CAF50)
- Rounded corners (8px)
- Animation:
- Fade-in: 0.5 seconds (smooth opacity transition from 0 to 1)
- Display: 1.5 seconds (full opacity)
- Fade-out: 0.5 seconds (smooth opacity transition from 1 to 0)
- Total duration: ~2.5 seconds
- Implementation: Single timer-based animation system for smooth transitions
Current Version: 1.2.2
Version number is stored in two locations:
SCRIPT_VERSIONvariable incc-notifyscript- First line comment in
notify.ps1file
A: Check the following:
- Ensure running in WSL environment
- Verify PowerShell is accessible (run
powershell.exe -Command "echo test") - Check Windows Firewall settings
A: Edit the cc-notify script and modify the step counts in the animation timer:
# Wait phase (26-100 steps = 1.5 seconds)
elseif ($script:animationStep -le 100) {
$window.Opacity = 1.0
}Change the step count (100) to adjust display time. Formula: steps = desired_seconds × 50
For example, for 3 seconds display: 26 + (3 × 50) = 176
Remember to update SCRIPT_VERSION to trigger auto-update.
A: Edit the XAML section in cc-notify script:
- Modify colors: Change
Background,BorderBrush,Foregroundproperties - Modify size: Change
Height,Widthproperties - Modify font: Change
FontSize,FontWeightproperties
Remember to update SCRIPT_VERSION to trigger auto-update.
A:
cc-notify(Bash): Handles parameter processing, version management, and cross-system callsnotify.ps1(PowerShell): Handles Windows UI rendering
This separation provides better performance and maintainability.
- Update
cc-notifyscript - Modify
SCRIPT_VERSIONto new version number - Update PowerShell code in heredoc
- Users will auto-update
notify.ps1on next run
- 1.2.2 (2026-01-24)
- Added smooth fade-in and fade-out animations
- Optimized animation system using single timer approach
- Reduced total display duration to ~2.5 seconds
- Improved animation performance and reliability
- 1.0.0 (2026-01-24)
- Initial release
- Implemented basic notification functionality
- Added auto version update mechanism
- Optimized performance using fixed script file
MIT License
wanyukang
Note: If you find this tool useful, feel free to Star it
