AI Coding AgentsLLM

Cline in VS Code with a local model: a private AI coding agent with Ollama (Linux, Windows, Mac)

Before you start

  • 19 min read

Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#

Cline is an open-source AI coding agent that lives in VS Code: it reads your project, proposes file edits and terminal commands, and waits for you to approve each one, and with Ollama it can use a model that runs on your own computer, so your code does not have to go to a cloud service.

Cline official logo

Logo: the official Cline project (github.com/cline/cline)

Cline suits people who want an agent that edits files and runs commands, not a chat that only suggests code. Here Cline talks to Ollama on localhost, so prompts and files stay on your computer. Two things decide whether it works: the model must be able to make tool calls, and the context window must be big enough for Cline's long instructions.

Current versionCline 4.1.26 for VS Code, released 26 October 2026 (GitHub, Open VSX and the Marketplace agree)
NeedsVS Code 1.101 or newer, and Ollama
Time neededAbout 30 minutes plus the model download (our estimate)
Size on diskYour model decides: Cline's docs list 5.2 GB for qwen3:8b and 18 GB for qwen3.8:27b
PortsNone for Cline. Ollama listens on 11434, on 127.0.0.1 by default
LicenceApache 2.0
Official docsdocs.cline.bot and github.com/cline/cline

At a glance:

  • What it is: a VS Code extension (id saoudrizwan.claude-dev, shown as "Cline"). The project also has a CLI, a desktop app and a JetBrains plugin; this guide covers the VS Code extension only.
  • What it changes: files and terminal commands, only after you approve them.
  • Local model: Ollama on your machine, port 11434.
  • The two settings to get right: a model with the tools badge, and the "Model Context Window" field. Check it with ollama ps.
  • Privacy: your code stays on your computer, but Cline sends usage reports by default. You can turn them off.
  • Status: alive. The repository is not archived and the newest release is from 26 October 2026.

How it fits together#

Cline sits between you, your project and the model. Everything dashed is optional.

Flow diagram of Cline with a local model: you give a task in the Cline panel, Cline sends the prompt and files to Ollama on this machine, Ollama answers with a tool call, you approve or reject it, Cline makes the change after saving a checkpoint, and a cloud model or usage reporting are dashed options

Drawn from the Cline docs (local models, auto approve, checkpoints, telemetry) and the Cline source at release v4.1.26, October 2026. Green is the path that stays on your machine; red only happens if you choose a cloud model.

Before you start#

You need VS Code, Ollama and a project folder. Cline's docs give this rough hardware guide:

RAMTypical local setup (Cline docs)
16-32 GBSmall, quantized models
32-64 GBMid-size coding models
64 GB or moreLarger models and bigger context windows

A model split between GPU and CPU "responds more slowly", and on a CPU-only machine "the first message of a session can take minutes while the model reads Cline's instructions" (Cline docs). Ollama needs Windows 10 22H2 or newer, or macOS Sonoma (14) or newer (Apple silicon; an Intel Mac runs on the CPU only), or Linux.

Run in terminalbash
code --version
git --version
Run in terminalpowershell
code --version
git --version

Checklist:

  • [ ] VS Code 1.101 or newer (or Cursor, Windsurf, VSCodium, Antigravity)
  • [ ] Ollama installed or ready to install; port 11434 free
  • [ ] A project in git with a clean git status, or a throwaway folder
  • [ ] Enough free RAM for the model plus its context (see Performance)

There is no Docker here, so no HTTPS or reverse proxy section: Cline and Ollama run on your machine and Ollama listens on 127.0.0.1 only.

Not run by DIY Lab Hub. Every command and value comes from the official Cline, Ollama and VS Code docs and the Cline source at release v4.1.26, read in October 2026. Where docs and code disagree, we say so.

Step 1: Install Ollama and confirm it runs#

Ollama is the local model server. If you already run it, skip to Step 2. Our Ollama guide goes deeper, and the Aider with a local model and Continue in VS Code guides use the same Ollama setup.

Linux#

Run in terminalbash
curl -fsSL https://ollama.com/install.sh | sh

Windows (PowerShell)#

Run in terminalpowershell
irm https://ollama.com/install.ps1 | iex

Ollama's Windows page says the install does not need Administrator and runs in the background afterwards.

Mac (Terminal)#

Download the app from ollama.com/download and open it once. The download page also lists the same one-line command as Linux:

Run in terminalbash
curl -fsSL https://ollama.com/install.sh | sh

Check it worked. Open a new terminal and run:

Run in terminalbash
ollama --version
curl http://localhost:11434/api/tags

