Claude Code alternatives compared
| Project | Licence | Type | Self-host | Cloud option | GitHub stars |
|---|---|---|---|---|---|
| OpenCode | MIT | Developer tool | — | — | ★ 231k |
| Codex CLI | Apache-2.0 | Developer tool | — | — | ★ 137k |
| goose | Apache-2.0 | Desktop app | — | — | ★ 57.3k |
| Aider | Apache-2.0 | Developer tool | — | — | ★ 50.4k |
| OpenHands | MIT | Self-hosted | ✓ Yes | ✓ Yes | ★ 94.9k |
The 5 open source alternatives to Claude Code
OpenCode is a terminal-based AI coding agent with a polished TUI. It works with 75+ model providers, including local models, and supports LSP, MCP servers and multiple sessions.
- 75+ model providers
- Terminal UI plus desktop and IDE clients
- LSP and MCP support
- Shareable sessions
Codex CLI is a lightweight coding agent from OpenAI that reads, edits and runs code in your terminal, with sandboxing and approval modes. The client is open source and written in Rust.
Note: The client is open source, but it is designed for OpenAI's models and account sign-in.
- Sandboxed command execution
- Approval modes
- MCP support
- Written in Rust
goose is an AI agent created by Block that runs on your machine as a desktop app or CLI. It can install, run and test code, works with any LLM and connects to tools through MCP. It is now hosted by the Agentic AI Foundation at the Linux Foundation.
- Desktop app and CLI
- Any LLM provider
- MCP extensions
- Recipes for repeatable tasks
Aider edits code in your local Git repository through a chat in the terminal. It maps your codebase, works with most cloud and local models and commits each change with a sensible message.
- Git-aware edits and auto-commits
- Repository map
- Most cloud and local models
- Voice coding
OpenHands (formerly OpenDevin) runs AI agents that write code, run commands and browse the web in a sandbox. It can work through a web UI, a CLI or GitHub issues, with any model.
Note: Some enterprise features of the hosted platform are licensed separately.
- Sandboxed agent runtime
- Web UI, CLI and GitHub integration
- Bring any model
- Hosted cloud option
How to choose an open source alternative to Claude Code
Check which model providers it supports, whether it can run local models, how it handles permissions for shell commands and file edits, and MCP support.
If you want your data on your own server, look at OpenHands. If you'd rather just install an app, gooseruns directly on your device. Don't want to run a server? OpenHandsoffers an official hosted version.
Not sure where to start? Browse all ai & llm tools projects.
Claude Code alternatives: FAQ
What is the best open source alternative to Claude Code?
OpenCode is the most complete open source alternative to Claude Code on our list, followed by Codex CLI and goose. The best choice depends on what you need: Check which model providers it supports, whether it can run local models, how it handles permissions for shell commands and file edits, and MCP support.
Is there a free alternative to Claude Code?
Yes. Every alternative listed here is open source, so the software itself is free to use. Some, such as OpenHands, also sell an optional hosted version if you don't want to run it yourself.
Can I self-host an alternative to Claude Code?
Yes: OpenHands can be installed on your own server, so your data stays on infrastructure you control.
Is there an open source Claude Code alternative I can install as an app?
goose (desktop app) runs directly on your device, with no server needed.
Why switch from Claude Code to open source software?
Claude Code is proprietary software owned by Anthropic: you can't see the code, and pricing, features and terms can change at any time. Open source alternatives publish their code under licences such as MIT and Apache-2.0, can be audited by anyone, and can't lock you in, because the software can always be forked or self-hosted.