// summary
This project contains the complete leaked source code for Anthropic's official Claude Code CLI tool, which was discovered on March 31, 2026, via map files in the npm package. The repository provides the original source code built with TypeScript and Bun, accompanied by detailed architectural documentation and exploration guides. Users can interactively delve into the tool's internal implementation and design patterns through the built-in MCP server.
// technical analysis
Claude Code is the leaked source code of Anthropic's official CLI tool, written in TypeScript and running in a Bun environment. The project demonstrates a highly modular architecture, building terminal UI via React and Ink, and utilizing MCP (Model Context Protocol) to achieve deep integration with IDEs and external systems. Its core design philosophy centers on an agent-driven development workflow, implementing automated task processing from file editing to multi-agent collaboration through complex tool systems, command systems, and permission management layers. Technically, the project employs optimization strategies such as lazy loading, parallel prefetching, and feature-flag-based build-time code elimination to handle the complexity of over 500,000 lines of code.
// key highlights
// use cases
// getting started
Developers do not need to clone the repository; they can install the MCP server directly via npm and use the 'claude mcp add' command to register it into Claude Code. If starting from source, clone the repository, enter the mcp-server directory, execute 'npm install' and 'npm run build', and then register the service to the local environment using the absolute path.