macrostack
Migration guide · AI Coding Assistants

The 5 best Claude Code alternatives

Claude Code is Anthropic's agentic coding tool. It reads your codebase, edits files across a project, runs commands and works directly with git, and it runs in the terminal, as VS Code and JetBrains extensions, inside the Claude desktop app and in the browser at claude.ai/code. You steer it with plain-markdown CLAUDE.md files (it can also read an existing AGENTS.md), extend it with MCP servers, skills, hooks and subagents, and can hand longer work to cloud sessions and scheduled routines. It is built to run Anthropic's Claude models, through a Claude subscription, an Anthropic Console API key, or Amazon Bedrock, Google Cloud and Microsoft Foundry. It has become the reference point for the category: Qwen Code's own README, for example, compares itself to Claude Code feature by feature.

93
Bottom line

For most people coming from Claude Code the closest swap is opencode: an MIT-licensed terminal agent with a read-only plan agent and a full-access build agent, 75+ model providers including local ones, and fallback support for your existing CLAUDE.md and ~/.claude/skills, so you can try it on the same repository today. Already pay for ChatGPT? OpenAI's Apache-2.0 Codex CLI is included from Plus. Want foundation governance and an agent that does more than code? goose. Prefer working in the editor? Cline. Weigh one cost honestly first: keeping Claude models inside any of these means per-token API billing, because a Claude plan only works in Anthropic's own apps.

Jump to the full comparison →

The cost

Verified on claude.com/pricing 2026-10-03. The Free plan does not include Claude Code. Pro is $20/month billed monthly, or $17/month on an annual plan ($200 up front). Max starts at $100/month and comes in two sizes, 5x or 20x Pro's usage; the page shows the starting price only. Team seats are $25/month standard or $125/month premium when billed monthly ($20 and $100 billed annually), and a premium seat gives 5x the usage of a standard one. Enterprise lists $20/seat/month billed annually plus usage at API rates. Every plan's usage resets on a rolling five-hour window, paid plans add weekly limits on top, and Claude Code draws from the same pool as Claude on the web, desktop and mobile. The other route is pay-as-you-go API credits through an Anthropic Console account, where the bill tracks the tokens you use.

What Claude Code actually costs

Why people consider an alternative

Three reasons come up most. Model choice: Claude Code is built around Claude models, so a team that wants to route some work to OpenAI, Google, open-weight or local models ends up running a second tool beside it. Cost shape: limits reset on a five-hour window with weekly caps on paid plans, and the Claude chat apps share the same pool, so heavy agent users either move up the plans ($20, then from $100) or move to per-token API billing. And control: Claude Code is proprietary. Its public GitHub repository carries an 'All rights reserved' notice and use is governed by Anthropic's Consumer or Commercial Terms, so the agent itself cannot be audited, forked or patched. Some security and procurement teams require that, independent of how well the tool works.

When Claude Code is still the right call

Often, honestly. If Claude models are doing your best work, Claude Code is the harness Anthropic builds for them, and it gets new capabilities such as subagents, skills, hooks, cloud sessions and scheduled routines directly rather than through a community port. Stay if the subscription is earning its keep: an open agent cannot use your Claude plan, so the same models on an API key can cost far more for heavy daily use; measure a real week before deciding. Stay if your organisation already runs it through Team or Enterprise with SSO and managed settings, or through Bedrock, Google Cloud or Foundry under an existing agreement. And if what you actually want is local inference rather than a different tool, Ollama documents running Claude Code against a local server with `ollama launch claude`; test that before you migrate anything.

