# Run one checked Claude Code change with a local Ollama model

> A documentation-based guide to routing Claude Code to a local Ollama model, verifying the endpoint and context, then reviewing one repository change against its original check.

By BIG CHANGE Editorial

Published: 2026-10-20T11:36:37.990Z
Updated: 2026-10-20T11:36:37.990Z
Canonical: https://bigchange.ai/blog/claude-code-local-ollama-checked-change-guide

![Conceptual charcoal illustration of an open desktop workstation showing its fan, memory modules, graphics card and internal cables.](https://bigchange.ai/api/media/file/local-model-workstation-open-chassis-hero-v2.png)
AI-generated conceptual illustration by BIG CHANGE.

Claude Code can work on an owned repository through a model served by Ollama on your machine. Ollama's current [Claude Code integration](https://docs.ollama.com/integrations/claude-code) connects directly through its Anthropic-compatible API. This guide takes one bounded code change from a recorded baseline to a human decision about the diff. It is for a developer who can install both tools, authorize edits in the repository, and run a suitable local coding model. BIG CHANGE checked the manuals on 20 October 2026; we did not run the model or test a repository.

## The big change

- **What changed:** Ollama now documents a direct Claude Code route to its local Anthropic-compatible server, with a launcher or explicit local endpoint settings. A separate proxy is unnecessary for this documented setup.
- **Why it matters:** You can keep the Claude Code workflow while choosing a local model, checking its actual context allocation, and reviewing a real repository edit against the project's original acceptance check.
- **What to watch:** A selected local tag and a running model do not prove every request stayed local or that its code is correct. Check effective routing, tool access, the full diff and the check result before accepting the change.

### 1. Record the repository's starting point

Work in a Git repository you own or are authorized to change. Use a reviewable branch or disposable checkout. Name one small behavior or defect to change, the files it may affect and a stop condition. Find the repository's existing acceptance command, such as its documented test or build check; do not substitute a generic command. Run it **before** the agent edits anything and record the command, exit status and relevant output. Record the branch, `git status` and any existing diff too. Existing changes belong in your baseline, not in an AI result.

Confirm your organization's code and dependency policies permit the chosen model and tools. Claude Code may read files and run commands under its effective permission settings. A request to “touch only these files” guides the agent but does not confine its filesystem access.

### 2. Install a fitting local model and allocate context

Install a current [Ollama release](https://docs.ollama.com/quickstart) and [Claude Code CLI](https://code.claude.com/docs/en/setup) through their official instructions, subject to your machine and organization rules. Record `ollama --version` and `claude --version`. Ollama introduced Anthropic Messages compatibility in version 0.14.0 in January 2026; that date does **not** establish the minimum version for today's `ollama launch` command.

Choose a model whose current catalog entry shows tool support, whose license permits your use, and whose weights **and context allocation** fit your machine. One concrete local example is [qwen3-coder:30b](https://ollama.com/library/qwen3-coder:30b), listed with tools, a roughly 19 GB Q4\_K\_M artifact and Apache License 2.0. That is a download size, not a RAM or VRAM requirement. Its advertised model context does not mean your machine can allocate it. If this model does not fit, choose another documented tool-capable local tag and replace the tag consistently in the following commands.

From a terminal, after the Ollama app or local server is running, download and confirm the exact tag:

```text
ollama pull qwen3-coder:30b
ollama list
```

Ollama [recommends at least 64,000 tokens](https://docs.ollama.com/context-length) for coding agents and says a larger context uses more memory. Set 64k or more in the **existing Ollama app's settings**, if your hardware supports it. If you operate the server yourself, configure that existing service with `OLLAMA_CONTEXT_LENGTH=64000` using the [platform-specific server instructions](https://docs.ollama.com/context-length); do not start a second server on port 11434. After a model request loads, `ollama ps` shows its actual `CONTEXT` and `PROCESSOR`. Stop or reduce task scope and choose a fitting setup if the intended allocation cannot load. Do not report the catalog's maximum as the allocated context.

### 3. Route Claude Code to the local server

Open a terminal **in the chosen repository**. Ollama documents this launcher route; use the same local tag confirmed by `ollama list`:

```text
ollama launch claude --model qwen3-coder:30b
```

Ollama documents this non-Claude model route. [Anthropic's gateway manual](https://code.claude.com/docs/en/llm-gateway) says Anthropic does not support routing Claude Code to non-Claude models through a gateway. Treat this as an Ollama-documented integration without Anthropic support for that routing, and check the actual session before relying on it.

For a manual setup, Ollama's [integration instructions](https://docs.ollama.com/integrations/claude-code#manual-setup) instead use `ANTHROPIC_AUTH_TOKEN=ollama`, an explicitly empty `ANTHROPIC_API_KEY`, and `ANTHROPIC_BASE_URL=http://localhost:11434`. This optional **Bash** command sets all three for this Claude Code process only, from the owned repository directory; it does not change a global shell profile:

```bash
ANTHROPIC_AUTH_TOKEN=ollama ANTHROPIC_API_KEY="" ANTHROPIC_BASE_URL=http://localhost:11434 claude --model qwen3-coder:30b
```

For other shells, use the preferred Ollama launcher above or the current first-party manual's shell-specific setup. Inspect existing Claude Code settings that may override the command's variables. Do not print any pre-existing credential while checking settings. The expected effective readback is the chosen local tag and `http://localhost:11434`; that is a check for the reader to perform, not a result BIG CHANGE observed. The local server ignores the `ollama` placeholder token; it is not an access-control secret. The documented local route does not require an Ollama cloud key or an Anthropic inference key. Claude Code software terms and connected services still apply.

Keep the server bound locally under Ollama's [server configuration guidance](https://docs.ollama.com/faq). A `:cloud` tag or `https://ollama.com` base URL is a cloud route with a different data and cost decision. Pause before sending repository content if the model or destination is unclear.

### 4. Check the route, then request one edit

Before allowing file changes, inspect Claude Code's effective model and connection with `/status` where available. Compare that readback with the launcher or manual endpoint, `ollama list`, and, after a request loads the model, `ollama ps`. Record the exact loaded tag, allocated `CONTEXT` and `PROCESSOR`; a CPU split may change whether the workflow is practical. Where available, inspect the local server's request evidence as well. These checks establish configuration and model loading, not a complete audit of all network traffic. Review enabled MCP tools, web fetch/search, telemetry and any cloud settings separately if local handling matters to your code policy.

Use Claude Code's normal approval prompts and [permission controls](https://code.claude.com/docs/en/permissions). Ask for the single owned-repository task in ordinary language: identify the required behavior, allowed scope, original acceptance command and where to stop. Ask it to report changed files and check output. Keep commit, push and release decisions with the repository owner, and decline unexpected network or tool actions. A model's claim that it used the local endpoint or passed a check is not verification.

### 5. Decide from the full diff and the original check

Inspect every changed file and the **full Git diff**, including changes outside the requested scope. Compare the change with the original behavior and repository policy, including any new dependency's license. Run the same recorded acceptance command yourself after the edit. Record its exit status and relevant output alongside the baseline. Accept the change only when the diff matches the request, the independent check gives an acceptable result, and the routing and permissions evidence meets your requirements. Otherwise leave the branch unaccepted and retain the exact failure for review.

If Ollama cannot be reached, check the running app or service and `ollama list` before trying the coding task. If the model cannot load or `ollama ps` reports insufficient context, check memory and the context setting; use a smaller scoped task or a fitting local model. If `/status` or effective settings show a hosted provider, stop before sending code and repair the current shell or Claude Code settings. A tool-call error may come from model compatibility or a permission denial; inspect the exact response before changing either. If an attempt already edited files, inspect its diff before reverting or continuing. After a failed acceptance check, diagnose the code and rerun the check only after a reviewed correction.

Local inference avoids a provider's per-token inference charge for the downloaded model, but it uses hardware, storage and electricity. Downloads, telemetry, web tools, MCP integrations or cloud model settings may send data or incur other costs. Ollama supports a [subset of Anthropic's Messages API](https://docs.ollama.com/api/anthropic-compatibility), with limits on features including token counting, prompt caching, batches, citations, PDFs and forced tool choice; individual models also vary in tool ability. There is no measured speed, quality, privacy or savings result from BIG CHANGE's documentation review. For a different local-agent setup, see our [Junie Local guide](https://bigchange.ai/blog/junie-local-windows-coding-agent-setup); this procedure specifically retains Claude Code and checks its Ollama route.

## Sources & further reading

- [Ollama, “Claude Code”](https://docs.ollama.com/integrations/claude-code) gives the current launcher, manual local settings and cloud alternative. It documents a route, not a successful run in a reader's repository.
- [Ollama, “Anthropic compatibility”](https://docs.ollama.com/api/anthropic-compatibility) describes the local endpoint, ignored placeholder token, model pull and API feature limits. Compatibility does not certify every model or tool call.
- [Ollama, “Context length”](https://docs.ollama.com/context-length) explains the 64k coding recommendation, memory trade-off and `ollama ps` readback. The actual machine determines feasible allocation.
- [Ollama's qwen3-coder:30b entry](https://ollama.com/library/qwen3-coder:30b) lists the example artifact, tools and linked Apache 2.0 license. Recheck the exact model entry before downloading or redistributing it.
- [Claude Code installation](https://code.claude.com/docs/en/setup) and [permission settings](https://code.claude.com/docs/en/permissions) describe access and tool approvals. Neither proves a specific session's effective endpoint or safe repository outcome.
- [Anthropic, “Other LLM gateways”](https://code.claude.com/docs/en/llm-gateway) states that Anthropic does not support routing Claude Code to non-Claude models through a gateway. Ollama separately documents the local integration described here.

## Sources

- [Claude Code — Ollama](https://docs.ollama.com/integrations/claude-code) — Primary launcher and manual local endpoint instructions, plus separate cloud route. It does not prove a particular run used localhost.
- [Anthropic compatibility — Ollama](https://docs.ollama.com/api/anthropic-compatibility) — Local Messages endpoint, ignored token placeholder, model pull and unsupported features. Compatibility varies by model and tool.
- [Context length — Ollama](https://docs.ollama.com/context-length) — 64k coding recommendation, memory trade-off and ollama ps context/processor readback; no specific machine capacity certified.
- [qwen3-coder:30b — Ollama model library](https://ollama.com/library/qwen3-coder:30b) — Exact example local tag, tools, approximately 19 GB Q4_K_M artifact and Apache 2.0 license link; download size is not working-memory need.
- [Quickstart — Ollama](https://docs.ollama.com/quickstart) — Official installation/start path; reader must check current platform instructions and installed version.
- [FAQ — Ollama](https://docs.ollama.com/faq) — Local server configuration and network/cloud boundary; not a full privacy audit of Claude Code or integrations.
- [Claude Code support — Ollama](https://ollama.com/blog/claude) — Dates v0.14.0 Messages compatibility; does not establish the minimum version for the current launcher.
- [Advanced setup — Claude Code Docs](https://code.claude.com/docs/en/setup) — Official installation and platform requirements; no Claude Code instance was installed or run in reporting.
- [Configure permissions — Claude Code Docs](https://code.claude.com/docs/en/permissions) — Tool approval and effective permissions; a natural-language path instruction is not a sandbox.
- [Other LLM gateways — Claude Code Docs](https://code.claude.com/docs/en/llm-gateway) — Anthropic says it does not support routing Claude Code to non-Claude models through a gateway. This is the vendor-support boundary alongside Ollama's documented local integration, not a legal conclusion.
