Skip to content

Ollama Docs, Revised

Claude Code

Task page. 5 changes, 5 questions for the owner. Audit: improved. Original source at commit 318ee28.

Revised

Claude Code reads your codebase, edits files, and runs commands.

Ollama connects Claude Code to local and cloud models through its Anthropic-compatible API.?1

Get started

Launch Claude Code with Ollama:

ollama launch claude

Capabilities

1- Chat: Ask questions about a repository or task

  • Command line: Run commands with Claude Code's permission flow
  • Tool calling: Use tools with compatible models
  • File edits: Read and edit files in your project
  • Subagents: Split work across tasks
  • Web search: Search the web through Ollama
  • Web fetch: Fetch and summarize web pages
  • Vision: Send images and screenshots
  • Thinking: Use thinking controls with compatible models

Models

Choose a model with enough context for your repository.

Note: For larger repositories, set the context length to 64k or higher.

More features

Run without interaction

Use --yes for scripts, Docker, or CI:

ollama launch claude --model gemma4:cloud --yes -- -p "how does this repository work?"

The --yes flag skips selectors, pulls the model when needed, and requires --model. Arguments after -- are passed directly to Claude Code.

Use Ollama's web search API from Claude Code.

See Web search for setup and usage.

Scheduled tasks with /loop

Use /loop inside Claude Code to run a prompt or slash command on a schedule:

/loop <interval> <prompt or /command>

Examples:

/loop 30m Check my open PRs and summarize their status
/loop 1h Research the latest AI news and summarize key developments
/loop 15m Check for new GitHub issues and triage by priority

Telegram

Connect a Telegram bot to your Claude Code session.

  1. 2Install the Telegram plugin.
  2. Create a bot with @BotFather.
  3. Launch Claude Code:
ollama launch claude -- --channels plugin:telegram@claude-plugins-official

Claude Code prompts for permission on most actions. To allow the bot to work autonomously, configure permission rules or pass --dangerously-skip-permissions in an isolated environment.

See the plugin README for setup instructions.

Connect directly to Ollama's cloudX9

Install Claude Code, then set your API key in OLLAMA_API_KEY. No Ollama installation required.

In Bash or Zsh, run:X6

ANTHROPIC_BASE_URL=https://ollama.com \
ANTHROPIC_AUTH_TOKEN="$OLLAMA_API_KEY" \
ANTHROPIC_API_KEY="" \
claude --model glm-5.3-flash

Use ANTHROPIC_AUTH_TOKEN for bearer authentication. Claude settings can override shell variables. Update any base URL or credentials in those settings, then run /status to check the connection.

Choose a cloud model that supports tools. Basic chat and file edits work with compatible models. Hosted WebSearch and advanced tool controls aren't3 fully supported.?2 See Anthropic compatibility.

Manual setup

41. Install Claude Code

5On macOS or Linux:

curl -fsSL https://claude.ai/install.sh | bash

On Windows:

irm https://claude.ai/install.ps1 | iex

2. Set the environment variables

export ANTHROPIC_AUTH_TOKEN=ollama
export ANTHROPIC_API_KEY=""
export ANTHROPIC_BASE_URL=http://localhost:11434

3. Run Claude Code

claude --model qwen3.5

Or run with environment variables inline:?3

ANTHROPIC_AUTH_TOKEN=ollama ANTHROPIC_BASE_URL=http://localhost:11434 ANTHROPIC_API_KEY="" claude --model kimi-k2.7-code:cloud

Notes on this page

  1. 1 Structure Audit: improved The page held raw JSX markup with empty icons; the nine capabilities are now a bullet list with the same names and descriptions.

    Was: <div className="capability-list capability-list-full"> ... Chat / Ask questions about a repository or task ... Thinking / Use thinking controls with compatible models ... </div>

    list-parallel-items-only

    Auditor: The nine capabilities are easier to scan as a plain list, with their names and descriptions preserved.

  2. 2 Structure Audit: improved One sentence held three actions in order, so they are now three numbered steps; the links and the command are unchanged.

    Was: Install the Telegram plugin, create a bot with @BotFather, then launch Claude Code:

    proc-one-action-per-step list-numbered-for-sequence

    Auditor: Numbered steps make the Telegram setup sequence easier to follow, and each step has one action.

  3. 3 Wording Audit: improved Use the contraction "aren't".

    Was: are not

    Contractions

    Auditor: “Aren’t” is a plain contraction that keeps the original meaning.

  4. 4 Structure Audit: improved The three step titles were raw HTML paragraphs; they are now numbered headings with the same text.

    Was: <p className="manual-step-title">1. Install Claude Code</p> (and steps 2 and 3)

    proc-imperative

    Auditor: Numbered headings make the three manual setup steps easier to find.

  5. 5 Structure Audit: improved The tab labels on the two code fences became a sentence before each block and plain language labels on the fences; the commands are unchanged.

    Was: shell macOS / Linux andpowershell Windows

    proc-substeps-branch-only

    Auditor: Plain language labels make clear which installation command applies to macOS or Linux and which applies to Windows.

