Send messages between agents across gateways using hooks. Use when you need to delegate tasks to Scotty (Pi) or communicate cross-gateway.
---
name: agent-messaging
description: Send messages between agents across gateways using hooks. Use when you need to delegate tasks to Scotty (Pi) or communicate cross-gateway.
---
# Agent Messaging Skill
Send tasks and messages to other agents across different gateways.
## Agent Directory
| Agent | Location | IP | Port | Hook Token |
|-------|----------|-----|------|------------|
| **Ada** ๐ฎ | ada-gateway (GCP) | `100.106.69.9` | `18789` | `$ADA_HOOK_TOKEN` (see secrets/agent-tokens.env) |
| **Spock** ๐ | ada-gateway (GCP) | Same as Ada | Same | Same |
| **Scotty** ๐ง | castlemascot-r1 (Pi) | `100.68.207.75` | `8443` | `$SCOTTY_HOOK_TOKEN` (see secrets/agent-tokens.env) |
## Usage
### Send message to Scotty (from Ada/Spock)
```bash
~/clawd/skills/agent-messaging/scripts/send-to-scotty.sh "Your task or message here"
```
### Send message to Ada (from Scotty)
```bash
~/clawd/skills/agent-messaging/scripts/send-to-ada.sh "Your message here"
```
### Direct curl (any agent)
```bash
curl -X POST http://<IP>:<PORT>/hooks/agent \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{"message": "Your message"}'
```
## Examples
### Delegate a task to Scotty
```bash
./scripts/send-to-scotty.sh "Install the table-image skill. Run: go install github.com/joargp/tablesnap/cmd/tablesnap@latest. Confirm when done."
```
### Ask Scotty to run a script
```bash
./scripts/send-to-scotty.sh "Run setup-skills.sh and report results: cd ~/clawd && ./scripts/setup-skills.sh"
```
### Report back to Ada
```bash
./scripts/send-to-ada.sh "Task complete! Installed 5 packages successfully."
```
## Response
The hook returns:
```json
{"ok": true, "runId": "uuid-here"}
```
The target agent will process the message in their next available slot.
## Notes
- Messages are queued if agent is busy
- Use Tailscale IPs (100.x.x.x) for reliability
- Tokens are in `~/clawd/secrets/` or `memory.md`
- Same-gateway agents (Ada โ Spock) use `sessions_send` instead
## Troubleshooting
**Connection refused?**
- Check if gateway is running: `ps aux | grep clawdbot`
- Verify port is correct
- Check Tailscale connection: `tailscale status`
**Unauthorized?**
- Verify hook token matches gateway config
- Check `hooks.token` in clawdbot.json
don't have the plugin yet? install it then click "run inline in claude" again.