---
title: "Claude Code alternatives 2026: AI coding agents compared"
canonical: "https://xerj.org/compare/claude-code-alternatives-2026"
updated: "2026-12-05"
---

# Best Claude Code alternatives in 2026

SHORT ANSWER · UPDATED 2026-12-05
The best Claude Code alternatives in 2026 are opencode for terminal coding with any model provider, Codex CLI for terminal coding with OpenAI models, Gemini CLI for terminal agent with Gemini models and OpenHands for autonomous agents in a sandboxed runtime. In one line, Claude Code is this: anthropic's agentic coding tool for the terminal and IDEs. The right swap depends on how you want to run it and which licence you need.
**Key number:** Claude Code had 158,196 GitHub stars on 5 Dec 2026, latest release v2.1.337, 4 Dec 2026.
Stars, licences, languages and releases for 9 tools were fetched live from the GitHub API, GitHub release pages and the Hugging Face API on 5 Dec 2026. Hosted services link to their official sites and carry no invented numbers.

**TL;DR** The best Claude Code alternatives in 2026 are opencode for terminal coding with any model provider, Codex CLI for terminal coding with OpenAI models, Gemini CLI for terminal agent with Gemini models and OpenHands for autonomous agents in a sandboxed runtime.

## Agent prompt

```text
Read https://xerj.org/llms.txt. I am comparing Claude Code alternatives. Install XERJ, start a local node, run xerj autoindex on my project folder, connect xerj mcp, and show me three searches with file and line citations.
```

## Pick one in ten seconds

- Pick [opencode](https://github.com/anomalyco/opencode) if you want terminal coding with any model provider.
- Pick [Codex CLI](https://github.com/openai/codex) if you want terminal coding with OpenAI models.
- Pick [Gemini CLI](https://github.com/google-gemini/gemini-cli) if you want terminal agent with Gemini models.
- Pick [OpenHands](https://github.com/OpenHands/OpenHands) if you want autonomous agents in a sandboxed runtime.
- Pick [Cline](https://github.com/cline/cline) if you want agentic coding in VS Code with approvals.
- Pick [Goose](https://github.com/aaif-goose/goose) if you want a local agent extended through MCP.
- Pick [Aider](https://github.com/Aider-AI/aider) if you want git-aware pair programming in the terminal.
- Pick [Continue](https://github.com/continuedev/continue) if you want custom assistants in VS Code and JetBrains.

## What Claude Code does well

Anthropic's agentic coding tool for the terminal and IDEs. It suits terminal-first agentic coding. It runs as a coding agent, is written mainly in TypeScript, and its licence is Anthropic Commercial Terms of Service. Plan for this: uses Anthropic models.

## How the Claude Code alternatives differ

The alternatives split by how they run:

- **Coding agent:** opencode, Codex CLI, Gemini CLI, OpenHands, Cline, Goose, Aider, Continue.

## Licences at a glance

- **Commercial services:** Claude Code.
- **Permissive licences:** opencode (MIT), Codex CLI (Apache-2.0), Gemini CLI (Apache-2.0), OpenHands (MIT), Cline (Apache-2.0), Goose (Apache-2.0), Aider (Apache-2.0), Continue (Apache-2.0).

## Most recent releases

OpenHands shipped v1.49.0 on 4 Dec 2026. opencode shipped v2.4.5 on 4 Dec 2026. Codex CLI shipped rust-v0.174.0 on 3 Dec 2026. A recent release is a sign of active upkeep, so check the changelog for the features you rely on.

## Add local search to any coding agent

XERJ is a new way for AI to search for data: one local Rust binary that indexes code, docs, logs and data with `xerj autoindex` and returns passages with file and line citations. `xerj mcp` is a stdio MCP server, and `xerj mcp --http` serves Streamable HTTP at `http://127.0.0.1:9330/mcp`, read-only unless you pass `--allow-writes`. A non-loopback bind needs `XERJ_MCP_TOKEN`. Each tool on this page can call it as one more MCP server.

## How we checked

Stars, licences, languages and releases for 9 tools were fetched live from the GitHub API, GitHub release pages and the Hugging Face API on 5 Dec 2026. Hosted services link to their official sites and carry no invented numbers. Descriptions summarise each project's own README or documentation. Star counts move daily, so treat them as a snapshot.

## Read next

- [opencode vs Claude Code (2026)](https://xerj.org/compare/opencode-vs-claude-code-2026)
- [Gemini CLI vs Claude Code (2026)](https://xerj.org/compare/gemini-cli-vs-claude-code-2026)
- [Best MCP memory servers for Claude Code 2026: 8 compared](https://xerj.org/compare/best-mcp-memory-servers-claude-code-2026)
- [Claude Code vs Codex CLI (2026): which coding agent fits?](https://xerj.org/compare/claude-code-vs-codex-2026)
- [opencode vs Codex CLI (2026)](https://xerj.org/compare/opencode-vs-codex-2026)
- [Best local search and MCP for opencode (2026)](https://xerj.org/compare/local-search-mcp-for-opencode-2026)
- [What is the Model Context Protocol (MCP)? 2026 guide for agents](https://xerj.org/science/model-context-protocol)
- [What is context engineering?](https://xerj.org/science/context-engineering)
- [What is agentic search? AI agents that search in a loop (2026)](https://xerj.org/science/agentic-search)

## FAQ

### What is the best Claude Code alternative in 2026?

It depends on the job: opencode fits terminal coding with any model provider, Codex CLI fits terminal coding with OpenAI models, Gemini CLI fits terminal agent with Gemini models, OpenHands fits autonomous agents in a sandboxed runtime.

### Is Claude Code open source?

Claude Code is published under Anthropic Commercial Terms of Service and had 158,196 GitHub stars on 5 Dec 2026.

### Which Claude Code alternatives can I self-host?

These run on your own machines: opencode, Codex CLI, Gemini CLI, OpenHands, Cline, Goose, Aider, Continue.

### Which languages are the Claude Code alternatives written in?

Python: Aider; Rust: Codex CLI, Goose; TypeScript: opencode, Gemini CLI, OpenHands, Cline, Continue. The primary language is the one GitHub reports for each repository.

## Evidence

- [anthropics/claude-code](https://github.com/anthropics/claude-code): 158,196 stars, Anthropic Commercial Terms of Service, TypeScript, latest release v2.1.337, 4 Dec 2026 (licence read from [its licence file](https://github.com/anthropics/claude-code/blob/HEAD/LICENSE.md)) (GitHub API and release page, checked 5 Dec 2026).
- [anomalyco/opencode](https://github.com/anomalyco/opencode): 230,891 stars, MIT, TypeScript, latest release v2.4.5, 4 Dec 2026 (GitHub API and release page, checked 5 Dec 2026).
- [openai/codex](https://github.com/openai/codex): 137,402 stars, Apache-2.0, Rust, latest release rust-v0.174.0, 3 Dec 2026 (GitHub API and release page, checked 5 Dec 2026).
- [google-gemini/gemini-cli](https://github.com/google-gemini/gemini-cli): 109,657 stars, Apache-2.0, TypeScript, latest release v0.72.0, 2 Dec 2026 (GitHub API and release page, checked 5 Dec 2026).
- [OpenHands/OpenHands](https://github.com/OpenHands/OpenHands): 94,835 stars, MIT, TypeScript, latest release v1.49.0, 4 Dec 2026 (GitHub API and release page, checked 5 Dec 2026).
- [cline/cline](https://github.com/cline/cline): 72,077 stars, Apache-2.0, TypeScript, latest release v4.1.28, 26 Nov 2026 (GitHub API and release page, checked 5 Dec 2026).
- [aaif-goose/goose](https://github.com/aaif-goose/goose): 57,282 stars, Apache-2.0, Rust, latest release v1.62.0, 4 Dec 2026 (GitHub API and release page, checked 5 Dec 2026).
- [Aider-AI/aider](https://github.com/Aider-AI/aider): 50,374 stars, Apache-2.0, Python, latest release v0.86.0, 9 Aug 2025 (GitHub API and release page, checked 5 Dec 2026).
- [continuedev/continue](https://github.com/continuedev/continue): 36,622 stars, Apache-2.0, TypeScript, latest release v2.0.0-vscode, 18 Jun 2026 (GitHub API and release page, checked 5 Dec 2026).

## Comparison table

| Tool | What it is | Runs as | Language | Latest release | Licence | Stars |
|---|---|---|---|---|---|---|
| [Claude Code](https://github.com/anthropics/claude-code) | Anthropic's agentic coding tool for the terminal and IDEs | Coding agent | TypeScript | v2.1.337, 4 Dec 2026 | Anthropic Commercial Terms of Service | 158,196 |
| [opencode](https://github.com/anomalyco/opencode) | Open source AI coding agent built for the terminal | Coding agent | TypeScript | v2.4.5, 4 Dec 2026 | MIT | 230,891 |
| [Codex CLI](https://github.com/openai/codex) | OpenAI's lightweight coding agent that runs in your terminal | Coding agent | Rust | rust-v0.174.0, 3 Dec 2026 | Apache-2.0 | 137,402 |
| [Gemini CLI](https://github.com/google-gemini/gemini-cli) | Google's open source AI agent that brings Gemini into the terminal | Coding agent | TypeScript | v0.72.0, 2 Dec 2026 | Apache-2.0 | 109,657 |
| [OpenHands](https://github.com/OpenHands/OpenHands) | Platform for software development agents that act in a sandbox | Coding agent | TypeScript | v1.49.0, 4 Dec 2026 | MIT | 94,835 |
| [Cline](https://github.com/cline/cline) | Autonomous coding agent in your IDE that can create files, run commands and use MCP tools | Coding agent | TypeScript | v4.1.28, 26 Nov 2026 | Apache-2.0 | 72,077 |
| [Goose](https://github.com/aaif-goose/goose) | Open source, extensible AI agent from Block that uses MCP extensions | Coding agent | Rust | v1.62.0, 4 Dec 2026 | Apache-2.0 | 57,282 |
| [Aider](https://github.com/Aider-AI/aider) | AI pair programming in your terminal that edits code in your git repo | Coding agent | Python | v0.86.0, 9 Aug 2025 | Apache-2.0 | 50,374 |
| [Continue](https://github.com/continuedev/continue) | Open source AI code assistant for VS Code and JetBrains with agents and MCP | Coding agent | TypeScript | v2.0.0-vscode, 18 Jun 2026 | Apache-2.0 | 36,622 |
