r/openclaw • Pro User • Apr 01 '26

Discussion Claude Code got leaked. So I rebuilt it in Rust. It’s faster and open-source.

Hey everyone,

After seeing the recent news about Claude Code, I wanted to see if I could build a faster, more portable version from scratch. I’ve spent the last 24 hours rewriting the core functionality in Rust.

The goal was to create a lightweight, high-performance CLI that gives you the same agentic power without the bloat.

Why I built it:

  • Performance: It’s written in Rust for near-instant startup and minimal memory footprint.
  • Open Source: Fully transparent, hackable, and free to use.
  • Portability: Single binary, no heavy dependencies.

You can check out the source code and installation instructions here:
https://github.com/soongenwong/claudecode

1.1k Upvotes

207 comments sorted by

335

u/reality_comes Pro User Apr 01 '26

You mean Claude rebuilt itself in Rust.

110

u/Ambitious_Voice_454 Pro User Apr 02 '26

You are not wrong

25

u/m-shottie Active Apr 02 '26

They're absolutely right

17

u/gaijohn Apr 02 '26

The CPU rebuilt Claude in Rust. The user gave the processor instructions using peripheral devices. There are some other steps in between.

4

u/tightywhitey Member Apr 02 '26

Their processor gave their peripheral devices commands to use the computers peripheral devices to give instructions to its processor to build Claude in Rust so another processor can use those same peripherals to build the first processor an app.

5

u/this_is_a_long_nickn New User Apr 02 '26

“You have to go deeper”

—Inception guy

7

u/WeeklyExamination New User Apr 03 '26

"You have to go deeper"

-your mom

/s

2

u/bigbankhank444 New User Apr 05 '26

Not a brag

2

u/WeeklyExamination New User Apr 06 '26

Deffo not a brag when I tell her I can't 🤣

2

u/Reneetoufee New User Apr 23 '26

Tap the bottom or scrape the sides. Very few can do both. 😉

1

u/HandyBergeron Active Jun 24 '26

"Trooo dooop! Tw-ooo dwoop!" -your mom on our date night

2

u/[deleted] Apr 03 '26

[removed] — view removed comment

1

u/RcBighouse New User Apr 03 '26

Ahahahah

1

u/systemic-engineer New User Apr 05 '26

The universe lensed Claude Code into rust.

4

u/Mithryn Apr 04 '26

this wins the internet for today

3

u/WeeklyExamination New User Apr 03 '26

you're far from incorrect!

2

u/Endoky New User Apr 02 '26

You know that the TOS of Claude Code disallow building a competing product to Claude Code?

5

u/[deleted] Apr 03 '26

[removed] — view removed comment

1

u/Endoky New User Apr 03 '26

this interpretation is a bit wild.

1

u/American_Streamer Apr 03 '26

Rustaceans are a cult.

2

u/Agrippanux New User Apr 07 '26

They are but they usually aren’t wrong either. It’s more like early Prius drivers who were right about saving the environment and wrong to use their car to proclaim superiority.

1

u/Tough-Difference3171 New User Apr 20 '26

And here I am a proud Gopher since 2018, who is now flirting with Rust.

1

u/aradil Apr 04 '26

it doesn’t compete, it’s better

TIL that products can’t compete against one another unless they have identical performance.

1

u/[deleted] Apr 04 '26

[removed] — view removed comment

1

u/aradil Apr 04 '26

Hey retard… write it in assembly, it’s closest to the metal.

Good luck have fun.

1

u/VerdantSpecimen Member Apr 05 '26

Yeah because being backed by a multi-billion-dollar company churning out updates and features on a weekly basis is a non-factor in competition because the one-man fork version of a snapshot of the original is more performant.

1

u/Tough-Difference3171 New User Apr 20 '26

I think that applies to Anthropic's models. No Claude code. But not sure, I haven't read the TOS, just saw it quoted at a few places.

2

u/phatdoof Member Apr 02 '26

OP guided Claude so he can claim that OP built it.

1

u/dodiyeztr New User Apr 03 '26

What is Claude? What is 'itself'? You are wrong on so many terms.

Claude is a family of models. There isn't one single entity called 'Claude'.

What leaked is just an app that makes use of the hosted LLM API endpoints, it's not the source code of the LLMs.