AlternativeLicenseSelf-hostPricingSovereignty
opencode★MITYesFree and open source (MIT); you pay your own model provider. Optional OpenCode Go at $10/month (Go Plus $40/month) for open-source models, or the pay-as-you-go Zen gateway. Verified on opencode.ai 2026-10-03.93
gooseApache-2.0YesFree and open source (Apache-2.0); you pay only your model provider, or nothing beyond hardware with a local model.93
ClineApache-2.0YesFree for individual developers (Apache-2.0); pay only for inference, with your own keys or Cline's provider. Enterprise (SSO, team management, centralised billing) is sales-led. Verified on cline.bot/pricing 2026-10-03.92
Qwen CodeApache-2.0YesFree and open source (Apache-2.0); you pay your chosen provider, or nothing beyond hardware with a local model.91
Codex CLIApache-2.0YesFree, open-source client (Apache-2.0). Included with ChatGPT plans, with the CLI listed from Plus ($20/month) and Pro from $100/month; or an API key at API rates. Local models via --oss cost nothing extra. Verified on OpenAI's Codex pricing page 2026-10-03.79
93
Macrostack's top pick

opencode

The MIT terminal agent that picks up your CLAUDE.md where you left it.

Which one fits your situation?

There is no single best answer — it depends on what you are actually trying to do.

Just tell me the best Claude Code alternative

opencode93

Our top pick — the highest Sovereignty Score at 93, and the one we would choose ourselves.

opencode vs goose →

I have no budget — is there a genuinely free one?

goose93

Open source under Apache-2.0. Free and open source (Apache-2.0); you pay only your model provider, or nothing beyond hardware with a local model.

goose vs opencode →

I want to self-host it and own the data

Cline92

Self-hostable, so your data stays on your own server. Free for individual developers (Apache-2.0); pay only for inference, with your own keys or Cline's provider. Enterprise (SSO, team management, centralised billing) is sales-led. Verified on cline.bot/pricing 2026-10-03.

Cline vs opencode →

Every alternative, compared

#1★ TOP PICK

opencode

The MIT terminal agent that picks up your CLAUDE.md where you left it.

93
OPEN SOURCEMITSELF-HOSTLOCAL-FIRST

opencode (MIT, maintained by Anomaly) is the open-source agent closest in shape to Claude Code: a terminal UI with a full-access `build` agent, a read-only `plan` agent and a `general` subagent, plus a desktop app in beta. It is provider-agnostic, with 75+ providers through the AI SDK and Models.dev, including Anthropic on an API key and local models via Ollama, LM Studio, llama.cpp or any OpenAI-compatible endpoint. For anyone coming from Claude Code it reads CLAUDE.md, ~/.claude/CLAUDE.md and ~/.claude/skills as fallbacks when no AGENTS.md exists, so an existing repository works on day one. Two optional paid services sit beside the free tool: OpenCode Go, a $10/month subscription to open-source models (Go Plus $40/month), and Zen, a pay-as-you-go gateway of tested models. Your own keys cost nothing extra.

⌁ The client is a single binary that runs on modest hardware, including over SSH. Running the model locally is the demanding part: Ollama's qwen3-coder:30b is a 19 GB download with a 256K context window, so roughly 24 GB of VRAM or a 32 GB+ unified-memory machine is a sensible floor, and Ollama's coding-agent guide recommends a context length of 64k or more for larger repositories.

Strengths

  • +Reads CLAUDE.md, ~/.claude/CLAUDE.md and ~/.claude/skills as fallbacks, the lowest-effort move from Claude Code
  • +75+ providers: keep Claude on an API key, switch models per task, or run fully local
  • +The same plan-then-build rhythm: a read-only plan agent that denies edits by default and asks before running bash
  • +The largest community in the category, about 211k GitHub stars, with commits daily

Trade-offs

  • −Keeping Claude models means per-token API billing: opencode's own docs say Anthropic prohibits using Claude Pro/Max plans through it, and it stopped bundling the plugins that did so in version 1.3.0
  • −The desktop app is still in beta; the terminal is the mature surface
  • −A large configuration surface (providers, models, agents, permissions) is more to learn than one vendor's defaults
  • −A local model is a real hardware ask and will trail a frontier model on hard multi-file work
Free and open source (MIT); you pay your own model provider. Optional OpenCode Go at $10/month (Go Plus $40/month) for open-source models, or the pay-as-you-go Zen gateway. Verified on opencode.ai 2026-10-03.
#2

