Skip to content

Open Source Claude Code Alternatives

8 alternatives · Data checked · By , founder & editor · AI coding assistants

OpenCode is the best open source alternative to Claude Code. It is a terminal agent under the MIT license, it works with many model providers, and it runs on Linux and macOS. Parity is 37%, so some features are missing. Cline covers 63% of features inside an IDE, CLI or desktop app. gptme suits a local-first setup.

Best overall

Best for: Developers who want a MIT-licensed terminal coding agent that works with many model providers

229k ThrivingPermissive

Pick #2

Best for: Teams wanting an open source agent with any model in IDE, CLI or desktop

72k ThrivingPermissive

Pick #3

Best for: Users who want an open source terminal coding agent using OpenAI models

136k ActivePermissive

Compare OpenCode vs Cline side by side →

Why people leave Claude Code

Claude Code is an AI coding assistant from Anthropic that runs in your terminal. You describe a task in plain language, and it reads your codebase, edits files across the project, and runs commands to carry the work through. Developers use it for refactors, bug fixes, test writing and exploring unfamiliar repositories. It also integrates with IDEs, so you can use it next to your editor. It works as an autonomous agent that plans multi-step changes and uses codebase context to stay consistent. It is a commercial product that uses Anthropic's Claude models and is accessed through an Anthropic account.

  • Locked to one model provider. Claude Code is built around Anthropic's models and account sign-in. Open source tools let you point at other hosted providers or local models.
  • Usage costs depend on a vendor account. You pay through an Anthropic plan or API usage. Open source agents let you choose your own provider and control spend directly.
  • Code context goes to a hosted service. Prompts and file contents are sent to a remote model. Teams with strict privacy rules may prefer tools that can run against self-hosted models.
  • Closed source tool. You cannot inspect or modify how the agent builds context, runs commands or handles permissions. Open source agents can be audited and changed.

Quick comparison

#AlternativeLicenseStarsHealthPlatformsFitParityMigrationImports from Claude Code
1 OpenCode Permissive 229k Thriving CLI, Linux, macOS Direct replacement 37% Easy –
2 Cline Permissive 72k Thriving CLI, Linux, macOS Direct replacement 63% Easy –
3 codex Permissive 136k Active macOS Direct replacement 46% Easy –
4 crush Source available 29k Thriving – Direct replacement 33% Moderate No
5 Goose Permissive 57k Thriving CLI, Linux, macOS Direct replacement 33% Moderate –
6 pi Permissive 124k Thriving CLI, Linux, macOS Partial replacement 30% Moderate No
7 gptme Permissive 4.5k Active – Direct replacement 59% Easy –
8 Aider Permissive 50k Dormant CLI, Linux, macOS Partial replacement 37% Easy No

Fit = how much of Claude Code's job the tool replaces. Parity = share of Claude Code's core features the tool covers fully. Migration = effort to move your data and team over. Health and stars from November 24, 2026. How we rank.

