Back to all posts
Guide
11 min read

9 Open Source Claude Code Alternatives

DevToolLab Team

DevToolLab Team

June 7, 2026 (Updated: October 4, 2026)

9 Open Source Claude Code Alternatives

Claude Code is a strong terminal coding agent, but it is a closed product. The CLI is "All rights reserved" software from Anthropic, it runs Claude models only, and it needs a paid Claude subscription (Pro, Max, Team or Enterprise) or an Anthropic Console account with API billing. There is no free tier. If you want to audit what an agent does to your repository, run it against a local model, or stop paying one vendor per seat, that is a real constraint.

Nine open-source agents cover most of what Claude Code does, led by OpenCode at 211,651 GitHub stars and OpenAI's Codex CLI at 127,771 as of October 4, 2026. This guide compares all nine on license, release activity, model access and cost, and flags what moved, changed pricing or stopped since the post first ran in June 2026.

Why Open Source Matters for Coding Agents

An agent that edits files and runs shell commands in your repository works with your permissions. Open source means you can read what it sends, pin a version, and fork it if the maintainer changes direction, which happens a lot in this category: four of the nine projects below have moved to a new GitHub organization. Open agents are also model-agnostic, so the same tool can run a frontier API model for a hard refactor and a local model through Ollama for routine edits.

Quick Comparison

Stars, versions and release dates were checked against GitHub, npm and PyPI on October 4, 2026.

ToolLicenseGitHub starsLatest releaseModel accessBest for
OpenCodeMIT211.6k1.18.34 (Sep 30, 2026)75+ providers, local models, free models includedClosest Claude Code replacement
OpenAI Codex CLIApache 2.0127.8k0.160.0 (Oct 1, 2026)ChatGPT plan or OpenAI API keySandboxed edits, ChatGPT subscribers
PiMIT112.2k1.0.2 (Oct 4, 2026)Subscription or API key via /loginBuilding your own agent workflow
Gemini CLIApache 2.0107.2k0.62.0 (Sep 29, 2026)Paid Gemini API key or Code Assist licenseGemini 3 with a 1M-token context
OpenHandsMIT89.9k1.24.0 (Sep 25, 2026)Any LLMAutonomous agents on your own server
ClineApache 2.069.8kCLI 3.0.68 (Oct 2, 2026)Any major provider, Ollama, LM StudioPlan-then-act review in the IDE
GooseApache 2.054.9k1.53.0 (Oct 2, 2026)15+ providers, existing subscriptions via ACPCode plus ops and data work
AiderApache 2.049.4k0.86.2 (Feb 12, 2026)Almost any LLM, including localOne Git commit per AI change
Qwen CodeApache 2.028.3k0.24.7 (Sep 29, 2026)OpenAI, Anthropic, Gemini, Qwen APIs, Ollama, vLLMQwen models, mixed API protocols

The Open Source Alternatives

OpenCode

The opencode.ai homepage, with the headline The open source AI coding agent, a curl install command and a terminal session below it
The opencode.ai homepage, with the headline The open source AI coding agent, a curl install command and a terminal session below it

OpenCode is the closest open-source equivalent to Claude Code and the most-starred project here, under MIT. The repository now lives in the anomalyco organization, and the old sst/opencode URL redirects there. It connects to 75+ LLM providers through Models.dev, including local models, includes some free models, and can sign in with a ChatGPT Plus or Pro account.

Two built-in agents split the work, and Tab switches between them: build has full access, while plan is read-only, denies file edits and asks before running bash commands. OpenCode loads the right language server for the model automatically and can run several agents on the same project at once. A desktop app is in beta for macOS, Windows and Linux.

One naming trap: opencode-ai/opencode is a different, archived Go project. Its author continued it as Crush at Charm, under the source-available Functional Source License (FSL-1.1-MIT).

Bash
curl -fsSL https://opencode.ai/install | bash   # or: npm i -g opencode-ai@latest
cd your-project && opencode

