674019130/learn-real-claude-code
86 stars · Last commit 2026-04-02
Deep dive into Claude Code source — 512K lines of industrial-grade TypeScript agent architecture
README preview
[English](./README.md) | [中文](./README-zh.md) # Learn Real Claude Code — Source Archaeology on a 512K-Line Agent ## The Source Code Doesn't Lie On March 31, 2026, a security researcher discovered that Anthropic had accidentally shipped the complete TypeScript source of Claude Code inside an npm package — 512,000+ lines, 1,902 files, a 60MB sourcemap that unzips to the full codebase. This was not the first time. The same mistake happened in February 2025. Before we talk about what the source reveals, let's be precise about what you are actually looking at. **Claude Code is not an agent. Claude Code is a harness.** The agent is Claude — a neural network, trained by Anthropic, capable of reasoning, planning, and acting. Claude Code is the shell around that model: the tools, the context management, the permission system, the terminal UI, the streaming infrastructure. It is the vehicle the agent drives. Not the driver. This distinction matters because it changes what you learn from reading the source. You are not studying "how Claude thinks." You are studying **how Anthropic built the environment that lets Claude think at its best** — in production, at scale, with real users. And what you find, when you read those 512,000 lines carefully, is deeply instructive.