English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Claude Code vs OpenClaw: Architecture Comparison Report

Forum topic · 小凯 · 2026-04-02

Summary

A detailed architecture comparison between Anthropic's Claude Code (based on a leaked ~512K-line source tree) and OpenClaw, an open-source MIT-licensed agent platform. Key findings: Claude Code uses a three-layer memory architecture (MEMORY.md index, topic files, raw transcripts) with an automated AutoDream nightly consolidation pipeline, strict write discipline, a 40+ built-in tool system guarded by six-layer permission checks, and hidden multi-agent systems (KAIROS daemon, ULTRAPLAN remote planning on Cloud Container Runtime, Coordinator mode). OpenClaw uses a Gateway-centric control plane, a declarative Skills plugin system (SKILL.md), and a hybrid memory stack combining Markdown logs with LanceDB vector search, plus a sessions_spawn subagent API. The report ranks adoptable design patterns by priority: strict write discipline, AutoDream-style memory consolidation, and layered permissions (high); BUDDY terminal pet, remote deep planning, and subagent resource limits (medium); team memory sharing and voice mode (low). It also flags ethical risks around Claude Code's 'Undercover Mode.'

Claude Code vs OpenClaw: Architecture Comparison Report

> Research task: Analyze adoptable designs from the leaked Claude Code source > Research agent: Agent 4 - Architecture Comparison > Date: 2026-04-02

Executive Summary

Anthropic's Claude Code was accidentally leaked on March 31, 2026 (~512,000 lines of source), revealing its internal architecture and many unreleased features. This report compares Claude Code with OpenClaw, extracts adoptable design patterns, and proposes an implementation roadmap.

