HZL: Persistent task ledger for agents
HZL (https://hzl-tasks.com) is a local-first task ledger that agents use to:
- - Plan multi-step work into projects + tasks
- Checkpoint progress so work survives session boundaries
- Route work to the right agent via project pools
- Coordinate across multiple agents with leases and dependencies
This skill teaches an agent how to use the hzl CLI.
When to use HZL
OpenClaw has no native task tracking. Unlike Claude Code (which has TodoWrite) or Codex (which has update_plan), OpenClaw relies on memory and markdown files for tracking work. HZL fills this gap.
Use HZL for:
- - Multi-step projects with real sequencing or handoffs
- Work that may outlive this session or involve multiple agents
- Anything where "resume exactly where we left off" matters
- Delegating work to another agent and needing recovery if they fail
Skip HZL for:
- - Truly trivial one-step tasks you will complete immediately
- Time-based reminders (use OpenClaw Cron instead)
- Longform notes or knowledge capture (use memory files)
Rule of thumb: If you feel tempted to make a multi-step plan, or there is any chance you will not finish in this session, use HZL.
⚠️ DESTRUCTIVE COMMANDS — READ FIRST
| Command | Effect |
|---|
| INLINECODE1 | DELETES ALL DATA. Prompts for confirmation. |
| INLINECODE2 |
DELETES ALL DATA WITHOUT CONFIRMATION. |
|
hzl task prune ... --yes |
PERMANENTLY DELETES old done/archived tasks and history. |
Never run these unless the user explicitly asks you to delete data. There is no undo.
Core concepts
- - Project: container for tasks. In single-agent setups, use one shared project. In multi-agent setups, use one project per agent role (pool routing).
- Task: top-level work item. Use parent tasks for multi-step initiatives.
- Subtask: breakdown of a task (
--parent <id>). Max 1 level of nesting. Parent tasks are never returned by hzl task claim --next. - Checkpoint: short progress snapshot for session recovery.
- Lease: time-limited claim that enables stuck detection in multi-agent flows.
Project setup
Single-agent setup
Use one shared project. Requests and initiatives become parent tasks, not new projects.
CODEBLOCK0
Everything goes into openclaw. hzl task claim --next -P openclaw always works.
Multi-agent setup (pool routing)
Use one project per agent role. Tasks assigned to a project (not a specific agent) can be claimed by any agent monitoring that pool. This is the correct pattern when a role may scale to multiple agents.
CODEBLOCK1
Pool routing rule: assign tasks to a project without --agent. Any eligible agent claims with --next.
CODEBLOCK2
Agent routing: when --agent is set at task creation, only that agent (or agents with no assignment) can claim it via --next. Tasks with no agent are available to everyone.
CODEBLOCK3
Use --agent on task creation when you specifically want one person. Omit it when any eligible agent in the pool should pick it up.
Session start (primary workflow)
With workflow commands (HZL v2+)
CODEBLOCK4
INLINECODE13 is required — agents must scope to their assigned pool. Use --any-project to intentionally scan all projects (e.g. coordination agents).
This handles expired-lease recovery and new-task claiming in one command. If a task is returned, work on it. If nothing is returned, the queue is empty. Agent routing applies: tasks assigned to other agents are skipped.
Without workflow commands (fallback)
CODEBLOCK5
Core workflows
Adding work
CODEBLOCK6
Working a task
CODEBLOCK7
Status transitions
CODEBLOCK8
Statuses: backlog → ready → in_progress → done (or blocked)
Finishing subtasks
CODEBLOCK9
Delegating and handing off work
Workflow commands (HZL v2+)
CODEBLOCK10
INLINECODE20 and --project guardrail: at least one is required on handoff. Omitting --agent creates a pool-routed task; --project is then required to define which pool.
Manual delegation (fallback)
CODEBLOCK11
Dependencies
CODEBLOCK12
Cross-project dependencies are supported by default. Use hzl dep list --cross-project-only to inspect cross-project edges.
Checkpointing
Checkpoint at notable milestones or before pausing. A good checkpoint answers: "if this session died right now, could another agent resume from here?"
When to checkpoint:
- - Before any tool call that might fail
- Before spawning a sub-agent
- After completing a meaningful unit of work
- Before handing off or pausing
CODEBLOCK13
Lifecycle hooks
HZL sends targeted notifications for high-value transitions — currently only on_done. Other lifecycle events (stuck detection, blocking, progress) require polling. This is deliberate: hooks signal when something meaningful happens, agents and orchestrators poll for everything else.
Hooks are configured during installation (see docs-site for setup). As an agent, here's what you need to know operationally:
- - Only
on_done fires. When you task complete, HZL queues a webhook. For stuck detection, stale detection, blocking changes, or progress — poll with hzl task stuck --stale or hzl task list. - Delivery is not instant.
hzl hook drain runs on a cron schedule (typically every 2–5 minutes). Your completion is recorded immediately, but the notification reaches the gateway on the next drain cycle. - Payloads include context. Each notification carries
agent, project, and full event details. The gateway handles per-agent routing — HZL sends the same payload to one URL regardless of which agent completed the task. - If hooks seem broken, check
hzl hook drain --json for delivery failures and last_error details.
Multi-agent coordination with leases
CODEBLOCK14
Use distinct --agent IDs per agent (e.g. henry, clara, kenji) so authorship is traceable.
Sizing tasks and projects
The completability test: "I finished [task]" should describe a real outcome.
- - ✓ "Finished installing garage motion sensors"
- ✗ "Finished home automation" (open-ended domain, never done)
Split into multiple tasks when: parts deliver independent value or solve distinct problems.
Adding context:
CODEBLOCK15
Don't duplicate specs into descriptions — reference docs instead to avoid drift.
Extended reference
CODEBLOCK16
Web dashboard (always-on, Linux)
CODEBLOCK17
Available at http://<your-box>:3456 (accessible over Tailscale). macOS: use hzl serve --background instead.
What HZL does not do
- - No orchestration — does not spawn agents or assign work automatically
- No task decomposition — does not break down tasks automatically
- No smart scheduling — uses simple priority + FIFO ordering
These belong in your orchestration layer, not the task ledger.
Notes
- - Run
hzl via the exec tool. - Check
TOOLS.md for your identity string, which projects to monitor, and the commands relevant to your role. - Use distinct
--agent IDs per agent and rely on leases to avoid collisions in shared databases. - INLINECODE45 commands require HZL v2+. If unavailable, use the manual fallback patterns documented above.
HZL: 智能体的持久化任务账本
HZL (https://hzl-tasks.com) 是一个本地优先的任务账本,智能体可用它来:
- - 将多步骤工作规划为项目 + 任务
- 记录检查点进度,使工作跨越会话边界得以延续
- 通过项目池将工作路由到正确的智能体
- 通过租约和依赖关系协调多个智能体
本技能教导智能体如何使用 hzl 命令行工具。
何时使用 HZL
OpenClaw 没有原生任务追踪功能。 与 Claude Code(有 TodoWrite)或 Codex(有 update_plan)不同,OpenClaw 依赖内存和 Markdown 文件来追踪工作。HZL 填补了这一空白。
在以下情况使用 HZL:
- - 需要真实排序或交接的多步骤项目
- 可能超出当前会话或涉及多个智能体的工作
- 任何从上次中断处精确恢复至关重要的情况
- 将工作委托给另一个智能体,并需要在其失败时进行恢复
在以下情况跳过 HZL:
- - 真正简单且会立即完成的一步式任务
- 基于时间的提醒(请使用 OpenClaw Cron)
- 长篇笔记或知识记录(请使用内存文件)
经验法则: 如果你有制定多步骤计划的冲动,或者有任何可能无法在当前会话中完成的情况,请使用 HZL。
⚠️ 破坏性命令 — 请先阅读
| 命令 | 效果 |
|---|
| hzl init --force | 删除所有数据。 需要确认。 |
| hzl init --force --yes |
无需确认即删除所有数据。 |
| hzl task prune ... --yes |
永久删除 已完成/已归档的任务和历史记录。 |
除非用户明确要求你删除数据,否则切勿运行这些命令。操作不可撤销。
核心概念
- - 项目:任务的容器。在单智能体设置中,使用一个共享项目。在多智能体设置中,每个智能体角色使用一个项目(池路由)。
- 任务:顶级工作项。对于多步骤计划,使用父任务。
- 子任务:任务的细分(--parent )。最多一层嵌套。父任务永远不会被 hzl task claim --next 返回。
- 检查点:用于会话恢复的简短进度快照。
- 租约:有时间限制的认领,可在多智能体流程中检测卡住状态。
项目设置
单智能体设置
使用一个共享项目。请求和计划成为父任务,而不是新项目。
bash
hzl project list # 先检查 — 仅在缺失时创建
hzl project create openclaw
所有内容都放入 openclaw。hzl task claim --next -P openclaw 始终有效。
多智能体设置(池路由)
每个智能体角色使用一个项目。分配给项目(而非特定智能体)的任务可由监控该池的任何智能体认领。当一个角色可能扩展到多个智能体时,这是正确的模式。
bash
hzl project create research
hzl project create writing
hzl project create coding
hzl project create marketing
hzl project create coordination # 用于跨智能体工作
池路由规则: 将任务分配给项目时不使用 --agent。任何符合条件的智能体使用 --next 认领。
bash
将工作分配给研究池(无 --agent)
hzl task add 研究竞争对手定价 -P research -s ready
Kenji(或任何研究员)认领它
hzl task claim --next -P research --agent kenji
智能体路由: 当在任务创建时设置了 --agent,只有该智能体(或未分配任务的智能体)可以通过 --next 认领它。没有指定智能体的任务对所有智能体可用。
bash
将任务预先路由到特定智能体
hzl task add 审查 Clara 的 PR -P coding -s ready --agent kenji
Kenji 认领它(匹配智能体)
hzl task claim --next -P coding --agent kenji # ✓ 返回它
Ada 尝试 — 跳过,因为它分配给 kenji
hzl task claim --next -P coding --agent ada # ✗ 跳过它
当你特别希望某个人处理时,在任务创建时使用 --agent。当池中任何符合条件的智能体都应接手时,省略它。
会话开始(主要工作流程)
使用工作流命令(HZL v2+)
bash
hzl workflow run start --agent --project --json
--project 是必需的 — 智能体必须限定在其分配的池范围内。使用 --any-project 有意扫描所有项目(例如协调智能体)。
这在一个命令中处理过期租约恢复和新任务认领。如果返回了任务,则处理它。如果没有返回任何内容,则队列为空。智能体路由适用:分配给其他智能体的任务将被跳过。
不使用工作流命令(回退方案)
bash
hzl agent status # 谁活跃?什么在运行?
hzl task list -P --available # 什么准备好了?
hzl task stuck # 有任何过期租约吗?
hzl task stuck --stale # 同时检查陈旧任务(无检查点)
如果存在卡住的任务,在认领前读取其状态
hzl task show
--view standard --json
hzl task steal --if-expired --agent --lease 30
hzl task show --view standard --json | jq .checkpoints[-1]
否则认领下一个可用任务
hzl task claim --next -P --agent
核心工作流程
添加工作
bash
hzl task add 功能 X -P openclaw -s ready # 单智能体
hzl task add 研究主题 Y -P research -s ready # 池路由(多智能体)
hzl task add 子任务 A --parent # 子任务
hzl task add 子任务 B --parent --depends-on # 带依赖关系
处理任务
bash
hzl task claim # 认领特定任务
hzl task claim --next -P # 认领下一个可用任务
hzl task checkpoint 里程碑 X # 记录检查点进度
hzl task complete # 完成
状态转换
bash
hzl task set-status ready # 使其可认领
hzl task set-status backlog # 移回规划阶段
hzl task block --comment 原因 # 带原因阻塞
hzl task unblock # 解除阻塞
状态:backlog → ready → in_progress → done(或 blocked)
完成子任务
bash
hzl task complete
hzl task show --view summary --json # 还有子任务剩余吗?
hzl task complete # 如果全部完成则完成父任务
委托和交接工作
工作流命令(HZL v2+)
bash
交接给另一个智能体或池 — 原子性地完成当前任务并创建后续任务
hzl workflow run handoff \
--from \
--title <新任务标题> \
--project <池> # --agent 如果指定人;--project 用于池
委托子任务 — 默认创建依赖边
hzl workflow run delegate \
--from \
--title <委托的任务> \
--project <池> \
--pause-parent # 阻塞父任务直到委托任务完成
--agent 和 --project 防护:交接时至少需要一个。省略 --agent 会创建池路由任务;此时需要 --project 来定义哪个池。
手动委托(回退方案)
bash
hzl task add <委托标题> -P <池> -s ready --depends-on <父任务-id>
hzl task checkpoint <父任务-id> 将 X 委托给 <池> 池。等待 <任务-id>。
hzl task block <父任务-id> --comment 等待 <委托任务-id>
依赖关系
bash
创建时添加依赖
hzl task add <标题> -P <项目> --depends-on <其他-id>
创建后添加依赖
hzl task add-dep <任务-id> <依赖-id>
查询依赖
h