Best Agent Harness for Local LLMs (2026): OpenCode, Qwen Code, Codex, Cline, Aider and More, Ranked for Ollama and LM Studio

Which coding agent harness works best with local models? 13 harnesses ranked by prompt size, context and tool calling, plus Cline vs Continue for 2026.

2026年10月20日19 分钟阅读Jakub Rusinowski
For most people running a local model in October 2026, the best agent harness is OpenCode. It talks to Ollama, LM Studio and llama.cpp out of the box, and one third-party study measured its start-up prompt at about 7,000 tokens, against about 33,000 for Claude Code (single source: Systima). Qwen Code and Codex CLI (--oss) are close seconds on 24–32 GB machines running Qwen3.6. If you have 8–16 GB, use Aider or a small-prompt harness like Pi, because big harness prompts eat your context. Cline is the pick for VS Code. Continue and Roo Code are no longer maintained.

Want the combinations for your exact GPU? Use the Agent harness × local model matrix.

What changed since our harness explainer

My agent harness explainer covers what a harness is. This page answers a narrower question: which one should you install today?

Three things changed in 2026.

  • Three popular tools stopped. Roo Code shut down on 15 May 2026 and its repo is archived (GitHub). Void was archived on 2 June 2026 (GitHub). Continue's maintainer wrote "we are no longer going to be actively maintaining Continue going forward" (issue #12629). Its last Open VSX release is 2.1.0, dated 19 June 2026 (Open VSX).
  • Ollama became the setup hub. ollama launch claude and ollama launch codex now wire those CLIs to a local model in one command (Ollama: Claude Code, Ollama: Codex).
  • Local models got good at tools. Qwen3.6-35B-A3B has a model-card SWE-bench Verified score of 73.4 (model card). The Qwen team says it uses only 3B active parameters.
✓ Maintained! Slow (no release in 6 months)✕ DiscontinuedOpenCode: active, last release 1.19.3 (2026-10-16)OpenCode✓ 1.19.3Qwen Code: active, last release 0.25.3 (2026-10-19)Qwen Code✓ 0.25.3Codex CLI (--oss): active, last release 0.163.0 (2026-10-15)Codex CLI✓ 0.163.0Cline: active, last release 4.1.25 (extension); 3.0.73 (CLI) (2026-10-17)Cline✓ 4.1.25Kilo Code: active, last release 7.8.14 (extension); 7.8.12 (CLI) (2026-10-16)Kilo Code✓ 7.8.14Pi coding agent: active, last release 1.3.0 (2026-10-15)Pi coding agent✓ 1.3.0Claude Code (local backend): active, last release 2.1.303 (2026-10-18)Claude Code✓ 2.1.303Crush (Charm): active, last release 0.98.1 (2026-10-09)Crush✓ 0.98.1Goose: activeGoose✓OpenHands: active, last release 1.11.0 (2026-07-09)OpenHands✓ 1.11.0Zed agent: activeZed agent✓GitHub Copilot BYOK (VS Code): activeGitHub Copilot BYOK✓Aider: stale, last release 0.86.2 (2026-02-12)Aider! 0.86.2Continue: discontinued, last release 2.1.0 (2026-06-19)Continue✕ 2.1.0Roo Code: discontinued, last release 3.54.0 (2026-05-15)Roo Code✕ 3.54.0Void: discontinuedVoid✕
Who is still shipping. The symbol and the colour say the same thing. Versions come from the npm, PyPI and Open VSX registries (checked 2026-10-19).

How I ranked them

I ranked on documented features, not hype or GitHub stars. Nothing here was measured by me. The ranking is my reading of each tool's docs and of third-party measurements.

Four things matter most for a local model:

  • Prompt overhead. Every token the harness sends before your request sits in the KV cache. On a 16 GB card, that is memory you no longer have for code.
  • Context it needs. Ollama recommends at least 64,000 tokens for coding agents. Its default is only 4k on GPUs under 24 GiB (Ollama docs).
  • Tool calling. Most harnesses need the model to emit native tool calls. Aider is the main exception: it uses plain-text diff formats.
  • Is it still maintained? A harness that stops shipping falls behind new chat templates and new model parsers.

The ranking

