Most of them can: OpenCode, Codex CLI, Cline and Claude Code start on an Ollama model with one command, ollama launch followed by the agent's name, and goose and Aider connect to Ollama in their own settings. Ollama added the launch command in version 0.15.0 in January 2026. Before you judge an agent, set the context window: Ollama's documentation says coding tools should have at least 64000 tokens, and its defaults are lower on a smaller machine. The agent is the open source part, and the model you load decides how good the answers are. This page repeats each project's own instructions and quotes no speed or quality figure, because we have not measured these agents on a local model.
| Agent | How to run it on an Ollama model | Source |
|---|---|---|
| OpenCode (MIT) | ollama launch opencode. OpenCode also probes a running Ollama at 127.0.0.1:11434 and adds its models | Ollama, OpenCode docs |
| Codex CLI (Apache 2.0) | ollama launch codex, or codex --oss, or codex --oss -m gpt-oss:120b for a named model | Ollama |
| Cline (Apache 2.0) | ollama launch cline, or ollama launch cline --model qwen3.5 | Ollama |
| goose (Apache 2.0) | In Goose, Settings, Configure Provider, Ollama, API host http://localhost:11434. In the command line, goose configure, then Ollama | Ollama |
| Aider (Apache 2.0) | Set OLLAMA_API_BASE=http://127.0.0.1:11434, then aider --model ollama_chat/<model> | Aider docs |
| Claude Code (all rights reserved) | ollama launch claude, covered on its own page | Claude Code with a local model |
Ollama's integrations list also has pages for Copilot CLI and Droid, which are not open source agents, and for Claude Desktop, covered on the Claude desktop app with a local model. Gemini CLI's README describes no local model route.
A coding agent fills a context window fast, because it reads files and runs commands. Ollama's context page says tasks that need large context, agents and coding tools among them, should be set to at least 64000 tokens, and that a larger window needs more memory. Its defaults depend on memory: 4k below 24 GiB of VRAM, 32k from 24 to 48 GiB, 256k from 48 GiB. OpenCode's and Codex CLI's Ollama pages repeat the 64k minimum.
OLLAMA_CONTEXT_LENGTH=64000 ollama serve
ollama ps
The second line is Ollama's own check: ollama ps shows the context each loaded model was given and whether it runs fully on the GPU. Aider's page says it sets Ollama's window for each request itself, so the variable matters most for the others.
Pick a model that supports tools, as large as your memory holds with room for the long context. Best local LLM for coding on a Mac lists coding models by memory, and which LLM can my Mac run gives the sizing rule. Ollama's launch pages also offer cloud models, which run on Ollama's service; choose a model you have pulled when you want it local.
That is a question about the agent, not the model. Open source Claude Code alternatives compares the same agents by licence, where they run and what each is for.
| Claim | Source |
|---|---|
| ollama launch arrived in Ollama 0.15.0, for Claude Code, Codex, OpenCode and Droid | Ollama release v0.15.0 |
| The launch command and the 64k context minimum for OpenCode | Ollama documentation, OpenCode |
| The launch command and the oss flag for Codex CLI; at least 64k tokens | Ollama documentation, Codex CLI |
| The launch command for Cline | Ollama documentation, Cline CLI |
| The goose steps for Ollama | Ollama documentation, Goose |
| The Aider variable and command, and how it sets the context window | Aider documentation, Ollama |
| At least 64000 tokens for coding tools; the context defaults by memory; ollama ps | Ollama documentation, Context length |
| OpenCode finds a running Ollama by itself | OpenCode documentation, providers |
All of these were read on 19 November 2026. Check each project's page for the current commands before you copy one.