Claude Codeでの作業方法を変えた、小さな生産性ハック

Dev.to / 2026/4/22

💬 オピニオンTools & Practical Usage

要点

  • この記事では、複数のClaude Codeセッションを同時に扱う際のシンプルな生産性向上として、タスク完了時に音声の「done」通知を鳴らす方法を紹介します。
  • 隠れているターミナル内の、見落としやすいUI表示に頼るのではなく、セッションが完了した正確なタイミングで短いチャイムが自動的にユーザーへ注意を促します。
  • ユーザーは、これによりコンテキスト切り替えが減り、音が鳴ったときだけセッションを確認することでフロー状態を維持しやすくなったと報告しています。
  • 設定は<code>~/.claude/settings.json</code>を編集してグローバル通知フックを追加し、WindowsではPowerShell、Mac/Linuxでは<code>afplay</code>または<code>paplay</code>のコマンドをプラットフォームに応じて使います。
  • 構成では空のマッチャーを使うため、プロジェクトやセッションに関係なく、通知のたびにフックが発火します。設定にかかるのは数分程度です。

I typically have half a dozen Claude Code sessions running at once, spread across different terminals and monitors, some hidden behind other windows. The visual "done" indicator is easy to miss when you're not looking at the right terminal.

About a month ago I added a global hook that plays a short chime whenever any session finishes a task. Two minutes to configure. Can't live without it now.

The difference is about flow. Before, I'd either stare at a terminal waiting, or context-switch and then keep interrupting myself to check which session was ready. Now the chime pulls me back at exactly the right moment. I stay in whatever I'm doing until I hear it, then go find the session that needs me. It's kept me in a flow state in a way I genuinely didn't expect from something so simple.

How to set it up

Drop this into your ~/.claude/settings.json:

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "powershell.exe -NoProfile -Command \"(New-Object Media.SoundPlayer 'C:\\Windows\\Media\\chimes.wav').PlaySync()\""
          }
        ]
      }
    ]
  }
}

That's it. Windows has the sound file built in. For Mac/Linux, swap the command for afplay or paplay with a sound file of your choice.

The empty matcher means it fires on every notification, regardless of which project or session triggered it. Claude Code sends a notification whenever a session finishes and is waiting for input, which is exactly the moment you want to know about.