One‑Line Magic: Using Claude Code Through Ollama

Published: (February 1, 2026 at 05:52 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Cover image for One‑Line Magic: Using Claude Code Through Ollama

Requirements

  • Ollama v0.15+ (you must have pulled a model via ollama pull)

Launching Claude Code

Run the launch command to see the available AI coding agents:

ollama launch

You will be prompted to select an integration:

Select integration: 
  > claude - Claude Code (gpt-oss:20b)
    clawdbot - Clawdbot
    codex - Codex
    droid - Droid
    opencode - OpenCode

Selecting the Claude Code model

Choose the model you want to use with Claude Code (the example below uses gpt-oss:20b):

ollama launch

Output:

Launching Claude Code with gpt-oss:20b...

╭─── Claude Code v2.1.29 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                    │ Tips for getting started                                                                           │
│                 Welcome back baxin!                │ Run /init to create a CLAUDE.md file with instructions for Claude                                  │
│                                                    │ ─────────────────────────────────────────────────────────────────                                  │
│                                                    │ Recent activity                                                                                    │
│                       ▐▛███▜▌                      │ No recent activity                                                                                 │
│                      ▝▜█████▛▘                     │                                                                                                    │
│                        ▘▘ ▝▝                       │                                                                                                    │
│     gpt-oss:20b · API Usage Billing · baxin’s      │                                                                                                    │
│     Individual Org                                 │                                                                                                    │
│               ~\Desktop\dev\zenn-dev               │                                                                                                    │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

‼ Auth conflict: Both a token (ANTHROPIC_AUTH_TOKEN) and an API key (/login managed key) are set. This may lead to unexpected behavior.
  • Trying to use ANTHROPIC_AUTH_TOKEN? `claude /logout`
  • Trying to use /login managed key? Unset the ANTHROPIC_AUTH_TOKEN environment variable.

 /model to try Opus 4.5

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> Try "how does  work?"
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ? for shortcuts

You can now interact with Claude Code using the selected model.

Back to Blog

Related posts

Read more »