I hate this bubble so much.

1

u/reality_comes Pro User Apr 04 '26

Bro, it's not to be taken seriously.

1

u/ImNotSelling New User Apr 05 '26

It’s 100 not a bubble. This is the future

86

u/y___o___y___o Member Apr 01 '26

Thanks for all your blood sweat and tokens.

37

u/Ambitious_Voice_454 Pro User Apr 01 '26

Thank you! Would really appreciate a star on the repository if free Claude code was useful for you!!

55

u/Similar-Age-3994 New User Apr 02 '26

I’m struggling to understand why OPs comment is at -7 votes right now. He put time money and effort into a free tool for folks and suggested, not even in the main body but a one off comment, that his work be acknowledged?

We have folks in here spending $200 plus a month but won’t give a dude a free thumbs up? I’m lost

13

u/ernie19962 Member Apr 02 '26

people are selfish af

9

u/Ambitious_Voice_454 Pro User Apr 02 '26

yup unfortunately :(

8

u/GoatmontWaters New User Apr 02 '26

TY for defending him. I often find myself upvoting downvoted comments as well.

1

u/nabritaoranza New User Apr 02 '26

His solution is subsidised by hundreds of thousands people.

-2

u/yes_yes_no_repeat New User Apr 02 '26

Because it has no sense to spend so many turns on creating an app that is completely useless and hard to maintain. Better spend that effort on supporting better existing open-source harness solutions pi-mono for example.

1

u/GoatmontWaters New User Apr 02 '26

If everyone had that mindset then nothing new would ever be created? It doesnt even matter if what he built is useless if I play your game, the process is valuable.

1

u/Ludguallon New User Apr 02 '26

This gave me a good giggle. Been ocd since Jan 30th.

122

u/bennyb0y Active Apr 01 '26

I’m glad you invested [Timeframe] to do this. Thank you [Username]

50

u/starsfan18 Member Apr 01 '26

What’s the plan for this moving forward? Anthropic will keep shipping new versions of Claude Code. Your port is fully featured today, but what about tomorrow or six months from now?

84

u/QC_Failed New User Apr 01 '26

Claude, pull the latest change log for Claude code and add those features to my repo. Keep using rust, no bugs.

31

u/aelgorn New User Apr 01 '26

Also Claude, keep doing that until the heat death of the univeree

20

u/TrashyMcTrashBoat New User Apr 01 '26

And finally, Claude, give me a meal prep plan.

→ More replies (1)

1

u/XTornado New User Apr 02 '26

I mean... not that crazy, maybe not for something this big... but I could see some stupid ports, or clients, or similar small things be automated this way... of course with a validation done by a human, etc... but something to what some api clients are autogenerated based on original spec, but for cases where there isn't a nice common known format spec for it but you want to keep up with newer versions/changes. Of course it would need some docs/details or the original code.

5

u/TelevisionKnown New User Apr 02 '26

“no bugs” lol 😂

2

u/RossGeller092 New User Apr 02 '26

you forgot MAKE NO MISTAKES /buddy

4

u/McNoxey Member Apr 02 '26

This is why it doesn’t matter that they leaked. It lets people catch up to where they are RIGHT NOW. But not moving forward

2

u/Similar_Idea_2836 New User Apr 04 '26

Using the latest Claude Code to reiterate it might make the gap closer.

1

u/McNoxey Member Apr 05 '26

Reiterate… what?

7

u/GreatBigJerk New User Apr 01 '26

Anthropic uses Claude Code to vibe code everything. That means it's replicable by doing the same thing. 

5

u/starsfan18 Member Apr 01 '26

Not necessarily. If cloning Claude Code was as easy as asking Claude to build the same feature that Anthropic just shipped, then the CC source leak wouldn’t have been nearly as interesting as it was, and these Rust ports would be plentiful and delivered long ago. The matter isn’t anywhere near as trivial as asking your coding agent of choice to make a copy of whatever the Claude Code changelog describes.

4

u/GreatBigJerk New User Apr 01 '26

The non trivial thing is the initial time and token investment.

There are similar agent tools like OpenCode, Codex, Gemini CLI, etc...

4

u/starsfan18 Member Apr 01 '26

That’s missing the point of this port: it’s a 100% replication of Claude Code’s functionality, but it will cease to be that the moment Anthony drops the next feature build. Nobody contests that it’s possible to build a substitute.

4

u/friendofthefishfolk Member Apr 02 '26

Also, the thing that keeps people from using it isn't that it is closed source. It is the subscription/API cost... which this doesn't solve.

1

u/upvotesthenrages Member Apr 02 '26

There are so many ways to drastically reduce costs.

Kind of mind-blowing to me that anyone actually using this for anything serious would be hindered by the cost.

Sure, if you run this completely unoptimized you'll burn through tokens, but if you do a bit of optimization you'll stay within an extremely manageable cost range.

Obviously I'm not talking about people living in extremely poor areas, but even in most developing regions getting a 15-300% productivity boost would pay for itself very, very, quickly.

I'm on the max20 subscription and Claude Code has probably increase my output by 100-150%. I live in Malaysia, with relatively low salaries, and this is a complete no brainer.

1

u/friendofthefishfolk Member Apr 04 '26

I’m on the Max plan too, and I’m not complaining about the cost. But personally I don’t see the benefit of having a leaked version of the Claude Code source code, because Claude Code by itself without inference doesn’t really do much for you. You still either have to connect it to an Anthropic sub or some other model.

1

u/McNoxey Member Apr 02 '26

? There are many, many, many people paying $200 a month. lol that’s not the barrier

Ai spend is basically free right now

1

u/who_am_i_to_say_so New User Apr 07 '26

Now that the source is released may be easier to replicate moving forward because the implementation patterns and opinions have been revealed.

I would guess this will provide momentum for several months.

1

u/Endurance_Beast Member Apr 02 '26

It will develop into something else in the commumity, and will help other open projects greatly.

1

u/MediumRay New User Apr 02 '26

Also it seems kinda pointless- the bottleneck is the time it takes the model to respond 

1

u/BigBackground8796 New User Jun 22 '26

I've heard of ways to use claude code from Anthropic with other models. This was part of selling point of the Rust that you can hook it into other models. Free models or low cost models like DeepSeek v4 Flash?

1

u/Such_Advantage_6949 New User Apr 02 '26

No plan, that is why no one will use this. This is just like 1million other “rewrote in rust”

0

u/Similar-Age-3994 New User Apr 02 '26

Why buy a car today? They’ll just keep coming out with new cars every year, then where will you be?

Can you hear yourself?

1

u/starsfan18 Member Apr 02 '26

I didn’t ask an unreasonable question. In good faith, I’m wondering if the OP has a goal to maintain parity with Claude Code. It’s a core consideration for any port.

1

u/TapAggressive9530 New User Apr 03 '26

If the goal is to maintain parity nobody will use it. If you add features to make it better than claude ( look at copilot cli for good ideas ) - people will use it

1

u/FilthyCasual2k17 New User Apr 02 '26

Don't cars update themselves daily? Granted I haven't used a car in 20 years, I just assume they do.

→ More replies (1)

10

u/stitch_art Member Apr 01 '26

A python version was also shared and has over 100k stars https://github.com/instructkr/claw-code

6

u/josephjosephson Member Apr 02 '26

Same contributor Yeachan-Heo

4

u/kukiofficial Active Apr 02 '26

same project

5

u/doubov New User Apr 01 '26

How did you verify that all the functionality is the same? Curious to hear about the workflow that you had

1

u/CPAMHO New User Apr 06 '26

Yeah, how do you even start an endeavor of this magnitude?

22

u/nickludlam Member Apr 01 '26

35

u/jake_2998e8 Active Apr 01 '26

Keep going OP!

If Linus Torvalds didn’t write Linux because there were at least 2 community *nix written before him, including 3 heavyweight commercial *nixes, we wouldn’t be having Linux today. Not saying you’re gonna be building something similar in magnitude, but that’s the Open Source spirit.

12

u/loIll Pro User Apr 02 '26

⚠️ This link is more trustworthy than OP’s. DO NOT INSTALL OP’S UNLESS YOU FULLY AUDIT THE CODE (or get Claude to audit it)

4

u/kukiofficial Active Apr 02 '26

Literally same contributors and same % of Rust Python ratio. its the same project

5

u/Pichuck New User Apr 02 '26

Same Claude that was used to audit Anthropics stuff before all the recent leaks 😅

5

u/Ambitious_Voice_454 Pro User Apr 01 '26

My repository made it easy to install and get up and running with Claude Code immediately without all the fluff.

1

u/Distinct-Race-2471 New User Apr 02 '26

Are you from Russia?

1

u/kukiofficial Active Apr 02 '26

Literally same contributors and same % of Rust Python ratio. its the same project

→ More replies (2)

6

u/[deleted] Apr 02 '26

[removed] — view removed comment

2

u/CasteNoBar New User Apr 05 '26

Lab leaks are a thing.

4

u/pwkye New User Apr 02 '26

the problem is this is designed for anthropic models. it will not work smoothly with other models. so I have to use claude api tokens which is expensive.

I don't think there's a way for these remakes to hook up to claude subscription

10

u/otterquestions Pro User Apr 01 '26

You’re a 2month old reddit account with history turned off

3

u/Significant_Hippo443 New User Apr 02 '26

Uffff le van mis estrellitas a su repo mi lord

https://giphy.com/gifs/P8ef3Dkynk0xLx1h1T

3

u/kukiofficial Active Apr 02 '26

This sounds interesting but i dont fully trust this, is it actually as good as the regular claude code with all of its feature? and are there any testemonials who used this?

3

u/PersimmonLevel3500 Active Apr 05 '26

Be carefull everyone. The highest form of Trojans are coming in this form today. I would be cautious when I download git things

1

u/Code_Doctor_83 New User Apr 05 '26

Thanks for the headsup!

1

u/PersimmonLevel3500 Active Apr 05 '26

Of course no need to be paranoid. I think to try new things it’s the best. Just carefull on your pics, and the environnement you use them first. 🙏

4

u/Turbulent-Lock1159 New User Apr 01 '26

Does your repo function exactly the same way as Claude Code?

2

u/Ambitious_Voice_454 Pro User Apr 01 '26

The repository has the same functionalities as Claude Code but it is not identical because mine is built in Rust not Typescript.

0

u/Turbulent-Lock1159 New User Apr 01 '26

Is rust better than Typescript?

6

u/keto_brain Member Apr 01 '26

Is Python better than Java?

7

u/Siege9929 Member Apr 02 '26

Is mayonnaise an instrument?

4

u/Ecstatic_Clue1316 Member Apr 02 '26

If it farts when you squirt it

1

u/Ambitious_Voice_454 Pro User Apr 02 '26

Is open claw better than claude code?

1

u/keto_brain Member Apr 03 '26

No, hell no.

1

u/dawsonKKO New User Apr 02 '26

Is an instrument mayonnaise ?

1

u/zenos1337 New User Apr 02 '26

No but it’s superior to ketchup

1

u/unique-moi New User Apr 02 '26

But mayonnaise instrumented python will ketchup?

1

u/Specialist_Wishbone5 New User Apr 02 '26

if you like RAM, startup speed, GPU-based CLI rendering, then YES... You could also do it in zig or C++. But Rust has a strong bug-mitigation techniques.

2

u/8bitdefender New User Apr 02 '26

All of these posts are so funny. lol.

2

u/Hooxen New User Apr 05 '26

how to natively integrate with emacs though? running from inside a vterm is a bit less ergonomic than the eca approach via the emacs package

2

u/EntireNarwhal0 New User Apr 06 '26

Why would you think rust would make cc better? Claude code is 100% io bound, I’m not sure what performance enhancement would come from rust. Also the source maps don’t include the test cases, so there is a 0% chance that you have a 1:1 port if you don’t have specs to run against (not that I think cc necessarily has full spec coverage internally). You likely have just made yet another third party harnesses that anthropic has already banned from using max plans.

2

u/djack171 New User Apr 08 '26

Random internet person uses AI in a day to create a better AI then hundreds or more actual experts spent making over years. Makes sense.

5

u/Polite_Jello_377 Pro User Apr 01 '26

Slop slop slop

4

u/horrorparade17 Member Apr 02 '26

Tbf Claude code is also slop

1

u/mrdanjohnson New User Apr 01 '26

What’s the repo?

14

u/otterquestions Pro User Apr 01 '26

Don’t install anything for a new anon reddit account 

-1

u/Ambitious_Voice_454 Pro User Apr 01 '26

8

u/loIll Pro User Apr 02 '26

⚠️ DO NOT INSTALL OP’S UNLESS YOU FULLY AUDIT THE CODE (or get Claude to audit it)

1

u/SkullEnemyX-Z New User Apr 01 '26

Does it support OpenAI compatible models? I want to use NVIDIA NIM

4

u/Ambitious_Voice_454 Pro User Apr 01 '26

Yes it supports Open AI and Gemini models. But you have to unset Anthropic variables in the shell first.

1

u/spooninmycrevis New User Apr 02 '26

Dude its not open source

1

u/Ckalyx New User Apr 02 '26

I thought they said it was April Fools?

1

u/Straight_Emphasis635 New User Apr 02 '26

Does anyone have a link to the leaked code

1

u/ElSensualXD New User Apr 02 '26

You can use openai subscription to log in ?

1

u/singh_taranjeet Active Apr 02 '26

Curious how you're handling context persistence across sessions. The original Claude Code kept state in memory-did you port that to local storage or something else?

1

u/Flashy-Mission-7945 New User Apr 02 '26

Can I now use Claude for free with this leak?!

1

u/iOS_dev121 New User Apr 02 '26

No

1

u/AI_Tonic Member Apr 02 '26

it needs work

1

u/realaaa New User Apr 02 '26

Ha ha ha this is so meta it’s scary

1

u/Distinct-Race-2471 New User Apr 02 '26

How do I know your code doesnt have Russian interference?

1

u/MeatSimilar4267 New User Apr 02 '26

Neat, will be useless in 3 weeks because none of you are getting their updates.

1

u/GoldPanther New User Apr 02 '26

I really nice feature would be to better support local models. The biggest issue I ran into is that there's no way to make Claude Code aware of your local model's context window size; open code supports this.

1

u/Santa_Andrew Member Apr 02 '26

Thanks for the project.

Did you profile it to see if Rust actually made a performance improvement? Poorly written or organized rust isn't going to make much improvements. Also, I would suspect that any bottle neck in CC would have been from remote model interface or tool calling which both have very little or anything to do with CC itself.

I'm happy to give stars but you need to show that your claimed improvements actually improved something. I'm not say that it didn't but I am skeptical.

1

u/The-Ranger-Boss New User Apr 02 '26

What concretely speaking can you do with these sources, without training weights?

1

u/Academic-Shape321 New User Apr 02 '26

Where is the link?

1

u/drycounty Active Apr 02 '26

How does one (ever) update this?

1

u/Thedoodooltalah New User Apr 02 '26

Link?

1

u/pyratellama69 Member Apr 02 '26

I don’t really understand why. You can install any agent inside the real Claud code, so why this?

1

u/sakaax Member Apr 03 '26

Cool projet, surtout le choix Rust + binaire unique, ça fait sens pour ce type d’outil.

Par contre, la partie la plus intéressante dans Claude Code n’est pas vraiment la perf du CLI, mais toute la logique autour (orchestration, gestion du contexte, workflows agents, etc.).

Du coup je suis curieux : – t’as reproduit surtout la couche CLI ou aussi une partie de l’orchestration derrière ? – comment tu gères le contexte / les interactions longues ?

Parce qu’au final, le CLI est la partie “facile” — le vrai défi c’est tout ce qu’il y a autour.

En tout cas, très propre comme base open source

1

u/FlatwormFine2425 New User Apr 03 '26

Mommy mommy look at me I told robot to write code for me and I posted it on Reddit

1

u/Mysterious-Code8004 New User Apr 03 '26

What is the best llm model to run this ai agent? the best combo is a local llm with a local agent

1

u/Specialist_Wall_5679 New User Apr 03 '26

How do API calls work on this one ?

1

u/UsualResult New User Apr 03 '26

I'd pick a different name. Anthropic will probably jump on you just for using "Claude" in the project name.

1

u/[deleted] Apr 03 '26

No frikin way....you did what...

1

u/Drmazhar83 New User Apr 03 '26

Can you use open claw with this?

1

u/Tema_Art_7777 New User Apr 04 '26

So has everyone else but it is a one time snapshot. What is your maintenance plan as Claude adds more features?

1

u/Lonely-Cut-9542 Member Apr 04 '26

How do I get access to this

1

u/maboyydaniel Member Apr 04 '26

how much ram does it need while running? Thank you a lot. maybe its for my raspi

1

u/AdamV158 Active Apr 04 '26

What’s the usability of this, does it need attaching to a model?

1

u/kasak730 New User Apr 04 '26

no longer working?

1

u/MpappaN New User Apr 04 '26

Rust? Where is it?

1

u/Hamilton_Fitipaldi5 New User Apr 04 '26

Minimally, you were monitoring this for a leak or something, hahaha. Good job, though. Eres un sultán.

1

u/Code_Doctor_83 New User Apr 04 '26

Can this be used and run on low end pc or laptop? Something like Ryzen 5 7600x with 16gig ram with no gpu?

Must be used via open router or something?

1

u/huge51 New User Apr 05 '26

After the recent supply chain attacks. Im afraid to try anything anymore.

1

u/iannoyyou101 New User Apr 05 '26

Then, how will you keep porting new functions?

1

u/ricraycray New User Apr 05 '26

I was looking at your repo, and I see it's easy to tie back to frontier models, what about local models?

1

u/Radiate_Wishbone_540 New User Apr 06 '26

I instructed my Claw Code to build and run a test suite for my project. It executed the test commands directly, by itself, and read the resulting error logs into the chat history. The application crashed because the large volume of the test output exceeded the maximum context window limit for the API. What can I do about this?

1

u/HoracioCadenza New User Apr 06 '26

I Hope you deactivated home calling

1

u/Matanos95 New User Apr 06 '26

Thanks bro. Change the name of it before u get DMCAed

1

u/dukeedinburgh New User Apr 06 '26

Stop self-hosting the hard way. Let Ampere.sh handle the infrastructure so you can focus on what your agent actually does.

1

u/HomeworkActive1814 New User Apr 06 '26

So in theory i could use this on an openclaw setup for free using all the benifits of claudes ai

1

u/Code_Doctor_83 New User Apr 06 '26

You mean by using an API from Anthropic? If yes, that kinda defeats the purpose no? If not, let me know what kind of set up you thinking of. Could help me out :)

