Get instant audio notifications when Claude Code completes tasks, needs permissions, or finishes operations!
Transform your Claude Code workflow with intelligent voice notifications powered by ElevenLabs TTS. Never miss when Claude finishes a task, needs your permission, or completes important operations.
β‘ This entire project was built from scratch using Claude Code with 100% AI-generated code!
From initial concept to production-ready open source package - every line of TypeScript, documentation, configuration, and tooling was created by AI. This showcases the power of Claude Code for end-to-end software development.
- ποΈ Natural TTS - Uses ElevenLabs AI voices for lifelike notifications
- π Smart Fallback - Automatically falls back to system TTS if API fails
- π― Contextual Messages - Different notifications for different events
- β‘ Ultra-Low Latency - Flash v2.5 model provides ~75ms response time
- π‘οΈ Never Fails - Built-in error handling ensures you always get notified
- π Cross-Platform - Works on macOS, Linux, and Windows
- βοΈ Configurable - Easy to customize voices, models, and messages
When Claude Code:
- β Finishes responding β "Claude has finished responding"
- π€ Completes subagent tasks β "Subagent finished: [task name]"
- π Needs permission β "Claude needs your permission"
- π Completes file edits β "File edited: config.ts"
- π¨ Finishes builds β "Build completed"
- π¦ Installs packages β "Package installation completed"
- Claude Code installed and configured
- Node.js 18+
- ElevenLabs API key (free tier works!)
- ffmpeg for audio playback (auto-installed on most systems)
-
Install the package:
npm install -g claude-code-voice-notifications
-
Configure ElevenLabs API key (optional but recommended):
Get your free API key from ElevenLabs, then add it to your shell:
For Zsh (.zshrc):
echo 'export ELEVENLABS_API_KEY="your_api_key_here"' >> ~/.zshrc source ~/.zshrc
For Bash (.bashrc):
echo 'export ELEVENLABS_API_KEY="your_api_key_here"' >> ~/.bashrc source ~/.bashrc
For Fish (.config/fish/config.fish):
echo 'set -gx ELEVENLABS_API_KEY "your_api_key_here"' >> ~/.config/fish/config.fish source ~/.config/fish/config.fish
-
Test the installation:
# Test with system TTS (works without API key) echo '{"hook_event_name": "Stop"}' | claude-voice-notifications # Test with ElevenLabs (needs API key configured above) echo '{"hook_event_name": "SubagentStop", "tool_input": {"description": "Test Task"}}' | claude-voice-notifications
-
Configure Claude Code hooks: Add the configuration below to your
~/.claude/settings.json
-
Restart Claude Code to activate notifications!
Event | Trigger | Example Notification |
---|---|---|
Stop | Claude finishes responding | "Claude has finished responding" |
SubagentStop | Subagent completes task | "Subagent finished: Code review" |
Notification | Permission/input needed | "Claude needs your permission" |
PostToolUse | Tool operation completes | "Build completed" |
Add this configuration to your ~/.claude/settings.json
:
{
"hooks": {
"Stop": [{
"hooks": [{
"type": "command",
"command": "claude-voice-notifications"
}]
}],
"SubagentStop": [{
"hooks": [{
"type": "command",
"command": "claude-voice-notifications"
}]
}],
"Notification": [{
"hooks": [{
"type": "command",
"command": "claude-voice-notifications"
}]
}],
"PostToolUse": [{
"matcher": "Bash|Edit|MultiEdit|Write",
"hooks": [{
"type": "command",
"command": "claude-voice-notifications"
}]
}]
}
}
You can customize the voice by setting environment variables:
# Use a different voice (get voice IDs from ElevenLabs)
export ELEVENLABS_VOICE_ID="pNInz6obpgDQGcFmaJgB" # Adam voice
# Add to your shell config (.zshrc, .bashrc, etc.)
echo 'export ELEVENLABS_VOICE_ID="pNInz6obpgDQGcFmaJgB"' >> ~/.zshrc
Available voice IDs from ElevenLabs:
JBFqnCBsd6RMkjVDRZzb
- George (default)pNInz6obpgDQGcFmaJgB
- Adam21m00Tcm4TlvDq8ikWAM
- RachelAZnzlk1XvdvUeBnXmlld
- Domi
# Test different events
echo '{"hook_event_name": "Stop"}' | claude-voice-notifications
echo '{"hook_event_name": "SubagentStop", "tool_input": {"description": "Test Task"}}' | claude-voice-notifications
echo '{"hook_event_name": "Notification", "message": "Claude needs permission"}' | claude-voice-notifications
echo '{"hook_event_name": "PostToolUse", "tool_name": "Bash", "tool_input": {"command": "npm run build"}}' | claude-voice-notifications
# Test with specific voice
ELEVENLABS_VOICE_ID="pNInz6obpgDQGcFmaJgB" echo '{"hook_event_name": "Stop"}' | claude-voice-notifications
Customize the PostToolUse matcher to only notify for specific tools:
{
"PostToolUse": [{
"matcher": "Bash", // Only bash commands
"hooks": [...]
}]
}
Run different voices for different events:
# Create separate .env files
cp .env .env.stop
cp .env .env.error
# Use different voice IDs in each
# Configure separate commands in hooks
- Long-running builds - Get notified when builds complete
- File operations - Know when important files are modified
- Multi-tasking - Work on other things while Claude works
- Accessibility - Audio feedback for visual impairments
- Remote work - Get notified even when not looking at screen
- Check your ElevenLabs API key in
.env
- Ensure ffmpeg is installed:
brew install ffmpeg
(macOS) - Test fallback:
pnpm test:fallback
- Verify hooks configuration in
~/.claude/settings.json
- Restart Claude Code after configuration changes
- Check hook syntax with
./setup-hooks.sh
- Ensure script has execute permissions:
chmod +x setup-hooks.sh
- Check file paths in hook commands
We welcome contributions! See CONTRIBUTING.md for guidelines.
If you want to contribute or modify the code:
git clone https://github.com/ZeldOcarina/claude-code-voice-notifications.git
cd claude-code-voice-notifications
npm install # or pnpm install
npm run test # Verify setup (requires API key)
- New TTS providers (Google, AWS, Azure)
- Additional hook events (PreCompact, UserPromptSubmit)
- Custom voice personalities per event type
- Integration with Slack/Discord notifications
MIT License - see LICENSE for details.
- Anthropic for Claude Code and hooks system
- ElevenLabs for amazing TTS technology
- Claude Code community for inspiration and feedback
Special Note: This project demonstrates Claude Code's capability for complete software development - from architecture and coding to documentation and DevOps setup, all generated through AI assistance.
Made with β€οΈ for the Claude Code community
Transform your coding workflow with intelligent voice notifications!