0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ClaudeCode🔰 コマンドの実行許可を求めてきた時に通知音を鳴らす

Posted at

ClaudeCode.png

コマンドの使用許可が必要な場合に通知音を鳴らす

✅ はじめに

ClaudeCodeがコマンドの実行許可やツールの使用許可を求めてきた時に、通知音を鳴らす方法を備忘録として投稿させていただきます。

やりたいこと

ClaudeCodeがコマンドの実行許可やツールの使用許可を求めてきた時に、通知音を鳴らす。

解決方法

Notification Hookに通知音を鳴らすコマンドを設定する。

公式ドキュメント

✅ スラッシュコマンドから設定する方法

1: ClaudeCodeを起動した状態で、スラッシュコマンド/hookを実行

/hooks

2: Notificationを選択

Notification

3: 通知音を再生するコマンドを入力

afplay /System/Library/Sounds/Glass.aiff

4: 設定の保存場所を選択

1. Project settings (local)  Saved in .claude/settings.local.json
2. Project settings          Checked in at .claude/settings.json
3. User settings             Saved in at ~/.claude/settings.json

✅ settings.jsonに設定する方法

1: 設定ファイルを開く

# ユーザ設定
~/.claude/settings.json

# プロジェクト設定
.claude/settings.json

# ローカルプロジェクト設定(コミットされない)
.claude/settings.local.json

2: 設定ファイルにhookの設定を追記する

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Glass.aiff"
          }
        ]
      }
    ]
  }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?