Skip to main content
Glama
nkyy

Claude Code Notification Hooks

by nkyy

🔔 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: Suzu (鈴) - Claude Code Notification Server

🚀 Quick Start

Run this in Claude Code:

cd /path/to/ccnotify && npm run setup-hooks

Method 2: Manual Setup

  1. Clone and build:

git clone <this-repository>
cd ccnotify
npm install && npm run build
  1. Run setup:

npm run setup-hooks
  1. Restart 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

success

Task completion, success

Glass

error

Errors, failures

Basso

warning

Warnings, attention needed

Sosumi

info

Information, status updates

Blow

progress

Progress updates, ongoing work

Tink

reminder

Reminders, prompts

Ping

default

System default notification sound

-

silent

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-hooks

Sounds 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 OperationsEnhanced 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

Available Tools

4 tools
auto_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
contextYesCurrent context or situation that might require notification
todos_completedNoWhether all planned todos are completed
error_occurredNoWhether an error has occurred
permission_requiredNoWhether user permission is required for an action
error_detailsNoDetails about the error if error_occurred is true
permission_detailsNoDetails about the permission required if permission_required is true

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It describes the tool's proactive, intelligent behavior and general use cases, but lacks details on how notifications are sent (e.g., format, channels), what 'appropriate' means, or any constraints like rate limits or authentication needs. The description adds some behavioral context but leaves key operational aspects unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the core purpose. Both sentences earn their place: the first defines the tool, and the second provides usage guidance. However, the all-caps 'SMART AUTO-NOTIFICATION' is slightly verbose, and the structure could be tighter by integrating the usage examples more seamlessly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (6 parameters, no annotations, no output schema), the description is moderately complete. It covers purpose and usage well but lacks details on behavioral traits, output format, or how parameters interact. For a tool with multiple siblings and no structured safety hints, more context on when to choose this over specific tools would enhance completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 6 parameters. The description doesn't add any parameter-specific semantics beyond what's in the schema (e.g., it doesn't explain how 'context' relates to 'todos_completed' or 'error_occurred'). With high schema coverage, the baseline is 3, and the description doesn't compensate with additional insights.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Intelligently analyze context and automatically send appropriate notifications.' It specifies the verb ('analyze' and 'send') and resource ('notifications'), and distinguishes it from siblings by calling it the 'primary notification tool.' However, it doesn't fully differentiate the 'smart auto-notification' mechanism from the more specific sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidelines: 'Claude should use this proactively for: task completion detection, error analysis, user action evaluation, progress updates.' It also states 'This is the primary notification tool - use it frequently to keep users informed,' which clearly positions it against the more specific sibling tools (send_error_notification, send_task_complete_notification, send_user_action_needed_notification).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
errorYesDescription of the error
detailsNoOptional additional error details

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: the tool triggers automatically ('AUTOMATICALLY'), includes an auditory component ('error sound'), and is proactive ('Claude must proactively use this'). However, it doesn't mention potential side effects like rate limits, permissions needed, or whether notifications are logged or displayed in a specific interface.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the core purpose stated first. However, the list of failure scenarios could be slightly more concise, and the final sentence ('Critical for error awareness - always notify on failures.') reiterates rather than adds new information, slightly reducing efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is largely complete. It covers purpose, usage guidelines, and behavioral context well. The main gap is the lack of output information (since no output schema exists), but for a notification tool, the description's focus on triggering behavior is sufficient for most agent needs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('error' and 'details') with their types and constraints. The description doesn't add any parameter-specific information beyond what's in the schema, such as formatting examples or semantic nuances. The baseline of 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'AUTOMATICALLY send error notifications with error sound when anything fails.' It specifies the verb ('send'), resource ('error notifications'), and includes the distinctive feature of an 'error sound.' It distinguishes from siblings by focusing specifically on error scenarios rather than task completion or user action notifications.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit, comprehensive guidance on when to use this tool: 'Claude must proactively use this when: compilation fails, tests fail, file operations fail, network requests fail, validation errors occur, bash commands fail.' It includes a clear directive ('always notify on failures') and distinguishes from siblings by specifying error contexts rather than success or user-interaction scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
taskYesDescription of the completed task
detailsNoOptional additional details about the completion

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses the tool's proactive/automatic nature ('AUTOMATICALLY send', 'Claude should proactively use') which is valuable behavioral context. However, it doesn't mention delivery method, permissions needed, rate limits, or what happens if the notification fails - significant gaps for a notification tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose. Every sentence adds value: first states purpose, second provides usage examples, third gives UX rationale. However, the second sentence is somewhat long with multiple examples, slightly reducing readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a notification tool with no annotations and no output schema, the description provides good purpose and usage context but lacks important behavioral details. It doesn't explain what 'success notifications' look like, where they're sent, or what the tool returns. The examples help but don't fully compensate for missing structural information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. It implies the 'task' parameter should describe significant completions, but this is already covered by the schema's description field.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('send success notifications') and resources ('when any significant task completes successfully'). It distinguishes from siblings by focusing on success notifications rather than errors or user actions, and provides concrete examples (builds, tests, file operations) that clarify scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidelines: 'Claude should proactively use this for' lists specific scenarios (builds finishing, tests passing, etc.), and 'Always notify users of completion for better UX' gives a clear when-to-use principle. It implicitly distinguishes from siblings by focusing on success scenarios rather than errors or user actions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
action_neededYesWhat action the user needs to take
contextNoContext or reason why user action is needed
urgencyNoUrgency level of the required actionmedium
timeoutNoHow long to display the notification (seconds)

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's proactive, urgent nature and UX importance, but lacks details on delivery mechanism (e.g., how notifications appear), user response handling, or potential side effects. The description doesn't contradict annotations (none exist), but could provide more operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the core purpose and immediately following with usage guidelines. Every sentence adds value, though the final sentence about UX could be integrated more seamlessly. It avoids redundancy and maintains a clear, directive tone throughout.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a notification tool with no annotations and no output schema, the description provides strong context about when and why to use it, supported by concrete examples. It covers the tool's proactive nature and urgency well, though could benefit from more detail about notification behavior or response handling to be fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, providing good documentation for all parameters. The description doesn't add specific parameter semantics beyond what's in the schema, but contextually reinforces the purpose of 'action_needed' and 'urgency' through examples. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't significantly enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('send urgent notifications') and resources ('when user input, decision, or immediate attention is required'), distinguishing it from siblings by emphasizing urgency and proactive use for user-blocking scenarios. It explicitly mentions use cases like file conflicts and permission requests, making the purpose highly specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool ('proactively use this for: file conflicts, permission requests, critical errors requiring user choice, or when waiting for user response before proceeding') and why ('Essential for good UX - notify users immediately when blocked'). It implicitly distinguishes from siblings by focusing on urgent, action-required scenarios rather than general notifications or errors.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv1.0.0
    • First observedauto_notify_if_appropriate
    • First observedsend_error_notification
    • First observedsend_task_complete_notification
    • First observedsend_user_action_needed_notification

TDQS

A4.1/5.0
Disambiguation3/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness5/5

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.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    C
    quality
    D
    maintenance
    Sends system notifications when AI completes responses in MCP-compatible code editors, with cross-platform support for macOS, Windows, and Linux including customizable titles, messages, icons, and sound effects.
    2
    -
  • A
    license
    B
    quality
    D
    maintenance
    Plays 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.
    2
    19
    6
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Enables AI development tools on Windows to send native system notifications for task completion, errors, and reminders, with customizable icons and sounds.
    7
    17
    7
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nkyy/claude-code-notify-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server