Featured Blog

Claude Code Source Code Leak 2026: What Anthropic Exposed in npm Source Map Error

2026-04-01
Security Incident Report March 31, 2026 · npm Supply Chain
Incident Closed — 512,000+ lines exposed · No customer data compromised · Mirrors remain public
Claude Code Source Leak 2026

What Anthropic Exposed

in the npm Packaging Error — v2.1.88

On March 31, 2026, Anthropic shipped Claude Code v2.1.88 to npm with a 59.8 MB cli.js.map source map file, exposing the full 512,000+ lines of TypeScript source across 1,900 files. The leak revealed 44 unreleased feature flags, internal telemetry, encryption logic, and multi-agent orchestration code. No customer data was compromised, but the incident marks Anthropic's second major leak in weeks.

// By the Numbers
59.8MB Source map file size
512K+ Lines of TypeScript
1,900 Files exposed
44 Unreleased feature flags

What Happened: The npm Source Map Mishap

Anthropic's official @anthropic-ai/claude-code package for version 2.1.88 contained a production artifact never intended for public release: the unobfuscated cli.js.map file. Source maps are debugging files that map minified JavaScript back to original TypeScript source.

Security researcher Chaofan Shou discovered the exposure within hours. Community mirrors quickly appeared on GitHub, making the full codebase permanently available. Anthropic removed the source map and older package versions, describing it as a "release packaging issue caused by human error."

Anthropic accidentally published Claude Code source code — The Media Copilot breach analysis

// Anthropic accidentally published Claude Code's source code — The Media Copilot, March 2026

Claude Code: The Agentic CLI Interface

Claude Code is Anthropic's terminal-first agentic tool that lets developers plan, execute, debug, and ship code using natural language — making the source exposure particularly significant for security researchers.

Entire Claude Code CLI source code leaks thanks to exposed map file — Ars TechnicaAnthropic Claude Code command line AI coding — review and analysisHow to install Claude Code — terminal, IDE, web and desktop setup, Bannerbear

// Claude Code in action: terminal interface, agentic workflow, and installation overview

Exactly What Was Exposed: 44 Unreleased Feature Flags

// Leaked Internal Architecture — Classified Contents
  • KAIROS — a persistent background daemon (always-on agent) that maintains long-term memory and proactively suggests improvements.
  • Buddy — a Tamagotchi-style virtual companion that gamifies code maintenance tasks.
  • Voice Mode, Proactive Agent flags, and detailed multi-agent orchestration logic.
  • Complete system prompts and internal safety policies.
Anthropic accidentally leaked Claude Code source — the internet is keeping it forever, Decrypt

// Anthropic accidentally leaked Claude Code's source — The Internet Is Keeping It Forever (Decrypt via Yahoo)

Why This Leak Matters: Three Hard Numbers

29M Secrets leaked on GitHub in 2025 — a 34% YoY jump. AI-assisted commits leak at 2× baseline rate.
97% Of breached organizations lacked proper AI access controls (IBM Cost of Data Breach 2025).
+81% YoY surge in AI service secrets exposed — 1.27M credentials in 2025 (GitGuardian).
Generative AI vs Agentic AI — what's the difference, JavaScript in Plain English Medium

// Generative AI vs Agentic AI: understanding the attack surface difference (Medium)

Expert Perspective

Ram Shankar Siva Kumar — Microsoft AI Red Team Lead

Exposing surrounding agentic tooling — CLI logic, orchestration, memory systems — lowers the bar for reverse-engineering guardrails and building adversarial variants. Even without model weights, the blueprint for how Claude Code interacts with models can now be studied or attacked at scale. This accelerates both legitimate open-source forks and sophisticated jailbreak techniques.

Implications for Developers & Enterprises

The leak makes reverse-engineering far easier and underscores that agentic AI tools are becoming the new attack surface. Enterprises relying solely on one vendor's CLI now face single-vendor concentration risk. The smart strategy is multi-model routing through a unified API layer that automatically falls back between providers while preserving the agentic experience.

AI vs Agentic Workflows — what's the difference, LinkedInBuilding smarter systems — the synergy of microservices and agentic AI, LinkedIn

// Agentic AI workflows and enterprise security implications

FAQ

Was any customer data exposed?

No. The leak contained only internal source code — no credentials, user prompts, or conversation history were compromised.

Can I still use Claude Code safely?

Yes, the official package has been cleaned. However, the mirrored source remains public, so scrutinize future releases carefully for build artifacts.

What should teams do immediately?

Scan npm pipelines for source-map inclusion, implement automated secret scanning, and consider a unified AI API gateway that abstracts vendor-specific CLIs.

Does this change the future of agentic CLI tools?

It accelerates adoption. The real differentiator is no longer the CLI itself, but the stability and security of the underlying API access layer.

The Claude Code source leak is a wake-up call. For developers building agentic applications, the clearest lesson is: never bet the farm on a single vendor's CLI or API. A unified, battle-tested integration platform with intelligent routing and automatic fallback is now essential for production-grade AI development.

300+ AI Models for
OpenClaw & AI Agents

Save 20% on Costs