Can you use Claude Code for free? With Ollama, a free model runs on your own PC and Claude Code talks to it instead of Anthropic's servers. On my 16-core laptop with no graphics card, it fixed a one-line bug in 6 minutes, once auto mode was off. On a 2-core machine it never finished. ⏱️ Chapters 0:00 Intro 0:27 Install Ollama 0:56 How fast is it? 1:35 Claude Code on a local model 2:08 Does it work? 3:15 Is it worth it? 💻 The commands (Windows, PowerShell) 1. Install Ollama: download OllamaSetup.exe from https://ollama.com/download/windows (no admin rights needed), or run: irm https://ollama.com/install.ps1 | iex 2. Get a model that can use tools: ollama pull qwen3.5:4b 3. Speed test: ollama run qwen3.5:4b --verbose "In two sentences, why should a small business back up its files?" 4. Give it the context Ollama recommends for Claude Code, then restart Ollama: [Environment]::SetEnvironmentVariable("OLLAMA_CONTEXT_LENGTH", "65536", "User") 5. Start Claude Code on the local model: ollama launch claude --model qwen3.5:4b 6. Switch to manual mode before your first request: press Shift+Tab until the status bar says "manual mode on", or start it with: ollama launch claude --model qwen3.5:4b -- --permission-mode default. If it asks "Make auto mode your default permission mode?", pick No, keep manual mode. ⚙️ Settings that mattered Auto mode asks the model to vet every command first. The local model took over a minute to answer, so every run was blocked and Claude guessed the result (wrongly). Manual mode asked me instead, and the fix was checked. Slow PC? Claude Code drops a silent request after a few minutes. These raise its limits (PowerShell, before step 5): $env:CLAUDE_STREAM_IDLE_TIMEOUT_MS = "1800000" $env:CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS = "1800000" Built-in graphics: Ollama skips them by default. Its log names the setting: OLLAMA_IGPU_ENABLE=1 (I didn't test it). 📊 What I measured Gemma 3 1B (806 MB, no tools): 7.65 tokens/s on 2 cores, 44.84 on 16 cores Qwen 3.5 4B (3.3 GB, tools): 2.43 tokens/s on 2 cores, 12.30 on 16 cores; a two-sentence answer took 6:54 vs 1:14, because it thinks first Claude Code sends about 14,500 tokens of instructions per request. 2 cores read them at 9.6 tokens/s (about 25 minutes); the laptop took 3 min 11 s. Qwen 3.5 at a 64K context: 5.7 GB of memory. The model ran on the laptop's processor (Intel Core Ultra 9 285H); the screen recording is from a Windows virtual machine. ⚠️ Anthropic says it doesn't support Claude Code with non-Claude models, so you're on your own if something breaks. 📚 Sources Ollama on Windows: https://docs.ollama.com/windows Ollama with Claude Code: https://docs.ollama.com/integrations/claude-code Context length: https://docs.ollama.com/context-length Claude Code environment variables: https://code.claude.com/docs/en/env-vars Claude Code permission modes: https://code.claude.com/docs/en/permission-modes More from me: https://khadim.tech Khadim Labs tests AI tools on real tasks, for people who want results without writing code. #ClaudeCode #Ollama #LocalAI
The information provided is not trading advice. kdj.com does not assume any responsibility for any investments made based on the information provided in this article. Cryptocurrencies are highly volatile and it is highly recommended that you invest with caution after thorough research!
If you believe that the content used on this website infringes your copyright, please contact us immediately (info@kdj.com) and we will delete it promptly.