docs/integrations/claude-code.mdx
Claude Code is Anthropic's agentic coding tool that can read, modify, and execute code in your working directory.
Open models can be used with Claude Code through Ollama's Anthropic-compatible API, enabling you to use models such as qwen3.5, glm-5:cloud, kimi-k2.5:cloud.
Install Claude Code:
<CodeGroup>curl -fsSL https://claude.ai/install.sh | bash
irm https://claude.ai/install.ps1 | iex
ollama launch claude
ollama launch claude --model kimi-k2.5:cloud
kimi-k2.5:cloudglm-5:cloudminimax-m2.7:cloudqwen3.5:cloudglm-4.7-flashqwen3.5Cloud models are also available at ollama.com/search?c=cloud.
Run Claude Code without interaction for use in Docker, CI/CD, or scripts:
ollama launch claude --model kimi-k2.5:cloud --yes -- -p "how does this repository work?"
The --yes flag auto-pulls the model, skips selectors, and requires --model to be specified. Arguments after -- are passed directly to Claude Code.
Claude Code can search the web through Ollama's web search API. See the web search documentation for setup and usage.
/loopThe /loop command runs a prompt or slash command on a recurring schedule inside Claude Code. This is useful for automating repetitive tasks like checking PRs, running research, or setting reminders.
/loop <interval> <prompt or /command>
Check in on your PRs
/loop 30m Check my open PRs and summarize their status
Automate research tasks
/loop 1h Research the latest AI news and summarize key developments
Automate bug reporting and triaging
/loop 15m Check for new GitHub issues and triage by priority
Set reminders
/loop 1h Remind me to review the deploy status
Chat with Claude Code from Telegram by connecting a bot to your session. Install the Telegram plugin, create a bot via @BotFather, then launch with the channel flag:
ollama launch claude -- --channels plugin:telegram@claude-plugins-official
Claude Code will prompt for permission on most actions. To allow the bot to work autonomously, configure permission rules or pass --dangerously-skip-permissions in isolated environments.
See the plugin README for full setup instructions including pairing and access control.
Claude Code connects to Ollama using the Anthropic-compatible API.
export ANTHROPIC_AUTH_TOKEN=ollama
export ANTHROPIC_API_KEY=""
export ANTHROPIC_BASE_URL=http://localhost:11434
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 glm-5:cloud
Note: Claude Code requires a large context window. We recommend at least 64k tokens. See the context length documentation for how to adjust context length in Ollama.