Closed2

Claude Code Hooksで通知音設定(Mac)

dyoshikawadyoshikawa

claude コマンドを叩いて /hooks スラッシュコマンドを実行。

Notification, Stopイベントに対して以下のコマンドを設定。

afplay /System/Library/Sounds/Glass.aiff

最後に User Settings を選択。

~/.claude/settings.json はこうなる:

~/.claude/settings.json
{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Glass.aiff"
          }
        ]
      }
    ],
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Glass.aiff"
          }
        ]
      }
    ]
  }
}

https://note.com/konho/n/n588e491f174e

waddy_uwaddy_u

memo item2 で通知センターに通知するように

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Claude Codeが許可を求めています\" with title \"Claude Code\" subtitle \"確認待ち\" sound name \"Glass\"'"
          }
        ]
      }
    ],
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"タスクが完了しました\" with title \"Claude Code\" subtitle \"処理終了\" sound name \"Hero\"'"
          }
        ]
      }
    ]
  }
}

https://zenn.dev/the_exile/articles/claude-code-hooks
https://qiita.com/P-man_Brown/items/ea08dfd6fe639be49c32
https://qiita.com/P-man_Brown/items/8f02ed57355c6e8fad84

このスクラップは2ヶ月前にクローズされました