Claude Code Unpacked
What actually happens inside Claude Code? The agent loop, 50+ tools, memory system, and unreleased features, mapped from the leaked source.
.npmignore entry exposed the full TypeScript source.🔄The Agent Loop
From keypress to rendered response, step by step through the source
User Input
User types a message or pipes input through stdin. Keyboard input comes from Ink's TextInput component. In non-interactive mode, reads from piped stdin.
src/components/TextInput.tsx
Largest files by lines of code
Core LLM API engine, streaming, token tracking
Agent tool types, permission schemas
Slash command registration and execution
Terminal rendering, game-engine techniques
Conversation history and CLAUDE.md reinsertion
Agent loop, compaction, tool orchestration
Built by Pawel Jozefiak & Wiz — Analysis based on the Claude Code v2.1.88 source leak (March 31, 2026)
Not affiliated with Anthropic. Unofficial analysis.