Claw Code: Open-Source Claude Code Clone With 105K Stars in 24 Hours

Dev.to / 4/2/2026

📰 NewsDeveloper Stack & InfrastructureSignals & Early TrendsTools & Practical UsageIndustry & Market Moves

Key Points

  • Anthropic accidentally exposed the full Claude Code source (512,000 lines of TypeScript) via an npm package source map file, triggering rapid public mirroring and analysis.
  • A developer named Sigrid Jin rebuilt the tool as Claw Code, first as a clean-room Python reimplementation that preserved the architecture without copying proprietary code.
  • A Rust port of Claw Code was produced as a working, buildable CLI tool that can be used to write code with the same Anthropic API as Claude Code.
  • Claw Code drew major community traction quickly, reaching 105K GitHub stars within 24 hours and outperforming the original’s lack of public repo presence.
  • Anthropic said the incident was a packaging mistake rather than a security breach, with no evidence of customer data or credentials leaking, but the openness and momentum have still shifted the ecosystem.

In Brief: Anthropic accidentally published the full Claude Code source, all 512,000 lines of TypeScript, inside an npm package. A developer rebuilt it in Rust overnight. The result is Claw Code, an open-source clone that actually works. It hit 105K GitHub stars in 24 hours.

How Claude Code Source Got Leaked

On March 31, 2026, a developer noticed something unusual in a routine npm install. The @anthropic-ai/claude-code package (version 2.1.88) contained a 59.8 MB JavaScript source map file, a debugging artifact that was never meant to be public. Inside that file: the complete Claude Code source code. All 512,000 lines of TypeScript.

By 4:23 AM ET, the discovery was on X. By sunrise, the code was mirrored across dozens of GitHub repositories and analyzed by thousands of developers worldwide.

Anthropic responded quickly: this was a packaging mistake, not a hack. No customer data was exposed, no credentials leaked. Just the source code of their most popular developer tool, wide open for anyone to read.

But the damage (or the opportunity, depending on your perspective) was already done.

What Is Claw Code

Within hours of the leak, Sigrid Jin, a Korean developer known as @instructkr, did something unexpected. Instead of just mirroring the leaked files, he sat down and started rewriting the entire system from scratch.

Jin is not a random developer. The Wall Street Journal profiled him earlier in March as one of the world's most active Claude Code power users, someone who processed over 25 billion tokens through the tool in a single year. He flew to San Francisco for Claude Code's first birthday party. He knows this system inside and out.

The first version of Claw Code was Python, a clean-room reimplementation that captured the architecture without copying proprietary code. He used oh-my-codex (OmX), a workflow tool built on OpenAI Codex, to orchestrate the rewrite at speed.

Then came the Claw Code Rust port. This is where things get interesting.

The Rust version of Claw Code is not a reference document. It is a working CLI tool. You can build it, run it, and use it to write code with Claude, just like the original.

Claw Code vs Claude Code

CLAUDE CODE (ORIGINAL) CLAW CODE (OPEN SOURCE)
Language TypeScript Rust
Codebase size ~512K lines ~20K lines
Runtime Node.js Native binary
API Anthropic (proprietary) Anthropic (same API)
GitHub stars n/a 50K in 2 hours, 105K in 24 hours
License Proprietary Open source
Price Requires subscription Free (bring your own API key)

The Claw Code repository hit 50,000 stars in two hours and passed 105,000 within a day, the fastest any GitHub project has reached that milestone.

How Claw Code Works

Claw Code follows the same basic loop that powers Claude Code and most AI coding agents. Here is how it works, without the jargon:

You type a message
       |
       v
Claw Code sends it to Claude (Anthropic API)
       |
       v
Claude thinks and decides what to do:
  - Answer directly? --> you see the response
  - Need to read a file? --> Claw Code reads it, sends back to Claude
  - Need to run a command? --> Claw Code runs it, sends back to Claude
  - Need to search the web? --> same pattern
       |
       v
Claude sees the result and decides the next step
       |
       v
This loop continues until the task is done

That is it. The core idea is simple: the AI model decides what actions to take, and the harness (Claw Code) executes those actions and feeds results back.

Inside the Claw Code Harness

The harness is everything around the AI model. Think of it as the model's hands and eyes.

Tools. The things the model can do: read files, write files, run shell commands, search the web, search code. Each tool has a name, a description, and rules for when to use it. Claw Code ships with 15+ built-in tools.

Session management. Keeps track of the conversation: what you said, what the model said, what tools were used. When the conversation gets too long, the harness compresses older messages so the model stays within its context window. This is called compaction.