The 8 best open source Claude Code alternatives

  1. 1

    OpenCode

    Open source terminal coding agent that works with many model providers

    229k Thriving 82 Permissive Direct replacement

    OpenCode is a MIT-licensed terminal agent that works with many model providers, and its 228,173 stars show wide adoption. Parity is only 37%, so expect to miss some Claude Code features. Cloud background agents and automated PR review are the main gaps.

    Strengths

    • MIT licensed and works with many model providers
    • Read-only plan agent asks before running bash commands
    • Many install routes: script, npm, Homebrew, pacman, Nix
    • Desktop app in beta for macOS, Windows and Linux

    Trade-offs

    • Cloud background agents not shown
    • Automated PR code review not shown
    • No inline completion as you type
    • No cloud background agents that produce PRs
    Best for
    Developers who want a MIT-licensed terminal coding agent that works with many model providers
    Fit
    Direct replacement · 37% feature parity
    Health
    82/100 (Thriving) · breakdown
    License
    Permissive (OSI) (MIT)
    Hosting
    Cloud from $4/mo
    Migration
    Easy
    Last commit
    Nov 2026
    • macOS
    • Linux
    • CLI

    Feature parity with Claude Code · 37%

    • Yes Multi-file editing
    • Yes Autonomous agent mode
    • Partly Codebase-aware context
    • Yes Terminal CLI
    Quick start
    curl -fsSL https://opencode.ai/v2/install | bash
  2. 2

    Cline

    Open source AI coding agent for IDE, terminal and desktop, usable with any model

    72k Thriving 83 Permissive Direct replacement

    Cline is the closest fit if you want Claude Code's agent workflow inside an IDE, CLI or desktop app with any model. It covers 63% of the features and has 71,791 stars. It has no cloud background agents and no automated PR review.

    Strengths

    • Runs in VS Code, JetBrains, CLI and a macOS and Windows desktop app
    • Plan and Act modes with approval for every edit and command
    • Diffs and checkpoints let you review and undo agent changes
    • Headless CLI and Node.js SDK for CI and custom agents

    Trade-offs

    • No cloud background agents
    • No automated PR code review
    • No inline tab completion as you type
    • JetBrains plugin is closed source
    Best for
    Teams wanting an open source agent with any model in IDE, CLI or desktop
    Fit
    Direct replacement · 63% feature parity
    Health
    83/100 (Thriving) · breakdown
    License
    Permissive (OSI) (Apache-2.0)
    Hosting
    Desktop / local
    Migration
    Easy
    Last commit
    Nov 2026
    • macOS
    • Linux
    • CLI

    Feature parity with Claude Code · 63%

    • Yes Multi-file editing
    • Yes Autonomous agent mode
    • Yes Codebase-aware context
    • Yes Terminal CLI
    • Yes IDE integration
    • Yes MCP support
    • Yes Multiple model choice
    • No Cloud background agents
    Quick start
    npm i -g cline
  3. 3

    codex

    Terminal coding agent from OpenAI that runs locally, for developers using OpenAI models

    136k Active 70 Permissive Direct replacement

    Codex is OpenAI's open source terminal coding agent, with 135,972 stars and a commit in November 2026. It covers 46.3% of Claude Code's features. It is built around OpenAI models and ChatGPT or API sign-in, though it can be configured for other providers and local models.

    Strengths

    • Apache-2.0 license, written in Rust
    • Installs through script, npm, Homebrew cask or binary
    • Prebuilt binaries for macOS and Linux, x86_64 and arm64
    • Works with a ChatGPT plan or an API key

    Trade-offs

    • Tied to OpenAI models and ChatGPT sign-in
    • API key use needs additional setup
    • Not self-hostable as a service
    Best for
    Users who want an open source terminal coding agent using OpenAI models
    Fit
    Direct replacement · 46% feature parity
    Health
    70/100 (Active) · breakdown
    License
    Permissive (OSI) (Apache-2.0)
    Hosting
    Cloud
    Migration
    Easy
    Last commit
    Nov 2026
    • macOS

    Feature parity with Claude Code · 46%

    • Yes Multi-file editing
    • Yes Autonomous agent mode
    • Yes Codebase-aware context
    • Yes Terminal CLI
    • Yes IDE integration
    • Partly Multiple model choice
    • Yes Cloud background agents
    Quick start
    npm install -g @openai/codex
  4. 4

    crush

    Terminal coding agent that works with many LLM providers, MCP and LSP

    29k Thriving 88 Source available Direct replacement

    Crush is a close terminal match with 29,147 stars and commits as recent as November 2026. It covers multiple providers with MCP and LSP context, but parity is 33.3%. Its FSL license is source-available, not OSI open source, and there is no official IDE extension.

    Strengths

    • Multi-provider, including custom compatible APIs
    • Switch models mid-session while keeping context
    • MCP over http, stdio and sse
    • Many install options including Homebrew, npm and winget

    Trade-offs

    • No official IDE extension
    • No cloud background agents
    • Source-available FSL license, not OSI open source
    • Not self-hostable as a service
    Best for
    Terminal users who want a multi-provider coding agent with MCP and LSP context
    Fit
    Direct replacement · 33% feature parity
    Health
    88/100 (Thriving) · breakdown
    License
    Source available (FSL-1.1)
    Hosting
    Desktop / local
    Migration
    Moderate
    Last commit
    Nov 2026

    Feature parity with Claude Code · 33%

    • Yes Autonomous agent mode
    • Partly Codebase-aware context
    • Yes Terminal CLI
    • No IDE integration
    • Yes MCP support
    • Yes Multiple model choice
    • No Cloud background agents
    Quick start
    brew install charmbracelet/tap/crush
  5. 5

    Goose

    Open source AI agent with desktop app and CLI that works with 85+ model providers

    57k Thriving 91 Permissive Direct replacement

    Goose is a general-purpose agent with a desktop app, a CLI and local model support, and it has 56,821 stars. It is less coding-focused and covers only 33.3% of Claude Code's features. Migration is moderate, and it has no cloud background agents.

    Strengths

    • Desktop app for macOS, Linux and Windows, plus a CLI
    • Connects to over 85 model providers
    • Loads local models directly without a separate server
    • MCP support for tools and data

    Trade-offs

    • No cloud background agents
    • Less coding-focused; general-purpose agent
    • No automated PR code review
    • No inline code completion
    Best for
    Users wanting a general-purpose open source agent with desktop app, CLI and local models
    Fit
    Direct replacement · 33% feature parity
    Health
    91/100 (Thriving) · breakdown
    License
    Permissive (OSI) (Apache-2.0)
    Hosting
    Desktop / local
    Migration
    Moderate
    Last commit
    Nov 2026
    • macOS
    • Linux
    • CLI

    Feature parity with Claude Code · 33%

    • Yes Autonomous agent mode
    • Yes Terminal CLI
    • Partly IDE integration
    • Yes MCP support
    • Yes Multiple model choice
    • No Cloud background agents
    Quick start
    curl -fsSL https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh | bash
  6. 6

    pi

    Terminal coding agent you extend with packages, skills and prompt templates

    124k Thriving 80 Permissive Partial replacement

    pi is a partial replacement for Claude Code, covering about 30% of its features. It suits developers who want a small terminal agent they can extend on their own. With 123,037 stars and a commit in November 2026, it is active, but you lose subagents, plan mode, an IDE extension and cloud background agents.

    Strengths

    • MIT license with an active release cadence: 25 releases in the last year
    • Extensions, skills, prompt templates and themes ship as packages through npm or git
    • Runs interactively, in print or JSON mode, over RPC, or through a TypeScript SDK
    • Installs through a shell script, npm, Homebrew or Nix on Linux and macOS

    Trade-offs

    • No built-in subagents or plan mode
    • No IDE extension
    • No cloud background agents
    • Sub-agents and plan mode are not included; you build or install them
    Best for
    Developers who want a minimal, hackable terminal agent they extend themselves
    Fit
    Partial replacement · 30% feature parity
    Health
    80/100 (Thriving) · breakdown
    License
    Permissive (OSI) (MIT)
    Hosting
    Desktop / local
    Migration
    Moderate
    Last commit
    Nov 2026
    • macOS
    • Linux
    • CLI

    Feature parity with Claude Code · 30%

    • Yes Autonomous agent mode
    • Yes Terminal CLI
    • No IDE integration
    • Yes Multiple model choice
    • No Cloud background agents
    • Partly Custom instructions and rules
    Quick start
    curl -fsSL https://pi.dev/install.sh | sh
  7. 7

    gptme

    Terminal AI agent that works with any model provider, for developers and knowledge workers

    4.5k Active 65 Permissive Direct replacement

    gptme is a local-first, provider-agnostic terminal agent that also handles general knowledge work. It covers 59.3% of features and has 4,490 stars. The main gaps are hosted background agents, automated PR review and official IDE extensions.

    Strengths

    • Works with Anthropic, OpenAI, Google, DeepSeek, OpenRouter and local Ollama models
    • Built-in shell, Python, web and vision tools
    • Supports MCP and ACP integrations plus plugins and skills
    • Sandboxed execution through Docker or Wasmtime

    Trade-offs

    • Hosted cloud background agents
    • Automated PR code review
    • Official IDE extensions
    • Small core team, with four contributors in the last 90 days
    Best for
    Users who want a provider-agnostic, local-first terminal agent that also does general knowledge work
    Fit
    Direct replacement · 59% feature parity
    Health
    65/100 (Active) · breakdown
    License
    Permissive (OSI) (MIT)
    Hosting
    Desktop / local
    Migration
    Easy
    Last commit
    Nov 2026

    Feature parity with Claude Code · 59%

    • Yes Multi-file editing
    • Yes Autonomous agent mode
    • Partly Codebase-aware context
    • Yes Terminal CLI
    • Partly IDE integration
    • Yes MCP support
    • Yes Multiple model choice
    • Partly Cloud background agents
    • Partly Custom instructions and rules
  8. 8

    Aider

    Terminal AI pair programmer that commits its edits to git, for use with any LLM

    50k Dormant 23 Permissive Partial replacement

    Aider covers about 37% of Claude Code's features, so it is a partial replacement. It suits you if you want git-centric pair programming in the terminal with any LLM. It has no autonomous multi-step agent loop and no MCP support. Its 50,215 stars are a strong base, but the last commit was May 2026.

    Strengths

    • Commits every change to git with a generated message
    • Connects to almost any LLM, including local models
    • Maps the codebase to help in larger projects
    • Runs linters and tests after edits

    Trade-offs

    • No autonomous multi-step agent loop
    • No cloud background agents
    • No MCP support
    • No releases in the past year and no recent contributors
    Best for
    Developers wanting git-centric AI pair programming in the terminal with any LLM
    Fit
    Partial replacement · 37% feature parity
    Health
    23/100 (Dormant) · breakdown
    License
    Permissive (OSI) (Apache-2.0)
    Hosting
    Cloud from $4/mo
    Migration
    Easy
    Last commit
    May 2026
    • macOS
    • Linux
    • CLI

    Feature parity with Claude Code · 37%

    • Yes Multi-file editing
    • Partly Autonomous agent mode
    • Yes Codebase-aware context
    • Yes Terminal CLI
    • Partly IDE integration
    • Yes Multiple model choice
    • No Cloud background agents
    • Partly Git and pull request integration
    Quick start
    python -m pip install aider-install
    aider-install