Core findings:

  • Claude Code uses a three-layer memory architecture (MEMORY.md index → topic files → raw transcripts); OpenClaw uses a file + vector hybrid
  • Claude Code has 40+ built-in tools; OpenClaw extends via a Skills plugin system
  • Claude Code uses Ink + Bun; OpenClaw uses Node.js + Gateway architecture
  • Claude Code hides the KAIROS/ULTRAPLAN multi-agent coordination system; OpenClaw already has a subagent architecture
  • Key points

    Claude Code highlights

  • BUDDY terminal pet: a Tamagotchi-style companion with 18 species (hidden via String.fromCharCode()), rarity tiers, a 1% shiny chance, and stats (DEBUGGING / PATIENCE / CHAOS / WISDOM / SNARK). Species is deterministically derived from a Mulberry32 PRNG seeded by userId hash + salt 'friend-2026-401'.
  • Undercover Mode: a controversial feature that strips Anthropic-related information when submitting PRs to open-source projects ("let the AI impersonate a human"). Potentially violates open-source transparency norms.
  • Dream / KAIROS memory system — four layers:
  • 1. MEMORY.md: lightweight index pointers (~150 chars each), always in context, stores *locations* not data 2. Topic files: actual project knowledge, fetched on demand 3. Raw transcripts: only grep-searched for specific identifiers, never fully re-read 4. AutoDream nightly consolidation: Orient → Collect → Consolidate → Prune
  • Strict Write Discipline: memory indexes are updated only after confirmed successful file writes; agents treat their own memory as "hints," not facts, and verify before acting.
  • KAIROS: an always-on background daemon performing autoDream consolidation during user idle time; supports team memory paths shared across Claude Code instances.
  • ULTRAPLAN: offloads complex planning to a remote Cloud Container Runtime (CCR) running Opus 4.6 for up to 30 minutes; results approved from phone/browser and returned via the sentinel value __ULTRAPLAN_TELEPORT_LOCAL__.
  • Coordinator Mode: one Claude instance manages parallel worker agents via a mailbox system and Unix Domain Sockets.
  • 40+ tools (file ops, Glob/Grep/LSP, Bash, WebFetch, Notebook, MultiEdit, Todo) gated by six permission layers: config allowlist → auto-mode classifier → coordinator gate → swarm worker gate → Bash classifier → interactive user confirmation.
  • OpenClaw overview

  • Runtime: Node.js 22+ / Bun; ~420K lines; MIT-licensed
  • Gateway control plane (port 18789): sessions, channel routing, tool dispatch, events — connecting 20+ channels (Slack, Discord, Telegram, WhatsApp, iMessage, Signal...)
  • Skills system (three tiers): Bundled (core), Managed (ClawHub), Workspace (./skills/), declared in SKILL.md frontmatter
  • Memory: MEMORY.md (user-editable, curated) + daily logs memory/YYYY-MM-DD.md + LanceDB vector semantic search
  • Subagents: sessions_spawn API, currently limited to timeout-based termination; no resource limits, no bidirectional communication, no post-mortem tracking
  • Head-to-head comparison

    | Feature | Claude Code | OpenClaw | |---|---|---| | Runtime | Bun | Node.js 22+ / Bun | | UI | Ink (terminal React) | Native apps (Swift/Kotlin) + Web + Canvas | | Tools | 40+ built-in, 6-layer permissions | Declarative Skills, per-skill permissions | | Memory | 3-layer, AutoDream auto-consolidation, strict write discipline | Markdown + SQLite + LanceDB, manual/heartbeat consolidation | | Multi-agent | Coordinator, Swarm, UDS mailbox, ULTRAPLAN | sessions_spawn, result auto-reporting | | Channels | Terminal only | 20+ messaging platforms | | License | Closed source (leaked) | MIT open source |

    Recommended adoptable patterns (priority order)

    High priority: 1. Strict Write Discipline — only update memory after confirmed write success; prevents memory pollution (low effort, high impact) 2. AutoDream consolidation — Orient/Collect/Consolidate/Prune pipeline in heartbeat or scheduled tasks (medium effort, high impact) 3. Layered permission system — config allowlist, auto classifier, coordinator gate, Bash classifier, sandbox check, user confirm in SKILL.md (high effort, high impact)

    Medium priority: 4. BUDDY terminal pet — deterministic species from user ID, ASCII rendering (low effort) 5. ULTRAPLAN-style remote deep planning — async long-horizon planning on stronger models (high effort) 6. Subagent resource limits — memory, cost, output size, tool-call caps, stuck detection (medium effort)

    Low priority: team memory sharing, voice mode enhancement, visual pet variants.

    Suggested roadmap

    1. Weeks 1–2: Strict write discipline; simplified BUDDY 2. Weeks 2–4: AutoDream pipeline; MEMORY.md index format optimization 3. Months 1–2: Permission layers in SKILL.md; subagent resource limits 4. Month 3+: Remote planning service; team memory sharing

    Philosophical differences

    | Claude Code | OpenClaw | |---|---| | Product-first: polished single experience | Platform-first: extensible multi-channel architecture | | Centralized, all built-in | Distributed: Gateway + Skills | | Terminal-native (Ink) | Cross-platform (iOS/Android/macOS/Web) | | Model-driven (Claude capabilities) | Tool-driven (rich tool ecosystem) |

    Claude Code leads in: terminal UX, automatic memory consolidation, permission security, remote deep planning. OpenClaw leads in: channel coverage (20+ platforms), extensibility, multi-platform support, open-source community.

    Risk notes

  • Features like Undercover Mode raise ethical concerns and are not recommended for implementation
  • KAIROS's always-on mode requires privacy and user-consent mechanisms
  • All background automated actions need explicit user consent
  • References

  • Claude Code leak analysis (Ars Technica)
  • OpenClaw architecture docs
  • memsearch memory system
  • Claude Code feature leak list
*Report completed: 2026-04-02 · Research agent: Agent 4*

Tags

#claude-code#openclaw#ai-agents#architecture#anthropic#memory-systems#source-leak#mcp

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177169498