Anthropic employee error exposed Claude Code source code through npm package

by

An Anthropic employee accidentally exposed the proprietary source code for Claude Code by including a source map file in a version of the AI programming tool posted to the company’s npm registry account, according to a technical analysis. The mistake did not involve customer data or credentials, and Anthropic said it was a release packaging issue caused by human error.

KEY FACTS

  • Exposure A source map in an npm package made the original Claude Code source accessible.
  • Company response Anthropic said no sensitive customer data or credentials were involved.
  • Risk Experts said source maps can reveal code logic, comments, prompts and possible secrets.
  • Pattern Reports said a similar incident happened last month.

Source map files are meant to help developers debug minified JavaScript or TypeScript code by linking it back to the original source. When they are left in production packages, they can expose internal constants, comments and other implementation details.

Security researcher Chaofan Shou drew attention to the issue on X after posting a link to the file in the npm registry. The disclosure said Claude Code used Bun’s bundler, which generates source maps by default unless they are turned off.

Secure coding trainer Tanya Janca said leaving source maps in a package is a common mistake, but the stakes are higher when the code contains valuable intellectual property. She advised disabling source maps in production builds, excluding map files from package settings and CI/CD artifacts, and separating debug and production releases.

Anthropic said it was rolling out measures to prevent a repeat. The company described the incident as a packaging issue rather than a security breach.

WHY IT MATTERS

Source code exposure can help attackers study how a system works and search for weaknesses more quickly than by reverse engineering compiled code. In AI tools, that can matter because prompts, workflows and access controls may reveal how the system behaves under different conditions.