At 4 AM on March 31, 2026, the Claude Code source was exposed. Within hours, Claw Code emerged β a clean-room Python rewrite of Claude Codeβs agent harness architecture, built entirely through AI-assisted orchestration. It hit 50K GitHub stars in 2 hours, making it the fastest repo in history to reach that milestone.
| *Source: GitHub β instructkr/claw-code | Wall Street Journal: βThe Trillion Dollar Race to Automate Our Entire Livesβ (March 21, 2026)* |
What Happened
The Claude Code source code was exposed publicly. Instead of just archiving the leaked code, developer Sigrid Jin (@instructkr) β one of the most active Claude Code power users, having consumed 25 billion tokens β chose to study the harness architecture and port the core patterns to Python from scratch.
The key distinction: this is not a copy of proprietary source. Itβs a clean-room reimplementation that captures the architectural patterns β tool wiring, agent orchestration, runtime context management β without copying Anthropicβs code.
How It Was Built
The entire rewrite was orchestrated using oh-my-codex (OmX), a workflow layer on top of OpenAIβs Codex:
| OmX Mode | How It Was Used |
|---|---|
$team mode |
Parallel code review and architectural feedback |
$ralph mode |
Persistent execution loops with architect-level verification |
| Codex-driven | Turned the src/ tree into a Python-first porting workspace |
From reading the original harness structure to producing a working Python tree with tests β all driven through OmX orchestration in a single session.
Repository Structure
claw-code/
βββ src/ # Python porting workspace
β βββ main.py # CLI entrypoint
β βββ commands.py # Command port metadata
β βββ tools.py # Tool port metadata
β βββ models.py # Dataclasses for subsystems/modules
β βββ query_engine.py # Porting summary renderer
β βββ port_manifest.py # Workspace structure summary
β βββ task.py # Task management
βββ tests/ # Python verification
βββ dev/rust # Rust port (in progress)
What It Reveals About Claude Codeβs Architecture
The porting process surfaces the internal structure of Claude Codeβs agent harness:
- Subsystem decomposition β How Claude Code splits into modules (commands, tools, models, tasks)
- Command/tool inventory β The full set of built-in capabilities
- Agent workflow patterns β How tasks are routed, orchestrated, and verified
- Runtime context management β How the harness manages state across sessions
This is essentially a study guide for harness engineering β understanding the patterns matters more than the specific implementation.
Quickstart
# Render porting summary
python3 -m src.main summary
# Print workspace manifest
python3 -m src.main manifest
# List subsystems
python3 -m src.main subsystems --limit 16
# Run tests
python3 -m unittest discover -s tests -v
# Inspect command/tool inventories
python3 -m src.main commands --limit 10
python3 -m src.main tools --limit 10
Current Status
| Aspect | Status |
|---|---|
| Python workspace | Functional β mirrors root-entry file surface, subsystem names, command/tool inventories |
| Runtime equivalence | Not yet β fewer executable runtime slices than original TypeScript |
| Rust port | In progress on dev/rust branch β faster, memory-safe harness runtime |
| Legal position | Clean-room reimplementation, not a code copy. Essay on legal/ethical questions included in repo |
The Creator
Sigrid Jin was featured in the Wall Street Journal (March 21, 2026) as one of the most dedicated Claude Code power users:
βAI startup worker Sigrid Jin single-handedly used 25 billion Claude Code tokens last yearβ¦ Jin flew to San Francisco in February for Claude Codeβs first birthday party.β
He noted that different tools have different strengths: βCodex is better at reasoning, while Claude Code generates cleaner, more shareable code.β
Why This Matters
- Harness > Model β The value isnβt in Claudeβs weights, itβs in how the harness orchestrates tools, manages context, and enforces quality. Now that architecture is open for study.
- AI building AI tools β The entire rewrite was done through AI orchestration (OmX + Codex), demonstrating that agent systems can now reverse-engineer and reimplement other agent systems.
- Community velocity β 50K stars in 2 hours signals massive demand for open, inspectable agent infrastructure.
How LearnAI Team Could Use This
- Study the Claw Code architecture as a teaching resource for agent orchestration patterns.
- Compare Claude Code (TypeScript) and Claw Code (Python) implementations to understand framework design tradeoffs.
- Use as a base for building custom agent harnesses for research or course-specific workflows.
Real-World Use Cases
- Agent framework education: students trace how a tool call flows through the harness.
- Prototyping custom agent loops with Python instead of TypeScript.
- Open-source harness experimentation: fork and modify without Claude Codeβs binary constraints.
- Runtime architecture comparison exercises in systems design courses.