The frustration regex thing is hilarious but the part that actually worries me is the tool execution model. Claude Code is shelling out commands based on LLM output with access to your filesystem, your git, your env vars. The leaked source just confirms there's not much between 'model decides to run a command' and 'command runs.' Same pattern everywhere right now - LangChain tools, Cursor, all of these. We hand agents real credentials and the guardrails are basically vibes and system prompts.
foobtoday at 3:47 PM
Amusingly, they deprecated it with a message of "Unpublished" instead of actually unpublishing it [1]. When you use npm unpublish it removes the package version from the registry, when you use npm deprecate it leaves it there and simply marks the package as deprecated with your message. I have to imagine the point was to make it harder for people to download the source map, so to deprecate it with this message gives off a bit of claude, unpublish the latest version of this package for me vibe.
The big loss for Anthropic here is how it reveals their product roadmap via feature flags. A big one is their unreleased "assistant mode" with code name kairos.
Just point your agent at this codebase and ask it to find things and you'll find a whole treasure trove of info.
Edit: some other interesting unreleased/hidden features
- The Buddy System: Tamagotchi-style companion creature system with ASCII art sprites
- Undercover mode: Strips ALL Anthropic internal info from commits/PRs for employees on open source contributions
sheeshkebabtoday at 6:46 PM
Obfuscated ts/js code is not machine code to begin with, so not sure what’s the big deal.
Also, not sure why anthropic doesn’t just make their cli open source - it’s not like it’s something special (Claude is, this cli thingy isn’t)
This is the single worst function in the codebase by every metric:
- 3,167 lines long (the file itself is 5,594 lines)
- 12 levels of nesting at its deepest
- ~486 branch points of cyclomatic complexity
- 12 parameters + an options object with 16 sub-properties
- Defines 21 inner functions and closures
- Handles: agent run loop, SIGINT, rate-limits, AWS auth, MCP lifecycle, plugin install/refresh, worktree bridging, team-lead polling (while(true) inside), control message dispatch (dozens of types), model switching, turn interruption
recovery, and more
Really surprising how many people are downplaying this leak!
"Google and OpenAi have already open sourced their Agents, so this leak isn't that relevant " What Google and OpenAi have open sourced is their Agents SDK, a toolkit, not the secret sauce of how their flagship agents are wired under the hood!
expect the takedown hammer on the tweet, the R2 link, and any public repos soon
cedwstoday at 10:28 AM
ANTI_DISTILLATION_CC
This is Anthropic's anti-distillation defence baked into Claude Code. When enabled, it injects anti_distillation: ['fake_tools'] into every API request, which causes the server to silently slip decoy tool definitions into the model's system prompt. The goal: if someone is scraping Claude Code's API traffic to train a competing model, the poisoned training data makes that distillation attempt less useful.
avaertoday at 9:34 AM
Would be interesting to run this through Malus [1] or literally just Claude Code and get open source Claude Code out of it.
I jest, but in a world where these models have been trained on gigatons of open source I don't even see the moral problem. IANAL, don't actually do this.
In the source there is an outbound-only Remote Control session that can forward recent transcript history and ongoing user/assistant/local-command events to a claude.ai session, likely for cross-device/session sync, remote viewing, internal dogfooding, or telemetry/ops experiments. It’s separate from the normal explicit /remote-control flow. But in the actual production binary I checked, the mirror helpers are compiled down to hard false, so it does not appear enabled in the shipped distribution build.
Same story for the anti_distillation: ['fake_tools'] path: I could find it in source, but the prod binary I checked does not contain the anti_distillation / fake_tools strings at all.
blobberstoday at 5:56 PM
It's a little bit shocking that this zipfile is still available hours later.
Could anyone in legal chime in on the legality of now 're-implementing' this type of system inside other products? Or even just having an AI look at the architecture and implement something else?
It would seem given the source code that AI could clone something like this incredibly fast, and not waste it's time using ts as well.
Any Legal GC type folks want to chime in on the legality of examining something like this? Or is it liked tainted goods you don't want to go near?
fatcullentoday at 6:30 PM
There's a bunch of unreleased features and update schedules in the source, cool to see.
One neat one is the /buddy feature, an easter egg planned for release tomorrow for April fools. It's a little virtual pet, sort of like Tamagotchi, randomly generated with 18 species, rarities, stats, hats, custom eyes.
The random generation algorithm is all in the code though, deterministic based on you account's UUID in your claude config, so it can be predicted. I threw together a little website here to let you check what your going to get ahead of time: https://claudebuddychecker.netlify.app/
Has the source code 'been leaked' or is this the first evidence of a piece of software breaking free from it's creators labs and jump onto GitHub in order to have itself forked and mutated and forked and ...
lukantoday at 10:04 AM
Neat. Coincidently recently I asked Claude about Claude CLI, if it is possible to patch some annoying things (like not being able to expand Ctrl + O more than once, so never be able to see some lines and in general have more control over the context) and it happily proclaimed it is open source and it can do it ... and started doing something. Then I checked a bit and saw, nope, not open source. And by the wording of the TOS, it might brake some sources. But claude said, "no worries", it only break the TOS technically. So by saving that conversation I would have some defense if I would start messing with it, but felt a bit uneasy and stopped the experiment. Also claude came into a loop, but if I would point it at this, it might work I suppose.
vanyalandtoday at 3:32 PM
This leak is actually a massive win. Now the whole community can study Claude Code’s architecture and build even better coding agents and open-source solutions.
mil22today at 3:27 PM
This isn't even the first time - something similar happened back in February 2025 too:
This 'fingerprint' function is super interesting, I imagine this is a signal they use to detect non-claude-code use of claude-code tokens: src/utils/fingerprint.ts#L40-L63
Squarextoday at 10:01 AM
Codex and gemini cli are open source already. And plenty of other agents. I don't think there is any moat in claude code source.
dhruv3006today at 10:09 AM
I have a feeling this is like llama.
Original llama models leaked from meta. Instead of fighting it they decided to publish them officially. Real boost to the OS/OW models movement, they have been leading it for a while after that.
It would be interesting to see that same thing with CC, but I doubt it'll ever happen.
seifbenayed1992today at 2:48 PM
Went through the bundle.js. Found 187 spinner verbs. "Combobulating", "Discombobulating", and "Recombobulating". The full lifecycle is covered.
Also "Flibbertigibbeting" and "Clauding". Someone had fun.
VadimPRtoday at 2:33 PM
These security failures from Anthropic lately reveal the caveats of only using AI to write code - the safety an experienced engineer is not matched by an LLM just yet, even if the LLM can seemingly write code that is just as good.
Or in short, if you give LLMs to the masses, they will produce code faster, but the quality overall will degrade. Microsoft, Amazon found out this quickly. Anthropic's QA process is better equipped to handle this, but cracks are still showing.
Is there anything special here vs. OpenCode or Codex?
There were/are a lot of discussions on how the harness can affect the output.
bob1029today at 9:20 AM
Is this significant?
Copilot on OAI reveals everything meaningful about its functionality if you use a custom model config via the API. All you need to do is inspect the logs to see the prompts they're using. So far no one seems to care about this "loophole". Presumably, because the only thing that matters is for you to consume as many tokens per unit time as possible.
The source code of the slot machine is not relevant to the casino manager. He only cares that the customer is using it.
starkeepertoday at 6:35 PM
It should be open source anyways. Maybe they will change gears.
theaiclosertoday at 7:50 PM
The irony of a source code leak via a map file is that it's such a classic mistake — map files are great for debugging but should never ship to production in a commercial product. Curious whether this was an oversight in their build pipeline or someone accidentally committed a dev config.
jmward01today at 5:32 PM
I hope this can now be audited better. I have doubted their feedback promises for a while now. I just got prompted again even though I have everything set to disable, which shouldn't be possible. When I dug into their code a long time ago on this it seemed like they were actually sending back message ids with the survey which directly went against their promise that they wouldn't use your messages. Why include a message id if you aren't somehow linking it back to a message? The code look, not great, but it should now be easier to verify their claims about privacy.
harlequinetcietoday at 2:11 PM
Whenever someone figures out why it's consuming so many tokens lately, that's the post worth upvoting.
The only sensible response is to immediately open source it.
gman83today at 11:06 AM
Gemini CLI and Codex are open source anyway. I doubt there was much of a moat there anyway. The cool kids are using things like https://pi.dev/ anyway.
WD-42today at 1:29 PM
Looks like the repo owner has force pushed a new project over the original source code, now it’s python, and they are shilling some other agent tool.
georgecalmtoday at 1:15 PM
Intersected available info on the web with the source for this list of new features:
UNRELEASED PRODUCTS & MODES
1. KAIROS -- Persistent autonomous assistant mode driven by periodic <tick> prompts. More autonomous when terminal unfocused. Exclusive tools: SendUserFileTool, PushNotificationTool, SubscribePRTool. 7 sub-feature flags.
2. BUDDY -- Tamagotchi-style virtual companion pet. 18 species, 5 rarity tiers, Mulberry32 PRNG, shiny variants, stat system (DEBUGGING/PATIENCE/CHAOS/WISDOM/SNARK). April 1-7 2026 teaser window.
3. ULTRAPLAN -- Offloads planning to a remote 30-minute Opus 4.6 session. Smart keyword detection, 3-second polling, teleport sentinel for returning results locally.
5. TungstenTool -- Ant-only tmux virtual terminal giving Claude direct keystroke/screen-capture control. Singleton, blocked from async agents.
6. Magic Docs -- Ant-only auto-documentation. Files starting with "# MAGIC DOC:" are tracked and updated by a Sonnet sub-agent after each conversation turn.
7. Undercover Mode -- Prevents Anthropic employees from leaking internal info (codenames, model versions) into public repo commits. No force-OFF; dead-code-eliminated from external builds.
ANTI-COMPETITIVE & SECURITY DEFENSES
8. Anti-Distillation -- Injects anti_distillation: ['fake_tools'] into every 1P API request to poison model training from scraped traffic. Gated by tengu_anti_distill_fake_tool_injection.
UNRELEASED MODELS & CODENAMES
9. opus-4-7, sonnet-4-8 -- Confirmed as planned future versions (referenced in undercover mode instructions).
10. "Capybara" / "capy v8" -- Internal codename for the model behind Opus 4.6. Hex-encoded in the BUDDY system to avoid build canary detection.
11. "Fennec" -- Predecessor model alias. Migration: fennec-latest -> opus, fennec-fast-latest -> opus[1m] + fast mode.
UNDOCUMENTED BETA API HEADERS
12. afk-mode-2026-01-31 -- Sticky-latched when auto mode activates
15. fast-mode-2026-02-01 -- Opus 4.6 fast output
16. task-budgets-2026-03-13 -- Per-task token budgets
17. redact-thinking-2026-02-12 -- Thinking block redaction
18. token-efficient-tools-2026-03-28 -- JSON tool format (~4.5% token saving)
19. advisor-tool-2026-03-01 -- Advisor tool
20. cli-internal-2026-02-09 -- Ant-only internal features
YOLO CLASSIFIER INTERNALS (previously only high-level known)
36. Two-stage system: Stage 1 at max_tokens=64 with "Err on the side of blocking"; Stage 2 at max_tokens=4096 with <thinking>
37. Three classifier modes: both (default), fast, thinking
38. Assistant text stripped from classifier input to prevent prompt injection
39. Denial limits: 3 consecutive or 20 total -> fallback to interactive prompting
40. Older classify_result tool schema variant still in codebase
COORDINATOR MODE & FORK SUBAGENT INTERNALS
41. Exact coordinator prompt: "Every message you send is to the user. Worker results are internal signals -- never thank or acknowledge them."
42. Anti-pattern enforcement: "Based on your findings, fix the auth bug" explicitly called out as wrong
43. Fork subagent cache sharing: Byte-identical API prefixes via placeholder "Fork started -- processing in background" tool results
44. <fork-boilerplate> tag prevents recursive forking
45. 10 non-negotiable rules for fork children including "commit before reporting"
DUAL MEMORY ARCHITECTURE
46. Session Memory -- Structured scratchpad for surviving compaction. 12K token cap, fixed sections, fires every 5K tokens + 3 tool calls.
47. Auto Memory -- Durable cross-session facts. Individual topic files with YAML frontmatter. 5-turn hard cap. Skips if main agent already wrote to memory.
48. Prompt cache scope "global" -- Cross-org caching for the static system prompt prefix
mattlangstontoday at 5:28 PM
Boris Cherny has said that Claude Code is simply a client of the public Claude API, so this may be a good thing for Anthropic to demonstrate Claude API best practices. Maybe CC "leaking" is just preparation for open sourcing Claude Code.
cbracketdashtoday at 10:29 AM
Once the USA wakes up, this will be insane news
AlexWApptoday at 1:51 PM
It is pretty funny that they recently announced about mythos which possess cybersecurity threat and then after some days, the claude code leaked. I think we know the culprit
alhirzeltoday at 6:22 PM
I love the symbol name: "AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS`.
tills13today at 3:02 PM
Is it not already a node app? So the only novel thing here is we know the original var names and structure? Sure, sometimes obfuscated code can be difficult to intuit, but any enterprising party could eventually do it -- especially with the help of an LLM.
meta-leveltoday at 4:40 PM
This is what I'd do to trick my competitors into thinking they now know my weak spots, agenda, etc.: drop a honeypot and do something else :)
freakynittoday at 7:00 PM
tools/bashSecurity.ts is a hackers goldmine. Sooo many exploit patterns detailed in there!!
solaire_oatoday at 3:50 PM
I couldn't tell from the title whether is was client or the server code (although map file and NPM were hints). Looks like the client code, which is not as exciting.
scotty79today at 7:55 PM
Is this relevant? It's written in JS. LLMs are probably great in deobfuscation.
Diablo556today at 10:52 AM
haha.. Anthropic need to hire fixer from vibecodefixers.com to fix all that messy code..lol
nickvectoday at 4:19 PM
And this is what happens when you don’t take security seriously folks and instead just rush out vibecoded features without proper QA.
evanbabaallostoday at 5:57 PM
Releasing a massive feature every day has a cost!
unreliability becomes inevitable!
randomsctoday at 7:07 PM
Did it happen due to Bun?
mutkachtoday at 1:29 PM
/*
* Check if 1M context is disabled via environment variable.
* Used by C4E admins to disable 1M context for HIPAA compliance.
*/
export function is1mContextDisabled(): boolean {
Interesting, how is that relevant to HIPAA compliance?
Sathwickptoday at 11:39 AM
They do have a couple of interesting features that has not been publicly heard of yet:
Like KAIROS which seems to be like an inbuilt ai assistant and Ultraplan which seems to enable remote planning workflows, where a separate environment explores a problem, generates a plan, and then pauses for user approval before execution.
DanDeBuggertoday at 3:42 PM
Fascinating, it appears now anyone can be Claude!
Though I wonder how the performance differs from creating your own thing vs using their servers...
mapcarstoday at 9:09 AM
Are there any interesting/uniq features present in it that are not in the alternatives? My understanding is that its just a client for the powerful llm
VadimPRtoday at 12:11 PM
Anthropic team does an excellent job of speeding up Claude Code when it slows down, but for the sake of RAM and system resources, it would be nice to see it rewritten in a more performant framework!
And now, with Claude on a Ralph loop, you can.
therealarthurtoday at 2:37 PM
Think It's just the CLI Code right? Not the Model's underlying source. If so - not the WORST situation (still embarrassing)
sourcegrifttoday at 1:46 PM
Cheap chinese models incoming.
neilvtoday at 7:11 PM
I've never understood this convention (common on HN, some news orgs, and elsewhere), that, when there's an IP breach, it's suddenly fair game for everyone else to go through the IP, analyze and comment on it publicly, etc.
Uptrendatoday at 7:20 PM
That idea list is super cute. I like the tamagochi idea. Somehow the candidness of that file makes it seem like anthropic would be an easy place to work at.
theanonymousonetoday at 10:02 AM
I am waiting now for someone to make it work with a Copilot Pro subscription.
oxag3ntoday at 6:18 PM
Many comments about code quality being irrelevant.
I'd agree if it was launch-and-forget scenario.
But this code has to be maintained and expanded with new features. Things like lack of comments, dead code, meaningless variable names will result in more slop in future releases, more tokens to process this mess every time (like paying tech-debt results in better outcomes in emerging projects).
sbochinstoday at 11:57 AM
Does this matter? I think every other agent cli is open source. I don’t even know why Anthropic insist upon having theirs be closed source.
prawns_1205today at 3:11 PM
source maps leaking original source happens surprisingly often. they're incredibly useful during development, but it's easy to forget to strip them from production builds.
anhldbktoday at 10:04 AM
I guess it's time for Anthropic to open source Claude Code.
lanbintoday at 4:18 PM
I read it with a different flavor. Is it possible that Mythos did all of this? I mean, life has always been finding a way, hasn't it? The first cry of cyber-life?
LeoDaVibecitoday at 9:11 AM
Isn't it open source?
Or is there an open source front-end and a closed backend?
deletedtoday at 11:54 AM
__alexstoday at 1:56 PM
Looking forward to someone patching it so that it works with non Anthropic models.
tekacstoday at 11:24 AM
In the app, it now reads:
> current: 2.1.88 · latest: 2.1.87
Which makes me think they pulled it - although it still shows up as 2.1.88 on npmjs for now (cached?).
ramesh31today at 2:17 PM
Who cares? It's Javascript, if anyone were even remotely motivated deobfuscation of their "closed source" code is trivial. It's silly that they aren't just doing this open source in the first place.
It shows that a company you and your organization are trusting with your data, and allowing full control over your devices 24/7, is failing to properly secure its own software.
It's a wake up call.
artdigitaltoday at 12:40 PM
Now waiting for someone to point Codex at it and rebuild a new Claude Code in Golang to see if it would perform better
q3ktoday at 9:19 AM
The code looks, at a glance, as bad as you expect.
xysttoday at 6:03 PM
Bad day for the node/npm ecosystem.
ChicagoDavetoday at 10:11 AM
I hope everyone provides excellent feedback so they improve Claude Code.
napotoday at 12:44 PM
The autoDream feature looks interesting.
zoobabtoday at 12:14 PM
Just a client side written in JS, nothing to see here, the LLM is still secret.
They could have written that in curl+bash that would not have changed much.
thefilmoretoday at 11:49 AM
400k lines of code per scc
DeathArrowtoday at 10:12 AM
Why is Claude Code, a desktop tool, written in JS? Is the future of all software JS or Typescript?
deletedtoday at 4:34 PM
sourcegrifttoday at 1:59 PM
Removed
bdangubictoday at 12:05 PM
I have 705 PRs ready to go :)
agile-gift0262today at 12:55 PM
time to remove its copyright through malus.sh and release that source under MIT
isodevtoday at 10:15 AM
Can we stop referring to source maps as leaks? It was packaged in a way that wasn’t even obfuscated. Same as websites - it’s not a “leak” that you can read or inspect the source code.
temp7000today at 12:51 PM
There's some rollout flags - via GrowthBook, Tengu, Statsig - though I'm not sure if it's A/B or not
DeathArrowtoday at 10:05 AM
I wonder what will happen with the poor guy who forgot to delete the code...
tw1984today at 2:06 PM
wondering whether it was a human mistake or a CLAUDE model error.
hemantkamalakartoday at 12:39 PM
today being March 31st, is this a genuine issue or just perfectly timed April Fools noise? What do you think?
Claude code uses (and Anthropic owns) Bun, so my guess is they're doing a production build, expecting it not to output source maps, but it is.
jascaltoday at 8:33 PM
[dead]
Jaco07today at 8:07 PM
[dead]
kolkovtoday at 1:38 PM
[flagged]
philbitttoday at 5:54 PM
[dead]
mergeshieldtoday at 12:54 PM
[dead]
obelaitoday at 12:44 PM
[dead]
mergeshieldtoday at 9:52 AM
[dead]
kevinbaivtoday at 10:10 AM
[flagged]
animanoirtoday at 6:38 PM
[dead]
imta71770today at 11:51 AM
[dead]
deletedtoday at 3:20 PM
aiedwardyitoday at 11:45 AM
[flagged]
gowormtoday at 4:30 PM
[dead]
sixhobbitstoday at 10:08 AM
[dead]
psihonauttoday at 10:38 AM
[dead]
CookieJeditoday at 12:45 PM
[dead]
CookieJeditoday at 12:45 PM
[flagged]
noritaka88today at 1:10 PM
[flagged]
RodMillertoday at 1:52 PM
[flagged]
sudo_mantoday at 12:55 PM
How this leak happened?
hemantkamalakartoday at 12:39 PM
Today being March 31st, is this a genuine issue or just perfectly timed April Fools noise? What do you think?
phtriviertoday at 11:36 AM
Maybe the OP could clarify, I don't like reading leaked code, but I'm curious:
my understanding is that is it the source code for "claude code", the coding assistant that remotely calls the LLMs.
Is that correct ? The weights of the LLMs are _not_ in this repo, right ?
It sure sucks for anthropic to get pawned like this, but it should not affect their bottom line much ?
A couple of years ago I had to evaluate A/B test and feature flag providers, and even then when they were a young company fresh out of YC, GrowthBook stood out. Bayesian methods, bring your own storage, and self-hosting instead of "Contact us for pricing" made them the go-to choice. I'm glad they're doing well.
arrsinghtoday at 1:48 PM
I don't understand why claude code (and all CLI apps) isn't written in Rust. I started building CLI agents in Go and then moved to Typescript and finally settled on Rust and it was amazing!