How to run Claude Code free on Windows with a local Ollama model

Set up Claude Code on Windows 10 or 11 and point it at a local model served by Ollama, so you can write and run code without a subscription or API key. It suits anyone with a modest GPU or a fast CPU who wants a private coding agent.

Claude Code with Ollama: Free Local Setup on Windows (No Subscription, No API Key), by Laxmi Kant | KGP Talkie on YouTube. 12 min 46 s.

17 chapters. Tap a step to jump to it.Chapters from the creator
Video length
12 min 46 s
Time to do it
30 minutes
Difficulty
Medium
Steps
10

What you need

Steps

  1. Open PowerShell and run ollama --version. You need version 0.15 or newer for the launch command. If it is older, download the latest installer from the Ollama site and run it.

  2. Raise the context length to 64k in the Ollama settings. Claude Code sends about 25,000 tokens before you type anything, so a short context will cut off your session.

  3. Pull a model that fits your hardware. A 24 GB graphics card runs qwen3.8:27b at 64k context. Smaller cards can use Gemma 4 12B or Qwen 3.5 4B, and a CPU-only machine works with a small model, just slowly.

  4. Install Claude Code by letting ollama launch handle it, or run the install script in PowerShell with irm piped into iex. The download is about 250 MB and needs no admin rights.

  5. Create or open an empty project folder in PowerShell. This folder is where Claude Code will read and write files, so keep it separate from important work.

  6. Run ollama launch claude. Pick your local model from the list, for example qwen3.8:27b, and avoid the cloud options if you want everything to stay on your machine.

  7. On first start, choose a text style, read the security notes and accept the prompt to trust the folder. The yellow model note and the API Usage Billing line are expected with a local model.

  8. Give it a first task, such as writing expenses.py that adds up a few amounts. Approve each permission request, then let it run the script and show the totals.

  9. Run ollama ps in a second PowerShell window to confirm the model is loaded. You want to see 100% GPU and a 65536 context if your card supports it.

  10. Ask for a change, like reading a CSV file and printing a text bar chart. Check the files it edits, use /clear between tasks and /exit when you are done.

Tips and common mistakes

Always read the code before you approve a permission request, since the agent can write files and run commands.

Type /clear between unrelated tasks so the context does not fill up with old work.

If a step fails, let the automatic retry run once before you change anything.

The manual route sets three environment variables instead of using ollama launch, which helps if the one-command setup fails.

Questions

Do I need an Anthropic account or API key?

No. Ollama serves the model locally and ollama launch claude connects Claude Code to it, so there is no subscription and no key.

Can I run this without a graphics card?

Yes, but pick a small model and expect slow responses. A 24 GB card is what makes a 27B model at 64k context comfortable.

Why does it say API Usage Billing?

That line appears in the Claude Code interface by default. With a local Ollama model you are not billed, since nothing is sent to Anthropic.

This guide was drafted from the video's details and general task knowledge. It has not been checked against the full video. Check the video and relevant product instructions before following a procedure. Report a correction.

More in Computers & Phones

See all