Key points
- Context: Anthropic's Claude Code reportedly leaked ~512K lines of source code on March 31, 2026, revealing internal architecture and unreleased features. This report benchmarks it against the MIT-licensed OpenClaw (~420K lines).
- Memory architecture: Claude Code uses a three-layer design — MEMORY.md as a lightweight always-loaded index (~150 chars per entry), on-demand topic files, and raw transcripts accessed only via grep. A fourth layer, AutoDream, runs nightly consolidation: Orient → Collect → Consolidate → Prune. OpenClaw uses MEMORY.md (manually maintained) + daily logs + LanceDB vector search, with consolidation only via heartbeat or manual triggers.
- Strict Write Discipline: Claude Code agents may only update memory indexes after confirming a successful file write, treating their own memories as "hints" to verify rather than facts — a key pattern OpenClaw should adopt.
- Tooling: Claude Code has 40+ built-in tools (file ops, Grep/Glob/LSP, Bash, WebFetch, Jupyter, MultiEdit, Todo) gated by a six-layer permission chain: config allowlist → auto-mode classifier → coordinator gate → swarm worker gate → Bash classifier → interactive user prompt. OpenClaw instead uses a declarative Skills system (bundled / managed via ClawHub / workspace
./skills/with SKILL.md manifests). - Multi-agent: The leak reveals KAIROS, an always-on background daemon for memory consolidation and team-shared memory paths; ULTRAPLAN, which offloads planning to a remote Cloud Container Runtime using Opus 4.6 for up to 30 minutes (results returned via the
__ULTRAPLAN_TELEPORT_LOCAL__sentinel); and a Coordinator Mode managing parallel workers via a UDS-based mailbox system. OpenClaw already has sub-agents viasessions_spawnbut lacks resource limits, bidirectional communication, and remote planning. - Fun/controversial finds: a Tamagotchi-style BUDDY terminal pet (18 species, rarity tiers, 1% shiny chance, deterministic per user via Mulberry32 PRNG seeded from a userId hash), a hidden voice mode, and an Undercover Mode that strips Anthropic branding from open-source PRs — flagged in the report as ethically problematic and not recommended for implementation.
- Philosophy difference: Claude Code is product-first, centralized, terminal-native (Ink + Bun), and model-driven; OpenClaw is platform-first, distributed (Gateway control plane on port 18789 + Skills), cross-platform (iOS/Android/macOS/Web), and tool-driven with 20+ messaging channels.
- *Strict Write Discipline* — update memory only after confirmed writes; low effort, high impact (prevents memory pollution).
- *AutoDream consolidation* — periodic Orient/Collect/Consolidate/Prune pipeline in heartbeat jobs; medium effort, high impact.
- *Six-layer permission system* — declare permission layers in SKILL.md; high effort, high impact. 2. Medium priority
- Simplified BUDDY terminal pet (deterministic species per user ID + ASCII rendering).
- ULTRAPLAN-style remote deep planning for long-horizon tasks, with async result approval.
- Enhanced sub-agent limits: memory, cost budget, output size, tool-call caps, stuck detection (OpenClaw currently supports timeout only). 3. Low priority / long term: team memory sharing (MEMORY_TEAM.md with permission controls), richer voice mode, visual pet variants.
- Weeks 1–2: strict write discipline, transactional writes, minimal BUDDY.
- Weeks 2–4: AutoDream in heartbeat; lightweight index-style MEMORY.md format.
- Months 1–2: multi-layer permissions in SKILL.md; sub-agent resource limits and loop detection.
- Month 3+: remote planning integration; team memory sync with privacy controls.
- Undercover Mode-style features raise open-source transparency/ethics concerns and are explicitly discouraged.
- Always-on daemons (KAIROS-like) and any background automation require explicit user consent and privacy safeguards.
- Claude Code leak analysis (Ars Technica)
- OpenClaw architecture docs
- memsearch memory plugin (Milvus blog)
- Claude Code leak feature list (dev.to)
Adoptable design patterns (prioritized)
1. High priority