Claude Code Isn’t Open Source: 10 Open Source Alternatives That Run Free (2026)
AI Coding 15 min read By Sanjeev Pratap Singh
In this articleTable of contents10
Last updated: 5 December 2026
The best Claude Code open source alternative for most developers is OpenCode: MIT licensed, about 218,000 GitHub stars, free models included, and it works with 75+ model providers. If you already pay for ChatGPT, use OpenAI's Codex CLI (Apache 2.0) instead. If you want something tiny you can bend to your workflow, try Pi (MIT).
Claude Code itself is not open source. Its GitHub repository holds issues, plugins and docs, but the licence file reads "© Anthropic PBC. All rights reserved." You also need a paid Claude plan to use it. Below are ten agents whose code you can read, fork and run on your own laptop or VPS, with the licence, GitHub activity and free model route we checked on 20 October 2026, plus three projects that look alive in old listicles but aren't.
Quick answer: The best Claude Code open source alternative is OpenCode (MIT), a terminal, desktop and IDE agent with free models and 75+ providers. Codex CLI (Apache 2.0) is best if you have a ChatGPT plan. Pi (MIT) is the most hackable, Cline and Kilo Code suit VS Code users, and Goose and OpenHands suit teams that want self-hosted agents.
Is Claude Code open source?
No. Claude Code is proprietary software from Anthropic. The anthropics/claude-code repository (opens in new tab) has over 150,000 stars, which confuses a lot of people, but its LICENSE.md says "All rights reserved" and points to Anthropic's Commercial Terms of Service. You can't fork it, ship a modified build or self-host it.
It also isn't free. Here's what Claude's pricing page (opens in new tab) showed on 20 October 2026:
| Claude plan | Price | Claude Code included? |
|---|---|---|
| Free | $0 | No |
| Pro | $20/month (or $17/month billed yearly) | Yes |
| Max | From $100/month (5x or 20x Pro usage) | Yes |
What is the cost in Indian rupees? Claude bills in dollars, so at ₹95 per dollar Pro is about ₹1,900 a month (about ₹1,615 a month on the yearly plan) and Max starts at about ₹9,500 a month, plus 18% GST and your card's forex markup. Free stays ₹0.

Claude's pricing page on 20 October 2026: Claude Code first appears in the Pro list, so the Free plan can't run it.
What is the cost in Indian rupees? At ₹95 per dollar, Pro is about ₹1,900 billed monthly and Max from about ₹9,500 a month, before GST.
So people look for an open source Claude Code alternative for three reasons:
- Cost. $20 a month (about ₹1,900) plus GST is a lot for a student or a fresher, and Pro usage limits run out on heavy days.
- Model choice. Claude Code is built around Claude models. Open source agents let you switch between Claude, GPT, Gemini, DeepSeek, Qwen, Kimi or a local model mid-project.
- Control and privacy. With an open agent you can read exactly what it sends, run it on your own server, and keep office code on machines you control.
One honest caveat before the list: the agent is only half the story. An open source agent connected to a cloud model still sends your code to that model provider. For code that must never leave your machine, you need a local model too (covered below).
Claude Code open source alternatives compared
Licence, stars and last activity come from each project's GitHub repository on 20 October 2026. "BYOK" means bring your own key: you paste an API key from a model provider and pay that provider directly.
| Agent | Licence | GitHub stars | Runs in | Free model route | Best for |
|---|---|---|---|---|---|
| OpenCode | MIT | ~218,000 | Terminal, desktop, IDE | Built-in free models, Ollama | Best overall |
| Codex CLI | Apache 2.0 | ~130,000 | Terminal, IDE | Ollama or LM Studio (--oss) |
ChatGPT plan holders |
| Pi | MIT | ~116,000 | Terminal, SDK | Any local provider | Hackers who customise |
| Gemini CLI | Apache 2.0 | ~107,000 | Terminal | None built in (Gemini API key or Vertex AI) | Gemini API users |
| OpenHands | MIT | ~91,000 | Local app, Docker, cloud | Any LLM, local models | Self-hosted team agents |
| Cline | Apache 2.0 | ~71,000 | VS Code, CLI, SDK | Ollama, LM Studio, free OpenRouter models | Step-by-step approvals |
| Goose | Apache 2.0 | ~55,000 | Desktop, CLI, API | Ollama | General agent, Linux Foundation |
| Aider | Apache 2.0 | ~50,000 | Terminal | Ollama | Git-first pair programming |
| Qwen Code | Apache 2.0 | ~29,000 | Terminal | Ollama or vLLM | Qwen and open-weight models |
| Kilo Code | MIT | ~28,000 | VS Code, JetBrains, CLI | "Auto Free" gateway models | Free models with zero setup |

