Skip to content

rrmars/claude-code-vs-openclaw

Repository files navigation

Claude Code vs OpenClaw

Claude Code vs OpenClaw: Cracking Open Anthropic's Flagship CLI

中文版

8 : 1 : 1

11 core mechanisms compared head-to-head. OpenClaw wins 8, Claude Code wins 1, 1 draw, 1 not applicable.

This isn't opinion. It's what the source code says.


What Is This

In March 2026, the complete TypeScript source of Claude Code v2.1.88 leaked via npm sourcemap (cli.js.map). ~512K lines, containing every implementation detail Anthropic doesn't publicly disclose — 49 tengu_* feature flags, GrowthBook remote control, prompt cache coordination, an unreleased AutoDream memory consolidation system, all of it.

We took this source and compared it against OpenClaw's source, mechanism by mechanism. No vibes-based scoring, no "both have their strengths" cop-outs — every mechanism gets a winner.

Key Findings

Claude Code isn't weak, but Anthropic's home-court advantage — controlling both the model and the client — didn't translate into runtime superiority.

A company that owns both the model and the client should, in theory, produce the most deeply optimized agent runtime. But Claude Code cashed in that advantage primarily at the API coordination layer — prompt cache sticky latch + 12-factor detection, cache_read_input_tokens rate optimization, 49 GrowthBook remote feature flags. All genuinely sophisticated, but the runtime's core capabilities (compaction quality, pruning controllability, agent orchestration, security depth) were surpassed by an open-source project with no provider home-court advantage.

OpenClaw proves that having no home-court advantage isn't a disadvantage. Compaction with quality gates + identifier preservation, reversible and configurable pruning, multi-layer tool policy pipelines, systematic hot-reload, five-tier session cleanup — none of these depend on any specific provider. In fact, being forced to support multiple providers made the designs more universal and more robust.

Scoreboard

Mechanism CC OC Winner
Context Compaction ★★★★ ★★★★★ OC
Context Pruning ★★★☆ ★★★★ OC
Memory System ★★★☆ ★★★★ OC
Agent Isolation ★★★☆ ★★★★★ OC
System Prompt ★★★ ★★★★☆ OC
Tool Safety ★★★ ★★★★ OC
Cache Optimization ★★★★★ N/A
Session Management ★★★ ★★★★★ OC
Configuration ★★★ ★★★★★ OC
Orchestration ★★★☆ ★★★★ Draw
Frustration Detection ★★★ CC

What is Claude Code's sole winning mechanism, "frustration detection"? A dozen regexes matching profanity (wtf, ffs, this sucks), which trigger a survey asking how your experience is going, then optionally ship your transcript to Anthropic's servers. This isn't sentiment awareness. It's product telemetry.

Details That Stand Out

"LLM summarization" doesn't mean "done well." Both Claude Code and OpenClaw use LLMs for context compaction, but Claude Code uses the summary as-is — no validation, no retry, no check whether file paths and commit hashes got swallowed. OpenClaw has identifierPolicy: "strict" forcing preservation of opaque identifiers, quality gates with up to 3 retries, and a structured fallback. One trusts the model won't make mistakes; the other assumes it will.

Features you think are off may have been remotely turned on. Claude Code's 49 GrowthBook tengu_* flags are controlled remotely by Anthropic — time-based microcompact, cached microcompact, fork subagent, AutoDream, MEMORY.md attachment recall. Whether these are enabled isn't up to you; it's up to Anthropic's rollout strategy. Whose A/B test is your CLI tool running?

AutoDream: Beautifully designed, never validated. Claude Code implements a complete cross-session memory consolidation system (dedup, conflict resolution, relative-to-absolute date conversion). The code is well-crafted. But as of the leak, it's off by default, has no production performance data, and has no quality gates. Can a feature that has never run on real users really be called "implemented"?

TL;DR

Anthropic controls both the model and the client, yet lost 1:8 on the runtime layer to a provider-agnostic open-source project. The home-court advantage wasn't spent where it mattered most — and that's the most interesting story the source code tells.

About

8 : 1 : 1 11 core mechanisms compared head-to-head. OpenClaw wins 8, Claude Code wins 1, 1 draw, 1 not applicable.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors