Claude Code Source Code Leaked: 512K Lines of Anthropic's CLI on GitHub
A GitHub repository published on March 31, 2026 contains the full source code of Anthropic's Claude Code CLI — 1,900 files, 512,000+ lines of TypeScript including agent tools, slash commands, IDE integrations, and the multi-agent coordination system.
By OMC Editorial on 2026-03-31
A GitHub repository published today contains what appears to be the complete source code of Anthropic's Claude Code — the company's agentic coding CLI that has been central to its developer growth story in 2026.
The repository, zhengxuyu/claude-codehttps://github.com/zhengxuyu/claude-code, was created on March 31, 2026 with a single commit. It contains approximately 1,900 files and over 512,000 lines of TypeScript.
What's in the Leak
The source tree includes:
- 50 slash command implementations — the full logic behind /commit, /review, /test, and other built-in commands
- 40 agent tool implementations — the tool definitions that give Claude Code its ability to read files, run bash commands, search codebases, and edit code
- 140 Ink UI components — the terminal UI layer built on React + Ink
- IDE integration systems — the bridge protocols connecting Claude Code to VS Code and JetBrains
- Multi-agent coordination — the orchestration layer for spawning and managing subagents
- Plugin and memory systems — the hooks and persistence mechanisms behind skills and session memory
The codebase uses Bun as its runtime and build system, with feature flags baked in at bundle time.
Architecture Reveals
The leaked code gives the first public look at how Claude Code's permission management works — a framework that gates tool use based on user-approved scopes. Also visible: the query engine that handles LLM API calls, including retry logic, token budgeting, and model routing.
The multi-agent coordination system is notably sophisticated, with dedicated protocols for spawning subagents, passing context, and collecting results — matching what Anthropic has described publicly but never shown in detail.
Anthropic Has Not Commented
As of publication, Anthropic has not issued a statement. The repository remains publicly accessible.
If you're building on MCP or Claude Code, the leaked source offers a rare look at the internals. The agent tool schema and slash command architectur