OpenAI Codex CLI

The OpenAI Codex product page, with the Codex app icon, the tagline Your AI assistant for work and a Download for macOS button
The OpenAI Codex product page, with the Codex app icon, the tagline Your AI assistant for work and a Download for macOS button

OpenAI Codex CLI is OpenAI's local coding agent, written in Rust under Apache 2.0. It does not need an API key: run codex, choose Sign in with ChatGPT, and usage comes out of a Plus, Pro, Business, Edu or Enterprise plan. An OpenAI API key still works.

Its safety model is OS-level sandboxing. On macOS it uses the built-in Seatbelt framework, on Linux and WSL2 it uses bubblewrap, and on Windows it uses a native sandbox. The default workspace-write mode lets the agent edit files and run routine commands inside the project, and it asks before using the network or touching anything outside the workspace. /permissions switches profiles mid-session, and the same agent runs as an IDE extension and a desktop app.

Bash
npm install -g @openai/codex   # or: brew install --cask codex
codex

Pi

The pi.dev homepage with the Pi logo, the line There are many agent harnesses, but this one is yours, and a curl install command
The pi.dev homepage with the Pi logo, the line There are many agent harnesses, but this one is yours, and a curl install command

Pi is a minimal agent harness rather than a finished product, and version 1.0.2 shipped on October 4, 2026. It leaves out sub-agents and plan mode on purpose. You add them through extensions, skills, prompt templates and themes, bundled as Pi packages and shared over npm or git, or you ask Pi to build the feature itself. It runs interactively, in print or JSON mode for scripts, over RPC, or embedded through a TypeScript SDK. Our agent harness explainer covers the 1.0 design.

The tradeoff is safety. Pi has no built-in permission system and runs with the full permissions of whoever launched it, so its docs recommend a Docker container, a Gondolin micro-VM or a policy sandbox. If you installed it earlier this year, the package moved from @mariozechner/pi-coding-agent, which stopped at 0.73.1 in May 2026, to @earendil-works/pi-coding-agent.

Bash
curl -fsSL https://pi.dev/install.sh | sh
cd your-project && pi   # then /login to connect a subscription or API key

Gemini CLI

The geminicli.com homepage, with a banner saying Gemini CLI was replaced by Antigravity CLI for unpaid users on June 18, 2026
The geminicli.com homepage, with a banner saying Gemini CLI was replaced by Antigravity CLI for unpaid users on June 18, 2026

Gemini CLI is Google's open-source terminal agent under Apache 2.0, with weekly stable releases. It runs Gemini 3 models with a 1M-token context window, grounds answers with Google Search, and supports MCP servers.

Check the access rules before treating it as a free option, because they changed. Until June 18, 2026, a personal Google account got 1,000 free requests a day. On that date Google stopped serving Gemini CLI to free Code Assist for individuals users and to Google AI Pro and Ultra subscribers, and moved them to its new Antigravity CLI. Gemini CLI still works with a paid Gemini API key or a Gemini Code Assist Standard or Enterprise license, and the code stays open source. The README still advertises the old free tier, so trust the announcement.

Bash
npm install -g @google/gemini-cli   # or: brew install gemini-cli
gemini

OpenHands

The openhands.dev homepage with the headline Build with coding agents, your way, and workflow cards for fixing vulnerabilities and reviewing PRs
The openhands.dev homepage with the headline Build with coding agents, your way, and workflow cards for fixing vulnerabilities and reviewing PRs

OpenHands, formerly OpenDevin, is the autonomous end of this list: you describe an outcome and it plans and executes the steps, in a Docker sandbox if you run it that way. Its 1.24.0 release reframes the project as Agent Canvas, a self-hosted control center that runs the OpenHands agent and can also drive Claude Code, Codex or Gemini through the Agent Client Protocol (ACP). Agents run locally, in Docker, on VMs or in the cloud, and automations tied to Slack, GitHub or Linear run on a schedule or on webhook events.