On Windows PowerShell use Invoke-RestMethod http://localhost:11434/api/tags for the second command. The version number prints, and the second command returns a JSON list of your models (empty at first).

Step 2: Pull a model that can call tools#

Cline works by asking the model to call tools (read a file, edit a file, run a command). A model that cannot do that just chats, or prints the tool call as plain text, and then nothing happens.

On ollama.com/search?c=tools the filter shows models with a tools badge. Cline's own docs recommend these for local use, with their memory estimate (model plus context):

Model (Ollama tag)DownloadMemory neededCline's suggested contextCline's note
qwen3:8b5.2 GBabout 10 GB32K8-16 GB machines and simple edits
gpt-oss:20b14 GBabout 16 GB64K16-24 GB machines
devstral-small-2:24b15 GBabout 21 GB32Kexploring codebases, multi-file edits
qwen3.8:27b18 GBabout 23 GB64Kbest all-round local model for agentic coding

Source: the Local Models page of the Cline Desktop docs, October 2026. Smaller models "respond faster but handle complex, multi-step tasks less reliably", so start with the largest model that fits your memory comfortably.

Linux#

Run in terminalbash
ollama pull qwen3:8b
ollama show qwen3:8b

Windows (PowerShell)#

Run in terminalpowershell
ollama pull qwen3:8b
ollama show qwen3:8b

Mac (Terminal)#

Same commands as Linux:

Run in terminalbash
ollama pull qwen3:8b
ollama show qwen3:8b

Check it worked. ollama show prints a Capabilities list. It should include tools. Then run ollama list to see the model on disk.

Tip: A tools capability is necessary but not proof. In GitHub issue #14453 (open, September 2026) the reporter's model declared tools, yet Ollama's reply put the tool call inside the message text instead of the tool_calls field, and Cline showed it as plain text. Test with one small task (Step 5) before you trust a new model.

Step 3: Install the Cline extension#

