Route and Bind
James sent "What is the weather today?" on WhatsApp. TutorClaw responded with a PRIMM lesson about weather variables.
"It is trying to tutor me on weather," he said.
Emma looked over. "Every message on your WhatsApp goes to TutorClaw because it is the only agent bound to that channel. Weather, reminders, grocery lists. It tries to teach all of them."
"I need to separate study from everything else."
"You do. But not with keywords." She pulled up the OpenClaw docs. "Routing is channel-based, not content-based. You do not teach the system which words mean 'study.' You create a dedicated space for studying. A WhatsApp group. Everything in that group goes to TutorClaw. Everything outside it goes to your main agent."
You are doing exactly what James is doing. Your TutorClaw handles every message because it is bound to the entire WhatsApp channel. The fix is not content analysis; it is physical separation: a dedicated group for studying.
Step 1: Create a WhatsApp Group
Open WhatsApp on your phone. Create a new group:
- Tap the new chat icon, then "New group"
- Add your own phone number (the one OpenClaw uses) as the only member
- Name the group "TutorClaw Study" (or any name you prefer)
You now have a group with just yourself in it. Messages you send in this group will be routed separately from your regular DMs.
Note the group name. You will need it in the next step to find the group's peer ID.
Step 2: Find the Group's Peer ID
OpenClaw identifies groups by their peer ID, not by name. Run:
openclaw channels list-peers --channel whatsapp
Find your "TutorClaw Study" group in the output. The peer ID looks like a long number ending in @g.us (for example, 120363012345@g.us). Copy it.
Step 3: Bind the Group to TutorClaw
One command creates the binding:
openclaw agents bind tutorclaw --channel whatsapp --peer-id "YOUR_GROUP_ID@g.us"
Replace YOUR_GROUP_ID@g.us with the actual peer ID from Step 2.
This binding says: messages from this specific WhatsApp group go to the tutorclaw agent. Everything else on WhatsApp (DMs, other groups) goes to the main agent.
Verify the binding:
openclaw agents list --bindings
You should see tutorclaw bound to a peer match on your group ID.
Step 4: Test Routing
Send two messages from WhatsApp:
In the TutorClaw Study group:
Teach me about loops in Chapter 2
In a regular DM (not the group):
What is the weather today?
Open the dashboard. Check which agent handled each message:
| Message Source | Expected Agent | Why |
|---|---|---|
| TutorClaw Study group | TutorClaw | Peer binding matches this group |
| Regular DM | Main agent | No peer binding, falls through to default |
Both messages are on the same WhatsApp number. The routing decision is based on WHERE the message came from (which group or DM), not WHAT it says.
Why Not Keywords?
You might wonder: why not route by keywords like "study" or "chapter"? Three reasons:
- False positives are unavoidable. "I want to learn cooking" contains "learn." Keyword routing would send it to TutorClaw.
- False negatives are hard to fix. "Help me with this thing" is a study request with no study keywords. You would need to add every possible phrasing.
- Groups are deterministic. A message in the study group is always a study message. The learner made the routing decision when they chose which group to type in.
Channel and group routing is simpler, more reliable, and requires zero AI to implement. The learner controls the routing by choosing where to send the message.
The Binding Priority Hierarchy
When multiple bindings exist, OpenClaw uses a "most-specific-wins" rule:
| Priority | Match Type | Example |
|---|---|---|
| 1 (highest) | Peer match (exact group or DM) | TutorClaw Study group |
| 2 | Account match | All messages on a specific WhatsApp account |
| 3 | Channel match | All WhatsApp messages across all accounts |
| 4 (lowest) | Default agent | Everything not matched by any binding |
A peer binding (your group) always wins over a channel-wide binding. This means you can have a general WhatsApp agent AND specific group overrides without conflict.
Try With AI
Exercise 1: Design a Multi-Agent Binding Config
I have three agents: tutorclaw (programming tutor), work
(handles work tasks), and home (default for everything else).
I have one WhatsApp account with two groups: "Study" and
"Team Projects." Design a binding configuration that routes
Study group messages to tutorclaw, Team Projects to work,
and everything else to home. Explain which binding type
each rule uses and why the priority hierarchy prevents conflicts.
What you are learning: Binding configuration scales by adding rules, not by teaching the system new words. Each rule targets a specific channel, account, or peer. The priority hierarchy resolves conflicts deterministically.
Exercise 2: Compare Group Routing to Keyword Routing
Compare two routing strategies for a tutoring agent:
Strategy A: Bind the agent to a dedicated WhatsApp group.
Strategy B: Route messages containing "study," "learn," or
"chapter" to the agent.
For each strategy, give me three messages that route correctly
and three that route incorrectly. Which strategy has more
predictable behavior and why?
What you are learning: Deterministic routing (group-based) trades flexibility for reliability. The learner decides where to send the message; the system does not guess. This is a deliberate design choice in OpenClaw.
Exercise 3: Predict Binding Resolution
Given these bindings:
1. tutorclaw bound to WhatsApp group "Study" (peer match)
2. work bound to WhatsApp account "biz" (account match)
3. home bound to WhatsApp channel (channel match)
Predict which agent handles each message:
- A message in the "Study" group on the "biz" account
- A DM on the "biz" account
- A message in a random group on the "personal" account
- A DM on the "personal" account
Explain each answer using the priority hierarchy.
What you are learning: The most-specific-wins rule resolves every routing question without ambiguity. A peer match always wins, regardless of which account or channel it is on. Understanding this hierarchy lets you design complex multi-agent setups with confidence.
James sent a study message in the new group. TutorClaw responded with a PRIMM lesson. He sent "What is the weather?" as a regular DM. The main agent responded.
"Two agents, two spaces," he said. "The learner chooses where to type. The system does not guess."
Emma nodded. "That is the design. Deterministic routing. No keyword matching, no intent classification, no AI parsing messages before they reach the agent. The learner picks the group. The binding picks the agent."
"Simpler than I expected. I was ready to build a classifier."
"You do not need one. Groups are a physical boundary. The learner understands 'type here for tutoring, type there for everything else' without reading documentation." She paused. "I built a product once with keyword routing. Spent two weeks tuning trigger lists. Users kept finding edge cases. Then someone suggested: just make a Slack channel for each agent. All the routing problems disappeared overnight because the routing decision moved from the system to the user."
James looked at his dashboard. Two agent names, two message sources, clean separation. "Lesson 19 is hardening?"
"Input validation, error messages, structured logging. Your routing works. Now make sure the tools handle bad input gracefully."