// Blog
Blog
In-depth articles, tutorials and guides on software engineering topics.
// Blog
Blog
In-depth articles, tutorials and guides on software engineering topics.
TL;DR: Install Claude Code with irm https://claude.ai/install.ps1 | iex, install Ollama with irm https://ollama.com/install.ps1 | iex, pick a model that fits your RAM, then run ollama launch claude. You pay $0, but a local model is slower and has a smaller context than Claude's hosted models.
The honest part first. Claude Code is not included in the free Claude plan. Pro costs $20 a month, or $17 a month billed yearly ($200 up front), and there is no free trial for individual plans. The Claude Code tool is a free download; the model behind it is what you pay for. This guide swaps that model for a free local one running in Ollama on your own PC.
Open PowerShell (not CMD) and run the official installer, then open a new terminal and check that the claude command works.
Claude Code needs Windows 10 version 1809 or newer, at least 4 GB of RAM, and an x64 or ARM64 processor. Windows 11 meets the version requirement.
irm https://claude.ai/install.ps1 | iexClose the terminal, open a new one, and check the version:
claude --versionYou should see a version number, for example 2.1.211 (Claude Code). If you see claude : The term 'claude' is not recognized as the name of a cmdlet, use the PATH fix in Troubleshooting.
Do not use Windows PowerShell (x86). It fails with Claude Code does not support 32-bit Windows.
The npm route needs Node.js 22 or later. The latest LTS is v26.13.0.
npm install -g @anthropic-ai/claude-codeIf PowerShell says npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system., allow signed scripts for your user and run the install again:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserYou can also run npm.cmd instead of npm. The PowerShell installer above is not affected by this.
Install Ollama for Windows with one PowerShell line, or download the installer from ollama.com.
irm https://ollama.com/install.ps1 | iexPrefer a manual install? Download OllamaSetup.exe and run it.
http://localhost:11434.ollama launch needs Ollama v0.15 or newer. The latest release is v0.40.14 (2026-11-03).Pick the tier that matches your RAM. The sizes below are download sizes, not exact memory needs, so treat these tiers as a rule of thumb.
| Your RAM | Model tag | Download | Context | Notes |
|---|---|---|---|---|
| 8–16 GB | qwen3.5:9b | 6.6 GB | 256K | Supports tools. On an 8 GB machine, use qwen3.5:4b (3.3 GB). |
| 18–32 GB | glm-4.7-flash | 19 GB | 198K | Tools and thinking. Recommended by Ollama for ollama launch. Ollama says it needs about 23 GB of VRAM at a 64k context. |
| 64 GB+ | qwen3-coder:30b-a3b-q8_0 | 32 GB | 256K | Supports tools. Leaves room for a bigger context. |
Rule of thumb: if it feels slow, step down a tier.
Run ollama launch claude. It lets you pick a model, then starts Claude Code wired to your local Ollama.
ollama launch claudeThree flags help:
--model <name> skips the model picker.--yes skips the selectors and downloads the model if you need it. It requires --model.--config sets things up without launching Claude Code.ollama launch claude --model qwen3.5:9b --yesYou can also point Claude Code at Ollama yourself. Set three variables in PowerShell, then start Claude Code with your model. Ollama's docs show these as VAR=value; the $env: lines are the PowerShell spelling.
$env:ANTHROPIC_AUTH_TOKEN="ollama"
$env:ANTHROPIC_API_KEY=""
$env:ANTHROPIC_BASE_URL="http://localhost:11434"
claude --model qwen3.5:9bYour Claude settings can override these shell variables. Inside Claude Code, run /status and check that the base URL is http://localhost:11434.
Open a small project and ask Claude Code a question about it, then check speed and context length, because a local model is slower and smaller than Claude's hosted models.
ollama launch claude --model qwen3.5:9b --yes -- -p "how does this repository work?"Everything after -- is passed straight to Claude Code.
A local model is slower. Run ollama ps and look at the PROCESSOR column. You want it to say 100% GPU. If part of the model runs on the CPU, it slows down.
Ollama sets the default context by VRAM: under 24 GiB you get 4k, from 24 to 48 GiB you get 32k, and at 48 GiB or more you get 256k. For Claude Code, Ollama recommends 64k or more.
Raise it with the context slider in the Ollama app, or start the server with a bigger context:
$env:OLLAMA_CONTEXT_LENGTH="64000"; ollama serveA bigger context uses more memory, so run ollama ps again and check the CONTEXT and PROCESSOR columns.
This is not Opus. Claude Opus 5.5 has a 1 million token context; the local tags above top out between 128K and 256K. Hosted web search and some advanced tool controls are not fully supported through Ollama.
Some model tags end in :cloud, for example gemma4:cloud. Those run on Ollama's cloud and are paid: pay per token, or Pro at $20 a month ($200 a year), or Max at $100 a month. Stick to local tags to keep this at $0.
What it is good for: learning Claude Code itself (the commands, the workflow, the habits), asking questions about your own code, and deciding with real practice whether Pro is worth it for you.
You are in CMD, not PowerShell. Open PowerShell and run the installer again. To stay in CMD, use the CMD installer instead:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdThe installer puts claude.exe in %USERPROFILE%\.local\bin, and that folder is missing from your PATH. Add it in PowerShell, then restart the terminal:
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')Run claude doctor for read-only installation and settings diagnostics.
This is PowerShell's execution policy, and it only affects the npm route. Run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, use npm.cmd, or switch to the PowerShell installer.
You opened Windows PowerShell (x86). Open the normal 64-bit Windows PowerShell. To check your system, run [Environment]::Is64BitOperatingSystem.
Ollama's Windows docs list NVIDIA driver 551.61 or newer. Update your driver, restart Ollama, and check ollama ps for 100% GPU.
OpenCode is another terminal coding agent. It offers some free models, such as GLM-5.3-Flash Free and Big Pickle, but its docs say they are free on OpenCode for a limited time. Some of those free models may use your data to improve the model; turn them off with OPENCODE_DISABLE_FREE_MODELS=1.
On Windows, OpenCode recommends WSL. Install it with:
npm install -g opencode-aiOllama's launch command supports OpenCode too.
All checked on 2026-11-04.
Want explainer videos like the one for this guide? The explainer-video agent builds them with Claude Code: browse the AI agents.
New step-by-step guides and coding tutorials, straight to your inbox.
Written by
AamerSoftware engineer and creator of Prograamer — practical tutorials on AI tools, AWS, web development, and career growth for software engineers.
Detailed comparison of Claude AI vs ChatGPT for software developers in 2026: coding capabilities, context windows, pricing, and which AI assistant you should choose.
Read moreComplete Claude AI pricing guide for 2026: Free tier ($0), Pro ($20/mo), Max ($100-200/mo), Team ($25-150/seat), Enterprise (custom), and API per-token costs compared.
Read moreLearn every way to use Claude AI for free in 2026: free tier features, Claude Code access, Pro trial, Guest Passes, and the best free alternatives for developers.
Read more