goose

A general-purpose open agent (desktop app, CLI and API) governed at the Linux Foundation.

93
OPEN SOURCEApache-2.0SELF-HOSTLOCAL-FIRST

goose (Apache-2.0) is a general-purpose AI agent that runs on your machine: a native desktop app for macOS, Linux and Windows, a full CLI, and an API to embed it, built in Rust. It writes code, but it is deliberately not only a coding tool; research, writing, automation and data analysis are in scope, which suits someone who used Claude Code for more than programming. It works with 15+ providers, including Anthropic, OpenAI, Google, Ollama, OpenRouter, Azure and Bedrock, and connects to 70+ extensions over MCP. goose is part of the Agentic AI Foundation (AAIF) at the Linux Foundation; its repository moved from block/goose to aaif-goose/goose, and the old address redirects.

⌁ goose itself is a light Rust binary or desktop app. Local inference is the cost: budget roughly 24 GB of VRAM or a 32 GB+ unified-memory machine for a 30B-class quantised coding model, or use a cloud provider.

Strengths

  • +Foundation governance at the Linux Foundation's Agentic AI Foundation, so no single vendor owns the roadmap
  • +A desktop app, CLI and API from one engine, which makes it approachable for people who would rather not live in a terminal
  • +15+ providers including Ollama, so it can run fully local
  • +70+ MCP extensions, and a scope that goes well beyond code

Trade-offs

  • −A generalist by design; if you only want a coding agent, a coding-first tool such as opencode will feel more focused
  • −Moving your setup is manual: check which of your CLAUDE.md conventions, skills and hooks have a goose equivalent before committing
  • −Running locally still needs real GPU memory, and a local model trails frontier models on hard agent tasks
Free and open source (Apache-2.0); you pay only your model provider, or nothing beyond hardware with a local model.
#3

Cline

The open-source agent for people who want it in the editor rather than the terminal.

92
OPEN SOURCEApache-2.0SELF-HOSTLOCAL-FIRST

Cline (Apache-2.0) is an autonomous coding agent available as a VS Code extension, a JetBrains plugin, a CLI (`npm i -g cline`) and a desktop app for macOS and Windows, all built on one shared agent core. It is not tied to a provider: Anthropic, OpenAI, Google, OpenRouter, Bedrock, Vertex, Groq, Cerebras, Ollama, LM Studio or any OpenAI-compatible endpoint. Cline's pricing page says it is free for individual developers, who pay only for inference with their own API keys or through Cline's provider; an Enterprise tier adds SSO, team management and centralised billing. Every edit in the editor shows as a reviewable diff, with checkpoints to undo the agent's work.

⌁ Cline runs anywhere VS Code or Node.js runs; the hardware question is only about the model. For local inference, Ollama's qwen3-coder:30b is a 19 GB download with a 256K context window, so roughly 24 GB of VRAM or a 32 GB+ unified-memory machine is a sensible floor.

Strengths

  • +Reviewable diffs in the editor plus checkpoints to roll the agent back, close to Claude Code's IDE experience
  • +Bring your own key for any major provider, or run fully local through Ollama or LM Studio
  • +The same agent across VS Code, JetBrains, a CLI and a desktop app
  • +A large, active project, about 70k GitHub stars, with commits daily

Trade-offs

  • −The JetBrains plugin is not open source; only the VS Code extension, CLI, SDK and desktop app are in the public repository
  • −Per-token billing on a frontier model can cost more than a flat Claude plan for heavy daily use, so measure before you switch
  • −Its convention for project rules is `.clinerules`, so check how your CLAUDE.md conventions map before relying on them
  • −Running a capable model locally is a real hardware ask
Free for individual developers (Apache-2.0); pay only for inference, with your own keys or Cline's provider. Enterprise (SSO, team management, centralised billing) is sales-led. Verified on cline.bot/pricing 2026-10-03.
#4

Qwen Code

