Skip to main content
This cookbook shows how to set up custom notifications so you know when Droid needs your input or when important events occur during a session.

How it works

Notification hooks can:
  1. Trigger on multiple events: Notification, Stop, SubagentStop, SessionEnd
  2. Support multiple channels: Desktop notifications, system sounds, Slack, email, webhooks
  3. Provide context: Include session details, task completion status, error messages
  4. Filter intelligently: Only notify on important events
  5. Work cross-platform: macOS, Linux, Windows

Prerequisites

Install notification tools for your platform:
For Slack notifications, create a webhook at api.slack.com/messaging/webhooks.

Basic notifications

Desktop notification when Droid waits

Get notified when Droid is waiting for your input. Create .factory/hooks/notify-wait.sh:
Add to ~/.factory/hooks.json (user-wide):

Sound alert when task completes

Play a sound when Droid finishes. Create .factory/hooks/completion-sound.sh:
Add to ~/.factory/hooks.json:

Advanced notifications

Slack integration

Send Slack messages when Droid completes tasks. Create .factory/hooks/slack-notify.sh:
Set your webhook URL:
Add to ~/.factory/hooks.json:

Email notifications

Send email alerts for important events. Create .factory/hooks/email-notify.sh:
Configure environment:

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:
Problem: Slack messages not sending Solution: Test webhook directly:
Problem: Getting spammed with alerts Solution: Add rate limiting:
Problem: No audio alert Solution: Check audio system:

See also