The plugin now supports customizable volume control for notification sounds. Users can configure notification volume from 0% (silent) to 100% (full volume) through the setup wizard or by editing config.json.
Run the interactive setup command:
/setup-notificationsThe wizard will ask you to choose a volume level:
- Full volume (100%) - Maximum volume (default)
- High volume (70%) - Loud but not maximum
- Medium volume (50%) - Balanced volume
- Low volume (30%) - Quiet, good for offices
- Very low (10%) - Very quiet, minimal distraction
The wizard will let you preview a sound at your selected volume before saving.
Edit ~/.claude/claude-notifications-go/config.json and set the volume field:
{
"notifications": {
"desktop": {
"enabled": true,
"sound": true,
"volume": 0.5,
"appIcon": "${CLAUDE_PLUGIN_ROOT}/claude_icon.png"
},
...
},
...
}Volume values:
1.0- Full volume (100%, default)0.7- High volume (70%)0.5- Medium volume (50%)0.3- Low volume (30%)0.1- Very low volume (10%)- Valid range:
0.0to1.0
The plugin uses logarithmic volume scaling to match human hearing perception:
Linear Volume → Logarithmic Units (log₂)
1.0 (100%) → 0.0 (full volume, no change)
0.7 (70%) → -0.5 (~-3dB)
0.5 (50%) → -1.0 (~-6dB, half perceived volume)
0.3 (30%) → -1.7 (~-10dB)
0.1 (10%) → -3.3 (~-20dB)
This means:
0.5sounds like "half as loud" to human ears0.3is noticeably quieter but still audible0.1is very quiet, suitable for very quiet environments
Volume control is implemented using gopxl/beep/effects.Volume:
volumeStreamer := &effects.Volume{
Streamer: audioStream,
Base: 2, // Exponential base
Volume: log₂(volume), // Logarithmic conversion
Silent: false,
}The same algorithm is used in:
internal/notifier/notifier.go- For actual notificationscmd/sound-preview/main.go- For sound preview utility
{
"notifications": {
"desktop": {
"enabled": true,
"sound": true,
"volume": 0.3,
"appIcon": "${CLAUDE_PLUGIN_ROOT}/claude_icon.png"
}
}
}Use case: You work in an office and don't want to disturb colleagues.
{
"notifications": {
"desktop": {
"enabled": true,
"sound": true,
"volume": 0.5,
"appIcon": "${CLAUDE_PLUGIN_ROOT}/claude_icon.png"
}
}
}Use case: Balanced volume for home office environment.
{
"notifications": {
"desktop": {
"enabled": true,
"sound": true,
"volume": 1.0,
"appIcon": "${CLAUDE_PLUGIN_ROOT}/claude_icon.png"
}
}
}Use case: You work in a noisy environment and need maximum volume.
{
"notifications": {
"desktop": {
"enabled": true,
"sound": false,
"volume": 1.0,
"appIcon": "${CLAUDE_PLUGIN_ROOT}/claude_icon.png"
}
}
}Use case: You only want visual notifications, no sound.
# Test 30% volume
bin/sound-preview --volume 0.3 sounds/task-complete.mp3
# Test 50% volume
bin/sound-preview --volume 0.5 sounds/task-complete.mp3
# Test full volume
bin/sound-preview sounds/task-complete.mp3After configuring volume in ~/.claude/claude-notifications-go/config.json, trigger a test notification:
# Manually trigger a test hook
echo '{"session_id":"test","transcript_path":"","tool_name":"ExitPlanMode"}' | \
bin/claude-notifications handle-hook PreToolUseOr just wait for the next real notification from Claude Code.
The plugin validates volume values:
# Valid volumes
volume: 0.0 # Silent (technically valid)
volume: 0.3 # 30% ✓
volume: 0.5 # 50% ✓
volume: 1.0 # 100% ✓
# Invalid volumes (will cause error)
volume: -0.1 # Negative ✗
volume: 1.5 # Above 1.0 ✗
volume: "50%" # String ✗ (must be float)Error message:
Error: desktop volume must be between 0.0 and 1.0 (got 1.5)
- Default volume:
1.0(full volume) - Applied automatically when config is generated
If you have an existing config.json without the volume field:
- The plugin will automatically add
volume: 1.0on first load (viaApplyDefaults()) - Your notifications will continue at full volume (backward compatible)
- You can manually add
"volume": 0.5to change it
No action required! The plugin automatically defaults to full volume (1.0) if the field is missing.
If you want to change the volume:
- Option A: Run
/setup-notificationsand reconfigure - Option B: Manually add
"volume": 0.5to yourconfig.json:
{
"notifications": {
"desktop": {
"enabled": true,
"sound": true,
"volume": 0.5, // ← Add this line
"appIcon": "..."
}
}
}Lower the volume value in config:
"volume": 0.3 // Try 30%Increase the volume value:
"volume": 0.7 // Try 70%Check:
- Is sound enabled?
"sound": true - Is volume in valid range?
0.0to1.0 - Is the sound file path correct?
- Check logs:
notification-debug.logshould show:Applying volume control: 30% Sound played successfully: sounds/task-complete.mp3 (volume: 30%)
Currently not supported - volume is global for all notifications. This feature may be added in the future.
Workaround: Use different sound files with varying loudness.
- Config structure:
internal/config/config.go - Notifier implementation:
internal/notifier/notifier.go - Sound preview:
cmd/sound-preview/main.go - Setup wizard:
commands/setup-notifications.md - Example config:
~/.claude/claude-notifications-go/config.json
Potential improvements:
- Per-status volume control (different volume for each notification type)
- Time-based volume (quieter at night, louder during day)
- Adaptive volume based on system volume
- Fade-in/fade-out effects
- Volume presets ("office", "home", "loud")
- Interactive Sound Preview - Preview sounds before choosing
- Webhook Documentation - Send notifications to external services
- Architecture - Plugin architecture overview