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のWindows版で音を鳴らす方法

Last updated at Posted at 2025-06-17

Claude Codeで音を鳴らしたい!!

みなさん、Cluade Code使ってますか?
Mac環境での音の出し方はそこいら中に書いてあるんですが、Windows+WSL2環境についてなかったので備忘がてら書いておきます。
対応状況が二転三転しているようなのでどのバージョンでもできる、といえない状態のようです。 1.0.25 (Claude Code) での動作を確認しています。

対応方法

コマンドそのものは以下のような物になります。

sound.ps
powershell.exe -Command '[System.Media.SystemSounds]::Hand.Play()'

これでWindowsの設定された警告音が鳴るはずです。WSL上でもWindowsのコマンドを呼ぶことができ、Windowsユーザーなら誰でも.Net Frameworks上のサウンドを鳴らすことができるわけです。

次に、Claude Codeで音声を鳴らすためには、たとえばCLAUDE.mdにこう記述してみてください。

CLAUDE.md
If you finish your works or you show to use message, use this command.
powershell.exe -Command '[System.Media.SystemSounds]::Hand.Play()'

あとは実行時にClaude CodeからPowerShellコマンドを使って良いか聞かれるので、自力でいつでも使えるように許可を与えてください。

参考資料。音の出し分けができるみたいなので、他の音を使いたいときはこちらからどうぞ。
https://learn.microsoft.com/nb-no/dotnet/api/system.media.systemsounds.hand?view=netframework-4.7.1

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?