Claude Code + Ollama: local coding agent setup

Learn to connect Claude Code to Ollama with Qwen3-Coder, configure the local endpoint, and understand the recommended 64,000-token context window.

Player not loading? Watch on YouTube

This tutorial explains how to connect Claude Code to Ollama so a local LLM handles coding requests. The speaker attributes compatibility with Anthropic's Messages API to Ollama 0.14.0, released in January 2026. The walkthrough covers Claude Code installation on macOS, Linux and Windows, followed by Ollama installation and a Qwen3-Coder download.

The connection uses an authentication token set to Ollama and a base URL of http://localhost:11434. Claude Code then starts with claude --model qwen3-coder. The speaker says Ollama recommends a context window of at least 64,000 tokens and warns that a smaller setting can cause interrupted tasks or lost context.

The speaker suggests Qwen3-Coder and GPT-OSS-20B for local use. The tutorial also names GLM-4.7:cloud and Minimax-M-2.1:cloud as remote options. Those choices use cloud inference rather than running on the viewer's hardware.

The speaker presents private code work and offline use after downloading models as reasons for this setup. Hardware remains a constraint: local inference uses the computer's memory and processor, and the tutorial gives no exact RAM requirement. It recommends starting with a function explanation or unit test. A final section describes /loop for recurring prompts, using pull request summaries every 30 minutes as an example.