One‑Line Magic: Using Claude Code Through Ollama

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyrinNew
    Senior Member
    • Feb 2024
    • 5168

    #1

    One‑Line Magic: Using Claude Code Through Ollama

    requirements

    • Ollama v0.15+
    • You have pulled a model via ollama pull


    ollama launch is a new command which sets up and runs coding tools like Claude Code, OpenCode, and Codex with local or cloud models. No environment variables or config files needed.



    Run ollama launch

    launch commands allow us to use a few AI coding agents.

    Claude Code, Clawdbot(Openclaw), Codex, Droid, and OpenCode.






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






    Then you will need to select a model you want use for Claude Code. (In this article, I used gpt-oss:20b model)





    ollama launch

    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






    OpenCode











    How to Use Claude Opus 4.5 & Gemini 3 for Free with OpenCode

    0xkoji ・ Jan 13

    #ai
    #opencode
    #llm
    #programming












    More...
Working...