Claude Code experience. Local models. Zero API costs.
Run a full-featured coding agent CLI against Ollama, LM Studio, or any OpenAI-compatible endpoint — entirely on your machine, with your own models.
Built on top of claw-code-parity, a clean-room Rust reimplementation of the Claude Code harness.
Claw Code Local patches the claw CLI to use any LLM provider, not just Anthropic. The upstream project built a full multi-provider API layer but never wired it into the actual binary — it was hardcoded to require Anthropic credentials. We fixed that, along with a streaming render bug that caused terminal output to smash sections together.
What you get:
- Interactive REPL with session persistence, slash commands, markdown rendering
- Tool use: file read/write/edit, grep, glob, bash execution, git integration
/commit,/diff,/pr,/review,/mcp,/agents,/skillsand 130+ slash commands- Works with any model your hardware can run
- Sessions auto-save and can be resumed
- Rust toolchain (1.70+)
- Ollama running locally (or any OpenAI-compatible endpoint)
- A model pulled in Ollama (e.g.
ollama pull qwen3:14b)
git clone https://github.com/codetwentyfive/claw-code-local.git
cd claw-code-local/rust
cargo build -p rusty-claude-cli --releaseThe binary is at rust/target/release/claw.exe (Windows) or rust/target/release/claw (Linux/macOS).
Set two environment variables. The API key value doesn't matter for Ollama — it just needs to be non-empty.
Bash / Zsh:
export OPENAI_API_KEY=ollama
export OPENAI_BASE_URL=http://localhost:11434/v1PowerShell (add to $PROFILE):
$env:OPENAI_API_KEY = "ollama"
$env:OPENAI_BASE_URL = "http://localhost:11434/v1"Optionally add the binary to your PATH for global access.
# Interactive REPL
claw --model qwen3:14b
# One-shot prompt
claw --model qwen3:14b "explain this codebase"
# Switch models mid-session with /model
/model qwen3.5-35b-uncensored:iq3m
# Resume your last session
claw --resume latestThe CLI auto-detects the provider from the model name and environment variables:
| Provider | Models | Env vars |
|---|---|---|
| Ollama | Any model you've pulled | OPENAI_API_KEY=ollama OPENAI_BASE_URL=http://localhost:11434/v1 |
| LM Studio | Any loaded model | OPENAI_API_KEY=lmstudio OPENAI_BASE_URL=http://localhost:1234/v1 |
| OpenAI | gpt-4o, o1, etc. | OPENAI_API_KEY=sk-... |
| xAI (Grok) | grok-3, grok-3-mini | XAI_API_KEY=xai-... |
| Anthropic | claude-opus, sonnet, haiku | ANTHROPIC_API_KEY=sk-ant-... |
| Any OpenAI-compatible | Depends on provider | OPENAI_API_KEY=... OPENAI_BASE_URL=https://... |
Two patches, both original:
-
Multi-provider CLI wiring — The
apicrate already hadProviderClientwith OpenAI-compat and xAI support, but the CLI hardcodedAnthropicClientand always required Anthropic credentials. We swapped it toProviderClient::from_model_with_anthropic_auth()so the provider is auto-detected from the model name and env vars. -
Streaming markdown render fix —
render_markdown()calledtrim_end()which stripped trailing newlines. In streaming mode each chunk is rendered independently, so block separators (between tables, headings, paragraphs) got eaten and everything ran together on one line. Added a streaming-safe render path that preserves block spacing.
This is a fork of ultraworkers/claw-code-parity, which is itself a clean-room Rust reimplementation of Claude Code's agent harness — not a copy of Anthropic's source code. See the upstream README and PARITY.md for the full porting status.
To sync with upstream:
git fetch upstream
git merge upstream/mainMIT — same as upstream.