AI agents · OpenClaw · self-hosting · automation

Quick Answer

Best Open-Source Claude Code Alternatives (2026 Ranked)

Published:

The short answer

OpenCode is the best open-source Claude Code alternative for most developers; Codex CLI if you live in ChatGPT; Cline or Kilo Code if you want the agent inside VS Code; OpenHands if the agent should run unattended. Licences, versions and stars below were read from GitHub on November 20, 2026.

AgentLicenceLatest releaseGitHub starsInterfaceModelsBest for
OpenCodeMITv1.19.6 (Nov 17, 2026)~228,000Terminal (TUI), desktopAny provider, local modelsClosest drop-in for Claude Code, no lock-in
Codex CLI (OpenAI)Apache-2.0rust-v0.171.0 (Nov 20, 2026)~136,000Terminal, IDE extensionGPT-6.2 Sol, GPT-6.1 Terra and other OpenAI modelsChatGPT Plus/Pro subscribers
ClineApache-2.0v4.1.26 (Oct 26, 2026)~72,000VS Code extension, CLIAny providerApprove-every-step agent inside the editor
Kilo CodeMITv7.8.27 (Nov 5, 2026)~28,000VS Code, JetBrainsAny providerEditor agent with modes (architect, code, debug)
OpenHandsMITv1.42.0 (Nov 18, 2026)~94,000Web UI, CLI, headlessAny providerAutonomous agents in Docker sandboxes and CI
Qwen CodeApache-2.0active (commits Nov 20, 2026)~31,000TerminalQwen models first, OpenAI-compatible APIsTeams on Qwen or Alibaba Cloud

Not on the list, and why: Gemini CLI (Apache-2.0, v0.70.0) has no free tier since June 18, 2026, so it is only an alternative if you pay for Gemini API access. Crush by Charmbracelet is popular but licensed FSL-1.1-MIT — source-available, converting to MIT later — not open source today. Aider (Apache-2.0) still works, but its last tagged release was v0.86.0 in August 2025. Claw Code (MIT, ~195,000 stars) is a clean-room reimplementation of Claude Code itself; see what is Claw Code.

The alternatives in detail

OpenCode — the default pick. A terminal agent with a polished TUI, a desktop app, LSP integration and support for 75+ model providers through one config. You can run Claude through your own Anthropic key, GPT through OpenAI, or a local model at zero marginal cost. It is the most-starred open-source coding agent on GitHub and ships releases several times a week. Pick it if you like Claude Code’s workflow and want to keep it while choosing the model. Our deeper comparison is OpenCode vs Claude Code vs Codex CLI.

Codex CLI — open source, OpenAI-first. The CLI is Apache-2.0 and written in Rust; sign in with ChatGPT and usage comes out of your Plus or Pro plan, or use an API key. It is the most like-for-like swap if your company already standardised on ChatGPT. It is open source, but practically tied to OpenAI models. See current API prices for GPT-6.2 Sol ($2/$10 per million tokens).

Cline and Kilo Code — agents inside the editor. Both run in VS Code and show every file edit and terminal command for approval, which suits developers who want control over each step. Kilo Code adds JetBrains support and role-based modes. For a three-way comparison with Continue, see Kilo Code vs Cline vs Continue.

OpenHands — the autonomous option. OpenHands runs the agent in a Docker sandbox and can be driven from a web UI, a CLI or headlessly in CI, which makes it the open-source answer to cloud agents such as Codex cloud tasks or Devin. Use it to fix issues or run migrations without a human watching each step.

Qwen Code — tuned for Qwen. Forked from Gemini CLI and adapted for Qwen models, with OpenAI-compatible endpoints. Pick it if you run Qwen on your own hardware or buy from Alibaba Cloud.

How to choose

  1. Terminal or editor? Terminal → OpenCode or Codex CLI. Editor → Cline or Kilo Code.
  2. Which model do you want to pay for? Already on ChatGPT → Codex CLI. Want Claude, GPT and local models in one tool → OpenCode.
  3. Should it run without you? Yes → OpenHands in a sandbox.
  4. Is “source-available” enough? If your legal team requires an OSI licence, drop Crush and stay with MIT or Apache-2.0 tools.

The trade-off with every open-source agent is that you pay per token instead of a flat plan; heavy users on Opus-class models can spend more than a Claude Max subscription. Keep an eye on spend with the tips in how to reduce AI coding agent token costs. For non-open-source options too, see best Claude Code alternatives.

Last verified: November 20, 2026.

Sources