Install Ollama
Open a terminal and run the command for your system. You can also download the installer from ollama.com.
irm https://ollama.com/install.ps1 | iex
curl -fsSL https://ollama.com/install.sh | sh
Download a model and test it
This downloads Google’s Gemma 4 and opens a chat in your terminal. Type a message to check it works, then /bye to exit. Smaller models run on a normal laptop; bigger ones need more memory.
ollama run gemma4
Install Claude Code
Skip this if you already have it. Then check it works with claude --version.
irm https://claude.ai/install.ps1 | iex
curl -fsSL https://claude.ai/install.sh | bash
Connect Claude Code to Ollama
One command. Ollama starts Claude Code and points it at your model through its Anthropic-compatible API.
ollama launch claude
Prefer doing it by hand? Set these, then start Claude Code with your model (example from Ollama’s docs):
Manual setup (optional)
macOS / Linux shell. On Windows PowerShell use $env:ANTHROPIC_AUTH_TOKEN="ollama" and so on.
export ANTHROPIC_AUTH_TOKEN=ollama export ANTHROPIC_API_KEY="" export ANTHROPIC_BASE_URL=http://localhost:11434 claude --model qwen3.5
Give the model enough context
For coding tools, Ollama recommends a context window of at least 64,000 tokens so the model can keep your project in mind. In the Ollama app, use the context length slider in Settings, or start the server like this. Bigger context uses more memory; check with ollama ps.
OLLAMA_CONTEXT_LENGTH=64000 ollama serve
📄 Get the PDF guide
Enter your email and download the printable version. You’ll also get new guides when they come out. Unsubscribe anytime.