To receive notifications when Claude Code completes a response, use hooks.
Hooks Reference - Claude Code Docs
Setup
Add the following to .claude/settings.json.
json
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "afplay /System/Library/Sounds/Glass.aiff"
}
]
}
]
}
}
Stop is executed when the main Claude Code agent completes a response. It will not run if stopped by user interruption.
Notification Methods
Play a sound
afplay /System/Library/Sounds/Glass.aiff
Display a notification
osascript -e 'display notification \"Notification content\" with title \"Title\" subtitle \"Subtitle\"'