Feature parity: Claude Code vs the top 5

FeatureClaude CodeOpenCodeClinecodexcrushGoose
Multi-file editingYesYesYesYes––
Autonomous agent modeYesYesYesYesYesYes
Codebase-aware contextYesPartlyYesYesPartly–
Terminal CLIYesYesYesYesYesYes
IDE integrationYes–YesYesNoPartly
MCP supportYes–Yes–YesYes
Multiple model choicePartly–YesPartlyYesYes
Cloud background agentsYes–NoYesNoNo
Git and pull request integrationYes–––––
Custom instructions and rulesYes–––––

yes · partly · no · – not checked.

Cost to switch

What Claude Code costs your team in a year, against running an open source alternative yourself.

Claude Code per year

$2,400

OpenCode per year

$0

Free desktop app

You save

$2,400

Server prices are typical monthly VPS prices for the RAM the tool needs (2 GB when unknown). Your time to run and update it is not included; OpenCode also sells a hosted plan from $4/month.

How to choose

You want a terminal agent that is MIT-licensed and works with many model providers

→ OpenCode

It is MIT-licensed, runs in the terminal on Linux and macOS, and has 228,655 stars.

You want the widest feature coverage, including inside your IDE

→ Cline

It covers 63% of Claude Code's features and runs in an IDE, a CLI or a desktop app with any model.

