* feat: add Claude Code hooks for formatting and notifications - Add PostToolUse hooks to auto-format files after Edit/Write: - format-frontend.sh: runs prettier on frontend files - format-backend.sh: runs rustfmt on backend Rust files - Add Notification hook to alert user when Claude needs input - Add edition=2021 to rustfmt.toml for proper parsing - Update .gitignore for symlinked cache directories - Add additional bash permissions for cargo check and npm scripts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * remove echo * notification when in ssh as well --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
26 lines
933 B
Bash
Executable File
26 lines
933 B
Bash
Executable File
#!/bin/bash
|
|
# Notify user when Claude requires input (works on macOS and Linux)
|
|
|
|
# Check if we're in an SSH session
|
|
if [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" || -n "$SSH_CONNECTION" ]]; then
|
|
# SSH session - use terminal bell
|
|
# If using VSCode, enable audible terminal bell for SSH sessions:
|
|
# Add the following to .vscode/settings.json:
|
|
# "accessibility.signals.terminalBell": {
|
|
# "sound": "on"
|
|
# },
|
|
# "terminal.integrated.enableVisualBell": true
|
|
printf '\a'
|
|
else
|
|
# Local session - use native notifications
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
osascript -e 'display notification "Claude is waiting for your input" with title "Claude Code" sound name "Glass"' 2>/dev/null || printf '\a'
|
|
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
|
notify-send "Claude Code" "Claude is waiting for your input" 2>/dev/null || printf '\a'
|
|
else
|
|
printf '\a'
|
|
fi
|
|
fi
|
|
|
|
exit 0
|