Home Learn AI OpenClaw

Developers · Track B

Grok OpenClaw

Ten progressive sections — the agent loop through gateway routing, heartbeat, delivery, and concurrency. Read each session on Zeus (full markdown below). When a session includes exercises, run the sample code locally alongside the text.

Sign in to save progress on your account.

Scroll for all sessions →

s01 — The Agent Loop

while True + stop_reason

“An agent is just while True + stop_reason.”

Establish the loop before adding I/O. messages[] is the state; stop_reason decides tool use vs. end turn.

s02 — Tool Use

schema + handler map

“Tools are data + a handler map.”

The model names a tool; you dispatch to a registered handler and feed results back into the loop.

s03 — Sessions & Context Guard

JSONL

“Sessions are JSONL files.”

Append, replay, and summarize when context grows too large — conversations that survive restarts.

s04 — Channels

InboundMessage

“Every platform produces the same InboundMessage.”

Normalize Telegram, Feishu, and friends into one shape before the gateway sees them.

s05 — Gateway & Routing

bindings

“(channel, peer) → agent_id; most specific wins.”

Multi-tenant isolation: route inbound events to the right agent instance.

s06 — Intelligence

prompts on disk

“Swap files, change personality.”

Soul, memory, skills — layered prompts assembled from files instead of one giant string.

s07 — Heartbeat & Cron

timer + queue

“Should I run?” alongside user messages.

Proactive agent work: scheduled checks without waiting for chat input.

s08 — Delivery

write-ahead

“Write to disk first, then try to send.”

Outbound queues with backoff so messages survive crashes and flaky networks.

s09 — Resilience

rotate / retry

“When one call fails, rotate and retry.”

Profile rotation, cooldowns, and fallback chains when APIs misbehave.

s10 — Concurrency

named lanes

“Named lanes serialize the chaos.”

FIFO per lane, generation counters, and bounded parallelism without a single global lock.

More tutorials

Prefer explicit step folders over one growing file? The “build your own OpenClaw-style stack” tutorial (numbered READMEs + code) and other curated links are on AI learning resources.

Capstone

After s01–s10, you have the gateway stack: same loop as Claude Code, plus routing, persistence, delivery, and production concurrency. Combine with the Claude Code track for deep harness skills on the unit agent.