Claude/Code/Q/Is it possible to have claude code play a sound from the terminal when it needs my attention
Properties
- tags
- Claude/Code, Q, Terminal, Notification
Is it possible to have Claude/Code play a sound from the terminal when it needs my attention?
Summary
Built-in Terminal Bell
- Claude Code has built-in support for terminal bell notifications
- Set the
preferredNotifChannelkey in~/.claude/settings.json— Claude/Code/Settings lists the channels it accepts: - This uses the ASCII BEL character (
\a) to trigger terminal bell sounds - To test if terminal bell is working:
Terminal Bell Configuration
macOS Terminal
GNOME Terminal
IDE Integrated Terminals (VSCode, Cursor, etc.)
- Terminal bell can work in IDE terminals, but requires specific configuration
VSCode Configuration
Cursor Configuration
- Settings → Features → Chat → Enable "Play sound on finish"
- Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) → "Help: List Signal Sounds" → Enable "Task Completed" - Note: Cursor's built-in sounds are for chat/agent completion, not terminal bell
- For terminal bell in Cursor, use VSCode-style settings (Cursor is VSCode-based)
Alternative: Use Hooks
Windows/WSL
Hooks for Custom Notifications
macOS Hook Examples
Windows/WSL Hook Examples
Common Issues and Solutions
No sound after enabling terminal_bell
- macOS Terminal app: Ensure Terminal profile has Bell enabled in settings
- VSCode: Verify
accessibility.signals.terminalBell.soundis set to"on"andeditor.accessibilitySupportis"on"in settings.json - Cursor: Enable terminal bell via settings.json (same as VSCode) - note that Cursor's built-in "Play sound on finish" is for chat completion, not terminal bell
- IDE terminals: If still not working after configuration, try restarting the IDE or use hooks instead
- Windows/WSL: Use PowerShell hooks instead of terminal bell
Bells are too quiet or ignored
Hook commands don't run
Answer
- Yes, it is possible to have Claude Code play a sound from the terminal when it needs attention
- Recommended approaches:
- For IDE integrated terminals (VSCode, Cursor):
- For standalone terminal apps (macOS Terminal, iTerm, etc.): Terminal bell works with proper configuration
- For custom sounds/announcements: Configure hooks in
~/.claude/settings.jsonorCLAUDE.md - For macOS: Use
afplaywith system sounds orsayfor text-to-speech - For Windows/WSL: Use PowerShell commands to play system sounds
- Note: Terminal bell (
terminal_bell) can work in IDE terminals with proper configuration, but hooks provide more flexibility and reliability across all environments