Claude Code's Source Got Leaked. Here's What's Actually Worth Learning.
Claude Code version 2.1.88 accidentally shipped a 59.8MB source map file inside its npm package. A missing line in .npmignore exposed 1,900 TypeScript files and 512,000 lines of Anthropic's internal orchestration code on Cloudflare R2. No customer data, model weights, or credentials were exposed. It was a build artifact error: Bun generates source maps by default, and the exclude rule was missing. The repo hit 84,000 GitHub stars in under two hours. The architectural insights for AI agent builders are more valuable than the drama. Key discoveries: Claude Code uses a three-layer memory system with a permanent index, a working context, and a verification step called 'skeptical memory' that treats recalled facts as hints to verify, not facts to act on. This solves context entropy (agent performance degradation in long sessions). A background service called autoDream runs as a forked read-only subagent every 24 hours (after 5+ sessions) to consolidate memory. The system uses 44 feature flags for gradual rollout of agent behaviors. The leak also includes 'Undercover Mode', a system designed to prevent employees from leaking internal details into public repos. It leaked along with everything else.
Key Facts
- *512,000 lines of TypeScript exposed via missing .npmignore entry
- *1,900 files across 59.8MB source map in npm package v2.1.88
- *No data breach: source code for the CLI tool only, no user data or model weights
- *Key architecture: 3-layer memory system with 'skeptical memory' verification step
- *autoDream: background memory consolidation subagent (runs after 5+ sessions, 24h cooldown)
- *44 feature flags controlling agent behavior rollout
Read the full article on Digital Thoughts
Read Full ArticleRelated Products
Everything from 1000+ Claude Code sessions. 15 chapters: CLAUDE.md architecture, skills, memory, night shift automation, multi-agent. $39.
Curated collection of prompts that actually work in Claude Code. Copy-paste ready for real development workflows. $29.