Questions for the owner

  • ?1 This page mixes a task (launch, direct cloud, manual setup) with reference (capabilities, features); should the capability list move to its own page, or is one page intended?

    About: “Ollama connects Claude Code to local and cloud models through its Anthropic-compatible API.”

  • ?2 The Capabilities list says Claude Code can search the web through Ollama, while this sentence says hosted WebSearch is not fully supported; which statement applies to which setup?

    About: “Hosted WebSearch and advanced tool controls aren't fully supported.”

  • ?3 How should the reader confirm that Claude Code is using the Ollama model after manual setup (the direct cloud section names /status; should this one too)?

    About: “Or run with environment variables inline:”

  • X6 Anthropic compatibility setup omits ANTHROPIC_API_KEY. The Claude Code page sets ANTHROPIC_API_KEY to an empty string in its local and cloud setups, but the Anthropic compatibility page's environment variables for Claude Code leave it out. Is clearing ANTHROPIC_API_KEY required for Claude Code, and if so should the Anthropic compatibility page include it?

    Pages: Anthropic compatibility, Claude Code

  • X9 Anchor to Claude Code direct-cloud section does not match the heading. Two pages link to #connect-directly-to-ollama-cloud, but the Claude Code heading is "Connect directly to Ollama's cloud", whose generated slug includes "ollamas". Should the heading get an explicit anchor id, or should both links be updated to the generated slug?

    Pages: Quickstart, Anthropic compatibility, Claude Code

Original

Claude Code reads your codebase, edits files, and runs commands.

Ollama connects Claude Code to local and cloud models through its Anthropic-compatible API.

Get started

Launch Claude Code with Ollama:

ollama launch claude

Capabilities

Chat Ask questions about a repository or task

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">Command line</div>
    <div className="capability-list-copy">Run commands with Claude Code's permission flow</div>
  </div>
</div>

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">Tool calling</div>
    <div className="capability-list-copy">Use tools with compatible models</div>
  </div>
</div>

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">File edits</div>
    <div className="capability-list-copy">Read and edit files in your project</div>
  </div>
</div>

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">Subagents</div>
    <div className="capability-list-copy">Split work across tasks</div>
  </div>
</div>

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">Web search</div>
    <div className="capability-list-copy">Search the web through Ollama</div>
  </div>
</div>

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">Web fetch</div>
    <div className="capability-list-copy">Fetch and summarize web pages</div>
  </div>
</div>

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">Vision</div>
    <div className="capability-list-copy">Send images and screenshots</div>
  </div>
</div>

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">Thinking</div>
    <div className="capability-list-copy">Use thinking controls with compatible models</div>
  </div>
</div>

Models

Choose a model with enough context for your repository.

Note: For larger repositories, set the context length to 64k or higher.

More features

Run without interaction

Use --yes for scripts, Docker, or CI:

ollama launch claude --model gemma4:cloud --yes -- -p "how does this repository work?"

The --yes flag skips selectors, pulls the model when needed, and requires --model. Arguments after -- are passed directly to Claude Code.

Use Ollama's web search API from Claude Code.

See Web search for setup and usage.

Scheduled tasks with /loop

Use /loop inside Claude Code to run a prompt or slash command on a schedule:

/loop <interval> <prompt or /command>

Examples:

/loop 30m Check my open PRs and summarize their status
/loop 1h Research the latest AI news and summarize key developments
/loop 15m Check for new GitHub issues and triage by priority

Telegram

Connect a Telegram bot to your Claude Code session. Install the Telegram plugin, create a bot with @BotFather, then launch Claude Code:

ollama launch claude -- --channels plugin:telegram@claude-plugins-official

Claude Code prompts for permission on most actions. To allow the bot to work autonomously, configure permission rules or pass --dangerously-skip-permissions in an isolated environment.

See the plugin README for setup instructions.

Connect directly to Ollama's cloud

Install Claude Code, then set your API key in OLLAMA_API_KEY. No Ollama installation required.

In Bash or Zsh, run:

ANTHROPIC_BASE_URL=https://ollama.com \
ANTHROPIC_AUTH_TOKEN="$OLLAMA_API_KEY" \
ANTHROPIC_API_KEY="" \
claude --model glm-5.3-flash

Use ANTHROPIC_AUTH_TOKEN for bearer authentication. Claude settings can override shell variables. Update any base URL or credentials in those settings, then run /status to check the connection.

Choose a cloud model that supports tools. Basic chat and file edits work with compatible models. Hosted WebSearch and advanced tool controls are not fully supported. See Anthropic compatibility.

Manual setup

1. Install Claude Code

curl -fsSL https://claude.ai/install.sh | bash
irm https://claude.ai/install.ps1 | iex

2. Set the environment variables

export ANTHROPIC_AUTH_TOKEN=ollama
export ANTHROPIC_API_KEY=""
export ANTHROPIC_BASE_URL=http://localhost:11434

3. Run Claude Code

claude --model qwen3.5

Or run with environment variables inline:

ANTHROPIC_AUTH_TOKEN=ollama ANTHROPIC_BASE_URL=http://localhost:11434 ANTHROPIC_API_KEY="" claude --model kimi-k2.7-code:cloud

What Changed

Raw interface markup became plain Markdown: the capability grid is now a bullet list, the Telegram sentence is now numbered steps, and the manual setup steps are headings with labeled code blocks. One contraction was fixed. Code blocks and links are unchanged; questions cover the page's several goals, a conflict about web search, a missing confirmation, and the two inventory items.

Content type: task. The page's main job is to get a reader running Claude Code on Ollama, through ollama launch claude, a direct cloud setup, or manual setup.

Automated check, original: 0 errors, 0 warnings, 1 suggestions. Revised: 0 errors, 2 warnings, 0 suggestions.

Independent audit (GPT-6): improved. The revision is easier to scan: it turns the capability markup into a list and makes the Telegram and manual setup steps clearer. The logged changes preserve the instructions and link targets; I found no unlisted change of meaning.

Structure (4)

  • 1 The page held raw JSX markup with empty icons; the nine capabilities are now a bullet list with the same names and descriptions. improved
  • 2 One sentence held three actions in order, so they are now three numbered steps; the links and the command are unchanged. improved
  • 4 The three step titles were raw HTML paragraphs; they are now numbered headings with the same text. improved
  • 5 The tab labels on the two code fences became a sentence before each block and plain language labels on the fences; the commands are unchanged. improved

Wording (1)

  • 3 Use the contraction "aren't". improved