Are you the author? Sign in to claim
A lightweight macOS desktop notification hook for Claude Code that displays native notifications with customizable syste
A high-performance Rust CLI tool for displaying cross-platform desktop notifications as a Claude Code hook, with advanced sound support and parallel execution.
brew install wyattjoh/stable/claude-code-notification
afplay (for sound support)The tool integrates with Claude Code as a notification hook, receiving JSON input via stdin and displaying native notifications with optional sound playback.
Basic Integration:
Configure in your Claude Code settings:
{
"hooks": {
"Notification": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "claude-code-notification"
}
]
}
]
}
}
With Custom Sound:
{
"hooks": {
"Notification": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "claude-code-notification --sound Submarine"
}
]
}
]
}
}
The matcher field can be left empty to fire on all notification events, or set to a specific event type (e.g. permission_prompt, idle_prompt, auth_success). See the Claude Code hooks documentation for the full list of matchers.
The --sound parameter supports two modes:
System Sounds (no / in name):
/System/Library/Sounds/{name}.aiffCustom Paths (contains /):
afplay.wav, .aiff, .mp3, .m4a, and other formats supported by afplay--sound /path/to/custom/sound.wav--sound ./sounds/notification.mp3--sound ~/Music/alert.m4aThe tool expects JSON input via stdin with the following structure:
{
"session_id": "string",
"transcript_path": "string",
"message": "string",
"title": "string (optional)"
}
Fields:
session_id - Claude session identifiertranscript_path - Path to session transcript filemessage - Notification body texttitle - Notification title (defaults to "Claude Code")Test the notifier with sample JSON input:
# Default Glass sound
echo '{"session_id":"test","transcript_path":"/tmp/test.md","message":"Test message","title":"Test"}' | claude-code-notification
# System sound
echo '{"session_id":"test","transcript_path":"/tmp/test.md","message":"Test message","title":"Test"}' | claude-code-notification --sound Submarine
# Custom sound file
echo '{"session_id":"test","transcript_path":"/tmp/test.md","message":"Test message","title":"Test"}' | claude-code-notification --sound ./custom-sound.wav
To contribute or modify the CLI:
# Clone the repository
git clone https://github.com/wyattjoh/claude-code-notifier.git
cd claude-code-notifier
# Run in development
cargo run
# Build release binary
make build-release
# Run tests
make test
# Format code
make fmt
# Lint code
make clippy
# Install globally
make install
The CLI uses notify-rust for cross-platform notifications and afplay for macOS sound playback, with comprehensive error handling and parallel execution for optimal user experience.
The notification system consists of:
src/main.rs) - Argument parsing with clapsrc/lib.rs) - Notification logic and sound playbacksrc/error.rs) - Structured error types with thiserrornotify-rust for notifications, afplay for soundsMIT License - see LICENSE file for details.
Hooking implementations and supporting tools for various coding agents (Claude, Cursor, Gemini, etc)
Claude Code hook that writes a forward-only why-block (decisions, trade-offs, assumptions, limitations) into your PR des
Blocks dangerous git and shell commands from being executed by AI coding agents
One command to install 6 essential safety hooks in 10 seconds — zero dependencies