# Interactive Claude Code Architecture Map: Breakdown of the Leaked Code
Developer autocracy101 has published an interactive visualization of 512,000 lines of TypeScript code from Claude Code, which accidentally leaked from Anthropic on March 31. The CCUnpacked map details the agent loop, file tree, 40+ tools, slash commands, and 44 feature flags, including 20 unimplemented features. This allows mid/senior-level developers to understand how the AI coding agent handles tasks in the terminal.
Agent Loop — the central component — models a multi-step process: from prompt input to final render. Instead of a single API request, Claude Code iteratively calls tools, analyzes results, and decides whether to continue or stop.
Agent Loop Details
Agent Loop visualizes the sequence of steps:
- Input via Ink: The Ink library-based component handles user input.
- Tool Selection: The model decides to use Bash, file read/edit, search, or one of 40+ other tools.
- Execution and Analysis: Retrieve the result and evaluate whether to continue.
- Decision: Continue the loop, ask the user for clarification, or finish.
A typical task takes 50+ iterations. This differs from stateless models: state is preserved between steps, providing context for complex tasks like refactoring or debugging.
The map displays dependencies between modules, including output rendering and slash command handling (/plan, /edit, etc.). For senior developers, it's useful to study integration with git worktrees and parallel workers.
Unimplemented Features Behind Feature Flags
Of the 44 flags, 20 relate to hidden capabilities. Key ones:
- KAIROS: Persistent mode with daily logs and memory across sessions.
- ULTRAPLAN: Long-term planning on Opus models with timeouts up to 30 minutes.
- Task Coordinator: Breaking tasks into parallel workers in isolated git worktrees.
- Buddy: Terminal virtual pet; appearance based on account hash (no 'fox' in the code).
These features point to Claude Code's evolution toward stateful agents with long-term context. Developers can monitor releases via feature flags in future updates.
The visualization is handy for navigation: clickable nodes reveal code snippets and dependencies. However, some factual inaccuracies are noted, such as in the Buddy description.
Context of Anthropic Leaks
The leak is the second in a week: earlier, a CMS error exposed 3000 files on Claude Mythos. Anthropic cites human error; no user data was affected.
Reactions on Hacker News are mixed: praise for the navigation, criticism for lacking new insights beyond textual breakdowns.
Key Takeaways
- Agent Loop implements an iterative cycle with 50+ tool calls per task.
- 44 feature flags, 20 unimplemented: KAIROS, ULTRAPLAN, Buddy.
- Architecture focused on stateful code handling in the terminal with git integration.
- CCUnpacked visualization speeds up analysis for AI agent developers.
- Anthropic leaks highlight risks in CI/CD pipelines.
— Editorial Team
No comments yet.