Deep dive into the internals of Anthropic's official CLI tool. From architecture design and Agent loops to terminal rendering — a comprehensive analysis of 1,902+ files and 514k+ lines of TypeScript.
Starting from the leak, we take our first look inside Claude Code's massive codebase and build a complete mental model from the CLI entry point to the LLM engine
Deep dive into QueryEngine.ts and query.ts, tracing the full journey of a conversation from user input to final response, and understanding the async-generator-driven streaming query loop
Deep dive into Claude Code's 40+ tool system — from type definitions to concurrent execution to the six-layer permission evaluation pipeline, understanding how AI safely operates on the external world