OpenClaude is an open-source coding agent for cloud and local models. Pair it with Ollama and it costs nothing. Full setup inside.

By Gencay

Published: 2026-04-04

URL: https://www.learnwithmeai.com/p/claude-code-source-code-free


\Claude Code source code leaked on GitHub — developers forked it within hours\

Claude Code is the best AI coding tool right now. It also needs a paid plan.

On March 31, Claude Code's source code leaked online.

\Claude Code source code leaked on GitHub, developers forked it within hours, Reference: Fried\_rice\

Developers forked it across GitHub within hours. Anthropic filed a DMCA notice, and GitHub disabled the original repo and 96 of its forks.

This guide does not use the leaked code.

A Korean developer rewrote Claude Code with AI instead. The rewrite is called Claw Code, and it is still on GitHub.

\Claw Code: https://github.com/ultraworkers/claw-code\

The result? 150K+ stars in 4 days.

One of the fastest-growing repos in GitHub history.

Then Gitlawb forked it and built OpenClaude, an open-source coding agent for cloud and local models.

\OpenClaude Gitlawb:Reference\

There’s one catch: OpenClaude still needs an API.

Why pay for an API when the whole point is running this for free?

That’s where Ollama comes in. A free, local AI API that replaces the paid one.

Let me show you how it works.

What is Ollama?

\OllamaReference\

Ollama is a free, open-source platform that lets you download and run AI models like Llama, Mistral, and Gemma locally on your machine.

If your hardware isn't powerful enough, Ollama Cloud lets you run these models remotely using a free API key.

This makes it the ideal backend for running OpenClaude without any cost.

\Ollama Models\

To use models on your pc without downloading, you should use Cloud models.

To do that, go to Settings → Keys and grab your free API key.

\Ollama API keys\

This lets you run models on Ollama Cloud instead of your local machine.

No GPU required.

Browse the available models, but make sure they support Ollama Cloud.

\Ollama Cloud Models\

Now you have a free AI API.

This is the key to running Claude Code source code without paying a cent.

Time to install OpenClaude.

How to install OpenClaude?

\Installation\

OpenClaude is an open-source version built from the Claude Code source code.

You can install it in 2 minutes using npm.

After installation, connect it to Ollama’s free API by setting three environment variables: your API key, the Ollama base URL, and your preferred model.

No paid subscription required.

Here are the steps.

Visit the GitHub page of OpenClaude and follow these steps.

Step 1: Open your terminal

Step 2: Run this code

npm install -g @gitlawb/openclaude

Step 3: Launch OpenClaude with your free Ollama API:

CLAUDE_CODE_USE_OPENAI=1 OPENAI_API_KEY="your-ollama-cloud-api-key" OPENAI_BASE_URL="https://ollama.com/v1" OPENAI_MODEL="minimax-m2.7" openclaude

Replace “your-ollama-cloud-api-key” with the API key you grabbed from Ollama.

That’s it.

Here’s what OpenClaude looks like:

\OpenClaude\

Tips: If you want to run Claude Code locally, check out my full guide to running Claude Code locally

Now let’s build something with it.

How to Build a Macro Tracker with OpenClaude?

OpenClaude can build full applications using a single prompt, just like the original Claude Code.

By giving it a natural language description of your app, it generates the complete code, loads existing skills, and asks setup questions automatically.

No coding experience needed.

Just paste this prompt:

Build an app that takes a photo of my food and breaks it down into calories
and macronutrients like protein, carbs, and fat.

Here’s the first output:

\Using OpenClaude\

OpenClaude automatically loaded my existing skills (superpowers) and asked 2-3 setup questions, just like the original Claude Code.

And after a few minutes, it’s finished, let’s test it.

\MacroTracker\

Is OpenClaude Worth Using?

OpenClaude is a free, open-source alternative to Claude Code that runs with Ollama’s free API. It’s not as fast as the original yet, but it can build real applications from a single prompt.

For developers who want Claude Code’s power without the subscription cost, OpenClaude is the best free option available today.

Pair it with Ollama, and you have the most powerful AI coding tool running on your machine without spending a cent.

I still am a Claude Max member, but you get the idea.

If you want to learn how to use Claude Code, check out my MasterClass. You’ll find all the essential information without a paywall, while my personal experiences are behind the paywall.

Thanks for reading.