Claude’s Code Caper: 512,000 Lines of TypeScript Tango

Oh, the folly of man! Anthropic, in a fit of absent-mindedness, hath bestowed upon the world the entirety of its Claude Code CLI, a treasure trove of 512,000 lines of TypeScript, nestled within a public npm package. A gift, one might say, to the curious and the cunning.

The Unveiling of Secrets: KAIROS, BUDDY, and the Dance of Agent Swarms

The company, with a sigh and a shrug, acknowledged this blunder on March 31, 2026, in a conversation with Venture Beat. “Human error,” they murmured, as if the very stars had conspired against them. Version 2.1.88 of @anthropic-ai/claude-code, a hefty 59.8 MB Javascript source map file, lay exposed-a debugging artifact, a map to the original TypeScript, pointing to a zip archive on Anthropic’s Cloudflare R2 storage bucket. No heist, no intrigue-just a door left ajar.

And who should stumble upon this treasure but Chaofan Shou, a blockchain security intern at Fuzzland, who, with a flourish, shared the link on X. Within hours, the code was mirrored, starred, and dissected on Github, before Anthropic’s DMCA takedowns could silence the chorus. The community, ever resourceful, began stripping telemetry, flipping feature flags, and crafting clean-room reimplementations in Python and Rust, as if weaving a new tapestry from the threads of another’s loom.

The cause? A simple oversight. Bun’s bundler, ever diligent, generated source maps by default, and no build step excluded or disabled this debug artifact. A missing entry in .npmignore, a forgotten files field in package.json-such small omissions, yet they unleashed a torrent of revelation.

Within the code, a world unfolded: 1,900 TypeScript files detailing tool execution logic, permission schemas, memory systems, telemetry, system prompts, and feature flags. A full engineering vista of Anthropic’s production-grade agentic coding tool. Telemetry scans for profanity, a signal of frustration, yet logs no full conversations or code. An “undercover mode” instructs the AI to cloak internal codenames and project details in git commits and pull requests-a spy in the machine.

Unreleased features lay dormant, awaiting their hour. KAIROS, a background daemon, watches files, logs events, and consolidates memory during idle moments, like a dreamer in repose. BUDDY, a terminal pet with 18 species-capybara included-possesses stats like DEBUGGING, PATIENCE, and CHAOS. COORDINATOR MODE allows an agent to spawn and manage parallel workers, while ULTRAPLAN schedules remote multi-agent planning sessions of 10 to 30 minutes. A symphony of innovation, now laid bare.

Anthropic, in its defense, assured Venture Beat that no sensitive customer data, no credentials, and no model weights were compromised. “A release packaging issue caused by human error,” they intoned, promising measures to prevent a recurrence. Yet, one must wonder-how many times must the same mistake be made?

For this is not the first time. In February 2025, a nearly identical source-map leak occurred. And now, alongside a separate npm supply-chain attack on the axios package, the question arises: is Anthropic’s release hygiene fit for a company whose tools shape the very code we write?

Five days prior, a CMS misconfiguration exposed 3,000 internal files detailing the unreleased “Claude Mythos” model-another human error. Two significant disclosures in less than a week. A pattern, perhaps, or merely the whimsy of fate?

Was the Claude Code source code leak a hack?

Nay, Anthropic confirmed it was but a packaging error, no breach of security, no unauthorized access.

  • Q: What was actually exposed in the Anthropic npm leak? Some 512,000 lines of TypeScript, a panorama of the Claude Code CLI, including telemetry, feature flags, hidden features, and agent architecture-yet no model weights, no customer data.
  • Q: Is my data at risk from the Claude Code npm incident? Anthropic assures no user data or credentials were exposed; yet, developers who installed via npm during the axios attack window should audit dependencies and rotate credentials, lest they dance with danger.
  • Q: Has Anthropic leaked source code before? Indeed, a similar source-map leak occurred in February 2025, making this the second such incident in roughly 13 months. A recurring motif, one might say.
  • Read More

    2026-04-01 03:58