Habr AI→ original

Anthropic Accidentally Leaked Claude Code Source Code via npm Source Map

Anthropic accidentally exposed Claude Code source code through source maps in its npm package. The leak revealed far more than expected: a multi-agent mode…

AI-processed from Habr AI; edited by Hamidun News
Anthropic Accidentally Leaked Claude Code Source Code via npm Source Map
Source: Habr AI. Collage: Hamidun News.
◐ Listen to article

Anthropic accidentally exposed Claude Code's source code through .map files in a published npm package. The leak provided a rare glimpse into the internal architecture of one of the most prominent AI tools for programming and showed how many features the company still keeps behind feature flags.

How the leak happened

The scheme turned out to be mundane: source map files ended up in the package—files normally needed by developers for debugging. Inside such files, not only a mapping between the compiled bundle and source code is stored, but also the texts of the original files themselves in the sourcesContent field. If such .

map files aren't excluded from publication through .npmignore or build settings, anyone can extract the real source code. According to analysis, exactly this happened with Claude Code, compiled via Bun, where source maps need to be explicitly disabled.

Because of this, not a trimmed release client went out, but practically the entire internal codebase of the CLI: a large main.tsx, dozens of tools, system prompts, feature flags, and utility subsystems. The most ironic moment is that inside they found a special Undercover Mode that was supposed to protect Anthropic's internal information in public commits.

That is, the company thought through masking for the model's communication with the external world, but stumbled at the most ground-level stage—npm package packaging.

What was found inside

The contents of the leak show that the public Claude Code is noticeably more modest than the internal version. In the code, modes and services were discovered that are either hidden behind compile-time flags or only available to Anthropic employees. We're not talking about cosmetic switches, but rather fairly mature mechanics: persistent proactive assistant, remote planning sessions, background memory processes, and orchestration of multiple agents. In essence, the leak revealed not only the product implementation, but also its roadmap: you can see which features are already built, how they're called internally, and what limitations are imposed on them.

  • Buddy — a terminal companion in the spirit of Tamagotchi with ASCII animation, rarity, "soul," and procedural parameters.
  • KAIROS — an always-on assistant that maintains logs, receives ticks, and can act proactively without waiting for a command.
  • ULTRAPLAN — offloading complex planning to a remote 30-minute CCR session on Opus 4.6 with result confirmation in a browser.
  • Dream — a background memory consolidation system that periodically rereads logs and updates memory files through strict phases.
  • Coordinator Mode — a multi-agent mode where one agent assigns tasks and several workers research, implement, and verify changes in parallel.
"Parallelism is your superpower."

Separately noteworthy is the cover mode for Anthropic employees working in public repositories. It prohibits mentioning internal code names, unreleased model versions, service links, and even the fact that an AI could have prepared the changes. Additionally, the leak exposed hidden API beta headers, internal code names like Tengu and Fennec, as well as a wider set of tools than a regular user sees. All of this shows: inside Claude Code, they've been building not just a CLI for a long time, but a full-fledged agent platform with memory, a swarm of executors, and different modes of autonomy.

What this means

For the market, this is an important leak for two reasons. First, it clearly demonstrates how rapidly AI tools for development are evolving beyond public releases. Second, it reminds us that even a strong engineering team can make a simple supply chain misstep when publishing a package. In the case of Claude Code, the source code told more than any presentation: Anthropic already has groundwork for proactive assistants, deep planning, and multi-agent work. And at the same time, it's a warning for everyone distributing AI products through npm: feature flags and internal rules won't save you if raw sourcesContent leaks out.

ZK
Hamidun News
AI news without noise. Daily editorial selection from 400+ sources. A product by Zhemal Khamidun, Head of AI at Alpina Digital.

Want to stop reading about AI and start using it?

AI News is a curated feed of AI/tech news. Hamidun Academy teaches you to use AI systematically in your work.

What do you think?
Loading comments…