Back to directory

Claude-Code-Source-Study

A 34-chapter, file-by-file and line-by-line technical analysis of Claude Code's source code, covering its prompt engineering, multi-agent orchestration, tool system and security model.

Claude-Code-Source-Study

Claude-Code-Source-Study is a bilingual, Chinese and English, deep-dive book that walks through Claude Code's own source code as a way to teach the full technical stack behind building an AI coding agent. Rather than a general architecture overview, each chapter breaks down specific files and functions, citing exact source line numbers and summarizing design patterns a reader can reuse in their own projects.

The chapters are organized around a session's runtime lifecycle: startup and configuration, the core query engine and prompt-cache handling, the family of built-in tools such as file, shell and search tools, agent and subagent coordination, the Model Context Protocol implementation and permission system, hooks, networking and remote sessions, and the terminal UI. All chapters live under a docs directory with a full table of contents and a changelog describing what changed between revisions.

More in Books

See all 105
  • A long technical guide to AI agent memory: why stateless LLMs need it, the different memory architectures from vector stores to knowledge graphs, and how Cognee implements one as an open-source memory layer.

  • Samizdat

    rare-books.vercel.app

    A free, curated shelf of rare internal memos, leaked handbooks, and out-of-print books from technology and business history, collected for builders to read or borrow.

  • A free, web-only book that explains AI systems, from raw compute to a deployed and governed behavior, design-first, for a software engineer who knows distributed systems but is new to machine learning.