# Run Claude Code with a local Ollama model

> Connect Claude Code to a local model and verify a small coding task.

Page: https://videotomd.com/b/gqYyZuO34x0/
Tool: Ollama · Tags: claude-code, local-models · 446 words, about 580 tokens
Pills: free · Ollama · checked 2026-10-15 · Ollama · Any AI · file tools · shell · on demand · frontier · coding · starting out · building

## Recipe

- Kind: workflow
- Stage: starting out, building
- Loads: on demand
- Works in: Ollama, Any AI
- Needs: file tools, shell
- Bring: Ollama
- Cost: free
- Model: frontier
- Tested in: not yet
- Checked: 2026-10-15
- For: coding

## Similar
- [Ollama Modelfile and companion](https://videotomd.com/b/text-ollama-modelfile-companion/): Pick it when the local model keeps losing track of the repo, because it sets the context window on purpose and shows you how to check that it loaded.
- [Local-only mode](https://videotomd.com/b/text-local-only-mode/): Pick it when the point of going local is keeping code off the network, because it shows you how to check that from the logs and sockets instead of trusting the model picker.

## Put it here

Loads on demand: paste or attach it when the task comes up. To have it every session, put it where your tool reads instructions:

- Ollama: Put the text in a Modelfile as SYSTEM """...""" with FROM <model> and PARAMETER num_ctx <n>, then `ollama create <name> -f Modelfile` and run <name>. Chat-only: paste it as the first message instead. Reload: ollama create again. Check it loaded: `ollama show --modelfile <name>` prints the SYSTEM; `ollama ps` shows the loaded context size. Source: https://docs.ollama.com/modelfile (checked 2026-10-12).
- Any AI: Coding agent: save as AGENTS.md in the project root (read natively by Codex, Cursor, Copilot, Gemini CLI, Kiro, Devin, Cline, Roo, OpenHands, OpenCode, Goose, Amp, Zed, Warp, Junie, Factory and Jules; Claude Code when no CLAUDE.md exists; Aider with --read). Chat: paste it first. Reload: new session. Check it loaded: ask it to repeat one rule from the file. Source: https://agents.md/ (checked 2026-10-12).

## Access

Membership: plans at https://videotomd.com/pricing/, or email then a plan at https://videotomd.com/b/gqYyZuO34x0/. A member's browser downloads the file there; an AI without that session needs the member to attach it.
