Claude Code Notification Hooks
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Claude Code Notification Hooks send a test success notification to check the sound"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
š 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
Related MCP server: Sound Effects MCP
š Quick Start
Method 1: One-Command Setup (Recommended)
Run this in Claude Code:
cd /path/to/ccnotify && npm run setup-hooksMethod 2: Manual Setup
Clone and build:
git clone <this-repository>
cd ccnotify
npm install && npm run buildRun setup:
npm run setup-hooksRestart Claude Code if it's currently running
3. That's It!
All Claude Code notifications will now automatically have enhanced sounds and styling. No additional configuration needed!
š± 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
Sound | Use Case | macOS Sound |
| Task completion, success | Glass |
| Errors, failures | Basso |
| Warnings, attention needed | Sosumi |
| Information, status updates | Blow |
| Progress updates, ongoing work | Tink |
| Reminders, prompts | Ping |
| System default notification sound | - |
| No sound | - |
š ļø Advanced Configuration
Customizing Sound Mappings
Edit the hook script at hooks/notification-hook.js to customize sound mappings:
// Example: Add custom sound rules
const customSoundRules = [
{ pattern: /deployment/i, sound: 'Ping' },
{ pattern: /security/i, sound: 'Funk' },
{ pattern: /backup/i, sound: 'Purr' }
];Troubleshooting
Hook not working?
# Check if hook is properly installed
cat ~/.config/claude-code/settings.json | grep -A 10 "hooks"
# Verify hook script is executable
ls -la hooks/notification-hook.js
# Re-run setup if needed
npm run setup-hooksSounds not playing?
# Test system sound (macOS)
afplay /System/Library/Sounds/Glass.aiff
# Check notification permissions in System Preferencesš 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 serverPlatform Support
macOS: Full native support with
osascriptand system soundsWindows/Linux: Cross-platform support via
node-notifierpackage
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:
Interception: Hook receives all notification calls from Claude Code
Analysis: Analyzes notification content using pattern matching
Enhancement: Adds appropriate sounds and styling based on content
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 scriptPlatform Support
macOS: Full native support with
osascriptand system soundsWindows/Linux: Cross-platform support via
node-notifierpackage
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
Available Tools
4 toolsauto_notify_if_appropriateA
SMART AUTO-NOTIFICATION: Intelligently analyze context and automatically send appropriate notifications. Claude should use this proactively for: task completion detection, error analysis, user action evaluation, progress updates. This is the primary notification tool - use it frequently to keep users informed.
Inputs: context (required), todos_completed, error_occurred, permission_required, +2 more.
send_error_notificationA
AUTOMATICALLY send error notifications with error sound when anything fails. Claude must proactively use this when: compilation fails, tests fail, file operations fail, network requests fail, validation errors occur, bash commands fail. Critical for error awareness - always notify on failures.
Inputs: error (required), details.
send_task_complete_notificationA
AUTOMATICALLY send success notifications when any significant task completes successfully. Claude should proactively use this for: builds finishing, tests passing, file operations completing, refactoring done, analysis complete, long operations finishing. Always notify users of completion for better UX.
Inputs: task (required), details.
send_user_action_needed_notificationA
AUTOMATICALLY send urgent notifications when user input, decision, or immediate attention is required. Claude should proactively use this for: file conflicts, permission requests, critical errors requiring user choice, or when waiting for user response before proceeding. Essential for good UX - notify users immediately when blocked.
Inputs: action_needed (required), context, urgency, timeout.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 4 tools
The tools have overlapping purposes despite different names, as all are notification tools with specific triggers. The descriptions help differentiate contexts (errors, task completion, user actions, general auto-notification), but the boundaries are somewhat fuzzy, especially between auto_notify_if_appropriate and the more specific tools. An agent might struggle to choose between them in ambiguous situations.
The naming follows a consistent verb_noun pattern (e.g., send_error_notification, send_task_complete_notification), with all tools using snake_case. The only deviation is auto_notify_if_appropriate, which uses a slightly different verb style ('auto_notify' vs. 'send'), but overall, the naming is predictable and readable.
With 4 tools, the count is well-scoped for a notification server. Each tool serves a distinct notification type (errors, task completion, user actions, general auto-notification), and there are no unnecessary redundancies. This number allows for focused coverage without being overwhelming or too sparse.
The tool set comprehensively covers the notification domain for code-related contexts. It includes notifications for errors, task completions, user actions, and general auto-notification, ensuring no gaps in common scenarios like failures, successes, or required interactions. This provides a complete lifecycle of notification needs without dead ends.
Related MCP Connectors
Make all the audio for your game from a single prompt. Describe your game and your AI assistant plans every sound it needs (sound effects, ambience loops, music tracks and character voice lines), then generates them all in one go. You get several AI versions of each sound and keep the ones you like. Sounds are organized per game in folders and scenes, and the free Godot plugin installs them into your project, ready to play with one line of code. Works with Claude, Claude Code, Cursor and any MCP client, with OAuth login (no API key needed). Free plan included; sounds can be used in commercial games.
Audio for your agent: transcribe, speak, translate, summarise, plus sound effects and music.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Related MCP Servers
- AlicenseBqualityDmaintenancePlays Spotify tracks or system sounds as notifications when Claude Code completes tasks, with desktop notifications and cross-platform support for macOS, Linux, and Windows.821 npm1MIT
- AlicenseBqualityDmaintenancePlays sound effects (completion, newtype, and error sounds) in response to various situations like task completion, insights, or errors. Integrates with Claude Desktop to provide audio feedback for improved workflow efficiency and entertainment.220 npm6MIT
- AlicenseNot gradedqualityDmaintenanceSends native Windows desktop notifications with repeating sound alerts for Claude Code, supporting states like finished, needs_help, and pending_review.24 npmMIT
- AlicenseNot gradedqualityDmaintenanceProvides sound alerts, voice messages, and macOS notifications for Claude Code and other MCP-compatible AI assistants.29 npm1MIT