674019130

Learn Real Claude Code — Development skill for Claude Code

Development community

Deep dive into Claude Code source — 512K lines of industrial-grade TypeScript agent architecture.

How to install Learn Real Claude Code

This entry records only its repository, not the path inside it, so there is no exact command to give. Open 674019130/learn-real-claude-code and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Learn Real Claude Code does

Deep dive into Claude Code source — 512K lines of industrial-grade TypeScript agent architecture.

Alternatives in Development

  • Management Deep Dive — 管理层纵深研究:买股票就是买人 15.9k ★
  • Open Agent SDK TypeScript — Agent-SDK without CLI dependencies, as an alternative to claude-agent-sdk, completely open source 2.6k ★
  • How Claude Code Works — Deep dive into Claude Code internals — architecture, agent loop, context engineering, and more 1.9k ★

README

[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.

What the Source Reveals

The common mental model of an AI coding agent looks like this:

user message → LLM call → parse response → if tool_call: run tool → loop

Clean. Simple. Teachable in a weekend.

The reality in Claude Code's source is different:

user message
    → fast-path check (exit in < 5ms if --version, --help, etc.)
    → lazy module evaluation (main.tsx is 804KB; don't load what you don't need)
    → parallel prefetch (config + auth + MCP init all fire concurrently)
    → command registry check (100+ slash commands before touching the model)
    → system prompt assembly (10+ sources, SYSTEM_PROMPT_DYNAMIC_BOUNDARY for cache)
    → StreamingToolExecutor fires tools MID-STREA