Add notification hook, directory CLAUDE.md scaffolding

- Wire Notification event in settings.json to new notify.sh hook
- notify.sh: Windows toast notifications via PowerShell balloon tip
- docs/CLAUDE.md: authoring standards for ADRs, TR registry, control manifest, engine reference
- design/CLAUDE.md: GDD directory guidance placeholder
- src/: scaffold with .gitkeep and CLAUDE.md authoring guide

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Donchitos
2026-03-16 20:17:53 +11:00
parent f36494e70c
commit 763ad1f0d1
6 changed files with 154 additions and 0 deletions

35
.claude/hooks/notify.sh Normal file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Notification hook — fires when Claude Code sends a notification
# Shows a Windows toast via PowerShell
# Read notification JSON from stdin
INPUT=$(cat)
# Extract message — try jq first, fall back to grep
if command -v jq &>/dev/null; then
MESSAGE=$(echo "$INPUT" | jq -r '.message // empty' 2>/dev/null)
fi
if [ -z "$MESSAGE" ]; then
MESSAGE=$(echo "$INPUT" | grep -oE '"message":"[^"]*"' | sed 's/"message":"//;s/"//')
fi
if [ -z "$MESSAGE" ]; then
MESSAGE="Claude Code needs your attention"
fi
# Sanitize message for PowerShell string embedding (escape single quotes)
MESSAGE_SAFE=$(echo "$MESSAGE" | sed "s/'/''/g" | head -c 200)
# Show Windows balloon tip notification (works on all Windows 10/11 without extra modules)
powershell.exe -NonInteractive -WindowStyle Hidden -Command "
Add-Type -AssemblyName System.Windows.Forms
\$notify = New-Object System.Windows.Forms.NotifyIcon
\$notify.Icon = [System.Drawing.SystemIcons]::Information
\$notify.BalloonTipTitle = 'Claude Code'
\$notify.BalloonTipText = '$MESSAGE_SAFE'
\$notify.Visible = \$true
\$notify.ShowBalloonTip(5000)
Start-Sleep -Seconds 6
\$notify.Dispose()
" 2>/dev/null &
echo "Notification: $MESSAGE_SAFE"

View File

@@ -83,6 +83,18 @@
]
}
],
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/notify.sh",
"timeout": 10
}
]
}
],
"PreCompact": [
{
"matcher": "",