claw0 promises ten sections, and the quick list stops at nine
0 - 1 learn OpenClaw: sections to build an claw-AI agent from scratch
At a glance
- What is it?
- claw0 is a teaching repository: ten progressive sections, each one a single runnable Python file, that build an agent gateway from an empty while loop up to routing, channels, a heartbeat and a delivery queue, repeated in English, Chinese and Japanese. The interesting parts are the places where the file contradicts itself. The quick start lists nine sections and cuts off mid-word, the architecture diagram stops before the first one, and the licence is claimed in prose with no licence file in the tree.
- Who is it for?
- Work through claw0 if you want to see an agent gateway assembled one idea at a time with the earlier files left intact, and if reading a production gateway afterwards is the actual goal, because that is the stated test of whether the course worked. Do not expect it to be a framework you install: there is no package to depend on, only sessions to read and run, and the companion repository is where an installable agent lives.
- Can I use it commercially?
- Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
- Is it still maintained?
- Yes. The repository last received commits 138 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- shareAI-lab/claw03,441 ★ · +106
| Repository | 2026-09-11 | 2026-11-15 |
|---|---|---|
| shareAI-lab/claw0 | 3.3k | 3.4k |
106 Stars in the last 65 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The quick start block lists nine sections and stops mid-word
The headline claim is ten sections of about 7,000 lines. The block that enumerates them does not deliver that. It starts at s01 Agent Loop and runs to s09 Resilience, and the s09 line ends inside the word it was describing, at a three-layer retry onion plus an auth profil. There is no s10 line at all, even though s10 Concurrency appears in the architecture diagram above, in the section details table below, and in the phase diagram further down. The architecture diagram has the mirror-image problem: it lists the layers from s10 Concurrency at the top down to s02 Tools, and then stops inside that line, before the box is closed and before s01, the foundation everything else builds on, ever appears. So the two lists in the file are each incomplete in a different direction, and the tables below them are the only complete enumeration.
Nothing in the stated dependency graph builds on the gateway
The dependency list is worth reading as a graph rather than a sequence, because it is not the ladder the phases suggest. s01 and s02 are the foundation with no dependencies. s03 builds on s02 by adding persistence to the tool loop, s04 builds on s03 because channels produce inbound messages for sessions, and s05 builds on s04 by routing channel messages to agents. Then the chain forks: s06 builds on s03 rather than on s05, using sessions for context and adding prompt layers, s07 builds on s06, s08 builds on s07 because heartbeat output has to flow through the delivery queue, and s09 builds on s03 plus s06, reusing the context guard for overflow and the model configuration. s10 then builds on s07. The consequence is that s05, the gateway and its five-tier routing, is a leaf: no later section is listed as building on it.
Three copies of the same logic, one directory each
The repository carries the whole course three times. Under sessions there are en, zh and ja folders, and the file states that each language folder is self-contained, holding runnable Python code and documentation side by side, that the code logic is identical across languages, and that only comments and docs differ. The structure listing spells out ten .py files and ten .md files for the English folder and the same for Chinese, then ends in the middle of the Japanese entry without repeating the note. Read as a maintenance fact rather than a teaching one, that is thirty Python files with three implementations of the same logic, and a divergence is one careless edit away in each language. The triplication is also the reason the repository carries three README files, English, Chinese and Japanese, linked at the very top.
The licence is claimed in prose and absent from the tree
There is a real inconsistency here, and it is the kind worth naming rather than smoothing over. The final section of the README is headed License and contains the single word MIT. The repository's own licence field, on the other hand, is empty, recorded as unknown rather than as MIT. And the list of top level entries contains .env.example, .gitignore, three README files, requirements.txt, sessions/ and workspace/, with no licence file among them. So the only statement of terms in the repository is a line of prose at the bottom of one of three README files, with nothing in the tree to corroborate it. Nothing here says the code is unlicensed or that MIT is wrong; the point is that the two sources that usually agree do not, and the README section is the only one that takes a position.
The per-section line counts add up to the headline figure
The section details table is the most useful thing in the file because it gives an approximate size for every session, and those numbers are internally consistent with the claim of about 7,000 lines. The agent loop is the smallest at roughly 175 lines, tool use roughly 445, sessions roughly 890, channels roughly 780, gateway roughly 625, intelligence roughly 750, heartbeat and cron roughly 660, delivery roughly 870, resilience roughly 1,130 and concurrency roughly 900. That is a little over 7,200 lines before the three-language multiplication, so the per-language figure is about 7,000. The distribution also tells you where the difficulty sits: resilience and concurrency are the two heaviest sections, and they come last, after the reader has already built routing and channels.
Six dependencies with lower bounds, and a heartbeat that sleeps by default
The dependency list is short and entirely lower bounded: anthropic at 0.39.0 or newer, python-dotenv, websockets, croniter, python-telegram-bot and httpx, on Python 3.11 or newer. Nothing is pinned, so two clones of the same commit can install different versions. The env template shows what each section actually needs. ANTHROPIC_API_KEY is required and MODEL_ID defaults to a dated Claude Sonnet identifier, with ANTHROPIC_BASE_URL available as a commented hook for API-compatible providers such as OpenRouter. Channel credentials are optional and scoped to one section each: a Telegram bot token for the channels file, and a Feishu app id, secret and domain for the same file, where the domain line chooses between feishu for the domestic service and lark for the international one. The heartbeat template is the most opinionated: an interval of 1800 seconds with an active window running from 9 to 22, so by default the proactive agent stays quiet overnight. The quick start that ties those pieces together is four steps, and the fourth one is the point of the whole repository: any section runs on its own, in whichever language you read.
# 1. Clone and enter
git clone https://github.com/shareAI-lab/claw0.git && cd claw0
# 2. Install dependencies
pip install -r requirements.txt
# 3. Configure
cp .env.example .env
# Edit .env: set ANTHROPIC_API_KEY and MODEL_ID
# 4. Run any section (pick your language)
python sessions/en/s01_agent_loop.py # English
python sessions/zh/s01_agent_loop.py # Chinese
python sessions/ja/s01_agent_loop.py # JapaneseNote what is not in that block: no build step, no package to install, and no check that the file you are about to run belongs to the section you just read.
A companion repository covers the half this one leaves out
The file positions claw0 against its sibling by naming what each one does not do. learn-claude-code, from the same organisation, is described as a companion teaching repository that builds an agent framework from scratch in 12 progressive sessions, where claw0 concentrates on gateway routing, channels and proactive behaviour, and the companion goes into the agent's internal design instead: structured planning with a todo manager and a nag, context compression in three layers, file-based task persistence with dependency graphs, team coordination over JSONL mailboxes with a shutdown and plan-approval state machine, autonomous self-organisation, and git worktree isolation for parallel execution. So the division is gateway shell versus agent interior, and the file tells you plainly to start with the companion if the inside of a production unit agent is what you want. Two things the structure listing never mentions: the workspace directory at the root, and the garbled repository description, which reads 0 - 1 learn OpenClaw with an article in front of claw-AI.
Editorial conclusion
Work through claw0 if you want to see an agent gateway assembled one idea at a time with the earlier files left intact, and if reading a production gateway afterwards is the actual goal, because that is the stated test of whether the course worked. Do not expect it to be a framework you install: there is no package to depend on, only sessions to read and run, and the companion repository is where an installable agent lives. Two things to know before you start. The dependencies are six packages with lower bounds rather than pinned versions, and the default model id in the env template is a dated one, so a run months from now will call whatever that identifier resolves to. And the licence is unsettled in the file itself, which matters if you intend to reuse any of the code: the README states MIT at the bottom, the repository's licence field is empty, and no licence file appears among the top level entries, so ask the authors rather than assuming.
Frequently asked questions
What is claw0 and how do I run it?
A teaching repository of 10 progressive sections, each a single runnable Python file, that build an AI agent gateway from an agent loop up to routing, channels, a heartbeat and a delivery queue. It needs Python 3.11 or newer and an Anthropic API key. The quick start is a clone, pip install -r requirements.txt, cp .env.example .env, then python sessions/en/s01_agent_loop.py.
What license is claw0 under?
The README states MIT in its License section. The repository's licence field is empty, recorded as unknown, and no licence file appears among the top level entries, which list .env.example, .gitignore, three README files, requirements.txt, sessions/ and workspace/.
How many lines of Python does claw0 contain?
The file claims about 7,000 lines per language, and its own section table supports that with approximate counts ranging from about 175 for the agent loop to about 1,130 for resilience, plus about 445, 890, 780, 625, 750, 660, 870 and 900 for the rest.
Which languages does claw0 support?
English, Chinese and Japanese, each with its own README and its own folder under sessions. Code logic is identical across the three and only comments and documentation differ, so each language folder holds ten Python files and ten markdown files.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/shareai-lab-claw0)Star history chart for your README
[](https://hysenlabs.com/projects/shareai-lab-claw0)Was this useful?