Claude Code's source code has been leaked via a map file in their NPM registry
TL;DR Highlight
Claude Code's source leaked via a source map file in its npm package.
Who Should Read
Developers who publish CLI tools to npm or want to learn from coding agent architecture
Core Mechanics
- Leaked through a map file on npm
- In an X post on March 31, 2026, Chaofan Shou said Claude Code's source was leaked via a map file in the npm registry.
- The post links a src.zip download.
- Post hit 35.9M views
- The post went up at 8:23 AM on March 31, 2026 and shows 35.9M views.
- The source has no further technical analysis.
- Copies spread to GitHub
- Sigrid Jin said they backed the source up to their GitHub.
- The repo is linked as ultraworkers/claw-code.
Community Reactions
- Opinion that feature flags expose the roadmap
- One comment pointed to an unreleased "assistant mode" codenamed kairos.
- Others found a Buddy System (Tamagotchi-style) and Undercover mode that strips internal info from commits and PRs.
- Analysis of a 3,167-line function in print.ts
- A comment cited 12 nesting levels, about 486 cyclomatic complexity, and 12 parameters.
- The commenter said it should be at least 8 to 10 modules.
- Comment about an ANTI_DISTILLATION_CC flag
- When enabled, it adds anti_distillation: ['fake_tools'] to API requests so the server slips decoy tool definitions into the system prompt.
- The commenter read it as a way to poison training data from scraped traffic.
- Pushback on whether it matters
- Some said Codex and gemini CLI are already open source, so there's no moat.
- Others said what those vendors open-sourced is an Agents SDK, not the internals of their flagship agents.
- Note on npm deprecate vs unpublish
- A comment said the version was marked deprecated with the message "Unpublished" instead of being unpublished.
- It explained that deprecate leaves the package in the registry.
How to Apply
- Check your package for .map files
- Today, run npm pack --dry-run and look for *.map in the file list.
- If any appear, disable sourcemap output or exclude them via .npmignore or the files field.
- Add a pre-publish artifact check to CI
- Inspect the tarball right before publish and fail if .map files or a src folder are present.
- Write a recall procedure for bad releases
- npm deprecate leaves the package available, so confirm in advance whether and when you can unpublish.
- Rotate any keys or internal URLs that were in the code immediately.
Try It
# Run in shell: check whether the package to be published includes source maps
npm pack --dry-run 2>&1 | grep -E '\.map$' && echo 'Source maps found: remove before publishing' || echo 'No source maps'Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques
Related Resources
- https://twitter.com/Fried_rice/status/2038894956459290963
- https://github.com/ultraworkers/claw-code
- https://www.npmjs.com/package/@anthropic-ai/claude-code
- https://github.com/chatgptprojects/claude-code/
- https://github.com/instructkr/claude-code
- https://daveschumaker.net/digging-into-the-claude-code-sourc...
- https://news.ycombinator.com/item?id=43173324
- https://news.ycombinator.com/item?id=47582220
- https://claudebuddychecker.netlify.app/
- https://malus.sh/