From 3413c7065f9e928691eaf4c0cfb99af75caf4dea Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sun, 30 Nov 2025 08:44:22 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 ++++++++++ README.md | 3 +++ hooks/hooks.json | 25 +++++++++++++++++++ hooks/play-sound.sh | 28 ++++++++++++++++++++++ plugin.lock.json | 49 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 117 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 hooks/hooks.json create mode 100644 hooks/play-sound.sh create mode 100644 plugin.lock.json diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..cfd3a06 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "handbook-sounds", + "description": "Audio feedback for Claude Code events on Windows using PowerShell sounds", + "version": "1.12.0", + "author": { + "name": "nikiforovall", + "url": "https://github.com/nikiforovall" + }, + "hooks": [ + "./hooks" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..ab62aab --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# handbook-sounds + +Audio feedback for Claude Code events on Windows using PowerShell sounds diff --git a/hooks/hooks.json b/hooks/hooks.json new file mode 100644 index 0000000..5a66256 --- /dev/null +++ b/hooks/hooks.json @@ -0,0 +1,25 @@ +{ + "description": "Audio feedback when Claude finishes responding and sends notifications", + "hooks": { + "Stop": [ + { + "hooks": [ + { + "type": "command", + "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/play-sound.sh\" --stop" + } + ] + } + ], + "Notification": [ + { + "hooks": [ + { + "type": "command", + "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/play-sound.sh\" --notification" + } + ] + } + ] + } +} diff --git a/hooks/play-sound.sh b/hooks/play-sound.sh new file mode 100644 index 0000000..9b7dfb0 --- /dev/null +++ b/hooks/play-sound.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# shellcheck shell=bash +set -euo pipefail + +# Check if hook is disabled via environment variable +if [ "${CC_HANDBOOK_SOUNDS_DISABLE_HOOKS:-false}" = "true" ]; then + exit 0 +fi + +# Parse hook type argument +hook_type="${1:-stop}" + +# Select sound file based on hook type +if [ "$hook_type" = "--stop" ]; then + sound_file="${CC_HANDBOOK_STOP_SOUNDS_FILE:-C:/Windows/Media/notify.wav}" +elif [ "$hook_type" = "--notification" ]; then + sound_file="${CC_HANDBOOK_NOTIFICATION_SOUNDS_FILE:-C:/Windows/Media/Windows Exclamation.wav}" +else + # Fallback for backward compatibility + sound_file="${CC_HANDBOOK_SOUNDS_FILE:-C:/Windows/Media/notify.wav}" +fi + +# Play sound using PowerShell with -NoProfile to avoid oh-my-posh conflicts +# Use -NonInteractive to prevent any prompts +# Run in background to not block Claude +powershell -NoProfile -NonInteractive -Command "(New-Object Media.SoundPlayer '$sound_file').PlaySync();" & + +exit 0 diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..f04bbcc --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,49 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:NikiforovAll/claude-code-rules:plugins/handbook-sounds", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "d52647f1aa4d87d70fbce953ceca1d46fb350887", + "treeHash": "f750f58093b33aa7ab769131efc2134d4487ffd6fd06727f46877b7df482084c", + "generatedAt": "2025-11-28T10:12:15.870942Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "handbook-sounds", + "description": "Audio feedback for Claude Code events on Windows using PowerShell sounds", + "version": "1.12.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "ed99aa1e2867b1b812308888067be7941026d3a00555dbb3eba380608c771dab" + }, + { + "path": "hooks/play-sound.sh", + "sha256": "7b238c48f44eae5ffc22b208fa5b3f4ca81b979adccef91996b1c5099c34d942" + }, + { + "path": "hooks/hooks.json", + "sha256": "d02c54081741f5cb46d350a5a9540bb91e04c1c4e932298f342b455e4a684fc1" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "c5712620891d16a9addd19170c724b1ac44aa0fe46146f6f41c1e9c0ea39fb1b" + } + ], + "dirSha256": "f750f58093b33aa7ab769131efc2134d4487ffd6fd06727f46877b7df482084c" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file