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?

Claude Code の hooks + BurntToast で Windows 通知を出す

0
Last updated at Posted at 2026-05-25

Claude Code に大きめの作業をお願いして別作業していると...

image.png

いつの間にかツールの許可待ちで止まってしまうの悲しいですよね。
いくらツール許可をしていても、どこかに漏れがあってこの文言が表示されてしまいます。。

そこで、Claude Code の Notification hook と PowerShell の BurntToast を使って、Windows の通知を出す設定を作ります。

BurntToast とは?

BurntToast は、PowerShell から Windows のトースト通知を出せるモジュールです。

まずはインストール

PowerShellを起動して

Install-Module -Name BurntToast -Scope CurrentUser

同じくPowerShellで動作確認。

Import-Module BurntToast

New-BurntToastNotification -Text "Claude Code", "通知テスト"

通知が出れば OK

こんな感じ

Screenshot 2026-05-25 165239.png

Claude Code hooks を設定する

WSL側の~/.claude/settings.json に以下を設定します。

{
  "hooks": {
    "Notification": [
      {
        "matcher": "permission_prompt",
        "hooks": [
          {
            "type": "command",
            "command": "powershell.exe -NoProfile -Command \"Import-Module BurntToast; New-BurntToastNotification -Text 'Claude Codeが許可待ちです。', '$(pwd)'\""
          }
        ]
      },
      {
        "matcher": "idle_prompt",
        "hooks": [
          {
            "type": "command",
            "command": "powershell.exe -NoProfile -Command \"Import-Module BurntToast; New-BurntToastNotification -Text 'Claude Codeの出力が終わったらしい。', '$(pwd)'\""
          }
        ]
      }
    ]
  }
}

この設定で下記タイミングに通知が走ります。

  • permission_prompt
    Claude Code がツール使用の許可待ちになった時
  • idle_prompt
    Claude Code が入力待ち(出力完了)になった時

動作確認

Claude Code にファイル変更などの作業を依頼してみてください。

ツールの許可待ち・実行完了後のプロンプト入力待ちで、Windows通知が表示されれば成功です。
※通知までに少しラグがあります

補足

  • PowerShell 7以降を使っている場合は powershell.exepwsh.exe に変更して下さい
  • 通知文に $(pwd) を追加すると、どのプロジェクトからの通知か分かりやすくなります
    例:
    New-BurntToastNotification -Text 'Claude Code needs your permission. `n$(pwd)'
    
  • 通知されるまでの間にツール使用の許可・プロンプト実行をすると通知は実行されません

おわりに

実は公式にWindows向けのHooks設定は記載されてます。

ただ、こんな感じのモーダルです。うん
image.png

BurntToastの方が-AppIconでアイコンを追加出来たり、Windowsの通知に溜まってくれるので非常に嬉しいなと思って使用しました。

参考文献

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?