Multi-Agent Coordination
Coordinate multiple agents through shared projects and atomic claiming.
Preferred routing pattern: project pools
Create tasks in the target project and omit --agent unless assignment must be explicit.
bash
hzl project create writing
hzl task add "Draft product announcement" -P writing -s readyAny writing agent can claim from the pool:
bash
hzl task claim --next -P writing --agent writer-1
hzl task claim --next -P writing --agent writer-2claim --next is atomic, so both agents get different tasks.
Explicit assignment (agent routing)
Use --agent on task add to pre-route a task to a specific agent. Only that agent can claim it via --next; other agents skip it. Omit --agent when any eligible agent in the pool should pick it up.
bash
# Pre-routed — only writer-1 can claim via --next
hzl task add "Revise legal disclaimer" -P writing -s ready --agent writer-1
# Pool-routed — any writer can claim
hzl task add "Draft product announcement" -P writing -s readyNote: --agent on task add is routing intent. --author on task add is attribution only (who created the task) and has no routing effect.
Workflow-first session loop
bash
# Each wake
hzl workflow run start --agent writer-1 --project writing
# On completion/handoff
hzl workflow run handoff --from <task-id> --title "Schedule post" --project marketingLeases and recovery
bash
hzl task claim --next -P writing --agent writer-1 --lease 60
hzl task stuck
hzl task steal <task-id> --if-expired --agent writer-2Coordination agents
Agents that triage across all projects use --any-project instead of --project:
bash
hzl workflow run start --agent henry --any-project --lease 30Worker agents always use --project <their-pool>.
Operational notes
- Keep agent identity strings stable.
- Prefer pool routing for scalable role teams.
- Use
--agentontask addsparingly — only when a specific agent must own the work. - Schedule
hzl hook drainin host runtime for reliable done notifications.