-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Problem
The smart-notify.sh script fails with AppleScript syntax error when variables contain special characters (quotes, parentheses, etc.):
Stop hook error: Failed with non-blocking status code: 30:37: syntax error: A identifier can't go after this """. (-2740)
Root Cause
Line 54 uses improper quote escaping when passing variables to osascript:
osascript -e "display notification \"$MSG\" with title \"Claude Code ($SESSION_DIR) - $TITLE\" sound name \"$SOUND\""When $MSG, $SESSION_DIR, or $TITLE contain quotes, parentheses, or other special characters, they break the AppleScript syntax.
Reproduction
- Install Claude Code hooks with
npx @verygoodplugins/mcp-automem claude-code - Trigger a Stop hook where the assistant message contains quotes or special characters
- Observe the syntax error in hook output
Proposed Solution
Properly escape variables before passing to AppleScript:
- Use
printfwithsedto escape quotes and special characters - Or use AppleScript's quoted form for proper escaping
- Or pass variables through heredoc
Impact
- Affects macOS users without
terminal-notifierinstalled (fallback path) - Stop hooks fail but don't block Claude Code operation (non-blocking error)
- Error appears in hook output logs
Environment
- macOS (affects osascript fallback path)
- Claude Code hooks installed via mcp-automem
- Users without terminal-notifier installed
Metadata
Metadata
Assignees
Labels
No labels