Skip to main content
Claude Code brings Claude directly into your terminal. It reads and writes files, runs shell commands, searches codebases, manages git workflows, coordinates multi-agent tasks, connects to MCP servers, and bridges into your IDE — all driven by the same Claude model that powers claude.ai.
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 more

Multi-agent orchestration

Spawn sub-agents with AgentTool, coordinate parallel work with TeamCreateTool, and manage tasks

MCP 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:
User Input → CLI Parser (Commander.js)
           → Query Engine (src/QueryEngine.ts)
           → LLM API (Anthropic SDK)
           → Tool Execution Loop
           → Terminal UI (React + Ink)
The entire UI layer is built with React + Ink — functional components, hooks, context providers, and a design system, all rendered to your terminal. The 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

FileRole
src/entrypoints/cli.tsxCLI session orchestration — the main path from launch to REPL
src/entrypoints/init.tsConfig, telemetry, OAuth, and MDM policy initialization
src/entrypoints/mcp.tsMCP server mode — run Claude Code as an MCP server
src/entrypoints/sdk/Agent SDK for programmatic embedding

Tech stack

CategoryTechnology
RuntimeBun ≥ 1.1.0
LanguageTypeScript (strict), ~512K lines across ~1,900 files
Terminal UIReact 19 + Ink
CLI parsingCommander.js (@commander-js/extra-typings)
Schema validationZod v3 (^3.24)
Code searchripgrep via GrepTool
ProtocolsMCP SDK · LSP
APIAnthropic SDK ^0.39.0
TelemetryOpenTelemetry (lazy-loaded, ~400KB) + gRPC (~700KB)
Feature flagsGrowthBook
AuthOAuth 2.0 · JWT · macOS Keychain

Feature flags (dead-code elimination)

Claude Code uses Bun’s bun:bundle to strip inactive features at build time:
import { feature } from 'bun:bundle'

if (feature('VOICE_MODE')) {
  const voiceCommand = require('./commands/voice/index.js').default
}
Notable flags: 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

Build docs developers (and LLMs) love