Audible notifications for Claude Code tasks and user confirmations...
Play audible notifications when Claude Code tasks complete and when user confirmation is requested.
This skill provides two key capabilities:
/buhi command plays a "Buhi" sound effect (cute pig sound) to test notifications or trigger manually/buhi CommandWhen invoked, this command:
~/.claude/skills/buhi/) or locally (.claude/skills/buhi/)settings.json with the correct absolute path:buhi.m4a sound file from the skill directory using the appropriate OS commandThis means you only need to run /buhi once to set up automatic notifications for both task completions and user confirmations.
The skill automatically adapts to where it's installed:
~/.claude/skills/buhi/): Configures ~/.claude/settings.json - notifications work for all projects.claude/skills/buhi/): Configures .claude/settings.json in your project - notifications work only for this projectWhen /buhi is invoked, it:
Detects installation location by examining the skill's base directory path:
~/.claude/skills/buhi/ → Global installation<project>/.claude/skills/buhi/ → Local installationDetermines settings.json path:
~/.claude/settings.json<project>/.claude/settings.json (two directories up from skill base)Constructs absolute audio file path:
/buhi.m4aSelects audio player based on OS:
afplaypaplayMedia.SoundPlayermacOS:
afplay <absolute-path-to>/buhi.m4a
Linux:
paplay <absolute-path-to>/buhi.m4a
Windows:
powershell -c "(New-Object Media.SoundPlayer '<absolute-path-to>/buhi.m4a').PlaySync()"
Simply run /buhi to:
The /buhi command automatically configures hooks in the appropriate settings.json file. These hooks trigger the notification sound in the following scenarios:
Running /buhi will:
settings.json pathThis ensures the notification works regardless of your current working directory.
If you need to manually configure or customize the hook, here's what /buhi sets up. Note that it uses absolute paths to ensure reliability:
macOS (Global installation):
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "afplay ~/.claude/skills/buhi/buhi.m4a"
}
]
}
],
"PreToolUse": [
{
"matcher": "AskUserQuestion",
"hooks": [
{
"type": "command",
"command": "afplay ~/.claude/skills/buhi/buhi.m4a"
}
]
}
]
}
}
macOS (Local installation):
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "afplay /absolute/path/to/project/.claude/skills/buhi/buhi.m4a"
}
]
}
],
"PreToolUse": [
{
"matcher": "AskUserQuestion",
"hooks": [
{
"type": "command",
"command": "afplay /absolute/path/to/project/.claude/skills/buhi/buhi.m4a"
}
]
}
]
}
}
Linux (Global installation):
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "paplay ~/.claude/skills/buhi/buhi.m4a"
}
]
}
],
"PreToolUse": [
{
"matcher": "AskUserQuestion",
"hooks": [
{
"type": "command",
"command": "paplay ~/.claude/skills/buhi/buhi.m4a"
}
]
}
]
}
}
Windows (Global installation):
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "powershell -c \"(New-Object Media.SoundPlayer '~/.claude/skills/buhi/buhi.m4a').PlaySync()\""
}
]
}
],
"PreToolUse": [
{
"matcher": "AskUserQuestion",
"hooks": [
{
"type": "command",
"command": "powershell -c \"(New-Object Media.SoundPlayer '~/.claude/skills/buhi/buhi.m4a').PlaySync()\""
}
]
}
]
}
}
The /buhi command automatically determines your installation type and OS, then configures the appropriate absolute path.
Important Notes:
~/.claude/settings.json - notifications work for all projects.claude/settings.json in your project - notifications work only for this project/buhi will preserve your existing hooksEdit your settings.json file and add volume parameters to the hook command:
macOS example:
"command": "afplay -v 0.5 /absolute/path/to/buhi.m4a"
Volume range: 0.0 (mute) to 1.0 (full volume)
Replace buhi.m4a with your own audio file:
# For local installation
cp your-sound.m4a .claude/skills/buhi/buhi.m4a
# For global installation
cp your-sound.m4a ~/.claude/skills/buhi/buhi.m4a
Or update your settings.json to reference a different sound file:
"command": "afplay /path/to/your/custom-sound.m4a"
Supported formats: .m4a, .mp3, .wav (varies by OS and audio player)
Remove or comment out the hooks from your settings.json:
For local installation (.claude/settings.json):
{
"hooks": {
// "Stop": [...] // Commented out - disables task completion notifications
// "PreToolUse": [...] // Commented out - disables user confirmation notifications
}
}
For global installation (~/.claude/settings.json):
{
"hooks": {
// "Stop": [...] // Commented out - disables task completion notifications
// "PreToolUse": [...] // Commented out - disables user confirmation notifications
}
}
Or delete the hook entries entirely if you have no other hooks configured. You can also disable them individually - for example, keep task completion notifications but disable user confirmation notifications.
/buhiVerify skill installation:
# For local installation
ls -la .claude/skills/buhi/buhi.m4a
# For global installation
ls -la ~/.claude/skills/buhi/buhi.m4a
Check system audio player:
afplay is pre-installedsudo apt-get install pulseaudio-utils)Test playback manually:
# macOS (use the appropriate path for your installation)
afplay ~/.claude/skills/buhi/buhi.m4a
# Linux
paplay ~/.claude/skills/buhi/buhi.m4a
# Windows PowerShell
(New-Object Media.SoundPlayer '~/.claude/skills/buhi/buhi.m4a').PlaySync()
Verify settings.json was created:
# For local installation
cat .claude/settings.json
# For global installation
cat ~/.claude/settings.json
If the file doesn't exist, run /buhi again to create it.
Verify settings.json syntax:
# For local installation
cat .claude/settings.json | python -m json.tool
# For global installation
cat ~/.claude/settings.json | python -m json.tool
Or use any JSON validator to ensure the file is valid JSON.
Check hook configuration:
Review hook execution:
The /buhi command automatically detects your operating system and configures the appropriate audio player command. If you switch between different operating systems on the same project, simply run /buhi again to update the configuration for your current OS.
afplay, Apple's built-in audio file playerpaplay, PulseAudio's command-line player (requires pulseaudio-utils package)Media.SoundPlayer class (built into .NET Framework)The hooks trigger in the following scenarios:
Stop hook triggers when:
PreToolUse hook (with AskUserQuestion matcher) triggers when:
The matcher field accepts regex patterns to filter which events trigger the hook. An empty string matches all events.
The included buhi.m4a file is: