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.

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 version | Cline 4.1.26 for VS Code, released 26 October 2026 (GitHub, Open VSX and the Marketplace agree) |
| Needs | VS Code 1.101 or newer, and Ollama |
| Time needed | About 30 minutes plus the model download (our estimate) |
| Size on disk | Your model decides: Cline's docs list 5.2 GB for qwen3:8b and 18 GB for qwen3.8:27b |
| Ports | None for Cline. Ollama listens on 11434, on 127.0.0.1 by default |
| Licence | Apache 2.0 |
| Official docs | docs.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
toolsbadge, and the "Model Context Window" field. Check it withollama 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.
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:
| RAM | Typical local setup (Cline docs) |
|---|---|
| 16-32 GB | Small, quantized models |
| 32-64 GB | Mid-size coding models |
| 64 GB or more | Larger 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.
code --version git --version
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#
curl -fsSL https://ollama.com/install.sh | sh
Windows (PowerShell)#
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:
curl -fsSL https://ollama.com/install.sh | sh
Check it worked. Open a new terminal and run:
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) | Download | Memory needed | Cline's suggested context | Cline's note |
|---|---|---|---|---|
qwen3:8b | 5.2 GB | about 10 GB | 32K | 8-16 GB machines and simple edits |
gpt-oss:20b | 14 GB | about 16 GB | 64K | 16-24 GB machines |
devstral-small-2:24b | 15 GB | about 21 GB | 32K | exploring codebases, multi-file edits |
qwen3.8:27b | 18 GB | about 23 GB | 64K | best 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#
ollama pull qwen3:8b ollama show qwen3:8b
Windows (PowerShell)#
ollama pull qwen3:8b ollama show qwen3:8b
Mac (Terminal)#
Same commands as Linux:
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
toolscapability is necessary but not proof. In GitHub issue #14453 (open, September 2026) the reporter's model declaredtools, yet Ollama's reply put the tool call inside the message text instead of thetool_callsfield, 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#
code --install-extension [email protected] code --list-extensions --show-versions | grep -i claude-dev
Windows (PowerShell)#
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:
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#
- Open the Cline panel (robot icon in the Activity Bar) and click the gear icon at its top right.
- Under the API provider choose Ollama.
- Leave "Use custom base URL" empty. The default is
http://localhost:11434. - Pick your model in Model. Cline reads the list from Ollama; if it is empty, type the name (for example
qwen3:8b). - Set Model Context Window to
32768on a small machine, or65536if 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:
ollama ps
Ollama's docs show this layout (expected output, from the docs, with their example model):
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.
| Setting | Where | What to do |
|---|---|---|
| Auto-approve | The auto-approve bar in the chat panel: Read files, Edit files, Execute commands, Fetch web content, Use MCP servers | Leave everything off except, at most, "Read files" (the docs' recommended default) |
| YOLO mode | Cline docs say Settings, Features | Never turn it on. The docs: it "disables all safety checks" |
| Checkpoints | Settings, Features | Keep on (default). Cline snapshots your files in a separate shadow git repository after each step |
| Usage reporting | Gear icon, General, "Allow error and usage reporting" | Clear it if you do not want to send usage events |
| Web Search | Settings, Features | Leave 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#
mkdir -p ~/cline-test && cd ~/cline-test git init code .
Windows (PowerShell)#
New-Item -ItemType Directory -Force $HOME\cline-test | Out-Null Set-Location $HOME\cline-test git init code .
Mac (Terminal)#
Same commands as Linux:
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:
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:
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".
| Part | Where data goes | What you can do |
|---|---|---|
| Prompts and project files | To 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 reporting | Events 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 flags | With telemetry off, Cline "still contacts its servers" to sign you in and check feature flags | Do not sign in or pick the Cline providers |
| A cloud provider you add | Your prompts and code go to that provider | Add one only on purpose |
Ollama cloud models (names ending :cloud) | Processed on Ollama's servers | Use local models, or set OLLAMA_NO_CLOUD=1 (Ollama FAQ) |
| Fetch web content, Web Search, MCP servers | Network requests to sites or tools | Leave them off unless needed |
| Commands Cline runs | They run on your computer with your permissions and can use the network | Read 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:11434by default (Ollama FAQ).OLLAMA_HOST=0.0.0.0opens 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. .clineignoreis 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:
ollama run qwen3:8b "Reply with the word ready."
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.
| Mistake | Why it happens | Do this instead |
|---|---|---|
| Choosing a model that cannot call tools | Cline needs tool calls to act. Issues #14453, #15255 and #10843 show Qwen 2.5 Coder via Ollama printing the tool call as text, or looping | Choose 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 big | Ollama'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 Ollama | Cline's source says Ollama's /v1 endpoint ignores num_ctx | Choose the Ollama provider |
| Putting another service between Cline and Ollama | Issue #15392 (closed): a timeout on 4.1.26 vanished once the reporter noticed Open WebUI sat in between | Point Cline at Ollama directly; add a proxy once it works |
| Following the docs' "Use Compact Prompt" step and not finding it | The 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 switches | If you do not see it, skip it. Use "Auto Compact" and short tasks |
| Turning on auto-approve or YOLO for speed | A 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 protection | Cline 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_LENGTH | Our assessment from the docs and source, not a test: assistants copy older setups. On the Ollama provider Cline sends the context with each request | Use the Ollama provider and the "Model Context Window" field; check each name at docs.cline.bot |
| AI assistants inventing settings keys or an extension id | Our assessment: the real id is saoudrizwan.claude-dev, and provider settings are written by the settings screen, not by a documented settings.json key | Use 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 psopen 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#
| Problem | Solution |
|---|---|
| Model list is empty | Make sure Ollama runs (ollama ps, or curl http://localhost:11434/api/tags), then type the model name yourself |
| Cline shows JSON instead of acting | The 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 message | Check PROCESSOR in ollama ps. On the CPU, lower the context or pick a smaller model |
| Timeout errors | Raise "Request Timeout (ms)", lower the context, remove any proxy between Cline and Ollama |
| Model forgets the project | The context is too small. Raise "Model Context Window" and check CONTEXT in ollama ps |
| Cline behaves differently after an update | Read 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:
code --install-extension [email protected]
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:
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:
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:
mkdir -p ~/restore-test && tar -xzf ~/backups/cline-rules-<date>.tar.gz -C ~/restore-test && ls -R ~/restore-test
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_PARALLELtimesOLLAMA_CONTEXT_LENGTH. Cline's estimates (model plus context): about 10 GB forqwen3:8bat 32K, about 23 GB forqwen3.8:27bat 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 psshows 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#
- Cline on GitHub (Apache 2.0) and release v4.1.26 - read October 2026
- Cline docs: installing, authorizing, local models, Desktop local models, auto approve, checkpoints, Plan and Act, config, deprecations, telemetry - read October 2026
- Cline source at v4.1.26: Ollama settings, Ollama provider, Features settings - read October 2026
- Cline on the VS Code Marketplace and Open VSX - read October 2026
- VS Code docs: extensions and command line - read October 2026
- Ollama: context length, FAQ, Windows, macOS, download, models qwen3, gpt-oss, devstral-small-2, qwen3.8 - read October 2026
- GitHub issues in cline/cline: #14453, #15255, #10843, #15275, #15392, #13371, #13008, #11022, #14812 - read October 2026
Checked against the official docs on 2026-10-31.