Live
Black Hat USADark ReadingBlack Hat AsiaAI BusinessGet ready for a wave of TBPN clones after its blockbuster OpenAI dealBusiness InsiderBlackSwanX,174 AI agents predict the future by fighting each other,run on OllamaHacker News AI TopPSA: Anyone with a link can view your Granola notes by defaultThe Verge AIReddit is moving on from r/allThe Verge AIElementary school students create award-winning mascot with artificial intelligence - The Journal GazetteGoogle News: AITripped up by misinformation? Here's a refresher on identifying AI - PBSGoogle News: AISilicon Valley's Computer History Museum examines evolution of technology, growing role of AI - CBS NewsGoogle News: AICursor s New Tool Lets Users Delegate to a Team of Coding AgentsGizmodoOpenAI acquires tech podcast ‘TBPN’ - thehill.comGoogle News: OpenAIA Baseless Copyright Claim Against a Web Host—and Why It FailedElectronic Frontier FoundationNvidia Needs to Remind Itself What PC Gamers Actually WantGizmodo2 Artificial Intelligence (AI) Stocks I'd Buy With $1,000 Before They Rebound From the Tech Sell-Off - The Globe and MailGoogle News: AIBlack Hat USADark ReadingBlack Hat AsiaAI BusinessGet ready for a wave of TBPN clones after its blockbuster OpenAI dealBusiness InsiderBlackSwanX,174 AI agents predict the future by fighting each other,run on OllamaHacker News AI TopPSA: Anyone with a link can view your Granola notes by defaultThe Verge AIReddit is moving on from r/allThe Verge AIElementary school students create award-winning mascot with artificial intelligence - The Journal GazetteGoogle News: AITripped up by misinformation? Here's a refresher on identifying AI - PBSGoogle News: AISilicon Valley's Computer History Museum examines evolution of technology, growing role of AI - CBS NewsGoogle News: AICursor s New Tool Lets Users Delegate to a Team of Coding AgentsGizmodoOpenAI acquires tech podcast ‘TBPN’ - thehill.comGoogle News: OpenAIA Baseless Copyright Claim Against a Web Host—and Why It FailedElectronic Frontier FoundationNvidia Needs to Remind Itself What PC Gamers Actually WantGizmodo2 Artificial Intelligence (AI) Stocks I'd Buy With $1,000 Before They Rebound From the Tech Sell-Off - The Globe and MailGoogle News: AI
AI NEWS HUBbyEIGENVECTOREigenvector

I Analyzed Claude Code's Leaked Source — Here's How Anthropic's AI Agent Actually Works

DEV Communityby Luren L.March 31, 20263 min read0 views
Source Quiz

On March 31, 2026, Anthropic's Claude Code source code leaked — again. A 60MB source map file ( cli.js.map ) was accidentally shipped in npm package v2.1.88, exposing ~1,900 TypeScript files and 512,000 lines of code. This is the second time this has happened. The first was February 2025. Instead of just reading the headlines, I did what any curious engineer would do: I read all of it. What I Found Claude Code is not what most people think. It's not a simple chat wrapper. It's a full agentic AI runtime with: QueryEngine — A conversation loop orchestrator that manages context assembly → API calls → tool execution → response rendering 40+ Tools</st

On March 31, 2026, Anthropic's Claude Code source code leaked — again. A 60MB source map file (cli.js.map) was accidentally shipped in npm package v2.1.88, exposing ~1,900 TypeScript files and 512,000 lines of code.

This is the second time this has happened. The first was February 2025.

Instead of just reading the headlines, I did what any curious engineer would do: I read all of it.

What I Found

Claude Code is not what most people think. It's not a simple chat wrapper. It's a full agentic AI runtime with:

  • QueryEngine — A conversation loop orchestrator that manages context assembly → API calls → tool execution → response rendering

  • 40+ Tools — File operations, shell execution, web search, MCP integration, notebook editing, and more

  • Task System — Sub-agent orchestration for parallelizing complex work

  • 100+ Slash Commands — /commit, /review, /security-review, /ultraplan

  • Bridge System — Remote session control from desktop/mobile via WebSocket

  • Plugin & Skills — User-defined extensions loaded from .claude/ directories

  • Voice Mode — STT integration with keyword detection

The Architecture

The most interesting part is the tool-call loop. Claude doesn't just generate text — it requests tools, the engine executes them, and results are fed back. This loop can run dozens of iterations for a single user request.

User Input → Context Assembly → API Call → Tool Request → Execute → Feed Back → ... → Final Response

Enter fullscreen mode

Exit fullscreen mode

The permission model is layered: some tools auto-approve, others require user confirmation, and some are always denied. This is how Claude Code stays safe while being powerful.

The context budget system is fascinating — it dynamically allocates tokens across system prompt, user context, memories, and tool results based on the current conversation state.

Internal Codenames

The leak revealed internal model codenames:

  • Capybara → Claude 4.6 variant

  • Fennec → Opus 4.6

  • Numbat → Unreleased model

Migration files show the progression: migrateFennecToOpus.ts, migrateSonnet45ToSonnet46.ts — giving us a roadmap of model evolution.

The Memory System

Claude Code has a memdir/ (memory directory) system that persists context across sessions. It scans for relevant memories, manages memory aging, and supports team-shared memory. This is how it "remembers" your codebase.

Why This Matters

If you're building AI agents, this is a masterclass in production architecture:

  • Tool abstraction — How to design a flexible tool system

  • Context management — How to stay within token limits while being useful

  • Permission models — How to make agents safe in production

  • State management — Zustand-style store + React for terminal UI

  • Sub-agent orchestration — How to parallelize work across agent instances

Full Analysis

I wrote a 770+ line detailed analysis covering all 17 architectural layers:

👉 GitHub: claude-code-analysis

Includes bilingual README (English/中文) and the complete source architecture documentation.

My Take

Anthropic calls this a "packaging error." Maybe. But for the AI engineering community, this is one of the most educational codebases to study. It shows how a well-funded AI lab actually builds production agent infrastructure — not toy demos, but real systems handling millions of users.

The irony? The best documentation for Claude Code wasn't written by Anthropic. It was written by the community, after the code leaked.

Disclaimer: This analysis is based on publicly available information. Claude Code is owned by Anthropic. This is an unofficial community analysis.

Was this article helpful?

Sign in to highlight and annotate this article

AI
Ask AI about this article
Powered by Eigenvector · full article context loaded
Ready

Conversation starters

Ask anything about this article…

Daily AI Digest

Get the top 5 AI stories delivered to your inbox every morning.

Knowledge Map

Knowledge Map
TopicsEntitiesSource
I Analyzed …claudemodelreleaseavailableproductintegrationDEV Communi…

Connected Articles — Knowledge Graph

This article is connected to other articles through shared AI topics and tags.

Knowledge Graph100 articles · 162 connections
Scroll to zoom · drag to pan · click to open

Discussion

Sign in to join the discussion

No comments yet — be the first to share your thoughts!

More in Products