Labsco
nkyy logo

Claude Code Notification

โ˜… 3

from nkyy

Sends notifications from Claude Code with customizable sounds and cross-platform support.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

๐Ÿ”” Claude Code Notification Hooks

โš ๏ธ DEPRECATED: This project has been superseded by cat-ccnotify-hook. Please use the new standalone package for better performance and easier installation.

Enhanced Claude Code experience with automatic desktop notifications and contextual sounds for all events. No manual notification calls needed - works automatically with all Claude Code operations!

โœจ Features

  • ๐Ÿ”” Automatic Notifications: Intercepts ALL Claude Code notifications and enhances them
  • ๐ŸŽต Contextual Sounds: Different sounds for success, error, warning, and other event types
  • ๐Ÿš€ Zero Configuration: Automatic detection and enhancement of notification types
  • ๐Ÿ“‹ Smart Sound Mapping: Intelligent analysis of notification content for appropriate sounds
  • ๐Ÿ–ฑ๏ธ Native System Integration: Uses macOS/Windows/Linux native notification systems

๐Ÿ“ฑ How It Works

The notification hook automatically detects and enhances all Claude Code notifications:

Automatic Sound Assignment

  • โœ… Success/Completion โ†’ Glass sound (macOS)
  • ๐Ÿšจ Errors/Failures โ†’ Basso sound (macOS)
  • โš ๏ธ Warnings/Attention โ†’ Sosumi sound (macOS)
  • ๐Ÿ’ก Info/Updates โ†’ Blow sound (macOS)
  • โณ Progress/Ongoing โ†’ Tink sound (macOS)

Examples in Action

# Building a project
npm run build
# โ†’ Automatic success notification with Glass sound when complete
# โ†’ Automatic error notification with Basso sound if failed

# Running tests  
npm test
# โ†’ Automatic progress notification with Tink sound while running
# โ†’ Automatic completion notification when finished

# Git operations
git push origin main
# โ†’ Automatic notifications for each step with appropriate sounds

๐ŸŽต Available Sounds

SoundUse CasemacOS Sound
successTask completion, successGlass
errorErrors, failuresBasso
warningWarnings, attention neededSosumi
infoInformation, status updatesBlow
progressProgress updates, ongoing workTink
reminderReminders, promptsPing
defaultSystem default notification sound-
silentNo sound-

๐ŸŒ Real-World Examples

Automatic Enhancement Examples

Claude Code Operations โ†’ Enhanced Notifications

# File operations
"Create a new React component"
โ†’ โœ… "Component created successfully" + Glass sound

# Build processes  
"Run the build process"
โ†’ โณ "Build in progress..." + Tink sound
โ†’ โœ… "Build completed successfully" + Glass sound

# Error scenarios
"Fix the TypeScript errors"
โ†’ ๐Ÿšจ "3 type errors found" + Basso sound

# Git operations
"Commit these changes"
โ†’ โœ… "Changes committed successfully" + Glass sound

๐Ÿ”ง Development

Development Commands

npm run dev    # Development mode with auto-reload
npm run build  # Production build
npm start      # Start production server

Platform Support

  • macOS: Full native support with osascript and system sounds
  • Windows/Linux: Cross-platform support via node-notifier package

Architecture

  • Type-safe TypeScript implementation
  • MCP (Model Context Protocol) compliant
  • Automatic platform-specific implementation switching
  • Extensible notification type system

๐Ÿ“‹ Technical Details

Hook Architecture

The notification hook intercepts Claude Code's notification system and enhances it:

  1. Interception: Hook receives all notification calls from Claude Code
  2. Analysis: Analyzes notification content using pattern matching
  3. Enhancement: Adds appropriate sounds and styling based on content
  4. Native Integration: Uses platform-specific notification APIs

Installation Structure

~/.config/claude-code/settings.json  # Claude Code configuration
hooks/notification-hook.js            # Main hook script  
dist/index.js                        # Built MCP server (optional)
scripts/setup-hooks.js               # Automated setup script

Platform Support

  • macOS: Full native support with osascript and system sounds
  • Windows/Linux: Cross-platform support via node-notifier package

Legacy MCP Server (Optional)

For advanced users who want manual notification control, the MCP server is still available:

{
  "mcpServers": {
    "ccnotify": {
      "command": "node",
      "args": ["/absolute/path/to/ccnotify/dist/index.js"]
    }
  }
}

๐Ÿค Contributing

Bug reports and feature requests are welcome! Please open an issue.

๐Ÿ“„ License

MIT License