Skip to content

About

decent looking notify tools for claude code in windows 10/11 + WSL2

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CC-Notify

A lightweight tool for displaying Windows desktop notifications in WSL environment, designed for command-line tools like Claude Code.

sample

Features

  • 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

System Requirements

  • Windows 10/11
  • WSL (Windows Subsystem for Linux)
  • PowerShell (built-in with Windows)

Installation

1. Clone or Download the Project

git clone <repository-url>
cd claude-code-notify-hook-in-WSL

2. Add Execute Permission

chmod +x cc-notify

3. Add to PATH (Optional)

Add 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

Usage

Basic Usage

# Use default title and message
./cc-notify

# Custom title
./cc-notify "My Title"

# Custom title and message
./cc-notify "Task Complete" "Build finished successfully!"

Using with Claude Code

Add to Claude Code hooks configuration:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/cc-notify 'Claude Code' 'Command execution completed'"
          }
        ]
      }
    ]
  }
}

Using in Scripts

#!/bin/bash

# Execute long-running task
./your-script.sh

# Send notification after task completion
cc-notify "Task Complete" "Script execution finished!"

How It Works

Architecture Design

cc-notify (Bash)
    ↓
Version Check
    ↓
notify.ps1 (PowerShell)
    ↓
Windows WPF Notification Window

Version Management Mechanism

  1. First Run: Automatically creates notify.ps1 file
  2. Version Verification: Checks PowerShell script version on each run
  3. Auto Update: Automatically regenerates script if version mismatch detected
  4. Seamless Upgrade: Users don't need manual intervention, script stays up-to-date automatically

File Structure

claude-code-notify-hook-in-WSL/
├── cc-notify          # Main script (Bash)
├── notify.ps1         # PowerShell notification script (auto-generated)
└── README.md          # This document

Technical Details

UI Design

  • 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

Version Control

Current Version: 1.2.2

Version number is stored in two locations:

  • SCRIPT_VERSION variable in cc-notify script
  • First line comment in notify.ps1 file

FAQ

Q: Notification not showing?

A: Check the following:

  1. Ensure running in WSL environment
  2. Verify PowerShell is accessible (run powershell.exe -Command "echo test")
  3. Check Windows Firewall settings

Q: How to modify notification display duration?

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.

Q: How to customize notification style?

A: Edit the XAML section in cc-notify script:

  • Modify colors: Change Background, BorderBrush, Foreground properties
  • Modify size: Change Height, Width properties
  • Modify font: Change FontSize, FontWeight properties

Remember to update SCRIPT_VERSION to trigger auto-update.

Q: Why two files needed?

A:

  • cc-notify (Bash): Handles parameter processing, version management, and cross-system calls
  • notify.ps1 (PowerShell): Handles Windows UI rendering

This separation provides better performance and maintainability.

Upgrade Guide

Upgrading to New Version

  1. Update cc-notify script
  2. Modify SCRIPT_VERSION to new version number
  3. Update PowerShell code in heredoc
  4. Users will auto-update notify.ps1 on next run

Version History

  • 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

License

MIT License

Author

wanyukang


Note: If you find this tool useful, feel free to Star it

About

decent looking notify tools for claude code in windows 10/11 + WSL2

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages