Inside Claude Code: Anatomy of a 512K-Line AI Agent

An interactive technical breakdown of Claude Code’s architecture — from the query loop and five compaction mechanisms to the permission pipeline and feature flags. Based on source code analysis of ~1,884 TypeScript files.

April 8, 2026 · 0 min