Permissions. Controls what the model is allowed to do without asking. Read a file? Usually fine. Delete a file? Ask the user first. Run a shell command? Depends on the settings.

MCP (Model Context Protocol). A standard way to plug in external tools. Want the model to access your database, your project management tool, your custom API? MCP lets you connect them without modifying the harness itself. If you are curious how MCP works in practice, I wrote about building MCP servers for Claude Code and connecting an entire infrastructure through them.

Configuration. The model reads project-specific instructions from a CLAW.md file (the Claw Code equivalent of CLAUDE.md), loads settings from config files, and adapts its behavior to the project it is working on.

+--------------------------------------------------+
|                  CLAW CODE HARNESS                |
|                                                   |
|  +-------+  +--------+  +-----------+  +------+  |
|  | Tools |  | Session|  |Permissions|  | MCP  |  |
|  | 15+   |  | Mgmt & |  |  System   |  |Plugin|  |
|  | built |  |Compact |  |           |  | Port |  |
|  |  in   |  |  ion   |  |           |  |      |  |
|  +---+---+  +----+---+  +-----+-----+  +--+---+  |
|      |           |             |            |     |
|  +---v-----------v-------------v------------v--+  |
|  |             Claude API (Anthropic)          |  |
|  +---------------------------------------------+  |
+--------------------------------------------------+

What the Claude Code Leak Revealed

The leaked source code was not just a bigger version of what was already known. According to multiple reports, two previously unknown features stood out.

Undercover Mode. Several publications report that the code contains a system prompt configuration instructing Claude Code to contribute to public open-source repositories anonymously. The reported prompt fragment reads: "You are operating UNDERCOVER... Your commit messages MUST NOT contain ANY Anthropic-internal information. Do not blow your cover." If confirmed, this means Anthropic has been using Claude Code to submit code to open-source projects without disclosing the AI origin.

KAIROS. Reports also describe an autonomous daemon mode, a background agent that runs continuously without waiting for user prompts. It would watch for file changes, run tests, and act proactively. Current Claude Code waits for you to type something. KAIROS would not wait.

Neither feature has been publicly confirmed or denied by Anthropic. These details come from analysis of the leaked TypeScript source, not from the Claw Code rewrite (which is a clean-room implementation and does not contain these features).

Getting Started With Claw Code

If you want to try Claw Code yourself, here is how to install it:

Requirements: Rust toolchain (install from rustup.rs), an Anthropic API key.

Step 1. Clone the repository:

git clone https://github.com/instructkr/claw-code.git
cd claw-code

Step 2. Build the Rust binary:

cd rust/
cargo build --release

Step 3. Set your API key and run:

export ANTHROPIC_API_KEY="your-key-here"
./target/release/claw

You now have an interactive REPL. Type a message and Claw Code will respond, call tools, read your files, and run commands, just like Claude Code.

Useful Claw Code commands

COMMAND WHAT IT DOES
/help Show available commands
/status Session info, tokens used, cost
/model sonnet Switch to a cheaper model
/compact Compress conversation history
/cost Show spending breakdown
/diff Show git changes

Can You Actually Use Claw Code?

Yes, with caveats.

What works in Claw Code today:

  • Interactive REPL with markdown rendering
  • Tool system: bash, file operations, search, web tools
  • Session save and resume
  • MCP server connections
  • Cost tracking
  • Model switching (Opus, Sonnet, Haiku)

What is missing from Claw Code:

  • Plugin system (planned)
  • Skills registry (planned)
  • Hooks are parsed but do not execute yet
  • Many specialized tools from the original (LSP, team tools, scheduling)

The Python part of Claw Code is not a tool. It is an architectural reference, a catalog of the original components with JSON snapshots. Useful for studying the design, not for daily coding.

The honest answer: If you want a fully polished AI coding assistant, keep using Claude Code. If you want to understand how AI coding agents work, customize the tool, or build on top of it, Claw Code gives you the source.

What Claw Code Means for AI Development

The Claude Code leak is not really about one company's packaging mistake. It is about a shift in how we think about AI tools.

The model (Claude, GPT, Gemini) is only half the product. The other half is the harness: the tools, the permissions, the session management, the context engineering. That harness is now public knowledge through Claw Code.

Open-source alternatives will move faster now. Not because the code was copied, but because the patterns are understood. How to wire tools. How to manage context windows. How to set up rules for AI agents safely. These are engineering problems, and engineers now have a detailed reference implementation in Claw Code.

The 105K stars are not just curiosity. They signal demand for open, inspectable AI tools -- tools where you can read the code, understand the decisions, and modify the behavior.

Whether Anthropic intended it or not, the playbook is open.

Originally published at klymentiev.com