https://github.com/dongzhenye/claude-code-notifications
๐ Never miss Claude's response\! Notification solutions for Claude Code - from terminal bells to desktop alerts.
https://github.com/dongzhenye/claude-code-notifications
claude-code developer-tools productivity sound-notifications terminal-notification
Last synced: 5 days ago
JSON representation
๐ Never miss Claude's response\! Notification solutions for Claude Code - from terminal bells to desktop alerts.
- Host: GitHub
- URL: https://github.com/dongzhenye/claude-code-notifications
- Owner: dongzhenye
- License: mit
- Created: 2025-07-13T17:33:57.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-08-20T17:11:53.000Z (5 months ago)
- Last Synced: 2025-10-13T07:13:26.149Z (3 months ago)
- Topics: claude-code, developer-tools, productivity, sound-notifications, terminal-notification
- Language: HTML
- Homepage: https://claude-code-notifications.vercel.app
- Size: 294 KB
- Stars: 8
- Watchers: 0
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ Claude Code Notifications
**Never miss Claude's response again**
[](https://github.com/dongzhenye/claude-code-notifications/stargazers)
[](LICENSE)
[](https://github.com/dongzhenye/claude-code-notifications)
*Elegant notification solutions for Claude Code CLI - from simple terminal bells to rich desktop alerts*
[Quick Start](#-quick-start) โข [Installation](#-installation) โข [Configuration](#-configuration) โข [Examples](#-examples)
---
## โจ The Problem We Solve
Ever found yourself:
- ๐ค **Constantly switching tabs** to check if Claude has responded?
- ๐ **Missing Claude's questions** while working in another window?
- โฐ **Wasting time** waiting when Claude has already finished?
**We've got you covered!** Choose from three notification styles that fit your workflow perfectly.
## ๐ฏ Choose Your Style

**[Minimal](#-minimal--built-in-simplicity)** โข **[Recommended](#-recommended--perfect-balance)** โข **[Custom](#-custom--unlimited-possibilities)**
## ๐ Quick Start
**Most users should use the Recommended tier:**
```bash
# One-line installation (works anywhere - downloads configs automatically)
curl -sSL https://raw.githubusercontent.com/dongzhenye/claude-code-notifications/main/install.sh | bash
```
That's it! You now have smart audio notifications configured. ๐
## ๐ Installation
### Prerequisites
- **Claude Code CLI** installed (`claude` command available)
- **macOS / Linux / Windows** operating system
- **Audio output** for sound notifications
### Installation Options
๐ฏ Option 1: Automatic Installation (Recommended)
```bash
# Download and run the installer
curl -sSL https://raw.githubusercontent.com/dongzhenye/claude-code-notifications/main/install.sh | bash
```
Or clone and run locally:
```bash
git clone https://github.com/dongzhenye/claude-code-notifications.git
cd claude-code-notifications
./install.sh
```
The installer will:
- โ
Detect your operating system
- โ
Automatically download configurations from GitHub (no cloning needed!)
- โ
Apply the recommended configuration
- โ
Create a backup of existing settings
- โ
Provide desktop notification setup options
โ๏ธ Option 2: Manual Installation
1. **Choose your configuration file:**
- macOS: `recommended/recommended.macos.json`
- Linux: `recommended/recommended.linux.json`
- Windows: `recommended/recommended.windows.json`
2. **Copy to Claude settings:**
```bash
cp recommended/recommended.macos.json ~/.claude/settings.json
```
3. **Test the configuration:**
```bash
# macOS
afplay /System/Library/Sounds/Glass.aiff
# Linux
paplay /usr/share/sounds/freedesktop/stereo/message.oga
# Windows (PowerShell)
[System.Media.SystemSounds]::Asterisk.Play()
```
## ๐จ Configuration
### ๐ต Minimal โ Built-in Simplicity
**Perfect for:** Users who want instant notifications with zero setup.
```bash
claude config set --global preferredNotifChannel terminal_bell
```
**Features:**
- โ
**5-second setup** - Just run one command
- โ
**Works everywhere** - Universal terminal bell
- โ
**Zero dependencies** - Nothing to install
- โ **Same sound for all** - No event differentiation
macOS Terminal Sound Setup
If you don't hear the bell on macOS:
1. Open **Terminal โ Preferences โ Profiles**
2. Select your profile โ **Advanced** tab
3. Enable **"Audible bell"**
4. Adjust volume in **System Preferences โ Sound**
### โญ Recommended โ Perfect Balance
**Perfect for:** Daily users who want smart notifications without fatigue.
**What makes it special:**
- ๐ต **Only 2 key events** - Needs input & task complete
- ๐ถ **Carefully chosen sounds** - Glass (attention) & Tink (done)
- ๐ **No notification fatigue** - Designed for all-day use
- ๐ **Cross-platform** - Works on all operating systems
**Sound Philosophy:**
```
High-frequency events (completion) โ Gentle sound (Tink)
Low-frequency events (needs input) โ Noticeable sound (Glass)
```
Configuration Details
The configuration maps Claude events to system sounds:
```json
{
"hooks": {
"Stop": [{
"description": "Sound notification on completion",
"hooks": [{
"type": "sound",
"path": "/System/Library/Sounds/Tink.aiff"
}]
}],
"Notification": [{
"description": "Sound notification when input needed",
"hooks": [{
"type": "sound",
"path": "/System/Library/Sounds/Glass.aiff"
}]
}]
}
}
```
### ๐ Custom โ Unlimited Possibilities
**Perfect for:** Power users who want visual notifications and advanced integrations.
**Examples included:**
- ๐ฅ๏ธ **Desktop notifications** with title and message
- ๐ฑ **Push notifications** to your phone
- ๐ **Webhook integrations** with Slack/Discord
- ๐จ **Custom scripts** for any behavior
Desktop Notification Example (macOS)
```bash
# Install terminal-notifier (if needed)
brew install terminal-notifier
# Use the provided script
cp custom/system-notify.macos.sh ~/claude-code-notifications/
# Configure in ~/.claude/settings.json
{
"hooks": {
"Notification": [{
"hooks": [{
"type": "command",
"command": "~/claude-code-notifications/custom/system-notify.macos.sh notification"
}]
}]
}
}
```
The script provides:
- ๐ System notification center integration
- ๐ Custom titles and messages
- ๐ต Optional sound effects
- ๐ผ๏ธ Claude icon in notifications
Create Your Own Integration
Create a custom script that receives the event type as first argument:
```bash
#!/bin/bash
EVENT_TYPE=$1
case "$EVENT_TYPE" in
"notification")
# Your code for input needed
curl -X POST https://your-webhook.com/claude-needs-input
;;
"stop")
# Your code for task complete
osascript -e 'display notification "Task complete!" with title "Claude"'
;;
esac
```
Endless possibilities:
- ๐ Smart home integration (turn on a light)
- ๐ Log events to a database
- ๐ค Trigger other automations
- ๐ Track productivity metrics
## ๐งช Testing & Debugging
### Test System Sounds
๐ macOS
```bash
# Test individual sounds
afplay /System/Library/Sounds/Glass.aiff
afplay /System/Library/Sounds/Tink.aiff
# Explore all available sounds
for sound in Basso Blow Bottle Frog Funk Glass Hero Morse Ping Pop Purr Sosumi Submarine Tink; do
echo "Playing $sound..."
afplay "/System/Library/Sounds/$sound.aiff"
sleep 1
done
```
๐ง Linux
```bash
# Test with PulseAudio
paplay /usr/share/sounds/freedesktop/stereo/message.oga
# Test with ALSA
aplay /usr/share/sounds/freedesktop/stereo/complete.oga
# List available sounds
find /usr/share/sounds -name "*.oga" -o -name "*.wav"
```
๐ช Windows
```powershell
# Test system sounds
[System.Media.SystemSounds]::Asterisk.Play()
[System.Media.SystemSounds]::Exclamation.Play()
[System.Media.SystemSounds]::Hand.Play()
# List available WAV files
Get-ChildItem C:\Windows\Media\*.wav | Select-Object Name
```
### Common Issues
๐ No sound playing?
1. **Check system volume** - Ensure it's not muted
2. **Test the sound file directly** - Use commands above
3. **Verify file paths** - Ensure sound files exist
4. **Check permissions** - Some systems restrict audio playback
๐ Multiple/duplicate sounds?
1. **Clear terminal bell:**
```bash
claude config set --global preferredNotifChannel none
```
2. **Check for duplicate hooks:**
```bash
cat ~/.claude/settings.json
```
3. **Use the installer's backup:**
```bash
cp ~/.claude/settings.json.backup ~/.claude/settings.json
```
โ๏ธ Settings not applying?
- Settings take effect **immediately** (no restart needed)
- Check JSON syntax with `jq . ~/.claude/settings.json`
- Ensure you're editing the correct file: `~/.claude/settings.json`
- Try the automatic installer for proper configuration
## ๐ Examples
### Real-world Use Cases
**๐ฏ Focused Development**
```bash
# Start a long-running task
claude "Refactor this entire codebase to use TypeScript"
# Switch to email/Slack/browser
# ๐ Get notified when Claude needs clarification
# โ
Get notified when complete
```
**๐ Learning & Exploration**
```bash
# Ask complex questions
claude "Explain the entire architecture and create documentation"
# Go make coffee โ
# ๐ Return when Claude is ready
```
**๐ Iterative Tasks**
```bash
# Multi-step processes
claude "1. Analyze code 2. Write tests 3. Fix bugs 4. Update docs"
# Work on other things
# ๐ Get notified at each step requiring input
```
## ๐ ๏ธ Advanced Configuration
### Claude Event Types
Claude Code supports these notification events:
| Event | Description | Frequency | Recommended Sound |
|-------|-------------|-----------|-------------------|
| `Notification` | Needs user input/permission | Low | Noticeable (Glass) |
| `Stop` | Completed response | High | Gentle (Tink) |
### Hook System
The Claude Code hook system is powerful and flexible:
```json
{
"hooks": {
"EventName": [{
"description": "Human-readable description",
"hooks": [{
"type": "sound|command",
"path": "/path/to/sound",
"command": "command to run"
}]
}]
}
}
```
Multiple hooks can be chained for complex behaviors.
## ๐ค Contributing
We love contributions! Here's how you can help:
- ๐ **Report bugs** - Open an issue with details
- ๐ก **Suggest features** - Share your ideas
- ๐ง **Submit PRs** - Improvements welcome
- ๐ **Improve docs** - Help others get started
- โญ **Star the repo** - Show your support
## ๐ License
MIT License - see [LICENSE](LICENSE) file for details.
## ๐จโ๐ป Author
Created with โค๏ธ by [Zhenye Dong](https://github.com/dongzhenye)
---
**If this tool saves you time, please consider giving it a โญ**
[Report Bug](https://github.com/dongzhenye/claude-code-notifications/issues) โข [Request Feature](https://github.com/dongzhenye/claude-code-notifications/issues)