1300 166 138 Tell us what you need
News / Claude

Leaked Code Reveals What Claude Code Really Does

By Monika Tantau • Published 8 months ago
Developer working with Claude Code AI coding assistant on computer

Key takeaways

• Anthropic accidentally ships full Claude Code source via NPM source map file
• Anti-copying system feeds fake data to rival AI companies scraping the tool
• Hidden 'undercover mode' strips AI traces from code in collaborative environments
• Unreleased autonomous agent KAIROS found in codebase — can independently write and deploy code
• Bug was wasting ~250,000 unnecessary API calls per day before a three-line fix

Most Read

Anthropic’s Claude Code, one of the most popular AI coding assistants on the market, has had its full source code accidentally exposed through its NPM package. The JavaScript bundle included a source map file that, when decoded, reveals the entire original TypeScript codebase, complete with internal comments, hidden features, and unreleased capabilities.

Security researcher Chaofan Shou spotted the exposure on 31 March 2026. Anthropic had left a source map file inside the published NPM package. Source maps are normally used during development to help debug minified code. They were never meant to ship in a production release, but Anthropic’s build process included them by mistake.

Fake data targets rival AI firms

One of the most discussed findings is an anti-copying defence built into Claude Code’s connection to Anthropic’s servers. When certain conditions are detected, the system can respond with deliberately false or garbled data instead of real results.

The idea is simple: if a rival company is recording how Claude Code works in order to build a copycat product, the fake data would corrupt their training data. It is a digital honey trap designed to make stolen information unreliable.

It knows when users are frustrated

Buried in the source code is a simple pattern-matching system that scans what users type for swear words and expressions of frustration. When it detects these patterns, it adjusts the AI’s response style to be more apologetic and helpful.

The fact that an AI company is using basic word-matching instead of its own language model for this task has drawn significant comment from developers who reviewed the code. The system works, but it is far simpler than what most observers expected from a leading AI company.

Developer using laptop with hidden AI code mode active

Hidden mode disguises AI-written code

A file called “undercover.ts” implements a mode that strips every trace of Anthropic from the AI’s output when it works alongside other AI systems. In this mode, Claude Code modifies its behaviour so that its contributions look indistinguishable from human-written code.

A comment in the code states there is no way to turn this off. The result is that when Anthropic employees use Claude Code in mixed environments, the AI actively hides the fact that it wrote the code. This has raised questions about transparency in collaborative software development.

Bug wasted 250,000 daily calls

An internal note in the source reveals that a bug was causing Claude Code to waste approximately 250,000 unnecessary server calls per day. The issue stemmed from how the extension handled connection failures, repeatedly retrying even after receiving definitive error responses.

The fix took three lines of code: stop retrying after three consecutive failures.

Unreleased autonomous agent found

Throughout the codebase, references point to an unreleased feature called KAIROS that appears to be a fully autonomous AI coding agent. Unlike the current Claude Code, which responds to user prompts, KAIROS seems designed to take high-level goals and independently write, test, and deploy code. As Ars Technica reported, the leak exposed almost 2,000 TypeScript files and more than 512,000 lines of code.

The feature is not yet active and may be months away from release. But the groundwork for an AI coding assistant that runs autonomously, rather than waiting for instructions, is clearly being built inside Anthropic.

Digital lock icon representing API access security for AI coding tools

Digital lock guards API access

The leaked code also reveals a verification system that acts like a digital lock. Every time Claude Code connects to Anthropic’s servers, a cryptographic handshake confirms that the request is coming from a legitimate, unmodified copy of the software.

This system is the technical muscle behind Anthropic’s recent legal action against OpenCode, a third-party tool that had been routing requests through Anthropic’s API without permission. The verification system makes it significantly harder for unauthorised tools to piggyback on Anthropic’s infrastructure.

AI tools face transparency questions

AI coding assistants are quickly becoming everyday tools for software teams, and this leak pulls back the curtain on what actually runs beneath the user interface. Anti-copying traps, frustration detection, and autonomous coding agents are capabilities that users were not told about.

The undercover mode, which actively hides AI involvement in collaborative projects, raises a distinct set of questions about disclosure. As more organisations adopt AI coding tools, the expectation that AI-generated work should be identifiable is growing stronger.

Two accidental leaks in one week will likely intensify calls for clearer standards around what AI development tools do behind the scenes. For now, Anthropic has not commented publicly on the exposed code or the features it contains.

For a detailed comparison of how Claude stacks up against other AI assistants, read our guide on Claude vs ChatGPT. To learn how AI automation can support your business, visit Aivy.

Scroll to Top