You prefer to work with OpenAI models in a terminal agent

→ codex

It is OpenAI's own open source terminal agent, with ChatGPT or API sign-in, and it can be set up for other providers and local models.

You want a local-first agent that is not tied to one provider

→ gptme

It is provider-agnostic and local-first, covers 59.3% of features, and also handles general knowledge work.

You want a desktop app and a CLI that can run local models

→ Goose

It ships both a desktop app and a CLI and supports local models, though it is less coding-focused.

You prefer git-centric pair programming over an autonomous agent

→ Aider

It is built around git workflows with any LLM, but it has no multi-step agent loop and no MCP support.

Moving off Claude Code

  • OpenCode, Cline, codex, gptme and Aider are rated easy to move to. Crush, Goose and pi are rated moderate. None of the ones with a recorded answer, Crush, pi and Aider, import Claude Code settings directly.
  • Your code stays in your repository, so there is nothing to export. Switching mostly means adding an API key for the model provider you pick.
  • Plan to rewrite project instructions and custom prompts by hand in the format your new tool expects.
  • Cloud background agents and automated PR review have no equivalent in OpenCode, Cline, Goose or gptme, so you would need separate tooling for those.

Frequently asked questions

What is the best open source alternative to Claude Code?

OpenCode ranks first. It is an MIT-licensed terminal agent that works with many model providers. Cline is the pick if you want more feature coverage, at 63%, and IDE support.

Is there a free open source alternative to Claude Code?

Yes. OpenCode, Cline, codex, Goose, pi, gptme and Aider are all under OSI-approved permissive licenses. The tools are free, but you still pay for API usage unless you run a local model.

Which open source alternative works with an IDE?

Cline runs in an IDE, a CLI or a desktop app. Crush has no official IDE extension, and pi lacks one as well.

Which alternatives run on Windows, Mac or Linux?

OpenCode, Cline, Goose and pi list Linux and macOS support. codex lists macOS.

Can I use local models instead of Anthropic's Claude models?

Yes. Goose supports local models, and gptme is local-first and provider-agnostic. codex can also be configured for local models.

Is Crush open source?

Crush uses the FSL license, which is source-available rather than OSI open source. If license terms matter, OpenCode is the MIT-licensed option.

2026 edition. Rankings use fit, health, license and popularity; sponsors never change the order. Methodology · Report an error.