困りごと
Claude Codeに大きな作業を頼んで放置 → いつ終わったかわからない。
macOS通知を飛ばす
{
"hooks": {
"notification": [
{
"matcher": "",
"command": "osascript -e 'display notification \"$CLAUDE_NOTIFICATION\" with title \"Claude Code\"'"
}
]
}
}
Claude Codeがユーザーに通知を送るタイミングで、macOSの通知センターにポップアップが出る。
Slack通知を飛ばす
{
"hooks": {
"notification": [
{
"matcher": "",
"command": "curl -s -X POST $SLACK_WEBHOOK_URL -H 'Content-type: application/json' -d '{\"text\": \"Claude Code: '$CLAUDE_NOTIFICATION'\"}'"
}
]
}
}
環境変数 SLACK_WEBHOOK_URL にSlackのIncoming Webhook URLをセット。
サウンドで知らせる
{
"hooks": {
"notification": [
{
"matcher": "",
"command": "afplay /System/Library/Sounds/Glass.aiff"
}
]
}
}
macOS標準のシステムサウンドが鳴る。
設定もClaude Codeに任せる
Claude Codeの作業が終わったらmacOS通知を飛ばすHookを設定して。
.claude/settings.json に書いて。
Slack通知も飛ばしたい。Webhook URLは SLACK_WEBHOOK_URL 環境変数から読んで。
組み合わせ
通知 + サウンドを同時に:
{
"matcher": "",
"command": "osascript -e 'display notification \"$CLAUDE_NOTIFICATION\" with title \"Claude Code\" sound name \"Glass\"'"
}