Guides · 2026-10-13
Run Claude Code or OpenCode against a local server on your Mac
Point Claude Code and OpenCode at oMLX, Ollama or any OpenAI-compatible local server running Qwen3.6.
Researched and drafted with AI assistance from the cited sources. Benchmarks are single-machine third-party results: treat them as indicative, not guaranteed.
Options
Local-capable coding agents include OpenCode, Aider, Continue.dev, Zed, Cline, Qwen Code, Pi, Hermes and OpenClaw. Cursor accepts a custom base URL, but some of its features still go through the cloud. Claude Code can run locally via ollama launch claude or through oMLX’s Anthropic-compatible /v1/messages endpoint.
Claude Code + Ollama
ollama launch claude
Community guides describe this launcher. Make sure a capable model such as Qwen3.6 is pulled and that you’ve set a sensible context (not the 262k default).
Claude Code + oMLX
oMLX serves the Anthropic Messages API on http://localhost:8000. Claude Code reads its endpoint from environment variables:
export ANTHROPIC_BASE_URL=http://localhost:8000
export ANTHROPIC_AUTH_TOKEN=local # any value, unless you set an API key in oMLX
claude
Pick the model in oMLX’s admin UI (/admin), or pass the model ID oMLX shows. Check the oMLX README for the current recommended Claude Code settings.
OpenCode + any OpenAI-compatible server
OpenCode accepts custom providers in opencode.json. Point it at oMLX (http://localhost:8000/v1), Ollama (http://localhost:11434/v1) or mlx_lm.server:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"local": {
"npm": "@ai-sdk/openai-compatible",
"name": "Local (oMLX)",
"options": { "baseURL": "http://localhost:8000/v1" },
"models": { "<model-id>": { "name": "Qwen3.6 local" } }
}
}
}
Make it fast
Agent system prompts are long, and prefill is the main bottleneck on M1–M4. Use a server with prompt and KV caching (oMLX), keep tool lists lean, and see the troubleshooting tree.
Sources
Skip the trial and error: sourced config packs →
Get the weekly Mac local-AI digest
New models, tool updates, and sourced configs. Free. Unsubscribe anytime.
Launching soon. Follow along via RSS in the meantime.