How it works
Notification hooks can:- Trigger on multiple events: Notification, Stop, SubagentStop, SessionEnd
- Support multiple channels: Desktop notifications, system sounds, Slack, email, webhooks
- Provide context: Include session details, task completion status, error messages
- Filter intelligently: Only notify on important events
- Work cross-platform: macOS, Linux, Windows
Prerequisites
Install notification tools for your platform:Basic notifications
Desktop notification when Droid waits
Get notified when Droid is waiting for your input. Create.factory/hooks/notify-wait.sh:
~/.factory/settings.json (user-wide):
Sound alert when task completes
Play a sound when Droid finishes. Create.factory/hooks/completion-sound.sh:
~/.factory/settings.json:
Advanced notifications
Slack integration
Send Slack messages when Droid completes tasks. Create.factory/hooks/slack-notify.sh:
~/.factory/settings.json:
Email notifications
Send email alerts for important events. Create.factory/hooks/email-notify.sh:
Rich desktop notifications with actions
macOS notifications with action buttons. Create.factory/hooks/rich-notify-macos.sh:
Webhook integration
Send notifications to custom webhooks: Create.factory/hooks/webhook-notify.sh:
Real-world examples
Example 1: Focus mode notifications
Only notify when you’re away from your desk: Create.factory/hooks/smart-notify.sh:
Example 2: Team notification dashboard
Log all events to a shared dashboard: Create.factory/hooks/team-logger.sh:
Best practices
1
Keep notification scripts fast
Use short timeouts to avoid blocking Droid:
2
Handle failures gracefully
Don’t block execution if notifications fail:
3
Respect user preferences
Check environment variables for opt-out:
4
Test notifications
Manually trigger hooks for testing:
5
Use appropriate notification levels
Different events warrant different urgency:
- Notification: High urgency (Droid waiting)
- Stop: Medium urgency (task complete)
- SessionEnd: Low urgency (FYI only)
Troubleshooting
Problem: No notifications show up Solution: Check notification permissions:See also
- Hooks reference - Complete hooks API documentation
- Get started with hooks - Basic hooks introduction
- Session automation - Automate session setup
- Logging and analytics - Track Droid usage