Install it from the Extensions view, or from the command line. The command line lets you pin the version this guide was checked against (VS Code's docs: append @{version} to install a specific version).

Linux#

Run in terminalbash
code --install-extension [email protected]
code --list-extensions --show-versions | grep -i claude-dev

Windows (PowerShell)#

Run in terminalpowershell
code --install-extension [email protected]
code --list-extensions --show-versions | Select-String claude-dev

Mac (Terminal)#

On a Mac, first open the Command Palette in VS Code (Cmd+Shift+P) and run "Shell Command: Install 'code' command in PATH" (VS Code docs). Then:

Run in terminalbash
code --install-extension [email protected]
code --list-extensions --show-versions | grep -i claude-dev

You can also press Ctrl+Shift+X (Cmd+Shift+X on a Mac), search for "Cline" and click Install, as the Cline docs describe.

Check it worked. The last command prints [email protected]. A robot icon for Cline appears in the Activity Bar. If you cannot find it, open the Command Palette and run "Cline: Open In New Tab" (Cline docs).

Tip: The extension id is saoudrizwan.claude-dev. It does not look like "Cline" or "cline", and it is the real one: the Marketplace, Open VSX and the project's README all use it. Do not install a different extension with a similar name.

Step 4: Point Cline at Ollama and set the context window#

The settings screen is the same on all three systems; only the shortcut keys differ.

Linux#

  1. Open the Cline panel (robot icon in the Activity Bar) and click the gear icon at its top right.
  2. Under the API provider choose Ollama.
  3. Leave "Use custom base URL" empty. The default is http://localhost:11434.
  4. Pick your model in Model. Cline reads the list from Ollama; if it is empty, type the name (for example qwen3:8b).
  5. Set Model Context Window to 32768 on a small machine, or 65536 if your memory allows. Type the number yourself.

Windows (PowerShell)#

Same steps as Linux. If you cannot find the panel, press Ctrl+Shift+P and run "Cline: Open In New Tab".

Mac (Terminal)#

Same steps as Linux; the shortcut is Cmd+Shift+P. Ollama must be running (menu bar app).

Check it worked. Send "Reply with the word ready" in Cline, then run this in a terminal while the model is loaded:

Run in terminalbash
ollama ps

Ollama's docs show this layout (expected output, from the docs, with their example model):

Codetext
NAME             ID              SIZE      PROCESSOR    CONTEXT    UNTIL
gemma4:latest    c6eb396dbd59    9.6 GB    100% GPU     131072     2 minutes from now

Your row shows your model and the CONTEXT number you set; PROCESSOR should say 100% GPU where you have a GPU.

Why the field matters: Cline's source says it uses Ollama's native /api/chat and sends your number as num_ctx with each request. Ollama's own default is 4096 tokens and its docs say coding tools need at least 64000. The field's placeholder is 32768. More context holds more of your project but needs more memory (see Performance). The same code comment says the OpenAI-compatible /v1 endpoint ignores num_ctx, so keep the provider on Ollama, not "OpenAI Compatible".

Request Timeout (ms) defaults to 300000 (5 minutes) and counts the time until the answer starts. Raise it if a large model is slow to load.

Tip: Cline's docs recommend focused tasks ("smaller context = faster responses") and a new task when the context gets too large. With a local model that advice matters more than any setting.

Safe settings before your first task#

Do these before Cline can touch your files. They are the same on every system.

SettingWhereWhat to do
Auto-approveThe auto-approve bar in the chat panel: Read files, Edit files, Execute commands, Fetch web content, Use MCP serversLeave everything off except, at most, "Read files" (the docs' recommended default)
YOLO modeCline docs say Settings, FeaturesNever turn it on. The docs: it "disables all safety checks"
CheckpointsSettings, FeaturesKeep on (default). Cline snapshots your files in a separate shadow git repository after each step
Usage reportingGear icon, General, "Allow error and usage reporting"Clear it if you do not want to send usage events
Web SearchSettings, FeaturesLeave off for a fully local setup

Cline has no fixed list of safe commands: "the model marks each command with a requires_approval flag" (docs). A weak local model can mislabel one, so read every command before you click Approve.

Step 5: Run a first task in a throwaway folder#

Make a small test project so a mistake costs nothing.

Linux#

Run in terminalbash
mkdir -p ~/cline-test && cd ~/cline-test
git init
code .

Windows (PowerShell)#

Codepowershell
New-Item -ItemType Directory -Force $HOME\cline-test | Out-Null
Set-Location $HOME\cline-test
git init
code .

Mac (Terminal)#

Same commands as Linux:

Run in terminalbash
mkdir -p ~/cline-test && cd ~/cline-test
git init
code .

In the Cline panel, make sure the toggle at the bottom says Plan, and send:

Codetext
Create a file hello.py that prints "hello from Cline". Do not do anything else.

Cline's docs explain the modes: Plan mode only talks, Act mode makes changes. Switch to Act, and when Cline proposes the new file, check the path and the content and click Approve.

Check it worked. hello.py appears in the Explorer. In a terminal:

Run in terminalbash
python3 hello.py
git status --short

(Use python hello.py on Windows.) It prints the line, and git status lists the new file, which Cline did not commit. Cline does not use your git history for undo: its checkpoints are in a shadow repository, and the Restore button next to a step rolls back your files.

What leaves your machine#

With a local model the answer is "much less, but not nothing".

PartWhere data goesWhat you can do
Prompts and project filesTo Ollama on 127.0.0.1:11434. Ollama's FAQ: "We don't see your prompts or data when you run locally."Keep the default address; never set OLLAMA_HOST to a public address
Usage and error reportingEvents such as features used, errors, token counts, timings, model names, Cline version, OS, editor and a device id. On by default, even with your own keys. Not your code, files or prompts, except for the Cline and ClinePass providers (telemetry page)Clear "Allow error and usage reporting"
Sign-in and feature flagsWith telemetry off, Cline "still contacts its servers" to sign you in and check feature flagsDo not sign in or pick the Cline providers
A cloud provider you addYour prompts and code go to that providerAdd one only on purpose
Ollama cloud models (names ending :cloud)Processed on Ollama's serversUse local models, or set OLLAMA_NO_CLOUD=1 (Ollama FAQ)
Fetch web content, Web Search, MCP serversNetwork requests to sites or toolsLeave them off unless needed
Commands Cline runsThey run on your computer with your permissions and can use the networkRead each command first

In VS Code, a few required events (such as the one recording that you turned telemetry off) are still sent while the editor's own telemetry is on.

Security and testing#

  • Keep Ollama local. It listens on 127.0.0.1:11434 by default (Ollama FAQ). OLLAMA_HOST=0.0.0.0 opens it to your network; never expose it to the internet.
  • Secrets. A local setup needs no key. Cline stores provider settings in ~/.cline/data/settings/providers.json: keep that file out of repos, backups and bug reports.
  • Rules and plugins can run code. Cline's config page: "Only use rules, hooks, skills, and plugins from sources you trust." Project rules live in .cline/rules/ (and the older .clinerules); read them before opening an unknown repository.
  • .clineignore is not protection. The deprecation page says it "was never designed to prevent access" and shell commands can still reach the files. Keep secrets out of the folder.
  • Text in files can steer the model. Our assessment, not a Cline statement: a file or web page may hold instructions aimed at the model. Approve each action yourself.
  • Functional test (Ollama alone). This tells Ollama problems apart from Cline problems:
Run in terminalbash
ollama run qwen3:8b "Reply with the word ready."
Run in terminalpowershell
ollama run qwen3:8b "Reply with the word ready."

Check it worked. The model prints a short reply. If this works but Cline does not, look at the Cline settings.

Common mistakes#

Each row comes from the Cline docs and source or from a real issue in the Cline tracker (state and date as read in October 2026). The last two rows are about AI assistants.

MistakeWhy it happensDo this instead
Choosing a model that cannot call toolsCline needs tool calls to act. Issues #14453, #15255 and #10843 show Qwen 2.5 Coder via Ollama printing the tool call as text, or loopingChoose a model with the tools badge from Cline's list; test one small task; try a larger model if it only chats
Leaving the context small, or setting it too bigOllama's default is 4096 tokens; a context that does not fit pushes the model onto the CPU. Issue #15275 (open): small models on a 16 GB Intel MacBook "time out after 900,000 milliseconds"Set "Model Context Window", check CONTEXT and PROCESSOR in ollama ps, lower it until the model sits on the GPU
Using the "OpenAI Compatible" provider for OllamaCline's source says Ollama's /v1 endpoint ignores num_ctxChoose the Ollama provider
Putting another service between Cline and OllamaIssue #15392 (closed): a timeout on 4.1.26 vanished once the reporter noticed Open WebUI sat in betweenPoint Cline at Ollama directly; add a proxy once it works
Following the docs' "Use Compact Prompt" step and not finding itThe docs say to enable it in Settings, Features. The 4.1.26 Features page has "Auto Compact" but no such switch; issue #13008 (closed) says 4.1.x removed the compact-prompt and native-tool-call switchesIf you do not see it, skip it. Use "Auto Compact" and short tasks
Turning on auto-approve or YOLO for speedA local model errs more, and the docs say YOLO "disables all safety checks"Approve each edit and command; use Restore if something goes wrong
Treating .clineignore as protectionCline can still reach files through shell commands (deprecation page)Keep secrets out of the project folder
AI assistants telling you to add Ollama as an "OpenAI Compatible" provider at /v1, or to rely on OLLAMA_CONTEXT_LENGTHOur assessment from the docs and source, not a test: assistants copy older setups. On the Ollama provider Cline sends the context with each requestUse the Ollama provider and the "Model Context Window" field; check each name at docs.cline.bot
AI assistants inventing settings keys or an extension idOur assessment: the real id is saoudrizwan.claude-dev, and provider settings are written by the settings screen, not by a documented settings.json keyUse the settings screen and the id from the Marketplace page

Tip: Make your first session a throwaway: a small folder, a clean git status, one tiny task. If a model cannot do that, it will not do your real project.

Tip: Keep ollama ps open in a second terminal. CONTEXT and PROCESSOR show the two things that most often break a local setup: the size you set, and whether the model runs on the GPU.

Tip: After a tool call goes wrong, start a new task instead of retrying. Cline's docs say to do this when the context gets too large, and a long failed conversation fills the window fast.

Troubleshooting#

ProblemSolution
Model list is emptyMake sure Ollama runs (ollama ps, or curl http://localhost:11434/api/tags), then type the model name yourself
Cline shows JSON instead of actingThe model is not making real tool calls. Try a model from the Step 2 table (issues #14453, #15255)
Very slow replies, or minutes for the first messageCheck PROCESSOR in ollama ps. On the CPU, lower the context or pick a smaller model
Timeout errorsRaise "Request Timeout (ms)", lower the context, remove any proxy between Cline and Ollama
Model forgets the projectThe context is too small. Raise "Model Context Window" and check CONTEXT in ollama ps
Cline behaves differently after an updateRead the release notes and open issues; install the older version with code --install-extension saoudrizwan.claude-dev@<version>

Exact error texts#

Unable to fetch models from Ollama server. Please ensure Ollama is running and accessible, or enter the model ID manually above. The text in the Ollama settings of the 4.1.26 source. Start Ollama, check the base URL, or type the model name.

Ollama request timed out after 300 seconds is built in the source from the Request Timeout setting (default 300000 ms). The model took longer than that to start answering. Raise it or use a smaller model.

BodyTimeoutError: Body Timeout Error (UND_ERR_BODY_TIMEOUT) appears in issue #15392 (closed, October 2026; a proxy sat in between) and #13371 (closed, August 2026; vLLM with the JetBrains plugin, where a commenter advised raising the provider timeout).

Shell Integration Unavailable: issue #11022 (closed as not planned, May 2026) reports it in VS Code on WSL with zsh although Cline still read the output. Cline's Marketplace README says commands run in a visible VS Code terminal using shell integration, and you can switch to a background process under Settings, Terminal, Terminal Execution Mode.

Known bugs (open on 31 October 2026)#

  • #14453, #15255, #10843: Qwen 2.5 Coder via Ollama returns tool calls as text or loops.
  • #15275: small Ollama models time out on an older Mac.

Updates and backups#

Update. VS Code installs extension updates automatically unless you turn that off (VS Code docs: right-click an extension and toggle Auto Update). If a new Cline release breaks your local setup, turn off auto-update for Cline and install the version you want:

Run in terminalbash
code --install-extension [email protected]
Run in terminalpowershell
code --install-extension [email protected]

Ollama updates itself on Mac and Windows; on Linux re-run the install script (Ollama FAQ).

Back up your work. Cline is not a server and has no Docker volume, so there is no ~/docker_volumes folder for it. Your project's history is in git. Cline's own config is ~/.cline/: rules in ~/.cline/rules/ and workflows in ~/.cline/workflows/ are worth saving. Do not back up ~/.cline/data/settings/providers.json unless you know it holds no keys. Linux and Mac:

Run in terminalbash
mkdir -p ~/backups
tar -czf ~/backups/cline-rules-$(date +%F).tar.gz -C ~ $(cd ~ && ls -d .cline/rules .cline/workflows 2>/dev/null)

Windows PowerShell:

Codepowershell
New-Item -ItemType Directory -Force $HOME\backups | Out-Null
$paths = @("$HOME\.cline\rules", "$HOME\.cline\workflows") | Where-Object { Test-Path $_ }
if ($paths) { Compress-Archive -Path $paths -DestinationPath "$HOME\backups\cline-rules-$(Get-Date -Format yyyy-MM-dd).zip" -Force }

Schedule it with cron at 03:00 (Linux, Mac) or Windows Task Scheduler. Leave model files out: Ollama can download them again.

Restore test. Extract into a new folder and look at the result, never over your live config:

Run in terminalbash
mkdir -p ~/restore-test && tar -xzf ~/backups/cline-rules-<date>.tar.gz -C ~/restore-test && ls -R ~/restore-test
Codepowershell
Expand-Archive -Path "$HOME\backups\cline-rules-<date>.zip" -DestinationPath "$HOME\restore-test"
Get-ChildItem -Recurse $HOME\restore-test

If your rule files are listed, the backup works.

Performance and resources#

  • Context memory. Ollama's FAQ: RAM scales with OLLAMA_NUM_PARALLEL times OLLAMA_CONTEXT_LENGTH. Cline's estimates (model plus context): about 10 GB for qwen3:8b at 32K, about 23 GB for qwen3.8:27b at 64K.
  • Ollama's own default depends on GPU memory: under 24 GiB, 4k; 24 to 48 GiB, 32k; 48 GiB or more, 256k, and its docs advise 64000 or more for coding tools. Cline sends its own number, so your "Model Context Window" wins.
  • Model stays loaded. Ollama keeps a model in memory for 5 minutes by default (OLLAMA_KEEP_ALIVE). ollama stop <model> frees it sooner.
  • Keep tasks small. Cline's docs: keep tasks focused and start a new task when the context gets too large. Checkpoints can use storage in very large repositories and can be switched off.
  • Monitoring. ollama ps shows the processor split and context. We took no timings, and Cline's docs publish no speed numbers for local models.

FAQ#

Does it work without an internet connection? The docs do not promise it. Your prompts stay local, but Cline's telemetry page says it still contacts its servers to sign you in and check feature flags. Test offline use on your own network first.

Which model should I use? One with the tools badge. Cline's docs list qwen3:8b for 8-16 GB machines, gpt-oss:20b for 16-24 GB and qwen3.8:27b for the best all-round local result.

Do I need a GPU? Cline's docs do not require one, but the first message of a session can take minutes on a CPU-only machine. Check ollama ps for the split.

Is Cline still maintained? Yes: the repository is public and not archived, and 4.1.26 came out on 26 October 2026. Releases are frequent, so pin a version that works for you.

What about the CLI and the desktop app? They share the same engine. The CLI needs Node.js 20 or newer (npm install -g cline); the desktop app (macOS and Windows) has its own Local Models page. We checked only the VS Code extension.

Sources#

Checked against the official docs on 2026-10-31.