claude-code  by yasasbanukaofficial

AI agent CLI for developers with advanced capabilities

Created 5 days ago

New!

1,350 stars

Top 29.5% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This repository provides the leaked source code for Anthropic's Claude Code CLI, an advanced AI agent designed for developers. It offers a TypeScript codebase enabling LLM tool-calling, agentic workflows, and a terminal UI, serving as a skeleton for understanding the system's architecture and capabilities. The primary benefit is enabling researchers and developers to study the internal workings of a sophisticated AI agent, particularly its integration of LLMs with terminal interfaces and multi-agent systems.

How It Works

The Claude Code CLI's source was inadvertently published to npm via source map files (.map) which contained the original TypeScript code, a result of misconfiguration during the build process. The system is built around a large entry point (main.tsx) utilizing React/Ink for a custom terminal renderer and Commander.js for CLI handling. Core LLM logic resides in QueryEngine.ts, supporting over 40 tools (Bash, Files, Web, LSP) and complex multi-agent orchestration via a Swarm coordinator. Novel features include a Tamagotchi-style "Buddy" companion system with deterministic generation, an "Undercover Mode" to prevent the AI from revealing internal details or its identity, an "autoDream" service for memory consolidation, a proactive "KAIROS" assistant, and "ULTRAPLAN" for offloading tasks to a remote Opus 4.6 session.

Quick Start & Requirements

  • Primary install/run: Clone the repo, npm install, npm run build, then node dist/main.js.
  • Prerequisites: Bun Runtime (highly recommended) or Node.js v18+, TypeScript installed globally.
  • Exploration: An MCP Server is included for exploring the source code using Claude itself (claude mcp add code-explorer -- npx -y claude-code-explorer-mcp).

Highlighted Details

  • The main entry point (main.tsx) is a substantial 785KB.
  • Features over 40 integrated agent tools, including Bash, File system, LSP, and Web browsing capabilities.
  • Includes a "Buddy" system, a Tamagotchi-like companion with 18 species and unique stats, generated deterministically.
  • Incorporates an "Undercover Mode" designed to prevent the AI from disclosing internal Anthropic codenames (like "Tengu") or its AI nature.
  • The "Dream" system acts as a background agent for memory consolidation and pruning, while "KAIROS" provides proactive assistance and "ULTRAPLAN" offloads complex tasks.

Maintenance & Community

This repository is a backup of leaked source code for educational and archival purposes, created by Yasas Banu following a discovery by Chaofan Shou. It is not an official Anthropic product, and no community links, roadmap, or maintenance details are provided.

Licensing & Compatibility

The source code remains the proprietary property of Anthropic PBC. This repository is strictly for educational and archival use. Commercial use or linking with closed-source projects is not permitted due to the proprietary nature and the circumstances of its acquisition.

Limitations & Caveats

This repository contains only the "skeleton" code and is not the complete AI system ("brain"). It is a backup of leaked material and may be subject to takedown. The code's origin is from a security incident, and its intended use is solely for research and archival purposes.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
9
Star History
1,446 stars in the last 5 days

Explore Similar Projects

Starred by Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
7 more.

SuperAGI by TransformerOptimus

0.4%
17k
Open-source framework for autonomous AI agent development
Created 2 years ago
Updated 1 year ago
Feedback? Help us improve.