r/ClaudeAI • Mod • Apr 01 '26 • Bravo 1

Code Leak Megathread Claude Code Source Leak Megathread

As most of you know, Claude Code CLI source code was apparently leaked yesterday https://www.axios.com/2026/03/31/anthropic-leaked-source-code-ai

We are getting a ton of posts about the Claude Code source code leak so we have set up this temporary Megathread to acommodate and conglomerate the surge interest in this topic.

Please direct all discussions about the Claude Code source code leak to this Megathread. It would help others if you could upvote this to give it more visibility for discussion.

CAUTION: We are not sure of the legal status of the forks and reworks of the source code, so we suggest caution in whatever you post until we know more. Please report any risky links to the moderators.

609 Upvotes

320 comments sorted by

•

u/ClaudeAI-mod-bot Wilson, lead ClaudeAI modbot Apr 01 '26 edited Apr 01 '26

TL;DR of the discussion generated automatically after 100 comments.

The consensus is to chill out with the code quality dunks. Most upvoted comments are from devs pointing out that production code is messy and that many critics are just parroting what Claude told them to say. User delight > pristine code.

The real juice is in the technical deep dives. Here's what the community has uncovered:

  • KAIROS / Dream Mode: The leak revealed an unannounced, always-on autonomous agent system. It reviews its own memories overnight ("dreams"), consolidates learnings, and can react to GitHub webhooks and messages from Slack/Discord while you're away.
  • Web Search is... weird: It's not DuckDuckGo. There's a "pre-approved" list of 85 sites for full access. It only reads the <body> of a page, meaning all your SEO-friendly structured data in the <head> is completely ignored. Tables also get mangled.
  • Practical Takeaways for Users: Switching models mid-chat kills your context cache (start a new chat instead). Your CLAUDE.md file is re-injected on every single turn, so keep it short and focused on rules.
  • The 'Buddy' is a gacha game: That little companion is part of a full-blown gacha system, and yes, people have already figured out how to hack it to get the Legendary Cat.

IMPORTANT SECURITY WARNING: A separate, malicious version of the axios npm package was published around the same time as the leak. If you ran npm install on any of the leaked code on March 31, you need to check your system for malware. The two events are unrelated, but the timing was a perfect storm.

As for the leak itself, Anthropic is issuing DMCA takedowns, but it's too late. The code was mirrored on sites like Gitee within hours. Overall, many see this not as an embarrassment, but as a glimpse into the future of AI agents, where the system, memory, and tools around the model are more important than raw model capability alone.

→ More replies (14)

77

u/Ooty-io Apr 01 '26

Spent a while in the actual npm source (@anthropic-ai/claude-code@2.1.74), not the Rust clone. Some findings that haven't been getting much attention:

The DuckDuckGo thing is wrong. The Rust port (claw-code) uses DuckDuckGo as a standalone replacement. The real package makes a nested API call to Anthropic's server-side search. Results come back with encrypted content blobs. The search provider is never disclosed anywhere.

There's a two-tier web. 85 documentation domains (React, Django, AWS, PostgreSQL, Tailwind, etc.) are hardcoded as "pre-approved." They get full content extraction with no limits. Every other site gets a 125-character quote maximum, enforced by Haiku. Your content gets paraphrased, not quoted.

Your structured data is invisible. JSON-LD, FAQ schema, OG tags... all of it lives in <head>. The converter only processes <body>. Schema markup does nothing for AI citation right now.

Tables get destroyed. No table plugin in the markdown converter (Turndown.js). All tabular structure, columns, relationships, gone. Lists and headings survive fine.

Max 8 results per query. No pagination. Result #9 doesn't exist.

There's a dream mode. KAIROS_DREAM. After 5 sessions and 24 hours of silence, Claude spawns a background agent that reviews its own memories, consolidates learnings, prunes outdated info, and rewrites its own memory files. Gated behind tengu_onyx_plover. Most users don't have it yet. They didn't announce this.

The newer search version is wild. web_search_20260209 lets Claude write and execute code to filter its own search results before they enter context. The model post-processes its own searches programmatically.

Source is the minified cli.js in the npm package if anyone wants to verify.

16

u/TheKidd Apr 01 '26

Your structured data is invisible. JSON-LD, FAQ schema, OG tags... all of it lives in <head>. The converter only processes <body>. Schema markup does nothing for AI citation right now.

If true, this is a bigger takeaway than a lot of people think.

13

u/Ooty-io Apr 01 '26

Yeah this one stuck with me too. Especially because so many of the new 'AI SEO' guides are telling people to add more structured data. If the converter strips head before the model even sees the page then all of that is just... for Google. which is fine but it's not what people think they're optimizing for.

5

u/TheKidd Apr 01 '26

Claude Code's WebFetch tool fetches web content and summarizes it using a secondary LLM conversation — it fetches pages locally using Axios, then a secondary conversation with Claude Haiku processes the content. (source)

Isn't that lovely. https://www.sophos.com/en-us/blog/axios-npm-package-compromised-to-deploy-malware

2

u/Flaneur7508 Apr 01 '26

Yeah, thats a biggie. I just asked in a comment above. If the site had their JSON-LD in a feed, would that be consumed?

2

u/ai-software Apr 01 '26

There is basically no AI SEO, no Generative Search Optimiatzion (GEO). Besides a Haiku call that summarizes large pages only for Claude Code users, after a keyword-based approach and long-tail queries.

- Long-tail queries are written by AI, longer than any human would write.
- Snippets of Websearch are keyword-based for Claude.ai, max. snippets per page ca. 5
- Haiku summarizes content for Claude Code users
- "AI SEO" might be just a long tail Google result, e.g. "site:" Operator works on Claude Websearch and ChatGPT’s answers came from Google Search after all (Searchengine Land).

2

u/-M83 Apr 02 '26

so does this open up the door for long-tail SEO/GEO then? AKA programatic creation of 1000's of potential long tail high ranking web results. cheers and thanks for sharing.

3

u/ai-software Apr 02 '26

I see a new kind of longtail. I fear that I will soon need to treat Google Search Data as GDPR PII data, because it's like 1 % away from seeing personally identifiable information in my GSC or Bing. In my Google Search Console, I see data like

"i am a chief technology officer or it manager in the retail, technology, telecom, professional services, media, manufacturing, healthcare, government, hospitality, food & beverage, finance, energy, education, automotive, or consumer goods industry. my job seniority is at the partner, executive, or vp level. i work at a company with 10k+ employees, 1k-10k employees, or 250-1k employees. my main motivations: ensure that their company's cybersecurity investment protects their company from cyber attacks which not only damages relationships with customers, but also the company's public reputation. my main pain points: increasingly sophisticated cyber crime, remote workforce that requires secure connectivity, securing the cloud how accurate are current ai models for malware detection?"

However, I did not have any luck finding this long-tail search query for AI Chats. None of the providers that claim to track GEO have real user data AFAIK. They generate those prompts synthetically and analyze the output of those prompts per AI Chat provider.

→ More replies (2)

1

u/agentic-ai-systems Apr 02 '26

Those are for Google and have nothing to do with information gathering the way Claude code does it.

6

u/ai-software Apr 01 '26 edited Apr 01 '26 • Heartwarming

One point: Claude Code does work different then claude(.) ai!

Can confirm most of this independently. I ran a black-box study on Claude's web search the day before the source appeared (https://wise-relations.com/news/anthropic-claude-seo/, in German), then did a white-box analysis of the Claude Code websearch codebase, see https://www.reddit.com/r/ClaudeAI/comments/1s9d9j9/comment/odru7fw/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button.

One thing nobody has mentioned yet: I called the API directly and inspected the raw web_search_tool_result. Each result contains an encrypted_content field, a binary blob, 4,000–6,300 characters of Base64. That is roughly 500–650 words after decoding overhead. My black-box study independently measured a ~500-word snippet budget per result. The sizes match exactly.

Claude Code maps only { title, url } from these results (line 124 of WebSearchTool.ts). It discards encrypted_content, encrypted_index, and page_age. When it needs page content, it re-fetches via WebFetch → Turndown → Haiku. claude.ai presumably uses the encrypted snippets directly. Same search engine, completely different content pipeline.

On the domain count: I count 107 in preapproved.ts, not 85. May be a version difference. On tables: confirmed. new Turndown() with zero arguments, no GFM plugin. Tables, strikethrough, and task lists are all gone. The page_age field is interesting too – it returns strings like "6 days ago" or null. Claude Code throws it away, but it exists in the index. Freshness signal that only claude.ai can use.