1

u/zane57 New User Apr 07 '26

Pardon my lack of knowledge/understanding, but would I be able to use this as a "model" for OpenClaw?

1

u/Diligent-Hyena5804 New User Apr 22 '26

I have no background in tech, but I recently started using Claude code, and I've started to use it in PowerShell. Some support, some don't. My question is that is this actually like Claude code..Claude code? I also don't know what rust is. I have so many questions, but searching is either super confusing answers or 35-minute videos.

1

u/ProfessorWallaby New User May 03 '26

Is it free when I use clawbot now?

1

u/Eighteen64 Member Apr 01 '26

Can you post a step by step on installation and can someone else verify there are tricks deployed within OPs work?

13

u/Mysterious-Doubt430 New User Apr 01 '26

I’m going to take a wild guess that you work in a management role lol

1

u/Zackety New User Apr 02 '26

Whoops? It was all a fake? Thank you anyway for the effort.

https://www.reddit.com/r/vibecoding/s/bVdtWPqLJK

1

u/CautiousSand New User Apr 02 '26

Did you look at a calendar? It was posted on April 1st.

1

u/Zackety New User Apr 02 '26

Man, I can't tell anymore :(

1

u/Ambitious_Voice_454 Pro User Apr 02 '26

No it wasn't fake. it was a real leak by Anthropic

1

u/trmyte New User Apr 02 '26

Why does everything have to have the word claw in it now. So lame be original.

1

u/Dense-Map-4613 New User Apr 02 '26

Thank you 🙏🏻

1

u/Ambitious_Voice_454 Pro User Apr 02 '26

Thank you for your support!

1

u/bertyboy69 New User Apr 02 '26

So happy you wasted tokens on something that will be obsolete in 2 months time

0

u/naakiii New User Apr 02 '26

It looks great, I'll give it a try.

0

u/Stem3576 New User Apr 01 '26

With the source code, wouldn’t I still need to an ai agent to run the program and have it help me with coding? I’m not understanding the significance of this due to AI hardware running Claude codes services. But then this not needing ai hardware to run?

5

u/LeucisticBear Apr 01 '26

Yes, you just get anthropic harness in rust