OpenClaw Under the Hood: How the Fastest-Growing AI Repository Actually Works
Back to Blog
AIOpenClawAI ArchitectureOpen SourceClaude CodeGitHub

OpenClaw Under the Hood: How the Fastest-Growing AI Repository Actually Works

Global Builders ClubFebruary 2, 20268 min read

A technical deep dive into the architecture that earned 135k GitHub stars in two months. The agent at its core has only 4 tools. Here's how it actually works.

Share:

A technical deep dive into the architecture that earned 135k GitHub stars in two months.

The OpenClaw repository hit 100,000 GitHub stars faster than any project in history. But beyond the hype, what's actually in the codebase? How does it work under the hood? And why is it fundamentally different from Claude Code?

I spent a week in the documentation, issues, and architecture diagrams. Here's what I found.

OpenClaw Architecture Overview

The Core Philosophy: Minimal Core, Infinite Edge

OpenClaw's design philosophy is radical: the smallest possible core with maximum extensibility.

At the heart is Pi, the minimal agent. Pi has exactly four tools:

  1. Read - File reading
  2. Write - File writing
  3. Edit - File modification
  4. Bash - Command execution

That's it. As Armin Ronacher noted, Pi has "the shortest system prompt of any agent that I'm aware of."

But wait—how does a 4-tool agent manage calendars, clear inboxes, and automate deployments?

Skills. 700+ of them.

The Architecture Stack

User → Channels (WhatsApp, Telegram, Discord, etc.)
              ↓
       Gateway (WebSocket @ 18789)
              ↓
         Pi Agent (4 core tools)
              ↓
         Skills (700+ via ClawHub)
              ↓
         Workspace (file-based memory)
              ↓
         Model Providers (15+ supported)

The Gateway: Control Plane, Not Product

The Gateway is a WebSocket server at ws://127.0.0.1:18789. It handles:

  • Session management
  • Channel routing (12+ messaging platforms)
  • Cron job scheduling
  • Tool execution coordination

The documentation makes an important distinction: "The Gateway is just the control plane—the product is the assistant."

This separation matters. The Gateway is infrastructure. The intelligence comes from the model provider and skills.

The Skills System: ClawHub is npm for AI

Skills are directories with a SKILL.md file containing YAML frontmatter and markdown instructions.

---
name: email-triage
description: Automatically categorize and draft email responses
requires.env: ["EMAIL_API_KEY"]
---

# Email Triage Instructions

When the user asks you to process emails...

Three-tier loading precedence:

  1. Workspace skills (highest priority)
  2. Managed skills (~/.openclaw/skills/)
  3. Bundled skills (lowest priority)

ClawHub is the public registry:

clawhub install <skill-slug>
clawhub update --all

Skills Architecture

Model Provider Architecture: True Model Agnosticism

OpenClaw ships with 15+ built-in model providers:

Provider Key
Anthropic ANTHROPIC_API_KEY
OpenAI OPENAI_API_KEY
Google Gemini GEMINI_API_KEY
OpenRouter Built-in (100+ models)
Ollama Auto-detected locally
xAI, Groq, Cerebras, Mistral Integrated

Custom providers work via configuration:

{
  "models": {
    "providers": {
      "my-llm": {
        "baseURL": "https://my-api.com/v1",
        "apiKey": "${MY_API_KEY}"
      }
    }
  }
}

Why this matters: You're not locked in. Run Claude today, GPT-4 tomorrow, local Llama next week. Same infrastructure, different brains.

How It Relates to Claude Code

This is the question everyone asks. Here's the honest comparison:

Security Model

OpenClaw Claude Code
Default Full shell access Sandboxed
Execution Acts autonomously Asks for confirmation
Philosophy User responsibility Guardrails first

Flexibility

OpenClaw Claude Code
Models 15+ providers Claude only
Local models Yes (Ollama) No
Custom skills 700+ community Anthropic-controlled

The Real Difference

Claude Code is a product. Anthropic controls the experience.

OpenClaw is infrastructure. You control everything.

Earlier discourse framed OpenClaw as "Claude with hands." That undersells it. OpenClaw is model-agnostic infrastructure that happens to work great with Claude.

OpenClaw vs Claude Code

The Heartbeat: Proactive AI

Most AI assistants are reactive: you ask, they answer.

OpenClaw can be proactive. The heartbeat feature (via HEARTBEAT.md) lets the agent wake itself up:

  • Every 30 minutes, check conditions
  • If threshold met, message the user
  • No prompt required

"Instead of you asking 'Is the server down?', OpenClaw wakes itself up, checks the data, and messages you if a threshold is met."

This transforms the paradigm from chatbot to autonomous assistant.

The Security Reality

Here's the uncomfortable truth: 26% of community OpenClaw skills contain vulnerabilities (Cisco research on 31,000 skills).

OpenClaw's response isn't to lock things down—it's to document the risks and provide tools:

openclaw security audit --deep --fix

The philosophy: power users can manage their own security. Sandboxing is available but not default.

This is the Linux approach to AI agents. Maximum power, maximum responsibility.

The Creator's Philosophy

Peter Steinberger (PSPDFKit founder) coined the phrase: "I ship code I don't read."

His workflow:

  • 5-10 concurrent agents on different features
  • 6,600+ commits in January alone
  • Prefers Codex for long-running tasks
  • Local CI instead of remote pipelines

This philosophy permeates OpenClaw: trust the agent, extend through code, ship fast.

Getting Started: What You Need to Know

To Run OpenClaw

npm install -g openclaw@latest
openclaw onboard --install-daemon

Then open http://127.0.0.1:18789/ for the dashboard.

To Understand the Code

Key directories in the repository:

  • src/ - Core TypeScript source
  • packages/ - Modular subsystems
  • skills/ - Bundled capabilities
  • apps/ - Platform-specific apps (macOS, iOS, Android)

To Contribute

git clone https://github.com/openclaw/openclaw
cd openclaw
pnpm install
pnpm build

The Bottom Line

OpenClaw's architecture is elegant in its simplicity:

  • Gateway: WebSocket control plane
  • Pi: Minimal 4-tool agent
  • Skills: Infinite extensibility
  • Providers: Model agnosticism

The 135k stars came from a real insight: some users want AI that runs on their hardware, connects to their apps, and acts autonomously—even if it's harder and riskier than managed alternatives.

Understanding OpenClaw isn't just about one project. It's about understanding what open-source AI infrastructure might look like as the field matures.


Resources: OpenClaw GitHub | Documentation | ClawHub Skills Registry

Written by

Global Builders Club

Global Builders Club

Support Our Community

If you found this content valuable, consider donating with crypto.

Suggested Donation: $5-15

Donation Wallet:

0xEc8d88...6EBdF8

Accepts:

USDCETHor similar tokens

Supported Chains:

EthereumBasePolygonBNB Smart Chain

Your support helps Global Builders Club continue creating valuable content and events for the community.

Enjoyed this article?

Join our community of builders and stay updated with the latest insights.