The Claude Code Source Leak: fake tools, frustration regexes, undercover mode
13 hours ago
- #AI Security
- #Product Development
- #Source Code Leak
- Anthropic accidentally exposed the source code of its Claude Code CLI tool via a .map file on npm, which was quickly mirrored and discussed on Hacker News.
- Key findings include anti-distillation mechanisms using fake tools and server-side summarization to poison training data for competitors, though these are easily bypassable.
- An undercover mode prevents Claude Code from revealing internal codenames or that it's AI in external projects, raising concerns about AI-authored commits appearing human.
- Frustration detection is implemented with regex patterns for efficiency, contrasting with typical LLM approaches.
- Native client attestation uses cryptographic hashes to verify requests from legitimate binaries, supporting legal actions against third-party API use.
- A bug causing ~250,000 wasted API calls daily was fixed by limiting consecutive autocompact failures to three.
- References to an unreleased autonomous agent mode called KAIROS reveal product roadmap details, including background tasks and GitHub integrations.
- Other notable aspects include an April Fools' joke with Tamagotchi-style companions, optimized terminal rendering, extensive bash security checks, and prompt cache economics.