Skip to main content
ycs77

notification-basic-win

by ycs77v1.0.0

[Windows] 基本鈴聲 - 當 Claude Code 執行結束或停止時,自動播放提示音通知用戶

Installation guide →
hooksdevelopment GitHub

Documentation

# Claude Code 提示音 - 基本鈴聲 (Windows)

當 Claude Code 執行結束或停止時,自動播放提示音通知用戶。

## 功能特色

- 🔔 **Notification 事件**: 當 Claude Code 發送通知時播放提示音
- 🛑 **Stop 事件**: 當 Claude Code 停止執行時播放提示音

## 安裝插件

在 Claude Code 中安裝插件:

```
/plugin install notification-basic-win@ycs77-notifications
```

## 使用說明

安裝插件後,它會自動運作,無需額外設定。

## Hook 觸發時機

### Notification Hook
- 當 Claude Code 發送用戶通知時觸發
- 用於提醒用戶注意重要訊息

### Stop Hook
- 當 Claude Code 主代理準備停止執行時觸發
- 用於通知用戶任務已完成

## 疑難排解

### 沒有聲音

1. 檢查系統音量設定
2. 確認音效檔案存在且格式正確(.wav)
3. 使用 `claude --debug` 檢查 hook 執行日誌
4. 手動測試 PowerShell 指令:
   ```powershell
   (New-Object System.Media.SoundPlayer 'D:\path\to\notification.wav').PlaySync()
   ```

### Hook 未觸發

1. 確認插件已正確安裝
2. 重新啟動 Claude Code(hooks 在啟動時載入)
3. 使用 `/hooks` 指令檢查已載入的 hooks
4. 使用 `claude --debug` 查看詳細日誌

### 權限問題

如果 PowerShell 執行被阻擋,可能需要調整執行策略:

```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```

## 作者

Lucas Yang ([email protected])

## 授權

MIT License