An Apache-2.0 agent that measures itself against Claude Code and runs on any provider.

91
OPEN SOURCEApache-2.0SELF-HOSTLOCAL-FIRST

Qwen Code (Apache-2.0, from the Qwen team at Alibaba Cloud) is an open-source coding agent for the terminal, IDE plugins for VS Code, JetBrains and Zed, a desktop app, a web UI and chat. It began as a fork of Google's Gemini CLI v0.8.2 and has developed independently since v0.1. Its README compares it to Claude Code feature by feature (subagents and agent teams, skills, hooks, MCP, plan mode, sandboxing) and it is multi-protocol: OpenAI, Anthropic, Gemini and Qwen APIs, any third-party provider, or local models through Ollama or vLLM. It has deep integrations for Alibaba's own Qwen models, which is both its strength and its bias.

⌁ The agent itself is a Node.js CLI that runs on modest machines. Local models via Ollama or vLLM carry the usual cost: roughly 24 GB of VRAM or a 32 GB+ unified-memory machine for a 30B-class quantised coding model.

Strengths

  • +Near feature parity with Claude Code on paper, per its own comparison table: subagents, skills, hooks, MCP, plan mode and sandbox
  • +Multi-protocol: OpenAI, Anthropic, Gemini and Qwen APIs, any third-party provider, or local Ollama and vLLM
  • +A wide surface: terminal, VS Code, JetBrains and Zed plugins, desktop app, web UI and SDK
  • +Very active, with commits daily and about 28k GitHub stars

Trade-offs

  • −Tuned first for Qwen models; other providers work, but that is where the integration is deepest
  • −The parity table is the project's own claim, so test it on your repository before relying on it
  • −The default standalone installer downloads from an Alibaba Cloud storage bucket; npm (Node 22+) and Homebrew are alternatives if your policy cares where binaries come from
Free and open source (Apache-2.0); you pay your chosen provider, or nothing beyond hardware with a local model.
#5

Codex CLI

OpenAI's Apache-2.0 terminal agent, included in the ChatGPT plan you may already pay for.

79
OPEN SOURCEApache-2.0SELF-HOST

Codex CLI is OpenAI's coding agent that runs locally on your computer, and unlike Claude Code its client is open source under Apache-2.0. For a subscriber it is the most direct like-for-like swap: sign in with ChatGPT and it draws on your plan (OpenAI's pricing page lists the CLI from Plus at $20/month, with Pro plans at $100, $200 or $500), or use an API key at API rates. It also has a documented local path: pass `--oss` to run against Ollama or LM Studio, and custom OpenAI-compatible providers can be added in its config. The same agent is available as IDE extensions, a desktop app and a cloud agent.

⌁ The client is light and runs anywhere a terminal does. Only `--oss` local mode needs serious hardware: the same roughly 24 GB VRAM guidance applies for a 30B-class quantised coding model.

Strengths

  • +An open-source client (Apache-2.0) you can read, audit and fork
  • +Uses a ChatGPT plan you may already pay for, so there is no second subscription
  • +Documented local mode: `--oss` with Ollama or LM Studio, plus custom OpenAI-compatible providers
  • +A similar spread of surfaces to Claude Code: terminal, IDE extensions, desktop app and cloud agent

Trade-offs

  • −The client is open but the default models and the plan are OpenAI's, so you trade one vendor's subscription tie for another's
  • −Codex shares usage with ChatGPT under OpenAI's plan limits, the same shape of constraint as Claude's plans
  • −Project instructions live in AGENTS.md, so CLAUDE.md conventions need moving across
  • −Local mode is a supported path rather than the tuned experience; expect a capability gap against OpenAI's hosted models
Free, open-source client (Apache-2.0). Included with ChatGPT plans, with the CLI listed from Plus ($20/month) and Pro from $100/month; or an API key at API rates. Local models via --oss cost nothing extra. Verified on OpenAI's Codex pricing page 2026-10-03.

Questions people ask

▸ Can I keep using my Claude Pro or Max subscription inside one of these tools?

