This documentation covers the leaked source of
@anthropic-ai/claude-code at version 0.0.0-leaked, published on 2026-03-31. The source is archived reference material. All original code is the property of Anthropic and is not licensed for redistribution.What Claude Code can do
~40 agent tools
File I/O, shell execution, ripgrep search, web fetch, Jupyter notebooks, LSP integration, and more
~85 slash commands
/commit, /review, /mcp, /memory, /config, /doctor, /compact, and many moreMulti-agent orchestration
Spawn sub-agents with
AgentTool, coordinate parallel work with TeamCreateTool, and manage tasksMCP integration
Connect to any Model Context Protocol server as a client, or run Claude Code itself as an MCP server
IDE bridge
Bidirectional bridge to VS Code and JetBrains extensions via
src/bridge/Persistent memory
Automatic memory extraction and cross-session recall via
src/memdir/ and src/services/extractMemories/Plugin & skill system
Load third-party plugins via
src/plugins/ and reusable workflow skills via src/skills/Voice input
Voice mode (feature-flagged) for hands-free interaction via
src/voice/Vim mode
Full Vim keybinding support via
src/vim/ and src/keybindings/Architecture overview
Claude Code follows a pipeline model from user input to terminal output:QueryEngine.ts file (~46K lines) drives the streaming API calls, tool-call loops, thinking mode, retries, and token counting at the core of every interaction.
Startup sequence
On launch,src/main.tsx fires parallel prefetch side-effects (MDM policy reads, Keychain reads, API preconnect) before any heavy module evaluation, then hands off to src/entrypoints/cli.tsx for session orchestration. Initialization covers OAuth, telemetry, MCP connections, and feature flag checks.
Entrypoints
| File | Role |
|---|---|
src/entrypoints/cli.tsx | CLI session orchestration — the main path from launch to REPL |
src/entrypoints/init.ts | Config, telemetry, OAuth, and MDM policy initialization |
src/entrypoints/mcp.ts | MCP server mode — run Claude Code as an MCP server |
src/entrypoints/sdk/ | Agent SDK for programmatic embedding |
Tech stack
| Category | Technology |
|---|---|
| Runtime | Bun ≥ 1.1.0 |
| Language | TypeScript (strict), ~512K lines across ~1,900 files |
| Terminal UI | React 19 + Ink |
| CLI parsing | Commander.js (@commander-js/extra-typings) |
| Schema validation | Zod v3 (^3.24) |
| Code search | ripgrep via GrepTool |
| Protocols | MCP SDK · LSP |
| API | Anthropic SDK ^0.39.0 |
| Telemetry | OpenTelemetry (lazy-loaded, ~400KB) + gRPC (~700KB) |
| Feature flags | GrowthBook |
| Auth | OAuth 2.0 · JWT · macOS Keychain |
Feature flags (dead-code elimination)
Claude Code uses Bun’sbun:bundle to strip inactive features at build time:
PROACTIVE · KAIROS · BRIDGE_MODE · DAEMON · VOICE_MODE · AGENT_TRIGGERS · MONITOR_TOOL · COORDINATOR_MODE · WORKFLOW_SCRIPTS
Explore further
Architecture overview
Deep-dive into the core pipeline, state management, UI layer, and build system
Tools reference
Complete catalog of all ~40 agent tools with categories and permission model
Commands reference
All ~85 slash commands organized by category
MCP server
Use the
claude-code-explorer-mcp package to browse the source interactively