Claude Code's Source Got Leaked. Here's What's Worth Learning
On March 31, 2026, Claude Code npm 2.1.88 shipped a 59.8MB source map, exposing about 1,900 TypeScript files and 512,000 lines of the agent harness.
By Dillip Chowdary • Oct 27, 2026 • Source: thoughts.jock.pl

At a glance
- Version
- 2.1.88
- Shipped
- March 31, 2026
- Source map
- 59.8MB
- Exposed code
- about 1,900 files and 512,000 lines
- Feature flags
- 44
- Mirror stars
- 84,000+ in under two hours
In this post
The leak write-up has architecture numbers and no model-launch flags, so the article will use only those facts, including a before/after table and the install warning the source actually names.On March 31, 2026, Claude Code npm package version 2.1.88 shipped with a 59.8MB source map, according to thoughts.jock.pl's report. Source maps are debug artifacts that Bun, the runtime Claude Code uses, generates by default, and this package was missing a *.map line in .npmignore.
The map referenced unobfuscated TypeScript on Anthropic's Cloudflare R2 bucket: about 1,900 files and 512,000 lines, plus 44 feature flags. A GitHub mirror reached 84,000+ stars in under two hours, the fastest-growing repository in GitHub history.
Pawel Jozefiak, writing in Digital Thoughts on April 1, 2026, spent a night reading that code and building from it. The account is for people who make AI agents and want the harness: how Claude Code manages tools, memory, context, permissions, and multi-agent coordination.
Anthropic confirmed a packaging error. Customer data, credentials, user conversations, API keys, and model weights were absent, so the files cannot run a separate Claude.
01What shipped
The tree also includes Undercover Mode, built so Anthropic employees would not accidentally leak internal details into public repositories, and it left with the CLI source. Jozefiak says this is not a traditional security breach. It is a build artifact that should have been excluded, the kind of mistake a team shipping fast can make.
The tree also includes Undercover Mode, built so Anthropic employees would not accidentally leak internal details into public repositories, and it left with the CLI source. Jozefiak says this is not a traditional security breach. It is a build artifact that should have been excluded, the kind of mistake a team shipping fast can make.
Anthropic pulled the npm package, took the Cloudflare R2 bucket down, and has been mass-sending DMCA takedowns. Roadmap exposure during IPO preparation would be too costly, he says. Theo from t3.gg put it this way: "if you think this was intentional, I have a couple bridges for sale." Staff chasing higher rate-limit hits may have shipped source maps for error logs and forgotten to remove them.
Anthropic pulled the npm package, took the Cloudflare R2 bucket down, and has been mass-sending DMCA takedowns. Roadmap exposure during IPO preparation would be too costly, he says. Theo from t3.gg put it this way: "if you think this was intentional, I have a couple bridges for sale." Staff chasing higher rate-limit hits may have shipped source maps for error logs and forgotten to remove them.
02What improved
Jozefiak calls the three-layer memory the main architectural discovery. MEMORY.md is an always-loaded index of pointers, each entry under 150 characters.
Topic files hold the detail and load when the index marks them relevant. Raw transcripts are never re-read in full.
The agent greps them for identifiers. Skeptical memory treats a note as a hint, not a fact.
The agent confirms that a function exists, and verifies a path, before it acts. That is his check on context entropy, when stale notes fill a long session.
| Comparison | Without this pattern | In the leaked Claude Code source |
|---|---|---|
| Input tokens for five workers | 5× the input token cost | Pay once for the shared prefix, then only the task-specific branch |
| MEMORY.md entry | Stale notes fill the live context | Pointer under 150 characters, always loaded |
| Memory after consolidation | Unbounded across sessions | Under 200 lines and 25KB |
| Unchanged file, second read | Read the file again | Skip the read and use the cached version |
| Large tool result | Full payload returned to the model | Full result on disk; preview plus a file reference |
03What you gain
The leak shows 40+ discrete tools, each behind a permission gate, and every operation goes through a PermissionGate. Tool.ts, the largest file, is roughly 29,000 lines of tool types and permission schemas.
If a file has not changed since the last read, the read is skipped and the cached copy is used. Most agent setups skip that check, he says, so the token savings compound.
A large codebase search is written to disk in full. Context gets a preview plus a file reference.
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
On every turn change, when the model finishes and the user sends a new message, CLAUDE.md is reinserted beside that message, not at the top of the history. The instructions stay after the system prompt scrolls away.
Five separate worker contexts would cost five times the input tokens. A shared prompt-cache prefix is paid once, and only the task-specific branch is extra. He says that leftover cost is still brutal.
Five separate worker contexts would cost five times the input tokens. A shared prompt-cache prefix is paid once, and only the task-specific branch is extra. He says that leftover cost is still brutal.
04How to get it
The source imports internal workspace packages that are not on npm, and someone registered those names with a disposable email. A blind npm install in the clone can pull malicious code. Bun writes source maps by default, and .npmignore on this publish did not list *.map.
The source imports internal workspace packages that are not on npm, and someone registered those names with a disposable email. A blind npm install in the clone can pull malicious code. Bun writes source maps by default, and .npmignore on this publish did not list *.map.
# warned against inside a cloned mirror
npm install# .npmignore line missing from the 2.1.88 publish
*.mapJozefiak has run his own agent for months on a dedicated Mac Mini, 24/7, with working memory that rolls over on a schedule and a permanent index across sessions. The leak matched that split.
He is adding its check: confirm a remembered function or path in the codebase before acting. autoDream waits 24 hours, needs at least five sessions and a lock, then prunes memory under 200 lines and 25KB. Each MEMORY.md entry stays under 150 characters, and transcripts are only grep'd for identifiers.
# MEMORY.md — core index, always loaded
# each entry under 150 characters
# topic files fetched on demand
# raw transcripts: grep for identifiers only# services/autoDream/ — forked subagent, read-only on the project
# gates: 24 hours since last run; at least 5 sessions; consolidation lock
# phases: orient, gather, consolidate, prune
# prune cap: under 200 lines and 25KB05What to watch next
Coordinator Mode stays unreleased. One Claude agent leads, workers run in parallel, and each worker has an isolated context plus restricted tool permissions.
They send XML-structured task notifications and share a scratchpad directory. The coordinator prompt says "parallelism is your superpower." They share a prompt cache so five workers do not each pay a full input context, and Jozefiak still calls the cost math brutal.
The 512,000 lines include no model weights. Undercover Mode shipped in that same public package.
Bun generates those maps unless *.map is excluded. He would keep an index under 150 characters, consolidation after 24 hours and five sessions, and memory under 200 lines and 25KB. He had already landed on that shared-prefix pattern himself.
Bun generates those maps unless *.map is excluded. He would keep an index under 150 characters, consolidation after 24 hours and five sessions, and memory under 200 lines and 25KB. He had already landed on that shared-prefix pattern himself.
Frequently asked questions
Did Claude Code npm version 2.1.88 leak customer data or API keys?
No. Pawel Jozefiak writes that customer data, credentials, user conversations, and API keys were not in the package. Anthropic confirmed a packaging error. The files are CLI source, not a database.
Were Claude model weights included in the source map?
No. The leak is the software harness around Claude, covering tools, memory, context, permissions, and multi-agent coordination. Jozefiak writes that you cannot run your own Claude from it.
What is autoDream in the leaked Claude Code source?
autoDream, under services/autoDream/, is a background consolidation engine. It forks a read-only subagent only after 24 hours, at least five completed sessions, and a free consolidation lock, then prunes memory to under 200 lines and 25KB.
How does Claude Code's three-layer memory work?
MEMORY.md is an always-loaded index of pointers, each under 150 characters. Topic files load on demand. Raw transcripts are grep'd for specific identifiers and are never re-read in full. The agent verifies memories against the codebase before acting.
Is it safe to npm install a GitHub mirror of the leaked Claude Code repo?
Jozefiak warns against it. The source imports internal workspace packages that are not on npm, and someone registered those names with a disposable email, so a blind npm install can pull malicious code. Anthropic has pulled the original package.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement