OpenClaw Source Code Analysis Textbook

A comprehensive deep-dive into the OpenClaw open-source AI assistant framework — from core concepts to advanced internals, structured for engineers at every level.


Recommended Reading Paths

Reader TypeRecommended Path
🆕 Complete BeginnerAll of Getting Started → Architecture 01-02 → Application 01
💻 Experienced EngineerAll of Architecture → All of Data Flow → All of Mechanisms
🤖 AI App DeveloperGetting Started → All of Application → Extension 03
🔧 Open Source ContributorGetting Started 02-03 → Architecture 04 → All of Extension

Table of Contents

🟢 Getting Started — Understanding OpenClaw

ChapterTitleDifficulty
00-01What Is OpenClaw?🟢 Beginner
00-02Codebase Tour🟢 Beginner
00-03Running Locally: Startup Flow & Entry Tracing🟡 Intermediate

🏗️ Architecture — System Design Overview

ChapterTitleDifficulty
01-01System Architecture Layers🟡 Intermediate
01-02Gateway Core🟡 Intermediate
01-03Plugin System🟡 Intermediate
01-04Module Boundaries & SDK Contract🔴 Advanced

🔄 Data Flow — Tracing the Message Path

ChapterTitleDifficulty
02-01Message Lifecycle🟡 Intermediate
02-02Routing Engine🟡 Intermediate
02-03Agent Call Loop🔴 Advanced

⚙️ Mechanisms — Deep Dives

ChapterTitleDifficulty
03-01Plugin SDK Design🔴 Advanced
03-02Authentication System🔴 Advanced
03-03Channel Integration Patterns🟡 Intermediate
03-04Memory & MCP🔴 Advanced
03-05Security Model🔴 Advanced

🚀 Application — Skills & Multi-Agent Collaboration

ChapterTitleDifficulty
04-01Skill System🟢 Beginner
04-02Writing High-Quality Skills🟡 Intermediate
04-03Multi-Agent Collaboration (ACP)🔴 Advanced
04-04Agent Scope & Context Management🔴 Advanced
04-05Automation & Scheduled Tasks🟡 Intermediate

🛠️ Extension — Building on OpenClaw

ChapterTitleDifficulty
05-01Tutorial: Write a Channel Plugin🟡 Intermediate
05-02Tutorial: Integrate a New LLM Provider🔴 Advanced
05-03Tutorial: Create a Skill🟢 Beginner

Key Concepts Glossary

TermOne-line Definition
GatewayThe control plane — receives channel messages, routes to agents, manages auth and config
ChannelA messaging platform adapter (Telegram/Discord/Slack etc.) for inbound/outbound message conversion
AgentThe AI reasoning engine — calls LLMs, uses tools, memory, and skills to complete tasks
PluginA code-based extension: Channel Plugin, Provider Plugin, or Capability Plugin
SkillA Markdown instruction file — not code; tells the Agent how to perform specific workflows
ProviderAn LLM service adapter (OpenAI/Anthropic/Ollama etc.) handling model calls and auth

Difficulty Legend


← Back to bilingual index | 中文版 →