Claude Code alternatives for agents with local models
Compare OpenCode, Cline and Aider for coding with local models or hosted APIs. Find a terminal agent, editor assistant or self-hosted setup.
Claude Code takes on coding tasks such as fixing bugs, writing tests and handling migrations. It works from the terminal and other development interfaces, so the appeal is an agent that can help with the project itself. Replacing it means choosing both an agent you like working with and a model to power it.
OpenCode and Aider are Claude Code alternatives for terminal work; Cline brings the workflow into an editor with diffs and checkpoints. For agents on your own server, consider OpenHands. The options below support local models as well as hosted providers, giving you room to choose how you run inference and pay for it.
An open source AI coding agent works in your terminal or IDE with local models or cloud models including Claude, GPT and Gemini.

OpenCode suits replacing Claude Code repository work with a model-flexible terminal or IDE agent. The development agent edits files, while a planning agent denies edits by default. Automatic language-server context and parallel sessions support project exploration and changes with local or hosted models.
An open-source AI coding agent for editors, terminal and desktop, with local models through Ollama or LM Studio and an Apache 2.0 core.

Cline suits people who would rather work from an editor panel than a terminal, though it also has a CLI and a desktop app. It pairs with models on your machine through Ollama or LM Studio, or with Claude, GPT, Gemini and OpenAI-compatible endpoints.
Plan mode proposes an approach before Act mode edits, and you approve edits and commands one by one or let them run. Diffs and checkpoints let you review and undo changes, and the CLI runs without interaction in scripts and CI.
An open-source AI coding agent for macOS, Windows and Linux that supports local models through Ollama or vLLM and cloud model APIs.

Qwen Code suits Claude Code users who need agent teams, planning and reusable project skills. Its terminal and editor interfaces support local or hosted models, MCP tools and isolated worktrees. Headless operation and SDKs cover scripted coding tasks.
An open-source coding agent for macOS, Linux and Windows that uses local or hosted models, with terminal and local browser clients that need no account.

Codewhale covers Claude Code repository edits with planning, permissions and recovery controls. Review file diffs and command results, resume sessions in the terminal or local browser, and use Fleet to divide work among agents. It supports existing Claude Code plugins with a different model backend.
Terminal coding assistant for local repositories on macOS, Windows and Linux. Use local models through Ollama or paid OpenAI access.

An open-source AI coding agent for VS Code, JetBrains, and the CLI, with local model support, hosted model access, and an MIT license.

A self-hosted AI coding agent platform runs locally or on servers, supports Claude Code and Codex, and automates engineering workflows.

OpenHands covers delegated and recurring Claude Code engineering tasks. Agents apply changes, investigate failures, run checks and prepare pull requests, with events or schedules starting work. Run its own agent on your infrastructure; using Claude Code as its backend would retain Claude Code.
A local-first AI coding workspace for macOS, Windows and Linux that connects to local or cloud models and coordinates parallel agents.

Desktop AI agent client for macOS, Windows and Linux that combines Claude Code, Codex and local models through Ollama, with locally stored chat history.

A terminal AI coding assistant that connects to local backends such as Ollama and llama.cpp or cloud APIs, with model switching that preserves context.

Crush is a terminal coding assistant for people who move between model backends. It discovers models from Ollama, llama.cpp, LM Studio and LiteLLM automatically, connects to Anthropic, OpenAI, Gemini and OpenRouter, and accepts any OpenAI- or Anthropic-compatible API.
You can change models during a session without losing its context and keep separate sessions in one project. Language server integrations add code context, and MCP connects other tools.
An open-source terminal coding assistant that edits projects with local or cloud LLMs, maps codebases and commits changes to Git.

Aider fits developers who live in a terminal and keep every project in Git. It maps the codebase so the model has context in larger projects, and it commits each change with a message, so you review diffs and undo edits with the Git tools you already use.
It works with local LLMs or cloud models from Anthropic, DeepSeek, OpenAI and others, runs your linters and tests after a change and fixes what they report. Comments in your editor can serve as requests.
A terminal coding agent that runs locally, supports Ollama and cloud models, and lets developers customize tools and workflows under the MIT license.

Pi suits adapting Claude Code-style terminal work around your own extensions and project instructions. Switch models during a session, branch earlier conversations and package reusable skills or prompts. Planning and subagents require extensions, and Pi inherits the process access it runs with.
An open-source terminal AI agent that edits files, runs code and handles persistent tasks with local models or cloud providers under the MIT license.

An open source terminal coding assistant connects to Ollama, LM Studio or cloud models and recalls information from previous sessions.

An open-source coding agent with recursive task delegation, searchable context, and persistent sessions accessible through terminal and web clients.
Local terminal coding and research agent with persistent Python sessions and parallel subagents. Hosted model routes use subscription or API-key access.
Prime Agent suits coding tasks that continue between terminal sessions. It edits project files, keeps a Python environment alive and coordinates subagents; you can disconnect and later reattach to background work.
An Apache 2.0 AI agent for macOS, Windows and Linux, with desktop and CLI interfaces and support for Ollama or cloud model providers.

A terminal coding agent that works with local models through Ollama or cloud providers and supports embedding in editors and browser apps.

An open-source terminal coding agent and Python toolkit that supports local models through llama.cpp, cloud providers, and MCP tools.

Fast Agent gives terminal coding sessions access to shell commands and MCP tools, with local llama.cpp or other model providers. Its agent workflows can divide a task between specialists and ask an evaluator for revisions.
A self-hosted coding assistant and Python agent framework that branches runs to compare approaches and supports local models through Ollama.

Pydantic DeepAgents reads and edits project files and runs shell commands from a terminal assistant. It can fork a task into isolated branches so you can compare approaches and review their diffs before continuing.
For Claude Code, start with OpenCode. Other alternatives include Cline, Qwen Code, Codewhale and Codex CLI.
Most are Terminal Coding Agents; others include Autonomous Coding Agents.
