The short answer: if you want an open-source coding agent you can read, fork and point at any model, start with Cline7.6 out of 10 (7.6/10) if you live in VS Code, Aider7.3 out of 10 (7.3) if you live in the terminal, and OpenHands7.0 out of 10 (7.0) if you want an autonomous agent you can self-host. OpenAI Codex7.8 out of 10 (7.8) scores highest, but only its local CLI is open source; the strongest cloud agent is not. This page is for developers and teams who care about auditability, model choice or keeping code inside their own network.
Quick picks
- Highest scoring (CLI is open source): OpenAI Codex7.8 out of 10, 7.8, CLI free with your own API key; cloud agent from $20/month (ChatGPT Plus).
- Best for VS Code: Cline7.6 out of 10, 7.6, free plus your own model costs. Asks approval for every edit and command.
- Best for the terminal and Git: Aider7.3 out of 10, 7.3, free plus your own model costs. Auto-commits every change.
- Best to self-host and run autonomously: OpenHands7.0 out of 10, 7.0, free (MIT licence); hosted individual tier free to start.
Scores are the weighted average of capability, ease of use, value, reliability and support (see our methodology). Rankings are computed from scores, not hand-placed, and the comparison table above shows the sub-scores. For closed and open tools side by side, see our best AI coding agents ranking or browse the full coding category.
What “open source” really buys you
- Auditability. You can read what the agent does with your code and shell. For regulated teams that is often the deciding factor.
- Model choice. Cline, Aider and OpenHands let you switch between Claude, GPT, Gemini and local models without changing tools.
- No seat licence, but not free. The software costs nothing; the tokens do. Heavy sessions on frontier models add up, and that is the number to budget.
- You own the setup. No vendor handles upgrades, uptime or support for you, with the partial exception of enterprise plans.
The ranking
1. OpenAI Codex (7.8): best agent, partly open
Codex is two products. The Codex CLI is open source and runs locally with your own OpenAI API key, billed separately. The cloud agent, which runs tasks in parallel sandboxes and opens pull requests, is the part that earns the top capability score (9), and it is not open source. It is included in ChatGPT Plus from $20/month, with higher limits on Pro, Team and Enterprise.
Weaknesses: the best tiers sit behind ChatGPT pricing, tasks run slower than inline autocomplete, and output still needs review before merging. Usage caps have also shifted; see our report on OpenAI reinstating the 5-hour Codex cap for Plus users. Skip it if you need the whole stack to be open or model-agnostic. The CLI works best with OpenAI models.
2. Cline (7.6): the transparent VS Code agent
Cline is Apache-2.0, has no paywall in the extension, and shows every file diff and terminal command for approval before it runs. It supports Anthropic, OpenAI, Google Vertex, AWS Bedrock, Azure and OpenRouter keys, has native MCP support, and offers separate Plan and Act modes. Its value score of 9 reflects that you only pay your model provider.
Weaknesses: heavy sessions on frontier models can cost roughly $5-30 a day by our profile’s estimate, and approving each step is slower than a fully autonomous run. It lives in VS Code (and JetBrains) rather than as a standalone CLI. Skip it if you want hands-off background work.
3. Aider (7.3): Git-native terminal pair programmer
Aider is Apache-2.0, supports 100+ models including local ones through Ollama, builds a repo map to pick relevant context, and commits each change with a generated message, so your history stays auditable and reversible. It can run linters and tests and attempt fixes on failure.
Weaknesses: it is terminal-only, you select files to edit manually, and its ease-of-use score (5) is the lowest in the group. Momentum has cooled: its latest tagged release was v0.86.0 in August 2025, per our profile, and newer rivals have moved faster. API costs can reach $30-60 a month at heavy use. Skip it if you want a GUI or an agent that navigates the codebase for you.
4. OpenHands (7.0): the self-hostable autonomous agent
OpenHands is MIT-licensed and gives the agent a sandboxed shell, file system and browser. It ships a web GUI, terminal UI, CLI and Python SDK, integrates with GitHub, GitLab and Bitbucket for issue-to-PR flows, and can be deployed into a private VPC on the Enterprise plan with SSO. The hosted individual tier passes model usage through at cost, capped at 10 conversations a day.
Weaknesses: local setup is Docker-based and noticeably harder than installing an extension, long autonomous runs can loop or stall, token spend is easy to underestimate, and free use is community-supported only with no SLA. Skip it if you want a five-minute install.
Not scored here
Several other open-source agents, such as OpenCode and Goose, are frequently listed in community roundups. They are not in our directory, so we have not scored or ranked them. We will add them if they meet our review criteria.
Which should you choose?
- If you work in VS Code and want control, choose Cline.
- If you work in the terminal and care about Git history, choose Aider, and pair it with a local model via Ollama7.2 out of 10 if code must stay on your machine.
- If you want to delegate issues and get pull requests back, choose Codex’s cloud agent for the best results, or OpenHands if the whole thing must be self-hosted.
- If budget is the constraint, Cline or Aider with a cheaper model gives the lowest floor, since you pay only for tokens.
- If you need the fully closed, polished option, our Claude Code vs Codex comparison covers the paid leaders.
Next step
Pick the one that matches your environment and run it on a real, well-scoped ticket with a spending limit set at your model provider. Read the full scores on the Cline7.6 out of 10, Aider7.3 out of 10 or OpenHands7.0 out of 10 pages, then install from cline.bot, aider.chat or openhands.dev.
Frequently asked questions
What is the best open-source AI coding agent?
On our scores, OpenAI Codex leads at 7.8, but only its CLI is open source. Among fully open-source tools, Cline leads at 7.6, followed by Aider at 7.3 and OpenHands at 7.0.
Are open-source coding agents really free?
The software is free, but you pay for model tokens unless you run a local model. Heavy use of frontier models can cost tens of dollars a month, or per day for intensive sessions.
Can I run these agents with a local model?
Aider supports local models through Ollama, and OpenHands is model-agnostic including open-weight models. Quality depends on the model you can run, so test on your own code first.
Is Cline better than Aider?
Cline scores 7.6 against Aider’s 7.3. Cline is easier to use and sits inside VS Code with approval checkpoints. Aider is terminal-only but tightly integrated with Git. Choose by where you work.
Is OpenHands safe to run on my code?
It runs commands in a sandboxed environment, and you can self-host it. Long autonomous runs can still produce wrong or costly changes, so review every pull request.
How did AgentsAI score these agents?
Each is scored on capability, ease of use, value, reliability and support, weighted per our methodology. AI-assisted research is verified by a human, and rankings are never weighted toward any vendor.