No. Anthropic's legal and compliance page for Claude Code says Claude account sign-in is intended for ordinary use of Claude Code and other native Anthropic applications, and that third-party developers may not offer Claude account login in their own applications or route requests through Free, Pro or Max plan credentials. opencode's documentation says the same from the other side: it stopped bundling plugins that used Claude Pro/Max plans in version 1.3.0 because Anthropic prohibits it. You can still use Claude models in every open agent here, but through an Anthropic API key or Bedrock, Google Cloud or Foundry, billed per token. Other vendors take a different line: opencode lists ChatGPT Plus, GitHub Copilot and GitLab Duo subscriptions as usable with zero setup, and Codex CLI is OpenAI's own client for a ChatGPT plan. (Verified 2026-10-03.)

▸ Will my CLAUDE.md, skills and MCP servers come with me?

Partly, and it depends on the tool. opencode reads CLAUDE.md, ~/.claude/CLAUDE.md and ~/.claude/skills as fallbacks when no AGENTS.md exists, which is why it is our pick. Claude Code itself can read AGENTS.md, so one useful first step is to move shared instructions into an AGENTS.md that both tools understand; Codex CLI uses AGENTS.md too. MCP is an open standard, and goose, Cline and Qwen Code all document MCP support, so most servers carry across with new configuration. Hooks, subagent definitions and slash-command workflows are tool-specific and need recreating.

▸ What about Gemini CLI? It used to be the free answer.

It still exists and is still Apache-2.0, but its free route changed. Google's Gemini Code Assist documentation states that from 18 June 2026 the Login with Google option no longer works for Gemini CLI on the Gemini Code Assist for individuals, Google AI Pro and Google AI Ultra tiers. The project's README still advertises the old free tier of 1,000 requests a day with a personal Google account, and its own docs disagree on the free quota for an API key (1,000 versus 250 requests a day), so check Google's rate-limit page before you rely on a number. An API key and Vertex AI still work, under Google's usage-based terms. Because the headline free tier we would have recommended it for no longer applies, it is not in our list. (Checked 2026-10-03.)

▸ Can Claude Code itself run on a local model?

Ollama documents a way: `ollama launch claude`, or setting ANTHROPIC_BASE_URL to a local Ollama server (http://localhost:11434), and it recommends a context length of 64k or more for larger repositories. Anthropic's own documentation describes ANTHROPIC_BASE_URL for routing Claude Code through an LLM gateway. Be clear about what that buys you: the client is still proprietary, and an open-weight model on your own GPU will not match a frontier model on hard multi-file agent work. If local inference is your only reason to look elsewhere, this is worth testing before you move tools.

▸ Why opencode and not goose, when both score 93?

Because the Sovereignty Score measures openness and control, not fit. opencode and goose are equally open: permissive licences, any provider, fully local if you want it. opencode is the recommendation because it is the smallest change from Claude Code: a coding-first terminal agent with the same plan-then-build rhythm that reads your existing CLAUDE.md and skills. goose is the better pick if you used Claude Code for more than code, want a desktop app, or prefer a project governed by a foundation rather than a company. We show both numbers so you can disagree with us.

▸ Will switching actually save me money?

Not automatically. If you want to keep Claude models, an open agent moves you from a flat plan to per-token API billing, which can cost more for heavy daily use. The routes that reliably cut cost are different: a ChatGPT plan you already pay for (Codex CLI is included from Plus at $20/month), a low-cost subscription to open-source models (OpenCode Go is $10/month), or a local model on hardware you own, which costs electricity but needs roughly 24 GB of VRAM to be comfortable. Measure a real week of your usage before you commit either way.

Compare them head-to-head

Related comparisons

Entry last verified 2026-10-03. Licenses and pricing change — spotted something out of date? That's a correction we want.

The Macrostack brief

New swaps, worth your inbox.

A short, occasional email when we add a high-intent alternative or ship a new head-to-head. No spam, no selling your address — unsubscribe in one click.