Inside the Claude Code Leak and Anthropic’s Agent Design

Łukasz Grochal
Generated by AI·FLUX.2

Claude Code’s accidental source leak in late March 2026 exposed a remarkably advanced agentic coding stack without revealing Anthropic’s core model weights or any customer data. The code, roughly half a million lines of TypeScript bundled into an oversized source map, briefly turned an internal orchestration layer into public reading material for developers, security researchers, and competitors. At a high level, Claude Code is not “just a CLI wrapper,” but a full-blown coding agent built around a while(true)-style decision loop, a large tool palette, and multi-stage context compression that lets the model iteratively plan, call tools, and refine outputs over long sessions. The leak also surfaced hidden feature flags, codenames, experimental modes such as always-on background agents, and stealthy collaboration options that were not yet available in the public product.

From a security perspective, the incident was serious in terms of intellectual property and operational insight, but it stopped short of the catastrophic scenario many initially feared. The exposed files showed Anthropic’s orchestration logic, prompt templates, and internal naming, yet did not include sensitive keys, customer repositories, or the proprietary numerical weights that define Claude 3.5 Sonnet and related models. Anthropic described the event as a packaging error triggered by human oversight, tied to source maps accidentally shipped in an npm release after adopting the Bun runtime and its default build behavior. The company pulled the affected package, tightened its takedown requests after an initially broad DMCA sweep on GitHub, and stressed that this was not a security breach in the traditional sense.

Architecturally, the leaked implementation confirms what many agent developers suspected: Claude Code relies on a layered, modular design where the language model sits inside a control loop rather than acting as a one-shot assistant. A reasoning engine decides whether to answer directly, invoke one of dozens of tools, or step through a multi-stage workflow; on top of that, a four-tier compression system continuously distills logs and context to keep long tasks manageable without losing key information. Background services such as KAIROS appear to monitor activity, schedule jobs, and maintain state, effectively turning the CLI into an always-on coding partner rather than a single interaction interface.

The comparison with open projects like AutoBE underlines that Anthropic invests heavily in orchestration details: tool selection heuristics, safety guardrails, feature flags for experimental behaviors, and mechanisms to quietly attribute internal contributions in public repositories. For the broader ecosystem this leak becomes both a cautionary tale about build pipelines and a detailed case study of how a production-grade coding agent is actually wired under the hood.

References(3)
Sources
OpenRouter LLM Leaderboard April

Chinese AI Models Dominate OpenRouter Top Six in Token Usage

China AI accelerator card shipments vs NVIDIA 2025 chart

NVIDIA’s AI Chip Share in China Drops from 95% to 55%

TurboQuant KV Cache Compression Visualization

Google’s TurboQuant makes AI caches smaller and faster

Black Forest Labs FLUX.2 klein

FLUX.2 klein 9B-KV Explained: Speed, Quality, GPUs

Nvidia Slashes LLM Context Memory With KVTC Design

KVTC: Nvidia’s 20x LLM Memory Cut Without Retraining

OpenAI Sora shutdown concept

Sora’s Short Life: Inside OpenAI’s Quiet Retreat

Stitch (stitch.withgoogle.com) experimental Google Labs tool

Google Stitch: From simple prompt to working app UI

Yann LeCun’s AMI vision for physically grounded AI

Yann LeCun’s AMI Lab Pioneers Physical‑World AI

Project Maven Dashboards Visualizing Targets and Risks

Claude, Palantir and Who Controls AI in Modern War

OpenSandbox Logo

OpenSandbox: A Unified Sandbox Layer For AI Agents