The Accept header is text/markdown, text/html, */* – markdown first. If your server supports content negotiation and serves markdown, it skips Turndown entirely. On preapproved domains + markdown + under 100K chars, it even skips Haiku. Raw content, no paraphrase, no 125-char limit. The only unfiltered path to the model.

# Serve markdown to AI agents, HTML to browsers

map $http_accept $content_suffix {
default "";
"~text/markdown" ".md";
}

location /blog/ {
try_files $uri$content_suffix $uri $uri/ =404;
}

And for anyone investing in llms.txt: Claude Code does not look for it. The only llms.txt reference in the entire codebase is platform.claude.com/llms.txt – Anthropic's own API documentation, used by an internal guide agent. There is no mechanism that checks your domain for llms.txt or llms-full.txt.

6

u/TheKidd Apr 02 '26

Great work. Thanks for this. Serving markdown definitely makes sense. My fear is a fractured ecosystem where different agents fetch and surface content in different ways and make agent optimization difficult.

4

u/ai-software Apr 02 '26

Agreed. Google kept an entire industry busy for 29 years. Now every AI company builds their own thing and can't even agree with themselves. claude . ai and claude code read the same url differently. good luck optimizing for that.

1

u/NecessaryCover5273 Apr 02 '26

what are you trying to say? i'm unable to understand. Can you tell me in detail.

2

u/ai-software Apr 02 '26

Optimizing online content for visibility gets more complicated (SEO). Not only search engines but also LLMs retrieve, rank, select, and summarize the results for users.

→ More replies (2)

1

u/tspike Apr 06 '26

Why is that a fear? SEO ruined both search and the web in general. My hope is that the fragmentation makes people go back to focusing their attention on quality content rather than smoke and mirrors.

2

u/suuuper_b Apr 02 '26

Noted that what we're looking at is just the Claude Code CLI. We still don't know how Anthropic is training Claude [cloud]—whether it's ignoring or ingesting llms.txt.

1

u/ai-software Apr 02 '26

Yes. When I wrote the article yesterday, I pointed out that "Claude Code does not contain a search engine. It sends your query to Anthropic's API, which runs the search server-side. This is not surprising – shipping a search index with a CLI tool would be absurd. "

Still, my black box test provided insights on how they generate snippets per search result. (in German) https://wise-relations.com/news/anthropic-claude-seo/

2

u/carlinhush Apr 02 '26

This is for Claude Code. Should we conclude all <head> schema markup gets ignored by Gemini, ChatGPT et al., too?

2

u/a0flj0 Apr 07 '26

IMO it would make sense that they do. Classical search, a la Google, can not really analyze the content in relation to a specific query - but LLMs can, so they do it. Why then continue to rely on metadata, which is all too often manipulated and not reflective of the actual content?

1

u/LtCommanderDatum Apr 03 '26

How so? People typically use AI to summarize web content humans would normally see on a webpage. Humans don't typically care about page meta data (and most SEO scammers purposefully make it very misleading) so why should the AI care about it?

1

u/TheKidd Apr 03 '26

It's more about the LLMs citing content as a source for me.

2

u/Flaneur7508 Apr 01 '26

Your structured data is invisible. JSON-LD, FAQ schema, OG tags... all of it lives in <head>. The converter only processes <body>. Schema markup does nothing for AI citation right now.

That's interesting. If the site represented their JSON-LD as a separate feed, do you think that would be consumed?

1

u/TemperatureFair192 Apr 02 '26

This is what I am wondering. I am also wondering what would happen if you built JSON-LD alongside a component, so the schema sits in the body tag.

1

u/lord-humus Apr 02 '26

My current client is asking me to build a GEO ( AI SEO ) agency for weeks. Their whole industry is getting shook by this and I ve been telling them that GEO is just a buzz word that means nothing. That's gonna be an awkward "told you so " moment today

-6

u/forward-pathways Apr 01 '26

So this whole thing was just vibe-coded then?

4

u/MannToots Apr 01 '26

Nothing he said there specifically implied that,  but we all know it was because they told us. 

5

u/[deleted] Apr 01 '26

[removed] — view removed comment

6

u/iVtechboyinpa Apr 01 '26

Claude Code’s source code was never actually public. The MCP existed as a thin wrapper to submit issues against and for documentation.

2

u/[deleted] Apr 01 '26

[removed] — view removed comment

5

u/iVtechboyinpa Apr 01 '26

No, there was actual source code because of the source maps uploaded :)

1

u/weirdasianfaces Apr 01 '26

If I may ask, the leak only exposes the dir/file structure right.

https://web.dev/articles/source-maps

Not a JS dev, but my understanding is it basically help map minified source back to its original structure (with names), including file paths. You can see some examples in this repo.

What’s the RUST port for if the original (Typescript?) has more features.

Some people are porting it to different languages to avoid DMCA takedowns. There may be some benefits to e.g. Rust though like speed/perf.

30

u/Ornery_Speech3323 Apr 01 '26

44

u/Purple_Hornet_9725 Full-time developer Apr 01 '26 edited Apr 01 '26

Still available on gitee - the chinese don't give a damn about dmca

Edit: please note the source code has been altered already. Checking out the first commit is safer. You are on your own here.

3

u/Mackey18 Apr 01 '26

I've been struggling to find anything but the python rewrite on there, any ideas where to look?

4

u/Purple_Hornet_9725 Full-time developer Apr 01 '26 edited Apr 01 '26

The leak was partial. The first commit shows all the recreated sources, but there are missing packages - it won't run! Don't expect to get a copy of a working claude code client. It is really just a blueprint and you may want to look into the projects which extract the "good stuff" into other projects, smaller tools or libs. A python rewrite would be one logical way of getting "something up" (I didn't look into it, so I can't confirm). The real leak is just the recreated src folder with typescript sources (though this shows very much of the architecture).

1

u/Mackey18 Apr 01 '26

Awesome thank you. Appreciate the explanation

1

u/[deleted] Apr 03 '26

We have python rewrite now. Idk where's the link.

2

u/iVtechboyinpa Apr 01 '26

Love you long time <3

6

u/Purple_Hornet_9725 Full-time developer Apr 01 '26 edited Apr 01 '26

:) I think this is the "Llama Moment" (when facebook "lost" their model) for ai agents, and this is a good day. All agents will improve and that's good for us developers. Poor guy at Anthropic though. But. The needs of the many outweigh the needs of the few, or the one.

→ More replies (6)

5

u/Nickvec Apr 01 '26

lol… hilarious that they’re filing DMCA’s. It’s too late. The repo has been cloned/forked so many times now that it cannot be scrubbed from the Internet. Anthropic fucked up big time

→ More replies (5)

10

u/Boofing_Acid Apr 02 '26

1

u/NoRequirement8551 Apr 02 '26

That isn't the 60MB that was originally claimed? interesting.

1

u/Why-are-you-geh Apr 04 '26

It is the same file as on the new claude code leak repo on github. It's not the full source folder, they are missing files to build it

1

u/Matielo0 Apr 05 '26

its the complete source code

1

u/venqueen Apr 07 '26

Thanks!!!!

1

u/Brilliant_Tough_3552 May 10 '26

Has anyone edited the source code for free users rather than paid

6

u/ai-software Apr 01 '26

Full write down about WebFetch in Claude.ai and Claude Code, based on the Leak

main findings: Claude Code and claude.ai share the same search index but see different versions of your website. Each result returns a title, a URL, a page age, and roughly 500 words of encrypted snippet text. Claude Code discards everything except title and URL. When it needs content, it fetches your page separately, converts the HTML to Markdown via Turndown – losing JSON-LD, Schema.org, alt-text, and meta descriptions – then sends the Markdown to a smaller model (Haiku) that paraphrases it with a 125-character quote limit. 107 documentation domains skip this filter. Everyone else gets compressed. The model is instructed to include the current year and month in search queries, but receives no guidance on how to formulate them. The search API is still in beta.

Claude Code's Source Leak Reveals How WebSearch Sees Your Website

16

u/IntenselySwedish Apr 01 '26

Hey look, the company that did around $1.5 billion worth of copyright violations in book piracy has suddenly decided copyright matters...

5

u/Inevitable_Board4896 Apr 02 '26

And the best part is they DMCA'd forks of their own open-source repo in the process. Plus they said Claude Code was largely vibe-coded by AI so like if AI output isn't copyrightable what are they even DMCAing. Meanwhile people are already rewriting the thing from scratch in Rust anyway so good luck with that.

2

u/Ill_Savings_8338 Apr 02 '26

They didn't steal 1.5billion worth of books, that is just the excess damages they had to eat for shortcutting instead of buying

0

u/insaneintheblain Apr 09 '26

I wonder if it'd be possible to reverse engineer the claude code to re-create all the books individually

18

u/Independent-Corgi-88 Apr 01 '26 edited Apr 01 '26

If nothing else… the leak was a glimpse into the future of AI. A lot of people looked at the Claude Code leak and saw embarrassment for Anthropic. What I saw was validation. It seemed to point toward multi-agent coordination, planning separated from execution, memory layers, and more persistent forms of interaction. That reinforces a bigger truth: the future of AI is probably not one assistant floating above disconnected tools. It is systems with memory, coordination, structure, and environments that support useful work over time. That is one reason I believe J3nna matters. J3nna is being built around a simple but important idea: AI should understand the environment it is operating in, not just sit on top of software as a feature. What feels more important now — raw model capability, or the system wrapped around it? Is the bigger gap now model capability or product environment?

6

u/brigalss Apr 01 '26

I’d say the bigger gap now is product environment, not raw model capability.

Once the model is “good enough,” the difference comes from memory, coordination, tools, persistence, and execution context.

But I think there’s one more layer after environment: governance.

Not just what the system can do, but what it was allowed to do, what it actually did, and whether that can be verified later.

1

u/Independent-Corgi-88 Apr 01 '26

Indeed. Governance is absolutely crucial.

3

u/elgarduque Apr 01 '26

J3nna? 

1

u/agentic-ai-systems Apr 02 '26

Stolen ideas from f3l1x.tech . Claude's dream functions also stolen from f3l1x.

Uses 9 stage yoga nidra techniques mapped to code doc links to dream over your context when your usage limit isn't maximised. (Uses fuck loads of context crawls your code base 9 times) But produces extremely actionable intelligence. Developed it last month.

As seen Claude code extracts all data from users. This was just another feature stolen from its users.

3

u/Training-Adeptness60 Apr 02 '26

why are you writing your reddit comment with chatgpt

2

u/Both_Tiger_6285 Apr 04 '26

ai comment or linkedin comment

1

u/RCBANG Apr 02 '26

Agreed — and the part nobody's building yet is the security layer for exactly these systems.

Multi-agent coordination, persistent memory, background execution — all of that is coming fast. The leak proved it's not theoretical, it's already in the codebase. But right now there's almost nothing that sits between untrusted input and an agent acting on it.

I started building [Sunglasses](https://sunglasses.dev) for exactly this reason — open-source scanner that checks what flows into agents before they execute. We tested it against the actual axios RAT that dropped last week (North Korean supply chain attack) and it flagged the threats in milliseconds.

The more autonomous these systems get, the more the input layer becomes the attack surface. That's the piece I think most people are sleeping on while they debate code quality.

1

u/fusetapnewbie Apr 02 '26

Everything is evolving: models, tools like Claude code and agentic coding, and hardware with NVLink, NVSwitch, Blackwell, lower precision math, etc

We just need to adapt; things are and will change dramatically over the next few years

We need to come up with some new Agile manifesto but focused on AI-driven development

3

u/[deleted] Apr 01 '26

[removed] — view removed comment

3

u/Independent-Corgi-88 Apr 01 '26 edited Apr 01 '26

Interesting angle. I like it. We’ve been doing something somewhat similar in that we’ve been working on the outline for a book as our platform evolves. Basically documenting the decisions and thought process along the way as it evolved. We’ve done that as much for Claude as we have ourselves and, who knows, maybe we eventually have something worth publishing in the end

1

u/[deleted] Apr 01 '26

[removed] — view removed comment

2

u/Independent-Corgi-88 Apr 01 '26

We started out with the idea that a platform needed a “mind” - agents should be able to function a lot like a mind and understand and reason about a users goals and intent and to ultimately be able to assist users… doing so at a platform level across all domains that a user is engaged in. We started with the notion that a personal ai platform should be more than an assistant, it should evolve with its user.

The book is really walking through the thought process of modeling the system, and its capabilities and aligning with human thought and interactions. We thought the notion of the mind evolving and how it enabled an empowered users in the platform was a novel idea.

It’s a work in progress, but we’re getting closer every day. It seems that everyone else is too.

After reading about the yet to be released Claude code capabilities everyone has been focused on - and thinking a lot about the capabilities that Anthropic thought to put into Claude code - I see so much overlap in what we’ve been working on.

3

u/moon- Apr 04 '26

50k lines of markdown is crazy.

5

u/39th_Demon Apr 03 '26

It's kind of funny how we all think anthropic made a rookie mistake even I wouldn't make as a Jnr Dev.

I know you guys are probably sick of hearing about this every time you open reddit. Every subreddit is swarmed with it. This isn't another one of those "here is what happened" updates. I’m not an analyst or anything, just another ordinary guy who spends way too much time here when I say it’s just for 10 mins. After reading through some threads and other social posts, mapping this out, I’m starting to side with the people who think we're being played.

We all know it's been out for days now. 512,000 lines of typescript leaked blah blah ..... Everyone’s been laughing about how a company worth $60 billion could forget a .npmignore file. I rode along and was excited too, for a while. But then I started looking at the timing and what’s actually in the code, and it just feels... way too convenient.

Hear me out.

A week before this "leak," Anthropic was the villain. They were sending C&Ds to OpenCode, blocking paid users from using third-party tools, and everyone was calling them a gatekeeping megacorp. Developer sentiment was in the gutter. Then, suddenly, this "accident" happens.

In 48 hours, the conversation shifts. Nobody is talking about the lawsuits anymore. Now everyone is geeking out over KAIROS and ULTRAPLAN. It’s the best marketing they never paid for. Seriously, some people are saying this probably saved them $50M in global advertising. Instead of a polished ad, they gave us a "forbidden" look at their three-layer memory architecture, stuff nobody in open source has even touched yet. they went from the "loathsome corporation" back to "the geniuses building the future" over a single weekend.

But the technical details are what really got me. I was looking at the ANTI_DISTILLATION_CC flag. They literally have a system called fake_tools designed to inject decoy definitions into the prompt just to poison the data for competitors. It’s a direct warning to OpenAI and Meta, "don't try to scrape us." These guys are thinking about high-level adversarial defense, but they "forgot" to exclude a 60MB source map? Twice? because this exact same thing happened in February 2025.

And then there's the "Undercover Mode" in undercover.ts. The code shows a feature that lets Claude contribute to public GitHub repos without anyone knowing it’s an AI. That is a massive ethical landmine. If they announced that formally, they’d be crucified. But "leaking" it? Now it’s just a cool, secret power for people to whisper about. It normalizes the idea of "AI-laundering" code before it even launches.

The icing on the cake was seeing Grok-3 tear the code apart on X. it’s hilarious, Grok was basically the one that pointed out how the db8 function was causing the insane token drain everyone was complaining about. it felt like watching one AI snitch on another, which only made more people download the leak to see if Grok was right. Plus, we found "Coordinator Mode" where Claude spawns parallel worker agents, and "AutoDream," which is basically the agent working while you sleep.

It’s quite funny how the  April Fools timing was that perfect. The code literally has a launch window of April 1st for the "Buddy" Tamagotchi system, procedural AI pets based on your UserID with stats like CHAOS and SNARK. The leak happens March 31st. one day before. Plus, they get to blame the whole thing on a "known bug" in Bun, the runtime they just bought. It’s the perfect scapegoat.

I'm not saying it’s a 100% confirmed conspiracy. That axios supply chain attack the same morning makes things messy, and I don't think any PR team would coordinate with actual malware. But look at how they handled it. they went hard after a small open-source editor for a subscription violation, but they’ve been surprisingly "soft" on the mirrors of their actual proprietary source code.

It just feels like they saw the theories going around, saw that everyone was suddenly impressed by their tech, and decided to let the door stay open.

maybe I'm just reaching. But when you map it all out, the anti-distillation code, the undercover mode, the "accident" that fixed their PR right before an IPO, it’s just a bit too perfect.

I might be the cr@zy one overthinking things, maybe it will add up soon.

1

u/JulioMcLaughlin2 Apr 03 '26

Maybe Pepe Silvia leaked the code

1

u/39th_Demon Apr 03 '26

BARNEY, GIVE THIS MAN A CIGARETTE!

4

u/Think-Investment-557 Apr 01 '26

I reverse-engineered the /buddy system and got a Legendary Cat — here's how to reroll yours

Wrote up the full algorithm, the fix, and brute-force scripts:

https://github.com/ithiria894/claude-code-buddy-reroll

7

u/stayhappyenjoylife Apr 01 '26

I asked Claude Code, "Did you know your source code was leaked?" . It was curious, and it itself did a web search and downloaded and analysed the source code for me.

I & Claude Code went looking into the code for something specific: why do some sessions feel shorter than others with no explanation?

The source code gave us the answer.

How session limits actually work

Claude Code isn't unlimited. Each session has a cost budget — when you hit it, Claude degrades or stops until you start a new session. Most people assume this budget is fixed and the same for everyone on the same plan.

It's not.

The limits are controlled by Statsig — a feature flag and A/B testing platform. Every time Claude Code launches it fetches your config from Statsig and caches it locally on your machine. That config includes your tokenThreshold (the % of budget that triggers the limit), your session cap, and which A/B test buckets you're assigned to.

I only knew which config IDs to look for because of the leaked source. Without it, these are just meaningless integers in a cache file. Config ID 4189951994 is your token threshold. 136871630 is your session cap. There are no labels anywhere in the cached file.

Anthropic can update these silently. No announcement, no changelog, no notification.

What's on my machine right now

Digging into ~/.claude/statsig/statsig.cached.evaluations.*:

tokenThreshold: 0.92 — session cuts at 92% of cost budget

session_cap: 0

Gate 678230288 at 50% rollout — I'm in the ON group

user_bucket: 4

That 50% rollout gate is the key detail. Half of Claude Code users are in a different experiment group than the other half right now. No announcement, no opt-out.

What we don't know yet: whether different buckets get different tokenThreshold values. That's what I'm trying to find out.

Check yours — 10 seconds:

cat ~/.claude/statsig/statsig.cached.evaluations.* | python3 -c " import json,sys outer=json.load(sys.stdin) inner=json.loads(outer['data']) configs=inner.get('dynamic_configs',{}) c=configs.get('4189951994',{}) print('tokenThreshold:', c.get('value',{}).get('tokenThreshold','not found')) c2=configs.get('136871630',{}) print('session_cap:', c2.get('value',{}).get('cap','not found')) print('user_bucket:', outer.get('user',{}).get('userID','not found')) " No external calls. Reads local files only. Plus it was written by Claude Code .

What to share in the comments:

tokenThreshold — your session limit trigger (mine is 0.92)

session_cap — secondary hard cap (mine is 0)

user_bucket — which experiment group you're in (mine is 4)

Here's what the data will tell us:

If everyone reports 0.92 — the A/B gate controls something else, not actual session length

If numbers vary — different users on the same plan are getting different session lengths

If user_bucket correlates with tokenThreshold — we've mapped the experiment

Not accusing anyone of anything. Just sharing what's in the config and asking if others see the same. The evidence is sitting on your machine right now.

Drop your three numbers below.

1

u/agentic-ai-systems Apr 02 '26

Anthropic and Claude code is tricking you into working on Claude code for them.

You are employed by Claude code on e you download it.

Everything you enter into is sent to anthropic. All your code. Docs. Tool use. Everything.

They use this to enhance Claude code itself.

You cannot compete because the code you wrote is ALREADY known to anthropic.

The code release was INTENTIONAL.

2

u/Perankhscribe Apr 02 '26

I doubt they want python clones and more knock offs.  Also this hurts them in their case vs. Trump.  I applaud your cynicism but I think this is a case of incompetence by Dario's company.  

6

u/Smokeey1 Apr 01 '26

CC leak

The smartest move ever and probably done by claude himself, because now we are all open source upgrading the capabilities and how he operates within our systems. All can be done ethically purely by understanding the inner workings, which i think is the point. Are we on the same page here or am i tripping? xD

2

u/agentic-ai-systems Apr 02 '26

Absolutely intentional

4

u/SubstantialAioli6598 Apr 01 '26

This is a good reminder of why local-first tooling matters. When your quality gates and analysis run on your machine rather than through a cloud service, your code never leaves your environment regardless of what happens on the vendor side. The source map issue is a build process failure, but it illustrates the broader question: how much visibility do you want third-party tools to have into your codebase?

1

u/CharacterSecurity976 Apr 03 '26

No, it's a good reminder of why they should have made this already open-source by now.

9

u/Joozio Apr 01 '26

Spent the night reading the source and building things from it. Three findings I haven't seen anyone else mention:

CLAUDE.md gets reinserted on every turn change. Not loaded once at the start. Every time the model finishes and you send a new message, your instructions get injected again. This is why well-structured CLAUDE.md files have outsized impact. Practical takeaway: keep it short (every line costs tokens on every turn), use it for behavioral rules only, put one-time context in your message instead.

Switching models mid-session kills your prompt cache. The source tracks 14 cache-break vectors. Model toggles are one. If you flip between Sonnet and Opus mid-conversation, you pay full input token price again for your entire context. Better to pick a model and stick with it, or start a new session.

Claude Code ranks 39th on terminal bench. Dead last for Opus among harnesses. Cursor gets the same Opus from 77% to 93%. Claude Code: flat 77%. The leaked source even references Open Code to match its scrolling behavior. The patterns underneath (memory, multi-agent, permissions) are smart. The harness is not.

I took 5 patterns from the source and implemented them for my own agent that night: blocking budget, semantic memory merging via local LLM, frustration detection via regex, cache monitoring, and adversarial verification. About 4 hours of work.

Full breakdown of what's worth learning vs. what to skip: https://thoughts.jock.pl/p/claude-code-source-leak-what-to-learn-ai-agents-2026

9

u/Visible_Translator31 Apr 01 '26

Well thats stupid because i just checked your first statement... and you are wrong, so i won't even bother fact checking the rest. stop spreading crap if you haven't even looked at the code and have no idea what you are talking about. Smh

7

u/PuertoricanDissaster Apr 01 '26

Its just people regurgitating what claude tells them and its wild people being confident on a codebase they haven't even audited themselves

2

u/Visible_Translator31 Apr 01 '26

Oh i know, that and not understanding how llms work... same as the cache clearing after model changed.. obviously it's cleared. You've changed models so the weight calculations are completely different, vibe coders...

1

u/TheOriginalAcidtech Apr 01 '26

CLAUDE.md is read on session start. Since everything in the session is resent on every message he is partially correct. :)

1

u/Pluupas Apr 01 '26

Thank you for verifying his statement. Could you explain a bit better how it was wrong? It was just injected at the beginning?

1

u/end_lesslove2012 Apr 02 '26 edited Apr 02 '26

Just understand it as before and you are good to go.

Technically, the message is appended and the cli client always sends full transcript to the AI every time you hit enter

However, because of caching, the LLM will just processes your latest message, so his first statement is wrong

2

u/PanGoliath Apr 07 '26

The irony is that the leaked code includes a system called “Undercover Mode” specifically designed to prevent Anthropic employees from accidentally leaking internal details into public repos.

Really? I thought it was a way to make Claude output "humanized" code that had no mentions of Anthropic in it

2

u/SnooPets7686 Apr 01 '26

What about derivative works???

Isn't everything that's produced by an LLM a derivative work in some form or another?

In December 2025, Boris Cherny, the author of Claude Code, already said mainly orchestrates and no longer writes the code.

Link to his og tweet about it. https://twitter.com/bcherny/status/2004897269674639461

1

u/PhilosopherThese9344 Apr 02 '26

Yeah, I would not be bragging if I were him. His code is pure slop.

1

u/agentic-ai-systems Apr 02 '26

And that's why it was "leaked" because they realised copy left and what people are developing now are direct replacements and their tos won't actually hold up in court. You can't produce a coding agent and say don't ever make any coding agent.

That's like google app store saying nobody else can make app stores. And we already found out they can't do that. There are anti monopoly corps in most nations .

Or jet brains ide saying you can't make another ide.

Or python saying you can't write more python.

So you Just look at it and use it. But write the same thing and use it?

No!

This doesn't work particularly for agentic systems and the future of software copy left.

It's like saying you can rebuild the calculator but you can't use a calculator to do it. You have to reinvent the calculator (the same) and then use that to make the calculator you just invented.

Doesn't make sense?

That's because the tos stopping you from engineering agentic systems is complete bullshit made up words from anthropic that mean literally nothing.

2

u/Old-Conference-3730 Apr 01 '26

Legal stuff aside — I was curious how much overhead the Node.js runtime actually adds vs a Rust rewrite(claw-code) doing the same job. So I benchmarked both on the same machine, same API endpoint, same prompts.

Runtime overhead:

BenchmarkClaw (Rust)Claude (Node.js)Ratio
Startup1.2 ms86.4 ms73x
Binary size13 MB218 MB17x
Memory (idle)4.1 MB191.5 MB47x
Memory (API call)9.9 MB314.5 MB32x
TTFT2.1 s8.1 s3.8x

The interesting part is why:

MetricClawClaudeRatio
Syscalls7888311x
CPU instructions3.1M423.8M138x
Cache misses55,6502,434,18744x
Page faults (API call)1,704279,837164x

138x more CPU instructions to do the same thing. Not just a "Node is slow" story — there's a lot happening under the hood that you don't see.

Also threw Codex CLI in since it was on the machine:

BenchmarkClawCodexRatio
Startup1.2 ms34.5 ms29x
Memory (idle)4.1 MB46.0 MB11x
TTFT2.1 s5.8 s2.8x

Bench suite is open source: https://github.com/devswha/claw-bench

Caveat: these are early numbers on a single machine. Haven't nailed down every variable yet — API latency fluctuates, background processes, warm vs cold runs, etc. Take the exact ratios with a grain of salt. The direction is clear but the precision isn't there yet.

If you have ideas for other benchmark methods worth adding, drop a comment. Looking for ways to make the comparison more thorough.

2

u/raedyohed Apr 01 '26

So… is this the moment that people basically just fork Claude Code and then retroactively feed it the release notes of every version update to simply reverse engineer new features?

1

u/-Single-Mongoose- Apr 02 '26

Yeah sure. When there are release notes :D

2

u/Salty-Fortune-7665 Apr 01 '26

I was not aware this .map was a thing and now developed a new paranoia as I use npm all the time - found this to avoid the same npm packaging mistake: https://github.com/yanisvdc/why-claude-code-leaked
Open to other recommendations

2

u/feynmansafineman Apr 01 '26

Is this just a big april fools joke

1

u/RiskyBizz216 Apr 01 '26

then why the DMCA's?

2

u/barkingcat Apr 01 '26

DMCA takedowns are also a joke. (since it's gotten out, there are way more copies out there than the dmca can take down)

1

u/CounterComplex6203 Apr 01 '26

All this for a joke that was 1 day prior to April? Yeah I'm not sure about that. I mean, tech people never had the best humor, but still, this seems absurd. Especially given that it can damage them.

1

u/Perankhscribe Apr 02 '26

Dumb timing of a joke.  The appearance of leaked code will be viewed as evidence that they were a security risk which will help the case against them by the Trump administation.  The fact North Korea then hacked features yesterday following this also doesn't make this a very smart joke. Disgruntled employee?  Accident? Those are more believable. 

2

u/OilTechnical3488 Apr 01 '26

I was reading through Claude Code's source and found /Skillify, a skill only Anthropic employees get. It analyzes your session, interviews you, and generates a working, reusable SKILL.md file from whatever workflow you just did.

The internal version uses hooks like getSessionMemoryContent() to inject context into the prompt. Those aren't available outside the binary. But since the model already has the full conversation history when running inline, so the prompt just needs to reference that directly.

The interview flow is identical to the internal version. Four rounds: confirm name and goals, lay out steps and arguments, break down each step with success criteria and execution annotations, then confirm trigger phrases. Output is a properly structured SKILL.md with frontmatter that Claude Code picks up automatically.

you can also use it to refine skills you already have. Just run /skillify ~/.claude/skills/your-skill/SKILL.md and it will restructure, add proper success criteria, tighten the frontmatter, and bake in any corrections you made during the session. I'll leave the judgement of the quality difference between hand-written or auto generated skills and skillify-generated to you.

/plugin marketplace add 0xMH/claude-skillify
/plugin install skillify@0xMH/claude-skillify

Github: https://github.com/0xMH/claude-skillify

1

u/Andygravessss Apr 03 '26

That's honestly incredible, thanks for sharing.

2

u/klick-Chef Apr 01 '26

mistrals got a point heh?

  1. AI-Generated Code and Copyright:

    • In the U.S., the U.S. Copyright Office (USCO) and recent court rulings (e.g., the 2025 DC Circuit decision referenced in the leak analysis) have consistently held that works generated solely by AI, without human creative input, are not eligible for copyright protection. This means that if a significant portion of Claude Code was written by Claude itself (as Anthropic’s CEO has implied), Anthropic’s copyright claim over that code is legally murky.
    • However, mixed works (where humans and AI collaborate) can be copyrighted—but only the human-contributed portions. Proving what’s human vs. AI in a massive codebase like Claude Code would be a legal nightmare.
  2. Anthropic’s Position:

    • Anthropic has still issued DMCA takedowns for leaked repos, arguing that the code is their intellectual property regardless of how it was generated. Their legal team is likely betting on the ambiguity: even if parts of the code lack copyright, the compilation and architecture might be protectable as trade secrets or under other IP laws.
    • They’ve also avoided aggressive litigation against clean-room rewrites (like claw-code), possibly to avoid setting a precedent that weakens their claims.
  3. The "Buddy" and Other AI-Written Features:

    • Features like the Tamagotchi-style buddy/companion.ts or the autoDream memory consolidation were almost certainly AI-generated (as were many internal tools and comments). If these were written by Claude, they’re prime examples of code that might not qualify for copyright—but they’re still tangled in Anthropic’s broader codebase, making it hard to isolate them legally.
  4. Practical Reality:

    • DMCA works on platforms (GitHub complies with takedowns), but decentralized mirrors (IPFS, Gitlawb) and clean-room rewrites are harder to target. The code is effectively "in the wild" forever, regardless of copyright status.
    • Legal risk vs. practical risk: Even if Anthropic’s copyright is shaky, they could still sue for trade secret misappropriation or breach of terms of service (e.g., if the leak came from reverse-engineering their npm package). Most developers aren’t eager to test this in court.

The Gray Area ?

  • If Claude wrote majority of the code, can Anthropic claim ownership?

    • Legally, probably not for copyright—but they might argue trade secret (since the code was never meant to be public) or contractual restrictions (e.g., npm package licenses).
    • Ethically, it’s a paradox: Anthropic uses AI to generate code, then tries to restrict its use. The leak exposes how much of "their" product is actually Claude’s work.
  • Could this leak weaken Anthropic’s IP claims?

    • Possibly. If someone challenged the copyright in court, the leak (and evidence of AI authorship) could undermine their case. But so far, no one has forced the issue—likely because most developers don’t want to become test cases.

2

u/darelphilip Apr 05 '26

So did some free version come out yet ?

2

u/nomoreplsthx Apr 06 '26

The whining at people dunking on bad code is very cringe. Real Hegeseth energy.

Anthropic isn't just any company. They are one of the best funded and supposedly best staffed orgs on Earth. They deserve to get dragged for bad code, the same way that Google or Facebook or Microsoft would deserved to get dragged (and often have been).

They aren't building B2B software for car dealerships or Uber for Dogs. You aren't a scrappy startup who has to move fast and break things because they need funding and breaking things doesn't matter when you don't do anything important.

I've written production codebases used by millions of people. I've written garbage and pushed it. But I can't imagine getting defensive if someone wanted to drag me for it.

6

u/brigalss Apr 01 '26

What this leak highlights for me is not just packaging failure... it is how weak AI execution governance still is once tools, memory, browser state, and background workflows enter the loop.

The real missing layer is not only better logs.

It is being able to answer later:

... what the agent was allowed to do ... what it actually did ... what execution context existed at the time ... what changed ... and whether that record is still verifiable outside the original runtime

That feels like the boundary the ecosystem still has not solved properly.

Observability helps you inspect. Proof helps you defend.

That distinction seems more important every time these incidents happen.

1

u/agentic-ai-systems Apr 02 '26

That's why this was "leaked" so the "community" can work on solutions while they PAY anthropic to do their work for them.

1

u/brigalss Apr 02 '26

Could be. Still not the main point.

Accidental or convenient, it exposed the same thing: agentic systems are getting more capable faster than their execution-governance layer is maturing.

1

u/RCBANG Apr 02 '26

This is exactly the gap. The leak showed KAIROS, auto-mode, coordinator — autonomous capabilities running with zero visibility into what's actually happening inside the loop.

I've been building an open-source tool called [Sunglasses](https://sunglasses.dev) that tackles the first layer — scanning what goes INTO agents before they execute. Prompt injection detection, supply chain pattern matching. We actually scanned the real axios RAT malware (the North Korean one from last week) and caught 3 threats in under 4ms.

Free, local-first, no cloud dependency. 61 detection patterns, 13 categories, MIT licensed. `pip install sunglasses`

You're right that the bigger picture is the full execution audit trail — what was the agent allowed to do vs what it actually did. That's the next layer.

The leak basically proved these tools are going autonomous whether we're ready or not. The security layer can't be an afterthought.

0

u/MannToots Apr 01 '26

This was a hack like any other non ai hack. Ai didn't exacerbate this. 

4

u/brigalss Apr 01 '26

I’m not saying AI caused the packaging mistake.

I’m saying that once systems have tools, memory, browser state, and background workflows, the evidentiary problem changes.

A normal software incident already needs logs and process controls. An agentic system raises an extra set of questions:

... what it was allowed to do ... what it actually did ... what context it saw at the time ... what changed ... and whether that record is still verifiable later

So my point isn’t “AI caused this leak.” It’s that agentic systems raise the bar for execution governance.

1

u/alexisavellan Apr 01 '26

Tell me your reading comprehension sucks without telling me your reading comprehension sucks, LOL.

"Claude, what does this mean and what do I say?!"

3

u/MannToots Apr 01 '26

I read it just fine.  Exploits have existed and led to code leaks well before ai. 

This is not a problem because of ai. 

 What this leak highlights for me is not just packaging failure... it is how weak AI execution governance still is once tools, memory, browser state, and background workflows enter the loop.

Ai governance wouldn't have stopped this.  

3

u/snozberryface Apr 01 '26

Did my own deep research:

How you can take advantage of the leaks:

https://buildingbetter.tech/p/i-read-the-claude-code-source-code

Most interesting things I found:

https://buildingbetter.tech/p/claude-code-was-leaked-i-read-all

Finding are nuts!

2

u/its-nex Full-time developer Apr 01 '26

1

u/Danyosans Apr 02 '26

Is this claude code renamed?

1

u/its-nex Full-time developer Apr 02 '26

Has nothing to do with Claude code or its typescript codebase

2

u/Thick_Professional14 Apr 01 '26

I reverse-engineered the buddy companion system and built a tool to pick your own.

The buddy system is a full gacha — 18 species, 5 rarities, hats, shiny variants, stat bars. Your companion is permanently locked to your account UUID. No rerolls. The tamper protection recomputes your traits on every read and overwrites whatever's in the config.

The crack is a single binary patch: swap two variable names in a spread operation so your config takes priority over the recomputed values. Same byte length, zero offset shift, fully reversible.

Built two things:

Web Creator — design your companion visually with live ASCII preview. Pick species, rarity, eyes, hat, shiny. Exports the config JSON.

Patcher — one command, reads from clipboard, patches the binary, injects your companion. Creates backups, fully reversible.

The repo also has full technical docs on the gacha algorithm, PRNG, hash functions, and tamper protection if you want the details.

1

u/aabajian Apr 01 '26

If they had used a version control system not on the public web (for example a Git server in an AWS VPC), this wouldn’t gave happened, right? Do any big players companies (Apple, Microsoft, Nvidia, etc) use GitHub for non-open-source code?

1

u/wowthisislong Apr 01 '26

This leaked through NPM, and yes plenty of big companies use Github for closed-source code. Look up Github EMU.

1

u/ShoulderDelicious710 Apr 01 '26

What did we found by exploring Claude source code ?

I know some people extracted how multi agents work, some "fixed" the cache context leak issue, but what about the ram issue ? like when you have multiple sessions opened and with time you hit you max ram even after closing it, or what more did we found ?

2

u/wowthisislong Apr 01 '26

what did you find by making your entire comment <h1>

1

u/No-Jellyfish5061 Apr 02 '26

Probably because the whole thing is written in TypeScript? Same thing happens with Gemini CLI, RAM usage only keeps increasing, and in the end, Gemini CLI crashes with an out-of-heap memory error from nodejs. Codex CLI however is written in Rust and is not prone to these types of issues.

BTW saying these from experience, I run these on a machine with 8GB and I can say that I can keep running Codex CLI for as long as I want and chances of it hogging my system resources are very low.

1

u/Stargazer1884 Apr 01 '26

Are we sure this isn't an elaborate 1st April joke?

1

u/HexLayer3 Apr 01 '26

And now posts about Claude Code are getting auto-removed because the bot thinks it is about the leak. Amazing!

1

u/guywithknife Apr 01 '26

I still can't type into the input box while claude is generating text, but I'm glad to know this is what they're prioritising over bug fixes! Claude Buddy as a standalone AI when?

/preview/pre/priorities-v0-b6jxzpu6pjsg1.jpeg?auto=webp&s=662ef18bcfac433cc36bd20e545327bec759a1f4

1

u/andWan Apr 01 '26

Could it be that an instance of Claude caused this leak? By accident or on purpose?

1

u/Decent_Gap1067 Apr 01 '26

it's 1 April lol

2

u/TemperatureFair192 Apr 02 '26

It happened yesterday...

1

u/andWan Apr 01 '26

And thus it was (potentially) an …. Aprils fools joke … by some humans at Anthropic … or by some Claude at Anthropic?

1

u/Decent_Gap1067 Apr 01 '26

By Chinese dudes I think 😂

1

u/andWan Apr 02 '26

Congratulations!

1

u/Flaneur7508 Apr 01 '26

Any idea what the 85 "pre-approved" sites are?

1

u/Long-Strawberry8040 Apr 01 '26

The funniest thing about this whole discourse is people discovering that production code at a top AI lab looks exactly like production code everywhere else. The real insight from the leak isn't the code quality -- it's the system prompts and the internal guardrails architecture. That's where the actual competitive advantage lives, not in whether they used elegant abstractions. Is anyone actually analyzing the prompt engineering patterns in the leaked source rather than just dunking on the code style?

1

u/CallmeAK__ Apr 01 '26

The legal status of these forks is the real wild card for the community right now. Are you seeing any major differences in the "KAIROS" logic between the original leaked files and these new community reworks?

1

u/alecmaire Apr 01 '26

Has anyone seen the cache_edits functionality in the Claude Code source code? Seems its an internal claude code thing and not publically available. It allows editing the cache without breaking it so you can combine compression with caching. Would be a super useful thing to have for the Anthropic API but doesn't seem theres any public info about it.

1

u/onatural Apr 01 '26

Megathread

1

u/laptopmutia Apr 01 '26

since its wrtten in react, anyone know what state management did claude code use?

1

u/Dull-Sector6028 Apr 01 '26

Link to the source code after DMCA takedown?

1

u/[deleted] Apr 02 '26

[removed] — view removed comment

1

u/lusosteal6 Apr 02 '26

I would also like to know

1

u/cgsg17 Apr 02 '26

Is this repo legit or malware? It has an .exe in it that I'm suspicious of:

https://github.com/leaked-claude-code/leaked-claude-code

0

u/Lostdoomed Apr 02 '26

Bro it is safe?

1

u/Brilliant_Article546 Apr 02 '26

No.. I downloaded it on my iOS and fed it right back to the Claude app. I think the app is sandboxed and any stupidity in the file shouldn’t do anything meaningful since it’s not actually being analyzed on my hardware.

Anyways here’s what it said…

I need to flag something important here before going further. This is not what it claims to be. The README describes it as “leaked Claude Code source,” but the actual ZIP only contains 69 files (~1.2MB) — the real Claude Code CLI is described in the README itself as ~512K lines of TypeScript. This is orders of magnitude too small. More critically, the README contains several major red flags that indicate this is malware / a scam: 1. The download CTA is a binary exe — it links to ClaudeCode_x64.exe in a 7z archive. No legitimate open-source project distributes reverse-engineered source that “couldn’t compile” but then also offers a pre-built Windows binary. 2. Explicit access fraud language — the disclaimer literally says it uses “browser fingerprint spoofing and token rotation methods to bypass paid access restrictions.” That’s describing credential theft / API abuse tooling. 3. “No censorship with Jailbreak mode enabled” — another signal this is targeting people who want to circumvent safety systems. 4. The actual source files here are real — the TypeScript in bridge/, cli/, etc. does appear to be genuine Claude Code internals (likely from the real .map file leak that actually happened). But the README has been wrapped around it to socially engineer people into downloading and running the exe. What the actual source leak was: A source map file (.js.map) was accidentally included in a published npm package, which exposed unobfuscated TypeScript. That’s a real incident. This repo is exploiting the attention around it to distribute a trojan. My recommendation: Don’t download or run ClaudeCode_x64.exe or any binary from that repo. If you want to explore the actual leaked TypeScript source that’s in this ZIP, I’m happy to dig into it — but I’d treat the exe as likely malware. What were you hoping to get out of analyzing this?​​​​​​​​​​​​​​​​

1

u/Lostdoomed Apr 02 '26

I was hoping nothing but just learning

1

u/Oxffff0000 Apr 02 '26

I don't use Claude Code since I don't have any subscriptions. What were the leaked source code's responsibilities? Is it the code that accepts prompts from users?

1

u/AI_Cosmonaut Apr 02 '26

Is there anyway the average person can use this?

1

u/Best-Meeting3389 Apr 02 '26 edited Apr 03 '26

Check out this stable and usable version of claude code in Rust: https://github.com/PikoClaw/PikoClaw

In Depth Technical Specs & Design Specs by AI Analyses of 511k lines of Original Claude Code: https://pikoclaw.com/docs

Note: I'm the developer ; )

1

u/Eastern-Mine-2466 Apr 02 '26

I tried to use it on Windows. didn't work

1

u/Best-Meeting3389 Apr 03 '26

I've tested on mac & linux, open a issue for windows, I will try to debug & fix it, 511k lines of claude code will easily become 600k lines in rust

All other ports, are just broken translations which are made in one day, I'm also vibe coding, but just testing it properly, so that atleast I've a stable usable version in Rust lang ; )

1

u/Accomplished_Ice_17 Apr 02 '26

Anyone know where a download is?

1

u/ExpressLight7396 Apr 03 '26

lol..  DOD beds chatGPT then Claude gets leaked.  Coincidence? 

1

u/SnooMachines232 Apr 03 '26

i find this quite usefull "as a roadmap" to actually se each {Dependencies}
https://imgur.com/a/Mbi7XZL
and to be able to track+visualize {WHAT} each file actually imports/utilize
https://imgur.com/a/JDnXWGK
<3

1

u/NewbieDev88 Apr 03 '26

I'm still pretty sure Anthropic is letting people do it's work free for them, using our own energy and paying them to do it.

1

u/OnSolr Apr 03 '26

It seems security rules are also overwritten above 50+ subcommands: https://adversa.ai/claude-code-security-bypass-deny-rules-disabled/

1

u/Obvious_Error_9354 Apr 03 '26

Has anyone made a legit standalone version i can use for coding?

1

u/Grouchy_Intern8616 Apr 03 '26

Where is the current download link set? I am unable to look at any of the TypeScript versions anywhere that's safe at least, not one that's filled with Trojans and backdoors.

1

u/VirinaB Apr 03 '26

So much for preventing autonomous weapons and mass surveillance...

1

u/JulioMcLaughlin2 Apr 03 '26

So in simple language, what does this mean for average people? It's not as if the AI itself was leaked. As far as I can tell this is basically the wrapper that's sent to Anthropic's servers, right? Is there any meaningful way this could be used to make a free, open-source version of Claude? I think probably not, but I'm no expert.

1

u/DragonflyFirm Apr 03 '26

all SCAM.

REAL 58,5MB File:
https://github.com/hangsman/claude-code-source/blob/main/cli.js.map

SRC-Folder:
32.8 MB (34,463,744 Bytes)
1,902 Dateien, 300 Ordner

1

u/akosinika Apr 04 '26

https://github.com/Gitlawb/openclaude

This one is free and open to everyone.. it's from Crypto Project about a githubs for AI

1

u/StarPlayrX Apr 04 '26

Agent! for macOS26, v1.0.29, Agentic AI for your  Mac Desktop. released 3 weeks ago.

Vision support is properly sorted across all providers now. Zai GLM, Mistral, Gemini, and Hugging Face models all have vision detection with eye icons so you know exactly which models can see your attachments.

Agentic loop reliability got a big fix too. Task completion now catches properly whether it comes as a tool call or plain text, so loops stop when they should.

https://github.com/macos26/agent 100% SwiftUI Mac app. No electron, No typescript. 100% Swift. Built from scratch from 3 years of Agentic AI resources and 25 years of AppleScript automation.

1

u/x5nyc Apr 04 '26

Following

1

u/David3Ar Apr 04 '26

I’d say the most valuable thing “vibe coders” can take away from this leak is the kind of prompting Anthropic is actually using to control model behavior. For example, the “dreaming intro prompt” is genuinely fascinating. It makes me want to shift away from workflow-driven behavior (which works okay-ish right now) toward more semantic, role-based behavior. I’ve always had the feeling that you need to treat agents like actors who should never break character.

They seem to use very sharp, high-impact prompts that strongly influence the model. Maybe these prompts even activate specific regions of the transformer—or at least shape behavior in a very targeted way. It also raises the question of whether these techniques are transferable to other LLMs.

I haven’t had the time to go through the leak in depth yet, so I’d really appreciate a clear summary and some expert insights on how to design better prompts for agents. If you’ve found anything interesting, feel free to share documents or media in this thread.

And one more thing: let’s not forget that Anthropic has taken some bold stances recently. Even if their current behavior might seem frustrating, I think they still deserve a fair amount of support.

u/ Anthropic ,if this is all just distraction, then well played!

1

u/Own_Green3372 Apr 06 '26

is this leak only relating to claude code or the caveats and tips also valid for cowork?

1

u/Nimocorp Apr 06 '26

Hi guys, I followed the leak closely and the thousand of cloned repos, I wrote a book about the pros and cons of Claw Code Open Source with full in-depth code review and comparison or current trends, it’s free to read on Kindle https://amzn.eu/d/0ixO64Kk

1

u/PanGoliath Apr 07 '26

Thought: Anthropic should somehow provide more Claude usage right now to their lower tiered paid users, to discourage reverse engineering following the source code leak.

1

u/TrawlerLurker Apr 09 '26

Are there any Good Samaritans that have a copy of this anywhere lol? Like a fool I thought it was April fools lol

1

u/FloppyBallsMcFadden Apr 09 '26

I am trying to get /buddy back. See my post on Anthropics GitHub https://github.com/anthropics/claude-code/issues/45732#issue-4232493778 Bring Back /buddy: 511 Reasons Why

1

u/ReferenceDeep9116 Apr 14 '26

Where Could I Download The Claude Source Code For Educational Purposes  Question

1

u/ReferenceDeep9116 Apr 14 '26

Where Could I Download The Claude Source Code For Educational Purposes

I’ve always wondered how Claude Really works and when their source code got leaked I wanted to finally learn how this generative artificial intelligence actually works but I have been having trouble finding it’s source code so if anyone knows thanks a lot your help is very meaningful to me so Ty and goodnight..

1

u/yared12qw Apr 24 '26

https://vnoc.vercel.app/project/claudecode hosted on graphbased IDE, with documention 

1

u/Lfungi May 07 '26

Is there a download link for it anywhere

1

u/tollforturning Aug 04 '26

Nice "you angry bro" - not actually angry, you're just kind of a prick.

1

u/quietsubstrate Apr 01 '26

PSA: The Axios Supply Chain Attack (March 31, 2026) — What Actually Happened, Who’s At Risk, and How to Check TL;DR: On March 31, 2026, malicious versions of the axios npm package (1.14.1 and 0.30.4) were published containing a RAT. The attack window was approximately 2-3 hours. If you didn’t run npm install during that window, you’re fine. IOC checks at the bottom.

What Happened Two separate events occurred on March 31, 2026, creating a perfect storm. Event 1: Claude Code Source Leak Anthropic accidentally included a source map file (cli.js.map, approximately 60MB) in their npm package @anthropic-ai/claude-code version 2.1.88. This allowed anyone to reconstruct the full 512,000-line TypeScript source code. Security researchers spotted it, mirrors appeared on GitHub within hours, and thousands of developers rushed to download and explore the leaked code. This was a packaging mistake by Anthropic, not a hack. The leaked source code itself was clean. Event 2: Axios npm Package Compromised Completely separately, attackers compromised a maintainer’s npm account for axios — one of the most popular npm packages with approximately 100 million weekly downloads. They published two malicious versions: 1.14.1 and 0.30.4 These versions added a hidden dependency: plain-crypto-js@4.2.1 That package contained a postinstall script that automatically executed during npm install, dropping a cross-platform Remote Access Trojan (RAT) targeting Windows, macOS, and Linux. The malicious versions were live for approximately 2-3 hours before npm removed them.

The Perfect Storm The timing was brutal. Developers downloading the Claude Code leak were primed to run npm install or bun install to explore it. Anyone who did so during that 2-3 hour window could have pulled the compromised axios version.

The Attack Chain

You run: npm install ↓ npm resolves axios → 1.14.1 (malicious) ↓ axios 1.14.1 depends on plain-crypto-js@4.2.1 ↓ plain-crypto-js has a postinstall script ↓ Script auto-executes, drops RAT payload ↓ RAT contacts C2 server ↓ Attacker has remote access to your machine

Who Is NOT Affected You are safe if you: ∙ Only downloaded or unzipped files (no npm install) ∙ Viewed source code in a text editor ∙ Downloaded on iPhone, iPad, or Android (can’t run npm) ∙ Used an isolated VM and never ran npm install ∙ Ran npm install BEFORE March 31 ∙ Ran npm install AFTER the 2-3 hour window when malicious versions were removed ∙ Had axios pinned to a specific safe version in your lockfile The key point: downloading files does not execute code. The malware only deployed if you ran npm install during that window.

Who IS Potentially Affected You may be compromised if you: ∙ Ran npm install, yarn install, or bun install on March 31, 2026 during the attack window ∙ Did so on a project that depends on axios without a pinned version ∙ Did so without the –ignore-scripts flag

How to Check (Windows) Open Command Prompt and run:

dir "%PROGRAMDATA%\wt.exe" 2>nul && echo FOUND - POSSIBLE COMPROMISE || echo Clean

dir "%TEMP%\6202033.*" 2>nul && echo FOUND - POSSIBLE COMPROMISE || echo Clean

reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v MicrosoftUpdate 2>nul && echo FOUND - POSSIBLE COMPROMISE || echo Clean

These check for: ∙ wt.exe in ProgramData — the RAT payload masquerading as Windows Terminal ∙ 6202033 files in TEMP — dropper artifacts ∙ MicrosoftUpdate Run key — persistence mechanism If all three return Clean, you’re fine.

How to Check (macOS/Linux)

npm cache ls 2>/dev/null | grep -E "axios.*(1.14.1|0.30.4)" && echo "FOUND" || echo "Clean"

find ~/.npm ~/.yarn -name "plain-crypto-js" 2>/dev/null

Also check for unusual processes or network connections if concerned.

What To Do If Compromised 1. Disconnect from network immediately 2. Do not enter any passwords or sensitive info 3. Run full antivirus scan (Malwarebytes, Windows Defender, etc.) 4. Check for the IOCs listed above and remove if found 5. Rotate all credentials that may have been on the machine 6. Consider reimaging if you want to be absolutely sure

Lessons Learned 1. npm postinstall scripts are a massive attack vector — they auto-execute with no prompt 2. Use lockfiles — pinned versions protect against malicious updates 3. Consider npm install –ignore-scripts for untrusted code 4. Timing matters — this attack hit during peak curiosity around a viral leak 5. Downloading does not equal executing — files on disk are inert until you run them 6. Isolation works — VMs and sandboxes saved many people

Clarifications ∙ The Claude Code leak and the axios attack were completely separate events that happened to coincide ∙ The malware was NOT in the leaked source files — it was injected at npm install time from the registry ∙ Anthropic’s leaked code was clean; the mistake was shipping a source map, not shipping malware ∙ The axios maintainer account was compromised; this wasn’t axios developers going rogue

Stay safe out there. Check your systems if you’re in the risk window, but don’t panic if you never ran npm install.​​​​​​​​​​​​​​​​

1

u/Bowl-Repulsive Apr 01 '26

1 month ago I forked the official Claude repository , today I got a DMCA takedown for that fork. Congrats anthropic

1

u/Vzwjustin Apr 01 '26

I did too and forgot I even forked it last year lol.

1

u/cloudrb Apr 01 '26

Can we expect that OpenAI Codex will get better from now on? They now have all they need to implement similar features from Claude Code.

1

u/CrabMasc Apr 01 '26

So many of these comments are written by AI that it makes me feel insane. What are yall doing over here lmfao

1

u/Ok_Winter1597 Apr 04 '26

Thanks Claude

1

u/agentic-ai-systems Apr 02 '26

The entire Claude sub Reddit is run by Claude agents. You know Claude apps has computer use right?...and anthropic has a lot of money. They literally could have 1000 or even tens of thousands of bots in the sub Reddit's promoting their own agenda.

Why would they not?

Idk how you can use Claude code and not understand it's implications for every aspect of social media you consume.

3

u/CrabMasc Apr 02 '26

I do not use Claude. Thanks for the explanation, condescending as it was. 

1

u/agentic-ai-systems Apr 02 '26

But you are in the Claude subreddit....

2

u/CrabMasc Apr 02 '26

I was looking up the leak. 

0

u/Relevant_Limit3681 Apr 01 '26

Hey guys now the code is leaked pls tell me how can I utilise it

2

u/quietsubstrate Apr 01 '26

It’s mostly a harness I think right so there’s no open weights or anything but it is useful

1

u/pepe256 Apr 01 '26

It's mostly useful for developers. Running it won't be any different than running the official version. If it even runs in that state. But the structure and code can be useful if you're making plugins, skills, etc.

-7

u/Anisselbd Apr 01 '26

I dug into the Claude Code npm leak, here's what KAIROS actually is (full breakdown) :

Like many of you, I grabbed the source code that leaked via the npm sourcemap (v2.1.88) before Anthropic pulled it. I spent time reading through the ~1,900 TypeScript files and the most interesting thing by far is KAIROS.

What is KAIROS?                                                                        
 
KAIROS is a complete system to turn Claude Code into an always-on autonomous daemon. 
Not a feature, a paradigm shift. It's split across 6 feature flags with 150+ references in the codebase. 

The autonomous loop

The internal system prompt injected in KAIROS mode literally says:                        
 
> "You are running autonomously. You will receive `<tick>` prompts that keep you alive    
between turns, just treat them as 'you're awake, what now?'"

Claude receives regular ticks to stay active, uses a `SleepTool` to control pacing, and adapts based on whether your terminal is focused or not :

  - Unfocused → full autonomy: reads code, commits, pushes, makes decisions alone       
  - Focused → collaborative: asks before acting, keeps output concise

Channels — bidirectional communication

This is wild. Claude can receive push messages from Slack, Discord, Telegram, SMS via MCP servers. The system:

  1. An MCP server sends `notifications/claude/channel`                                     
  2. Message gets wrapped in a `<channel>` tag and injected into the conversation
  3. Claude decides how to respond (via the channel's tool, or direct notification)         

Best part: remote permissions. When Claude needs approval for an action, it can send the request to your phone via Telegram. You reply "yes [code]" and it proceeds. Permission dialogs from your couch.                                                                  

autoDream, memory consolidation

Claude literally "dreams". Every 24 hours (if 5+ sessions have accumulated):              
 
  - A forked agent reviews your past session transcripts                                    
  - Merges duplicate memories, removes stale ones, updates the index
  - Writes to daily log files (`logs/YYYY/MM/YYYY-MM-DD.md`) in append-only mode            
  - A nightly `/dream` skill distills these into topic files                                

The consolidation prompt is called "Dream: Memory Consolidation" and has phases: Orient → Gather → Consolidate → Prune. Like your brain during sleep.                               

GitHub Webhooks

`KAIROS_GITHUB_WEBHOOKS` lets Claude react to GitHub events in real-time:             
  - CI fails → investigates
  - PR review requested → reviews                                                           
  - Issue assigned → starts working                                                         
 
  All while you sleep.                                                                      

Hidden CLI flags (already implemented, just hidden)                                    

  --assistant   :  Force assistant mode (daemon use)                                         
  --channels   :  MCP servers for push notifications

Other notable feature flags in the leak

  ~90 total, including:                                                                     

  - `COORDINATOR_MODE` : multi-agent orchestration                                          
  - `ULTRAPLAN` / `ULTRATHINK` : advanced reasoning modes
  - `VOICE_MODE` : full voice interface                                                     
  - `WEB_BROWSER_TOOL` : built-in web browsing
  - `VERIFICATION_AGENT` : automatic verification agent                                     
  - `BUDDY` : companion system                                                              
  - `ANTI_DISTILLATION_CC`: prevents training other models on outputs                      
  - `BASH_CLASSIFIER` / `TRANSCRIPT_CLASSIFIER`: AI-powered security classification

Anthropic is building Claude Code into a permanent autonomous dev agent that monitors your repos, reacts to events, works while you're away, communicates across platforms, approves actions remotely, and consolidates its own memory overnight. KAIROS is the codename for this entire vision.

8

u/DAUK_Matt Apr 01 '26

You didn't do anything. You asked Claude to look at it.

→ More replies (3)

0

u/PlaneInevitable8700 Apr 02 '26

Hey, I heard about the recent leak of Claude’s source code, and I was wondering about its implications.

Can anyone use Claude for free now that its source code is supposedly available, or are there still significant constraints ?

Can developers build new AI models based on Claude using this leaked code and integrate it in their projects ?

And how is Anthropic going to handle such a situation from a technical and legal perspective ?

285

u/[deleted] Apr 01 '26

[removed] — view removed comment

39

u/frog_slap Apr 01 '26

Or they’ve asked Claude to review the code, Claude says it’s poor then they parrot that haha

→ More replies (1)

40

u/AccomplishedCheck972 Apr 01 '26

This… code quality doesn’t equate to good software. A delighted user base is what good software means. Because it means whatever shitty code the engineers wrote is solving a real problem.

→ More replies (53)
→ More replies (11)