Top 200 ReposEXPLORER
Browse agents, categories and pages
Back to results
Planned, not doneThe source describes an intention, not a finished result.

Run a Local Coding Assistant Through Ollama

Overview

Point Claude Code at a model served by Ollama on your own machine, through Ollama's Anthropic-compatible API, and use it for small coding tasks on a scratch branch.

Problem or Objective

More in Local and Self-Hosted AI

AI Agents and Models

Tools and Integrations

Tools
Claude Code · Ollama
Prerequisites
A computer with enough memory for the chosen local model, Ollama and Claude Code installed, and a Git repository with a scratch branch.

How It Works

Install Ollama and Claude Code, then pull a local model that supports tool calling. The quickest route is ollama launch claude, which starts Claude Code wired to Ollama. For a manual setup, set ANTHROPIC_BASE_URL to http://localhost:11434, ANTHROPIC_AUTH_TOKEN to ollama and ANTHROPIC_API_KEY to an empty value, then start claude with --model and the local model's name. Raise the model's context window to 64k or more for anything beyond a tiny repository. Open a throwaway branch, ask for a small change such as a new function with tests, approve each command through Claude Code's permission prompts, run the tests yourself, and read the diff before you decide to commit anything.

Implementation Workflow

Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.

  1. Choose the agentSet up Claude Code, Ollama.
  2. Connect the toolsConnect the tools this workflow relies on: Claude Code, Ollama.
  3. Check the prerequisitesA computer with enough memory for the chosen local model, Ollama and Claude Code installed, and a Git repository with a scratch branch.
  4. Gather your detailsCollect what the prompt asks for: Scratch branch to work on, The change you want, File to change, Command that runs the tests.
  5. Run the starter promptPaste the starter prompt below into Claude Code and adapt it to your case.
  6. Check against the documentationCompare what you get with the documentation at docs.ollama.com before you rely on it.

Practical Starter Prompt: Make one small change with a local model

Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].

Preview
Work only on the branch [Scratch branch to work on] in this repository. Add [The change you want] in [File to change], following the style of the surrounding code, and write tests for it with [Command that runs the tests]. Ask me before running any command or editing any file outside [File to change] and its test file. When you are done, show me the full diff and the test output, and do not commit: I will review the changes and decide whether to commit them.

Start Claude Code with ollama launch claude, or set the Ollama environment variables and pass --model. Approve commands one at a time in the permission prompts, read the diff, run the tests, and commit yourself only if you are happy with the result.

Expected Results and Benefits

This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.

This is a suggested workflow, not a reported outcome. Ollama's Claude Code page documents the launch command, the environment variables for a local server, tool calling with compatible models, and the advice on context length. The Ollama README lists Claude Code among its integrations. Neither page measures code quality, speed or what hardware a given model needs, so how useful a local model is for your project is something to test.

Limitations and Considerations

Ollama's page says that for larger repositories the context length should be 64k or higher, and that tools work only with compatible models, so pick a model that supports tool calling. Claude Code still asks for permission on most actions; keep those prompts on rather than skipping them, and commit only after you have reviewed the diff and run the tests. Claude settings can override shell variables, so if Claude Code still reaches the wrong endpoint, check those settings and run /status. Local models need enough memory and a capable GPU or CPU: check the model's size against your machine before pulling it. Results depend on your setup and were not independently reproduced by Top 200 Repos.

GitHub Repositories

AI Agent Repository

Source code of the agent that does the work.

Official Website

The official site of the main tool or project in this use case.

Visit Website (opens in a new tab)ollama.com

Related Videos

About ollama/ollama

About ollama/ollama

About anthropics/claude-code

Independent creators. Listing a video implies no endorsement, sponsorship or partnership.

Sources

  1. Claude Code - Ollama (opens in a new tab)

    Project documentation · docs.ollama.com · Undated · Source checked 27 Nov 2026, 06:57 UTC

    What this source supports
    • Ollama connects Claude Code to local and cloud models through its Anthropic-compatible API.
    • Choose a model and set a 64k+ context window.
    • For larger repositories, set the context length to 64k or higher.
    • Claude settings can override shell variables.
  2. ollama/ollama README (opens in a new tab)

    Project documentation · github.com · Undated · Source checked 27 Nov 2026, 06:57 UTC

    What this source supports
    • Start building with open models. Access the latest releases locally or in the cloud with complete privacy.
Report a problem

More with Claude Code

Planned, not done

Create Custom Store Tools Instead of Paying for Subscriptions

Use Claude Code to write small in-house tools for an online shop, such as a reply helper for support mail or a margin report, as an alternative to paying for separate apps, with testing before you rely on them.

code.claude.comanthropics/claude-code
Reported by source

Answer technical questions by letting async agents run experiments

Simon Willison sends research questions to cloud coding agents such as Claude Code for web and Codex Cloud, which write and run experiments in a dedicated repo and open a PR.

simonwillison.net · 6 Nov 2025anthropics/claude-code, openai/codex
Planned, not done

Structure Repeated Browser Research Into Evidence Tables

Give Claude Code the open-source Browser Use CLI with a local browser, ask the same research questions across a short list of pages, and keep every answer as a sourced table row.

github.comanthropics/claude-code, browser-use/browser-use

View all: Claude Code