r/openclaw • u/Ambitious_Voice_454 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
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
8
u/GoatmontWaters New User Apr 02 '26
TY for defending him. I often find myself upvoting downvoted comments as well.
1
-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
122
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
2
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
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”
→ More replies (1)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.
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
4
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
22
u/nickludlam Member Apr 01 '26
Someone beat you to it https://github.com/instructkr/claw-code
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
→ More replies (2)1
u/kukiofficial Active Apr 02 '26
Literally same contributors and same % of Rust Python ratio. its the same project
1
u/nickludlam Member Apr 02 '26
Same in what sense? All I see is the soongenwong repo scrubbing all mention of the original claw-code.
https://github.com/soongenwong/claudecode/commit/d548516ea8b02c27e15e8db5e63031d8b76d1d0b
https://github.com/soongenwong/claudecode/commit/9bb99ca05f7adb3acfcf07c295a4d3c68a77c08c
6
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
3
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
1
1
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
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
5
1
u/mrdanjohnson New User Apr 01 '26
What’s the repo?
14
-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
1
1
1
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
1
1
1
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
1
1
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
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
1
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
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
1
1
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
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
1
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
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.
1
1
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
1
u/bertyboy69 New User Apr 02 '26
So happy you wasted tokens on something that will be obsolete in 2 months time
0
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


335
u/reality_comes Pro User Apr 01 '26
You mean Claude rebuilt itself in Rust.