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?

WSL + Claude Code Hooks で通知を表示させる

Last updated at Posted at 2025-07-05

この記事を読むと

Claude Code Hooks を使って、 Claude Code がタスクを完了するなどしたときに WSL から windows に通知を送ることができます!

💥(← Claude のウニのロゴに一番近い絵文字)

環境

  • WSL
  • Windows
  • Claude Code v1.0.43
  • go-toast

手順

1. go-toast をダウンロード

windows に通知を送信するのには go-toast を使います。下のリンクから実行ファイルをダウンロードして適当なディレクトリに置きます。

(Download 64bit/32bit を選べばOKです!)

2. hooks の設定

WSL で ~/.claude/settings.json を開き、以下のように設定を書きます。
(</path/to/toast64.exe> の部分は適宜変更してください!)

settings.json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "</path/to/toast64.exe> --app-id 'Claude Code' --title 'Command Execution' --message 'Executing bash command...' --audio 'default' --duration 'short'"
          }
        ]
      }
    ],
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "</path/to/toast64.exe> --app-id 'Claude Code' --title 'Notification' --message 'Claude Code has a notification for you.' --audio 'default' --duration 'long'"
          }
        ]
      }
    ],
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "</path/to/toast64.exe> --app-id 'Claude Code' --title 'Task Complete' --message 'Claude Code has finished the task.' --audio 'default' --duration 'long'"
          }
        ]
      }
    ]
  }
}

完成です!

カスタマイズしたい方は go-toast のリポジトリや claude のドキュメントを参照してください!

トラブルシューティング

動かない

Claude Code のバージョンが古い可能性が高いです。claude -v コマンドを実行して Claude Code が v1.0.43 よりも新しいことを確認してください!

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?