#HarnessTypeLocal setupStart-up prompt (community-measured)Min context (docs)Latest release
1OpenCodeCLI/TUIOllama, LM Studio, llama.cpp, any OpenAI-compatible~7,000 tokens (single source: Systima)16k–32k1.19.3, 16 Oct 2026
2Qwen CodeCLIOllama, vLLM, any OpenAI-compatiblenot measurednot stated0.25.3, 19 Oct 2026
3Codex CLI --ossCLIOllama, LM Studio~25,450 default, ~18,415 minimal (v0.121.0), incl. ~17,000 of MCP schemas; ~8,500 expected without (single source: Vaughan)64k0.163.0, 15 Oct 2026
4ClineVS Code + CLIOllama, LM Studio90% smaller with Compact Prompt32k at 32 GB (Cline blog)ext 4.1.25, 16 Oct 2026
5AiderCLIOllama, OpenAI-compatiblenot measuredauto-sized0.86.2, 12 Feb 2026 (stale)
6PiCLIAny OpenAI/Anthropic-compatible~600 tokens, estimated (single source: Vaughan)not stated1.3.0, 15 Oct 2026
7Kilo CodeVS Code, JetBrains, CLIOllama, LM Studionot measured32k7.8.15, 19 Oct 2026
8Claude Code (local)CLIOllama, LM Studio (Anthropic API)~33,000 tokens (single source: Systima)64k2.1.304, 19 Oct 2026

Versions come from the npm, PyPI and Open VSX registries, checked 20 Oct 2026. The prompt figures come from three separate measurements, so treat them as rough sizes, not a league table.

Tokens the harness sends before your first request (one third-party measurement each)Pi coding agentPi coding agent: ~600 tokens~600 tokensOpenCodeOpenCode: ~7,000 tokens~7,000 tokensCodex CLICodex CLI: ~25,450 tokens~25,450 tokensClaude CodeClaude Code: ~33,000 tokens~33,000 tokens
Start-up prompt size. Each figure is a single third-party measurement, on different versions and setups, so read them as rough sizes. Every one of these tokens sits in the KV cache before you open a file.

1. OpenCode: the default pick

OpenCode documents ready-to-paste configs for Ollama (http://localhost:11434/v1), LM Studio (:1234/v1) and llama-server (:8080/v1) (OpenCode docs). You set limit.context per model, so the harness knows how much room it has. It supports MCP.

Step-by-step setup: OpenCode with Ollama, LM Studio or llama.cpp, with copyable commands and the models that fit your GPU.

Its measured start-up prompt is about 7,000 tokens with 10 tools, against about 33,000 tokens with 27 tools for Claude Code. That comes from a single Systima study, as reported by Developers Digest on 12 July 2026 (single source). The test ran on a cloud model, but prompt size does not depend on the model.

One catch: OpenCode's docs say its workflow "relies on tool calling". If tool calls fail on Ollama, the docs suggest raising num_ctx to 16k–32k first.

2. Qwen Code: best match for Qwen models

Qwen Code is Apache-2.0, supports MCP and takes any OpenAI-compatible endpoint (GitHub). Setup is three env vars: OPENAI_BASE_URL, OPENAI_API_KEY and OPENAI_MODEL (Qwen Code docs). The free Qwen OAuth tier ended on 15 April 2026, so local use is now the main free path.

Step-by-step setup: Qwen Code with Ollama, LM Studio or llama.cpp, with copyable commands and the models that fit your GPU.

Sebastian Raschka ran Qwen3.6 35B-A3B in Qwen Code on his own five-task set and reported 4 of 5 solved (community-reported, Raschka).

3. Codex CLI with --oss

Codex has a first-class local mode. Run ollama launch codex, or codex --oss -m , and set oss_provider = "ollama" or "lmstudio" in config.toml (Codex config docs). Ollama asks for at least a 64k context window for Codex.

Step-by-step setup: Codex CLI with Ollama or LM Studio, with copyable commands and the models that fit your GPU.

In Raschka's test, Qwen3.6 "does actually perform better" in Codex than in Qwen Code, and Codex used the fewest tokens of the three harnesses he tried (community-reported). The 25k prompt figure above dates from April and version 0.121.0, so it may be out of date. Vaughan also says about 17,000 of those tokens were MCP tool schemas from his own setup. He expected about 8,500 without them (single source: Vaughan).

4. Cline: the VS Code pick

Cline is the most-starred active VS Code agent with a local mode: 71.0k stars on 20 Oct 2026 (GitHub). Choose Ollama or LM Studio in the provider menu (Cline docs). On small machines, switch on Settings → Features → Use Compact Prompt. Cline says this cuts the system prompt by 90%, but it turns off MCP and Focus Chain (Cline blog, Sep 2025, possibly stale).

Step-by-step setup: Cline with Ollama, LM Studio or llama.cpp, with copyable commands and the models that fit your GPU.

5. Aider: best for small GPUs

Aider is the one major harness here that does not need native tool calling. It asks the model for edits in text formats such as diff or whole. That makes it forgiving with small models and odd chat templates.

Step-by-step setup: Aider with Ollama, LM Studio or llama.cpp, with copyable commands and the models that fit your GPU.

Setup: export OLLAMA_API_BASE=http://127.0.0.1:11434, then aider --model ollama_chat/. Aider sizes Ollama's num_ctx to fit each request plus 8k for the reply (Aider docs).

The worry is maintenance. The last PyPI release is 0.86.2 from 12 February 2026 (PyPI). The Aider leaderboard's newest open-weight row is from 3 October 2025 (leaderboard). It still works, but treat it as stable rather than moving.

6. Pi: the minimalist

Pi ships four tools (read, write, edit, bash). Its system prompt was estimated at about 600 tokens on v0.67.68 (single source: Vaughan). You add a local endpoint in ~/.pi/agent/models.json and can replace the prompt with .pi/SYSTEM.md. Its current docs add MCP servers through an mcp.json file (Pi docs).

Step-by-step setup: Pi with Ollama, LM Studio or llama.cpp, with copyable commands and the models that fit your GPU.

In Vaughan's one-task test, Pi ran Gemma 4 31B dense in 266 s against 569 s under default Codex (single source: Vaughan). But Qwen3.6 35B-A3B wrote its files to /tmp under Pi. Small prompts help speed; they do not fix every model.

7. Kilo Code

Kilo is MIT, runs in VS Code, JetBrains and a CLI, and its CLI is a fork of OpenCode (GitHub). Its Ollama docs are the most candid I found. They recommend qwen3-coder:30b, a num_ctx of at least 32k, and 24 GB+ VRAM or a 32 GB+ Mac. They also warn that qwen3-coder:30b "sometimes fails to call tools correctly" (Kilo docs).

Step-by-step setup: Kilo Code with Ollama or LM Studio, with copyable commands and the models that fit your GPU.

8. Claude Code with a local model

This works and is now easy. Use ollama launch claude, or set ANTHROPIC_BASE_URL=http://localhost:11434, ANTHROPIC_AUTH_TOKEN=ollama and ANTHROPIC_API_KEY="" (Ollama docs). LM Studio works too, on port 1234 with CLAUDE_CODE_ATTRIBUTION_HEADER=0 (LM Studio docs).

Step-by-step setup: Claude Code with Ollama or LM Studio, with copyable commands and the models that fit your GPU.

It ranks last of the eight for local use for three reasons. It is proprietary. Its start-up prompt is the largest measured. And Ollama's Anthropic API does not support tool_choice or prompt caching (Ollama docs). Model vendors do test in it, though: Qwen reports Qwen3.8-27B's SWE-bench Pro score using the Claude Code harness (model card).

Also works

  • Crush (Charm): Auto-discovers Ollama and LM Studio models, and supports MCP and LSP. Its licence is FSL-1.1-MIT, which is source-available (GitHub).
  • Goose: A general agent built on MCP extensions. Configure it with OLLAMA_HOST. It "depends heavily on tool calling" (Goose docs).
  • OpenHands: A sandboxed web UI in Docker. It recommends Qwen3.6-35B-A3B and at least 22k context, 32,768 for better results (OpenHands docs).
  • Zed agent: Native Ollama and LM Studio support. Zed sends num_ctx 4096 unless you raise max_tokens (Zed docs).
  • GitHub Copilot BYOK: Agent mode works with local models marked "toolCalling": true. It needs no Copilot plan, but some features still call GitHub (VS Code docs).

I left Cursor out because I could not confirm a fully local mode from its docs.

Which harness for which setup

Every figure in the last column comes from the same engine as the analyzer: the memory the model needs at that context (weights, an f16 KV cache and runtime overhead), and the verdict for the memory named. Unified memory counts three quarters of the total as usable.

Your machineModel to start withHarnessContext to setFit (analyzer)
8–16 GB VRAMQwen3.5 9BAider, Pi, or Cline with Compact Prompt32k7.4 GB, tight on 8 GB; 7.4 GB, fits 12 GB
16 GB VRAM + 32 GB+ RAMQwen3.6-35B-A3B with MoE layers on CPUAider or OpenCode32k22.7 GB, needs CPU offload on 16 GB + 32 GB RAM
24–32 GB VRAMQwen3.6-35B-A3BOpenCode, Codex --oss64k23.3 GB, tight on 24 GB; 23.3 GB, fits 32 GB
24–32 GB VRAMQwen3.8-27B or Qwen3.6-27BQwen Code, OpenCode32k19.9 GB, fits 24 GB
24–32 GB VRAM, VS CodeQwen3-Coder 30B-A3B or Devstral Small 2Cline, Kilo Code32k–64k32k: 22.4 GB, tight on 24 GB; 64k: 25.7 GB, fits 32 GB
96 GB+ unified memoryQwen3-Coder-Next (80B, 3B active)OpenCode, Codex --oss128k52.4 GB, does not fit 64 GB unified; 52.4 GB, fits 96 GB unified
64 GB+ unified memoryQwen3.6-35B-A3B at Q8Claude Code via Ollama, OpenHands128k40.7 GB, fits 64 GB unified

Why the small tier avoids Claude Code: my arithmetic, not a measurement. About 33,000 tokens of harness prompt (single source: Systima) is half of a 64k window before you open a file. On 8–16 GB, the KV cache for that window competes with the weights. The analyzer is the authority on whether it fits; use the KV cache calculator to see the cost.

The model picks follow the vendors and docs. Qwen3.6-35B-A3B is 35B total with 3B active and a 262,144-token native context (model card; Vaughan). Qwen3-Coder-Next is 80B total with 3B active (model card; Vaughan). Its card names Claude Code, Qwen Code, Kilo and Cline as supported scaffolds. InsiderLLM suggests running the 35B-A3B on 16 GB with --cpu-moe for the experts (single source: InsiderLLM). Devstral Small 2 dates from December 2025, so treat it as possibly stale. For a deeper model list, see best local coding models.

Cline vs Continue in 2026

The short answer: pick Cline, because Continue is no longer maintained.

ClineContinue
StatusActive: extension 4.1.25 (16 Oct 2026), CLI 3.0.73 (17 Oct 2026)Not maintained; repo read-only; last Open VSX release 2.1.0 (19 Jun 2026)
SurfacesVS Code extension, CLIVS Code, JetBrains, CLI (frozen)
Local providersOllama, LM StudioOllama, LM Studio, OpenAI-compatible
Agent mode needsTool-capable model; Compact Prompt for small machinescapabilities: [tool_use], or "System Message tools" fallback
AutocompleteNo tab-autocomplete model role documentedYes, its main strength (e.g. qwen2.5-coder:1.5b)
LicenceApache-2.0Apache-2.0
Stars (20 Oct 2026)71.0k36.3k

Sources: Cline GitHub, Open VSX Cline, Continue GitHub, Open VSX Continue, Continue Ollama guide.

The GitHub README calls 2.0.0 the "final" release of the VS Code extension, CLI and JetBrains plugin. Open VSX lists a later 2.1.0, dated 19 June 2026. Either way, no fixes are coming for new chat templates or Ollama changes. Ollama 0.32.6 (4 August 2026) changed its OpenAI-compatible streaming to match OpenAI's chunk layout (Ollama release notes).

If you used Continue for agent work, move to Cline or Kilo Code. If you used it for tab autocomplete, it will keep working until something breaks. The setup steps are in my local coding agent setup guide and my Cline write-up.

The five failure modes that look like a "bad harness"

Most "this harness doesn't work with local models" reports come down to one of these.

  • Context truncation. Ollama defaults to 4k on GPUs under 24 GiB (Ollama docs) and silently drops what doesn't fit (Aider docs). Set OLLAMA_CONTEXT_LENGTH=64000 ollama serve and check the CONTEXT column in ollama ps. Zed and Continue also send their own num_ctx. More in the context window guide.
  • Missing chat template. llama.cpp needs --jinja for tool calls (InsiderLLM). Ramalama needs it for Goose (Goose docs).
  • Wrong tool-call parser on vLLM/SGLang. Qwen3.6 and Qwen3-Coder-Next use --tool-call-parser qwen3_coder; Devstral uses mistral (Qwen3.6-27B card, Devstral card).
  • Thinking mode eats the tool call. With thinking on, some models put the call in reasoning_content. InsiderLLM also reports, citing a Reddit PSA, that Qwen 3.6 ignores {"enable_thinking": false} in chat-template kwargs if there is a space after the colon (single source: InsiderLLM).
  • Over-quantised KV cache. InsiderLLM reports that -ctk q4_0 hurts tool-call accuracy and recommends Q8 or higher for the KV cache (single source: InsiderLLM).

Is there a fair benchmark of harnesses on local models?

No, not yet. Here is what exists.

  • Cloud "harness effect" figures. Vaughan reports Claude Opus at 93% on Terminal-Bench 2.0 in Cursor and 77% in default Claude Code (single source: Vaughan, citing Pawel Jozefiak). No local model was involved.
  • Single-author local tests. Vaughan compared Pi and Codex on one task with four local models. Raschka compared Qwen Code, Codex and Claude Code on five tasks. Both are useful, but neither is a benchmark.
  • Harness Arena. A blind, same-model, same-task arena. At the time of a 18 Sep 2026 walkthrough, each harness had one vote, and the sponsor runs a competing harness (summary).

So the "harness swing" for local models is real in anecdotes and unmeasured at scale.

My take

If I were setting up a local coding agent today on a 24 GB card, I would start with OpenCode and Qwen3.6-35B-A3B at a 64k context. I'd keep Codex --oss as a second opinion. The small prompt matters more locally than any feature list, because every token of harness overhead costs memory and prefill time.

On a laptop GPU, I would not fight it. Aider with a 9B model, or Pi, gets real edits done without an agent loop that drowns in its own instructions.

I'd stop recommending Continue for new setups. That is not a judgement on its quality. An unmaintained client is a liability when model templates change every few months. For VS Code users, Cline is the safe default today.

Claude Code with a local model is fun to try, and vendors now test models in it. But it is built for a cloud model with prompt caching. Locally, it is the heaviest option here.

Get started

Rent GPUs on RunPod → Rent GPUs on Vast.ai → This page contains affiliate links.

Frequently asked questions

What is the best agent harness for local LLMs in 2026?

OpenCode is the best default for local models in October 2026. It has documented configs for Ollama, LM Studio and llama.cpp, supports MCP, and has a start-up prompt of about 7,000 tokens in one third-party study. Qwen Code and Codex CLI with --oss are strong alternatives on 24–32 GB machines.

Which coding agent harness works best with Ollama?

OpenCode, Codex CLI and Claude Code all have direct Ollama paths, and Ollama ships "ollama launch codex" and "ollama launch claude" commands. Aider uses the ollama_chat/ model prefix. Whichever you pick, raise Ollama's context with OLLAMA_CONTEXT_LENGTH, because the default is 4k tokens on GPUs under 24 GiB.

Is Cline or Continue better for local models?

Cline. Continue's maintainer announced it is no longer actively maintained, and its last Open VSX release is 2.1.0 from 19 June 2026. Cline is still shipping and supports Ollama, LM Studio, MCP and a Compact Prompt mode for smaller machines.

How much context does a local coding agent need?

Ollama recommends at least 64,000 tokens for coding agents. Codex and Claude Code docs ask for 64k, OpenHands asks for at least 22,000, and Kilo Code asks for at least 32k. The context you can afford depends on your VRAM, so check it in the LLMConfigurator analyzer.

Can I use Claude Code with a local model?

Yes. Run "ollama launch claude", or point ANTHROPIC_BASE_URL at Ollama (port 11434) or LM Studio (port 1234). Use a tool-capable model and a 64k+ context. Expect a large start-up prompt, about 33,000 tokens in one third-party measurement, and no prompt caching through Ollama.

Which harness works with models that are weak at tool calling?

Aider. It asks the model for edits in plain-text diff formats rather than native tool calls, so it tolerates small models and imperfect chat templates. Most other harnesses, including OpenCode, Goose and Copilot agent mode, require native tool calling.

Which local model should I use with a coding agent?

On 24–32 GB, Qwen3.6-35B-A3B is the most widely documented choice. OpenHands recommends it, and its model card reports 73.4 on SWE-bench Verified. Qwen3.8-27B and Devstral Small 2 are alternatives. On 96 GB+ of unified memory, Qwen3-Coder-Next (80B total, 3B active) is the step up.

Is there a benchmark comparing agent harnesses on the same local model?

Not a rigorous one as of October 2026. There are single-author tests by Daniel Vaughan and Sebastian Raschka, and a crowd-voted Harness Arena with very few votes. The Aider polyglot leaderboard tests models inside Aider only, and its newest open-weight entry dates from October 2025.

Sources (42)