This is the source code for Claude Code, Anthropic's official CLI tool for Claude. This is a leaked/public dump of the TypeScript and React source code.
- This is source code only — there is no
package.json, build configuration, or dependencies included - This is not a standalone project — it was extracted from Anthropic's internal monorepo
- Build requirements are missing — the actual build process requires internal tooling and configuration
- This requires significant setup — you'll need to recreate the missing build infrastructure
src/
├── commands/ # CLI commands and implementations
├── components/ # React/Ink UI components
├── services/ # API clients, auth, telemetry, MCP handling
├── tools/ # Tool definitions and implementations
├── utils/ # Utility functions
├── hooks/ # React hooks
├── state/ # State management
├── types/ # TypeScript type definitions
├── constants/ # Configuration constants
├── migrations/ # Data migrations
└── main.tsx # CLI entry point
- Runtime: Bun (modern JavaScript runtime)
- Language: TypeScript
- UI Framework: React + Ink (terminal UI)
- CLI Framework: Commander.js
- API Client: Anthropic SDK (
@anthropic-ai/sdk) - Authentication: OAuth 2.0, Keychain (macOS), Registry (Windows)
- Package Manager: Bun
To actually build and run this project, you would need:
package.jsonwith all dependencies and scriptstsconfig.jsonfor TypeScript compilationbunfig.tomlfor Bun configuration- Bun build/bundling configuration
@anthropic-ai/sdk - Claude API client
@commander-js/extra-typings - CLI argument parsing
react - UI library
ink - Terminal React renderer
chalk - Terminal styling
lodash-es - Utility library
zod - Runtime type validation
- OAuth credentials configuration
- Anthropic API endpoint configuration
- Analytics/GrowthBook setup
- MDM (Mobile Device Management) integration setup
- Internal tool registrations and permissions
- Bun runtime installed
- Keychain/secrets management (platform-specific)
- Node.js/npm (for compatibility)
src/main.tsx— CLI entry point with startup profiling and initialization- Uses
commander.jsfor argument parsing
- Query Engine (
QueryEngine.ts) — Orchestrates Claude API calls - Tool System (
Tool.ts) — Framework for extending Claude's capabilities - Task System (
Task.ts) — Background task management - Commands (
src/commands/) — CLI slash-commands and operations
- API (
services/api/) — Anthropic Claude API integration - Auth (
services/auth/) — OAuth, API key, and session management - MCP (
services/mcp/) — Model Context Protocol server support - Analytics (
services/analytics/) — GrowthBook feature flags and telemetry - Remote Settings (
services/remoteManagedSettings/) — Device management policies
state/— Redux-like state managementhistory.ts— Session history trackingmemdir/— Memory system for remembering context
If you want to try building this:
# Install Bun (required)
curl -fsSL https://bun.sh/install | bash
# Attempt to install dependencies (will fail without package.json)
# You'd need to create a package.json first
# Try TypeScript compilation
bun build src/main.tsx --target bunThis will fail because:
- No
package.jsonexists - Dependencies are not specified
- Build configuration is missing
- Internal Anthropic modules are not available
This appears to be a snapshot of Claude Code's internal source at a specific point in time. It contains:
- ✅ All source TypeScript/React code
- ✅ Type definitions and interfaces
- ✅ Service implementations
- ✅ UI component code
- ❌ No build scripts or configuration
- ❌ No package dependencies
- ❌ No private keys or credentials (sanitized)
- ❌ No test files
Despite not being runnable standalone, this code is valuable for:
- Understanding Claude Code's architecture
- Seeing how Anthropic structures a large CLI application
- Learning about Ink + React for terminal UIs
- Understanding MCP (Model Context Protocol) integration
- Studying async/concurrent operation handling in Node/Bun
- Examples of TypeScript in production code
This source code was publicly leaked. Use at your own discretion and risk. This is not an official Anthropic release.