Claude Code's licence reads "All rights reserved" and it needs Pro at $20 a month; OpenCode (MIT) tops our list of ten open source agents.
The 10 best open source Claude Code alternatives
1. OpenCode: best Claude Code open source alternative overall
OpenCode is the closest open source match for the Claude Code experience. It's a terminal agent that reads your repo, plans, edits files and runs commands, and it also ships as a desktop app and an IDE extension. The repo moved to anomalyco/opencode (opens in new tab) and is MIT licensed, with commits landing daily.
- Models: 75+ providers through Models.dev, including Anthropic, OpenAI, Google and local models, per OpenCode's site (opens in new tab). You can also log in with GitHub to use a Copilot plan, or with OpenAI to use a ChatGPT Plus or Pro plan.
- Free route: a set of free models is included, so you can start without a card.
- Paid option: OpenCode Go costs $10 a month for a bundle of open coding models; Go Plus is $40 a month. At ₹95 per dollar that's about ₹950 and ₹3,800.
- Best for: anyone leaving Claude Code who wants the same terminal workflow without being tied to one model company.
The big advantage is switching. Use a cheap open model for boilerplate, then switch to Claude or GPT for a hard bug, all in one session.
2. Codex CLI: best if you already pay for ChatGPT
OpenAI's Codex CLI (opens in new tab) is open source under Apache 2.0, even though the models behind it are not. It runs in your terminal, works in a sandbox by default, and you sign in with your ChatGPT account.
- Plans: Codex is included with ChatGPT Plus, Pro, Business, Edu and Enterprise. Free and Go users get a lighter model in the Codex app, subject to rollout, per OpenAI's Codex pricing page.
- Local models: the CLI has a built-in
--ossmode that connects to Ollama or LM Studio, so you can run it fully offline. - Install:
npm install -g @openai/codexor Homebrew, then runcodex.
If you're already paying for ChatGPT Plus, this is the cheapest way to get a Claude Code style agent: no extra bill. Students should check the GitHub Student Developer Pack too, since Copilot credits also work inside OpenCode.
3. Pi: the most hackable minimal agent
Pi is a small, MIT licensed agent toolkit that has grown to about 116,000 stars at earendil-works/pi (opens in new tab). It deliberately skips features like sub-agents and plan mode. Instead, you add what you want through extensions, skills, prompt templates and themes, or ask Pi to build the feature for you.
- Install: a one-line script from pi.dev, or
npm install -g --ignore-scripts @earendil-works/pi-coding-agent(needs Node.js 22.19 or newer). - Models: run
/logininside Pi to connect a subscription or API key; local providers work too. - Modes: interactive, print/JSON for scripts, RPC, and a TypeScript SDK.
Pick Pi if Claude Code feels like too much magic and you want an agent whose every behaviour you can read in an afternoon. Note that new contributors' issues and pull requests are auto-closed by default and reviewed by maintainers daily.
4. Cline: best for approving every step
Cline (opens in new tab) (Apache 2.0, about 71,000 stars) began as a VS Code extension and now also runs as a CLI and an SDK. It shows a plan, then asks your permission before each file edit or command. That makes it slower than Claude Code, and much harder to surprise you.
- Models: Anthropic, OpenAI, Gemini, OpenRouter, DeepSeek, Groq, and local models through Ollama or LM Studio.
- Cost: the tool is free; you pay the model provider per task, and Cline shows a running cost.
- Best for: beginners learning what an agent actually does, and anyone working on code where one wrong
rmwould hurt.
5. Kilo Code: easiest free models
Kilo Code (opens in new tab) (MIT) works in VS Code, JetBrains IDEs and the terminal. Its "Auto Free" mode routes requests to free models through the Kilo Gateway, so you can start with no API key at all. Paid credits are optional.
Free models are slower at busy hours and change often. Treat them as a way to learn and do small tasks, not as a full replacement for Claude on a big refactor.
6. Goose: best general-purpose agent with neutral governance
Goose (opens in new tab) (Apache 2.0, about 55,000 stars) started at Block and is now part of the Agentic AI Foundation at the Linux Foundation. That matters if your company is wary of tools owned by a single vendor. It's written in Rust and comes as a desktop app for macOS, Linux and Windows, a CLI, and an API.
- Models: 15+ providers including Anthropic, OpenAI, Google, Ollama, OpenRouter, Azure and Bedrock. It can also use existing Claude, ChatGPT or Gemini subscriptions through ACP (Agent Client Protocol).
- Extensions: 70+ through MCP. New to MCP? Read what an MCP server is first.
- Best for: people who want one agent for coding plus research, writing and automation.
7. OpenHands: best for self-hosted, always-on agents
OpenHands (opens in new tab) (MIT, about 91,000 stars) has changed shape in 2026. The main repo is now "Agent Canvas", a self-hosted control centre that runs the OpenHands agent and can also drive Claude Code, Codex, Gemini CLI, Pi and OpenCode through ACP. Agents can run locally, in Docker, on VMs or on OpenHands Cloud.
This is the pick for a small team that wants agents working on GitHub issues while laptops are closed. Put it on a VPS, connect it over SSH, and let it pick up tasks. For a single developer it's more setup than you need; a separate lightweight OpenHands CLI exists for terminal use.
8. Aider: best Git-first pair programmer
Aider (opens in new tab) (Apache 2.0, about 50,000 stars) is the original terminal pair programmer. Every change it makes becomes a Git commit with a clear message, so undoing a bad edit is one git reset away. It works with almost any model, including local ones.
The catch: Aider's last code push was 22 May 2026. It still works, and many people love its predictable style, but it isn't moving as fast as OpenCode or Codex. Use it if you want a simple tool that does one thing well.
9. Qwen Code: best for open-weight Qwen models
Qwen Code (opens in new tab) (Apache 2.0) is Alibaba's terminal agent. It supports OpenAI, Anthropic, Gemini and Qwen APIs, plus local models through Ollama or vLLM, and you can switch providers mid-session.
Many 2025 articles call it "Claude Code for free" because of its free Qwen OAuth login. That changed: the project's GitHub issue #3203 (opens in new tab) cut the daily free quota from 1,000 to 100 requests and set 15 April 2026 as the date to close the free OAuth entry point. Today you bring a key or run a model locally.
10. Gemini CLI: open source, but the free tier moved
Gemini CLI (opens in new tab) (Apache 2.0, about 107,000 stars) is still active and still open source. What changed is access: for unpaid and Google One users, Google replaced Gemini CLI with Antigravity CLI on 18 June 2026, and its README now recommends Antigravity CLI for the newest Gemini models. Gemini CLI still works with a Gemini API key or Vertex AI.
Use it if you have a Gemini API key or a paid Code Assist licence. If you just want free Google AI in the terminal, our free Cursor AI alternatives guide covers Antigravity.
Claude Code vs OpenCode: which should you use?
Stay on Claude Code if you're happy with Claude models, the Pro limits cover your week, and you value the polish. Switch to OpenCode if you want model choice, lower cost or an open codebase. Most of your habits carry over: both run in the terminal, both read an instructions file in your repo, and both support MCP servers.
| Claude Code | OpenCode | |
|---|---|---|
| Licence | Proprietary, all rights reserved | MIT |
| Price | Needs Claude Pro ($20/month) or Max | Free; optional Go at $10/month |
| Models | Claude models | 75+ providers, free models, local models |
| Use existing subscriptions | Claude plans | Copilot, ChatGPT Plus/Pro, API keys |
| Interfaces | Terminal, IDE extensions | Terminal, desktop, IDE |
| Self-host or fork | No | Yes |
What is the cost in Indian rupees? At ₹95 per dollar, Claude Pro is about ₹1,900 a month and OpenCode Go about ₹950, both billed in dollars plus GST. OpenCode itself is free.
You can also mix them. Ollama (v0.14.0 and later) offers an Anthropic-compatible API (opens in new tab), so Claude Code can talk to a local open model: set ANTHROPIC_BASE_URL=http://localhost:11434 and ANTHROPIC_AUTH_TOKEN=ollama, then start claude with an Ollama model. Claude Code stays closed source, but your model bill drops to zero. Ollama recommends a model with at least 64k context for this.
How to run these agents for $0
Yes, you can run a Claude Code style agent without paying anyone. There are three routes, from easiest to most private:
- Free hosted models. OpenCode's included free models or Kilo Code's Auto Free. No setup, but slower at peak hours and the model list changes.
- Free credits you already have. A ChatGPT plan works in Codex CLI and OpenCode; a Copilot plan (free for verified students) works in OpenCode.
- Local models. Install Ollama, pull a coding model sized for your RAM, and point OpenCode, Codex CLI (
codex --oss), Cline, Aider, Goose or Qwen Code at it.
For local models, hardware decides everything. Small coding models run on a 16 GB RAM laptop but are slower and make more mistakes than Claude. A GPU with 8 GB or more of VRAM helps a lot. Our guide to run an LLM locally on your laptop covers model sizes, and if Ollama ignores your graphics card, follow Ollama not using GPU fixes.

