Part of MERGE_RUNBOOK Phase C.4. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3.0 KiB
claw-code: Open-Source Claude Code Reimplementation
This repository is a clean-room rewrite of Anthropic's Claude Code CLI — an agent harness for running Claude with tool execution, session management, and workflow orchestration.
Origin & Context
Created by @instructkr in March 2026 after Claude Code's source was leaked. Rather than host the leaked code, the author ported it from scratch to Python (and now Rust) to preserve the architectural patterns legally. The author is a power user featured in the Wall Street Journal who used 25 billion Claude Code tokens in 2025.
What It Does
claw-code is an AI agent runtime/harness that allows you to run Claude (via Anthropic API) with:
- Tool execution: Bash commands, file operations (read/write/edit), web search, grep, glob, etc.
- Session management: Persistent conversations, history, context
- MCP (Model Context Protocol): Connect external data sources/tools
- Skills system: Reusable prompt templates and workflows
- Hooks: Automation triggers (pre/post tool use)
- Plugin architecture: Extend with custom capabilities
- OAuth/API integration: Direct Anthropic API access
- Multi-modal: Code, images, PDFs, Jupyter notebooks
Current Architecture
The project has two implementations:
- Python (
src/): Original port from TypeScript — functional but not feature-complete - Rust (
rust/crates/): Active development focus — faster, memory-safe, production-ready
Rust crates structure:
api/- Anthropic API clientruntime/- Core conversation loop, session management, MCPtools/- Tool registry and executioncommands/- Slash command handlersrusty-claude-cli/- Main CLI binarycompat-harness/- Compatibility layer
Parity Status
The Rust port is not feature-parity with original Claude Code (per PARITY.md):
✅ Working:
- Core Anthropic API/OAuth
- Tool loop with 15+ built-in tools
- MCP stdio/bootstrap
- CLAUDE.md discovery
- Session persistence
- Basic CLI commands
❌ Missing:
- Plugins: No plugin system yet
- Hooks: Parsed but not executed
- Many commands:
/agents,/hooks,/mcp,/plan,/review,/tasks,/skills - Advanced orchestration: Remote transports, structured I/O
- Service ecosystem: Analytics, settings sync, team memory
Use Case
This is for developers who want:
- Open-source alternative to official Claude Code
- Self-hosted AI agent runtime
- Tool-use enabled Claude workflows
- Customizable harness for research/experimentation
- Faster Rust-based implementation
Not a drop-in replacement — still under active development toward feature parity.
Key Files
README.md- Project overview and backstoryCLAUDE.md- Claude Code instructions for working with this repoPARITY.md- Detailed gap analysis between Rust port and original TypeScriptrust/- Rust implementation (primary focus)src/- Python implementation (reference)tests/- Verification suite