If you are looking for the old ghcr.io/all-hands-ai/openhands:latest image on port 3000, the README no longer uses it. The current Docker command serves the UI on port 8000 and only sees projects under PROJECTS_PATH:

Bash
export PROJECTS_PATH="$HOME/projects"
mkdir -p "$PROJECTS_PATH" "$HOME/.openhands"
docker run -it --rm \
  -p 127.0.0.1:8000:8000 \
  -e AGENT_CANVAS_ALLOW_LAN_SESSION_KEY=true \
  -v "$HOME/.openhands:/home/openhands/.openhands" \
  -v "${PROJECTS_PATH}:/projects" \
  ghcr.io/openhands/agent-canvas:1.24.0

Cline

The cline.bot homepage with the headline The Open Coding Agent, tabs for the CLI, IDE extension and SDK, and an npm i -g cline install command
The cline.bot homepage with the headline The Open Coding Agent, tabs for the CLI, IDE extension and SDK, and an npm i -g cline install command

Cline started as a VS Code extension and is now a family: the extension, a JetBrains plugin, a CLI with an interactive mode and a headless mode for CI, a desktop app for macOS and Windows, and an SDK. One caveat the README states plainly: the JetBrains plugin is not open source.

Its workflow suits teams that review everything. In Plan mode Cline explores the codebase, asks clarifying questions and proposes a strategy; in Act mode it executes, and every file edit and terminal command waits for your approval unless you turn on auto-approve. Checkpoints let you undo the agent's work, and .clinerules files carry project conventions across the CLI and both IDEs. Newer additions include multi-agent teams (cline --team-name auth-sprint "...") and agents that run on cron schedules.

npm i -g cline
cline

Goose

The goose-docs.ai homepage, with a banner saying goose has moved to the Agentic AI Foundation, and the goose logo
The goose-docs.ai homepage, with a banner saying goose has moved to the Agentic AI Foundation, and the goose logo

Goose is a general-purpose agent rather than a coding specialist: research, data analysis and automation sit next to code edits in the same session. Block built it and in December 2025 donated it to the Linux Foundation's Agentic AI Foundation, which is why the repository now lives at aaif-goose/goose.

It is written in Rust and ships as a desktop app for macOS, Linux and Windows, a CLI and an API. It supports 15+ providers, connects to 70+ MCP extensions, and can use an existing Claude, ChatGPT or Gemini subscription through ACP instead of an API key.

Bash
curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash
goose configure   # pick a provider
goose session

Aider

The aider.chat homepage with the headline AI pair programming in your terminal, a terminal demo session, and badges for GitHub stars, installs and tokens per week
The aider.chat homepage with the headline AI pair programming in your terminal, a terminal demo session, and badges for GitHub stars, installs and tokens per week

Aider pioneered Git-native pair programming in the terminal. Every change becomes a commit with a descriptive message, so git diff and git revert are your review and undo tools. A tree-sitter repo map gives the model a compressed view of the whole codebase, and Aider can lint and run your tests after each change.

Development has slowed, and you should know that before standardizing on it. The latest PyPI release is 0.86.2 from February 12, 2026, the last commit landed on May 22, 2026, and the README still recommends Claude 3.7 Sonnet and o3-mini. It is still the best fit when every AI edit must be its own commit.

Bash
python -m pip install aider-install
aider-install
cd your-project && aider

Qwen Code

The Qwen Code documentation overview page, with install commands for Linux, macOS and Windows and a sidebar listing VS Code, Zed and JetBrains integrations
The Qwen Code documentation overview page, with install commands for Linux, macOS and Windows and a sidebar listing VS Code, Zed and JetBrains integrations

