Claude Code with Ollama: local GPT-OSS 20B setup

Learn to connect Claude Code to Ollama on Windows, choose a model for your hardware, and set a 32K context before generating repository documentation.

Player not loading? Watch on YouTube

This tutorial connects Claude Code to a local LLM through Ollama, using GPT-OSS 20B on Windows. The presenter explains that Ollama supports the Anthropic API used by Claude Code and describes the resulting setup as free, private, and usable offline. Those are the presenter's claims about this configuration.

The walkthrough starts with installing Ollama through PowerShell, then considers GPU VRAM or Apple unified memory when choosing a model. The presenter uses Can I Run AI to compare hardware estimates and warns that offloading work to CPU and RAM can slow responses. He also explains that the displayed model memory estimate excludes context, so a model that fits still needs room for the session.

After downloading GPT-OSS 20B, he sets Ollama's context length to 32K based on his measurements and tests it with a question about retrieval augmented generation. He then installs Claude Code and launches it through Ollama with the downloaded model. An unrecognized-model notice appears; he explains that it reflects the custom model selection.

The coding assistant test asks for Markdown documentation of a .NET MCP server repository. The presenter shows a generated README with connection strings and request and response examples. He also reports unrelated answers when context was too small, making context capacity a practical setup concern rather than a universal 32K recommendation.