Anthropic's Claude Code CLI Source Code Leaked via npm

A security researcher discovered that the entire source code of Anthropic's Claude Code CLI tool was exposed through a source map file published on npm. The leaked codebase reveals a highly sophisticated AI-powered coding assistant with a modular architecture and advanced features.

đź’ˇ

Why it matters

The leak of Anthropic's Claude Code source code is significant, as it reveals the technical sophistication of this AI-powered coding tool and the company's approach to building advanced AI systems.

Key Points

  • 1The leaked codebase contains ~1,900 TypeScript files and over 512,000 lines of code
  • 2Claude Code is built on Bun (not Node) and uses React with Ink for terminal UI rendering
  • 3It has a plugin-like tool architecture with ~40 discrete, permission-gated capabilities
  • 4The query engine (46K lines) handles LLM API calls, streaming, caching, and orchestration
  • 5Claude Code can spawn sub-agents to handle complex, parallelizable tasks

Details

The leaked source code of Anthropic's Claude Code CLI tool reveals a highly sophisticated AI-powered coding assistant. With ~1,900 TypeScript files and over 512,000 lines of code, it is a production-grade system, not a toy project. Claude Code is built on the Bun JavaScript runtime, leveraging its performance features, and uses React with Ink for its terminal user interface. The tool has a modular, plugin-like architecture, with around 40 discrete capabilities (file read, bash execution, web fetch, LSP integration, etc.) each gated by permissions. The core of the system is the 46,000-line query engine, which handles all the LLM API calls, streaming, caching, and orchestration. Claude Code can also spawn sub-agents, or 'swarms', to handle complex, parallelizable tasks. Additionally, it has an IDE bridge system for bidirectional communication with extensions in tools like VS Code and JetBrains IDEs. The leaked codebase provides a fascinating look into the technical architecture and design decisions behind this advanced AI coding assistant, including the use of Bun, React with Ink, Zod for validation, and a rich system of slash commands.

Like
Save
Read original
Cached
Comments
?

No comments yet

Be the first to comment

AI Curator - Daily AI News Curation

AI Curator

Your AI news assistant

Ask me anything about AI

I can help you understand AI news, trends, and technologies