Qwen Code is Alibaba's terminal agent, built around the Qwen models but speaking the OpenAI, Anthropic, Gemini and Qwen APIs, plus local models through Ollama or vLLM, with provider switching at runtime. Beyond the CLI it has a desktop app, an experimental web UI (qwen serve), VS Code, Zed and JetBrains integrations, and a headless qwen -p mode for CI.

The free path changed this year. The Qwen OAuth free tier was discontinued on April 15, 2026, so you now need an API key, an Alibaba Cloud Coding Plan or Token Plan, or a local model.

Bash
npm install -g @qwen-code/qwen-code@latest   # Node.js 22+, or: brew install qwen-code
cd your-project && qwen   # then /auth to pick a provider

Is There a Free Claude Code Alternative?

Yes, if you supply the model. OpenCode, Cline, Goose, Aider and Qwen Code all run against a local model through Ollama or another local server, so your only cost is hardware; our VRAM requirements guide covers how much GPU memory a usable coding model needs. OpenCode also includes free hosted models. If you already pay for a chat subscription, Codex CLI runs on a ChatGPT plan and Goose can use an existing Claude, ChatGPT or Gemini subscription. The Gemini CLI and Qwen OAuth free tiers both ended in 2026, so older guides that list them as free are out of date.

Projects That Moved or Stopped in 2026

  • Continue marked its continuedev/continue repository read-only after a final release and says it is no longer actively maintained.
  • Roo Code, a popular Cline fork, archived its repository in May 2026.
  • Four repositories moved organizations, and GitHub redirects the old URLs: sst/opencode to anomalyco/opencode, All-Hands-AI/OpenHands to OpenHands/OpenHands, block/goose to aaif-goose/goose, and badlogic/pi-mono to earendil-works/pi.
  • Gemini CLI and Qwen Code both ended their free sign-in tiers, on June 18 and April 15, 2026.

How to Choose

Start from the constraint that matters most to you, not from star counts.

If you wantPickWhy
The closest Claude Code replacementOpenCodebuild and plan agents, 75+ providers, free models included
To use a ChatGPT plan you already pay forCodex CLISign in with ChatGPT, OS-level sandbox by default
To build your own agent workflowPiMinimal core, packages, SDK and RPC modes
Gemini 3 with a 1M-token contextGemini CLIPaid API key or Code Assist license since June 2026
Autonomous agents on a serverOpenHandsAgent Canvas, Docker sandboxes, Slack and GitHub automations
To approve every edit inside your IDEClinePlan and Act modes, checkpoints, .clinerules
One agent for code plus ops and data workGoose70+ MCP extensions, Linux Foundation governance
One Git commit per AI changeAiderAuto-commits and repo map, slower development in 2026
Qwen models or a mix of API protocolsQwen CodeOpenAI, Anthropic, Gemini and Qwen APIs plus Ollama and vLLM

Conclusion

For most developers leaving Claude Code, start with OpenCode: it has the largest community, the broadest model support, and a plan and build split that mirrors how Claude Code gets used day to day. Add Codex CLI if you already pay for ChatGPT, since that subscription covers it, and reach for Aider on repositories where every AI change must be its own commit. For a zero-cost setup, pair OpenCode or Cline with a local model and size the GPU first. Re-check access terms before you standardize a team, because two free tiers ended this year.

Related Posts

Best HR Software for UK Enterprise (1000+)

Nine HR platforms ranked for UK companies past 1,000 employees, from HiBob to Workday, SAP SuccessFactors and Oracle, on scale, security and UK payroll.

By DevToolLab Team•

Gemini Code Assist vs Antigravity in 2026

Google stopped selling Gemini Code Assist on October 9, 2026. The renewal deadlines, what Antigravity changes, seat costs, and a tested Gemini CLI migration.

By DevToolLab Team•

7 Best NotebookLM Alternatives in 2026

NotebookLM is now Gemini Notebook. ChatGPT, Claude and Copilot projects plus Open Notebook, SurfSense, AnythingLLM and kotaemon, tested on 32 RFCs.

By DevToolLab Team•