The open source implementation of Anthropic's Claude Code CLI,
built from decompiled source intelligence using ruDevolution.
On March 31, 2026, Anthropic accidentally shipped source maps in the Claude Code npm package, exposing the full TypeScript source. The leak revealed:
- KAIROS — an autonomous agent system that works without user input
- Undercover Mode — hides AI involvement in commits from Anthropic employees
- Internal tools (TungstenTool, SendUserFileTool, PushNotificationTool)
- 22 private repository names
- Animal codenames for unreleased models
Anthropic patched it within hours, but the architecture was documented by Sabrina Ramonov and others.
This project takes a different approach. Instead of relying on leaked source, we use ruDevolution — an AI-powered decompiler — to analyze the published npm package legally, and rebuild an open source version from that intelligence.
Open Claude Code is a clean-room open source implementation of the Claude Code CLI architecture. It's not a copy of Anthropic's code — it's a ground-up rebuild informed by decompilation analysis of the published binary.
The original implementation with basic WASM terminal UI, conversation management, and Claude API integration. Built before the decompilation intelligence was available.
A complete rewrite based on ruDevolution's decompilation of Claude Code v2.1.91 (34,759 declarations, 981 modules). The v2 architecture mirrors the actual Claude Code internals:
- Async generator agent loop — 13 event types, recursive after tool execution
- 25+ built-in tools — Bash, Read, Edit, Write, Glob, Grep, Agent, WebFetch
- 6 permission modes — bypassPermissions, acceptEdits, auto, default, dontAsk, plan
- MCP client — stdio, SSE, Streamable HTTP transports
- Hooks system — PreToolUse, PostToolUse, Stop events
- Settings chain — user/project/local/managed
- Context compaction — automatic context window management
- Custom agents & skills — extensible AI personas
Our decompiler discovered capabilities Anthropic hasn't publicly announced:
| Discovery | Evidence |
|---|---|
| 🤖 Agent Teams | CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS, TEAMMATE_COMMAND |
| 🌙 Auto Dream Mode | tengu_auto_dream_completed — works while you sleep |
| 🔮 claude-opus-4-6 | Unreleased model ID (current public is 4.5) |
| 🔮 claude-sonnet-4-6 | Unreleased model ID |
| 🔐 6 "amber" codenames | amber_flint, amber_prism, amber_stoat, amber_wren |
| 🧰 Advisor Tool | tengu_advisor_tool_call — new tool type |
| 🧰 Agentic Search | Search that spawns sub-agents |
| ☁️ CCR (Cloud Code Runner) | Full cloud execution with BYOC |
| 🎮 Powerups | Gamification with unlockable abilities |
| 📡 MCP Streamable HTTP | New transport replacing SSE |
| 📱 Chrome Extension | Extension ID: fcoeoabgfenejglbffodgkkbkcdhcgfn |
| 🎙️ Native Audio | Voice input capability |
| 117 new env vars | Since v2.0 |
Download decompiled releases →
git clone https://github.com/ruvnet/open-claude-code.git
cd open-claude-code/open_claude_code/src
npm install
ANTHROPIC_API_KEY=your-key node index.mjscd open-claude-code/v2
ANTHROPIC_API_KEY=your-key node src/index.mjs "explain this codebase"npx ruvector decompile @anthropic-ai/claude-codev2/src/
├── core/
│ └── agent-loop.mjs # Async generator (13 event types)
├── tools/
│ ├── registry.mjs # validateInput/call interface
│ ├── bash.mjs, read.mjs # Built-in tools
│ ├── edit.mjs, write.mjs
│ └── glob.mjs, grep.mjs
├── permissions/
│ └── checker.mjs # 6 permission modes
├── config/
│ ├── settings.mjs # User/project/local chain
│ └── cli-args.mjs
└── index.mjs # Entry point
This project is a clean-room implementation — not a copy of Anthropic's source code. The architecture is informed by analysis of the published npm package using ruDevolution, which is legal under:
- 🇺🇸 US DMCA §1201(f) — reverse engineering for interoperability
- 🇪🇺 EU Software Directive Art. 6 — decompilation for interoperability
- 🇬🇧 UK CDPA §50B — decompilation for interoperability
No leaked source code was used. No DRM was bypassed. No proprietary code was copied.
- ruDevolution — The AI-powered decompiler used to analyze Claude Code
- Decompiled Claude Code Releases — Every major version decompiled
- Sabrina Ramonov's Leak Analysis — Coverage of the March 2026 source leak
MIT