Free hosted models are easiest, plans you already pay for add no bill, and local models through Ollama keep your code on your machine.
A safety rule for every agent on this list: start in a mode that asks before running commands, and run agents inside a Git repo so you can roll back. Open source doesn't mean safe by default. An agent with shell access can delete files just as fast as Claude Code can.
Projects to skip or watch
Older "Claude Code alternatives" lists still recommend tools that have stalled or changed licence. As of 20 October 2026:
- Roo Code: its GitHub repository is archived (last push 15 May 2026). No new fixes.
- Kimi CLI (Python): archived and marked legacy. Moonshot now points to the newer Kimi Code CLI (opens in new tab), which is MIT licensed and active.
- Plandex: not archived, but its last code push was 3 October 2025. Treat it as dormant.
- Crush (Charm): active and popular (about 29,000 stars), but it uses the Functional Source License (FSL-1.1-MIT), which only turns into MIT later. It's source-available, not OSI open source today.
- Mistral Vibe: Apache 2.0 and active, but small (about 5,000 stars) and built mainly around Mistral's models. Worth a look if you already use Mistral.

Roo Code and the old Kimi CLI are archived, Plandex is dormant and Crush is source-available, so check a project's status before you adopt it.
Which alternative fits you?
Pick by your situation:
- You want Claude Code's workflow, open source: OpenCode.
- You already pay for ChatGPT Plus: Codex CLI.
- You like to tinker and build your own tools: Pi.
- You live in VS Code and want approvals: Cline, or Kilo Code for free models.
- JetBrains user (IntelliJ, PyCharm, Android Studio): Kilo Code.
- Team that wants agents on a server: OpenHands, or Goose for neutral Linux Foundation governance.
- Office code that can't leave your machine: any of the above plus a local model through Ollama.
- You just want the cheapest editor setup: see our Cursor vs GitHub Copilot comparison for the paid IDE side.
A sensible default for most readers: OpenCode with free models for daily work, and a paid model only for hard bugs. Much of everyday agent work is small (renaming, writing tests, fixing lint), and free models handle that well enough.
Claude Code open source alternative: the short list
- Claude Code is proprietary ("All rights reserved") and needs Claude Pro ($20/month) or Max; the Free plan doesn't include it.
- OpenCode (MIT) is the best Claude Code open source alternative: terminal, desktop and IDE, 75+ providers, free models.
- Codex CLI (Apache 2.0) is the cheapest route for ChatGPT Plus users and runs local models with
--oss. - Pi, Cline, Kilo Code, Goose, OpenHands, Aider and Qwen Code are all open source and actively maintained, Aider more slowly.
- Skip Roo Code and the old Kimi CLI (archived); Crush is source-available, not open source.
Install OpenCode first, then add Codex CLI
If you want a Claude Code open source alternative today, install OpenCode first, connect a free model or a key you already have, and try it on one real task. Add Codex CLI if you pay for ChatGPT, and keep Ollama ready for code that must stay offline. You keep the terminal workflow you liked in Claude Code, and you decide which model and which bill come with it.
Next, compare the IDE side in our list of free Cursor AI alternatives, or browse more guides in AI Coding.
FAQ
Frequently Asked Questions
Is Claude Code open source?
No. Claude Code is proprietary. Its GitHub repository has public issues, plugins and docs, but the licence file says "© Anthropic PBC. All rights reserved" and use is governed by Anthropic's Commercial Terms of Service. You can't fork, modify or self-host it. OpenCode (MIT) and Codex CLI (Apache 2.0) are the closest open source options.
What is the best open source alternative to Claude Code?
OpenCode is the best open source alternative to Claude Code for most people. It is MIT licensed, has about 218,000 GitHub stars, runs in the terminal, as a desktop app and in IDEs, and connects to 75+ model providers, including free and local models. Codex CLI is the better pick if you already have a ChatGPT plan.
Is there a free alternative to Claude Code?
Yes. OpenCode includes free models, Kilo Code has an Auto Free mode, and any open source agent on this list can run a local model through Ollama at no cost. Codex CLI also costs nothing extra if you already pay for ChatGPT Plus. Free hosted models are slower and less capable than Claude on large refactors.
Is OpenCode better than Claude Code?
OpenCode is better if you want model choice, an open codebase and lower cost. Claude Code is more polished and tuned for Claude models, so it can feel more reliable on long, multi-step changes. Many developers use OpenCode with a Claude API key or a Copilot plan to get Claude-level models inside an open tool.
Can I use Claude Code with local models?
Yes. Ollama version 0.14.0 and later offers an Anthropic-compatible API. Set ANTHROPIC_BASE_URL to your local Ollama address and ANTHROPIC_AUTH_TOKEN to "ollama", then start Claude Code with an Ollama model name. The tool remains closed source, but you pay nothing for the model. Ollama recommends models with at least 64k context.
Is Codex CLI open source?
Yes. OpenAI's Codex CLI is open source under the Apache 2.0 licence, with about 130,000 GitHub stars. The models it uses by default are not open source. You sign in with a ChatGPT plan or an API key, or use the built-in –oss mode to run local models through Ollama or LM Studio.
How much does Claude Code cost in India?
Claude Code needs a paid Claude plan. Pro costs $20 a month billed monthly, or $17 a month billed yearly, which is about ₹1,900 a month at ₹95 per dollar, before 18% GST. Max starts at $100 a month for 5x Pro usage. The free Claude plan does not include Claude Code.
Is Aider still maintained?
Aider still works and remains Apache 2.0 licensed with about 50,000 GitHub stars, but its last code push was on 22 May 2026. That makes it slower moving than OpenCode, Codex CLI or Cline. It is still a good choice if you like its Git-first style, where every change becomes a commit.
Which open source coding agent works with JetBrains IDEs?
Kilo Code is the easiest open source agent for JetBrains IDEs like IntelliJ IDEA, PyCharm and Android Studio. It is MIT licensed, also runs in VS Code and the terminal, and offers free models through its Auto Free mode. OpenCode also ships an IDE extension, so check its docs for your editor.


